+ Changed from MySQL to MySQLi native driver.
+ Added 2 new functions in DataBase class: fetch($query) and num_rows($query) git-svn-id: https://svn.pioder.pl/uf-svn/uF@20 72ec579a-5ced-4fa4-82f3-afba5d98df2f
This commit is contained in:
@@ -19,7 +19,7 @@ class Forum
|
||||
$forum = Topic::TopicInformation($tid,'f_id');
|
||||
$all='';
|
||||
$query = DataBase::sql_query("SELECT `name`, `f_id` FROM `".FORUMS_TABLE."` ORDER BY `f_id`",'GENERAL','Could not obtain forum information');
|
||||
while($t = @mysql_fetch_array($query))
|
||||
while($t = DataBase::fetch($query))
|
||||
{
|
||||
|
||||
if ($t['f_id']==$forum)
|
||||
@@ -39,7 +39,7 @@ class Forum
|
||||
{
|
||||
$sql = "SELECT count(*) as `p_id` FROM ".POSTS_TABLE." WHERE f_id='$forum_name'";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain posts information.');
|
||||
$result = mysql_fetch_array($query);
|
||||
$result = DataBase::fetch($query);
|
||||
return $result['p_id'];
|
||||
}
|
||||
|
||||
@@ -47,17 +47,18 @@ class Forum
|
||||
{
|
||||
global $lng;
|
||||
global $user;
|
||||
global $last_post;
|
||||
global $lastpost;
|
||||
global $userdata;
|
||||
global $forum_config;
|
||||
if ($posts==0) { return '<p align="center" class="fstandard">'.$lng['nopost'].'</p>';}
|
||||
else
|
||||
{
|
||||
$id = $last_post[$forum]['tp_id'];
|
||||
$topic = $last_post[$forum]['t_id'];
|
||||
$userid = $last_post[$forum]['u_id'];
|
||||
$un = $last_post[$forum]['user_nick'];
|
||||
$rank = $last_post[$forum]['user_rank'];
|
||||
$id = $lastpost[0];
|
||||
$userid = $lastpost[1];
|
||||
$topic = $lastpost[2];
|
||||
$rank = $lastpost[4];
|
||||
$un = $lastpost[5];
|
||||
|
||||
switch($rank)
|
||||
{
|
||||
case '0':
|
||||
@@ -93,13 +94,13 @@ class Forum
|
||||
{
|
||||
$page='';
|
||||
}
|
||||
return '<p align="center"><span class="fverysmall"><b>'.GenerateTime($last_post[$forum]['time']).'</b><br></span> <a href="topic.php?t='.$topic.$page.'#p'.$id.'" class="fverysmall"><b>'.$lng['topic'].' #'.$topic.'</b></a><a class="fsmall">: </a><a href="user.php?id='.$userid.'" class="fverysmall">'.$user_color_name.'</a></p>';
|
||||
return '<p align="center"><span class="fverysmall"><b>'.GenerateTime($lastpost[3]).'</b><br></span> <a href="topic.php?t='.$topic.$page.'#p'.$id.'" class="fverysmall"><b>'.$lng['topic'].' #'.$topic.'</b></a><a class="fsmall">: </a><a href="user.php?id='.$userid.'" class="fverysmall">'.$user_color_name.'</a></p>';
|
||||
}
|
||||
}
|
||||
|
||||
function LastPostImg($postsinforum)
|
||||
{
|
||||
global $last_post;
|
||||
global $lastpost;
|
||||
global $i;
|
||||
global $forum;
|
||||
global $default_skin;
|
||||
@@ -108,7 +109,7 @@ class Forum
|
||||
{
|
||||
if ($postsinforum>0)
|
||||
{
|
||||
if ($last_post[$forum[$i]['f_id']]['time']>$time)
|
||||
if ($lastpost[3]>$time)
|
||||
{
|
||||
return 'folder_new_posts';
|
||||
}
|
||||
@@ -132,7 +133,7 @@ class Forum
|
||||
{
|
||||
$sql = "SELECT `f_id`, `$inf` FROM ".FORUMS_TABLE." WHERE f_id='$fid';";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain forum information.');
|
||||
$result = mysql_fetch_array($query);
|
||||
$result = DataBase::fetch($query);
|
||||
$result = $result[$inf];
|
||||
return $result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user