Просмотр файла system/inc/classes/settings.class.php

Размер файла: 2.76Kb
  1. <?php
  2.  
  3. if (substr(PHP_OS, 0, 3) == 'WIN')
  4. {
  5. define('OS_WINDOWS', true);
  6. define('OS_UNIX', false);
  7. define('PEAR_OS', 'Windows');
  8. }
  9. else
  10. {
  11. define('OS_WINDOWS', false);
  12. define('OS_UNIX', true);
  13. define('PEAR_OS', 'Unix');
  14. }
  15.  
  16. @ob_start();
  17. @ob_implicit_flush(0);
  18.  
  19.  
  20. $shcms_setting = mysql_fetch_array(mysql_query("SELECT * FROM `shcms_settings`"));
  21.  
  22.  
  23. /**
  24. * Если есть ошибки выводит
  25. * функция ниже.
  26. */
  27. function errors($error_)
  28. {
  29. echo '<div class="errors">'.$error_.'</div>';
  30. }
  31.  
  32. /**
  33. * Если все правильно выводит
  34. * функцию ниже
  35. */
  36. function messag($messag_)
  37. {
  38. echo '<div class="actshcms">'.$messag_.'</div>';
  39. }
  40.  
  41. $method_logs = $_SERVER['REQUEST_METHOD'];
  42. $server_port =$_SERVER['SERVER_PORT'];
  43.  
  44. /**
  45. * Доступ для авторизованных
  46. */
  47.  
  48. function registrat($link = NULL)
  49. {
  50. global $user_id;
  51. if (!isset($user_id))
  52. {
  53. if ($link==NULL)
  54. $link=H.'index.php?';
  55. header("Location: $link");
  56. exit;
  57. }
  58. }
  59. /**
  60. * Доступ для не авторизованных
  61. */
  62. function unreg($unregi = "")
  63. {
  64. global $user_id;
  65. if (isset($user_id))
  66. {
  67. if ($unregi=="")$unregi='/';
  68. header("Location: $unregi");
  69. exit;
  70. }
  71. }
  72.  
  73.  
  74. /**
  75. * Определяет размер файлов.
  76. */
  77.  
  78. function size($file_size) {
  79. if( $file_size >= 1073741824 ) {
  80. $file_size = round( $file_size / 1073741824 * 100 ) / 100 . " Gb";
  81. } elseif( $file_size >= 1048576 ) {
  82. $file_size = round( $file_size / 1048576 * 100 ) / 100 . " Mb";
  83. } elseif( $file_size >= 1024 ) {
  84. $file_size = round( $file_size / 1024 * 100 ) / 100 . " Kb";
  85. } else {
  86. $file_size = $file_size . " b";
  87. }
  88. return $file_size;
  89. }
  90.  
  91. /**
  92. * Обработка смайлов,
  93. * тэгов,
  94. * сcылок и строк
  95. */
  96. function processing($pag_smil,$bbcode_smiley_smiley = true, $parser = true, $smiles = true)
  97. {
  98. if ($bbcode_smiley_smiley == true)
  99. {
  100. $bb_c_s=$pag_smil;
  101. $pag_smil = bbcode::bb_codes($pag_smil);
  102. }
  103. if ($parser==true)
  104. {
  105. $bb_c_s=$pag_smil;
  106. $BBcodeParser = new BBcodeParser;
  107. $pag_smil=$BBcodeParser->parserString($pag_smil);
  108. }
  109. if ($smiles==true)
  110. {
  111. $bb_c_s=$pag_smil;
  112. $smile_class = new Smiles;
  113. $pag_smil=$smile_class->Smileclass($pag_smil);
  114. }
  115. return $pag_smil;
  116. }
  117. $titles_home = mysql_fetch_array(mysql_query("SELECT * FROM `settings_shcms`"));
  118. $title_homes = $titles_home['title'];
  119. $time_date = time();
  120. ?>