Просмотр файла cfg.php

Размер файла: 6.1Kb
  1. <?
  2. ###########################
  3. # Данная версия скрипта принадлежит #
  4. # LiraS aka Артур Лукин Иванович #
  5. # Вносить свои изменения крайне #
  6. # запрещенно! #
  7. ###########################
  8. require 'functions.php';
  9. if (isset($_GET['usr']))
  10. {
  11. $_GET['usr'] = stringg($_GET['usr']);
  12. }
  13. if (isset($_GET['pwd']))
  14. {
  15. $_GET['pwd'] = stringg($_GET['pwd']);
  16. }
  17. if (isset($_GET['v']))
  18. {
  19. $_GET['v'] = htmlspecialchars(stripslashes(trim($_GET['v'])));
  20. }
  21. function vremya($time)
  22. {
  23. $tim = date("d.m.y", $time);
  24.  
  25. return $tim;
  26. }
  27. function news_time($time)
  28. {
  29. $tim = date("d.m.y H:i", $time);
  30. return $tim;
  31. }
  32. function chat($time)
  33. {
  34. $tim = date("d.m H:i",$time);
  35. return $tim;
  36. }
  37.  
  38. function vremja($time=NULL,$times=NULL)
  39. {
  40. global $set;
  41. $timesdvig=$set['timesdvig'];
  42. if ($time==NULL)$time=time();
  43. if ($times==NULL)$time=$time+$timesdvig;
  44. else $time=$time+intval($times);
  45. $timep="".date("j M Y в H:i", $time)."";
  46. $time_p[0]=date("j n Y", $time);
  47. $time_p[1]=date("H:i", $time);
  48. if ($time_p[0]==date("j n Y", time()+$timesdvig))$timep="сегодня в $time_p[1]";
  49. if ($time_p[0]==date("j n Y", time()+$timesdvig-86400))$timep="вчера в $time_p[1]";
  50. $timep=str_replace("Jan","01",$timep);
  51. $timep=str_replace("Feb","02",$timep);
  52. $timep=str_replace("Mar","03",$timep);
  53. $timep=str_replace("May","04",$timep);
  54. $timep=str_replace("Apr","05",$timep);
  55. $timep=str_replace("Jun","06",$timep);
  56. $timep=str_replace("Jul","07",$timep);
  57. $timep=str_replace("Aug","08",$timep);
  58. $timep=str_replace("Sep","09",$timep);
  59. $timep=str_replace("Oct","10",$timep);
  60. $timep=str_replace("Nov","11",$timep);
  61. $timep=str_replace("Dec","12",$timep);
  62. return $timep;
  63. }
  64. function otdih($time)
  65. {
  66. $timeo = date("i|s", $time);
  67. $tim = explode("|", $timeo);
  68. $t = "$tim[0] минут $tim[1] секунд";
  69. return $t;
  70. }
  71. function pochta()
  72. {
  73. $q = mysql_query("SELECT COUNT(*) FROM `msg_r` WHERE `user_to` = '".mysql_real_escape_string($_GET['usr'])."' AND `read` = '1';");
  74. $new_mail = mysql_result($q, 0);
  75. if ($new_mail>0)
  76. {
  77. echo "<font color=\"green\"><big><b><a href=\"msg.php?usr=$_GET[usr]&amp;pwd=$_GET[pwd]&amp;id=read\">У вас сообщение!</a>[$new_mail]</b></big></font><br/>";
  78. }
  79. }
  80.  
  81. function head($title=NULL)
  82. {
  83. # Глобал set
  84. global $set,$exist;
  85. if ($title==NULL) $title=$set['title'];
  86. if (empty($_GET['usr']))
  87. {
  88. if (isset($_GET['v']) && $_GET['v'] == 'xhtml' || isset($_GET['v']) && $_GET['v'] != 'web')
  89. {
  90. require 'themes/1/head.php';
  91. } elseif (isset($_GET['v']) && $_GET['v'] == 'web')
  92. {
  93. require 'themes/2/head.php';
  94. }
  95. } elseif ($exist == 1)
  96. {
  97. $u = mysql_fetch_array(mysql_query("SELECT `id` FROM `users` WHERE `usr` = '".mysql_real_escape_string($_GET['usr'])."'"));
  98. $id = strip_tags($u['id']);
  99. $d = mysql_fetch_array(mysql_query("SELECT `design` FROM `settings` WHERE `u_id` = '".mysql_real_escape_string($id)."'"));
  100. $design = strip_tags($d['design']);
  101. ###################################
  102. if ($design == 0 or $design == null)
  103. {
  104. require 'themes/1/head.php';
  105. } elseif ($design != 0 and is_file("themes/".$design."/head.php"))
  106. {
  107. require "themes/".$design."/head.php";
  108. }
  109. } else
  110. {
  111. require 'themes/1/head.php';
  112. }
  113. }
  114. function foot()
  115. {
  116.  
  117. global $usr,$exist;
  118.  
  119. if (empty($usr) or $exist == 0)
  120. {
  121. if (isset($_GET['v']))
  122. {
  123. if ($_GET['v'] == '' OR $_GET[v] == 'xhtml' || isset($_GET['v']))
  124. {
  125. require "themes/1/foot.php";
  126. }
  127. elseif ($_GET['v'] == 'web')
  128. {
  129. require "themes/2/foot.php";
  130. }
  131. } else
  132. {
  133. require "themes/1/foot.php";
  134. }
  135. }elseif (isset($usr) && $diz > 0)
  136. {
  137. $u = mysql_fetch_array(mysql_query("SELECT id FROM users WHERE usr = '".mysql_real_escape_string($_GET['usr'])."'"));
  138. $id = $u['id'];
  139. $diz = mysql_num_rows(mysql_query("SELECT * FROM settings WHERE u_id = '".mysql_real_escape_string($id)."'"));
  140. $t = mysql_fetch_array(mysql_query("SELECT design FROM settings WHERE u_id = '".mysql_real_escape_string($id)."'"));
  141. require "themes/$t[design]/foot.php";
  142. }
  143. }
  144. function foot_main()
  145. {
  146. $diz = mysql_num_rows(mysql_query("SELECT * FROM users WHERE usr = '".mysql_real_escape_string($_GET['usr'])."'"));
  147. if (empty($_GET['usr']))
  148. {
  149. if (isset($_GET['v']))
  150. {
  151. if ($_GET['v'] == '' OR $_GET['v'] == 'xhtml')
  152. {
  153. require "themes/1/foot_main.php";
  154. }
  155. elseif ($_GET['v'] == 'web')
  156. {
  157. require "themes/2/foot_main.php";
  158. }
  159. } else
  160. {
  161. require "themes/1/foot_main.php";
  162. }
  163. }elseif (isset($_GET['usr']) && $diz > 0)
  164. {
  165. $t = mysql_fetch_array(mysql_query("SELECT design FROM settings WHERE user = '".mysql_real_escape_string($_GET['usr'])."'"));
  166. require "themes/$t[design]/foot_main.php";
  167. }
  168. }
  169. function title($msg = NULL,$img = NULL) // Загловок страницы
  170. {
  171. if (!isset($_SESSION['web']) || $_SESSION['web']==0)
  172. {
  173. global $set;
  174. if ($msg=='no' || $msg=='notitle' || $msg=='not')$msg=NULL;
  175. elseif ($msg==NULL || $msg=='default' || $msg=='DEFAULT')$msg=$set['welcome'];
  176.  
  177.  
  178. if ($img!=NULL && $msg!=NULL)$img.="<br />\n";
  179.  
  180. echo "<div class=\"title\"></div>";
  181. }
  182. }
  183. function ban()
  184. {
  185. $u = mysql_fetch_array(mysql_query("SELECT id FROM users WHERE usr = '".mysql_real_escape_string($_GET['usr'])."'"));
  186. $ban = mysql_num_rows(mysql_query("SELECT * FROM ban WHERE user_id = '".mysql_real_escape_string($u['id'])."'"));
  187. $bn = mysql_fetch_array(mysql_query("SELECT * FROM ban WHERE user_id = '".mysql_real_escape_string($u['id'])."'"));
  188. $times = time();
  189. echo "<div class=\"main\"><div class=\"in\">";
  190. if ($ban > 0 && $times<$bn['time'])
  191. {
  192. echo "Вы в бане!<br/>\n";
  193. $who = iconv("windows-1251","utf-8",$bn['who']);
  194. $why = iconv("windows-1251","utf-8",$bn['why']);
  195. echo "Забанил: $who <br/>\n";
  196. echo "Причина: $why <br/>\n";
  197. echo "До: ".vremja($bn[time])." <br/>\n";
  198. $r = rand(10000,999999);
  199. echo "<a href=\"main.php?usr=$_GET[usr]&amp;pwd=$_GET[pwd]&amp;rand=$r\">назад</a><br/>\n";
  200. }
  201. elseif ($times >= $bn['time'])
  202. {
  203. mysql_query("DELETE FROM ban WHERE user_id = '$u[id]'");
  204. echo "Вы успешно вышли из бана<br/>\n<a href=\"main.php?usr=$_GET[usr]&amp;pwd=$_GET[pwd]\">в игру</a>";
  205. }
  206. foot();
  207. exit();
  208. }
  209.  
  210. ?>