View file forum/main.php

File size: 9.81Kb
<?



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";

}






$sql="select pass from users where id='$UIN'";
$res=mysql_query($sql);
$row=mysql_fetch_object($res);
$themes=10;
if ($pass!=$row->pass)
{
$UIN="Guest";
}






$sql1="select id from rating where room='1'";
$result1=mysql_query($sql1);
$n1=0;
$n2=0;
$n3=0;
$n4=0;
$n6=0;
$n7=0;
$n8=0;
$n9=0;
$n10=0;
$n11=0;
$n12=0;
$n13=0;
$n14=0;

while ($row1=mysql_fetch_object($result1))
    {
    $n1=$n1+1;
    }
$sql2="select id from rating where room='2'";
$result2=mysql_query($sql2);
while ($row2=mysql_fetch_object($result2))
    {
    $n2=$n2+1;
    }
$sql3="select id from rating where room='3'";
$result3=mysql_query($sql3);
while ($row3=mysql_fetch_object($result3))
    {
    $n3=$n3+1;
    }
$sql4="select id from rating where room='4'";
$result4=mysql_query($sql4);
while ($row4=mysql_fetch_object($result4))
    {
    $n4=$n4+1;
    }
    $sql5="select id from rating where room='5'";
$result5=mysql_query($sql5);
while ($row5=mysql_fetch_object($result5))
    {
    $n5=$n5+1;
    }
$sql6="select id from rating where room='6'";
$result6=mysql_query($sql6);
while ($row6=mysql_fetch_object($result6))
    {
    $n6=$n6+1;
    }
$sql7="select id from rating where room='7'";
$result7=mysql_query($sql7);
while ($row7=mysql_fetch_object($result7))
    {
    $n7=$n7+1;
    }
$sql8="select id from rating where room='8'";
$result8=mysql_query($sql8);
while ($row8=mysql_fetch_object($result8))
    {
    $n8=$n8+1;
    }
$sql9="select id from rating where room='9'";
$result9=mysql_query($sql9);
while ($row9=mysql_fetch_object($result9))
    {
    $n9=$n9+1;
    }
$sql10="select id from rating where room='10'";
$result10=mysql_query($sql10);
while ($row10=mysql_fetch_object($result10))
    {
    $n10=$n10+1;
    }
$sql11="select id from rating where room='11'";
$result11=mysql_query($sql11);
while ($row11=mysql_fetch_object($result11))
    {
    $n11=$n11+1;
    }
$sql12="select id from rating where room='12'";
$result12=mysql_query($sql12);
while ($row12=mysql_fetch_object($result12))
    {
    $n12=$n12+1;
    }
$sql13="select id from rating where room='13'";
$result13=mysql_query($sql13);
while ($row13=mysql_fetch_object($result13))
    {
    $n13=$n13+1;
    }
$sql14="select id from rating where room='14'";
$result14=mysql_query($sql14);
while ($row14=mysql_fetch_object($result14))
    {
    $n14=$n14+1;
    }
if ($room==1)
{
$nameroom="&#x0421;&#x0430;&#x0439;&#x0442;";
$n=$n1;
}
if ($room==2)
{
$nameroom="&#x041E;&#x0431;&#x0441;&#x0443;&#x0436;&#x0434;&#x0435;&#x043D;&#x0438;&#x0435;";
$n=$n2;
}
if ($room==3)
{
$nameroom="&#x041C;&#x0443;&#x0437;&#x044B;&#x043A;&#x0430;, &#x043A;&#x0438;&#x043D;&#x043E;";
$n=$n3;
}
if ($room==4)
{
$nameroom="&#x0420;&#x0430;&#x0437;&#x043D;&#x043E;&#x0435;";
$n=$n4;
}
if ($room==6)
{
$nameroom="&#x0412;&#x043E;&#x043F;&#x0440;&#x043E;&#x0441;&#x044B; &#x0430;&#x0434;&#x043C;&#x0438;&#x043D;&#x0443;";
$n=$n6;
}
if ($room==7)
{
$nameroom="&#x0421;&#x043E;&#x0437;&#x0434;&#x0430;&#x043D;&#x0438;&#x0435; &#x0441;&#x0430;&#x0439;&#x0442;&#x043E;&#x0432;";
$n=$n7;
}
if ($room==5)
{
$nameroom="&#x041C;&#x043E;&#x0431;&#x0438;&#x043B;&#x043A;&#x0438;";
$n=$n5;
}
if ($room==8)
{
$nameroom="&#x0424;&#x043B;&#x0435;&#x0439;&#x043C;";
$n=$n8;
}
if ($room==9)
{
$nameroom="Hard&amp;Soft";
$n=$n9;
}
if ($room==10)
{
$nameroom="&#x0412;&#x0441;&#x0442;&#x0440;&#x0435;&#x0447;&#x0438; &#x0447;&#x0430;&#x0442;&#x0430;";
$n=$n10;
}
if ($room==11)
{
$nameroom="&#x0412;&#x043E;&#x043F;&#x0440;&#x043E;&#x0441;&#x044B;";
$n=$n11;
}
if ($room==12)
{
$nameroom="&#x041F;&#x0440;&#x0438;&#x043A;&#x043E;&#x043B;&#x044B;";
$n=$n12;
}
if ($room==13)
{
$nameroom="&#x0427;&#x0435;&#x043B;&#x043E;&#x0432;&#x0435;&#x043A;, &#x0436;&#x0438;&#x0437;&#x043D;&#x044C;, &#x043E;&#x0431;&#x0449;&#x0435;&#x0441;&#x0442;&#x0432;&#x043E;";
$n=$n13;
}
if ($room==14)
{
$nameroom="&#x041F;&#x0440;&#x0435;&#x0434;&#x043B;&#x043E;&#x0436;&#x0435;&#x043D;&#x0438;&#x044F;";
$n=$n14;
}
echo '<wml>';
echo '<head>';
echo '<meta http-equiv="Cache-Control" content="no-cache" forua="true"/>';
echo '</head>';
?><card id="forum" title="<?=$nameroom?> (<?=$n?>)"><?
echo '<p>';
?>

<do name="a243543" type="options" label = "&#x0424;&#x043E;&#x0440;&#x0443;&#x043C;"><go href="index.php?UIN=<?=$UINmd5?>&amp;pass=<?=$pass?>"/></do>
<?
if ($UIN!="Guest")
{
?>
<a href="topic.php?UIN=<?=$UINmd5?>&amp;pass=<?=$pass?>&amp;room=<?=$room?>"><small>&#x0414;&#x043E;&#x0431;&#x0430;&#x0432;&#x0438;&#x0442;&#x044C; &#x0442;&#x0435;&#x043C;&#x0443;</small></a><br/>
<?
}
if(isset($HTTP_GET_VARS['next_row']))
{
$next_row=$HTTP_GET_VARS['next_row'];
}
else
{
$next_row=0;
}
$sql="select * from rating where room='$room' order by id desc limit $next_row, $themes ";
$result=mysql_query($sql);
while ($row5=mysql_fetch_object($result))
{
$sql3="select * from topic where id='$row5->ident'";
$result3=mysql_query($sql3);
$row3=mysql_fetch_object($result3);
$id=$row3->id;
$prosm=$row3->prosm;
$name=$row3->name;
$sql12="select setting_trans from users where id='$name'";
$result12=mysql_query($sql12);
$row12=mysql_fetch_object($result12);
$setting_trans=$row12->setting_trans;
if ($setting_trans==1)
{
$message=$row3->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("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);

$row3->message=$message;
}

$sql2="select id from forum where topic='$id'";
$result2=mysql_query($sql2);
$n=0;
while ($row2=mysql_fetch_object($result2))
{
$n=$n+1;
}



$message=$row3->message;
$row3->message=$message;
$row3->message=translate($row3->message);


$sql22="select nick from users where id='$name'";
$res22=mysql_query($sql22);
$row22=mysql_fetch_object($res22);
$name2=$row22->nick;
$name2=translate($name2);
?>
<a href="read_topic.php?UIN=<?=$UINmd5?>&amp;pass=<?=$pass?>&amp;topic=<?=$id?>&amp;user=<?=$name?>&amp;room=<?=$room?>">&lt;<?=$name2?>
<?echo ' ';?>
<?=$row3->date?>&gt; (<?=$n?>) [<?=$prosm?>]</a><br/>
<?=$row3->message?><br/>
<br/>
<?
$next_row=$next_row+1;
}
    ?>
<a href="main.php?UIN=<?=$UINmd5?>&amp;pass=<?=$pass?>&amp;next_row=<?=$next_row?>&amp;room=<?=$room?>">
<?
echo '<small>&#x0414;&#x0430;&#x043B;&#x044C;&#x0448;&#x0435;</small></a><br/>';
?><a href="index.php?UIN=<?=$UINmd5?>&amp;pass=<?=$pass?>"><small>&#x0413;&#x043B;&#x0430;&#x0432;&#x043D;&#x0430;&#x044F; &#x0444;&#x043E;&#x0440;&#x0443;&#x043C;&#x0430;</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/><?
$dpoint=".";
$dpoint2=":";


$time2 =date(d);
$time2 .=$dpoint;
$time2 .=date(m);
$time2 .=$dpoint;
$time2 .=date(y);
$time2.= " - ";
$time2 .=date(H);
$time2.=$dpoint2;
$time2.=date(i);
$time2.=$dpoint2;
$time2 .=date(s);

$sql="update users set last='$time2' where id='$UIN'";
mysql_query($sql);
end_page(1);
?>
</p>
</card>
</wml>