<?php
session_start();
$mod_title="игра-меню GM-а";
$mod_status="on";
if($mod_status=="on")
{
function mod_body($auth,$adminauth)
{
$level="";
$guildc="";
$arenac="";
if($auth=="ok")
{
$mcl="";
$perms="";
$query = "SELECT * FROM users WHERE login='$_COOKIE[login]'";
$cat = mysql_query ($query);
if(!$cat) exit (mysql_error());
while(list($id,$login,$pass,$mail,$reg,$class,$m,$h,$z,$s,$mon,$gold,$pms,$lvl,$ava,$ban,$online) = mysql_fetch_row($cat))
{
$mcl=$class;
$level=$lvl;
$perms=$pms;
}
$query = "SELECT * FROM count";
$cat = mysql_query ($query);
if(!$cat) exit (mysql_error());
while(list($id,$guild,$arena) = mysql_fetch_row($cat))
{
$guildc=$guild;
$arenac=$arena;
}
echo "
<img src='img/bo.png'> <a href='?do=game/char'>персонаж($level)</a>|<img src='img/bs.png'> <a href='?do=game/history'>история</a><br>
<br>
";
$_pg="0";
$ag="-10";
$_pg2="10";
if(!empty($_GET['_pg']))
{
$ag=$_GET['_pg']-"10";
$_pg=$_GET['_pg'];
$_pg2=$_GET['_pg']+"10";
}
if($perms=="100")
{
if(empty($_GET['dox']))
{
echo "
<form method='POST' action='?do=game/gm/addquest&dox=go'>
имя квеста:<br>
<input type='text' name='name' size='15'><br>
описание:<br>
<textarea name='text'></textarea><br>
мин.лвл:<br>
<input type='text' name='min' size='15' value='0'><br>
макс.лвл:<br>
<input type='text' name='max' size='15' value='0'><br>
нужен item для прохождения:<br>
<input type='text' name='items' size='15' value='Кристал'><br>
нужно золота:<br>
<input type='text' name='gold' size='15' value='0'><br>
нужно серебра:<br>
<input type='text' name='mon' size='15' value='0'><br>
получиш золота:<br>
<input type='text' name='ngold' size='15' value='0'><br>
получиш серебра:<br>
<input type='text' name='nmon' size='15' value='0'><br>
получиш exp-ы:<br>
<input type='text' name='nexp' size='15' value='0'><br>
получиш предмет:<br>
<input type='text' name='nitem' size='15' value='Кристал'><br>
получиш поинтов:<br>
<input type='text' name='npoints' size='15' value='0'><br>
тип квеста #1:<br>
<select name='qtype2'>
<option value='unlimited'>unlimited</option>
<option value='limited'>limited</option>
</select><br>
тип квеста #2:<br>
<select name='qtype'>
<option value='default'>default</option>
<option value='event'>event</option>
</select><br>
<input type='submit' value='добавить quest'><br>
</form>
<br>
";
}
else
{
$text=str_replace("
","<br>",$_POST['text']);
$text=str_replace("[b]","<b>",$text);
$text=str_replace("[/b]","</b>",$text);
$text=str_replace("[red]","<span style=color:red>",$text);
$text=str_replace("[/color]","</span>",$text);
$text=str_replace("[u]","<u>",$text);
$text=str_replace("[/u]","</u>",$text);
$text=str_replace("[blue]","<span style=color:blue>",$text);
$text=str_replace("[green]","<span style=color:green>",$text);
$text=str_replace("[gray]","<span style=color:gray>",$text);
$text=str_replace("[yellow]","<span style=color:yellow>",$text);
$text=str_replace(":)","<img src=img/smile/1.gif alt=:)>",$text);
$text=str_replace("=)","<img src=img/smile/2.gif alt==)>",$text);
$text=str_replace("0)","<img src=img/smile/10.gif alt=0)>",$text);
$text=str_replace(")))","<img src=img/smile/14.gif alt=)))>",$text);
$text=str_replace(":(","<img src=img/smile/15.gif alt=:(>",$text);
$text=str_replace(":neznat:","<img src=img/smile/33.gif alt=:neznat:>",$text);
$text=str_replace(":lox:","<img src=img/smile/55.gif alt=:lox:>",$text);
$text=str_replace(":offtop:","<img src=img/smile/63.gif alt=:offtop:>",$text);
$text=str_replace(":oops:","<img src=img/smile/65.gif alt=:oops:>",$text);
$text=str_replace(":zanat:","<img src=img/smile/2.gif alt=:zanat:>",$text);
$text=str_replace("[url=","<a href=",$text);
$text=str_replace("]",">",$text);
$text=str_replace("[/url]","</a>",$text);
$txt="";
$query = "INSERT INTO quests (name,min_level,max_level,items,text,gold,mon,ngold,nmon,nexp,nitem,nor,npoints,qtype,qtype2) VALUES ('$_POST[name]','$_POST[min]','$_POST[max]','$_POST[items]','$text','$_POST[gold]','$_POST[mon]','$_POST[ngold]','$_POST[nmon]','$_POST[nexp]','$_POST[nitem]','$txt','$_POST[npoints]','$_POST[qtype]','$_POST[qtype2]')";
$result = mysql_query ($query)
or die (mysql_error());
echo "<span style='color:green'>квест добавлен!</span><br>";
}
}
else
{
echo "Вы не администратор!<br>";
}
include "data/buttons.auth.php";
}
else
{
echo "
Ошибка авторизации!<br>
";
}
}
}
else
{
function mod_body($auth,$adminauth)
{
echo "мод выключен администратором!<br>";
}
}
?>