View file forum/read_topic.php

File size: 8.55Kb
<?

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="&#x0427;&#x0438;&#x0442;&#x0430;&#x0442;&#x044C; &#x0441;&#x043D;&#x0430;&#x0447;&#x0430;&#x043B;&#x0430;";
$ee=translate($ee);

$hh="&#x041A; &#x043E;&#x043A;&#x043E;&#x043D;&#x0447;&#x0430;&#x043D;&#x0438;&#x044E;";
$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="&#x0427;&#x0438;&#x0442;&#x0430;&#x0442;&#x044C;">

<?
if ($UIN!="Guest")
{
?>

<do name="a2" type="options" label = "&#x041D;&#x0430;&#x043F;&#x0438;&#x0441;&#x0430;&#x0442;&#x044C;"><go href="topic_answer.php?UIN=<?=$UINmd5?>&amp;pass=<?=$pass?>&amp;id=<?=$topic?>&amp;room=<?=$room?>"/></do>

<?
}
?>


<do name="afghfg" type="options" label = "&#x0414;&#x0430;&#x043B;&#x044C;&#x0448;&#x0435;"><go href="read_topic.php?UIN=<?=$UINmd5?>&amp;pass=<?=$pass?>&amp;next_row=<?=$next2?>&amp;topic=<?=$topic?>&amp;room=<?=$room?>&amp;user=<?=$user?>"/></do>
<?
 if ($sort==1)
{
?>
<do name="asdfsd2" type="options" label = "<?=$hh?>"><go href="read_topic.php?UIN=<?=$UINmd5?>&amp;pass=<?=$pass?>&amp;topic=<?=$topic?>&amp;room=<?=$room?>"/></do>
<?
}
else
{
?>
<do name="asdfsd7ty2" type="options" label = "<?=$ee?>"><go href="read_topic.php?sort=1&amp;UIN=<?=$UINmd5?>&amp;pass=<?=$pass?>&amp;topic=<?=$topic?>&amp;room=<?=$room?>"/></do>
<?
}
if ($addmin==1)
{
?>
<do name="a33rdt3" type="options" label="&#x0423;&#x0434;&#x0430;&#x043B;&#x0438;&#x0442;&#x044C; &#x0442;&#x043E;&#x043F;&#x0438;&#x043A;"><go href="del_topic.php?UIN=<?=$UINmd5?>&amp;pass=<?=$pass?>&amp;topic=<?=$topic?>&amp;room=<?=$room?>"/></do>
<do name="a333" type="options" label="&#x0417;&#x0430;&#x0435;&#x0431;&#x0430;&#x043D;&#x0438;&#x0442;&#x044C;"><go href="ban.php?UIN=<?=$UINmd5?>&amp;pass=<?=$pass?>&amp;user=<?=$user?>&amp;topic=<?=$topic?>"/></do>

<?
}

if ($addmin==2)
{
?>
<do name="a333ffg3" type="options" label="&#x0423;&#x0434;&#x0430;&#x043B;&#x0438;&#x0442;&#x044C; &#x0442;&#x043E;&#x043F;&#x0438;&#x043A;"><go href="del_topic.php?UIN=<?=$UINmd5?>&amp;pass=<?=$pass?>&amp;topic=<?=$topic?>&amp;room=<?=$room?>"/></do>
<?
}
?>
<do name="a23232" type="options" label = "&#x041A; &#x0440;&#x0430;&#x0437;&#x0434;&#x0435;&#x043B;&#x0443;"><go href="main.php?UIN=<?=$UINmd5?>&amp;pass=<?=$pass?>&amp;room=<?=$room?>"/></do>
<do name="a243543" type="options" label = "&#x0424;&#x043E;&#x0440;&#x0443;&#x043C;"><go href="index.php?UIN=<?=$UINmd5?>&amp;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("&amp;гт;","&gt;", $message);
$message=eregi_replace("&amp;лт;","&lt;", $message);
$message=eregi_replace("&amp;ьуот;","&quot;", $message);
$message=eregi_replace("&amp;амп;","&amp;", $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?>&amp;pass=<?=$pass?>&amp;topic=<?=$topic?>&amp;room=<?=$room?>&amp;user=<?=$name2?>">&lt;<?=$name2?>
<?echo ' ';?>
<?=$row->date?>&gt;</a><br/>
<?=$message?><br/>
<br/>
<?
$next_row=$next_row+1;
}
if ($UIN!="Guest")
{
    ?>
<a href="topic_answer.php?UIN=<?=$UINmd5?>&amp;pass=<?=$pass?>&amp;id=<?=$topic?>&amp;room=<?=$room?>"><small>&#x041D;&#x0430;&#x043F;&#x0438;&#x0441;&#x0430;&#x0442;&#x044C;</small></a><br/>
<?
}
?>
<a href="read_topic.php?sort=<?=$sort?>&amp;UIN=<?=$UINmd5?>&amp;pass=<?=$pass?>&amp;next_row=<?=$next_row?>&amp;topic=<?=$topic?>&amp;room=<?=$room?>"><small>&#x0414;&#x0430;&#x043B;&#x044C;&#x0448;&#x0435;</small></a><br/>
<a href="http://wap.all60.com?UIN=<?=$UINmd5?>&amp;pass=<?=$pass?>"><small>&#x0413;&#x043B;&#x0430;&#x0432;&#x043D;&#x0430;&#x044F;</small></a><br/>
<?

end_page(1);
?>
</p>
</card>
</wml>