Просмотр файла parkerforum2/index.php

Размер файла: 4.27Kb
<?
if(QUERY_STRING=="logged");
$logged=0;
session_start();
include"design/header.htm";
include"params.php";
include"colors.php";
if($epass==$pass and $elog==$log)
{
print"<div align=right><font size=1 face=$fonttype1 color=$fontcolor1><a href='admin.php'>Вы опознаны как администратор форума!</a></font></div>";
$logged=1;
}

if($page=="")
$page=1;
$file=file("topics.dat");
$entries=count($file);
$total=$entries/$nums;
$pages = intval($total);
print"<font size=1 face=$fonttype1 color=$fontcolor1>Страницы:</font>&nbsp;&nbsp;";
for ($i = 1; $i <= ceil($entries/$nums); $i++)
{
print "<font size=\"1\" face=$fonttype1 color=$fontcolor1><A HREF=?page=$i>$i</A></font> ";
}
print "<BR>";
print "<font face=$fonttype1 size=2 color=$fontcolor1><a href='newtopic.php'>Новая тема</a></font><BR><BR>";

print"
<table width=\"100%\" border=\"0\" bgcolor=\"$border1\" cellpadding=\"0\" cellspacing=\"0\">
<tr>
<td>
<table width=\"100%\" border=\"0\" cellpadding=\"1\" cellspacing=\"1\">
<tr bgcolor=\"#ffffff\">
<td width=\"60%\" bgcolor=\"$color1\"><div align='center'><font size=2 color=$fontcolor1 face=$fonttype1><B>Тема</B></font></div></td>
<td width=\"10%\" bgcolor=\"$color3\"><div align='center'><font size=2 color=$fontcolor1 face=$fonttype1><B>Кто создал</B></font></div></td>
<td width=\"9%\" bgcolor=\"$color3\"><div align='center'><font size=2 color=$fontcolor1 face=$fonttype1><B>Последний ответ</B></font></div></td>
<td width=\"10%\" bgcolor=\"$color3\"><div align='center'><font size=2 color=$fontcolor1 face=$fonttype1><B>Кол-во сообщений</B></font></div></td>
<td width=\"10%\" bgcolor=\"$color3\"><div align='center'><font size=2 color=$fontcolor1 face=$fonttype1><B>Кол-во просмотров</B></font></div></td>
</tr>";

if ($page != "")
{
$Tmp=$nums*$page;
$tmp=$nums;
$up=$Tmp-$tmp;

$down=$up+$nums;
for ($i=$up; $i<$down; $i++)
{
$rev=array_reverse($file);
if ($rev[$i]!="")
{
list($id,$date,$author,$mail,$icq,$site,$topic,$msg)=split("::",$rev[$i]);

$answers=file("data/answers/$id.dat");
$countanswers=count($answers); // посчитаем ответы
list($udate,$uname,$umail,$uicq,$uurl,$umsg,$uip)=split("::",$answers[$countanswers-1]);
$seens=file("data/seens/$id.dat"); // кол-во просмотров

$n=$i-$entries;
$n++;
$n=abs($n);

$lastp=$countanswers/$nums;
$lastpage=intval($lastp);
$lastpage++;

if($countanswers!=0)
$message1="<font size=1><a href='showtopic.php?line=$n&page=$lastpage'>>></a></font>";
else
$message1=" ";

if($logged==1)
{
$message2="&nbsp;| <a href='edit.php?object=topic&line=$n'>редактировать</a>";
$message3="<a href='delete.php?object=topic&line=$n'>удалить</a> |";
}

print"
<tr bgcolor=\"#ffffff\">
<td height=\"37\" width=\"60%\" bgcolor=\"$color2\"><font size=2 color=$fontcolor1 face=$fonttype1>&nbsp;&nbsp;<a href='showtopic.php?line=$n'><B>$topic</B></a>$message2 $message3</font></td>
<td height=\"37\" width=\"10%\" bgcolor=\"$color4\"><font size=2 color=$fontcolor1 face=$fonttype1><div align='center'><a href='mailto:$mail'>$author</a><BR><font size=1>$date</font></div></font></td>
<td height=\"37\" width=\"9%\" bgcolor=\"$color4\"><font size=2 color=$fontcolor1 face=$fonttype1><div align=center><a href='mailto:$umail'>$uname</a><BR>$message1</div></font></td>
<td height=\"37\" width=\"10%\" bgcolor=\"$color4\"><font size=2 color=$fontcolor1 face=$fonttype1><div align='center'>$countanswers</div></font></td>
<td height=\"37\" width=\"10%\" bgcolor=\"$color4\"><font size=2 color=$fontcolor1 face=$fonttype1><div align=center>$seens[0]</div></font></td>
</tr>";
}
}
}

print"
</table>
</td>
</tr>
</table>";

if($logged==0)
{
print"
<div align=right>
<form method=\"post\" action=\"login.php\">
<input type=hidden name=seenform value=y>
<font size=\"1\" face=$fonttype1 color=$fontcolor1>Логин:</font>
<input type=\"text\" name=\"elog\" size=\"10\">
<font size=\"1\" face=$fonttype1 color=$fontcolor1>&nbsp;&nbsp;Пароль:</font>
<input type=\"password\" name=\"epass\" size=\"10\">
<input type=\"submit\" name=\"Submit\" value=\">>\">
</form>
</div>";
}
print"<BR><font size=1 face=$fonttype1 color=$fontcolor1><div align='center'>ParkerForum 2.00<BR>powered by <a href='mailto:[email protected]'>ademan</a><BR><a href='http://khoroshun.com'><B>www.khoroshun.com</B></a></font>";
include"design/footer.htm";
?>