* @link http://www.pioder.pl/ * @license see LICENSE.txt **/ if ( !defined('IN_uF') ) { die('Hacking attempt'); } class Forum { function AddForums($tid) { global $forum_config; $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 = DataBase::fetch($query)) { if ($t['f_id']==$forum) { $all .= ''."\n"; } else { $all .= ''."\n"; } } return $all; unset($t, $all); } function PostsInForum($forum_name) { $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 = DataBase::fetch($query); return $result['p_id']; } function LastPost($posts, $forum) { global $lng; global $user; global $lastpost; global $userdata; global $forum_config; if ($posts==0) { return '
'.$lng['nopost'].'
';} else { $id = $lastpost[0]; $userid = $lastpost[1]; $topic = $lastpost[2]; $rank = $lastpost[4]; $un = $lastpost[5]; switch($rank) { case '0': { $user_color_name = $un; break; } case '1': { $user_color_name = ''.$un.''; break; } case '2': { $user_color_name = ''.$un.''; break; } } if ($_SESSION['uid']>0) { $limiter = $userdata['limit_tpid']; } else { $limiter = $forum_config['limit_tpid']; } $count = ceil($id / $limiter); if ($count >1) { $page= '&page='.$count; } else { $page=''; } return ''.GenerateTime($lastpost[3]).'
'.$lng['topic'].' #'.$topic.': '.$user_color_name.'