Просмотр файла gta/add.php

Размер файла: 4.11Kb
  1. <?php
  2. #####################################################
  3. # mod by -=LesNIK=- #
  4. # icq 366244181 #
  5. # Официальный сайт мода http://wenz.net.ru #
  6. # все ответы на вопросы и помощь по скрипту #
  7. # вы можете получить только там! #
  8. # #
  9. # Вы не имеете право вносить #
  10. # свои изменения в данный мод!#
  11. # #
  12. # Уважайте труд автора! #
  13. #####################################################
  14.  
  15.  
  16. include "./../ini.php";
  17. include "./../includes/header.php";
  18. include "./../includes/inc_online.php";
  19. print "<p><small>";
  20.  
  21. $id=cyr(htmlspecialchars(stripslashes(trim($id))));
  22. $pass=cyr(htmlspecialchars(stripslashes(trim($pass))));
  23.  
  24. if(!empty($id))
  25. {
  26. $q = mysql_query("select secur,golod,voodoo,nums,guns,cars,id,login,pass,money,level,police,health from users where id='".$id."';");
  27. }
  28. else
  29. {
  30. die ($lang['empty_login']."</small></p></card></wml>");
  31. }
  32.  
  33. $data = mysql_fetch_array($q);
  34.  
  35. $id=$data['id'];
  36. $login=$data['login'];
  37. $money=$data['money'];
  38. $level=$data['level'];
  39. $police=$data['police'];
  40. $stage=$data['stage'];
  41. $health=$data['health'];
  42. $cars=$data['cars'];
  43. $guns=$data['guns'];
  44. $nums=$data['nums'];
  45. $voo_por=$data['voodoo'];
  46. $golod=$data['golod'];
  47. $secur=$data['secur'];
  48.  
  49. if($pass!=$data['pass'])
  50. {
  51. die ($lang['empty_login']."</small></p></card></wml>");
  52. }
  53.  
  54. mysql_query("update users set last='".time()."',city='1' where id='".$id."';");
  55.  
  56. include "./../includes/inc_secur.php";
  57. include "./../includes/inc_golod.php";
  58. include "./../includes/inc_hospital.php";
  59. include "./../includes/inc_police.php";
  60. include "./../includes/inc_die.php";
  61. include "./../includes/inc_voodoo.php";
  62. include "./../includes/inc_attack.php";
  63. include "./../includes/inc_mes.php";
  64. else
  65. echo '<br/>----<br/>';
  66.  
  67. // --------------------------------------------------------------------------------------------------------------------
  68. $q = mysql_qw ('SELECT * FROM news WHERE id=?',$id);
  69. if(mysql_num_rows($q)==0)
  70. {
  71. echo '[Новостей нет]';
  72. }
  73. switch ($act)
  74. {case 'add':
  75. $name = substr ($name,0,20);
  76. $name=htmlspecialchars(stripslashes($name));
  77. $msg = substr ($msg,0,512);
  78. $msg=htmlspecialchars(stripslashes($msg));
  79. $msg=str_replace("http://","",$msg);
  80. $msg=str_replace("&","",$msg);
  81. $msg=str_replace("&&","",$msg);
  82. $msg=str_replace("wap.","",$msg);
  83. $msg=str_replace("\r","",$msg);
  84. $msg=str_replace("\n","",$msg);
  85. $msg=str_replace(".wen.",".simwap.",$msg);
  86. $msg=str_replace(".kmx.",".simwap.",$msg);
  87. $msg=str_replace(".net.",".simwap.",$msg);
  88. $msg=str_replace(".org.",".simwap.",$msg);
  89. $msg=str_replace("пидарас","хороший чел!",$msg);
  90. $msg=str_replace("хуё","***",$msg);
  91. $msg=str_replace("хуи","***",$msg);
  92. $msg=str_replace("хуй","***",$msg);
  93.  
  94. if($name =='' or $msg == '')
  95. exit ("Не заполнены обязательные поля".$px);
  96. $q = mysql_qw ('select * from news where id=?',intval($id));
  97. if(mysql_num_rows ($q)==0) exit;
  98. mysql_qw ('INSERT INTO news SET time=?,name=?,msg=?,id_news=?',time(),$login,$msg,intval($id)) or die(mysql_error());
  99. echo 'Комент добавлен<br/>';
  100.  
  101.  
  102. break;
  103.  
  104. default:
  105. if ($admin==7)
  106. {
  107. echo
  108. "<form action='add.php?id=$id&amp;pass=$pass&amp;act=add&amp;' method='post'>
  109. Ваше имя:<input name='$login' /><br/>
  110. Сообщение:<input type='text' name='msg' /><br/>
  111. <input type='submit' value='Добавить' /></form>";
  112. }else{
  113. echo"
  114. Ваше имя:<input name='$login'/><br/>
  115. Мнение:<input name='msg'/><br/>
  116. <anchor>Добавить<go href='add.php?id=$id&amp;pass=$pass&amp;act=add' method='post'>
  117. <postfield name='name' value='$(login)'/>
  118. <postfield name='msg' value='$(msg)'/>
  119. </go></anchor>";}
  120.  
  121.  
  122. break;
  123. }
  124.  
  125.  
  126. include("./../includes/foot.php");
  127.  
  128.  
  129. mysql_close();
  130. include "./../includes/footer.php";
  131. ?>