Размер файла: 2.21Kb
<?php
####################
# Автор: [Svig] #
# ICQ: 563000172 #
####################
include ("../conf.php");
include ("../lock.php");
if ($user == $myrow["user"] && $pass == $myrow["pass"])
{
echo "<link rel='stylesheet' type='text/css' href='../style.css'/>";
include ("../head.php");
$at_page=10;
$count=mysql_result(mysql_query("SELECT COUNT(`id`) FROM `chat`"), 0);
$pages=ceil($count/$at_page);
$page=abs(intval(@$_REQUEST['page']));
if($page==0) $page=1;
define('PAGE', $page);
unset($page);
$from=(PAGE-1)*$at_page;
$result=mysql_query("SELECT * FROM chat ORDER BY `id` DESC LIMIT $from, $at_page");
if (mysql_num_rows($result) > 0)
{
$myrow2 = mysql_fetch_array($result);
echo "<div class='nav'>• <a href=add.php?page=add&user=$user&pass=$pass>Написать</a></div>";
do
{
echo "<div class='nav'>";
include ("smiles/smiles.php");
echo "Ник: [<b><a href='../info.php?user=$user&pass=$pass&id=".$myrow2['id_user']."'>".$myrow2['user2']."</a></b>]<br />";
echo "<small>".$myrow2['date']." </small><br />";
echo "".$myrow2['text']."<br /></div>";
}
while ($myrow2 = mysql_fetch_array($result));
echo "<div class='nav'>";
if(PAGE>1) echo "<a href='index.php?page=".(PAGE-1)."&user=$user&pass=$pass'>Назад</a>";
if(PAGE<$pages) echo " <a href='index.php?page=".(PAGE+1)."&user=$user&pass=$pass'>Вперед</a>";
if($pages>1) echo "";
echo "</div>";
}
else
{
echo "<div class='nav'>";
echo "Сообщений в чате нет!<br />";
echo "• <a href=add.php?page=add&user=$user&pass=$pass>Написать</a><br />";
echo "</div>";
echo "<div class='nav'>";
echo "• <a href=../menu.php?user=$user&pass=$pass>В меню</a>";
echo "</div>";
include ("../foot.php");
exit();
}
echo "<div class='nav'>• <a href=../menu.php?user=$user&pass=$pass>В меню</a></div>";
include ("../foot.php");
exit();
}
else
{
echo "<link rel='stylesheet' type='text/css' href='../style.css'/>";
include ("../head.php");
echo "<div class='nav'>";
echo "Ошибка! <br />Неверный <b>Ник</b> или<b>Пароль</b>!<br /></div>";
echo "<div class='nav'><a href='index.php'>На главную</a></div>";
include ("../foot.php");
}
?>