View file partner/modules/guest/index.php

File size: 6.14Kb
<?php
Error_Reporting(E_ALL & ~E_NOTICE);
Error_Reporting (ERROR | WARNING);

session_name("SESID");
session_start();

include ("../../config.php");
include ("../../themes/$themes.php");

$id="$_SESSION[id]";
$data = file("../../data/gb.txt");
$count = count($data);
$kolmes = $guestmes;
$stranic = ceil($count/$kolmes);

if(empty($_GET["page"]))
{
$page_get = 1;
}
else
{
$page_get = "$_GET[page]";
}

$do = $kolmes * ($page_get - 1);
$end = $kolmes * $page_get;

$page_nazad = $page_get - 1;
$page_dalee = $page_get + 1;

if (eregi("([0-9])", "$page_get"))
{
echo "<div class=\"e\"><center>Гостевая<br/>";
if($_SESSION[apass]==$apass)
{
echo "[<a href=\"admin.php?act=clearguest\">Очистить</a>]<br/>";
}
if($_GET[mail]=="1")
{
echo "E-MAIL отправлен!<br/>";
}
if(!empty($_SESSION['name']))
{
echo "Приветик $_SESSION[name]<br/>";
}
echo "<a href=\"add.php\">Добавить</a>|";
echo "<a href=\"./\">Обновить</a><br/>";

if ($page_get < 0 | $page_get > $stranic)
{
echo "Данной страницы несуществует!<br/>";
}

if(empty($data))
{
echo "</div><p class=\"b\">В гостевой еще нет сообщений<br/></p>";
}
else
{

for ($i = $do; $i < $end; $i++)
{
if (!empty($data[$i]))
{
$viewmess = explode("|", $data[$i]);
$name_user   = $viewmess[0];
$for_user    = $viewmess[1];
$device_user = $viewmess[2];
$ip_user     = $viewmess[3];
$time_user   = $viewmess[4];
$date_user   = $viewmess[5];
$mail_user   = $viewmess[6];
$url_user    = $viewmess[7];
$mess_user   = $viewmess[8];
$mess_id = $viewmess[9];
$mess_admin2 = $viewmess[10];
$mess_admin3 = $viewmess[11];
echo "</div><p class=\"b\">[ID:$mess_id]<a href=\"add.php?for=$name_user\">$name_user</a>";
if(!empty($for_user))
{
echo " для <a href=\"add.php?for=$for_user\">$for_user</a>";
}
echo "<br/>";
if (!empty($mail_user))
{
echo "<font color=red>E-mail:</font>$mail_user<br />";
}
if (!empty($url_user))
{
echo "<font color=red>Caйт:</font><a href=\"http://$url_user\">$url_user</a><br/>";
}
if($_SESSION['login']==$nickadmina && md5($_SESSION['pass'])==$passadmina) {
$mess_user = str_replace('[admin]', '<br/><font color=red>Письмо</font>:<font color=green>', $mess_user);
$mess_user = str_replace('[/admin]', '</font>', $mess_user);
}
else
{
$mess_user = preg_replace('|admin(.*)/admin]|', '<font color=red>Письмо админу</font>]', $mess_user);
$mess_user = str_replace('[[', '[', $mess_user);
$mess_user = str_replace(']]', ']', $mess_user);
$mess_user = str_replace('RnB', '<font color=red>RnB</font>', $mess_user);
$mess_user = preg_replace('|HTTP://(.*)\w|', '<font color=red>Реклама запрещена!</font>', $mess_user);
$mess_user = preg_replace('|Http://(.*)\w|', '<font color=red>Реклама запрещена!</font>', $mess_user);
$mess_user = preg_replace('|hTtp://(.*)\w|', '<font color=red>Реклама запрещена!</font>', $mess_user);
$mess_user = preg_replace('|htTp://(.*)\w|', '<font color=red>Реклама запрещена!</font>', $mess_user);
$mess_user = preg_replace('|httP://(.*)\w|', '<font color=red>Реклама запрещена!</font>', $mess_user);
$mess_user = preg_replace('|HTtp://(.*)\w|', '<font color=red>Реклама запрещена!</font>', $mess_user);
$mess_user = preg_replace('|http://(.*)\w|', '<font color=red>Реклама запрещена!</font>', $mess_user);
$mess_user = str_replace('</font>>', '</font>', $mess_user);
}
echo "<font color=red>Дата</font>:$date_user<br />";
echo "<font color=red>Время</font>:$time_user<br/></p>";
echo "<p class=\"b\" style=\"border-top:0px\">$mess_user<br/>";

if (!empty($mess_admin1))
{
echo "<font color=red>Админ $nickadmina: $mess_admin1</font><br/>";
}
if (!empty($mess_admin2))
{
echo "<font color=red>Админ: $mess_admin2</font><br/>";
}
if (!empty($mess_admin3))
{
echo "<font color=red>Админ: $mess_admin3</font><br/>";
}
echo "[<font color=\"#990000\">$device_user,$ip_user</font>]</p><hr>";
if($_SESSION[apass]==$apass)
{
echo "<p>[<a href=\"admin.php?act=ans&amp;str=$i&amp;to=$mail_user&amp;for=$name_user&amp;page=$page_get\">ответ</a>|<a href=\"admin.php?act=del&amp;str=$i&amp;page=$page_get\">удал</a>]</p>";
}

}
}

if($stranic > 1)
{
echo "<p align=\"center\" class=\"d\">";
if($page_get > 1)
{
echo "<a href=\"index.php?page=$page_nazad\">Назад</a>";
}
echo "|";
if($stranic > $page_get)
{
echo "<a href=\"index.php?page=$page_dalee\">Дальше</a>";
}
echo "<br/>Страница:$page_get<br/>";
echo "Всего страниц:$stranic<br/>";
if($page_get > 1)
{
echo "<a href=\"index.php?page=1\">В начало</a>";
}
echo "|";
if($stranic > $page_get)
{
echo "<a href=\"index.php?page=$stranic\">В конец</a><br/>";
}
echo "</p>";

echo "<form action=\"index.php\" method=\"get\">";
echo "<p align=\"center\" class=\"d\">";
echo "На страницу<br/>
<input type=\"text\" name=\"page\" size=\"3\" maxlength=\"3\" value=\"\" /><br/>
<input type=\"submit\" value=\"Перейти\" />";
echo "</p>";
echo "</form>";
}

if(!empty($_SESSION['name']))
{
$rand = rand(1, 9);
$_SESSION['rand'] = "$rand";
echo "<form action=\"send.php?rand=$rand\" method=\"post\">";
echo "<p class=\"b\" align=\"center\"><input type=\"hidden\" name=\"name\" value=\"$_SESSION[name]\" />
<input type=\"hidden\" name=\"email\" value=\"$_SESSION[email]\" />
<input type=\"hidden\" name=\"url\" value=\"$_SESSION[url]\" />
* сообщение<br />
<textarea rows=\"4\" cols=\"15\" name=\"msg\"></textarea><br />
<input type=\"checkbox\" name=\"msgtrans\" value=\"1\" /> Транслит сообщения
<br /><br />
* Проверочное число <font color=\"red\">$rand</font>:<br/><input size=\"4\" maxlength=\"4\" name=\"imgrand\" value=\"\" /><br /><br />
<input type=\"submit\" value=\"добавить\" /></p>
</form>";
}
echo "<p>В гостевой $count сообщений.<br/></p>";
}
}
else
{
echo"<p align=\"center\">Что хотел взломать мой сайт?<br />";
}

include ("../../templates/foot.php");
?>