* @link http://www.pioder.pl/ * @license see LICENSE.txt **/ define('IN_uF', true); //include files include('./config.php'); include('./includes/constants.php'); include('./includes/db.php'); include('./includes/errors.php'); //connect to database DataBase::db_connect(); include('./includes/sessions.php'); include('./includes/classes/class_user.php'); include('./common.php'); include('./includes/misc_functions.php'); include('./includes/classes/class_forum.php'); include('./includes/classes/class_topic.php'); include('./includes/classes/secure.php'); $default_lang = DefaultLang(); include('./lngs/'.$default_lang.'/main.php'); $start = TimeGeneration(); $fid = intval($_GET['f']); SessDelInvalid(); SessRegister(); SessDeleteOld(); include('./includes/cache/cache_forums.php'); //add skin variables $skin = array( 'ntopic' => ($forum['lock']==1) ? 'ntopic' : ' reply', 'lposts'=>$lng['posts'], 'llastposts'=>$lng['lastpost'], 'lposts'=>$lng['posts'], 'lauthor'=>$lng['author'], 'llastpost'=>$lng['lastpost'], 'ltopicname'=>$lng['ltopicname'], 'f_id' => $fid, 'lang'=> $default_lang ); $skin = array_push_assoc($skin,GenerateHeader($lng['showforum'].': '.$forum['name'], '> '.$forum['name'])); //do it! include('./skins/'.$default_skin.'/overall_header.tpl'); include('./skins/'.$default_skin.'/forum_body.tpl'); $sql = "SELECT ".TOPICS_TABLE.".*, ".USERS_TABLE.".*, ".TOPICS_TABLE.".posts AS `postcount`, ".TOPICS_TABLE.".lastpost AS `topic_lastpost` FROM ".TOPICS_TABLE." LEFT JOIN ".USERS_TABLE." ON ".TOPICS_TABLE.".author = ".USERS_TABLE.".u_id WHERE f_id='$fid' ORDER BY `sticky` DESC, `lastpost_time` DESC $limit;"; $query = DataBase::sql_query($sql,GENERAL,'Could not obtain topics information'); $value = DataBase::num_rows($query); if ($value>0) { while($record = DataBase::fetch($query)) { $last_post = explode(':', $record['topic_lastpost']); $skin = array( 't_id'=>$record['t_id'], 'fname'=>($record['sticky']=='1') ? ''.$lng['sticky'].''.$record['name'] : $record['name'], 'author'=>Topic::TopicAuthor($record['author']), 'tposts'=>$record['postcount'], 'new_post'=>Topic::LastPostImg(), 'lastpost'=>Topic::LastPostInTopic($record['t_id']) ); include('./skins/'.$default_skin.'/forum_forum_add.tpl'); } $skin['noposts']=''; } else { $skin['noposts']='

'.$lng['nopost'].'!

'; } $skin = array_push_assoc($skin, array( 'option_pages' => ListPages($page, $count), 'lwith' => $lng['with'], 'lpage' => $lng['page'], 'lpages' => $count, 'f_id' => $fid, 'lang' => $default_lang, 'ntopic' => ($forum['lock']==1) ? 'ntopic' : '
reply' )); include('./skins/'.$default_skin.'/forum_end_body.tpl'); $stop = TimeGeneration(); $skin['queries'] = ShowQueries($start, $stop); include('./skins/'.$default_skin.'/overall_footer.tpl'); ?>