* @link http://pioder.gim2przemysl.int.pl/dsf.html
* @license GNU GPL v3
**/
define('IN_uF', true);
//include files
include('./config.php');
include('./includes/constants.php');
include('./includes/class_db.php');
include('./includes/class_error.php');
//connect to database
DataBase::db_connect();
include('./includes/sessions.php');
include('./includes/class_user.php');
include('./common.php');
include('./includes/class_overall.php');
include('./includes/class_forum.php');
include('./includes/class_topic.php');
include('./includes/class_mod.php');
include('./includes/classes/secure.php');
$default_lang = Over::DefaultLang();
include('./lngs/'.$default_lang.'/main.php');
$tid = intval($_GET['t']);
$start = Over::TimeGeneration();
sess_del_invalid($_SESSION['uid']);
sess_register($_SESSION['uid']);
sess_delete_old();
$default_skin = Over::ViewSkinName();
include('./includes/cache/cache_topic.php');
$forum_locked = $forum['lock'];
//add skin variables
$skin = array(
'lreply'=>(($topic['lock']==1) or ($forum_locked==1)) ?
''
:
'
'
);
$skin = array_push_associative($skin, Over::generate_header($lng['showtopic'].': '.$topic['name'], '> '.$forum['name'].' > '.$topic['name']));
//do it!
include('./skins/'.$default_skin.'/overall_header.tpl');
include('./skins/'.$default_skin.'/topic_body.tpl');
$sql = "SELECT ".POSTS_TABLE.".*, ".USERS_TABLE.".*, ".USERS_TABLE.".u_id AS user_id,".SESSIONS_TABLE.".* FROM `".POSTS_TABLE."` LEFT JOIN ".USERS_TABLE." ON ".USERS_TABLE.".u_id = ".POSTS_TABLE.".u_id LEFT JOIN ".SESSIONS_TABLE." ON ".SESSIONS_TABLE.".u_id = ".POSTS_TABLE.".u_id WHERE t_id='$tid' ORDER BY tp_id $limit;";
$query = DataBase::sql_query($sql,'CRITICAL','Could not obtain post information.');
while($item=mysql_fetch_array($query))
{
$ua = Over::user_agent($item['user_agent']);
$warn_pool = ($forum_config['allow_warns'] && $forum_config['warns_in_topic'] ) ? (isset($user_warnlevel[$item['u_id']])) ?
''.$lng['warns'].':
'.($user_warnlevel[$item['u_id']]*10).'%' : ''.$lng['warns'].':
0%' : ' ';
$skin = array(
'tp_id' => $item['tp_id'],
'p_id' => $item['p_id'],
'u_id' => $item['user_id'],
'username' => Topic::UserName($item['nick'], $item['rank']),
'pdate' => Over::GenerateTime($item['ptime']),
'user_gg' => (($item['allow_gg'])&& ($item['gg']!='0')) ?
'
' : '',
'edit' => ($_SESSION['uid']>0) ? (($item['u_id']==$_SESSION['uid']) ||(RANK>0)) ?
'
' : '' : '',
'userrank' => User::UserRank($item['rank']),
'avatar' => ($item['avatar']!='') ? '' : '
',
'posttext' => Topic::PostText($item['text'], $item['moderated'], $item['p_id']),
'sig'=>($item['sig']!='') ? '
----------------
'.$item['sig'] : '',
'posts'=>$item['posts'],
'regdate' => date('d-m-Y',$item['regdate']),
'lastvisit' => date('d-m-Y',$item['lastvisit']),
'warns_pool' => $warn_pool,
'lstat'=>$lng['stat'],
'rowspan'=> ($_SESSION['uid']>0) ? ((RANK>0) ? '3' : '2') : '2',
'L.IP' => ($_SESSION['uid']>0) ? ((($forum_config['ip_post_for_mod'] && (RANK>0)) || (RANK==2) ) ? 'IP: '.$item['post_ip'].'
' : '') : '',
'IP'=>$item['post_ip'],
'admin'=>$lng['admin_mod_administration'],
'mode_p_del' => ($item['tp_id']!='1') ?
'
' : '',
'ban'=> $lng['ban'],
'edit_profile'=>$lng['edit_profile'],
'add_warn'=>$lng['add_warn'],
'online'=>($item['time']!=NULL) ? (($item['time']+1250)>time()) ? 'online.gif' : 'offline.gif' : 'offline.gif',
//labels
'lwarns'=>$lng['warns'],
'lang'=>$default_lang,
'ldate'=>$lng['date'],
'lrank'=>$lng['lurank2'],
'llastvisit'=>$lng['lulastvisit'],
'lregdate'=>$lng['regdate2'],
'lposts'=>$lng['posts'],
'ua_system'=>$ua[0],
'ua_system_desc'=>$lng['system'].' '.$ua[2],
'ua_browser'=>$ua[1],
'ua_browser_desc'=>$lng['browser'].' '.$ua[3],
'lno'=>$lng['no.'],
'lpinfo'=>$lng['postinfo'],
'C.delete_post'=>$lng['c_delete_post']
);
//do it!
include('./skins/'.$default_skin.'/topic_post_body.tpl');
}
//generate end template variables
$skin = array(
'functions_moderate'=> ($_SESSION['uid']>0) ? (RANK>0) ? './skins/'.$default_skin.'/topic_mod_body.tpl' : './skins/'.$default_skin.'/blank.tpl' : './skins/'.$default_skin.'/blank.tpl',
'lock' => ($topic['lock']==1) ? '' : '',
'stick' => ($topic['sticky']==1) ? '
'
: '',
'lmod' => $lng['lmod'],
'c_delete_topic'=>$lng['c_delete_topic'],
'option_pages'=>Over::AddPages(),
'lwith'=>$lng['with'],
'lpage'=>$lng['page'],
'lpages'=>$count
);
$skin['lreply']=(($topic['lock']==1) or ($forum_locked==1))
? '' : '
0) and ($topic['lock']==0) and ($forum_locked==0) and ($userdata['allow_qr']=='1'))
{
include './quick_reply.php';
}
if($_SESSION['uid']>0)
{
if(RANK==2)
{
$skin['pa_link']=''.$lng['pa_link'].'';
}
else
{
$skin['pa_link']='';
}
}
else
{
$skin['pa_link']='';
}
$stop = Over::TimeGeneration();
$skin['queries'] = Over::ShowQueries($start, $stop);
include('./skins/'.$default_skin.'/overall_footer.tpl');
?>