* @link http://www.pioder.pl/
* @license see LICENSE.txt
**/
define('IN_uF', true);
//include files
require('./config.php');
require('./includes/constants.php');
require('./includes/db.php');
require('./includes/errors.php');
//connect to database
DataBase::db_connect();
require('./includes/sessions.php');
require('./includes/classes/class_user.php');
require('./common.php');
require('./includes/misc_functions.php');
require('./includes/classes/class_forum.php');
require('./includes/classes/class_topic.php');
require('./includes/classes/secure.php');
$default_lang = DefaultLang();
require('./lngs/'.$default_lang.'/main.php');
$start = TimeGeneration();
$fid = intval($_GET['f']);
SessDelInvalid();
SessRegister();
SessDeleteOld();
require('./includes/cache/cache_forums.php');
//add skin variables
$skin = array(
'ntopic' => ($forum['lock']==1) ? '' : '
',
'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!
require('./skins/'.$default_skin.'/overall_header.tpl');
require('./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'])
);
require('./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) ? '' : '
'
));
require('./skins/'.$default_skin.'/forum_end_body.tpl');
$stop = TimeGeneration();
$skin['queries'] = ShowQueries($start, $stop);
require('./skins/'.$default_skin.'/overall_footer.tpl');
?>