diff --git a/upload/engine/core.class.php b/upload/engine/core.class.php index 0eeb42b..c0d760e 100644 --- a/upload/engine/core.class.php +++ b/upload/engine/core.class.php @@ -13,7 +13,7 @@ public $lng, $lng_m, $lng_b = array(); - public $csrf_time = 1800; + public $csrf_time = 3600; public $captcha = array( 0 => "---", diff --git a/upload/engine/libs/bbcode.parse.php b/upload/engine/libs/bbcode.parse.php index 7537894..baa0b28 100644 --- a/upload/engine/libs/bbcode.parse.php +++ b/upload/engine/libs/bbcode.parse.php @@ -90,7 +90,7 @@ ), 'spoiler' => array( - 'left_tag' => '
', + 'left_tag' => '
', 'right_tag' => '
' ), @@ -118,7 +118,7 @@ // Шаблоны ББ-кодов с опциями и тонкими настройками регулярок (рекурсивные) private $codes_options = array( 'quote' => array( - 'pattern' => '/\[(quote)\=\"(([\w]+) \| (\d{2}\.\d{2}\.\d{2} \- \d{2}\:\d{2}\:\d{2}))\"\]((?:[^[]|(?R))*)\[\/quote\]/Usi', + 'pattern' => '/\[(quote)\=\"((\w+) \| (\d{2}\.\d{2}\.\d{4} - \d{2}\:\d{2}\:\d{2}))\"\]((?:[^[]|(?R))*)\[\/quote\]/Usi', 'replace' => '
{2}
{5}
', 'values' => array(1,2,5), 'escapes' => false, @@ -168,7 +168,7 @@ 'spoiler' => array( 'pattern' => '/\[(spoiler)\=\"([\w\s\-\.\:\;\+\|\,]{1,32})\"\]((?:[^[]|(?R))*)\[\/spoiler\]/Usui', - 'replace' => '
{3}
', + 'replace' => '
{3}
', 'values' => array(1,2,3), 'escapes' => false, ), @@ -322,7 +322,7 @@ foreach($this->codes_video as $name => $value){ $pattern[] = '/\[video\=\"'.$name.'\"\]http(s)?\:\/\/(www\.)?'.$value['pattern'].'\[\/video\]/Usi'; - $replace[] = ''; + $replace[] = '
'; } return preg_replace($pattern, $replace, $text); diff --git a/upload/engine/menu.class.php b/upload/engine/menu.class.php index b90196d..4a1dda8 100644 --- a/upload/engine/menu.class.php +++ b/upload/engine/menu.class.php @@ -4,10 +4,11 @@ private $core, $db; // , $user, $lng public function __construct($core){ - $this->core = $core; - $this->db = $core->db; - $this->user = $core->user; - //$this->lng = $core->lng; + $this->core = $core; + $this->db = $core->db; + $this->user = $core->user; + $this->config = $core->config; + //$this->lng = $core->lng; } private function generate_sub_menu($tree){ @@ -17,10 +18,15 @@ $id = intval($ar['id']); $parent = intval($ar['parent']); + $url = $ar['url']; + + $active = ($this->is_active($url, $ar['sons'])) ? 'active' : ''; + $data = array( "TITLE" => $this->db->HSC($ar['title']), - "URL" => $this->db->HSC($ar['url']), + "URL" => $this->db->HSC($url), "TARGET" => $this->db->HSC($ar['target']), + "ACTIVE" => $active, "SUB_MENU" => (!empty($ar['sons'])) ? $this->generate_sub_menu($ar['sons']) : "", ); @@ -35,7 +41,29 @@ return ob_get_clean(); } + private function get_url(){ + $protocol = (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS']=='on')) ? 'https://' : 'http://'; + return $protocol.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; + } + + private function is_active($url){ + + if($this->config->main['s_root']==$url || $this->config->main['s_root_full']==$url){ + if(!isset($_GET['mode']) || @$_GET['mode']==$this->config->main['s_dpage']){ + return true; + } + }else{ + if(strripos($this->request_url, $url)!==false){ + return true; + } + } + + return false; + } + private function generate_menu($array){ + $this->request_url = $this->get_url(); + ob_start(); $tree = $this->create_tree($array); @@ -45,10 +73,15 @@ $id = intval($ar['id']); $parent = intval($ar['parent']); + $url = $ar['url']; + + $active = ($this->is_active($url, $ar['sons'])) ? 'active' : ''; + $data = array( "TITLE" => $this->db->HSC($ar['title']), - "URL" => $this->db->HSC($ar['url']), + "URL" => $this->db->HSC($url), "TARGET" => $this->db->HSC($ar['target']), + "ACTIVE" => $active, "SUB_MENU" => (!empty($ar['sons'])) ? $this->generate_sub_menu($ar['sons']) : "", ); diff --git a/upload/language/ru_RU/ajax.php b/upload/language/ru_RU/ajax.php index 18ffefc..a2e09a1 100644 --- a/upload/language/ru_RU/ajax.php +++ b/upload/language/ru_RU/ajax.php @@ -64,6 +64,20 @@ 'new_success_del' => 'Новость успешно удалена', + 'reg_e_login_regexp' => 'Логин может состоять только из латинских букв, цифр и знаков -_', + 'reg_e_email_regexp' => 'Неверный формат E-Mail адреса', + 'reg_e_exist' => 'Запрещено использовать данный логин и/или E-Mail', + 'reg_e_pass_length' => 'Пароль должен быть не менее 6-ти символов', + 'reg_e_pass_match' => 'Пароли не совпадают', + 'reg_e_rules' => 'Необходимо принять правила сайта', + "reg_e_rules" => "Для регистрации необходимо принять правила", + "reg_e_success" => "Вы успешно зарегистрировались. Теперь вы можете войти под своим логином и паролем.", + "reg_e_success_mail" => "Письмо с подтверждением регистрации отправлено на E-Mail, указанный при регистрации", + "reg_e_already" => "Вы уже зарегистрированы", + "reg_title" => "[Регистрация]", + 'reg_ok' => 'ОК', + "log_reg" => "Регистрация пользователя", + 'log_new_del' => 'Удаление новости', 'log_com_add' => 'Добавление комментария', 'log_com_edit' => 'Редактирование комментария', diff --git a/upload/language/ru_RU/register.php b/upload/language/ru_RU/register.php index f480764..9fa3eb1 100644 --- a/upload/language/ru_RU/register.php +++ b/upload/language/ru_RU/register.php @@ -13,17 +13,6 @@ "msg3" => "Для подтверждения регистрации, перейдите по ссылке ниже", "msg4" => "Если это были не вы, то проигнорируйте данное сообщение.", "msg5" => "С уважением, администрация сайта", - "e_rules" => "Для регистрации необходимо принять правила", - 'e_login_regexp' => 'Логин может состоять только из латинских букв, цифр и знаков -_', - 'e_email_regexp' => 'Неверный формат E-Mail адреса', - 'e_exist' => 'Запрещено использовать данный логин и/или E-Mail', - 'e_pass_length' => 'Пароль должен быть не менее 6-ти символов', - 'e_pass_match' => 'Пароли не совпадают', - "log_reg" => "Регистрация пользователя", - "reg_title" => "[Регистрация]", - "e_success" => "Вы успешно зарегистрировались. Теперь вы можете войти под своим логином и паролем.", - "e_success_mail" => "Письмо с подтверждением регистрации отправлено на E-Mail, указанный при регистрации", - 'reg_ok' => 'ОК', ); ?> \ No newline at end of file diff --git a/upload/language/ru_RU/system.php b/upload/language/ru_RU/system.php index 636425e..4801a36 100644 --- a/upload/language/ru_RU/system.php +++ b/upload/language/ru_RU/system.php @@ -117,6 +117,8 @@ 'add' => 'Добавить', 'edit' => 'Редактировать', 'delete' => 'Удалить', + 'insert' => 'Вставить', + 'cancel' => 'Отмена', 'search' => 'Поиск', 'filemanager' => 'Файловый менеджер', 'filemanager_ph' => 'Выберите файлы или перенесите их сюда', @@ -145,6 +147,32 @@ 'bb_c_img' => 'Изображение', 'bb_c_video' => 'Видео [youtube|vine|vk|vimeo|coub|twitch]', 'bb_c_smiles' => 'Смайлики', + 'bb_insert_link' => 'Вставка ссылки', + 'bb_insert_email' => 'Вставка E-Mail адреса', + 'bb_insert_size' => 'Размер текста', + 'bb_insert_font' => 'Шрифт', + 'bb_insert_color' => 'Цвет текста', + 'bb_ingert_bg' => 'Цвет фона', + 'bb_insert_list' => 'Список', + 'bb_insert_code' => 'Вставка кода', + 'bb_insert_spoiler' => 'Вставка спойлера', + 'bb_insert_img' => 'Вставка изображения', + 'bb_insert_video' => 'Вставка видео', + 'bb_v_youtube' => 'YouTube', + 'bb_v_vine' => 'Vine', + 'bb_v_vk' => 'ВКонтакте', + 'bb_v_vimeo' => 'Vimeo', + 'bb_v_coub' => 'Coub', + 'bb_v_twitch' => 'Twitch', + 'bb_ph_text' => 'Текст', + 'bb_ph_url' => 'Ссылка', + 'bb_ph_email' => 'E-Mail адрес', + 'bb_ph_spoiler' => 'Название спойлера', + 'bb_ph_img' => 'Ссылка на изображение', + 'bb_ph_video' => 'Ссылка на видео', + 'bb_list_mark' => 'Маркированный', + 'bb_list_num' => 'Нумерованный', + 'bb_spoiler' => 'Нумерованный', ); ?> \ No newline at end of file diff --git a/upload/modules/admin/news.class.php b/upload/modules/admin/news.class.php index 3c12ac3..84e2b47 100644 --- a/upload/modules/admin/news.class.php +++ b/upload/modules/admin/news.class.php @@ -236,8 +236,8 @@ $safe_text_bb = $this->db->safesql($text_bb); $safe_text_bb_short = $this->db->safesql($text_bb_short); - $text_html_strip = trim(strip_tags($text_html, "")); - $text_html_short_strip = trim(strip_tags($text_html_short, "")); + $text_html_strip = trim(strip_tags($text_html, "