+ 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:
8
includes/cache/cache_forums.php
vendored
8
includes/cache/cache_forums.php
vendored
@@ -14,7 +14,7 @@ if(!defined('IN_uF'))
|
||||
//cache forums and posts - version v1.0 Alpha 2---------------------------------
|
||||
$default_skin = ViewSkinName();
|
||||
$sql = "SELECT `name`,`lock` FROM ".FORUMS_TABLE." WHERE `f_id`='$fid' LIMIT 1";
|
||||
$result = @mysql_fetch_array(DataBase::sql_query($sql,'GENERAL','Could not obtain forum information'));
|
||||
$result = DataBase::fetch(DataBase::sql_query($sql,'GENERAL','Could not obtain forum information'));
|
||||
if ($result['name']=='')
|
||||
{
|
||||
message_forum($lng['no_forum'],'index.php');
|
||||
@@ -25,13 +25,13 @@ $forum = array(
|
||||
);
|
||||
$sql = "SELECT COUNT(*) as `p_id`, `t_id` FROM ".POSTS_TABLE." GROUP BY `t_id`";
|
||||
$query = DataBase::sql_query($sql,'GENERAL', 'Could not obtain amout of posts in forum');
|
||||
while($result = @mysql_fetch_array($query))
|
||||
while($result = DataBase::fetch($query))
|
||||
{
|
||||
$count_topic[$result['t_id']]=$result['p_id'];
|
||||
}
|
||||
/*$sql = "SELECT ".POSTS_TABLE.".*, ".USERS_TABLE.".* FROM ".POSTS_TABLE." LEFT JOIN ".USERS_TABLE." ON ".USERS_TABLE.".u_id = ".POSTS_TABLE.".u_id WHERE `f_id`='$fid' ORDER BY `ptime`";
|
||||
$query = DataBase::sql_query($sql,'GENERAL', 'Could not obtain amout of posts in forum');
|
||||
while($result = @mysql_fetch_array($query))
|
||||
while($result = DataBase::fetch($query))
|
||||
{
|
||||
$lastpost[$result['t_id']]['tp_id']=$result['tp_id'];
|
||||
$lastpost[$result['t_id']]['u_id']=$result['u_id'];
|
||||
@@ -65,7 +65,7 @@ else
|
||||
$limit = 'LIMIT 0, '.$limiter;
|
||||
$page=1;
|
||||
}
|
||||
$count = @mysql_fetch_array(DataBase::sql_query("SELECT COUNT(`t_id`) as `t_id`
|
||||
$count = DataBase::fetch(DataBase::sql_query("SELECT COUNT(`t_id`) as `t_id`
|
||||
FROM ".TOPICS_TABLE." WHERE `f_id`='$fid'",'GENERAL','Could not obtain count amout of topics'));
|
||||
$count = $count['t_id'];
|
||||
$count = ceil($count / $limiter);
|
||||
|
||||
Reference in New Issue
Block a user