A lightweight forum engine written in PHP. Repository is now obsolete and read-only. http://www.pioder.pl/uforum.html
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

110 lines
4.2 KiB

<?php
/**
* @package Dynamic Script Forum
* @file forum.php
* @version 1.0.x, 08-04-2008, 16:53
* @copyright 2008(c) PioDer <[email protected]>
* @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/classes/secure.php');
$default_lang = Over::DefaultLang();
include('./lngs/'.$default_lang.'/main.php');
$start = Over::TimeGeneration();
$fid = intval($_GET['f']);
sess_del_invalid($_SESSION['uid']);
sess_register($_SESSION['uid']);
sess_delete_old();
include('./includes/cache/cache_forums.php');
//add skin variables
$skin = array(
'ntopic' => ($forum['lock']==1) ? '<img src="skins/'.$default_skin.'/images/lng_'.$default_lang.'/lock.gif"
alt="ntopic" border="0"/>' : '<a href="posting.php?mode=ntopic&amp;f='.$_GET["f"].'">
<img src="skins/'.$default_skin.'/images/lng_'.$default_lang.'/topic.gif" onMouseOver="this.style.cursor=\'hand\'; this.src=\'skins/'.$default_skin.'/images/lng_'.$default_lang.'/topic_active.gif\'"�
onMouseOut="this.src=\'skins/'.$default_skin.'/images/lng_'.$default_lang.'/topic.gif\'" border="0" alt="reply"></a>',
'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_associative($skin,Over::generate_header($lng['showforum'].': '.$forum['name'], '</a>&gt; <a href="forum.php?f='.$_GET['f'].'" class="navigator">'.$forum['name']));
//do it!
include('./skins/'.$default_skin.'/overall_header.tpl');
include('./skins/'.$default_skin.'/forum_body.tpl');
$sql = "SELECT ".TOPICS_TABLE.".*, ".USERS_TABLE.".* 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 = mysql_num_rows($query);
if ($value>0)
{
while($record = mysql_fetch_array($query))
{
$skin = array(
't_id'=>$record['t_id'],
'fname'=>($record['sticky']=='1') ? '<b>'.$lng['sticky'].'</b>'.$record['name'] : $record['name'],
'author'=>Topic::TopicAuthor($record['author']),
'tposts'=>$count_topic[$record['t_id']],
'new_post'=>Topic::LastPostImg(),
'lastpost'=>Topic::LastPostInTopic($record['t_id'])
);
include('./skins/'.$default_skin.'/forum_forum_add.tpl');
}
$skin['noposts']='';
}
else
{
$skin['noposts']='<tr><td width="'.TABLES_WIDTH.'" colspan="8" height="19" class="fitem"><p class="fstandard" align="center">'.$lng['nopost'].'!</p></td></tr>';
}
$skin = array_push_associative($skin, array(
'option_pages' => Over::AddPages(),
'lwith' => $lng['with'],
'lpage' => $lng['page'],
'lpages' => $count,
'f_id' => $fid,
'lang' => $default_lang,
'ntopic' => ($forum['lock']==1) ? '<img src="skins/'.$default_skin.'/images/lng_'.$default_lang.'/lock.gif"
alt="ntopic" border="0">' : '<a href="posting.php?mode=ntopic&amp;f='.$_GET["f"].'">
<img src="skins/'.$default_skin.'/images/lng_'.$default_lang.'/topic.gif"
onMouseOver="this.style.cursor=\'hand\'; this.src=\'skins/'.$default_skin.'/images/lng_'.$default_lang.'/topic_active.gif\'"�
onMouseOut="this.src=\'skins/'.$default_skin.'/images/lng_'.$default_lang.'/topic.gif\'" border="0" alt="reply"></a>'
));
include('./skins/'.$default_skin.'/forum_end_body.tpl');
if ($_SESSION['uid']>0)
{
if(RANK=='2')
{
$skin['pa_link']='<a href="admin/index.php" class="fsmall"><b>'.$lng['pa_link'].'</b></a>';
}
else
{
$skin['pa_link']='';
}
}
else
{
$skin['pa_link']='';
}
$stop = Over::TimeGeneration();
$skin['queries'] = Over::ShowQueries($start, $stop);
include('./skins/'.$default_skin.'/overall_footer.tpl');
?>