Просмотр файла mafia/mafhist.php

Размер файла: 4.5Kb
  1. <?
  2. header("Cache-Control: no-cache");
  3. header("Content-type:text/vnd.wap.wml");
  4. $ref=rand(10000,1000000);
  5. require("inc.php");
  6. $link = @mysql_pconnect ($MySQL_Hostname, $MySQL_Username, $MySQL_Password)
  7. or die ("<wml>
  8. <card id=\"error\" title=\"error\">
  9. <do type=\"prev\" label=\"Back\"><prev/></do><p align=\"center\">Can not connect to MySQL</p>
  10. </card>
  11. </wml>");
  12. @mysql_select_db($MySQLDatabasename) or die ("<wml>
  13. <card id=\"error\" title=\"error\">
  14. <do type=\"prev\" label=\"Back\"><prev/></do><p align=\"center\">error select the database...</p>
  15. </card>
  16. </wml>");
  17.  
  18. $result = @mysql_query ("Select * from mafusers where id='".$id."'");
  19. if (mysql_affected_rows() == 0) {
  20. echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
  21. echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml12.dtd\">\n";
  22. echo "<wml>\n";
  23. echo "<card id=\"error\" title=\"&#x041E;&#x0448;&#x0438;&#x0431;&#x043A;&#x0430;\" ontimer=\"index.php?ref=$ref\"><timer value=\"15\"/>\n";
  24. echo "<p align=\"center\">\n";
  25. echo "User was not found\n";
  26. echo "</p>\n";
  27. echo "</card>\n";
  28. echo "</wml>\n";
  29. mysql_close($link);
  30. exit;
  31. }
  32. $row = mysql_fetch_array ($result);
  33. if ($ps !== $row["pass"]){
  34. echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
  35. echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml12.dtd\">\n";
  36. echo "<wml>\n";
  37. echo "<head><meta http-equiv=\"Cache-Control\" content=\"no-cache\" forua=\"true\"/></head>\n";
  38. echo "<card id=\"error\" title=\"&#x041E;&#x0448;&#x0438;&#x0431;&#x043A;&#x0430;\" ontimer=\"index.php?ref=$ref\"><timer value=\"15\"/>\n";
  39. echo "<p align=\"center\">\n";
  40. echo "Your login failed\n";
  41. echo "</p>\n";
  42. echo "</card>\n";
  43. echo "</wml>\n";
  44. mysql_close($link);
  45. exit;
  46. }
  47. if (!isset($rm)) $rm = 1;
  48. $rmaf = "maf".$rm;
  49. $ringame = "ingame".$rm;
  50. $us=$row["user"];
  51. $smset = $row["smiles"];
  52.  
  53. //В игре человек или нет:
  54. mysql_query ("select * from $ringame WHERE gamer_id = '".$id."'");
  55. if (mysql_affected_rows()!=0) $gmes = 1; else $gmes = 0;
  56. //if ($rm<0||$rm>9) exit;
  57. //$room="room".$rm;
  58.  
  59. $max = $row["max"];
  60. echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
  61. echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml12.dtd\">\n";
  62. echo "<wml>\n";
  63. echo "<head><meta http-equiv=\"Cache-Control\" content=\"no-cache\" forua=\"true\"/></head>\n";
  64. echo "<card id=\"history\" title=\"Р?стория\">\n";
  65. echo "<do type=\"options\" name=\"refresh\" label=\"Обновить\"><go href=\"maf.php?id=$id&amp;ps=$ps&amp;rm=$rm&amp;ref=$ref\"/></do>\n";
  66. echo "<p mode=\"wrap\">\n";
  67.  
  68. echo "<a href=\"maf.php?id=$id&amp;ps=$ps&amp;rm=$rm#add\">Сказать</a><br/>\n";
  69. echo "<a href=\"maf.php?id=$id&amp;ps=$ps&amp;rm=$rm&amp;ref=$ref\">Обновить</a>\n";
  70. $res = @mysql_query ("Select * from $rmaf order by id desc LIMIT 400");
  71. $kol = mysql_affected_rows();
  72. @$total=$kol -1;
  73. if (!isset($num)) $num=0;
  74. $ignor = $row["ignor"];
  75. $mread = $num;
  76. for ($i = 1; $i<=$num; $i++) $data = mysql_fetch_array ($res);
  77. $i = $num;
  78. while (($mread < $num+$max)&&($i<=$total)){
  79. $data = mysql_fetch_array ($res);
  80. $date = $data["time"];
  81. $name = $data["who"];
  82. $usid = $data["usid"];
  83. $msg = $data["message"];
  84. //echo "$message<br/>\n";
  85. $gm = $data["gamemes"];
  86. if ($smset==0&&$data["messagewosm"]!="") $msg = $data["messagewosm"];
  87. if ($smset==2&&$data["messagewoasm"]!="") $msg = $data["messagewoasm"];
  88. $time = $data["id"];
  89. $th = $data["towhom"];
  90. $hid = $data["hid"];
  91. $i++;
  92. if ((strpos($ignor, $name."|") === false)&&(($hid != 2)||($id == $usid))&&($gmes==0||($gmes==1&&$gm==1))){
  93. if ($th == "") {
  94. echo "<br/><b><a href=\"inside.php?id=$id&amp;ps=$ps&amp;rm=$rm&amp;nk=$usid&amp;ref=$ref\">$name</a></b>($date)&gt;$msg\n"; $mread++;}
  95. else if (($th == $id)||($id == $usid)){
  96. echo "<br/><b><a href=\"inside.php?id=$id&amp;ps=$ps&amp;rm=$rm&amp;nk=$usid&amp;ref=$ref\">$name</a>[P!]</b>($date)&gt;$msg\n";$mread++;}
  97. }
  98. }
  99. mysql_close ($link);
  100. $page_next = $num + $max-1;
  101. $page_prev = $num - $max+1;
  102. if ($num + $max < $total) {
  103. echo "<br/><a href=\"mafhist.php?id=$id&amp;ps=$ps&amp;rm=$rm&amp;num=$page_next\">&gt;&gt;&gt;</a>";
  104. }
  105. if ($num >= $max) {
  106. echo "<br/><a href=\"mafhist.php?id=$id&amp;ps=$ps&amp;rm=$rm&amp;num=$page_prev\">&lt;&lt;&lt;</a>\n";
  107. }
  108. echo "<br/><a href=\"enter.php?id=$id&amp;ps=$ps\">На улицу</a>\n";
  109. echo "</p>\n";
  110. echo "</card>\n";
  111. echo "</wml>\n";
  112. ?>