View file release_fix#2/mods/game/gm/chat.php

File size: 4.59Kb
<?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")
{
$supertext="$_GET[cdo]";
if(!empty($supertext))
{
$supertext="[red]$_GET[cdo][/color], ";
}
else
{
if(!empty($_GET['dtt']))
{
$supertext="$_GET[dtt]";
$supertext="$supertext&id=id страницы]имя ссылки[/url]";
}
else
{
$supertext="";
}
}
echo "
<form method='post' action='?do=game/gm/chat&style=2&dox=send'>
сообщение:<br>
<textarea name='text'>$supertext</textarea><br>
<input type='submit' value='отправить'><br></form>
<small><a href='?do=game/gm/chat&style=2&dtt=[url=?do=page'>вставить страницу</a>|<a href='?do=game/pcreate&style=2'>создать страницу</a><br></small>
<a href='?do=game/gm/chat&style=2'>обновить</a> <a href='#niz'>#</a><br>
";
if($_GET['dox']=="send")
{
$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);
$query = "INSERT INTO gmchat (login,text) VALUES ('$_COOKIE[login]','$text')";
$result = mysql_query ($query)
or die ("<span style='color:red'>ошибка!</span>");
}
$query = "SELECT * FROM gmchat ORDER BY id DESC LIMIT $_pg,$_pg2";
$cat = mysql_query ($query);
if(!$cat) exit (mysql_error());
while(list($id,$login,$text) = mysql_fetch_row($cat))
{
$ol="";
$query3 = "SELECT * FROM users WHERE login='$login'";
$cat3 = mysql_query ($query3);
if(!$cat3) exit (mysql_error());
while(list($id4,$login4,$pass4,$mail4,$reg4,$class4,$m4,$h4,$z4,$s4,$mon4,$gold4,$pms4,$lvl4,$ava4,$ban4,$online) = mysql_fetch_row($cat3))
{
if($online=="no")
{
$ol="<span style='color:red'>[off]</span>";
}
else
{
$ol="<span style='color:green'>[on]</span>";
}
}
echo "$id-<a href='?do=game/info&dox=$login'>$login</a> $ol [<a href='?do=game/mail/sent&xs=$login&style=2'>лс</a>][<a href='?do=game/gm/chat&cdo=$login&style=2'>ответить</a>]<br>$text<br><br>";
}
echo "
<a href='#verh' name='niz'>#</a><br>
<a href='?do=game/gm/chat&_pg=$ag&style=2'><<<назад</a>|<a href='?do=game/gm/chat&_pg=$_pg2&style=2'>далее>>></a><br>
";
}
else
{
echo "Вы не администратор!<br>";
}
include "data/buttons.auth.php";
}
else
{
echo "
Ошибка авторизации!<br>
";
}
}
}
else
{
function mod_body($auth,$adminauth)
{
echo "мод выключен администратором!<br>";
}
}
?>