<?
require "conf.php";
$agent=$HTTP_USER_AGENT;
$conn=mysql_connect(my_host, my_user, my_password);
mysql_select_db(my_db, $conn);
header("Content-Type: text/vnd.wap.wml; charset=utf-8");
header("Cache-Control: no-cache");
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 `index` 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=5;
}
if (isset($row->setting_forum))
{
$setting_forum=$row->setting_forum;
}
else
{
$setting_forum=5;
}
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;
$next3=$next_row-$setting_forum;
$sql=("select `admin` from `index` where id='$UIN'");
$res=mysql_query($sql);
$row=mysql_fetch_object($res);
$admin=$row->admin;
if ($pass!=$row->pass)
{
$UIN="Guest";
}
$sql33=("select * from `topic` where id='$topic' order by id desc");
$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="nmess.php?UIN=<?=$UINmd5?>&pass=<?=$pass?>&id=<?=$topic?>&room=<?=$room?>"/></do>
<?
}
?>
<do name="afghfg" type="options" label = "Дальше"><go href="readmess.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="readmess.php?UIN=<?=$UINmd5?>&pass=<?=$pass?>&topic=<?=$topic?>&room=<?=$room?>"/></do>
<?
}
else
{
?>
<do name="asdfsd7ty2" type="options" label = "<?=$ee?>"><go href="readmess.php?sort=1&UIN=<?=$UINmd5?>&pass=<?=$pass?>&topic=<?=$topic?>&room=<?=$room?>"/></do>
<?
}
/*if ($admin==1)
{
$adres=strtok($row->date," ");
$site="http://$adres";
?>
<do name="a33rdt3" type="options" label="Удалить топик"><go href="dellmess.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 ($admin==2)
{
$sql=("select * from forum where topic=$topic order by topic desc $next_row, $setting_forum");
$adres=strtok($row->date," ");
$site="http://$adres";
?>
<do name="a333ffg3" type="options" label="Удалить топик"><go href="dellmess.php?UIN=<?=$UINmd5?>&pass=<?=$pass?>&topic=<?=$topic?>&room=<?=$room?>"/></do>
<?
}
?>
<do name="a23232" type="options" label = "К разделу"><go href="forum.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>';
$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))
{
$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("xx","?", $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("xxx","zzz", $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=ereg_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);
$adres=strtok($row->date," ");
$site="http://$adres";
?>
<a href="user.php?UIN=<?=$UINmd5?>&pass=<?=$pass?>&topic=<?=$topic?>&room=<?=$room?>&user=<?=$site?>"><?=$name2?>
<?echo ' ';?>
<?=$row->date?></a><br/>
<?=$message?><br/>
<br/>
<?
$next_row=$next_row+1;
}
?>
<small><a href="nmess.php?UIN=<?=$UINmd5?>&pass=<?=$pass?>&id=<?=$topic?>&room=<?=$room?>">Написать</a><br/></small>
<?
?>
<small><a href="readmess.php?UIN=<?=$UINmd5?>&pass=<?=$pass?>&next_row=<?=$next2?>&topic=<?=$topic?>&room=<?=$room?>&user=<?=$user?>">Дальше</a><br/> </small>
<small><a href="readmess.php?UIN=<?=$UINmd5?>&pass=<?=$pass?>&next_row=<?=$next3?>&topic=<?=$topic?>&room=<?=$room?>&user=<?=$user?>">Haзaд</a><br/> </small>
<small><a href="nomer.php?UIN=<?=$UINmd5?>&pass=<?=$pass?>&topic=<?=$topic?>&room=<?=$room?>&user=<?=$user?>">Перейти к Номеру</a><br/> </small>
<?
/* if ($sort==1)
{
?>
<small><a href="readmess.php?UIN=<?=$UINmd5?>&pass=<?=$pass?>&topic=<?=$topic?>&room=<?=$room?>"><?=$hh?></a><br/> </small>
<?
}
else
{
?>
<small><a href="readmess.php?sort=1&UIN=<?=$UINmd5?>&pass=<?=$pass?>&topic=<?=$topic?>&room=<?=$room?>"><?=$ee?></a><br/> </small>
}*/
?>
<?
if ($admin==1)
{
?>
<small>***<br/><a href="dellmess.php?UIN=<?=$UINmd5?>&pass=<?=$pass?>&topic=<?=$topic?>&room=<?=$room?>">Удaлить Teмy</a><br/> </small>
<small><a href="ban.php?UIN=<?=$UINmd5?>&pass=<?=$pass?>&user=<?=$user?>&topic=<?=$topic?>">Зaбaнить</a><br/> ***<br/> </small>
<?
}
if ($admin==2)
{
?>
<small>***<br/><a href="dellmess.php?UIN=<?=$UINmd5?>&pass=<?=$pass?>&topic=<?=$topic?>&room=<?=$room?>">Удaлить Teмy</a><br/> ***<br/> </small>
<?
}
?>
<small><a href="forum.php?UIN=<?=$UINmd5?>&pass=<?=$pass?>&room=<?=$room?>">К разделу</a><br/> </small>
<small><a href="index.php?UIN=<?=$UINmd5?>&pass=<?=$pass?>">Форум</a><br/> </small>
<small><a href="../apanel.php?id=<?=$UINmd5?>&pass=<?=$pass?>">B Пaнeль</a><br/></small>
</p>
</card>
</wml>