// #########################################################################
// MySQL Class - Coded by Steekarlkani!
// #########################################################################
class mysql {
public $connect;
public function OPEN_MYSQL()
{
$this->connect = mysql_connect(MySQLhostname, MySQLusername, MySQLpassword)or die (mysql_error());
mysql_select_db(MySQLdb, $this->connect)or die (mysql_error());
}
public function FetchSITESetting($strSetting)
{
$query = mysql_query("SELECT * FROM cms_settings");
$row = mysql_fetch_assoc($query);
}
public function HoloHash($password)
{
$hash_secret = "xCg532%@%gdvf^5DGaa6&*rFTfg^FD4\$OIFThrR_gh(ugf*/";
$string = sha1($password.($hash_secret));
}
public function HoloHashMD5($password)
{
$hash_secret = "xCg532%@%gdvf^5DGaa6&*rFTfg^FD4\$OIFThrR_gh(ugf*/";
$string = md5($password.($hash_secret));
}
public function Eingeloggt_Bleiben($username)
{
if(isset($_SESSION["username"]) && $_COOKIE["remember"] == "remember")
{
$cname = $this->FilterText($_COOKIE["rusername"]);
$cpass_hash = $this->FilterText($_COOKIE["rpassword"]);
$csql = mysql_query("SELECT password, id FROM users WHERE username = '".$this->FilterText($cname)."' LIMIT 1")or die (mysql_error());
if(mysql_num_rows($csql) < 1)
{
setcookie("remember", "", time()-60*60*24*100, "/"); setcookie("cookpass", "", time()-60*60*24*100, "/");
setcookie("rusername", "", time()-60*60*24*100, "/"); setcookie("cookpass", "", time()-60*60*24*100, "/");
setcookie("rpassword", "", time()-60*60*24*100, "/"); setcookie("cookpass", "", time()-60*60*24*100, "/");
}
else
{
$crow = mysql_fetch_assoc($csql);
if($cpass_hash = $correct_pass)
{
$_SESSION["username"] = $cname;
$_SESSION["password"] = $crow["password"];
header("location:me");
}
else
{
setcookie("remember", "", time()-60*60*24*100, "/"); setcookie("cookpass", "", time()-60*60*24*100, "/");
setcookie("rusername", "", time()-60*60*24*100, "/"); setcookie("cookpass", "", time()-60*60*24*100, "/");
setcookie("rpassword", "", time()-60*60*24*100, "/"); setcookie("cookpass", "", time()-60*60*24*100, "/");
}
}
}
}
public function IsEven($intNumber)
{
if($intNumber % 2 == 0){
return true;
} else {
return false;
}
} public function bbcode_format($str)
{
$str = str_replace(":)", " <img src='./web-gallery/smilies/smile.gif' alt='Smiley' title='Smiley' border='0'> ", $str);
$str = str_replace(";)", " <img src='./web-gallery/smilies/wink.gif' alt='Smiley' title='Smiley' border='0'> ", $str);
$str = str_replace(":P", " <img src='./web-gallery/smilies/tongue.gif' alt='Smiley' title='Smiley' border='0'> ", $str);
$str = str_replace(";P", " <img src='./web-gallery/smilies/winktongue.gif' alt='Smiley' title='Smiley' border='0'> ", $str);
$str = str_replace(":p", " <img src='./web-gallery/smilies/tongue.gif' alt='Smiley' title='Smiley' border='0'> ", $str);
$str = str_replace(";p", " <img src='./web-gallery/smilies/winktongue.gif' alt='Smiley' title='Smiley' border='0'> ", $str);
$str = str_replace("(L)", " <img src='./web-gallery/smilies/heart.gif' alt='Smiley' title='Smiley' border='0'> ", $str);
$str = str_replace("(l)", " <img src='./web-gallery/smilies/heart.gif' alt='Smiley' title='Smiley' border='0'> ", $str);
$str = str_replace(":o", " <img src='./web-gallery/smilies/shocked.gif' alt='Smiley' title='Smiley' border='0'> ", $str);
$str = str_replace(":O", " <img src='./web-gallery/smilies/shocked.gif' alt='Smiley' title='Smiley' border='0'> ", $str);
$simple_search = array( '/\[b\](.*?)\[\/b\]/is','/\[i\](.*?)\[\/i\]/is','/\[u\](.*?)\[\/u\]/is','/\[s\](.*?)\[\/s\]/is','/\[quote\](.*?)\[\/quote\]/is','/\[link\=(.*?)\](.*?)\[\/link\]/is','/\[url\=(.*?)\](.*?)\[\/url\]/is','/\[color\=(.*?)\](.*?)\[\/color\]/is','/\[size=small\](.*?)\[\/size\]/is','/\[size=large\](.*?)\[\/size\]/is','/\[code\](.*?)\[\/code\]/is','/\[habbo\=(.*?)\](.*?)\[\/habbo\]/is','/\[room\=(.*?)\](.*?)\[\/room\]/is','/\[group\=(.*?)\](.*?)\[\/group\]/is');
$simple_replace = array('<strong>$1</strong>','<em>$1</em>','<u>$1</u>','<s>$1</s>',"<div class='bbcode-quote'>$1</div>","<a href='$1'>$2</a>","<a href='$1'>$2</a>","<font color='$1'>$2</font>","<font size='1'>$1</font>","<font size='3'>$1</font>",'<pre>$1</pre>',"<a href='./user_profile.php?id=$1'>$2</a>","<a onclick=\"roomForward(this, '$1', 'private'); return false;\" target=\"client\" href=\"./client.php?forwardId=2&roomId=$1\">$2</a>","<a href='./group_profile.php?id=$1'>$2</a>");
$str = preg_replace ($simple_search, $simple_replace, $str);
}
public function GenerateTicket()
{
$data = "ST-";
for ($i=1; $i<=6; $i++){
$data = $data . rand(0,9);
}
$data = $data . "-";
for ($i=1; $i<=20; $i++){
$data = $data . rand(0,9);
}
$data = $data . "-habbore-beta-fe";
$data = $data . rand(0,5);
}
public function Login($username)
{
$rawname = $_SESSION["username"];
$rawpass = $_SESSION["password"];
$usersql = mysql_query("SELECT * FROM users WHERE username = '".$this->FilterText($rawname)."' AND password = '".$this->FilterText($rawpass)."' LIMIT 1");
$myrow = mysql_fetch_assoc($usersql);
$userinfo = mysql_query("SELECT * FROM user_stats WHERE id = '".$this->FilterText($myrow["id"])."'")or die (mysql_error());
$userinfo = mysql_fetch_assoc($userinfo);
$my_id = $this->FilterText($myrow["id"]);
$user_rank = $this->FilterText($myrow["rank"]);
$ban = mysql_query("SELECT * FROM bans WHERE value = '".$this->FilterText($myrow['username'])."' AND bantype = 'user' or value = '".$this->FilterText($remote_ip)."' AND bantype = 'ip' LIMIT 1");
$bancheck = mysql_num_rows($ban);
if($bancheck > 0)
{
$bandata = mysql_fetch_assoc($ban);
$timestamp = time();
if($bandata['expire'] > $timestamp)
{
$login_error = "Du bist gebannt! Der Grund für deinen Bann lautet \"".$this->HoloText($bandata['reason'])."\" und dauert bis ".date('d.m.Y - H:i:s', $this->HoloText($bandata['expire']))."";
include('logout.php');
session_destroy();
}
else
{
mysql_query("DELETE FROM bans WHERE value = '".$this->FilterText($name)."' AND bantype = 'user' or value = '".$this->FilterText($remote_ip)."' AND bantype = 'ip' LIMIT 1"); }
}
}
}
Alles anzeigen
Liebe Grüsse Steekarlkani.