Просмотр файла includes/main_forum/index.php

Размер файла: 3.47Kb
  1. <?php
  2. # Не выводить сообщения об ошибках
  3. error_reporting(0);
  4.  
  5. Header("Content-type:text/vnd.wap.wml; charset=Utf-8");
  6. Header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
  7. Header("Cache-Control: no-cache, must-relative");
  8. print "<?xml version=\"1.0\" encoding=\"Utf-8\"?>";
  9. print '<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN" "http://www.wapforum.org/DTD/wml_1.2.xml">';
  10. print '<wml>';
  11. # if ($user!='dimon') die('<card id="m" title="KMX.Ru-Форум"><p>Форум на реконструкции. Зайдите позже.<br/><anchor>назад<prev/></anchor></p></card></wml>');
  12.  
  13. # Пути
  14. $rootpath="/home/kmx/includes/main_forum/"; # К директории форума относительно корня файловой системы
  15. $forum='?'.$id.'/forum'; # К файлу форума относительно корня WEB-сервера
  16. $mainpage='?'.$id; # К главной странице относительно корня WEB-сервера
  17.  
  18. # Имена таблиц в БД
  19. $table = "mainforum"; # Форума
  20. $tableu = "users"; # Пользователей
  21.  
  22. # Системное сообщение по умолчанию
  23. #$sysmsg='<b>РІСЃРµ РІ РЅРѕСЂРјРµ</b><br/>';
  24.  
  25. #if ($anketa['status']<4) include($rootpath."underconstuction.php");
  26.  
  27. if (!$connect_bd) include($rootpath."mysqlerror.php");
  28.  
  29. @mysql(DBName,"CREATE TABLE `$table` ( `l1` int(11) NOT NULL default '0', `l2` int(11) NOT NULL default '0', `l3` int(11) NOT NULL default '0', `status` int(11) NOT NULL default '0', `login` varchar(16) NOT NULL default '', `time` int(11) NOT NULL default '0', `text` text NOT NULL)");
  30.  
  31. # @mysql_query("LOCK TABLES `$table` WRITE");
  32. # ALTER TABLE `mainforum` ORDER BY (`l1` * 1000000 + `l2` * 1000 + `l3`)
  33.  
  34. $login = $user.'.'.$sitedomain.'.ru';
  35.  
  36. $q=@mysql(DBName,"SELECT `status` FROM `users` WHERE `domain` = '$sitedomain' AND `login` = '$user'");
  37.  
  38. $back_addr=$query1.'/'.$query2.'/'.$query3.'/'.$query4.'/'.$query5.'/'.$query6;
  39.  
  40. if ($user!='')
  41. {
  42. $autorize = true;
  43. $f = mysql_fetch_array($q);
  44. $status = $f['status'];
  45. }
  46. else
  47. {
  48. $autorize = false;
  49. $status = 0;
  50. }
  51.  
  52. $action = $query1;
  53.  
  54. $_razdel = explode('-',$query2);
  55. $razdel = $_razdel[0];
  56. $paget = $_razdel[1] =$apage;
  57.  
  58. $_topic = explode('-',$query3);
  59. $topic = $_topic[0];
  60. $pagem = $_topic[1];
  61.  
  62. $_message = explode('-',$query4);
  63. $message = $_message[0];
  64.  
  65. $addtopic = addslashes(utf2cyr(str_replace("\r"," ",str_replace("\n"," ",stripslashes(trim($HTTP_POST_VARS['at']))))));
  66. $addmsg = addslashes(utf2cyr(str_replace("\r"," ",str_replace("\n"," ",stripslashes(trim($HTTP_POST_VARS['am']))))));
  67.  
  68. $title = "KMX.Ru - ";
  69.  
  70. if ($paget<1) $paget=1;
  71. if ($pagem<1) $pagem=1;
  72.  
  73. $maxsize=3000;
  74.  
  75. if ($autorize)
  76. {
  77. $endtext='<br/><br/><a href="'.$mainpage.'">xPanel</a></p></card></wml>';
  78. $mainkey='<do name="m" type="options" label="xPanel"><go href="'.$mainpage.'"/></do>';
  79. }
  80. else
  81. {
  82. $endtext='<br/><br/><a href="'.$mainpage.'">На главную</a></p></card></wml>';
  83. $mainkey='<do name="m" type="options" label="На главную"><go href="'.$mainpage.'"/></do>';
  84. }
  85.  
  86. switch ($action)
  87. {
  88. case 'dr': include($rootpath_forum."delrazdel.php");break;
  89. case 'ar': include($rootpath_forum."addrazdel.php");break;
  90. case 'r': include($rootpath_forum."rules.php");break;
  91. case 'a':
  92. case 'reg': include($rootpath_forum."autorize.php");break;
  93. case 'nm': include($rootpath_forum."addanswer.php");break;
  94. case 'nt': include($rootpath_forum."addtopic.php");break;
  95. case 'dm': include($rootpath_forum."editanswer.php");break;
  96. default: include($rootpath_forum."main.php");break;
  97. }
  98.  
  99. @mysql_query("UNLOCK TABLES");
  100.  
  101. print $endtext;
  102. exit();
  103. ?>