require("include/top.php");
require("include/libbb.php");
if($_SESSION["SESSION"]&&$_SESSION["SCENEID"])
{
$query = "SELECT topicposts FROM users WHERE id='".$_SESSION["SCENEID_ID"]."'";
$result = mysql_query($query);
$posts_per_page=mysql_result($result,0);
}
else
{
$posts_per_page = 25;
}
if ($com) $posts_per_page=$com; else $com=$posts_per_page;
$query='SELECT count(0) FROM bbs_posts WHERE topic='.$which;
$result=mysql_query($query);
$nb_posts=mysql_result($result,0);
$pages=ceil($nb_posts/$posts_per_page);
if(($page<=0)||(!$page)||($page>$pages)) {
$page=$pages;
}
$query="SELECT topic FROM bbs_topics WHERE id=".$which;
$result=mysql_query($query);
$topictitle=htmlcleanonerow(mysql_result($result,0));
$query="SELECT bbs_posts.post,bbs_posts.author,bbs_posts.added,users.nickname,users.avatar,users.level FROM bbs_posts,users WHERE bbs_posts.author=users.id AND bbs_posts.topic=".$which." ORDER BY bbs_posts.added ASC";
$query.=" LIMIT ".(($page-1)*$posts_per_page).",".$posts_per_page;
$result=mysql_query($query);
while($tmp=mysql_fetch_assoc($result)) {
$replies[]=$tmp;
}
// place page & topic related infos into a global object so it can be used in displayPageLinks()
$GLOBALS['pageAndTopicInfos'] = array( 'page'=>$page, 'pages'=>$pages, 'which'=>$which, 'com'=>$com );
/*
* displayPageLinks
* add the TR with the links to the pages ( first/previous/next/last/dropdown )
*
* added on 2007/04/14 by p01
*/
function displayPageLinks()
{
// make a local copy of the 'pageAndTopicInfos'
foreach( $GLOBALS['pageAndTopicInfos'] as $key=>$val )
$$key = $val;
?>
|
}
?>
=$topictitle?> |
  |
displayPageLinks();
// display replies
for( $i=0; $i
">
if( ( ($replies[$i]["level"]=='fakeuser') && $user["topichidefakeuser"] )
|| ( ($replies[$i]["level"]=='pr0nstahr') && $user["topichidepornstar"] )
|| ( ($replies[$i]["level"]=='annoyinguser') && $user["topichideannoyinguser"] ) )
{
print("i'm a ".$replies[$i]["level"]." so i got shamelessly censored, if you're registered you can uncensor my level's posts here");
}
else
{
print(parse_message($replies[$i]["post"]));
}
?>
|
">
|
}
displayPageLinks();
?>
|
if(session_is_registered("SESSION")): ?>
else: ?>
endif; ?>
require("include/bottom.php"); ?>