Просмотр файла include/anss.php

Размер файла: 19.92Kb
  1. <?
  2. if(!$authorize AND $AuthorAnonim)
  3. {
  4. $f = intval($_GET['f']);
  5. $ip = empty($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['REMOTE_ADDR'] : $_SERVER['HTTP_X_FORWARDED_FOR'] ;
  6. $ip = htmlspecialchars(sql($ip));
  7. $user = htmlspecialchars(sql($_SERVER['HTTP_USER_AGENT']));
  8. $query = mysql_query("SELECT themes.*, forums.name AS fname
  9. FROM themes, forums
  10. WHERE themes.id=".$f."
  11. AND themes.id_forum=forums.id");
  12. $data = mysql_fetch_assoc($query);
  13. if(mysql_num_rows($query) < 1)
  14. {
  15. if($version == "wml")
  16. {
  17. header('Content-type: text/vnd.wap.wml; charset=utf-8');
  18. header("Cache-Control: no-cache");
  19. echo(doctype("Ошибка").$tag.'
  20. Темы не существует! <br />
  21. -
  22. <a href="./?p=0&amp;v=wml">Форумы</a> '.$tagC.'
  23. </p></card></wml>');
  24. } elseif($version == "xhtml")
  25. {
  26. header("Content-type: text/html; charset=utf-8");
  27. header("Last-Modified:".gmdate("D, d M Y H:i:s")." GMT");
  28. header("Cache-Control: no-cache, must-relative");
  29. echo('<html>
  30. <head>
  31. <title>Ошибка</title>
  32. </head>
  33. <body bgcolor="'.$style['background'].'" link="'.$style['link'].'" vlink="'.$style['link'].'" text="#000000">
  34. <table align="center" border="0" cellspacing="1" cellpadding="5" width="350">
  35. <tr><td align="center" bgcolor="'.$style['title'].'">
  36. <font color="#FFFFFF"><b>Ошибка</b></font>
  37. </td></tr>
  38. <tr><td bgcolor="'.$style['text'].'">'.$tag.'
  39. Темы не существует!
  40. '.$tagC.'</td></tr>
  41. <tr><td bgcolor="'.$style['bottom'].'">'.$tag.'
  42. <a href="./?p=0&amp;v=xhtml">Форумы</a>
  43. '.$tagC.'</td></tr></table>
  44. </body></html>');
  45. }
  46. } elseif($data['close'] == "on")
  47. {
  48. if($version == "wml")
  49. {
  50. header('Content-type: text/vnd.wap.wml; charset=utf-8');
  51. header("Cache-Control: no-cache");
  52. echo(doctype("Ошибка").$tag.'
  53. Темы закрыта! <br />
  54.  
  55. <anchor>Назад<prev /></anchor><br />
  56. <a href="./?p=0&amp;v=wml">Форумы</a>
  57. '.$tagC.'
  58. </p></card></wml>');
  59. } elseif($version == "xhtml")
  60. {
  61. header("Content-type: text/html; charset=utf-8");
  62. header("Last-Modified:".gmdate("D, d M Y H:i:s")." GMT");
  63. header("Cache-Control: no-cache, must-relative");
  64. echo('<html>
  65. <head>
  66. <title>Ошибка</title>
  67. </head>
  68. <body bgcolor="'.$style['background'].'" link="'.$style['link'].'" vlink="'.$style['link'].'" text="#000000">
  69. <table align="center" border="0" cellspacing="1" cellpadding="5" width="350">
  70. <tr><td align="center" bgcolor="'.$style['title'].'">
  71. <font color="#FFFFFF"><b>Ошибка</b></font>
  72. </td></tr>
  73. <tr><td bgcolor="'.$style['text'].'">'.$tag.'
  74. Тема закрыта!
  75. '.$tagC.'</td></tr>
  76. <tr><td bgcolor="'.$style['bottom'].'">'.$tag.'
  77. <a href="./?p=0&amp;v=xhtml">Форумы</a>
  78. '.$tagC.'</td></tr></table>
  79. </body></html>');
  80. }
  81. }
  82. elseif(ban($user, $ip))
  83. {
  84. if($version == "wml")
  85. {
  86. header('Content-type: text/vnd.wap.wml; charset=utf-8');
  87. header("Cache-Control: no-cache");
  88. echo(doctype("Ошибка").$tag.'
  89. Ошибка! Вы заблокированы модератором '.$modername.'. <br />
  90. Причина: '.$banmess.'! <br />
  91. -
  92. <a href="'.$_SERVER['HTTP_REFERER'].'">Назад</a><br />
  93. <a href="./?p=0&amp;v=wml">Форумы</a>
  94. '.$tagC.'</p></card></wml>');
  95. } elseif($version == "xhtml")
  96. {
  97. header("Content-type: text/html; charset=utf-8");
  98. header("Last-Modified:".gmdate("D, d M Y H:i:s")." GMT");
  99. header("Cache-Control: no-cache, must-relative");
  100. echo('<html>
  101. <head>
  102. <title>Ошибка</title>
  103. </head>
  104. <body bgcolor="'.$style['background'].'" link="'.$style['link'].'" vlink="'.$style['link'].'" text="#000000">
  105. <table align="center" border="0" cellspacing="1" cellpadding="5" width="350">
  106. <tr align="center" bgcolor="'.$style['title'].'"><td colspan="2">
  107. <font color="#FFFFFF"><b>Ошибка</b></font>
  108. <tr bgcolor="'.$style['text'].'"><td colspan="2">'.$tag.'Вы заблокированы модератором '.$modername.'</td></tr>
  109. <tr bgcolor="'.$style['text'].'"><td>'.$tag.'Причина:'.$tagC.'</td><td>'.$tag.$banmess.$tagC.'</td></tr>
  110. <tr bgcolor="'.$style['bottom'].'"><td colspan="2">'.$tag.'
  111. <a href="./?p=0&amp;v=xhtml">Форумы</a>
  112. '.$tagC.'</td></tr></table>
  113. </body></html>');
  114. }
  115. }
  116. else
  117. {
  118. if(empty($_POST['ans']))
  119. {
  120. if($version == "wml")
  121. {
  122. header('Content-type: text/vnd.wap.wml; charset=utf-8');
  123. header("Cache-Control: no-cache");
  124. echo(doctype("Ответ на тему").$tag.'
  125. <b>Ответить на тему в "'.$data['fname'].'" </b><br /> <br />
  126. Имя: <input type="text" name="author" maxlength="10" />
  127. <br />
  128. Тема: ['.$data['tname'].'] <br />
  129. Сообщение: <br />'.$tagC.'
  130. <input type="text" name="mess'.$ref.'" maxlength="500" /><br /><anchor>[Ответить]
  131. <go href="./?p=30&amp;v=wml&amp;f='.$f.'" method="post">
  132. <postfield name="mess" value="$(mess'.$ref.')" />');
  133. echo('Транслит:<br />
  134. <select name="transl">
  135. <option value="0">Нет</option>
  136. <option value="1">Да</option>
  137. </select>');
  138. echo('
  139. <postfield name="mess" value="$(mess'.$ref.')" />
  140. <postfield name="transl" value="$(transl'.$ref.')" />
  141. <postfield name="ans" value="true" />
  142. </go></anchor><br />'.$tag.'
  143. <a href="./?p=14&amp;v=wml&amp;f=4">Смайлы</a><br />
  144. <a href="./?p=4&amp;v=wml&amp;t='.$f.'">В тему</a><br />
  145. <a href="./?p=2&amp;v=wml&amp;f='.$data['id_forum'].'">В «'.$data['fname'].'»</a><br />
  146. <a href="./?p=0&amp;v=wml">Форумы</a>
  147. '.$tagC.'</p></card></wml>');
  148. } elseif($version == "xhtml")
  149. {
  150. header("Content-type: text/html; charset=utf-8");
  151. header("Last-Modified:".gmdate("D, d M Y H:i:s")." GMT");
  152. header("Cache-Control: no-cache, must-relative");
  153. echo('<html>
  154. <head>
  155. <title>Ответ на тему</title>
  156. </head>
  157. <body bgcolor="'.$style['background'].'" link="'.$style['link'].'" vlink="'.$style['link'].'" text="#000000">
  158. <form action="./?p=30&amp;v=xhtml&amp;sid='.$sid.'&amp;f='.$f.'" method="post">
  159. <table align="center" border="0" cellspacing="1" cellpadding="5" width="350">
  160. <tr><td align="center" bgcolor="'.$style['title'].'" colspan="2">
  161. <font color="#FFFFFF"><b>Ответ на тему</b></font>
  162. </td></tr>
  163. <tr bgcolor="'.$style['bottom'].'"><td colspan="2"><b>Ответить на тему в "'.$data['fname'].'"</b></td></tr>
  164. <tr bgcolor="#deebf1"><td colspan="2"></td></tr>
  165. <tr bgcolor="'.$style['text'].'"><td>'.$tag.'Имя:'.$tagC.'</td><td><input type="text" name="author" maxlength="10" /></td></tr>
  166. <tr bgcolor="'.$style['text'].'"><td>'.$tag.'Тема:'.$tagC.'</td><td>'.$tag.'[Re: '.$data['tname'].']'.$tagC.'</td></tr>
  167. <tr bgcolor="'.$style['text'].'"><td>'.$tag.'Сообщение:'.$tagC.'</td><td><textarea name="mess" cols="30" rows="5"></textarea></td></tr>');
  168. echo('<tr bgcolor="'.$style['text'].'"><td nowrap>'.$tag.'Транслит:'.$tagC.'</td>
  169. <td><select name="transl">
  170. <option value="0">Нет</option>
  171. <option value="1">Да</option>
  172. </select></td></tr>');
  173. echo('
  174. <tr bgcolor="'.$style['text'].'"><td align="center" colspan="2">
  175. <input type="hidden" name="ans" value="true">
  176. <input type="submit" value="Ответить" /></td></tr>
  177. <tr bgcolor="'.$style['bottom'].'"><td colspan="2">'.$tag.'
  178. <a href="./?p=14&amp;v=xhtml&amp;f=4">Смайлы</a><br />
  179. <a href="./?p=4&amp;v=xhtml&amp;t='.$f.'">В тему</a><br />
  180. <a href="./?p=2&amp;v=xhtml&amp;f='.$data['id_forum'].'">В «'.$data['fname'].'»</a><br />
  181. <a href="./?p=0&amp;v=xhtml">Форумы</a>
  182. '.$tagC.'</td></tr></table>
  183. </form>
  184. </body></html>');
  185. }
  186. } else
  187. {
  188. $message = $_POST['mess'];
  189. $transl=sql(htmlspecialchars(trim(chop($_POST['transl']))));
  190. $username=sql(htmlspecialchars(trim(chop($_POST['author']))));
  191. $username=translatenick($username);
  192. if($transl == "1")
  193. {
  194. $message = translate($message);
  195. }
  196. $message = preg_replace("|[\r\n]+|", " \r\n", $message);
  197. $message = preg_replace("|[\n]+|", "\n", $message);
  198. $message = sql(htmlspecialchars(trim(chop(cutString($message, 1024)))));
  199. $message = preg_replace_callback("|&lt;(\d{1,20})&gt;|", "smile", $message);
  200. if(strpos($message, "http://") !== false)
  201. {
  202. $message = preg_replace("|(http://[^\s]+)|i", "<a href=\"go/?\\1\">\\1</a>", $message);
  203. }
  204. else if(strpos($message, "HTTP://") !== false)
  205. {
  206. $message = preg_replace("|(HTTP://[^\s]+)|i", "<a href=\"go/?\\1\">\\1</a>", $message);
  207. }
  208. $R = mysql_query("SELECT * FROM `posts`
  209. WHERE `name`='".$username."'
  210. AND `id_theme`=".$f);
  211. $aR = mysql_fetch_array($R);
  212. $postR=$aR['post'];
  213. if(!preg_match("|^[-a-z0-9а-яё_!?№#;:%^&*()+=~\|\\\/ @.,\[\]\{\}\"'<>\s]*$|iu", $message) or empty($message))
  214. {
  215. if($version == "wml")
  216. {
  217. header('Content-type: text/vnd.wap.wml; charset=utf-8');
  218. header("Cache-Control: no-cache");
  219. echo(doctype("Ответ на тему").$tag.'
  220. <b>Ответить в тему в "'.$data['fname'].'"</b><br /> <br />
  221. <b>Поле "Сообщение" пустое или содержит плохие символы! </b><br />
  222. Имя: <input type="text" name="author" maxlength="10" /> <br />
  223. Тема: ['.$data['tname'].'] <br />
  224. Сообщение: '.$tagC.'<br />
  225. <input type="text" name="mess'.$ref.'" maxlength="600" /><br />');
  226. echo($tag.'Транслит:'.$tagC.'<br />
  227. <select name="transl'.$ref.'" value="0">
  228. <option value="0">Нет</option>
  229. <option value="1">Да</option>
  230. </select><br />');
  231. echo('
  232. <anchor>[Ответить]
  233. <go href="./?p=30&amp;v=wml&amp;f='.$f.'" method="post">
  234. <postfield name="mess" value="$(mess'.$ref.')" />');
  235. echo('<postfield name="transl" value="$(transl'.$ref.')" />');
  236. echo('
  237. <postfield name="ans" value="true" />
  238. </go></anchor><br />
  239. '.$tag.'
  240. <a href="./?p=14&amp;v=wml&amp;f=4">Смайлы</a><br />
  241. <a href="./?p=4&amp;v=wml&amp;t='.$f.'">В тему</a><br />
  242. <a href="./?p=2&amp;v=wml&amp;f='.$data['id_forum'].'">В «'.$data['fname'].'»</a><br />
  243. <a href="./?p=0&amp;v=wml">Форумы</a>
  244. '.$tagC.'</p></card></wml>');
  245. } elseif($version == "xhtml")
  246. {
  247. header("Content-type: text/html; charset=utf-8");
  248. header("Last-Modified:".gmdate("D, d M Y H:i:s")." GMT");
  249. header("Cache-Control: no-cache, must-relative");
  250. echo('<html>
  251. <head>
  252. <title>Ответ на тему</title>
  253. </head>
  254. <body bgcolor="'.$style['background'].'" link="'.$style['link'].'" vlink="'.$style['link'].'" text="#000000">
  255. <form action="./?p=30&amp;v=xhtml&amp;f='.$f.'" method="post">
  256. <table align="center" border="0" cellspacing="1" cellpadding="5" width="350">
  257. <tr><td align="center" bgcolor="'.$style['title'].'" colspan="2">
  258. <font color="#FFFFFF"><b>Ответ на тему</b></font>
  259. </td></tr>
  260. <tr bgcolor="'.$style['bottom'].'"><td colspan="2">
  261. <b>Ответить на тему в "'.$data['fname'].'"</b>
  262. </td></tr>
  263. <tr bgcolor="#deebf1"><td colspan="2">'.$tag.'<b>Ошибка!!! Поле "Сообщение" пустое или содержит плохие символы!</b>'.$tagC.'</td></tr>
  264. <tr bgcolor="'.$style['text'].'"><td>'.$tag.'Имя:'.$tagC.'</td><td><input type="text" name="author" maxlength="10" /></td></tr>
  265. <tr bgcolor="'.$style['text'].'"><td>'.$tag.'Тема:'.$tagC.'</td><td>'.$tag.'[Re: '.$data['tname'].']'.$tagC.'</td></tr>
  266. <tr bgcolor="'.$style['text'].'"><td>'.$tag.'Сообщение:'.$tagC.'</td><td><textarea name="mess" cols="30" rows="5"></textarea></td></tr>');
  267. echo('<tr bgcolor="'.$style['text'].'"><td nowrap>Транслит:</td>
  268. <td><select name="transl">
  269. <option value="0">Нет</option>
  270. <option value="1">Да</option>
  271. </select></td></tr>');
  272. echo('
  273. <tr bgcolor="'.$style['text'].'"><td align="center" colspan="2">
  274. <input type="hidden" name="ans" value="true">
  275. <input type="submit" value="Ответить" /></td></tr>
  276. <tr bgcolor="'.$style['bottom'].'"><td colspan="2">'.$tag.'
  277. <a href="./?p=14&amp;v=xhtml&amp;f=4">Смайлы</a><br />
  278. <a href="./?p=4&amp;v=xhtml&amp;t='.$f.'">В тему</a><br />
  279. <a href="./?p=2&amp;v=xhtml&amp;f='.$data['id_forum'].'">В «'.$data['fname'].'»</a><br />
  280. <a href="./?p=0&amp;v=xhtml">Форумы</a>
  281. '.$tagC.'</td></tr></table>
  282. </form>
  283. </body></html>');
  284. }
  285. }
  286. elseif(mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE username='".$username."'"), 0) > 0)
  287. {
  288. if($version == "wml")
  289. {
  290. header('Content-type: text/vnd.wap.wml; charset=utf-8');
  291. header("Cache-Control: no-cache");
  292. echo(doctype("Ответ на тему").$tag.'
  293. <b>Ответить в тему в "'.$data['fname'].'"</b><br /> <br />
  294. <b>Ошибка!!! Для использования этого имени необходима авторизация! </b><br />
  295. Имя: <input type="text" name="author" maxlength="10" /> <br />
  296. Тема: ['.$data['tname'].'] <br />
  297. Сообщение: '.$tagC.'<br />
  298. <input type="text" name="mess'.$ref.'" maxlength="600" /><br />');
  299. echo($tag.'Транслит:'.$tagC.'<br />
  300. <select name="transl'.$ref.'" value="0">
  301. <option value="0">Нет</option>
  302. <option value="1">Да</option>
  303. </select><br />');
  304. echo('
  305. <anchor>[Ответить]
  306. <go href="./?p=30&amp;v=wml&amp;f='.$f.'" method="post">
  307. <postfield name="mess" value="$(mess'.$ref.')" />');
  308. echo('<postfield name="transl" value="$(transl'.$ref.')" />');
  309. echo('
  310. <postfield name="ans" value="true" />
  311. </go></anchor><br />
  312. '.$tag.'
  313. <a href="./?p=14&amp;v=wml&amp;f=4">Смайлы</a><br />
  314. <a href="./?p=4&amp;v=wml&amp;t='.$f.'">В тему</a><br />
  315. <a href="./?p=2&amp;v=wml&amp;f='.$data['id_forum'].'">В «'.$data['fname'].'»</a><br />
  316. <a href="./?p=0&amp;v=wml">Форумы</a>
  317. '.$tagC.'</p></card></wml>');
  318. } elseif($version == "xhtml")
  319. {
  320. header("Content-type: text/html; charset=utf-8");
  321. header("Last-Modified:".gmdate("D, d M Y H:i:s")." GMT");
  322. header("Cache-Control: no-cache, must-relative");
  323. echo('<html>
  324. <head>
  325. <title>Ответ на тему</title>
  326. </head>
  327. <body bgcolor="'.$style['background'].'" link="'.$style['link'].'" vlink="'.$style['link'].'" text="#000000">
  328. <form action="./?p=30&amp;v=xhtml&amp;f='.$f.'" method="post">
  329. <table align="center" border="0" cellspacing="1" cellpadding="5" width="350">
  330. <tr><td align="center" bgcolor="'.$style['title'].'" colspan="2">
  331. <font color="#FFFFFF"><b>Ответ на тему</b></font>
  332. </td></tr>
  333. <tr bgcolor="'.$style['bottom'].'"><td colspan="2">
  334. <b>Ответить на тему в "'.$data['fname'].'"</b>
  335. </td></tr>
  336. <tr bgcolor="#deebf1"><td colspan="2">'.$tag.'<b>Ошибка!!! Для использования этого имени необходима авторизация</b>'.$tagC.'</td></tr>
  337. <tr bgcolor="'.$style['text'].'"><td>'.$tag.'Имя:'.$tagC.'</td><td><input type="text" name="author" maxlength="10" /></td></tr>
  338. <tr bgcolor="'.$style['text'].'"><td>'.$tag.'Тема:'.$tagC.'</td><td>'.$tag.'[Re: '.$data['tname'].']'.$tagC.'</td></tr>
  339. <tr bgcolor="'.$style['text'].'"><td>'.$tag.'Сообщение:'.$tagC.'</td><td><textarea name="mess" cols="30" rows="5"></textarea></td></tr>');
  340. echo('<tr bgcolor="'.$style['text'].'"><td nowrap>Транслит:</td>
  341. <td><select name="transl">
  342. <option value="0">Нет</option>
  343. <option value="1">Да</option>
  344. </select></td></tr>');
  345. echo('
  346. <tr bgcolor="'.$style['text'].'"><td align="center" colspan="2">
  347. <input type="hidden" name="ans" value="true">
  348. <input type="submit" value="Ответить" /></td></tr>
  349. <tr bgcolor="'.$style['bottom'].'"><td colspan="2">'.$tag.'
  350. <a href="./?p=14&amp;v=xhtml&amp;f=4">Смайлы</a><br />
  351. <a href="./?p=4&amp;v=xhtml&amp;t='.$f.'">В тему</a><br />
  352. <a href="./?p=2&amp;v=xhtml&amp;f='.$data['id_forum'].'">В «'.$data['fname'].'»</a><br />
  353. <a href="./?p=0&amp;v=xhtml">Форумы</a>
  354. '.$tagC.'</td></tr></table>
  355. </form>
  356. </body></html>');
  357. }
  358. }
  359. elseif(!preg_match("|^[<>@\[\] -\.\_0-9a-zA-Zа-яА-Я]+$|u", $username) or strlen($username) > 20)
  360. {
  361. if($version == "wml")
  362. {
  363. header('Content-type: text/vnd.wap.wml; charset=utf-8');
  364. header("Cache-Control: no-cache");
  365. echo(doctype("Ответ на тему").$tag.'
  366. <b>Ответить в тему в "'.$data['fname'].'"</b><br /> <br />
  367. <b>Поле "Имя" пустое или содержит плохие символы! </b><br />
  368. Имя: <input type="text" name="author" maxlength="10" /> <br />
  369. Тема: ['.$data['tname'].'] <br />
  370. Сообщение: '.$tagC.'<br />
  371. <input type="text" name="mess'.$ref.'" maxlength="600" /><br />');
  372. echo($tag.'Транслит:'.$tagC.'<br />
  373. <select name="transl'.$ref.'" value="0">
  374. <option value="0">Нет</option>
  375. <option value="1">Да</option>
  376. </select><br />');
  377. echo('
  378. <anchor>[Ответить]
  379. <go href="./?p=30&amp;v=wml&amp;f='.$f.'" method="post">
  380. <postfield name="mess" value="$(mess'.$ref.')" />');
  381. echo('<postfield name="transl" value="$(transl'.$ref.')" />');
  382. echo('
  383. <postfield name="ans" value="true" />
  384. </go></anchor><br />
  385. '.$tag.'
  386. <a href="./?p=14&amp;v=wml&amp;f=4">Смайлы</a><br />
  387. <a href="./?p=4&amp;v=wml&amp;t='.$f.'">В тему</a><br />
  388. <a href="./?p=2&amp;v=wml&amp;f='.$data['id_forum'].'">В «'.$data['fname'].'»</a><br />
  389. <a href="./?p=0&amp;v=wml">Форумы</a>
  390. '.$tagC.'</p></card></wml>');
  391. } elseif($version == "xhtml")
  392. {
  393. header("Content-type: text/html; charset=utf-8");
  394. header("Last-Modified:".gmdate("D, d M Y H:i:s")." GMT");
  395. header("Cache-Control: no-cache, must-relative");
  396. echo('<html>
  397. <head>
  398. <title>Ответ на тему</title>
  399. </head>
  400. <body bgcolor="'.$style['background'].'" link="'.$style['link'].'" vlink="'.$style['link'].'" text="#000000">
  401. <form action="./?p=30&amp;v=xhtml&amp;f='.$f.'" method="post">
  402. <table align="center" border="0" cellspacing="1" cellpadding="5" width="350">
  403. <tr><td align="center" bgcolor="'.$style['title'].'" colspan="2">
  404. <font color="#FFFFFF"><b>Ответ на тему</b></font>
  405. </td></tr>
  406. <tr bgcolor="'.$style['bottom'].'"><td colspan="2">
  407. <b>Ответить на тему в "'.$data['fname'].'"</b>
  408. </td></tr>
  409. <tr bgcolor="#deebf1"><td colspan="2">'.$tag.'<b>Ошибка!!! Поле "Имя" пустое или содержит плохие символы!</b>'.$tagC.'</td></tr>
  410. <tr bgcolor="'.$style['text'].'"><td>'.$tag.'Имя:'.$tagC.'</td><td><input type="text" name="author" maxlength="10" /></td></tr>
  411. <tr bgcolor="'.$style['text'].'"><td>'.$tag.'Тема:'.$tagC.'</td><td>'.$tag.'[Re: '.$data['tname'].']'.$tagC.'</td></tr>
  412. <tr bgcolor="'.$style['text'].'"><td>'.$tag.'Сообщение:'.$tagC.'</td><td><textarea name="mess" cols="30" rows="5"></textarea></td></tr>');
  413. echo('<tr bgcolor="'.$style['text'].'"><td nowrap>Транслит:</td>
  414. <td><select name="transl">
  415. <option value="0">Нет</option>
  416. <option value="1">Да</option>
  417. </select></td></tr>');
  418. echo('
  419. <tr bgcolor="'.$style['text'].'"><td align="center" colspan="2">
  420. <input type="hidden" name="ans" value="true">
  421. <input type="submit" value="Ответить" /></td></tr>
  422. <tr bgcolor="'.$style['bottom'].'"><td colspan="2">'.$tag.'
  423. <a href="./?p=14&amp;v=xhtml&amp;f=4">Смайлы</a><br />
  424. <a href="./?p=4&amp;v=xhtml&amp;t='.$f.'">В тему</a><br />
  425. <a href="./?p=2&amp;v=xhtml&amp;f='.$data['id_forum'].'">В «'.$data['fname'].'»</a><br />
  426. <a href="./?p=0&amp;v=xhtml">Форумы</a>
  427. '.$tagC.'</td></tr></table>
  428. </form>
  429. </body></html>');
  430. }
  431. }
  432. elseif(strtolower($postR) == strtolower($message))
  433. {
  434. header("Location: ".$forumdir."p=2&f=".$data['id_forum']."&v=".$version);
  435. }
  436. else
  437. {
  438. if(mysql_result(
  439. mysql_query("SELECT COUNT(*)
  440. FROM `posts`
  441. WHERE `name` = '$username'
  442. AND `id_theme` = ".$f."
  443. AND `crc32` = ".crc32($message)), 0))
  444. {
  445. header("Location: ".$forumdir."p=2&f=".$data['id_forum']."&v=".$version);
  446. exit();
  447. }
  448. mysql_query("UPDATE `themes`
  449. SET `time`=".time()." WHERE `id`=".$f);
  450. mysql_query("INSERT INTO `posts` VALUES(0, '".$username."', '".$message."', ".crc32($message).", ".$f.", ".time().", '".$user."', '".$ip."')");
  451. header("Location: ".$forumdir."p=2&f=".$data['id_forum']."&v=".$version);
  452. }
  453. }
  454. }
  455. }
  456. ?>