* @link http://pioder.gim2przemysl.int.pl/dsf.html * @license GNU GPL v3 **/ 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 = @mysql_fetch_array($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 = mysql_fetch_array($query); return $result['p_id']; } function LastPost($posts, $forum) { global $lng; global $user; global $last_post; global $userdata; global $forum_config; if ($posts==0) { return '
'.$lng['nopost'].'
';} 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']; 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 ''.Over::GenerateTime($last_post[$forum]['time']).'
'.$lng['topic'].' #'.$topic.': '.$user_color_name.'