$tmp=DataBase::fetch(DataBase::sql_query("SELECT `name`, `desc` FROM `".FORUMS_TABLE."` WHERE `f_id`='$fid'",GENERAL,'Could not obtain forum information'));
$sql="SELECT ".TOPICS_TABLE.".*, ".USERS_TABLE.".*, ".TOPICS_TABLE.".posts AS `postcount`, ".TOPICS_TABLE.".lastpost AS `topic_lastpost` FROM ".TOPICS_TABLE." LEFT JOIN ".USERS_TABLE." ON ".TOPICS_TABLE.".author = ".USERS_TABLE.".u_id WHERE f_id='$fid' ORDER BY `sticky` DESC, `lastpost_time` DESC $limit;";
$query=DataBase::sql_query($sql,GENERAL,'Could not obtain topics information');
$sql="INSERT INTO ".SESSIONS_TABLE." VALUES ('', '".$_COOKIE[SESS_NAME]."','$uid','$time')";
$query=DataBase::sql_query($sql,GENERAL,'Could not add new session.',true);
if(DataBase::num_rows($query)>0)
@ -73,7 +73,7 @@ function SessRegister()
functionSessDeleteOld()
{
$time=time();
$time=$_SERVER['REQUEST_TIME'];
$sql="DELETE FROM ".SESSIONS_TABLE." WHERE time+129600<$time;";
DataBase::sql_query($sql,GENERAL,'Could not delete session',true);
}
@ -96,7 +96,7 @@ function SessDelInvalid()
functionSessDelete($uid)
{
$time=time();
$time=$_SERVER['REQUEST_TIME'];
$sql="DELETE FROM ".SESSIONS_TABLE." WHERE u_id='$uid'";
$query=DataBase::sql_query($sql,GENERAL,'Could not delete session',true);
if(DataBase::num_rows($query)>0)
@ -113,7 +113,7 @@ function SessView()
global$user;
global$forum_config;
$name='';
$time=time();
$time=$_SERVER['REQUEST_TIME'];
$sql="SELECT ".SESSIONS_TABLE.".*, ".USERS_TABLE.".*, ".SESSIONS_TABLE.".u_id AS u_id FROM ".SESSIONS_TABLE." LEFT JOIN ".USERS_TABLE." ON ".SESSIONS_TABLE.".u_id = ".USERS_TABLE.".u_id WHERE time+1250>$time;";
$query=DataBase::sql_query($sql,GENERAL,'Could not obtain sessions information.');
DataBase::sql_query($sql[$i],'ERROR','Error of SQL Query: '.$sql[$i].' Error with install script!');
}
DataBase::sql_query("UPDATE `".$_POST['mysql_prefix']."config` SET `value`='".time()."' WHERE `name`='date_install'",GENERAL,'Could not update date install information');
DataBase::sql_query("UPDATE `".$_POST['mysql_prefix']."config` SET `value`='".$_SERVER['REQUEST_TIME']."' WHERE `name`='date_install'",GENERAL,'Could not update date install information');
DataBase::sql_query("UPDATE `".$_POST['mysql_prefix']."config` SET `value`='".$patch."' WHERE `name`='forumpatch'",GENERAL,'Could not update date install information');
@ -145,7 +145,7 @@ if ((isset($_POST['keywords'])) || ($_GET['content']=='lastposts') || ($_GET['co
$sql="SELECT ".TOPICS_TABLE.".*, ".USERS_TABLE.".* FROM ".TOPICS_TABLE." LEFT JOIN ".USERS_TABLE." ON ".TOPICS_TABLE.".author = ".USERS_TABLE.".u_id WHERE `u_id`='".intval($_GET['u'])."' ORDER BY `sticky` DESC, `lastpost_time` DESC $limit;";
$sql="SELECT ".POSTS_TABLE.".*, ".USERS_TABLE.".*, ".USERS_TABLE.".u_id AS user_id,".SESSIONS_TABLE.".* FROM `".POSTS_TABLE."` LEFT JOIN ".USERS_TABLE." ON ".USERS_TABLE.".u_id = ".POSTS_TABLE.".u_id LEFT JOIN ".SESSIONS_TABLE." ON ".SESSIONS_TABLE.".u_id = ".POSTS_TABLE.".u_id WHERE t_id='$tid' ORDER BY tp_id $limit;";
$query=DataBase::sql_query($sql,CRITICAL,'Could not obtain post information.');