+ Changed generating last post and post count in forum and topic.php

+ Deleted not used template file: post_add_body.tpl
+ Replaced MCP images

git-svn-id: https://svn.pioder.pl/uf-svn/uF@21 72ec579a-5ced-4fa4-82f3-afba5d98df2f
This commit is contained in:
pioder
2009-05-03 21:00:21 +00:00
parent b1f37b6ea5
commit c2ba3eb804
70 changed files with 371 additions and 395 deletions

View File

@@ -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 = DataBase::fetch(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');
@@ -23,14 +23,14 @@ $forum = array(
'name'=>$result['name'],
'lock'=>$result['lock']
);
$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');
/*$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 = 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');
$query = DataBase::sql_query($sql,GENERAL, 'Could not obtain amout of posts in forum');
while($result = DataBase::fetch($query))
{
$lastpost[$result['t_id']]['tp_id']=$result['tp_id'];
@@ -66,7 +66,7 @@ else
$page=1;
}
$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'));
FROM ".TOPICS_TABLE." WHERE `f_id`='$fid'",GENERAL,'Could not obtain count amout of topics'));
$count = $count['t_id'];
$count = ceil($count / $limiter);
if ($count==0)

View File

@@ -18,7 +18,7 @@ if(!defined('IN_uF'))
//cache forums --don't modify!!!
$cache_id=1;
$sql = "SELECT ".FORUMS_TABLE.".*, COUNT(".POSTS_TABLE.".p_id) as amout, ".POSTS_TABLE.".f_id AS count FROM ".FORUMS_TABLE." LEFT JOIN ".POSTS_TABLE." ON ".FORUMS_TABLE.".f_id= ".POSTS_TABLE.".f_id GROUP BY `f_id` ORDER BY `c_id`, `sort`";
$query = DataBase::sql_query($sql,'CRITICAL','Could not obtain forum information.');
$query = DataBase::sql_query($sql,CRITICAL,'Could not obtain forum information.');
while($result = DataBase::fetch($query))
{
$forum[$cache_id]['f_id'] = $result['f_id'];
@@ -31,7 +31,7 @@ while($result = DataBase::fetch($query))
$cache_id+=1;
}
$sql = "SELECT `u_id`,`nick`, `regdate` AS count FROM ".USERS_TABLE." ORDER BY `regdate` DESC";
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain amout of count users information');
$query = DataBase::sql_query($sql,GENERAL,'Could not obtain amout of count users information');
$lastuser = DataBase::fetch($query);
$count_users = DataBase::num_rows($query) -1;
?>

View File

@@ -13,7 +13,7 @@ if(!defined('IN_uF'))
}
//||topic.php script cache ------------------------------------------------------------------------------
$sql = "SELECT ".TOPICS_TABLE.".*, ".TOPICS_TABLE.".name AS topic_name, ".TOPICS_TABLE.".lock AS topic_lock, ".FORUMS_TABLE.".* FROM ".TOPICS_TABLE." LEFT JOIN ".FORUMS_TABLE." ON ".TOPICS_TABLE.".f_id = ".FORUMS_TABLE.".f_id WHERE `t_id`='$tid' LIMIT 1";
$result = DataBase::fetch(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['t_id']=='')
{
message_forum($lng['no_topic'], 'index.php');
@@ -29,7 +29,7 @@ $forum['moderate']=$result['moderate'];
$sql = "SELECT `u_id`,`value` FROM `".WARNINGS_TABLE."`";
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain user warns information');
$query = DataBase::sql_query($sql,GENERAL,'Could not obtain user warns information');
$result = DataBase::num_rows($query);
while ($result = DataBase::fetch($query))
{
@@ -49,7 +49,7 @@ while ($result = DataBase::fetch($query))
//check online for user
$sql = "SELECT `s_id`, `u_id`, `time` FROM ".SESSIONS_TABLE." WHERE time+1250>".time();
$query = DataBase::sql_query($sql, 'GENERAL', 'Could not read user active.');
$query = DataBase::sql_query($sql, GENERAL, 'Could not read user active.');
while($result = DataBase::fetch($query))
{
$user[$result['u_id']]['online']='1';
@@ -82,7 +82,7 @@ else
$page=1;
}
$count = DataBase::fetch(DataBase::sql_query("SELECT COUNT(`p_id`) as `p_id`
FROM ".POSTS_TABLE." WHERE `t_id`='$tid'",'GENERAL','Could not obtain count amout of posts'));
FROM ".POSTS_TABLE." WHERE `t_id`='$tid'",GENERAL,'Could not obtain count amout of posts'));
$count = $count['p_id'];
$count = ceil($count / $limiter);
if(isset($_GET['page']) && ($_GET['page']>$count))