Размер файла: 2.76Kb
- <?php
-
- if (substr(PHP_OS, 0, 3) == 'WIN')
- {
- define('OS_WINDOWS', true);
- define('OS_UNIX', false);
- define('PEAR_OS', 'Windows');
- }
- else
- {
- define('OS_WINDOWS', false);
- define('OS_UNIX', true);
- define('PEAR_OS', 'Unix');
- }
-
- @ob_start();
- @ob_implicit_flush(0);
-
-
- $shcms_setting = mysql_fetch_array(mysql_query("SELECT * FROM `shcms_settings`"));
-
-
-
- /**
- * Если есть ошибки выводит
- * функция ниже.
- */
- function errors($error_)
- {
- echo '<div class="errors">'.$error_.'</div>';
- }
-
- /**
- * Если все правильно выводит
- * функцию ниже
- */
-
- function messag($messag_)
- {
- echo '<div class="actshcms">'.$messag_.'</div>';
- }
-
-
- $method_logs = $_SERVER['REQUEST_METHOD'];
- $server_port =$_SERVER['SERVER_PORT'];
-
- /**
- * Доступ для авторизованных
- */
-
- function registrat($link = NULL)
- {
- global $user_id;
- if (!isset($user_id))
- {
- if ($link==NULL)
- $link=H.'index.php?';
- header("Location: $link");
- exit;
- }
- }
-
- /**
- * Доступ для не авторизованных
- */
- function unreg($unregi = "")
- {
- global $user_id;
- if (isset($user_id))
- {
- if ($unregi=="")$unregi='/';
- header("Location: $unregi");
- exit;
- }
- }
-
-
- /**
- * Определяет размер файлов.
- */
-
- function size($file_size) {
- if( $file_size >= 1073741824 ) {
- $file_size = round( $file_size / 1073741824 * 100 ) / 100 . " Gb";
- } elseif( $file_size >= 1048576 ) {
- $file_size = round( $file_size / 1048576 * 100 ) / 100 . " Mb";
- } elseif( $file_size >= 1024 ) {
- $file_size = round( $file_size / 1024 * 100 ) / 100 . " Kb";
- } else {
- $file_size = $file_size . " b";
- }
- return $file_size;
- }
-
-
- /**
- * Обработка смайлов,
- * тэгов,
- * сcылок и строк
- */
- function processing($pag_smil,$bbcode_smiley_smiley = true, $parser = true, $smiles = true)
- {
- if ($bbcode_smiley_smiley == true)
- {
- $bb_c_s=$pag_smil;
- $pag_smil = bbcode::bb_codes($pag_smil);
- }
- if ($parser==true)
- {
- $bb_c_s=$pag_smil;
- $BBcodeParser = new BBcodeParser;
- $pag_smil=$BBcodeParser->parserString($pag_smil);
- }
- if ($smiles==true)
- {
- $bb_c_s=$pag_smil;
- $smile_class = new Smiles;
- $pag_smil=$smile_class->Smileclass($pag_smil);
- }
- return $pag_smil;
- }
- $titles_home = mysql_fetch_array(mysql_query("SELECT * FROM `settings_shcms`"));
- $title_homes = $titles_home['title'];
- $time_date = time();
-
-
- ?>