Файл: l2ps_v5/library.php
Строк: 481
<?php
include ("files/ini.php");
include ("files/zag.php");
$polz=mysql_query("SELECT * FROM `users` WHERE `udata0`='$log' AND `udata1`='$pas' LIMIT 1");
if(mysql_num_rows($polz)==0){
header ("Location: index.php?error");
echo'<div class="p">Ошибка! Пользователь с таким логином и паролем не зарегистрирован, или пароль/логин неверен! <a href="index.php">На главную</a><br>';exit;
}else{
switch($_GET[mod]){
default:
if($game=="quest"){
echo"<u>Задания</u>:<br/><br />";
$num = 10;
$page = $_GET['page'];
$result = mysql_query("SELECT COUNT(*) FROM `l2pirates_quest` WHERE `profession`='' ORDER BY `id` DESC ");
$posts = mysql_result($result, 0);
$total = intval(($posts - 1) / $num) + 1;
$page = intval($page);
if(empty($page) or $page < 0) $page = 1;
if($page > $total) $page = $total;
$start = $page * $num - $num;
$user_quest= mysql_query("SELECT * FROM `l2pirates_quest` WHERE `profession`='' ORDER BY `id` DESC LIMIT $start,$num ");
while($us = mysql_fetch_array($user_quest)){
echo"<a href='/quest_info/info/$us[id]/'>$us[name]</a> (";
echo" <i>$us[gorod]</i> )<br>";
}
echo"<br>";
if ($page != 1) $pervpage = '<a href=/quest_info/1/>1</a> ... ';
if ($page != $total) $nextpage = ' ... <a href=/quest_info/' .$total. '/>' .$total. '</a>';
if($page - 2 > 0) $page2left = ' <a href=/quest_info/'. ($page - 2) .'/>'. ($page - 2) .'</a> ';
if($page - 1 > 0) $page1left = '<a href=/quest_info/'. ($page - 1) .'/>'. ($page - 1) .'</a> ';
if($page + 2 <= $total) $page2right = ' <a href=/quest_info/'. ($page + 2) .'/>'. ($page + 2) .'</a>';
if($page + 1 <= $total) $page1right = ' <a href=/quest_info/'. ($page + 1) .'/>'. ($page + 1) .'</a>';
if($page>2){echo $pervpage;}
echo $page1left.'(<b>'.$page.'</b>)'.$page1right.$nextpage;
include ("files/down.php");
exit;
}
if($game=="info"){
$quest = mysql_query("SELECT * FROM `l2pirates_quest` WHERE `id`='".abs(intval($_GET[id]))."' LIMIT 1 ");
if(mysql_num_rows($quest)==1){
////////////////////////////////////////////////////Сдать квест................/////////////////////////////////////////////////////////////////
$q=mysql_fetch_array($quest);
echo"<b>$q[name]</b><br>$q[text]<br><br>";
$quest_item = mysql_query("SELECT * FROM `l2pirates_quest_item` WHERE `quest_id`='".abs(intval($_GET[id]))."' ");
while($q_i=mysql_fetch_array($quest_item)){
echo"<i>$q_i[name]</i> ( $q_i[kol] ед. , Выпадает из : <u>$q_i[name_mob]</u> ";
$mobs = mysql_query("SELECT * FROM `npc` WHERE `name`='$q_i[name_mob]' LIMIT 1 ");
$m=mysql_fetch_array($mobs);
echo", Окрестность: <i>$m[location]</i> )<br>";
}
echo"<br><b>Награда:</b><br><br>";
$armor = mysql_query("SELECT * from `armor` WHERE `item_id`='$q[item]' LIMIT 1");
if(mysql_num_rows($armor)==1){
$arm=mysql_fetch_array($armor);
if($arm[crystal_type]=="NG"){$arm[crystal_type]="Без ранга";}
if($arm[crystal_type]=="D"){$rang="(с <font color=green>20</font> уровня)";}
if($arm[crystal_type]=="C"){$rang="(с <font color=green>40</font> уровня)";}
if($arm[crystal_type]=="B"){$rang="(с <font color=green>52</font> уровня)";}
if($arm[crystal_type]=="A"){$rang="(с <font color=green>62</font> уровня)";}
if($arm[crystal_type]=="S"){$rang="(с <font color=green>76</font> уровня)";}
if($arm[bodypart]=="shield"){$tip="Щит";}
if($arm[bodypart]=="head"){$tip="Шлем"; }
if($arm[bodypart]=="chest"){$tip="Верх";}
if($arm[bodypart]=="legs"){$tip="Низ"; }
if($arm[bodypart]=="feet"){$tip="Ботинки";}
if($arm[bodypart]=="gloves"){$tip="Перчатки"; }
if($arm[bodypart]=="fullarmor"){$tip="Комплект брони"; }
if($arm[bodypart]=="earing"){$tip="Серьга";}
if($arm[bodypart]=="ring"){$tip="Кольцо"; }
if($arm[bodypart]=="neck"){$tip="Ожерелье";}
if($arm[bodypart]=="pet"){$tip="Броня для питомца";}
if($arm[bodypart]=="ring" and $arm[bodypart]=="earing" and $arm[bodypart]=="neck"){
echo"Вещь : <a href='/shop/info/mdef/$arm[item_id]/'><b>$arm[name]</b></a> ( $tip , $arm[crystal_type] $rang )<br>";
}else{
echo"Вещь : <a href='/shop/info/def/$arm[item_id]/'><b>$arm[name]</b></a> ( $tip , $arm[crystal_type] $rang )<br>";
}
}
$weapon = mysql_query("SELECT * from `weapon` WHERE `item_id`='$q[item]' LIMIT 1");
if(mysql_num_rows($weapon)==1){
$w=mysql_fetch_array($weapon);
if($w[weaponType]=="sword"){$tip="Меч";}
if($w[weaponType]=="dual"){$tip="Сдвоенный меч"; }
if($w[weaponType]=="blunt"){$tip="Булава";}
if($w[weaponType]=="etc"){$tip="Книга"; }
if($w[weaponType]=="dagger"){$tip="Кинжал";}
if($w[weaponType]=="dualfist"){$tip="Кастет"; }
if($w[weaponType]=="bow"){$tip="Лук"; }
if($w[weaponType]=="pole"){$tip="Пика"; }
if($w[weaponType]=="rod"){$tip="Удочка";}
if($w[weaponType]=="pet"){$tip="Оружие для питомца";}
if($w[crystal_type]=="NG"){$w[crystal_type]="Без ранга";}
if($w[crystal_type]=="D"){$rang="(с <font color=green>20</font> уровня)";}
if($w[crystal_type]=="C"){$rang="(с <font color=green>40</font> уровня)";}
if($w[crystal_type]=="B"){$rang="(с <font color=green>52</font> уровня)";}
if($w[crystal_type]=="A"){$rang="(с <font color=green>62</font> уровня)";}
if($w[crystal_type]=="S"){$rang="(с <font color=green>76</font> уровня)";}
echo"Вещь : <a href='/shop/info/weapon/$w[item_id]/'><b>$w[name]</b></a> ( $tip , $s[crystal_type] $rang )<br>";
}
$pet = mysql_query("SELECT * from `l2pirates_shop_pet` WHERE `id`='$q[item]' LIMIT 1");
if(mysql_num_rows($pet)==1){
$p=mysql_fetch_array($pet);
echo"Животное : <b>$p[name]</b><br>";
}
if($q[script]=="/trade_area.php"){$q[script]="Торговая Площадь";}
if($q[script]=="/bank.php"){$q[script]="Банк";}
if($q[script]=="/clan.php"){$q[script]="Кланы";}
if($q[script]=="/werehouse.php"){$q[script]="Хранилище";}
if($q[script]=="/teleport.php"){$q[script]="Телепорт";}
if($q[script]=="/beginers.php"){$q[script]="Помошник Новичков";}
if($q[script]=="/olympiad.php"){$q[script]="Олимпиада";}
if($q[script]=="/manor.php"){$q[script]="Манор";}
if($q[script]=="/clan_holl.php"){$q[script]="Аукционер";}
if($q[script]=="/town.php"){$q[script]="Город";}
echo"Дополнительно: ".number_format($q[aden])." аден<br><br>Задание находиться в городе <i>$q[gorod]</i> (<b>$q[script]</b>)<br><br>";
echo"<b>Задание доступно персонажам с $q[min_level] по $q[max_level] уровень.</b>";
}else{echo"Неверный ID.";}
include ("files/down.php");
exit;
}
if($game=="newforum"){
if($udata67 == "777"){
$g=mysql_query("SELECT * FROM `l2pirates_faq_forums` WHERE `id`='$id' LIMIT 1");
if(mysql_num_rows($g)==1){
if($udata9<"20"){echo "Форум доступен с 20-го уровня.";
}}else{echo"Вы не админ!";
include ("files/down.php");
exit;
}
echo'<form method="post" action="?game=newforums&id='.$id.'&uid='.$uid.'">';
echo "Название темы:<br/>";
echo "<input class="button" name="nazva" maxlength="30" title="Название темы" emptyok="true"/>";
echo "<br/>Текст сообщения:<br/>";
echo "<input class="button" name="msg" maxlength="500" title="Сообщение" emptyok="true"/><br/>";
echo '<input type="checkbox" name="transi" value="ok"> Транслировать название темы?<br/>';
echo '<input type="checkbox" name="transik" value="ok"> Транслировать название сообщение?<br/>';
echo '<input class="button" type="submit" value="Ок"/></form>';
}else{echo "Такой раздел не существует!";
header ("Location: ?");
}
include ("files/down.php");
exit;
}
if($game=="newforums"){
$g=mysql_query("SELECT * FROM `l2pirates_faq_forums` WHERE `id`='$id' LIMIT 1");
if(mysql_num_rows($g)==1){
if(empty($nazva)){
header ("Location: ?game=theme&id=$id");
include ("files/down.php");
exit;
}
if(empty($msg)){
header ("Location: ?game=theme&id=$id");
include ("files/down.php");
exit;
}
if($transi=="ok"){
require_once "files/translit.php";
if(ereg("[а-яА-Я]",$nazva)){}else{
$nazva=str_replace($trans1,$trans2,$nazva);}
}
if($transik=="ok"){
require_once "files/translit.php";
if(ereg("[а-яА-Я]",$msg)){}else{
$msg=str_replace($trans1,$trans2,$msg);}
}
$time = date("H:i d.m.y");
$new = "INSERT INTO l2pirates_faq_themes VALUES('$id','','$nazva','$log','$time','1','1','$log')";
$result = mysql_query($new);
$u=mysql_query("SELECT * FROM `l2pirates_faq_themes` ORDER by `uid` DESC");
$dat=mysql_fetch_array($u);
$uids=$dat[uid];
$mg = "INSERT INTO l2pirates_faq_forummsgs VALUES('$id','$uids','0','$log','$time','$msg')";
$result = mysql_query($mg);
$result666 = mysql_query("SELECT * FROM `l2pirates_faq_forums` WHERE `id`='".$id."'");
$po = mysql_fetch_array($result666);
$msg=$po[forumthemes]+1;
$msg2=$po[forummsg]+1;
mysql_query("UPDATE `l2pirates_faq_forums` SET `forumthemes`='$msg',`forummsg`='$msg2' WHERE `id`='$id'");
mysql_query("UPDATE `l2pirates_faq_forumosts` SET `nick`='$log'");
header ("Location: ?game=tem&id=$id&uid=$uids");
}else{echo "Такой раздел не существует!";
header ("Location: ?");
}
include ("files/down.php");
exit;
}
if($game=="saves"){
$g=mysql_query("SELECT * FROM `l2pirates_faq_themes` WHERE `id`='$id' AND `uid`='$uid' LIMIT 1");
if(mysql_num_rows($g)==1){
if(empty($msg)){
header ("Location: ?game=say&id=$id&uid=$uid");
include ("files/down.php");
exit;
}
if($transi=="ok"){
require_once "files/translit.php";
if(ereg("[а-яА-Я]",$msg)){}else{
$msg=str_replace($trans1,$trans2,$msg);}
}
$time = date("H:i d.m.y");
$q = mysql_query("SELECT COUNT(`aid`) FROM `l2pirates_faq_forummsgs` WHERE `uid`='$uid'");
$aid = mysql_result($q, 0);
$otvet = "INSERT INTO l2pirates_faq_forummsgs VALUES('$id','$uid','$aid','$log','$time','$msg')";
$result = mysql_query($otvet);
$result666 = mysql_query("SELECT * FROM `l2pirates_faq_forums` WHERE `id`='".$id."'");
$po = mysql_fetch_array($result666);
$msg2=$po[forummsg]+1;
mysql_query("UPDATE `l2pirates_faq_forums` SET `forummsg`='$msg2' WHERE `id`='$id'");
$result666 = mysql_query("SELECT * FROM `l2pirates_faq_themes` WHERE `uid`='".$uid."'");
$po = mysql_fetch_array($result666);
$msg2=$po[msg]+1;
mysql_query("UPDATE `l2pirates_faq_themes` SET `msg`='$msg2',`posl`='$log' WHERE `uid`='$uid'");
mysql_query("UPDATE `l2pirates_faq_forumosts` SET `nick`='$log'");
header ("Location: ?game=tem&id=$id&uid=$uid");
}else{echo "Такая тема не существует!";
header ("Location: ?");
}
include ("files/down.php");
exit;
}
if($game=="say"){
if($udata67 == "777"){
$g=mysql_query("SELECT * FROM `l2pirates_faq_themes` WHERE `id`='$id' AND `uid`='$uid' LIMIT 1");
if(mysql_num_rows($g)==1){
if($udata9<"20"){echo "Форум доступен с 20-го уровня.";
}}else{echo"Вы не админ!";
include ("files/down.php");
exit;
}
$result666 = mysql_query("SELECT * FROM `l2pirates_faq_themes` WHERE `uid`='".$uid."'");
$onoff = mysql_fetch_array($result666);
if($onoff[onoff]=="0"){
echo "Этот топик закрыт!";
include ("files/down.php");
exit;
}
echo'<form method="post" action="?game=saves&id='.$id.'&uid='.$uid.'">';
echo "Текст сообщения:<br/>";
echo "<input class="button" name="msg" maxlength="500" title="Сообщение" emptyok="true"/><br/>";
echo '<input type="checkbox" name="transi" value="ok"> Транслит?<br/>';
echo '<input class="button" type="submit" value="Написать"/></form>';
}else{echo "Такая тема не существует!";
header ("Location: ?");
}
include ("files/down.php");
exit;
}
if($game=="tem"){
$req = mysql_query("SELECT * FROM `l2pirates_faq_themes` WHERE `uid`='$uid' LIMIT 1");
////////////////////////////
$avto=mysql_num_rows($req);
if($avto>=1){
While($mags = mysql_fetch_array($req))
{
$ws=explode("*",$mags[name]);
$req = mysql_query("SELECT * FROM `l2pirates_faq_forums` WHERE `id`='$id' LIMIT 1");
////////////////////////////
$avto=mysql_num_rows($req);
if($avto>=1){
While($mag = mysql_fetch_array($req))
{
$w=explode("*",$mag[forumname]);
echo"<b>$mag[forumname]</b><div class='bts'></div>";
echo "<img src="l2pic/logo/forumtext.gif"> <a href="library.php">Библиотека</a> / <img src="l2pic/logo/forumtext.gif"> <a href="?game=theme&id=$id">$mag[forumname]</a> / <img src="l2pic/logo/forumtext.gif"> $mags[name]<hr>";
//echo '<img src='l2pic/logo/forumtext.gif'> <a href="library.php?game=golos&id='.$gallery[id].'">Полезная стятья?</a> ('.$gallery[ocenka].')<hr/>';
}}
}}
$g=mysql_query("SELECT * FROM `l2pirates_faq_themes` WHERE `id`='$id' AND `uid`='$uid' LIMIT 1");
if(mysql_num_rows($g)==1){
$q = mysql_query("SELECT COUNT(`oid`) FROM `l2pirates_faq_forummsgs` WHERE `oid`='$id' AND `uid`='$uid'");
$kmsg = mysql_result($q, 0);
//echo "<img src="l2pic/logo/forumtext.gif"> В теме сообщений (<b>$kmsg</b>)<div class='bts'></div>";
if(empty($startan)) $startan = 0;
$startan=intval($startan);
if($startan<0) $startan=0; $num_msgs_an=1;
$qi = mysql_query("SELECT * FROM `l2pirates_faq_forummsgs` WHERE `oid`='$id' AND `uid`='$uid' ORDER by `aid` ASC LIMIT $startan,$num_msgs_an");
while($row=mysql_fetch_array($qi))
{
$req = mysql_query("SELECT * FROM `users` WHERE `udata0` = '$row[autor]'");
$pic = mysql_fetch_array($req);
/*if($udata67 == "777" or $udata67 == "200"){
echo " <a href="search.php?nick=$row[autor]&go=go"><font color='lime'>$row[autor].GM</font></a>";
}else{
if($udata67 == "501" or $udata67 == "500" or $udata67 == "100"){
echo " <a href="search.php?nick=$row[autor]&go=go"><font color='DeepSkyBlue'>$row[autor]</font></a>";
}else{
if($udata67 == "503" or $udata67 == "504" or $udata67 == "505"){
echo " <a href="search.php?nick=$row[autor]&go=go"><font color='gold'>$row[autor]</font></a>";
}else{*/
echo "Автор: <a href="search.php?nick=$row[autor]&go=go"><font color='lime'>$row[autor].GM</font> </a>|";
//}}}
echo" Дата добавления:<font color=#999999>($row[time])</font><hr>";
//$koment = strip_tags($row['msg']);
//$koment = smiles($koment);
echo" - $row[msg] <small></small>";
//echo"<br/>$koment";
echo"<br/><div class='bts'></div>";
}
$result666 = mysql_query("SELECT * FROM `l2pirates_faq_themes` WHERE `uid`='".$uid."'");
$onoff = mysql_fetch_array($result666);
$req = mysql_query("SELECT * FROM `l2pirates_faq_themes` WHERE `uid`='$uid' LIMIT 1");
////////////////////////////
$avto=mysql_num_rows($req);
if($avto>=1){
While($mags = mysql_fetch_array($req))
{
if($onoff[onoff]=="1"){
if($mags[autor]=="$log"){
echo"<img src='/l2pic/logo/forums1.png' alt='*'/> <a href="?game=okclose2&id=$id&uid=$uid">Закрыть топик</a><br>";
}}}}
if($onoff[onoff]=="1"){
if($udata67 == "777"){
echo "<img src='/l2pic/logo/forums1.png' alt='*'/> <a href="?game=say&id=$id&uid=$uid">Добавить сообщение</a><br/>";
}
if($udata67 == "777" or $udata67 == "200" or $udata67 == "501" or $udata67 == "500" or $udata67 == "100"){
echo "<img src='/l2pic/logo/forums1.png' alt='*'/> <a href="?game=okclose&id=$id&uid=$uid">Закрыть топик</a><br/>";
}
}else{
echo "<font color=red>Конец статьи!</font>";
if($udata67 == "777" or $udata67 == "200" or $udata67 == "501" or $udata67 == "500" or $udata67 == "100"){
echo "<hr><img src='/l2pic/logo/forums1.png' alt='*'/> <a href="?game=okclose&id=$id&uid=$uid">Открыть топик</a><br/>";
}
}
if($udata67 == "777" or $udata67 == "200" or $udata67 == "501" or $udata67 == "500" or $udata67 == "100"){
echo "<img src='/l2pic/logo/forums1.png' alt='*'/> <a href="?game=deltem&id=$id&uid=$uid">Удалить топик</a><br/>";
}
$q = mysql_query("SELECT COUNT(`uid`) FROM `l2pirates_faq_forummsgs` WHERE `uid`='$uid'");
$kol = mysql_result($q, 0);
echo "<div class='bts'></div>";
if($startan!= 0) $page2left = ' <a href= ?game=tem&startan='. ($startan - 1) .'&page='.($page-1).'&id='.$id.'&uid='.$uid.'>'. ($page - 1) .'</a> | ';
if(empty($page)){$page=1;}
if($kol > $startan + 1) $page2right = ' | <a href= ?game=tem&startan='. ($startan + 1) .'&page='. ($page+1) .'&id='.$id.'&uid='.$uid.'>'. ($page + 1) .'</a>';
echo $page2left.'<b>('.$page.')</b>'.$page1right.$page2right.'<br/>';
}else{echo "Такая тема не существует!";
header ("Location: ?");
}
include ("files/down.php");
exit;
}
if($game=="deltem"){
if($udata67 == "777"){
$result666 = mysql_query("SELECT * FROM `l2pirates_faq_forums` WHERE `id`='".$id."'");
$po = mysql_fetch_array($result666);
$msg2=$po[forumthemes]-1;
$q = mysql_query("SELECT COUNT(`uid`) FROM `l2pirates_faq_forummsgs` WHERE `uid`='".$uid."' AND `oid`='".$id."'");
$kol = mysql_result($q, 0);
$msg=$po[forummsg]-$kol;
mysql_query("UPDATE `l2pirates_faq_forums` SET `forummsg`='$msg',`forumthemes`='$msg2' WHERE `id`='$id'");
mysql_query("DELETE FROM `l2pirates_faq_themes` WHERE `uid`='".$uid."'");
mysql_query("DELETE FROM `l2pirates_faq_forummsgs` WHERE `uid`='".$uid."'");
echo "Тема удалена!";
header ("Location: ?game=theme&id=$id");
}else{echo"Вы не админ!";
header ("Location: ?");
}
include ("files/down.php");
exit;
}
if($game=="okclose2"){
$g=mysql_query("SELECT * FROM `l2pirates_faq_themes` WHERE `id`='$id' AND `uid`='$uid' AND `autor`='$log' LIMIT 1");
if(mysql_num_rows($g)==1){
if($log=="$log"){
$result666 = mysql_query("SELECT * FROM `l2pirates_faq_themes` WHERE `uid`='".$uid."'");
$onoff = mysql_fetch_array($result666);
if($onoff[onoff]=="1"){
mysql_query("UPDATE `l2pirates_faq_themes` SET `onoff`='0' WHERE `uid`='$uid'");
echo "Топик закрыт!";
header ("Location: ?game=tem&id=$id&uid=$uid");
}
}else{echo"Вы не админ!";
header ("Location: ?");
}
}else{echo "Такая тема не существует!";
header ("Location: ?");
}
include ("files/down.php");
exit;
}
if($game=="okclose"){
$g=mysql_query("SELECT * FROM `l2pirates_faq_themes` WHERE `id`='$id' AND `uid`='$uid' LIMIT 1");
if(mysql_num_rows($g)==1){
if($udata67 == "777"){
$result666 = mysql_query("SELECT * FROM `l2pirates_faq_themes` WHERE `uid`='".$uid."'");
$onoff = mysql_fetch_array($result666);
if($onoff[onoff]=="1"){
mysql_query("UPDATE `l2pirates_faq_themes` SET `onoff`='0' WHERE `uid`='$uid'");
echo "Топик закрыт!";
header ("Location: ?game=tem&id=$id&uid=$uid");
}else{
mysql_query("UPDATE `l2pirates_faq_themes` SET `onoff`='1' WHERE `uid`='$uid'");
echo "Топик открыт!";
header ("Location: ?game=tem&id=$id&uid=$uid");
}
}else{echo"Вы не админ!";
header ("Location: ?");
}
}else{echo "Такая тема не существует!";
header ("Location: ?");
}
include ("files/down.php");
exit;
}
if($game=="theme"){
$req = mysql_query("SELECT * FROM `l2pirates_faq_forums` WHERE `id`='$id' LIMIT 1");
////////////////////////////
$avto=mysql_num_rows($req);
if($avto>=1){
While($mag = mysql_fetch_array($req))
{
$w=explode("*",$mag[forumname]);
echo"<b>$mag[forumname]</b><div class='bts'></div>";
echo "<img src="l2pic/logo/forumtext.gif"> <a href="library.php">Библиотека</a> / $mag[forumname]<hr>";
}}
$g=mysql_query("SELECT * FROM `l2pirates_faq_forums` WHERE `id`='$id' LIMIT 1");
if(mysql_num_rows($g)==1){
$q = mysql_query("SELECT COUNT(`id`) FROM `l2pirates_faq_themes` WHERE `id`='$id'");
$kol = mysql_result($q, 0);
if($kol=="0"){echo "В данном разделе пока нет статей.<br>";}
if(empty($startan)) $startan = 0;
$startan=intval($startan);
if($startan<0) $startan=0; $num_msgs_an=5;
$qi = mysql_query("SELECT * FROM `l2pirates_faq_themes` WHERE `id`='$id' ORDER by `uid` DESC LIMIT $startan,$num_msgs_an");
while($row=mysql_fetch_array($qi))
{
if($row[autor]=="$log"){
echo "";
}
if($row[onoff]=="0"){
echo "<img src='/l2pic/logo/them_01.png' alt='*'/> ";
}
$req = mysql_query("SELECT * FROM `users` WHERE `udata0` = '$row[autor]'");
$pic = mysql_fetch_array($req);
/*if($udata67 == "200" or $log == "Bopo6eu"){
echo " <a href="search.php?nick=$row[autor]&go=go"><font color='lime'>$row[autor].GM</font></a>";
}else{
if($udata67 == "501" or $udata67 == "500" or $udata67 == "100"){
echo " <a href="search.php?nick=$row[autor]&go=go"><font color='DeepSkyBlue'>$row[autor]</font></a>";
}else{
if($udata67 == "503" or $udata67 == "504" or $udata67 == "505"){
echo " <a href="search.php?nick=$row[autor]&go=go"><font color='gold'>$row[autor]</font></a>";
}else{*/
//echo " <a href="search.php?nick=$row[autor]&go=go">$row[autor]</a>";
//}}}
echo" <br/><img src="l2pic/logo/forumtext.gif">
<a href="?game=tem&id=$row[id]&uid=$row[uid]">$row[name]</a> <small><font color=#999999>($row[time])</font></small><br/>";
$req = mysql_query("SELECT * FROM `users` WHERE `udata0` = '$row[posl]'");
$pic = mysql_fetch_array($req);
/*if($udata67 == "200" or $udata67 == "777"){
echo " <a href="search.php?nick=$row[posl]&go=go"><font color='lime'>$row[posl].GM</font></a>";
}else{
if($udata67 == "501" or $udata67 == "500" or $udata67 == "100"){
echo " <a href="search.php?nick=$row[posl]&go=go"><font color='DeepSkyBlue'>$row[posl]</font></a>";
}else{
if($udata67 == "503" or $udata67 == "504" or $udata67 == "505"){
echo " <a href="search.php?nick=$row[posl]&go=go"><font color='gold'>$row[posl]</font></a>";
}else{*/
//echo " <a href="search.php?nick=$row[posl]&go=go">$row[posl]</a>";
//}}}
echo"<div class='bts'></div>";
}
if($udata67 == "777"){
echo "<img src='/l2pic/logo/forums1.png' alt='*'/> <a href="?game=newforum&id=$id">Новая статья</a>";}
echo"<div class='bts'></div>";
$q = mysql_query("SELECT COUNT(`id`) FROM `l2pirates_faq_themes` WHERE `id`='$id'");
$kol = mysql_result($q, 0);
if($startan!= 0) $page2left = ' <a href= ?game=tem&startan='. ($startan - 5) .'&page='.($page-1).'&id='.$id.'&uid='.$uid.'>'. ($page - 1) .'</a> | ';
if(empty($page)){$page=1;}
if($kol > $startan + 5) $page2right = ' | <a href= ?game=tem&startan='. ($startan + 5) .'&page='. ($page+1) .'&id='.$id.'&uid='.$uid.'>'. ($page + 1) .'</a>';
echo $page2left.'<b>('.$page.')</b>'.$page1right.$page2right.'<br/>';
include ("files/down.php");
exit;
}}
if($game=="razsave"){
if($udata67 == "777"){
if(empty($forumname)){
header ("Location: ?game=addraz");
include ("files/down.php");
exit;
}
$raz = "INSERT INTO l2pirates_faq_forums VALUES('','$forumname','0','0')";
$result = mysql_query($raz);
echo "Раздел успешно создан!";
header ("Location: ?");
}else{echo"Вы не админ!";
header ("Location: ?");
}
include ("files/down.php");
exit;
}
if($game=="addraz"){
if($udata67 == "777"){
echo'<form method="post" action="?game=razsave">';
echo "Название раздела:<br/>";
echo "<input class="button" name="forumname" maxlength="30" title="Название раздела" emptyok="true"/>";
echo '<input class="button" type="submit" value="Добавить"/></form>';
}else{echo"Вы не админ!";
header ("Location: ?");
}
include ("files/down.php");
exit;
}
if($game=="statia_del_ok"){
if($udata67 == "777"){
$g=mysql_query("SELECT * FROM `l2pirates_faq_statia` WHERE `id`='$id' LIMIT 1");
if(mysql_num_rows($g)==0){
echo "Такая статья на модерации не существует!";
include ("files/down.php");
exit;}
mysql_query("DELETE FROM `l2pirates_faq_statia` WHERE id='".mysql_real_escape_string($_GET['id'])."' LIMIT 1");
header ("Location: ?game=mod");
}else{echo"Вы не админ!";
header ("Location: ?");
}
include ("files/down.php");
exit;
}
if($game=="mod"){
if($udata67 == "777"){
echo '<center>Модерация статей</center></a><hr/>';
echo '<a href=library.php?game=alldelmodstatia>Очистить все</a><hr/>';
if(empty($startan)) $startan = 0;
$startan=intval($startan);
if($startan<0) $startan=0; $num_msgs_an=5;
$qi = mysql_query("SELECT * FROM `l2pirates_faq_statia` ORDER by `id` DESC LIMIT $startan,$num_msgs_an");
$i=$startan+1;
while($row=mysql_fetch_array($qi)){
echo '<br/>'.$i++.') <font color="red">Раздел</font> <b>'.$row['razdel'].'</b><br/><font color="red">Название</font> <b> <font color="lime">'.$row['name'].'</font></b><font color="red"> Дата</font> ('.$row['time'].')<br/><font color="red">Статья</font> <font color=#999999>'.$row['text'].'</font><br/><u>Опубликовал:</u> ';
echo ''.$row['avtor'].'</a><br/>';
echo ' <a href="?game=statia_del_ok&id='.$row['id'].'">Удалить</a><hr/>';}
$q = mysql_query("SELECT COUNT(`id`) FROM `l2pirates_faq_statia`");
$kol = mysql_result($q, 0);
if($startan!= 0) $page2left = ' <a href= ?game=mod&startan='. ($startan - 5) .'&page='.($page-1).'>'. ($page - 1) .'</a> | ';
if(empty($page)){$page=1;}
if($kol > $startan + 5) $page2right = ' | <a href= ?game=mod&startan='. ($startan + 5) .'&page='. ($page+1) .'>'. ($page + 1) .'</a>';
echo $page2left.'<b>('.$page.')</b>'.$page1right.$page2right.'<br/>';
if ($startan != 0) {echo '<a href="?game=mod&startan='.($startan - 5).'&page='.($page-1).'">Назад</a> ';}
if ($kol > $startan + 5) {echo ' <a href="?game=mod&startan='.($startan + 5).'&page='.($page+1).'">Далее</a>';}
echo '<br/><a href=?>В библу</a>';
}else{echo"Вы не админ!";
header ("Location: ?");
}
include ("files/down.php");
exit;
}
if($game=="alldelmodstatia"){
$query="TRUNCATE TABLE `l2pirates_faq_statia`";
$result = mysql_query($query);
echo "Все статьи очищены";
header("Location: ?game=mod");
include ("files/down.php");
exit;
}
if($game=="mystatia"){
include ("files/down.php");
exit;
}
if($game=="statia"){
if(empty($_POST[name])){
echo '<form action="?game=statia" method="post">';
echo"Название статьи<br/>
<input class='input' type="text" size="10" name="name"/><br/>";
echo"Статья<br/>
<textarea name='text' cols='20' rows='4'></textarea><br/>";
echo "Раздел:<br/>
<select name="razdel">
<option value="Вопросы новичков">Вопросы новичков</option>
<option value="Финансовые вопросы">Финансовые вопросы</option>
<option value="Кланы">Кланы</option>
<option value="Альянсы">Альянсы</option>
<option value="Игровое общение">Игровое общение</option>
<option value="Развитие персонажа">Развитие персонажа</option>
<option value="Игровые конкурсы">Игровые конкурсы</option>
<option value="Разное">Разное</option>
</select><br/>";
echo "Автор:<br/>
<select name="Автор">
<option value="Автор">$log</option>
<select><br/>";
echo '<input class="button" type="submit" value="Создать" /></form>';
echo '<a href="?game=mystatia">Мои статьи на модерации</a><br/><br/>';
echo'Для создания полноценных статей вы можете использовать встроенные теги.<br/>
(br) - переход на новую строку<br/>
(page) - переход на новую страницу<br/>
(b)текст(.b) - <b>жирный текст</b><br/>
(s)текст(.s) - <s>зачеркнутый текст</s><br/>
(u)текст(.u) - <u>подчеркнутый текст</u><br/>
(i)текст(.i) - <i>наклонный текст</i><br/>
(big)текст(.big) - <big>большой текст</big><br/>
(small)текст(.small) - <small>маленький текст</small><br/>
(url)файл|форум(.url) - (url)forum|форум(.url) установит ссылку на <a href="forum.php?">форум</a><br/>';
}else{
$time = date("H:i d.m.y");
mysql_query("INSERT INTO
`l2pirates_faq_statia` SET
`name` = '$_POST[name]',
`text` = '$_POST[text]',
`avtor` = '$log',
`time`='$time',
`razdel` = '$_POST[razdel]'");
echo'Статья <b>'.$_POST[name].'</b> создана и отправлена на модерацию!<br/>После одобрения Администрации статья появится в библиотеке!';}
echo"<br/><a href="?">Назад</a>";
include ("files/down.php");
exit;
}
//////////////////
$q = mysql_query("SELECT COUNT(`id`) FROM `l2pirates_faq_forums`;");
$kol = mysql_result($q, 0);
if($kol<="0"){echo "Разделы на форуме еще не создали.";
if($udata67 == "777"){
echo "<br/><img src='/l2pic/logo/forums1.png' alt='*'/> <a href="?game=addraz">Создать раздел</a>| <img src='/l2pic/logo/forums1.png' alt='*'/> <a href="?game=mod">Моделировать статьи</a>(<b>$kol4</b>)";
}
include ("files/down.php");
exit;
}
$qi = mysql_query("SELECT * FROM `l2pirates_faq_forums` ORDER by `id` ASC");
while($row=mysql_fetch_array($qi))
{
echo "<img src="l2pic/logo/forumtext.gif"> <a href="?game=theme&id=$row[id]">$row[forumname]</a> [$row[forumthemes]]<br/>";
}
$q4 = mysql_query("SELECT COUNT(`id`) FROM `l2pirates_faq_statia`;");
$kol4 = mysql_result($q4, 0);
$q1 = mysql_query("SELECT COUNT(`id`) FROM `l2pirates_faq_forums`;");
$kol1 = mysql_result($q1, 0);
$q2 = mysql_query("SELECT COUNT(`aid`) FROM `l2pirates_faq_forummsgs`;");
$kol2 = mysql_result($q2, 0);
$q3 = mysql_query("SELECT COUNT(`id`) FROM `l2pirates_faq_themes`;");
$kol3 = mysql_result($q3, 0);
if($udata67 == "777"){
echo "<br/><img src='/l2pic/logo/forums1.png' alt='*'/> <a href="?game=mod">Моделировать статьи</a> (<b>$kol4</b>)<br/><img src='/l2pic/logo/forums1.png' alt='*'/> <a href="?game=addraz"> Создать раздел</a>";
}
echo "<br/><img src='/l2pic/logo/forums1.png' alt='*'/><a href="?game=statia"> Добавить статью</a>";
$result666 = mysql_query("SELECT * FROM `l2pirates_faq_forumosts`");
$post = mysql_fetch_array($result666);
echo"<br/>
<img src='/l2pic/logo/forums1.png' alt='*'/> Всего в библиотеке разделов: (<b>$kol1</b>)<br/>
<img src='/l2pic/logo/forums1.png' alt='*'/> Всего в библиотеке статьей: (<b>$kol3</b>)<br/>";
}
}
include ("files/down.php");
?>