URL Rewriting
//line 195->URL Rewriting
//line 200->calc posts
//line 163->Add list of moderators
//line 235->remove blockquotes
//line 239->display the moderator
////////////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2000 Phorum Development Team //
// http://www.phorum.org //
// //
// This program is free software. You can redistribute it and/or modify //
// it under the terms of either the current Phorum License (viewable at //
// phorum.org) or the Phorum License that was distributed with this file //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY, without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. //
// //
// You should have received a copy of the Phorum License //
// along with this program. //
////////////////////////////////////////////////////////////////////////////////
require "./common.php";
if(empty($f)) $f="0";
if($ActiveForums==1){
$sSQL="Select id, folder from $pho_main where active=1";
$q->query($DB, $sSQL);
$rec=$q->getrow();
if($rec["folder"]==0){
header("Location: $forum_url/$list_page.$ext?f=$rec[id]$GetVars");
exit();
}
}
$title = " - $lForumList";
include phorum_get_file_name("header");
if($f!=0){
$level='';
if($ForumParent!=0){
$level="f=$ForumParent";
} else {
$level="f=0";
}
$table_width=$ForumTableWidth;
$table_header_color=$ForumTableHeaderColor;
$table_header_font_color=$ForumTableHeaderFontColor;
$table_body_color_1=$ForumTableBodyColor1;
$table_body_font_color_1=$ForumTableBodyFontColor1;
$nav_color=$ForumNavColor;
$nav_font_color=$ForumNavFontColor;
addnav($menu, $lUpLevel, "$forum_page.$ext?$level$GetVars");
}
else{
$table_width=$default_table_width;
$table_header_color=$default_table_header_color;
$table_header_font_color=$default_table_header_font_color;
$table_body_color_1=$default_table_body_color_1;
$table_body_font_color_1=$default_table_body_font_color_1;
$nav_color=$default_nav_color;
$nav_font_color=$default_nav_font_color;
}
//////////////////////////
// START NAVIGATION //
//////////////////////////
// Log Out/Log In
if(isset($phorum_user['id'])){
addnav($menu, $lLogOut, "login.$ext?f=$f&logout=1$GetVars");
addnav($menu, $lMyProfile, "profile.$ext?f=$f&id=$phorum_user[id]$GetVars");
} else{
$SQL="Select max(security) as sec from $pho_main";
$q->query($DB, $SQL);
if($q->field("sec", 0)){
$url="login.$ext?f=$f$GetVars";
addnav($menu, $lLogIn, $url);
}
}
//////////////////////////
// END NAVIGATION //
//////////////////////////
if(isset($menu) && is_array($menu)){
$TopNav=getnav($menu);
?>
valign="TOP" nowrap="nowrap"> |
query($DB, $sSQL);
$rec=$q->getrow();
$act_id=$rec["parent"];
$all_parents.=",".$act_id;
}
$sSQL="Select id, name, table_name, parent, folder, description from ".$pho_main." where active=1 and (parent=$f or displayflag=1 or (displayflag=2 and parent in (".$all_parents."))) order by folder desc";
if($SortForums) $sSQL.=", name";
$q->query($DB, $sSQL);
$rec=$q->getrow();
} else {
$rec = "";
}
if(is_array($rec)){
while(is_array($rec)){
$empty=false;
$name=$rec["name"];
$num=$rec["id"];
$description=$rec["description"];
if(!$rec["folder"]){
$sSQL="select count(*) as posts from $rec[table_name]";
$tq = new query($DB, $sSQL);
if($tq->numrows())
{
$trec=$tq->getrow();
$num_posts=$trec["posts"];
$sSQL="select count(*) as nonposts from $rec[table_name] where approved='N'";
$tq = new query($DB, $sSQL);
if ($tq->numrows()){
$trec=$tq->getrow();
$num_posts -= $trec["nonposts"];
}
} else{
$num_posts='0';
}
$sSQL="select max(datestamp) as max_date from $rec[table_name] where approved='Y'";
$tq->query($DB, $sSQL);
$trec=$tq->getrow();
if(empty($trec["max_date"])){
$last_post_date="";
} else {
$last_post_date=date_format($trec["max_date"]);
}
$posts="$lNumPosts: $num_posts ";
$last="$lLastPostDate: $last_post_date";
$url="$list_page.$ext?f=$num$GetVars";
//MODIF->URL Rewriting
//$lang=FindVar($GetVars);
//$url="$list_page"."_"."$lang"."_"."$num".".htm";
//MODIF->Add list of moderators
$pho_mod = $PHORUM['mod_table'];
$sSQL="Select moderation from $pho_main where id=$num";
$mq = new query($DB, $sSQL);
$mrec=$mq->getrow();
$mod=$mrec["moderation"];
if($mod != "n")
{
$modnames = "";
$sSQL="SELECT user_id FROM $pho_mod WHERE forum_id=$num";
$mq= new query($DB, $sSQL);
$i=0;
$sep = "";
while($mrec=$mq->getrow())
{
$i++;
$pho_auth = $PHORUM['auth_table'];
$modo_id = $mrec['user_id'];
$sSQL = "SELECT username from $pho_auth WHERE id=$modo_id";
$zq = new query($DB, $sSQL);
$zrec=$zq->getrow();
$modo_name = $zrec["username"];
if ($i > 1)
$sep = ", ";
$modnames .= $sep."$modo_name";
}
}
}
else{
$last=$lForumFolder;
$url="$forum_page.$ext?f=$num$GetVars";
//MODIF->URL Rewriting
//$lang=FindVar($GetVars);
//$url="$forum_page"."_"."$lang"."_"."$num".".htm";
//MODIF->calc posts
// get all children posts
$total_num_posts='0';
$gSQL="SELECT table_name FROM $pho_main WHERE parent=$num";
$g=new query($DB,$gSQL);
while($grec=$g->getrow())
{
$sSQL="select count(*) as posts from $grec[table_name]";
$mq = new query($DB, $sSQL);
if($mq->numrows())
{
$mrec=$mq->getrow();
$num_posts=$mrec["posts"];
$sSQL="select count(*) as nonposts from $grec[table_name] where approved='N'";
$mq = new query($DB, $sSQL);
if ($mq->numrows())
{
$mrec=$mq->getrow();
$num_posts -= $mrec["nonposts"];
}
}
else
{
$num_posts='0';
}
$total_num_posts += $num_posts;
}
$posts="$lNumPosts: $total_num_posts ";
}
?>
|
|
|
|
: |
| ";
$rec=$q->getrow();
}
}
else{
?>
> |