<?
require "consts.php";
require "incl.php";
$agent=$HTTP_USER_AGENT;
$conn=mysql_connect(my_host, my_user, my_password);
mysql_select_db(my_db, $conn);
header("Cache-Control: no-cache");
header("Content-Type: text/vnd.wap.wml; charset=utf-8");
echo '<?xml version="1.0" encoding="utf-8"?>';
echo '<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN"
"http://www.wapforum.org/DTD/wml1.2.dtd">';
if(isset($HTTP_GET_VARS['UIN']))
{
$UIN=$HTTP_GET_VARS['UIN'];
}
else
{
$UIN="Guest";
}
$UINmd5=$UIN;
if(isset($HTTP_GET_VARS['pass']))
{
$pass=$HTTP_GET_VARS['pass'];
}
else
{
$pass="Guest";
}
$ee="Читать сначала";
$ee=translate($ee);
$hh="К окончанию";
$hh=translate($hh);
if(isset($HTTP_GET_VARS['sort']))
{
$sort=$HTTP_GET_VARS['sort'];
}
else
{
$sort=0;
}
$sql="select * from users where id='$UIN'";
$res=mysql_query($sql);
$row=mysql_fetch_object($res);
if (isset($row->setting_forum))
{
$setting_forum=$row->setting_forum;
}
else
{
$setting_forum=8;
}
if (isset($row->setting_forum))
{
$setting_forum=$row->setting_forum;
}
else
{
$setting_forum=8;
}
if(isset($HTTP_GET_VARS['next_row']))
{
$next_row=$HTTP_GET_VARS['next_row'];
}
else
{
$sql4="select prosm from topic where id='$topic'";
$result4=mysql_query($sql4);
$row4=mysql_fetch_object($result4);
$prosm=$row4->prosm;
$prosm2=$prosm+1;
$sql5="update topic set prosm='$prosm2' where id='$topic'";
mysql_query($sql5);
$next_row=0;
}
$next2=$next_row+$setting_forum;
$sql="select pass, addmin from users where id='$UIN'";
$res=mysql_query($sql);
$row=mysql_fetch_object($res);
$addmin=$row->addmin;
if ($pass!=$row->pass)
{
$UIN="Guest";
}
$sql33="select * from topic where id='$topic'";
$result33=mysql_query($sql33);
$row33=mysql_fetch_object($result33);
$name3333=$row33->name;
echo '<wml>';
echo '<head>';
echo '<meta http-equiv="Cache-Control" content="no-cache" forua="true"/>';
echo '</head>';
?><card id="forjjum" title="Читать">
<?
if ($UIN!="Guest")
{
?>
<do name="a2" type="options" label = "Написать"><go href="topic_answer.php?UIN=<?=$UINmd5?>&pass=<?=$pass?>&id=<?=$topic?>&room=<?=$room?>"/></do>
<?
}
?>
<do name="afghfg" type="options" label = "Дальше"><go href="read_topic.php?UIN=<?=$UINmd5?>&pass=<?=$pass?>&next_row=<?=$next2?>&topic=<?=$topic?>&room=<?=$room?>&user=<?=$user?>"/></do>
<?
if ($sort==1)
{
?>
<do name="asdfsd2" type="options" label = "<?=$hh?>"><go href="read_topic.php?UIN=<?=$UINmd5?>&pass=<?=$pass?>&topic=<?=$topic?>&room=<?=$room?>"/></do>
<?
}
else
{
?>
<do name="asdfsd7ty2" type="options" label = "<?=$ee?>"><go href="read_topic.php?sort=1&UIN=<?=$UINmd5?>&pass=<?=$pass?>&topic=<?=$topic?>&room=<?=$room?>"/></do>
<?
}
if ($addmin==1)
{
?>
<do name="a33rdt3" type="options" label="Удалить топик"><go href="del_topic.php?UIN=<?=$UINmd5?>&pass=<?=$pass?>&topic=<?=$topic?>&room=<?=$room?>"/></do>
<do name="a333" type="options" label="Заебанить"><go href="ban.php?UIN=<?=$UINmd5?>&pass=<?=$pass?>&user=<?=$user?>&topic=<?=$topic?>"/></do>
<?
}
if ($addmin==2)
{
?>
<do name="a333ffg3" type="options" label="Удалить топик"><go href="del_topic.php?UIN=<?=$UINmd5?>&pass=<?=$pass?>&topic=<?=$topic?>&room=<?=$room?>"/></do>
<?
}
?>
<do name="a23232" type="options" label = "К разделу"><go href="main.php?UIN=<?=$UINmd5?>&pass=<?=$pass?>&room=<?=$room?>"/></do>
<do name="a243543" type="options" label = "Форум"><go href="index.php?UIN=<?=$UINmd5?>&pass=<?=$pass?>"/></do>
<?
echo '<p>';
if ($sort==1)
{
$sql="select * from forum where topic=$topic order by id limit $next_row, $setting_forum";
}
else
{
$sql="select * from forum where topic=$topic order by id desc limit $next_row, $setting_forum";
}
$result=mysql_query($sql);
while ($row=mysql_fetch_object($result))
{
$id=$row->id;
$name=$row->name;
$sql3="select setting_trans from users where id='$name'";
$result3=mysql_query($sql3);
$row3=mysql_fetch_object($result3);
$setting_trans=$row3->setting_trans;
$message=$row->message;
if ($setting_trans==1)
{
$message=ereg_replace("h","х", $message);
$message=ereg_replace("a","а", $message);
$message=ereg_replace("b","б", $message);
$message=ereg_replace("v","в", $message);
$message=ereg_replace("g","г", $message);
$message=ereg_replace("d","д", $message);
$message=ereg_replace("e","е", $message);
$message=ereg_replace("z","з", $message);
$message=ereg_replace("зх","ж", $message);
$message=ereg_replace("i","и", $message);
$message=ereg_replace("j","й", $message);
$message=ereg_replace("k","к", $message);
$message=ereg_replace("l","л", $message);
$message=ereg_replace("m","м", $message);
$message=ereg_replace("n","н", $message);
$message=ereg_replace("o","о", $message);
$message=ereg_replace("p","п", $message);
$message=ereg_replace("r","р", $message);
$message=ereg_replace("s","с", $message);
$message=ereg_replace("t","т", $message);
$message=ereg_replace("u","у", $message);
$message=ereg_replace("f","ф", $message);
$message=ereg_replace("c","ц", $message);
$message=ereg_replace("цх","ч", $message);
$message=ereg_replace("сх","ш", $message);
$message=ereg_replace("yи","ы", $message);
$message=ereg_replace("x","э", $message);
$message=ereg_replace("yу","ю", $message);
$message=ereg_replace("yа","я", $message);
$message=ereg_replace("q","ь", $message);
$message=ereg_replace("сч","щ", $message);
$message=ereg_replace("Q","Ь", $message);
$message=ereg_replace("H","Х", $message);
$message=ereg_replace("A","А", $message);
$message=ereg_replace("B","Б", $message);
$message=ereg_replace("V","В", $message);
$message=ereg_replace("G","Г", $message);
$message=ereg_replace("D","Д", $message);
$message=ereg_replace("E","Е", $message);
$message=ereg_replace("Z","З", $message);
$message=ereg_replace("Зх","Ж", $message);
$message=ereg_replace("I","И", $message);
$message=ereg_replace("J","Й", $message);
$message=ereg_replace("K","К", $message);
$message=ereg_replace("L","Л", $message);
$message=ereg_replace("M","М", $message);
$message=ereg_replace("N","Н", $message);
$message=ereg_replace("O","О", $message);
$message=ereg_replace("P","П", $message);
$message=ereg_replace("R","Р", $message);
$message=ereg_replace("S","С", $message);
$message=ereg_replace("T","Т", $message);
$message=ereg_replace("U","У", $message);
$message=ereg_replace("F","Ф", $message);
$message=ereg_replace("C","Ц", $message);
$message=ereg_replace("Цх","Ч", $message);
$message=ereg_replace("Сх","Ш", $message);
$message=ereg_replace("Yи","Ы", $message);
$message=ereg_replace("X","Э", $message);
$message=ereg_replace("Yу","Ю", $message);
$message=ereg_replace("Yа","Я", $message);
$message=ereg_replace("Сч","Щ", $message);
$message=str_replace("$", " backs", $message);
$message=htmlspecialchars($message);
$message=eregi_replace("&гт;",">", $message);
$message=eregi_replace("&лт;","<", $message);
$message=eregi_replace("&ьуот;",""", $message);
$message=eregi_replace("&амп;","&", $message);
}
$message=translate($message);
$sql22="select nick, id, name from users where id='$name'";
$res22=mysql_query($sql22);
$row22=mysql_fetch_object($res22);
$name2=$row22->nick;
$name2=translate($name2);
$iddd=$row22->name;
?>
<a href="user.php?UIN=<?=$UINmd5?>&pass=<?=$pass?>&topic=<?=$topic?>&room=<?=$room?>&user=<?=$name2?>"><<?=$name2?>
<?echo ' ';?>
<?=$row->date?>></a><br/>
<?=$message?><br/>
<br/>
<?
$next_row=$next_row+1;
}
if ($UIN!="Guest")
{
?>
<a href="topic_answer.php?UIN=<?=$UINmd5?>&pass=<?=$pass?>&id=<?=$topic?>&room=<?=$room?>"><small>Написать</small></a><br/>
<?
}
?>
<a href="read_topic.php?sort=<?=$sort?>&UIN=<?=$UINmd5?>&pass=<?=$pass?>&next_row=<?=$next_row?>&topic=<?=$topic?>&room=<?=$room?>"><small>Дальше</small></a><br/>
<a href="http://wap.all60.com?UIN=<?=$UINmd5?>&pass=<?=$pass?>"><small>Главная</small></a><br/>
<?
end_page(1);
?>
</p>
</card>
</wml>