PConnect($DBHOST, $DBUSER, $DBPASSWORD, $DBNAME); @mysql_query("SET NAMES 'UTF8'"); $sql = "SELECT * from config"; $rsc = $conn->Execute($sql); if($rsc){while(!$rsc->EOF) { $field = $rsc->fields['setting']; $config[$field] = $rsc->fields['value']; STemplate::assign($field, strip_mq_gpc($config[$field])); @$rsc->MoveNext(); }} if ($_REQUEST['language'] != "") { if ($_REQUEST['language'] == "english") { $_SESSION['language'] = "english"; } elseif ($_REQUEST['language'] == "spanish") { $_SESSION['language'] = "spanish"; } elseif ($_REQUEST['language'] == "french") { $_SESSION['language'] = "french"; } elseif ($_REQUEST['language'] == "portugese") { $_SESSION['language'] = "portugese"; } } if ($_SESSION['language'] == "") { $_SESSION['language'] = $default_language; } if ($_SESSION['language'] == "english") { include("lang/english.php"); } elseif ($_SESSION['language'] == "spanish") { include("lang/spanish.php"); } elseif ($_SESSION['language'] == "french") { include("lang/french.php"); } elseif ($_SESSION['language'] == "portugese") { include("lang/portugese.php"); } else { include("lang/".$default_language.".php"); } for ($i=0; $iexecute($sql); setcookie('slrememberme', gzcompress(serialize(array($_SESSION[USERNAME], $key)), 9), time()+60*60*24*30); } function destroy_slrememberme($username) { if (strlen($username) > 0) { global $conn; $sql="update members set remember_me_time=NULL, remember_me_key=NULL WHERE username='".mysql_real_escape_string($username)."'"; $conn->execute($sql); } setcookie ("slrememberme", "", time() - 3600); } if (!isset($_SESSION["USERNAME"]) && isset($_COOKIE['slrememberme'])) { $sql="update members set remember_me_time=NULL and remember_me_key=NULL WHERE remember_me_time<'".date('Y-m-d H:i:s', mktime(0, 0, 0, date("m")-1, date("d"), date("Y")))."'"; $conn->execute($sql); list($username, $key) = @unserialize(gzuncompress(stripslashes($_COOKIE['slrememberme']))); if (strlen($username) > 0 && strlen($key) > 0) { $sql="SELECT status,USERID,email,username,verified from members WHERE username='".mysql_real_escape_string($username)."' and remember_me_key='".mysql_real_escape_string($key)."'"; $rs=$conn->execute($sql); if($rs->recordcount()<1) { $error=$lang['392']; } elseif($rs->fields['status'] == "0") { $error = $lang['393']; } if($error=="") { $_SESSION['USERID']=$rs->fields['USERID']; $_SESSION['EMAIL']=$rs->fields['email']; $_SESSION['USERNAME']=$rs->fields['username']; $_SESSION['VERIFIED']=$rs->fields['verified']; create_slrememberme(); } else { destroy_slrememberme($username); } } } function cleanit($text) { return strip_tags(stripslashes($text)); } $lsql="DELETE FROM ips WHERE date_added!='".date("Y-m-d")."'"; $conn->execute($lsql); if($sban != "1") { $bquery = "SELECT count(*) as total from bans_ips WHERE ip='".mysql_real_escape_string($_SERVER['REMOTE_ADDR'])."'"; $bresult = $conn->execute($bquery); $bcount = $bresult->fields['total']; if($bcount > "0") { $brdr = $config['baseurl']."/banned.php"; header("Location:$brdr"); exit; } } ?>