Размер файла: 2.71Kb
<?php
// MyForum - Сервис форумов
// Copyright © A'lex и KO. All Rights Reserved
// По всем вопросам обращайтесь на email [email protected] или в асю 376920428
include 'config.php';
include 'functions.php';
if ($moder && $show) {
$r = mysql_query("SELECT * FROM {$table}{$f}_topiks WHERE ForumID=$p ORDER BY ID DESC");
} else {
$r = mysql_query("SELECT * FROM {$table}{$f}_topiks WHERE ForumID=$p AND Visible=0 ORDER BY `ID` DESC");
}
$nummes = mysql_numrows($r);
$body="";
$npost=0;
if ($sid == FALSE) {
$tp = $_SERVER['HTTP_ACCEPT'];
$user = $_SERVER["HTTP_USER_AGENT"];
if (strstr($tp,'text/html') || strstr($user, 'Mozilla')) {
$size = 4800;
} else {
$size = 1800;
}
} else {
$sn = substr($sid, 15, 1);
//echo $sn;
if ($sn == '1') {$size=1800;}
if ($sn == '2') {$size=4800;}
if ($sn == '3') {$size=9800;}
//echo ' '.$size;
}
if ($mes == FALSE) {$mes = 0;}
if (($mes > $nummes)) {$mes = $nummes-1;}
if ($mes!=0) {
for($i=0; $i<$mes-1; $i++) {
$a=mysql_fetch_array($r);
$npost++;
}
}
$nsize=0;
for($i=$mes-1; $i<$nummes; $i++) {
$add="";
$a=mysql_fetch_array($r);
$ID = $a['ID'];
$Cop = $a['Cop'];
$Title = $a['Title'];
$Date = $a['Date'];
$Visible = $a['Visible'];
$Enabled = $a['Enadled'];
$label="";
if ($Enabled!=0) {$label=$label.'#';}
if ($Visible!=0) {$label=$label.'del';}
$k = mysql_query("SELECT * FROM {$table}{$f}_messages WHERE ForumID=$p AND TopikID=$ID AND Visible=0");
if ($k!=FALSE) {$Count = mysql_numrows($k);}
if (($Visible=='0') || ($moder && $show && ($Visible!='0'))) {
$add="$Date <b>$Cop</b><br/>" .
"$label<a href=\"showtopik.php?f=$f&p=$p&t=$ID$isid\">$Title</a> ($Count)<br/><br/>\n";
}
$nsize+=strlen($add);
$npost++;
if (($nsize > $size) && (strlen($body)!=0)) {
$newpost=$npost;
break;
} else {
$body.=$add;
}
}
if ($newpost) {$next = "<a href=\"showforum.php?f=$f&p=$p&mes=$newpost$isid\">Далее</a><br/>";}
$next.="<a href=\"showforum.php?f=$f&p=$p$isid\">В начало</a><br/>";
$r = mysql_query("SELECT * FROM {$table}{$f}_forums WHERE ID=$p");
$a=mysql_fetch_array($r);
$ForumTitle=$a['Title'];
$back ="<a href=\"newtopik.php?f=$f&p=$p$isid\">Новая тема</a>";
if ($moder && $show) {$back.="<br/><a href=\"showforum.php?f=$f&p=$p&sid=$sid&w=$w\">" .
"Скрыть удаленные посты</a>";}
if ($moder && (!$show)) {$back.="<br/><a href=\"showforum.php?f=$f&p=$p&sid=$sid&w=$w&show=all\">" .
"Показать удаленные посты</a>";}
$back .= "<br/><a href=\"index.php?f=$f$isid\">Список форумов</a><br/>";
displaytext($ForumTitle, $Banner . $back, $body, $next . $back, $w);
mysql_close($lnk);
?>