File size: 17.13Kb
<?php
########################################
## WAP-ENGINE ##
########################################
## ##
## Автор : CHUMA (Токарев Владимир) ##
## e-mail : [email protected] ##
## WAP : http://wap-engine.ru ##
## ##
########################################
## ВЫ НЕ ИМЕЕТЕ ПРАВО ##
## ИЗМЕНЯТЬ КОД СКРИПТА ##
## ДЛЯ ДАЛЬНЕЙШЕГО РАСПРОСТРАНЕНИЯ! ##
########################################
include ('../../config.php');
include ('../../templates/run.php');
include ('../../templates/func.php');
$title_page = 'Просмотр темы';
$login_in = $login;
$passw_in = $passw;
$status_in = $status;
####################
if ($portal=='off')
{
include '../../themes/'.$themes.'.php';
echo'<p align="center">'.$offmes.'</p>';
}
if ($portal=='on')
{
$id = filter($_GET['id']);
$str = filter($_GET['str']);
$str_r = filter($_GET['str_r']);
$razdel_data = '../../data/forum/razdel.php';
$razdel_f = file($razdel_data);
$podrazdel_data = '../../data/forum/podrazdel.php';
$podrazdel_f = file($podrazdel_data);
$podrazdel_arr = explode('|',$podrazdel_f[$str]);
$razdel_arr = explode('|',$razdel_f[$str_r]);
$temy_data = '../../data/forum/podrazdel/'.$podrazdel_arr[0].'.php';
$temy_f = @file($temy_data);
$temy_count = count($temy_f);
$tem_data = '../../data/forum/temy/'.$podrazdel_arr[0].'_'.$id.'.php';
$tem_f = @file($tem_data);
@array_splice($tem_f, 0, 2);
@array_splice($tem_f, -2, 2);
$tem_count = count($tem_f);
$kolmes = $koltemmes;
$stranic = ceil($tem_count/$kolmes);
$users_on_f = file('../../data/user_online.txt');
$user_on_arr = implode('|', $users_on_f);
for($i=2; $i < $temy_count-2; $i++)
{
$temy_arr_title = explode('|', $temy_f[$i]);
if($id == $temy_arr_title[0])
{
$title_tema = $temy_arr_title[4];
break;
}
}
$title_page = ''.$title_tema.' » '.$podrazdel_arr[2].' » '.$razdel_arr[1].' » Форум';
include '../../themes/'.$themes.'.php';
####################
# Ошибка! Антифлуд
if($_GET['err'] == 'flood')
{
$forum_flood = '../../data/flood_forum.txt';
$forum_flood_list = file($forum_flood);
$flood_time = time();
$ip = filter($_SERVER['REMOTE_ADDR']);
$flood_sec = 0;
foreach ($forum_flood_list as $key => $string)
{
$flood_arr = explode('|', $string);
if(trim($flood_arr[0]) == $ip && trim($flood_arr[1]) + $antiflood_forum >= $flood_time)
{
$flood_sec = (trim($flood_arr[1]) + $antiflood_forum) - $flood_time;
break;
}
}
echo"<p class=\"err\">Флуд!!! Вы слишком часто пишите сообщения. В форум можно писать один раз в $antiflood_forum сек. Подождите еще $flood_sec сек.</p>";
}
# Ошибка! Антифлуд
echo'<p class="modul_name"align="center"><a href="index.php?'.session_name().'='.session_id().'">Форум</a> » <a href="index.php?act=showrazdel&str_r='.$str_r.'&'.session_name().'='.session_id().'">'.$razdel_arr[1].'</a> » <a href="index.php?act=showforum&id='.$podrazdel_arr[0].'&str='.$str.'&str_r='.$str_r.'&'.session_name().'='.session_id().'">'.$podrazdel_arr[2].'</a></p>';
for($i=2; $i < $temy_count-2; $i++)
{
$temy_arr = explode('|', $temy_f[$i]);
if($id == $temy_arr[0])
{
echo'<p class="a">Тема: "'.$temy_arr[4].'"</p>';
$m_polozhenie = 'На форуме в теме "'.trim($temy_arr[4]).'"';
echo'<p class="b">';
if(isset($_SESSION['sespass']) && isset($passw_in) && $_SESSION['sespass'] == $passw_in && ($status_in == "1" || $status_in == "2" || $status_in == "3"))
{
if($temy_arr[6] != '#')
{
echo"<a href=\"admin.php?act=close&id=$id&str_t=$i&str=$str&str_r=$str_r&".session_name()."=".session_id()."\">Закрыть</a> |";
}
else
{
echo"<a href=\"admin.php?act=open&id=$id&str_t=$i&str=$str&str_r=$str_r&".session_name()."=".session_id()."\">Открыть</a> |";
}
}
if(isset($_SESSION['sespass']) && isset($passw_in) && $_SESSION['sespass'] == $passw_in && $temy_arr[1] == $login_in && $status_in != "1" && $status_in != "2" && $status_in != "3")
{
if($temy_arr[6] != '#')
{
echo"<a href=\"admin.php?act=close&id=$id&str_t=$i&str=$str&str_r=$str_r&".session_name()."=".session_id()."\">Закрыть</a> |";
}
}
if(file_exists('../../data/forum/temy/'.$podrazdel_arr[0].'_'.$id.'_podpiska.php') && $temy_arr[1] == $login_in)
{
$podp_nicks = file('../../data/forum/temy/'.$podrazdel_arr[0].'_'.$id.'_podpiska.php');
$count_podp_nicks = count($podp_nicks);
$count_podp_nicks = $count_podp_nicks - 2;
$podp_user_est = 0;
for($ii=2; $ii <= $count_podp_nicks; $ii++)
{
if($login_in == trim($podp_nicks[$ii]))
{
$podp_user_est = 1;
break;
}
}
if($podp_user_est == 1)
{
echo' <a href="podpiska.php?act=otpis&id='.$id.'&str_t='.$i.'&str='.$str.'&str_r='.$str_r.'&'.session_name().'='.session_id().'">Отписаться</a> |';
}
else
{
echo' <a href="podpiska.php?act=podpis&id='.$id.'&str_t='.$i.'&str='.$str.'&str_r='.$str_r.'&'.session_name().'='.session_id().'">Подписаться</a> |';
}
}
elseif($temy_arr[1] == $login_in)
{
echo' <a href="podpiska.php?act=podpis&id='.$id.'&str_t='.$i.'&str='.$str.'&str_r='.$str_r.'&'.session_name().'='.session_id().'">Подписаться</a> |';
}
$tema_est = 1;
if($temy_arr[6] == '#')
{
$tema_zakr = 1;
}
if($temy_arr[5] == '!')
{
$top_tema = 1;
}
break;
}
}
if((isset($_SESSION['sespass']) && isset($passw_in) && $_SESSION['sespass'] == $passw_in) || $dostup_forum == 1)
{
if(empty($_GET['page']))
{
$page_get = 1;
}
else
{
$page_get = $_GET['page'];
}
if($page_get < 0)
{
$page_get = 1;
}
if($page_get > $stranic)
{
$page_get = $stranic;
}
$do = $kolmes * ($page_get - 1);
$end = $kolmes * $page_get;
$page_nazad = $page_get - 1;
$page_dalee = $page_get + 1;
if (preg_match("#^[0-9]*$#", "$page_get") && preg_match("#^[0-9]*$#", "$id") && $tema_est == 1)
{
if(!empty($podrazdel_arr[3]) && $_SESSION['passrazd'] != trim($podrazdel_arr[3]))
{
echo'<p class="err">Внимание!!! Данный раздел под паролем.<br /></p>';
echo'<form method="post" action="vhod.php?id='.$podrazdel_arr[0].'&str='.$str.'&str_r='.$str_r.'&'.session_name().'='.session_id().'">';
echo'<p class="b">Пароль:<br /><input name="passrazd" maxlength="10" value="" /><br />';
echo'<input value="Войти" name="do" type="submit" /></p></form>';
echo'<p><a href="index.php?'.session_name().'='.session_id().'">В форум</a><br /></p>';
include ('../../templates/foot.php');
exit;
}
if(empty($tema_zakr))
{
echo " <a href=\"add.php?id=$id&str=$str&str_r=$str_r&".session_name()."=".session_id()."\">Ответить</a><br />";
echo"</p>";
}
else
{
echo "<p class=\"a\"><img src=\"/themes/chuma/02.gif\"> Данная тема закрыта!<br /></p>";
}
if ($page_get < 0 || $page_get > $stranic && $stranic >=1)
{
echo '<p>Данной страницы несуществует!</p>';
}
for ($i = $do; $i < $end; $i++)
{
if (!empty($tem_f[$i]))
{
$viewmess = explode('|', $tem_f[$i]);
$name_user = trim($viewmess[0]);
$date_user = trim($viewmess[1]);
$time_user = trim($viewmess[2]);
$mess_user = trim($viewmess[3]);
$name_izm = trim($viewmess[4]);
$date_izm = trim($viewmess[5]);
$time_izm = trim($viewmess[6]);
$exp_date = explode('.', $date_user);
$n = $i + 1;
$str_t = $i + 2;
if($n == 1) { $napisal = 'Автор:'; } else { $napisal = ''; }
echo "<p class=\"b\">";
echo"$napisal ";
user_data('../../data/users/'.trim($name_user).'.php');
if(strstr($user_on_arr, '|'.trim($name_user).'|'))
{
if($pol == '1')
{
if($status == '5')
{
echo'<img src="/images/st/m_nov.gif"alt=""/>';
}
elseif($status == '4')
{
echo'<img src="/images/st/m.gif"alt=""/>';
}
elseif($status == '3')
{
echo'<img src="/images/st/mod_m.gif"alt=""/>';
}
elseif($status == '2')
{
echo'<img src="/images/st/gmod_m.gif"alt=""/>';
}
elseif($status == '1')
{
echo'<img src="/images/st/admin_m.gif"alt=""/>';
}
}
elseif($pol == '0')
{
if($status == '5')
{
echo'<img src="/images/st/w_nov.gif"alt=""/>';
}
elseif($status == '4')
{
echo'<img src="/images/st/w.gif"alt=""/>';
}
elseif($status == '3')
{
echo'<img src="/images/st/mod_w.gif"alt=""/>';
}
elseif($status == '2')
{
echo'<img src="/images/st/gmod_w.gif"alt=""/>';
}
elseif($status == '1')
{
echo'<img src="/images/st/admin_w.gif"alt=""/>';
}
}
}
else
{
if($pol == '1')
{
echo'<img src="/images/st/m_off.gif"alt=""/>';
}
elseif($pol == '0')
{
echo'<img src="/images/st/w_off.gif"alt=""/>';
}
}
$nick_name_arr = explode('::', $nickname);
$nickname = $nick_name_arr[0];
$nickcolor = $nick_name_arr[1];
if(!empty($nickname))
{
if(!empty($nickcolor))
{
$login_nick_color = '<font color="'.$nickcolor.'">'.$nickname.'</font>';
}
else
{
$login_nick_color = ''.$nickname.'';
}
}
else
{
$login_nick_color = ''.$name_user.'';
}
echo" <a href=\"../../modules/kabinet/user_info.php?nick=$name_user&".session_name()."=".session_id()."\">$login_nick_color</a> ";
if($rating >= $kolbronza && $rating <= $kolserebro)
{
echo'<img src="/images/st/bronza.gif"alt=""/>';
}
if($rating >= $kolserebro && $rating <= $kolzoloto)
{
echo'<img src="/images/st/serebro.gif"alt=""/>';
}
if($rating >= $kolzoloto)
{
echo'<img src="/images/st/zoloto.gif"alt=""/>';
}
if(isset($_SESSION['sespass']) && isset($passw_in) && $_SESSION['sespass'] == $passw_in)
{
if($icon_text == "1" || $icon_text == "")
{
echo" <a href=\"../../modules/kabinet/send_privat.php?nick=$name_user&".session_name()."=".session_id()."\"><img src=\"/themes/chuma/1.gif\"align=\"top\"title=\"Написать сообщение\"alt=\"\"></a>";
if($name_user == $login_in)
{
echo" <a href=\"admin.php?act=edit&str_t=$str_t&id=$id&str=$str&str_r=$str_r&page=$page_get&".session_name()."=".session_id()."\"><img src=\"/images/st/r.gif\"align=\"top\"title=\"Редактировать сообщение\"alt=\"\"></a> ";
}
echo" <a href=\"add.php?otv=1&str_t=$str_t&id=$id&str=$str&str_r=$str_r&page=$page_get&".session_name()."=".session_id()."\"><img src=\"/images/st/g.gif\"align=\"top\"title=\"Ответить\"alt=\"\"></a> ";
echo" <a href=\"add.php?cit=1&str_t=$str_t&id=$id&str=$str&str_r=$str_r&page=$page_get&".session_name()."=".session_id()."\"><img src=\"/images/st/c.gif\"align=\"top\"title=\"Цитировать\"alt=\"\"></a> ";
}
if($icon_text == "0")
{
echo" <a href=\"../../modules/kabinet/send_privat.php?nick=$name_user&".session_name()."=".session_id()."\">[ЛС]</a>";
if($name_user == $login_in)
{
echo" <a href=\"admin.php?act=edit&str_t=$str_t&id=$id&str=$str&str_r=$str_r&page=$page_get&".session_name()."=".session_id()."\">[Ред]</a> ";
}
echo" <a href=\"add.php?otv=1&str_t=$str_t&id=$id&str=$str&str_r=$str_r&page=$page_get&".session_name()."=".session_id()."\">[Отв]</a> ";
echo" <a href=\"add.php?cit=1&str_t=$str_t&id=$id&str=$str&str_r=$str_r&page=$page_get&".session_name()."=".session_id()."\">[Цит]</a> ";
}
}
echo '<br />';
echo "($date_user / $time_user)<br />";
echo "$mess_user<br />";
if(!empty($name_izm))
{
user_data('../../data/users/'.$name_izm.'.php');
$nick_name_arr = explode('::', $nickname);
$nickname = $nick_name_arr[0];
$nickcolor = $nick_name_arr[1];
if(!empty($nickname))
{
if(!empty($nickcolor))
{
$login_nick_color = "$nickname";
}
else
{
$login_nick_color = "$nickname";
}
}
else
{
$login_nick_color = "$name_izm";
}
echo "<br /><font class=\"edited\">Изменил $login_nick_color ($date_izm $time_izm)</font>";
}
echo '</p>';
if($n == 1)
{
if($top_tema == 1)
{
echo "<p class=\"a\" style=\"margin-top:0px\"><img src=\"/themes/chuma/01.gif\"> Тема закреплена!<br /></p>";
}
}
if(isset($_SESSION['sespass']) && isset($passw_in) && $_SESSION['sespass'] == $passw_in && ($status_in == '1' || $status_in == '2' || $status_in == '3'))
{
echo'<p class="dy">';
echo"[<a href=\"admin.php?act=delmes&str_t=$str_t&id=$id&str=$str&str_r=$str_r&page=$page_get&".session_name()."=".session_id()."\"onclick=\"return confirm('Подтверждаете удаление?')\">Удал</a>][<a href=\"admin.php?act=edit&str_t=$str_t&id=$id&str=$str&str_r=$str_r&page=$page_get&".session_name()."=".session_id()."\">Ред</a>]";
echo "[<a href=\"admin.php?act=banuser&id=$id&str=$str&str_r=$str_r&ban=$name_user&page=$page_get&".session_name()."=".session_id()."\">Бан</a>]";
echo"</p>";
}
}
}
if($stranic > 1)
{
echo "<p align=\"center\" class=\"d\">";
echo "Страницы:";
echo "<br />";
if($page_get > 4)
{
echo "<a href=\"showtema.php?id=$id&str=$str&str_r=$str_r&page=1&".session_name()."=".session_id()."\">1</a>...";
}
$start_1 = $page_get - 3;
$end_1 = $page_get - 1;
if($start_1 < 1)
{
$start_1 = 1;
}
for($i = $start_1; $i <= $end_1; $i++)
{
echo"<a href=\"showtema.php?id=$id&str=$str&str_r=$str_r&page=$i&".session_name()."=".session_id()."\">$i</a> ";
}
echo"$page_get";
$start_2 = $page_get + 1;
$end_2 = $page_get + 3;
if($start_2 < 1)
{
$start_2 = 1;
}
if($end_2 > $stranic)
{
$end_2 = $stranic;
}
for($i = $start_2; $i <= $end_2; $i++)
{
echo" <a href=\"showtema.php?id=$id&str=$str&str_r=$str_r&page=$i&".session_name()."=".session_id()."\">$i</a>";
}
if($stranic > $page_get && $page_get < ($stranic-3))
{
echo "...<a href=\"showtema.php?id=$id&str=$str&str_r=$str_r&page=$stranic&".session_name()."=".session_id()."\">$stranic</a>";
}
echo "<br />";
if($page_get > 1)
{
echo "<a href=\"showtema.php?id=$id&str=$str&str_r=$str_r&page=$page_nazad&".session_name()."=".session_id()."\">Назад</a>";
}
echo " | ";
if($stranic > $page_get)
{
echo "<a href=\"showtema.php?id=$id&str=$str&str_r=$str_r&page=$page_dalee&".session_name()."=".session_id()."\">Дальше</a>";
}
echo "</p>";
}
echo "<p>Сообщений в теме: $tem_count</p>";
if(isset($_SESSION['sespass']) && isset($passw_in) && $_SESSION['sespass'] == $passw_in && empty($tema_zakr))
{
echo "<form action=\"add.php?id=$id&str=$str&str_r=$str_r&act=send&page=$stranic&".session_name()."=".session_id()."\" method=\"post\">";
echo "<p class=\"b\" align=\"center\">Сообщение:<br />
<textarea rows=\"4\" cols=\"15\" name=\"msg\"></textarea><br />";
if($trans == '1')
{
echo"<input type=\"checkbox\" name=\"msgtrans\" value=\"1\" /> Транслит<br />";
}
echo"<input type=\"submit\" value=\"Ответить\" /></p>
</form>";
}
echo'<p><img src="/images/st/dload.gif"alt=""/> <a href="save_tema.php?id='.$id.'&str='.$str.'&str_r='.$str_r.'&'.session_name().'='.session_id().'">Сохранить в txt</a><br /></p>';
}
else
{
echo"<p class=\"err\">Попытка взлома или вы пытаетесь просмотреть несуществующую тему!<br /></p>";
}
}
else
{
echo'<p class="err">Вы не авторизованы!!! Войдите в личный кабинет.<br /></p>';
echo'<p><br /><a href="../kabinet/index.php?'.session_name().'='.session_id().'">В кабинет</a><br /></p>';
}
####################
echo'<p><img src="/images/st/back.gif"alt=""/> <a href="index.php?'.session_name().'='.session_id().'">В форум</a><br /></p>';
}
include ('../../templates/foot.php');
?>