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

Размер файла: 3.45Kb
<?
error_reporting(0); 
include "config.php";
include "header.php";
include "infa.php";
if (!empty($pass))
{
$viewmess = file("data/$name.$antihak.txt");
$viewmess = explode("|", $viewmess[0]);
$nick_user = $viewmess[0];
$pass_user = $viewmess[1];
$status = $viewmess[11];
}
if ($pass==$pass_user)
{
if($status==Админ)
{
$accept="on";
}
if($status==Модер)
{
$accept="on";
}
if (!empty($name))
{
$pass_user=$pass;
$nick_user=$name;
echo "$time ";
include "online.php";
echo "
<form action=\"send.php\" method=\"post\">
<input type=\"hidden\" name=\"pass_user\" value=\"$pass_user\"/>
<input type=\"hidden\" name=\"nick_user\" value=\"$nick_user\"/>
<textarea cols=\"20\"  rows=\"3\" name=\"msg\">$msg</textarea><br/>
<input type=\"submit\" value=\"добавить\"/></form>";
}
else
{
echo "<b>Добро пожаловать!</b><br/>
В наш мини чат<br/>
$time<br/>
<a href=\"add.php\">Добавить</a><br/>
";
}
echo "
<a href=\"index.php?rand=$randlink&name=$name&pass=$pass\">Обновить</a><br/>
";
$num_sep =$vsego;
$preview="chat.txt";
$preview = file($preview);
$count = count($preview);
$num_page=1;
if (isset($HTTP_GET_VARS['page'])) {
   if (($HTTP_GET_VARS['page']>0) and ($HTTP_GET_VARS['page']<=ceil($count/$num_sep))) $num_page=$HTTP_GET_VARS['page'];
}
for ( $i=($num_page-1)*$num_sep; $i<=(($num_page*$num_sep<$count) ? $num_page*$num_sep-1: $count-1); $i++) 
{
$viewmess = file("chat.txt");
$viewmess = explode("|", $viewmess[$i]);
$nick_user = $viewmess[0];
$status_user = $viewmess[1];
$name_user = $viewmess[2];
$time_user = $viewmess[3];
$mess_user = $viewmess[4];
$device_user = $viewmess[5];
if (!empty($status_user))
{
echo "
<a href=\"anketa.php?user=$nick_user&pass=$pass&name=$name\">$name_user</a>";
}
else
{
echo "$nick_user";
}
if ($accept==on)
{
echo " [<a href=\"del.php?act=delmsg&str=$i&name=$name&pass=$pass\">x</a>]<br/>
$device_user";
}
echo "
<br/>$time_user
</center>
<div class=\"msg\">
$mess_user<br/>
</div>
<center>
* * *<br/>";
}
if ($count>$num_sep)
nav_page(ceil($count/$num_sep),(isset($HTTP_GET_VARS['page']) ? $HTTP_GET_VARS['page']: 1),"index.php?pass=$pass&name=$name&page=");
echo "Сообщений: $count<br/>";
$file="users.txt";
$file = file($file);
$count2 = count($file);
echo "
Регистраций: <a href=\"users.php?name=$name&pass=$pass\">$count2</a><br/>
";
if($accept==on)
{
echo "<a href=\"moderka.php?infa=moderka&name=$name&pass=$pass\">Модерка</a>";
$base="moderka.$antihak.txt";
$base = file($base);
$count3 = count($base);
echo "($count3)<br/>";
}
if($status==Админ)
{
echo "<a href=\"adminka.php?infa=adminka&name=$name&pass=$pass\">Админка</a>";
$base2="adminka.$antihak.txt";
$base2 = file($base2);
$count4 = count($base2);
echo "($count4)<br/>";
}
echo "<a href=\"smile.php?pass=$pass&name=$name\">Смайлы</a><br/>
<a href=\"bbcode.php?pass=$pass&name=$name\">Теги</a><br/>
<a href=\"nastrojki.php?name=$name&pass=$pass\">Настройки</a><br/>
";
if (!empty($pass))
{
echo "<a href=\"edit_user.php?name=$name&pass=$pass\">Изменить анкету</a><br/>";
}
else
{
echo "<a href=\"auth.php\">Авторизация</a><br/>
<a href=\"reg.php\">Регистрация</a><br/>";
}
if($accept==on)
{
echo "<a href=\"del.php?name=$name&pass=$pass\">Очистить чат</a><br/>";
}
if (!empty($pass))
{
echo "
<a href=\"index.php\">Выход</a><br/>";
}
}
else
{
echo "Ошибка авторизации<br/>
<a href=\"index.php\">Вход</a><br/>";
}
echo "$bottom";
?>