commit 55e0adfa17e79bef30a8c8a80f504605769672e5 Author: 3err0 Date: Sat May 18 13:46:03 2019 +0800 message diff --git a/404.php b/404.php new file mode 100644 index 0000000..8153121 --- /dev/null +++ b/404.php @@ -0,0 +1,30 @@ + +404 » {$config['home_title']} + + + + + + +
+

Упс...

+

Запрашиваемая страница не найдена +

К сожалению, такой страницы не существует.
Вероятно, она была удалена с сервера, либо ее здесь никогда не было.
+Впрочем, если вы уверены, что страница должна быть, сообщите нам об этом, мы разберёмся.

На главную

+
+ +HTML; + +?> \ No newline at end of file diff --git a/control.php b/control.php new file mode 100644 index 0000000..9bd39e5 --- /dev/null +++ b/control.php @@ -0,0 +1,56 @@ +close (); + msg ( "error", $lang['index_denied'], $lang['mod_not_found'] ); + } +} + +$db->close (); + +GzipOut (); +?> \ No newline at end of file diff --git a/download.php b/download.php new file mode 100644 index 0000000..4789e98 --- /dev/null +++ b/download.php @@ -0,0 +1,72 @@ +get ( "usergroup" ); +if (! $user_group) { + $user_group = array (); + $db->query ( "SELECT * FROM " . USERPREFIX . "_usergroups ORDER BY id ASC" ); + while ( $row = $db->get_row () ) { + $user_group[$row['id']] = array (); + foreach ( $row as $key => $value ) { + $user_group[$row['id']][$key] = $value; + }} + $cache->set ( "usergroup", $user_group ); + $db->free (); +} + +if (! $is_logged) {$member_id['user_group'] = 5;} +if (! $user_group[$member_id['user_group']]['allow_files']) die ( "Access denied" ); + + $_SERVER['HTTP_REFERER'] = clean_url ( $_SERVER['HTTP_REFERER'] ); + $_SERVER['HTTP_HOST'] = clean_url ( $_SERVER['HTTP_HOST'] ); + if ($_SERVER['HTTP_HOST'] != $_SERVER['HTTP_REFERER']) { + @header ( 'Location: ' . $config['http_home_url'] ); + die ( "Access denied!!!

Please visit {$config['http_home_url']}" ); + } + +$id = intval ( $_REQUEST['id'] ); + +$d_time = time() + ($config['date_adjust'] * 60); +$row = $db->super_query ( "SELECT name, onserver, info_hash FROM " . PREFIX . "_torrents WHERE id ='$id'" ); + +if (! $row) die ( "Access denied" ); + +if(substr($row['name'], -8) == ".torrent") { + require_once( SYSTEM_DIR."/classes/torrent.class.php" ); + $tr_file = TORRENT_DIR.$row['onserver']; + $torrent = new Torrent($tr_file); + if($error = $torrent->errors()){ + } + else + { + $torrent->comment("http://".$_SERVER['HTTP_HOST']."/"); + + if (! $is_logged) { + $torrent->announce("http://".$_SERVER['HTTP_HOST'].":2710/announce"); //Добавляем дополнительные анонсеры, оставляя уже добавленные +} else { + $tpv = $member_id['torrent_pass_version']; + $tppk = $db->super_query("SELECT value FROM xbt_config WHERE name='torrent_pass_private_key'" ); + $site_key = $tppk['value']; + $passkey = sprintf('%08x%s', $member_id['user_id'], substr(sha1(sprintf('%s %d %d %s', $site_key, $tpv, $member_id['user_id'], $row['info_hash'])), 0, 24)); + $torrent->announce("http://".$_SERVER['HTTP_HOST'].":2710/{$passkey}/announce"); //Добавляем дополнительные анонсеры, оставляя уже добавленные + } + }} else die ( "Access denied" ); + +if ($config['files_count'] == "yes" and ! $file->range) $db->query ( "UPDATE " . PREFIX . "_torrents SET dcount=dcount+1 WHERE id ='$id'" ); + +$db->close (); + +$torrent->send($row['name']); +?> \ No newline at end of file diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..f08a128 Binary files /dev/null and b/favicon.ico differ diff --git a/index.php b/index.php new file mode 100644 index 0000000..201d021 --- /dev/null +++ b/index.php @@ -0,0 +1,108 @@ +load_template('forum/index.tpl'); +else $tpl->load_template('main.tpl'); + +$tpl->set('{toporders}', $toporders); +$tpl->set ( '{login}', $tpl->result['login_panel'] ); +$tpl->set ( '{info}', "
" . $tpl->result['info'] . "
" ); +$tpl->set('{online}', $tpl->result['online']); +$tpl->set ( '{minichat}', $tpl->result['minichat'] ); +$tpl->set('{forum}', $tpl->result['forum_table']); +$tpl->set ( '{comments-last}', $commentslast ); +$tpl->set('{category_menu}', $cat_menu); + +if ($allow_active_news AND $do != "userinfo") {$tpl->set ( '[sort]', "" );$tpl->set ( '{sort}', news_sort ( $do ) );$tpl->set ( '[/sort]', "" );} else {$tpl->set_block ( "'\\[sort\\](.*?)\\[/sort\\]'si", "" );} +if ($dle_module == "showfull" ) {if (is_array($cat_list) AND count($cat_list) > 1 ) $category_id = implode(",", $cat_list);} + +if (strpos ( $tpl->copy_template, "[category=" ) !== false) {$tpl->copy_template = preg_replace ( "#\\[category=(.+?)\\](.*?)\\[/category\\]#ies", "check_category('\\1', '\\2', '{$category_id}')", $tpl->copy_template );} +if (strpos ( $tpl->copy_template, "[not-category=" ) !== false) {$tpl->copy_template = preg_replace ( "#\\[not-category=(.+?)\\](.*?)\\[/not-category\\]#ies", "check_category('\\1', '\\2', '{$category_id}', false)", $tpl->copy_template );} + +$config['http_home_url'] = explode ( "index.php", strtolower ( $_SERVER['PHP_SELF'] ) ); +$config['http_home_url'] = reset ( $config['http_home_url'] ); + +if (! $user_group[$member_id['user_group']]['allow_admin']) $config['admin_path'] = ""; + +$ajax .= << + + + + + +HTML; + +if (strpos ( $tpl->result['content'], "hs.expand" ) !== false or strpos ( $tpl->copy_template, "hs.expand" ) !== false or $pm_alert != "") { +$ajax .= << + +{$pm_alert} +HTML; +} +$tpl->set ( '{AJAX}', $ajax ); + +if(isset($_GET['category'])){ + $tpl->set('[newslist]',''); + $tpl->set('{newslist}', "/newslist/".$_GET['category']."/"); + $tpl->set('{news_pol}', $_GET['category']."/"); + $tpl->set('[/newslist]',''); +} else{$tpl->set_block("'\[newslist\](.*?)\[/newslist\]'si",""); $tpl->set('{news_pol}', "");} + +$tpl->set ( '{headers}', $metatags ); +$tpl->set ( '{content}', "
" . $tpl->result['content'] . "
" ); + +$tpl->compile ( 'main' ); +$tpl->result['main'] = str_replace ( '{THEME}', $config['http_home_url'] . 'templates/' . $config['skin'], $tpl->result['main'] ); +if ($replace_url) $tpl->result['main'] = str_replace ( $replace_url[0]."/", $replace_url[1]."/", $tpl->result['main'] ); +$tpl->result['main'] = str_replace("%username%", $is_logged?$member_id['name']:'Юзер', $tpl->result['main']); + +echo $tpl->result['main']; +$tpl->global_clear (); +$db->close (); + +GzipOut (); +?> diff --git a/language/Russian/adminpanel.lng b/language/Russian/adminpanel.lng new file mode 100644 index 0000000..ba2f03c --- /dev/null +++ b/language/Russian/adminpanel.lng @@ -0,0 +1,1654 @@ + "windows-1251", +'admin_logo' => "engine/skins/images/nav.jpg", +'wysiwyg_language' => "ru", +'opt_sys_regloginza' => "Помещать пользователей авторизующихся через Loginza в группе:", +'opt_sys_regloginzad' => "Выберите группу в которую будут помещены пользователи авторизирующиеся через Loginza", +// 8.3 +'opt_sys_comb' => "Разрешить объединение комментариев", +'opt_sys_combd' => "Включение или отключение объединения комментариев, добавляемых друг за другом от одного посетителя. Если данная настройка включена, то все комментарии, которые добавляет посетитель в течении суток к одной новости, будут объединены в один комментарий, при условии что комментарии добавляются подряд и между ними нет комментариев других пользователей.", +'cat_in_none' => "- Без категории -", +'group_adds_html' => "Разрешить использование HTML при добавлении новостей c сайта", +'hint_gaadhtml' => "Данная опция разрешает использование HTML при добавлении с сайта. Внимание, если вы данную опцию отключите, а в настройках скрипта включен WYSIWYG редактор, то для данной группы редактор будет автоматически переключен в BB редактор.", +'group_pref' => "Префикс имени группы", +'hint_gpref' => "При отображении пользователя из этой группы, перед именем, будет добавлена эта строчка. Вы можете использовать эту опцию для раскраски имен групп пользователей, например: <span style='color:red'>", +'group_suf' => "Суффикс имени группы", +'hint_gsuf' => "При отображении пользователя из этой группы, после имени, будет добавлена эта строчка. Например: </span>", +'opt_sys_subs' => "Разрешить пользователям подписываться на комментарии новости", +'opt_sys_subsd' => "Включение или отключение подписки на комментарии. В случае если данная опция включена, то пользователь при добавлении комментария сможет подписываться на комментарии к этой новости, и в случае появления новых комментариев к данной новости, он будет уведомлен на E-mail об этом.", +'modul_offline_1' => "Внимание: данный модуль был отключен в настройках скрипта, для его полноценного функционирования необходимо включить данный модуль в настройках скрипта, в разделе настроек комментариев.", +'btn_clearsubscribe' => "Отписать всех пользователей от комментариев", +'static_err_2' => "Страница с данным именем уже существует.", +'filter_action' => "Действие", +'filter_action_0' => "Произвести замену слова", +'filter_action_1' => "Отклонить добавление текста", +'news_err_39' => "Ваша новость содержит недопустимый к публикации текст.", +'google_map_send' => "уведомить поисковую систему Google, о наличии новой версии карты сайта", +'confirm_action' => "Вы уверены, что хотите выполнить данное действие? Отменить его будет невозможно.", +// 8.3 + +'opt_srebuild' => "Перестроение публикаций", +'opt_srebuildc' => "Пересохрание публикаций на сайте, для вступления в силу, для старых публикаций, некоторых настроек скрипта, а также изменений в парсере скрипта.", +'rebuild_info' => "Данная утилита производит перестроение всех новостей на сайте. Данное действие необходимо выполнять если вы внесли изменения в настройки скрипта, которые для вступления в силу требуют пересохранения новости, чтобы они также были видны и в старых новостях. Либо при собственных изменениях в парсере скрипта, например изменения в ББ тегах. Либо для вступления в силу новых возможностей скрипта, добавленных в новых версиях скрипта.

Внимание: Перед началом не забудьте создать резервную копию базы данных, т.к. данное действие в случае некорректной или не совсем ожидаемой работы, невозможно будет отменить.", +'rebuild_count' => "обработано:", +'rebuild_start' => "Начать перестроение", +'rebuild_status' => "идет обработка, ждите...", +'rebuild_status_ok' => "обработка успешно завершена", +'rebuild_forw' => "Продолжить перестроение", +'opt_statrebuild' => "Перестроение статических страниц", +'rebuild_stat_info' => "Данная утилита производит перестроение всех статических страниц на сайте. Данное действие необходимо выполнять, если вы внесли изменения в настройки скрипта, которые для вступления в силу требуют пересохранения статической страницы. Либо при собственных изменениях в парсере скрипта, например изменения в ББ тегах. Либо для вступления в силу новых возможностей скрипта, добавленных в новых версиях скрипта.

Внимание: Перед началом не забудьте создать резервную копию базы данных, т.к. данное действие в случае некорректной или не совсем ожидаемой работы, невозможно будет отменить.", +'stat_allstaic' => "Общее количество статических страниц:", +'stat_secfault_4' => "Внимание ошибка безопасности:
Файл {file} доступен для записи, что противоречит политике безопасности скрипта. Установите для данного файла CHMOD 444.", +'opt_relrebuild' => "Перестроение кеша похожих новостей", +'rebuild_rel_info' => "Данная утилита производит перестроение кеша похожих новостей на сайте. Поиск похожих новостей на сайте осуществляется только во время первого показа публикации на сайте, после чего используется кеш из найденных публикаций. Если по мере наполнения сайта другой информацией и если вы хотите чтобы новые новости также отображались в списке похожих новостей, вы можете сбросить кеш и будет проведен повторный поиск похожих публикаций по базе данных.

Внимание: Перед началом не забудьте создать резервную копию базы данных, т.к. данное действие в случае некорректной или не совсем ожидаемой работы, невозможно будет отменить.", + +// 8.2 +'bb_t_t' => "Типограф", +'stat_not_min' => "Внимание!
Ваш сервер не отвечает минимальным требованиям скрипта, на сервере не установлена библиотека:", +'opt_sys_dimm' => "Автоматическое затемнение сайта при показе оригинального изображения", +'opt_sys_dimmd' => "Если 'Да', то при увеличении уменьшенного изображения до оригинального, общий фон сайта будет затемнятся.", +'opt_sys_gall' => "Режим галлереи при просмотре уменьшенных изображений", +'opt_sys_galld' => "Если 'Да', то при просмотре оригинальных изображений из уменьшенных копий, на изображениях будет выводится навигация для показа следующей картинки, запуска слайдшоу и т.д.", +'nl_info_1' => "В своем сообщении вы можете использовать тег {%user%}, который будет заменен на логин получателя в сообщении, или на полное имя, если пользователь его указывал в своем профиле. Если в настройках скрипта включено использование поля BCC для рассылки, то тег будет заменен на слово:", +'nl_info_2' => "Пользователь", +'filter_search' => "Область поиска", +'filter_search_0' => "Везде", +'filter_search_1' => "Новости, статические страницы", +'filter_search_2' => "Комментарии, профиль пользователя", +'upload_error_0' => "Невозможно создать директорию", +'upload_error_1' => "Папка", +'upload_error_2' => "недоступна для записи.
Назначьте необходимые права доступа для папки (CHMOD 777)", +'opt_sys_mcommd' => "Автоматичекий запрет комментирования новости по истечении указанного срока", +'opt_sys_mcommdd' => "Вы можете включить автоматическое закрытие новости для комментирования по истечении определенного срока после публикации новости. Для этого укажите количество дней, в течении которых после публикации новости, ее разрешено комментировать. Если вы не хотите устанавливать ограничения, установите 0.", +'edit_search_static' => "Поиск по статическим страницам:", +'edit_static_act' => "Редактировать данную статическую страницу", +'edit_nostatic' => "- Не найдено статических страниц -", +'static_order' => "Порядок сортировки статических страниц", +'static_advanced_search'=> "Расширенный поиск статических страниц", +'mass_static_edit_date_tl' => "Изменение даты", +'mass_static_edit_date_fr1' => "Вы уверены, что хотите изменить дату статической страницы на текущую дату, выбрано", +'mass_static_confirm_2' => "статических страниц?", +'mass_static_confirm_3' => "страницы?", +'mass_static_delete' => "Удаление статических страниц", +'static_per_page' => "Количество статей на страницу:", +'templates_help' => "Описание тегов используемых в данном шаблоне, вы можете посмотреть в онлайн документации:", +'mod_not_found' => "Файл выбранного раздела админпанели не найден", +'admin_other_section' => "Сторонние модули", +'static_br_html_1' => "Фильтрованный текст без автоматического переноса строк", +'static_br_html_2' => "Исходный текст HTML без фильтрации и изменений", +'static_type' => "Тип текста:", +'static_not_allowed' => "Данная страница была опубликована с опциями доступными только администраторам, вы не можете редактировать данную страницу", +// 8.2 + +// 8.0 +'group_a_addnews' => "Разрешить добавление новостей в админпанели", +'group_h_addnews' => "Данная опция позволит пользователям, имеющим доступ в админпанель, добавлять новости в админпанели. Мы настоятельно рекомендуем давать доступ только пользователям вызывающим у вас доверие, т.к. добавление новостей в админпанели позволяет более тонко настраивать новости.", +'group_a_editnews' => "Разрешить редактирование новостей в админпанели", +'group_h_editnews' => "Данная опция позволит пользователям, имеющим доступ в админпанель, редактировать и удалять новости в админпанели. Мы настоятельно рекомендуем давать доступ только пользователям вызывающим у вас доверие, т.к. добавление новостей в админпанели позволяет более тонко настраивать новости.", +'group_a_comments' => "Разрешить редактирование комментариев в админпанели", +'group_h_comments' => "Данная опция позволит пользователям, имеющим доступ в админпанель, редактировать и удалять комментарии в админпанели.", +'group_a_categories' => "Разрешить управление категориями в админпанели", +'group_h_categories' => "Данная опция позволит пользователям, имеющим доступ в админпанель, создавать, редактировать и удалять категории в админпанели.", +'group_a_editusers' => "Разрешить управление пользователями в админпанели", +'group_h_editusers' => "Данная опция позволит пользователям, имеющим доступ в админпанель, управлять пользователями в админпанели.", +'edit_not_admin' => "Вы не можете редактировать пользователей находящихся в группе администраторов.", +'admin_not_access' => "Вы не можете назначить пользователя администратором сайта.", +'group_a_wordfilter' => "Разрешить управление фильтром слов в админпанели", +'group_h_wordfilter' => "Данная опция позволит пользователям, имеющим доступ в админпанель, управлять фильтром слов в админпанели.", +'group_a_userfields' => "Разрешить управление дополнительными полями профиля пользователей в админпанели", +'group_h_userfields' => "Данная опция позволит пользователям, имеющим доступ в админпанель, управлять дополнительными полями профиля пользователей в админпанели.", +'group_a_static' => "Разрешить управление статическими страницами в админпанели", +'group_h_static' => "Данная опция позволит пользователям, имеющим доступ в админпанель, создавать, редактировать и удалять статические страницы в админпанели.", +'group_a_editvote' => "Разрешить управление опросами сайта в админпанели", +'group_h_editvote' => "Данная опция позволит пользователям, имеющим доступ в админпанель, создавать, редактировать и удалять опросы для сайта в админпанели.", +'group_a_newsletter' => "Разрешить доступ к массовой рассылки сообщений в админпанели", +'group_h_newsletter' => "Данная опция позволит пользователям, имеющим доступ в админпанель, осуществлять массовые рассылки сообщений пользователям.", +'group_a_blockip' => "Разрешить управление фильтрами блокировки по IP, логину или E-Mail в админпанели", +'group_h_blockip' => "Данная опция позволит пользователям, имеющим доступ в админпанель, создавать, редактировать и удалять фильтры блокировки по IP, логину или E-Mail.", +'group_a_banners' => "Разрешить управление рекламными материалами в админпанели", +'group_h_banners' => "Данная опция позволит пользователям, имеющим доступ в админпанель, создавать, редактировать и удалять рекламные материалы сайта.", +'group_a_rss' => "Разрешить управление RSS импортом новостей в админпанели", +'group_h_rss' => "Данная опция позволит пользователям, имеющим доступ в админпанель, осуществлять управление RSS импортом новостей в админпанели.", +'group_a_iptools' => "Разрешить доступ к IP утилитам в админпанели", +'group_h_iptools' => "Данная опция позволит пользователям, имеющим доступ в админпанель, осуществлять поиск зарегистрированных пользователей по определенному IP адресу или по подсети в админпанели.", +'group_a_rssinform' => "Разрешить управление RSS информерами в админпанели", +'group_h_rssinform' => "Данная опция позволит пользователям, имеющим доступ в админпанель, осуществлять управление RSS информерами сайта в админпанели.", +'group_a_googlemap' => "Разрешить создание карты сайта для поисковой системы Google в админпанели", +'group_h_googlemap' => "Данная опция позволит пользователям, имеющим доступ в админпанель, осуществлять создание карты сайта для поисковой системы Google в админпанели.", +'opt_all_rublik' => "Список всех разделов", +'opt_all_rublikc' => "Просмотр списка всех разделов доступных для вас в панели управления.", +'ip_error_1' => "Данное правило уже существует в фильтре.", +'filter_register' => "С учетом регистра", +'mass_clear_count' => "Очистить количество просмотров", +'mass_clear_count_1' => "Вы уверены, что хотите очистить счетчик просмотров у выбранных", +'mass_clear_count_2' => "Очистка счетчика просмотров новостей", +'mass_clear_rating' => "Очистить рейтинг новости", +'mass_clear_rating_1' => "Вы уверены, что хотите очистить рейтинг у выбранных", +'mass_clear_rating_2' => "Очистка рейтинга новостей", +'rss_clear' => "Очистить список", +'opt_sys_sm_iv' => "Включить аудио и видео в новостях при просмотре мобильной версии", +'opt_sys_sm_ivd' => "Если 'Да', то новость будет отображаться без изменений, если 'Нет', то при просмотре мобильной версии сайта из новостей в целях экономии трафика будут убраны все аудио и видео материалы.", +'opt_sys_asp' => "Разрешить индексацию поисковыми системами ссылок на версию для печати", +'opt_sys_aspd' => "Если 'Нет', то для поисковых систем будет запрещено проходить по ссылкам на версию для печати и эти страницы не будут проиндексированы поисковыми системами.", +'opt_sys_asc' => "Разрешить индексацию поисковыми системами ссылок опубликованных в комментариях", +'opt_sys_ascd' => "Если 'Нет', то для поисковых систем будет запрещено проходить по ссылкам которые ваши пользователи будут публиковать в комментариях.", +'addnews_option' => "Опции новости:", +'massusers_group' => "Изменить группу", +'massusers_comments' => "Удалить комментарии", +'massusers_banned' => "Забанить пользователей", +'massusers_delete' => "Удалить пользователей", +'massusers_denied' => "Вы должны выбрать пользователей для выполнения массовых действий.", +'massusers_head' => "Удаление пользователей", +'massusers_confirm' => "Вы уверены, что хотите удалить выбранных", +'massusers_confirm_1' => "пользователей", +'massusers_confirm_2' => "пользователей удалены", +'massusers_delok' => "Все выбранные Вами пользователи успешно удалены!", +'massusers_head_1' => "Удаление комментариев пользователей", +'massusers_confirm_3' => "Вы уверены, что хотите удалить все комментарии у выбранных", +'massusers_comok' => "Все комментарии у выбранных Вами пользователей успешно удалены.", +'massusers_head_2' => "Изменение группы пользователей", +'massusers_confirm_4' => "Выберете новую группу для выбранных", +'massusers_groupok' => "Все пользователи были перенесены в группу:", +'massusers_head_3' => "Бан пользователей", +'massusers_confirm_5' => "Блокирование выбранных", +'massusers_banok' => "Все выбранные пользователи были заблокированы", +'bb_flash' => "Введите размеры флеш ролика (ширина, высота)", +'bb_flash_url' => "Введите ссылку на флеш ролик", +'inset_flash_link' => "вставить флеш", +'meta_title' => "Метатег title:", +'opt_sys_sm_fm' => "Включить форматирование текста при просмотре мобильной версии", +'opt_sys_sm_fmd' => "Если 'Да', то новость будет отображаться без изменений, если 'Нет', то при просмотре мобильной версии сайта из текста новостей будет убрано все форматирование текста за исключением ссылок и переносов строк.", +'bb_t_yvideo' => "Вставка Youtube или Rutube видео", +// 8.0 + +// 7.5 +'preview_short' => "Краткое содержание:", +'preview_full' => "Подробное содержание:", +'preview_static' => "Просмотр статической страницы:", +'group_max_signature' => "Максимальное количество символов в подписи", +'hint_max_signature' => "Введите максимальное количество допустимых символов в подписи пользователя, если вы хотите снять ограничение на количество символов, то введите 0.", +'group_max_info' => "Максимальное количество символов в краткой информации о себе", +'hint_max_info' => "Введите максимальное количество допустимых символов в краткой информации о себе пользователя, если вы хотите снять ограничение на количество символов, то введите 0.", +'get_offline_key' => "

Также не исключено, что на вашем сервере отключены или запрещены исходящие соединения, поэтому вы можете активировать скрипт в ручном режиме. Для этого вам необходимо проследовать по ссылке:", +'get_key' => "Получить код сайта.", +'key_activation' => "После того как вы получите на сайте dle-news.ru специальный код сайта, вернитесь в свою админпанель и введите полученный код вместо вашего ключа.", +'trial_act5' => "Введенный код сайта не применим для данной версии скрипта, вам необходимо ввести ваш лицензионный ключ для активации вашего скрипта или генерации нового кода сайта.", +'find_rtags' => "в облаке тегов", +'opt_smartphone' => "Настройка поддержки и работы с смартфонами", +'opt_sys_smart' => "Включить автоматическую поддержку смартфонов", +'opt_sys_smartd' => "При включении данной поддержки для пользователей заходящих на ваш сайт с мобильных смартфонов, будет использован специальный облегченный дизайн вашего сайта. Перед включением данной опции убедитесь что в вашей папке шаблонов /templates/ присутствует папка с именем шаблона smartphone.", +'opt_sys_sm_im' => "Включить изображения в новостях при просмотре мобильной версии", +'opt_sys_sm_imd' => "Если 'Да', то новость будет отображаться без изменений, если 'Нет', то при просмотре мобильной версии сайта из новостей в целях экономии трафика будут убраны все изображения.", +// 7.5 + +// 7.3 +'opt_sys_flvwd' => "Если 'Да', то при проигрывании видеофайлов во флеш плеере, справа сверху будет показываться ваш логотип. Сам логотип при этом должен находится в папке шаблона /шаблон/images/flv_watermark.png", +'opt_sys_adt' => "Разрешить добавление ключевых слов в облако тегов при добавлении новостей с сайта", +'opt_sys_adtd' => "Если 'Да', то пользователям при добавлении новостей с сайта будет разрешено добавление ключевых слов в облако тегов", +'filter_type' => "Тип замены", +'filter_type_1' => "Любое вхождение", +'filter_type_2' => "Точное совпадение слова", +'opt_sys_afix' => "Включить поддержку фиксации новостей на сайте:", +'opt_sys_afixd' => "Отключение данной функции позволяет использовать сокращенные запросы к базе данных MySQL, тем самым снижается нагрузка на БД", +'spoiler_title' => "Показать / Скрыть текст", +'upload_standart' => "Стандартная", +'upload_mass' => "Массовая", +'upload_queue' => "Список загружаемых файлов", +'upload_cancel' => "Отменить все загрузки", +'upload_waehlen' => "Выбрать файлы", +'upload_mass_info' => "Выберете файлы на вашем компьютере, которые вы хотите загрузить на сервер. Для одновременного выбора сразу нескольких файлов из директории используйте выделение мышкой или удерживайте клавишу Ctrl.", +'opt_sys_maxfile' => "Максимальный размер файла допустимый к загрузке на сервер (в килобайтах)", +'opt_sys_maxfiled' => "Введите максимальный размер файлов которые допустимо загружать на сервер. Данный размер указывается в килобайтах, например для ограничения размера файла в 2 мегабайта, в настройках указывается 2048. Если вы хотите снять ограничение, то укажите в настройках 0.", +'opt_sys_maxfilec' => "Максимальное количество файлов при массовой загрузке", +'opt_sys_maxfilecd' => "Введите максимальное количество файлов, которое возможно одновременно выбрать и поставить в очередь на загрузку на сервер. Для того чтобы снять ограничение на количество файлов, поставьте 0.", +'files_too_big' => "Слишком большой размер файла", +'files_max_info' => "Максимальный размер файла загружаемого на сервер составляет", +'files_max_info_1' => "Максимальный размер изображения загружаемого на сервер составляет", +'files_max_info_2' => "Максимальный размер файла загружаемого на сервер скриптом неограничен", +// 7.3 + +// 7.2 +'opt_sys_wdq' => "Включить WYSIWYG редактор при быстром редактировании новостей на стайте:", +'opt_sys_addsec' => "Включить автоматическое блокирование спам программ", +'opt_sys_addsecd' => "Данная опция позволяет включить автоматическую защиту от программ, осуществляющих спам рассылки новостей на сайты.", +'hint_scode' => "Вы можете включить отображение кода безопасности при добавлении новостей вашими посетителями с сайта, включение данной функции позволяет заблокировать автопостинг с использованием различных спамботов", +'group_image' => "Разрешить использование изображений", +'hint_group_image' => "Вы можете разрешить или запретить пользователям использование изображений в комментариях или в подписи.", +'restricted' => "Запрет на публикацию:", +'restricted_none' => "Отсутствует", +'restricted_news' => "Новостей", +'restricted_comm' => "Комментариев", +'restricted_all' => "Новостей и комментариев", +'restricted_date' => "Сроком на:", +'hint_restricted' => "Укажите количество дней, в течении которых пользователю будет запрещена публикация новостей или комментариев. Оставьте 0, если срок блокировки неограничен по времени", +'restricted_clear' => "Снять запрет", +'mail_info_6' => "Настройка E-Mail сообщения, которое отсылается при получении нового персонального сообщения", +'mail_pm_info' => "При написании шаблона для данного сообщения вы можете использовать следующие теги:
{%username%} - пользователь, получивший персональное сообщение
{%date%} - дата получения сообщения
{%fromusername%} - логин отправителя
{%title%} - заголовок сообщения
{%text%} - текст сообщения", +'opt_sys_pmail' => "Отсылать E-Mail уведомление при получении пользователем нового персонального сообщения", +'opt_sys_pmaild' => "Если 'Да', при получении нового персонального сообщения, на E-Mail указанный в профиле пользователя будет отправлено соответствующее уведомление.", +'opt_sys_change_s' => "Разрешить пользователям менять порядок сортировки новостей на сайте", +'opt_sys_change_sd' => "Если 'Да', то при смене порядка сортировки, отключается автоматическое кеширование новостей на сайте для кратких новостей, что увеличивает нагрузку на сайт.", +'edit_no_author' => "Вы изменили автора публикации, но новый автор необнаружен в базе данных. Введите корректное имя нового автора публикации. Все другие изменения в новость успешно внесены.", +'opt_rules' => "Правила на сайте", +'opt_rulesc' => "Редактирование правил поведения на сайте для пользователей. Правила можно выводить при регистрации пользователей, а также отдельной страницей http://site.ru/rules.html", +'rules_edit' => "Общие правила на сайте", +'rules_descr' => "Для вывода кнопок 'Принять' и 'Отклонить' при регистрации пользователей используйте тег {ACCEPT-DECLINE} при написании правил.", +'rules_ok' => "Правила успешно сохранены.", +'rules_check' => "Если вы хотите выводить данные правила при регистрации посетителей на сайте, то вам необходимо включить вывод правил в настройках скрипта.", +'opt_sys_rules' => "Выводить правила сайта при регистрации", +'opt_sys_rulesd' => "Если 'Да', то при регистрации пользователя ему будут выводится правила сайта, которые он должен будет принять.", +'ip_type' => "IP, Логин или E-mail:", +'user_edit_found' => "Новый логин не может быть назначен пользователю, т.к. введенный логин уже зарегистрирован.", +'news_edit_date' => "Ранее редактировал", +'news_edit_reason' => "Причина редактирования:", +'allow_view_edit' => "Выводить информацию о том что новость отредактирована", +'addnews_tags' => "Облако тегов:", +'hint_tags' => "Введите через запятую ключевые теги новости. Данные теги будут использованы при формировании облака тегов на сайте. Вы можете вводить только обычные слова, не содержащие специальные символы", +'opt_sys_tags' => "Включить поддержку модуля \"Облако тегов\"", +'opt_sys_tagsd' => "Если вы не используете на своем сайте \"Облако тегов\", то данный модуль рекомендуется отключить.", +'opt_sm_cl_1' => "Облако тегов", +'opt_sm_cl_3' => "В данном разделе настраивается вывод облака тегов, при просмотре всех тегов на сайте", +// 7.2 + +// 7.0 +'tabs_gr_all' => "Общие настройки", +'tabs_gr_news' => "Новости", +'tabs_gr_comments' => "Комментарии", +'tabs_gr_admin' => "Админпанель", +'stat_medit_link' => "Редактирование ожидающих модерации новостей", +'group_signature' => "Разрешить использование подписи в комментариях", +'hint_signature' => "Вы можете разрешить или запретить пользователям использование подписи, которая будет видна при написании пользователем комментария.", +'group_url' => "Разрешить использование кликабельных ссылок", +'hint_group_url' => "Вы можете разрешить или запретить пользователям использование кликабельных ссылок в комментариях, профиле или в персональных сообщениях.", +'images_all_insert' => "Вставить выбранное", +'opt_sys_catsort' => "Критерий сортировки при просмотре каталога", +'opt_sys_catsortd' => "Выберите критерий для сортировки новостей при просмотре каталога", +'opt_sys_catmsort' => "Порядок сортировки при просмотре каталога", +'opt_sys_catmsortd' => "Выберите порядок сортировки новостей при просмотре каталога", +'opt_sys_related_num' => "Количество похожих новостей", +'opt_sys_related_numd' => "Введите количество похожих новостей, которые будут выводится при просмотре полных новостей", +'opt_sys_seotype' => "Тип ЧПУ:", +'opt_sys_seotyped' => "Тип 1 - ссылки на полную новость будут иметь вид http://site.ru/id-имя новости.html

Тип 2 - ссылки на полную новость будут иметь вид http://site.ru/категория/подкатегория/id-имя новости.html

Тип 3 - ссылки на полную новость будут иметь вид http://site.ru/2008/04/02/имя новости.html, внимание данный тип несет повышенную нагрузку на сервер", +'opt_sys_seo_1' => "Тип 1", +'opt_sys_seo_2' => "Тип 2", +'opt_sys_seo_3' => "Тип 3", +'b_find_related' => "Найти похожие новости", +'mass_edit_date' => "Установить текущую дату", +'mass_edit_date_tl' => "Изменение даты новостей", +'mass_edit_date_fr1' => "Вы уверены, что хотите изменить дату новости на текущую дату, выбрано", +'stat_os' => "Операционная система:", +'opt_sys_max_mod' => "Максимальное количество новостей, допустимых к ожиданию на модерацию", +'opt_sys_max_modd' => "Введите максимальное количество новостей, которое допустимо при добавлении с сайта пользователями на ожидание модерации, поставьте 0 если не хотите устанавливать ограничений.", +// 7.0 + + +// 6.7 +'nl_startfrom' => "Начать рассылку с:", +'nl_user' => "пользователя (введите 0, если хотите начать рассылку с самого начала)", +'nl_n_mail' => "Количество писем за один проход:", +'nl_interval' => "Интервал в секундах между отправкой писем:", +'opt_sys_maxc' => "Максимальное количество символов в комментариях", +'opt_sys_maxcd' => "Укажите максимальное количество символов, которое может использовать пользватель при написании комментариев на сайте", +'opt_sys_reason' => "Причина отключения сайта:", +'opt_sys_reasond' => "Сообщение для отображения в режиме отключенного сайта", +'google_cat_priority' => "Приоритет категорий:", +'google_stat_priority' => "Приоритет статических страниц:", +'search_by_author' => "Поиск по автору:", +'search_by_date' => "Дата публикации:", +'search_by_status' => "Статус новостей:", +'news_status_all' => "Все новости", +'news_status_mod' => "Ожидающие модерации новости", +'news_status_approve' => "Опубликованные новости", +'news_order' => "Порядок сортировки новостей", +'news_order_fixed' => "Зафиксированные", +'news_advanced_search' => "Расширенный поиск новостей", +'inset_video_link' => "вставить видео", +'inset_audio_link' => "вставить аудио", +// 6.7 + +// 6.5 +'opt_rsssys' => "Настройка RSS экспорта новостей", +'opt_sys_arss' => "Включить RSS экспорт новостей", +'opt_sys_arssd' => "Вы можете разрешить или запретить RSS экспорт ваших новостей на сайте.", +'opt_sys_nrss' => "Количество экспортируемых новостей", +'opt_sys_nrssd' => "Укажите количество экспортируемых новостей в RSS поток.", +'opt_sys_crss' => "Количество экспортируемых комментариев", +'opt_sys_crssd' => "Укажите количество экспортируемых комментариев в RSS поток.", +'opt_sys_frss' => "Количество экспортируемых торрентов", +'opt_sys_frssd' => "Укажите количество экспортируемых торрентов в RSS поток.", + +'opt_sys_trss' => "Тип экспорта основного RSS потока", +'opt_sys_trssd' => "Выберите тип вывода основного RSS потока при обращении по адресу http://dle-news.ru/rss.xml.", +'opt_sys_rss_type_0' => "Все новости", +'opt_sys_rss_type_1' => "Только опубликованные на главной", +'opt_sys_rss_type_2' => "Простой", +'opt_sys_rss_type_3' => "Полный", +'opt_sys_rss_type_4' => "Яндекс новости", +'img_orig_ins' => "оригинал", +'opt_sys_short_name' => "Краткое название сайта:", +'opt_sys_short_named' => "Укажите краткое название сайта, которое будет публиковатся в модуле 'speedbar', при публикации ссылки на главную страницу сайта", +'static_skin' => "Папка шаблона:", +'hint_static_skin' => "Вы можете установить для данной статической страницы полностью отдельный шаблон, отличный от используемого по умолчанию.", +'xf_not_notig' => "необязательно", +// 6.5 + +// 6.3 +'opt_sys_multiple' => "Включить поддержку мультикатегорий на сайте", +'opt_sys_multipled' => "Включение данной возможности позволяет публиковать одну новость в несколько категорий одновременно, отключение данной возможности будет позволять добавлять новость только в одну категорию, однако позволяет существенно сократить нагрузку на сервер.", +'user_del_comments' => "Удалить все комментарии?", +'catalog_url' => "Символьный код:", +'catalog_hint_url' => "Символьный код предназначен для объединения группы новостей в каталоги, например, если задать группе новостей один символьный код a, то эта группа новостей новостей будет доступна по адресу: http:/site.ru/catalog/a/. Допускается максимально использовать только три символа", +'edit_go_page' => "Перейти на страницу:", +'main_notice' => "Блокнот", +'main_no_notice' => "Здесь вы можете сохранять собственные заметки и памятки.", +'rss_no_rss' => "С момента последнего получения новостей, новых новостей в данном потоке не появилось.", +'group_offline' => "Разрешить просмотр отключенного сайта", +'hint_goffline' => "Вы можете разрешить или запретить данной группе просмотр отключенного сайта.", +'google_nnum' => "Количество новостей:", +'hint_g_num' => "Вы можете указать количество новостей, которое будет экспортировано в файл Google Sitemap. Если вы оставите данное поле пустым, то будут экспортированы все новости.", +'google_priority' => "Приоритет новостей:", +'hint_g_priority' => "Приоритет экспортируемых URL относительно других URL на Вашем сайте. Допустимый диапазон значений — от 0.0 до 1.0. Это значение не влияет на сравнение Ваших страниц со страницами на других сайтах.", +'rssinform_del' => "Вы действительно хотите удалить RSS информер?", +// 6.3 + +// 6.2 +'opt_sys_asrate' => "Разрешить выставление рейтинга в кратких новостях", +'opt_sys_asrated' => "Вы можете разрешить или запретить пользователям выставлять рейтинг для новости при просмотре кратких новостей. Если 'Нет', то выставить рейтинг для новости, можно будет только при просмотре полной новости", +'opt_sys_search' => "Выберите тип поиска используемого на сайте", +'opt_sys_searchd' => "Расширенный тип поиска осуществляет полнотекстовый поиск и дает более точные результаты поиска, однако на больших базах данных процесс поиска может занимать продолжительное время и вызывать повышенную нагрузку.", +'opt_sys_simple' => "Простой", +'opt_sys_advance' => "Полнотекстовый", +'a_rating' => "Разрешить выставление рейтинга новостей", +'hint_garating' => "Вы можете разрешить или запретить данной группе выставлять рейтинг для новостей, если запретить, то пользователи смогут только видеть результаты рейтинга", +'opt_google' => "Карта сайта для Google и Yandex", +'opt_googlec' => "Данный модуль предназначен для создания карт сайта для поисковых систем Google и Yandex.", +'google_info' => "1. Необходимо зарегистрироваться в Google Sitemaps с использованием вашей учетной записи Google.

2. Перейдите по ссылке \"Добавьте первую карту сайта\".

3. Введите в поле \"URL\" адрес вашего файла индекса Sitemap и нажмите кнопку \"Передать URL\".

4. Более подробную справку вы можете найти на сайте Google.", +'google_main' => "Краткое описание сервиса Google Sitemaps", +'google_map' => "Файл карты сайта (Google Sitemap)", +'google_create' => "Создать / Обновить файл карты сайта", +'no_google_map' => "Файл индекса для Google Sitemap ранее еще не создавался.", +'google_map_info' => "файл индекса для Google Sitemap был создан и доступен по адресу:", +'opt_sys_news_c' => "Включить код безопасности (CAPTCHA) при добавлении новостей с сайта", +'opt_sys_news_cd' => "Вы можете включить отображение кода безопасности при добавлении новостей вашими посетителями с сайта, включение данной функции позволяет заблокировать автопостинг с использованием различных спамботов", +'cat_noparentid' => "Категория не может быть собственной подкатегорией!", +'opt_iptoolsname' => "Поиск всех IP адресов, которые были у определенного пользователя", +'opt_iptoollast' => "Последний раз использовал IP адрес:", +'opt_iptoolcall' => "При написании комментариев использовались IP адреса:", +// 6.2 + +// 6.0 +'opt_sys_path' => "Файл админпанели", +'opt_sys_pathd' => "Вы можете изменить имя файла админпанели. По умолчанию это admin.php,если вы указываете новый файл, то незабудьте переименовать его на сервере, указывается только имя файла, без указания пути к нему.", +'opt_rssinform' => "RSS информер на сайте", +'opt_rssinformc' => "Данный модуль предназначен для гибкого добавления различных RSS информеров с других сайтов.", +'rssinform_title' => "Управление RSS информерами на сайте", +'rssinform_ein' => "Включить информер", +'rssinform_on' => "Показ информера включен", +'rssinform_off' => "Показ информера выключен", +'rssinform_create' => "Добавить информер", +'rssinform_xname' => "Название RSS информера", +'rssinform_xdescr' => "Описание RSS информера", +'rssinform_url' => "URL для RSS информера", +'rssinform_template' => "Шаблон для информера", +'rssinform_max' => "Количество новостей в блоке", +'rssinform_tmax' => "Количество символов в заголовке", +'rssinform_dmax' => "Количество символов в тексте новости", +'hint_ri_max' => "Укажите количество новостей которые вы хотите получать из данного потока", +'hint_ri_tmax' => "Укажите максимальное количество символов в заголовке, при превышении данного значения заголовок будет автоматически обрезан, вы можете указать 0, тогда заголовок будет опубликован полностью любой длины", +'hint_ri_dmax' => "Укажите максимальное количество символов в новости, при превышении данного значения новость будет автоматически уменьшена, вы можете указать 0, тогда новость будет опубликована полностью любой длины", +'opt_sys_inform' => "Включить использование RSS информеров", +'opt_sys_informd' => "Если вы не используете на своем сайте RSS информеры, то данный модуль рекомендуется отключить.", +'modul_offline' => "Внимание: данный модуль был отключен в настройках скрипта, для его полноценного функционирования необходимо включить данный модуль в настройках скрипта, в разделе оптимизации.", +'opt_sys_cmod' => "Включить поддержку предмодерации комментариев", +'opt_sys_cmodd' => "Если вы хотите в дальнейшем модерировать комментарии у некоторых групп пользователей, прежде чем они будут опубликованы на сайте, то вам необходимо включить эту поддержку. Отключение данной поддержки позволяет экономить ресурсы MySQL сервера.", +'group_modc' => "Отправлять комментарии на модерацию", +'hint_modc' => "Комментарий пользователя будет опубликован на сайте, только после предварительной модерации комментария администратором или модератором.", +'stat_cmod' => "Комментарии ожидающие проверки:", +'stat_cmod_link' => "проверка ожидающих модерации комментариев", +'bb_b_approve' => "Опубликовать", +'cmod_n_title' => "Новость:", +'mass_acomm' => "Вы не выбрали комментарии, которые необходимо опубликовать", +'mass_approve_ok' => "Все выбранные Вами комментарии успешно опубликованы на сайте!", +'st_views' => "Просмотров", +'upload_t_size' => "Размер уменьшенной копии картинки:", +'upload_t_seite_1' => "По наибольшей стороне", +'upload_t_seite_2' => "По ширине", +'upload_t_seite_3' => "По высоте", +'bb_t_font' => "Шрифт", +'bb_t_size' => "Размер", +'opt_sys_maxside' => "Максимально допустимые размеры изображения", +'opt_sys_maxsided' => "Существует две возможности использования данной настройки:

Первая: Вы вводите допустимые размеры в пикселях любой из сторон оригинального изображения. Например: 800.

Вторая: Вы задаете ширину и высоту оригинального изображения в формате ширина x высота. Например: 800x600

Если размер будет больше, то оригинальное изображение будет автоматически уменьшено до указанного размера, иначе изображение будет пересжато без изменения размера. Вы можете указать 0, если хотите чтобы изображение оставалось оригинальным.", +'mass_edit_app' => "Опубликовать новости", +'mass_edit_notapp' => "Отправить на модерацию", +'mass_edit_app_tl' => "Выбор публикации новостей", +'mass_edit_app_fr1' => "Вы уверены, что хотите опубликовать выбранные", +'mass_edit_app_fr2' => "Вы уверены, что хотите отправить на модерацию выбранные", +'mass_edit_comm' => "Разрешить комментарии", +'mass_edit_notcomm' => "Запретить комментарии", +'mass_edit_comm_fr1' => "Вы уверены, что хотите разрешить комментарии для выбранных", +'mass_edit_comm_fr2' => "Вы уверены, что хотите запретить комментарии для выбранных", +'mass_edit_com_tl' => "Настройка комментариев для новостей", +'mass_edit_rate' => "Разрешить рейтинг", +'mass_edit_notrate' => "Запретить рейтинг", +'mass_edit_rate_tl' => "Настройка рейтинга для новостей", +'mass_edit_rate_fr1' => "Вы уверены, что хотите разрешить рейтинг для выбранных", +'mass_edit_rate_fr2' => "Вы уверены, что хотите запретить рейтинг для выбранных", +'mass_edit_main' => "Опубликовать на главной", +'mass_edit_notmain' => "Снять публикацию на главной", +'mass_edit_main_tl' => "Публикация новостей на главной", +'mass_edit_main_fr1' => "Вы уверены, что хотите опубликовать на главной выбранные", +'mass_edit_main_fr2' => "Вы уверены, что хотите снять с главной выбранные", +'mass_edit_fix' => "Зафиксировать новости", +'mass_edit_notfix' => "Снять фиксацию", +'mass_edit_fix_tl' => "Фиксация новостей на сайте", +'mass_edit_fix_fr1' => "Вы уверены, что хотите зафиксировать выбранные", +'mass_edit_fix_fr2' => "Вы уверены, что хотите опустить выбранные", +'mass_confirm_2' => "новостей?", +'opt_sys_file4' => "Включить поддержку докачивания файлов при скачивании", +'opt_sys_file4d' => "Вы можете разрешить или запретить использование докачки файлов для ваших пользователей, скачивающих файл с сайта, если произошел разрыв соединения при скачивании.", +'opt_sys_file5' => "Максимальная скорость скачивания (kb/s)", +'opt_sys_file5d' => "Вы можете ограничить максимальную скорость скачивания файла. Максимальная скорость указывается в kb/s. Если вы не хотите ставить ограничений на скорость скачивания файлов, то поставьте 0", +// 6.0 + +// 5.7 +'user_avatar' => "Загрузка аватара:", +'user_del_avatar' => "Удалить аватар?", +'opt_sfind' => "Поиск и Замена", +'opt_sfindc' => "Быстрый поиск и замена определенного текста по всей базе данных", +'find_main' => "Быстрая замена текста в базе данных скрипта", +'find_info' => "Данная утилита производит замену текста в вашей базе. Например у вас изменился домен и вы хотите его изменить в ваших новостях, статических страницах, комментариях и т.д.

Внимание: Перед заменой не забудьте создать резервную копию базы данных, т.к. данное действие в случае некорректной или не совсем ожидаемой замены, невозможно будет отменить. Мы настроятельно не рекомендуем производить замену коротких слов или предлогов, т.к. они могут встречаться в составе других слов.", +'find_ftable' => "Выберете таблицу для замены:", +'find_ftext' => "Введите старый текст:", +'find_rtext' => "Введите новый текст:", +'find_rstart' => "Произвести замену", +'find_rnews' => "в новостях", +'find_rcomms' => "в комментариях", +'find_rpm' => "в персональных сообщениях", +'find_rstatic' => "в статических страницах", +'find_done_h' => "Замена завершена", +'find_done' => "Текст в базе данных был успешно заменен.", +'mail_info_3' => "Настройка E-Mail сообщения, которое отсылается при добавлении новой новости на сайте", +'mail_news_info' => "При написании шаблона для данного сообщения вы можете использовать следующие теги:
{%title%} - заголовок новости
{%username%} - пользователь, добавивший новость
{%date%} - дата добавления новости
{%category%} - категория, в которую добавлена новость", +'mail_info_4' => "Настройка E-Mail сообщения, которое отсылается при добавлении нового комментария на сайте", +'mail_comm_info' => "При написании шаблона для данного сообщения вы можете использовать следующие теги:
{%link%} - ссылка на новость
{%username%} - пользователь, добавивший комментарий
{%date%} - дата добавления комментария
{%ip%} - IP пользователя
{%text%} - текст комментария
{%unsubscribe%} - ссылка по которой пользователь может отписаться от комментариев к новости", +'opt_sys_nmail' => "Отсылать E-Mail уведомление при получении новых новостей", +'opt_sys_cmaild' => "Если 'Да', при добавлении комментария на сайте, на E-Mail указанный в настройках будет отправлено соответствующее уведомление.", +'bb_t_leech' => "Вставка защищенной ссылки", +'opt_sys_nmaild' => "Если 'Да', при добавлении новости с сайта, которое ожидает модерации, на E-Mail указанный в настройках будет отправлено соответствующее уведомление.", +'opt_sys_cmail' => "Отсылать E-Mail уведомление администратору при добавлении комментариев", +'group_icon' => "Иконка группы", +'hint_gicon' => "Вы можете задать путь к картинке, которая будет назначена для этой группы. Вы можете использовать тег {THEME} для динамической загрузки картинки из папки шаблона", +// 5.7 + +// 5.5 +'opt_sys_related' => "Отображение похожих новостей", +'opt_sys_relatedd' => "Данный модуль производит контекстовый поиск похожих новостей, при просмотре полной новости. Отключение данного модуля позволит снизить нагрузку на MySQL сервер", +'anti_snap' => "Сделать снимок", +'anti_snapalert' => "Вы уверены что список обнаруженных файлов безопасен, и вы хотите сделать новый снимок файлов.", +'anti_modified' => "не соответствует сделанному снимку", +'anti_not' => "неизвестен дистрибутиву", +'anti_snap' => "Сделать снимок", +'anti_creates' => "Снимок системных файлов скрипта и шаблонов успешно сделан", +'ip_found_comments' => "Список пользователей использовавших данный IP адрес при написании комментариев", +'static_tpl' => "Использовать шаблон", +'hint_stpl' => "Укажите название шаблона, который хотите использовать для данной статической страницы, вы можете оставить это поле пустым, тогда будет использован стандартный шаблон static.tpl", +'opt_sys_nodate' => "Поддержка публикации новостей на еще не наступившую дату", +'opt_sys_nodated' => "При включении данной опции скрипт будет позволять устанавливать для новости еще не наступившую дату, и при наступлении данной даты новость будет опубликована на сайте автоматически. При отключении данной опции скрипт будет использовать сокращенные запросы к базе данных, что существенно повышает быстродействие скрипта и снижает нагрузку на сервер при очень больших базах данных.", +'cat_s_tpl' => "Шаблон короткой новости", +'cat_s_tpl_hit' => "Помимо назначения отдельного шаблона для данной категории, вы можете указать только отдельный файл шаблона для вывода кратких новостей. Вы можете оставить это поле пустым, тогда будет загружаться стандартный файл шаблона shortstory.tpl", +'cat_f_tpl' => "Шаблон полной новости", +'cat_f_tpl_hit' => "Помимо назначения отдельного шаблона для данной категории, вы можете указать только отдельный файл шаблона для вывода полных новостей. Вы можете оставить это поле пустым, тогда будет загружаться стандартный файл шаблона fullstory.tpl", +// 5.5 + +// 5.3 +'bb_t_emo' => "Вставка смайликов", +'bb_t_up' => "Загрузка файлов на сервер", +'opt_sys_logextra' => "Метод авторизации в админпанели", +'opt_sys_logextrad' => "При включении расширенного метода авторизации в админпанели, каждая новая сессия в админпанели будет требовать повторного ввода пароля, что гарантирует невозможность входа в админпанель, в случае кражи ваших Cookies.
Внимание данный метод авторизации будет работать, если ваш PHP установлен как модуль Apache, поэтому перед включением рекомендуем вам уточнить режим работы PHP у вашего хостера", +'opt_sys_stdm' => "Стандартный метод", +'opt_sys_extram' => "Расширенный метод", +'btn_clearcache' => "Очистить кеш", +'rss_info' => "Источник:", +'stat_cache' => "Внимание!
Отсутствует доступ для записи в папки engine/cache/ и engine/cache/system/. Установите для этих папок CHMOD 777, а для всех файлов внутри них CHMOD 666!", +'nl_amail' => "Не отсылать письма тем,
кто не хочет получать писем с сайта", +'opt_sys_align' => "Выравнивание картинок по умолчанию", +'opt_sys_alignd' => "Выберите тип выравнивания добавляемых в новость картинок. Данный тип будет предлагаться по умолчанию в выпадающих меню.", +'opt_sys_left' => "По левому краю", +'opt_sys_center' => "По центру", +'opt_sys_right' => "По правому краю", +'opt_sys_none' => "Без выравнивания", +'opt_sys_ip' => "Контроль изменения IP адреса", +'opt_sys_ipd' => "Средний уровень - происходит автоматический сброс авторизации на сайте при изменении IP адреса у всех пользователей имеющих доступ в админцентр

Высокий уровень - происходит автоматический сброс авторизации на сайте при изменении IP адреса у всех посетителей сайта", +'opt_sys_ipn' => "Отсутствует", +'opt_sys_ipm' => "Средний уровень", +'opt_sys_iph' => "Высокий уровень", +'opt_iptools' => "IP Утилиты", +'opt_iptoolsc' => "Поиск зарегистрированных пользователей по определенному IP адресу или по подсети, а также поиск всех IP адресов у пользователя", +'opt_ipfe' => "Вы можете использовать как полный адрес: 192.48.25.71, так и сокращенный: 129.42", +'ip_found_users' => "Список пользователей использовавших данный IP адрес при регистрации или авторизации", +'user_ban' => "Забанен", +'banned_info' => "Неограниченно", +'cache_c' => "Кешировать счетчик просмотров новостей", +'cache_cd' => "Если 'Нет', то счетчик просмотров новостей будет обновляться с каждым просмотром. Если 'Да', количество просмотров будет записываться в другую таблицу и обновляться каждые 4 часа. Включение данной опции позволяет сэкономить процессорное время для больших сайтов.", +// 5.3 + +// 5.2 +'static_br_html' => "Фильтрованный текст с автоматическим переносом строк", +'opt_rss' => "RSS импорт новостей", +'opt_rssc' => "Импортирование новостей в собственную базу данных с других сайтов, используя RSS каналы этих сайтов", +'rss_list' => "Список RSS каналов", +'rss_url' => "URL RSS канала", +'rss_descr' => "Краткое описание", +'rss_new' => "Добавить новый канал", +'rss_news' => "Получить новости", +'rss_edit' => "Настройка канала", +'rss_del' => "Удалить канал", +'rss_hurl' => "Введите адрес RSS канала из которого будут получаться новости. Например http://dle-news.ru/rss.xml", +'rss_hdescr' => "Краткое описание RSS канала, не более 255 символов", +'rss_full' => "Получать полные новости", +'rss_hfull' => "Если \'Да\', то парсер также будет загружать полные страницы сайта по ссылкам в RSS и получать текст полной новости на сайте. Помните это очень ресурсоемкий процесс.", +'rss_date' => "Дата новостей", +'rss_date_1' => "Установить текущую", +'rss_date_2' => "Использовать из канала", +'rss_main' => "Публиковать на главной", +'rss_rating' => "Разрешить рейтинг", +'rss_comm' => "Разрешить комментарии", +'rss_text_type' => "Конвертирование новостей", +'rss_search' => "Маска для поиска", +'rss_hsearch' => "Маска поиска применяется для импортирования полных статей с сайтов Это регулярное выражение, которое использует следующие теги:
{skip} - пропускает любые символы
{get} - получает текст для новости", +'rss_maxnews' => "Количество новостей", +'rss_hmaxnews' => "Импортирование новостей достаточно тяжелый процесс, не рекомендуется устанавливать большие значения", +'rss_cookie' => "Cookies сайта", +'rss_hcookie' => "Иногда для получения полной информации с сайта необходима авторизация на сайте. Вы можете задать cookies которые использует сайт для авторизации, например для сайтов на DataLife Engine необходимо ввести

dle_user_id=id
dle_password=71820d7c524

На каждой новой строке задается новое значение cookies.", +'rss_password' => "Пароль", +'rss_ok1' => "Новый RSS канал успешно добавлен", +'rss_ok2' => "RSS канал успешно отредактирован", +'rss_err1' => "URL является обязательным полем", +'rss_dofull' => "Получить полную новость", +'rss_error' => "Не удалось получить полную новость, возможно, неверно составлен шаблон для поиска новости", +'rss_addnews' => "Добавить новости в базу данных", +'rss_added' => "Все новости успешно добавлены в базу данных", +'rss_notadded' => "Нет новостей для добавления в базу данных", +'opt_sys_sub' => "Выводить новости опубликованные в субкатегориях", +'opt_sys_subd' => "Если 'Да', то новости опубликованные в субкатегориях будут показываться также при просмотре основной категории. В противном случае вам необходимо будет указывать несколько категорий при публикации новости.", +'btn_descr' => "Сгенерировать описание", +'btn_keyword' => "Сгенерировать ключевые слова", +'clean_pm' => "

4. Очистка персональных сообщений пользователей

Вы можете очистить все персональные сообщения ваших пользователей. Это позволит вам уменьшить размеры вашей базы данных, однако ваши посетители потеряют все сообщения, которые они хранят в своем ящике, возможно некоторые сообщения важные. Мы рекомендуем вам заранее уведомлять ваших посетителей о том что будет произведена очистка персональных сообщений с целью уменьшения базы данных.", +'bb_t_hide' => "Вставка скрытого текста", +'bb_t_video' => "Вставка видео", +// 5.2 + +'opt_sys_sbar' => "Включить модуль 'speedbar'", +'opt_sys_sbard' => "Данный модуль показывает текущее местонахождение посетителя на сайте, включая категории, подкатегории и т.д.", +'opt_sm_speed' => "Модуль 'speedbar'", +'opt_sm_speedd' => "В данном разделе настраивается вывод модуля который показывает текущее местонахождение посетителя на сайте, включая категории, подкатегории и т.д.", +'opt_secrsys' => "Настройки безопасности скрипта", +'opt_sys_sxfield' => "Безопасный режим для дополнительных полей", +'opt_sys_sxfieldd' => "Если вы выберете 'Да' то при добавлении информации в дополнительные поля новостей будет использоваться безопасный режим и использование HTML в данных полях будет запрещено.", +'add_metatags' => "Ручное добавление метатегов для статьи", +'xf_lat' => "Латинскими буквами", +'static_new' => "Создать новую страницу", +'poll_new' => "Новый опрос", +'opt_sys_mail' => "Настройки E-Mail", +'opt_sys_mm' => "Метод отправки почты", +'opt_sys_mmd' => "Если функция PHP mail() недоступна, выберите метод SMTP", +'opt_sys_smtph' => "SMTP хост", +'opt_sys_smtphd' => "Обычно — localhost", +'opt_sys_smtpp' => "SMTP Порт", +'opt_sys_smtppd' => "Обычно — 25", +'opt_sys_smtup' => "SMTP Имя пользователя", +'opt_sys_smtpud' => "Не требуется в большинстве случаев, когда используется 'localhost'", +'opt_sys_smtupp' => "SMTP Пароль", +'opt_sys_smtpupd' => "Не требуется в большинстве случаев, когда используется 'localhost'", +'opt_sys_mbcc' => "Использовать поле BCC для рассылки", +'opt_sys_mbccd' => "Если вы выберете 'Да' то при рассылке сообщений в качестве получателей будет указано несколько адресатов, что позволяет сократить общее время отправки сообщений и количество отправленных сообщений.", + +'b_select' => "Назначить", +'opt_sys_loghash' => "Сбрасывать ключ авторизации при каждом входе?", +'opt_sys_loghashd' => "Если 'Да', каждая успешная авторизация пользователя на сайте будет сбрасывать его ключ авторизации. Это сделает невозможным войти под одним именем пользователя более, чем с одного компьютера.", +'opt_sys_codeсd' => "Отображение кода безопасности при написании комментариев или при отправке персональных сообщений, для защиты от спам ботов на сайте", +'opt_sys_imw' => "Автоматическое изменение размера для удаленных изображений", +'opt_sys_imwd' => "Укажите максимальную ширину картинки для тега [img] [/img], после которой изображение будет пропорционально уменьшено, до указанного размера. Для отключения автоматического уменьшения введите 0.", + +'group_main' => "Разрешить публиковать на главной", +'group_main_hint' => "Вы можете разрешить или запретить данной группе публиковать новости на главной странице сайта", +'clean_title' => "Мастер оптимизации базы данных", +'clean_all' => "Добро пожаловать в Мастер оптимизации базы данных DataLife Engine. Мы предлагаем вам шаг за шагом очистить вашу базу данных от устаревшей информации, провести оптимизацию и синхронизацию вашей базы данных. Обратите внимание на то, что если вы не хотите выполнять то или иное действие, то просто выберите \"пропустить шаг\". Общий размер вашей базы данных, на данный момент до оптимизации составляет: {datenbank}.", +'clean_skip' => "Пропустить шаг", +'clean_news' => "

1. Удаление устаревших новостей

Вы можете удалить новости, которые уже перестали быть актуальными и не нужны вам больше. Введите дату для удаления всех новостей, которые были добавлены в базу данных ранее выбранной даты. Это достаточно ресурсоемкая операция, поэтому может занять довольно продолжительное время.", +'clean_comments' => "

2. Удаление устаревших комментариев

Введите дату для удаления всех комментариев ваших посетителей, которые были добавлены в базу данных ранее выбранной даты. Это достаточно ресурсоемкая операция, поэтому может занять довольно продолжительное время.", +'clean_users' => "

3. Пересчет статистики

Иногда в следствии частого удаления, или экспорта пользователей, количество новостей и комментариев, закрепленных за посетителями, может не соответствовать действительности, поэтому вы можете произвести пересчет статистики сайта. Это достаточно ресурсоемкая операция, поэтому может занять довольно продолжительное время.", +'clean_logs' => "

5. Очистка логов скрипта

Вы можете очистить все логи скрипта. Это позволит вам уменьшить размеры вашей базы данных, однако ваши посетители смогут повторно участвовать в опросах в новостях, а также в выставлении рейтинга новостей.", +'clean_finish' => "

Результаты оптимизации

Оптимизация вашей базы данных успешно завершена. Размер вашей базы данных до оптимизации составлял: {db-alt}, после оптимизации составляет: {db-new}. В итоге вы очистили базу данных на: {db-compare}.", +'opt_sys_ajax' => "Использование технологии AJAX для навигации по сайту", +'opt_sys_ajaxd' => "Включение или отключение перехода по страницами, при помощи AJAX. Не используйте данный метод, если используете показ рекламы между новостями.", +'opt_sys_ban' => "Включить поддержку управления рекламой", +'opt_sys_band' => "Включение или отключения модуля управления рекламными материалами", +'opt_clean' => "Мастер оптимизации", +'opt_cleanc' => "Мастер оптимизации и очистки базы данных, позволяющий существенно увеличить скорость работы сайта", +'opt_banner' => "Рекламные материалы", +'opt_bannerc' => "Добавление и управление рекламными материалами, которые публикуются на сайте", +'opt_s_acc' => "Управление пользователями", +'opt_s_tem' => "Управление шаблонами", +'opt_s_fil' => "Утилиты", +'opt_s_oth' => "Другие разделы", + +'led_status' => "Статус", +'vote_aus' => "Приостановить", +'vote_ein' => "Включить опрос", +'led_on_title' => "Опрос включен и доступен для голосования", +'led_off_title' => "Опрос временно приостановлен", +'group_poll' => "Разрешить голосовать в опросах, опубликованных в новостях", +'group_poll_hint' => "Вы можете разрешить или запретить данной группе участвовать в опросах, которые добавляются в новости", +'templ_poll' => "Опрос в новостях", +'templ_poll_i' => "В данном разделе настраивается вывод опроса в новостях.", +'btn_send' => "Отправить", +'btn_preview' => "Просмотр", +'tabs_news' => "Новость", +'tabs_vote' => "Опрос", +'tabs_extra' => "Дополнительно", +'tabs_perm' => "Доступ", +'date_expires' => "Срок действия до:", +'hint_expires' => "Ваша новость будет автоматически удалена или отправлена на модерацию, при наступлении указанного времени. Оставьте данное поле пустым, если хотите чтобы новость имела неограниченный срок действия.", +'hint_ftitle' => "Укажите заголовок вашего опроса.", +'v_ftitle' => "Заголовок Опроса", +'v_multi' => "Разрешить выбор нескольких вариантов", +'v_info' => "Добавление опроса к новости является необязательным параметром, поэтому если вы не хотите добавлять опрос к данной новости, то просто оставьте все поля пустыми.", +'tabs_g_info' => "Внимание: В данном разделе настраиваются, дополнительные параметры доступа к новости для различных групп, данные параметры действительны только для просмотра полной новости.", +'tabs_not' => "У вас недостаточно прав, для использования данной вкладки", + +'ng_group' => "Настройки группы", +'ng_read' => "Только просмотр", +'ng_all' => "Просмотр и комментирование", +'ng_denied' => "Запретить просмотр", + +'a_feed' => "Использование обратной связи", +'a_search' => "Использование поиска по сайту", +'hint_gasearch' => "Разрешение пользователю на использование поиска по сайту", +'hint_gafeed' => "Разрешение пользователю на использование обратной связи на сайте, для отправки e-mail зарегистрированным посетителям сайта. В случае запрета, он сможет отсылать письма только администрации сайта.", +'site_status' => "Режим работы сайта:", +'comm_view' => "Просмотреть", +'comm_del' => "Удалить все", +'comm_alldel' => "Все комментарии данного пользователя удалены", +'comm_alldelconfirm' => "Вы уверены, что хотите удалить все комментарии данного пользователя?", +'comm_einfo' => "Управление комментариями", +'comm_ctext' => "Текст комментария", +'bb_b_apply' => "Принять", +'ajax_info' => "Пожалуйста, подождите...", +'mass_dcomm' => "Вы не выбрали комментарии, которые необходимо удалить", +'mass_delokc' => "Все выбранные Вами комментарии успешно удалены!", +'mod_anti' => "Антивирус", +'anti_descr' => "Проверка папок и файлов скрипта на наличие подозрительных файлов, а также отслеживание несанкционированных изменений в файлах", +'anti_title' => "Проверка файлов скрипта ...", +'anti_box' => "Подождите, идет проверка файлов скрипта ...", +'anti_file' => "Имя файла:", +'anti_path' => "Путь к файлу:", +'anti_size' => "Размер:", +'anti_global' => "Провести тщательное сканирование", +'anti_result' => "Обнаружены следующие подозрительные файлы:", +'anti_notfound' => "При сканировании диска подозрительных файлов не обнаружено.", +'comm_move' => "Переместить все новости из данной категории в", +'dle_version' => "Версия DataLife Engine:", +'dle_udate' => "Проверить наличие обновлений", +'dle_updatebox' => "Подождите идет подключение к удаленному серверу ...", +'no_update' => "Не удалось подключится к удаленному серверу, возможно ваш сервер не поддерживает удаленные соединения, либо произошел сбой в работе наших серверов. Повторите попытку немного позднее ...", +'stat_allow' => "Разрешить просмотр
для следующих групп:", + +'licence_info' => "Тип лицензии скрипта:", +'licence_trial' => "Неактивированная копия", +'licence_full' => "Лицензия активирована", +'trial_info' => "Внимание!
Вы используете неактивированную версию скрипта. Для снятия установленных ограничений вам необходимо ввести ключ активации. Если вы используете скрипт на тестовом сайте, то не активируйте свою копию скрипта. Активация скрипта проходит на нашем сервере http://dle-news.ru/, поэтому убедитесь, что имеется интернет соединение.", +'trial_login' => "Логин:", +'trial_key' => "Введите ключ для активации лицензии:", +'trial_act' => "Активировать", +'trial_limit' => "Были превышены лимиты бесплатной версии скрипта. Дальнейшая работа невозможна.", +'trial_act1' => "Активация DataLife Engine не была произведена, не удалось установить подключение к удаленному серверу. Попробуйте повторить активацию немного позднее.", +'trial_act2' => "Активация DataLife Engine не была произведена, введенные данные не соответствуют необходимым, либо данная копия была уже активирована на другом сервере.", +'trial_act3' => "Благодарим вас за покупку нашего скрипта. Надеемся, что работа с ним доставит Вам только удовольствие!!! В случае обнаружения каких либо ошибок в дистрибутиве, сообщите нам об этом на E-Mail: support@dle-news.ru", +'trial_act4' => "Внимание в связи со сбоями в работе нашего сервера активация скрипта не может быть произведена. Повторите попытку позднее.", + +'sys_global' => "Глобальные настройки", +'hint_news_number' => "Количество новостей на одну страницу в данной категории, оставьте пустым или поставьте 0, если хотите использовать глобальные настройки скрипта.", +'opt_xprof' => "Настройка профиля", +'opt_xprofd' => "В данном разделе проводится настройка дополнительных полей профиля пользователей", + +'ip_block' => "Внимание, Вы включили автоматическую блокировку по IP вашего аккаунта, доступ к вашему аккаунту с данной подсети запрещен.", +'xp_reg' => "Добавить на страницу регистрации?", +'xp_privat' => "Сделать это поле личным?", +'xp_edit' => "Поле может быть изменено пользователем?", +'xp_descr' => "Описание поля", +'xp_edith' => "Редактирование", +'xp_privath' => "Личное", +'xp_regh' => "При регистрации", +'xp_xlist' => "Список дополнительных полей профиля пользователей", +'hint_metas' => "Метатеги для данной статьи могут быть добавлены вручную либо сгенерированы автоматически. Оставьте поля пустыми и метатеги будут сформированы автоматически.", + +'xp_reg_hint' => "При выборе \'Да\', это дополнительное поле будет предложено заполнить при регистрации.", +'xp_privat_hint' => "При выборе \'Да\', поле будет видимым только для самого пользователя, и администраторов. При выборе \'Нет\', остальные пользователи смогут видеть это поле.", +'xp_edit_hint' => "При выборе \'Нет\', пользователь не сможет редактировать это поле, но смогут администраторы.", + +'mass_ddenied' => "У вас нет прав доступа для выполнения массовых действий", +'skin_name' => "Вы вошли как:", +'opt_sys_reggroup' => "Регистрировать новых пользователей в группе:", +'opt_sys_reggroupd' => "Выберите группу в которую будут помещены новые пользователи после регистрации", +'user_gtlimit' => "В группе до:", +'opt_sys_file3' => "Блокировать скачивание файлов с других серверов", +'opt_sys_file3d' => "Включение блокировки скачивания загруженных файлов с других серверов, кроме вашего", +'group_notdel' => "Удаление данной группы пользователей невозможно", +'group_move' => "Переместить всех пользователей данной группы в", +'group_err1' => "Не задано имя группы пользователей", +'group_ok1' => "Новая группа пользователей успешно добавлена", +'group_ok2' => "Изменения в группу успешно внесены", +'group_new' => "Создать группу", +'group_new1' => "Добавление новой группы пользователей", +'group_edit' => "Отредактировать группу", +'group_edit1' => "Редактирование группы: ", +'group_name' => "Название группы", +'group_ct' => "Доступные разделы", +'group_alct' => "Доверительные разделы", +'group_aadm' => "Разрешить доступ в админпанель", +'group_shid' => "Скрывать только полную новость из недоступных разделов", +'group_adds' => "Разрешить добавлять новости c сайта", +'group_moder' => "Публиковать новости без проверки", +'group_edit2' => "Редактирование собственных новостей", +'group_edit3' => "Редактирование всех новостей", +'group_addc' => "Разрешить добавление комментариев", +'group_editc' => "Изменение своих комментариев", +'group_delc' => "Удаление своих комментариев", +'group_allc' => "Изменение всех комментариев", +'group_dllc' => "Удаление всех комментариев", +'group_hic' => "Просмотр скрытого текста", +'group_apm' => "Разрешить использование PM", +'group_afil' => "Разрешить скачивание файлов", +'group_tlim' => "Временное размещение в группе", +'group_rlim' => "Основная группа по окончании лимита", +'group_mpm' => "Максимальное количество PM", +'group_mfot' => "Максимальный размер аватара", +'group_sel1' => "Редактировать", +'group_sel2' => "Удалить", +'group_sel3' => "Удалить невозможно", +'group_sel4' => "Пользователей", +'group_sel5' => "Новая группа", +'group_fixed' => "Разрешить фиксировать новости", + + +'group_del' => "Выбранная группа была успешна удалена", +'group_list' => "Список групп пользователей", +'hint_gtitle' => "Краткое название группы не более 20 символов.", +'hint_gmod' => "Если да, то пользователь сможет публиковать новости в доверительные разделы без проверки администратором.", +'hint_gned' => "Разрешение на редактирование собственных публикаций даже после опубликования на сайте.", +'hint_gnaed' => "Разрешение на редактирование любых публикаций на сайте из доверительных разделов.", +'hint_gaс' => "Разрешение пользователю добавлять комментарии на сайте.", +'hint_geс' => "Разрешение пользователю редактировать собственные комментарии.", +'hint_gdс' => "Разрешить пользователю удаление собственных комментариев.", +'hint_gaeс' => "Разрешение пользователю редактировать любые комментарии.", +'hint_gadс' => "Разрешить пользователю удаление любых комментариев.", +'hint_gvhide' => "Разрешить пользователю просмотр текста между тегами [HIDE] [/HIDE].", +'hint_gapm' => "Разрешить пользователю использовать персональные сообщения на сайте.", +'hint_gafile' => "Разрешить пользователю скачивать прикрепленные к новости файлы.", +'hint_gmpm' => "Максимальное количество персональных сообщений, которое может получать и хранить пользователь.", +'hint_gmphoto' => "Существует две возможности использования данной настройки:

Первая: Вы задаете максимальный размер в пикселях любой из сторон загруженного аватара. Например: 100

Вторая: Вы задаете ширину и высоту загружаемого аватара в формате ширина x высота. Например: 100x100

Для запрета загрузки аватаров на сервер поставьте 0.", +'hint_gadmin' => "Данная опция не предоставляет полного доступа ко всем разделам админпанели, а только разрешает добавление или редактирование новостей в админпанели.", +'hint_gaad' => "Разрешение пользователям добавление новостей на сайт.", +'hint_gadc' => "В случае если пользователю разрешено добавлять новости без проверки, или пользователю разрешено редактировать новости пользователей, вы можете указать в какие разделы он может добавлять новости без модерации, а также в каких разделах редактировать новости других пользователей.", +'hint_gasr' => "При включении данной опции будет блокироваться только просмотр полных новостей из недоступных разделов, краткие новости будут показываться. Данная опция позволяет уменьшить критерии выборки новостей, тем самым уменьшить нагрузку на сервер", +'hint_glimit' => "Разрешение на временное размещение в данной группе, при переносе пользователя в данную группу вы должны будете указать количество дней на которое он там будет размещен, после чего пользователь будет автоматически перемещен в ниже указанную группу", +'hint_grid' => "Укажите группу в которую будет перемещен пользователь по окончании срока нахождения во временной группе", +'hint_glhel' => "Укажите дату до которой данный пользователь будет находиться в выбранной группе. При условии что группа отмечена как временная", +'hint_gfixed' => "Разрешить пользователям фиксировать новости на сайте", + +'opt_group' => "Настройка групп пользователей", +'opt_groupc' => "Создание и управление различными группами пользователей на сайте, назначение прав доступа для этих групп", +'opt_sys_alc' => "Разрешить комментировать новости", +'opt_sys_alcd' => "Включение или отключение комментариев для всех новостей", +'meta_descr' => "Описание для статьи", +'meta_descr_cat' => "Описание для категории", +'meta_descr_max' => "не более 200 символов", +'meta_keys' => "Ключевые слова", + +'opt_sys_descr' => "Описание (Description) сайта:", +'opt_sys_descrd' => "Краткое описание, не более 200 символов", +'opt_sys_key' => "Ключевые слова (Keywords) для сайта:", +'opt_sys_keyd' => "Введите через запятую основные ключевые слова для вашего сайта", + +'opt_ipban' => "Фильтр по: IP, Логину или E-Mail", +'opt_ipbanc' => "Блокировка доступа на сайт для определенных IP, логинов или E-Mail адресов при регистрации на сайте", +'ip_add' => "Добавление в фильтр IP адреса, Логина или E-Mail", +'ip_example' => "Вы можете воспользоваться данным разделом, чтобы заблокировать определенные IP адреса, или заблокировать определенные электронные адреса, имена пользователей при регистрации. При вводе IP адреса, то доступ на сайт данному IP или подсети закрывается полностью, а не только для регистрации.

Примечание: вы можете воспользоваться в фильтре символом звездочки * для подстановки в имя пользователя, IP адрес или электронный адрес (например: 127.0.*.*, *@mail.ru, username*).", +'ip_list' => "Список заблокированных IP адресов, Логинов, E-Mail адресов", +'ip_empty' => "Список пуст", +'ip_error' => "IP адрес не может быть пустым", +'ip_unblock' => "Разблокировать", +'opt_sys_wdst' => "Включить WYSIWYG редактор при редактировании статических страниц:", +'st_al_templ' => "Загружать шаблон для данной статической страницы", +'opt_sm_static' => "Статические страницы", +'opt_sm_statd' => "В данном разделе настраивается вывод статических страниц", +'opt_filesys' => "Настройка загрузки файлов на сервер", +'opt_sys_file' => "Разрешить загрузку файлов на сервер", +'opt_sys_filed' => "Будет разрешена загрузка не только картинок на сервер, но и других файлов", +'opt_sys_file1' => "Расширение файлов, допустимых к загрузке", +'opt_sys_file1d' => "Укажите через запятую расширения файлов, которые разрешено закачивать. Внимание не указывайте расширения для картинок, они определяются скриптом автоматически. Если вы укажите расширения картинок, то они будут предлагаться скриптом к скачиванию, а не к показу.", +'opt_sys_file2' => "Включить счетчик скачиваний файла", +'opt_sys_file2d' => "Включение счетчика увеличивает нагрузку на сервер", +'files_upok' => "Файл загружен на сервер", +'stat_install' => "Внимание!
После установки скрипта на сервер Вы не удалили файл install.php - это делает Ваш сайт уязвимым. Прежде чем продолжить работу, удалите данный файл с Вашего сервера!", + +'opt_notcompress' => "Без сжатия", +'b_method' => "Выберете метод сжатия базы данных:", +'b_save' => "Сохранить базу данных", +'b_restore' => "Выберите резервную копию базы данных:", +'b_load' => "Восстановить базу данных", + + +'edit_regdate' => "Дата регистрации:", +'edit_fdate' => "От", +'edit_tdate' => "До", +'edit_entedate' => "Дата последнего посещения:", +'edit_newsnum' => "Количество сообщений:", +'hint_newsnum' => "Введите количество новостей для поиска.", +'hint_comsnum' => "Введите количество комментариев для поиска.", +'edit_comsnum' => "Количество комментариев:", +'user_breset' => "Очистить", +'user_brestore' => "Вернуть", +'user_coms' => "Комментариев:", +'user_order' => "Порядок сортировки пользователей", +'user_order_no' => "----", +'user_order_minus' => "По убыванию", +'user_order_plus' => "По возрастанию", +'ban_date' => "Срок окончания бана:", +'ban_edate' => "Забанен до:", +'ban_descr' => "Причина бана:", +'hint_bandescr' => "Укажите количество дней, в течении которых пользователю будет запрещен доступ на сайт. Оставьте 0, если срок блокировки неограничен по времени", + + +'allow_br' => "Автоматический перенос строк", +'stat_banned' => "Из них было забанено:", +'cache_size' => "Общий размер кеша:", +'free_size' => "Размер свободного места на диске:", +'cat_posi' => "Отсортировать категории", + +'main_quick' => "Быстрый доступ к разделам сайта", +'main_newsl' => "Рассылка сообщений", +'main_newslc' => "Создание и массовая отправка E-Mail или персональных сообщений, для зарегистрированных пользователей", +'news_list' => "Список статей на сайте", +'b_start' => "Выполнить", +'vote_new' => "Добавить", +'vote_edit' => "Отредактировать", +'b_find' => "Найти", +'b_create' => "Добавить поле", +'m_login' => "Авторизация на сайте", +'b_login' => "Войти", +'nl_main' => "Подготовка к отправке сообщений", +'nl_empf' => "Получатели:", +'nl_type' => "Тип сообщения:", +'nl_pm' => "ПМ", +'nl_editor' => "Редактор сообщений:", +'nl_message' => "Текст сообщения", +'nl_seng' => "Отправка сообщения", +'nl_info' => "Внимание идет отсылка сообщений пользователям, не закрывайте данное окно до тех пор, пока не будут отосланы все письма", +'nl_sendet' => "Отправлено сообщений:", +'nl_status' => "Статус:", +'nl_start' => "Начать отправку", +'nl_sinfo' => "отправка ...", +'nl_error' => "ошибка отправки", +'nl_finish' => "отправка завершена", +'nl_mailerror' => "сбой функции mail", +'news_clearcomments' => "Удалить все комментарии", +'db_confirmclear' => "Вы уверены, что хотите удалить все комментарии к новостям?", +'extra_signature' => "Подпись", + +'opt_sys_chars' => "Используемая кодировка на сайте:", +'opt_sys_charsd' => "Укажите кодировку, которую использует ваш сайт", + +'hint_title' => "Заголовок статьи обязателен к заполнению и может содержать не более 200 символов.", +'hint_url' => "ЧПУ URL статьи ссылка для просмотра статьи в браузере. Необязательный параметр. Допустимы только латинские символы.", +'hint_calendar' => "Дата публикации новости. Если установленная дата еще не наступила, новость будет опубликована автоматически, в указанное время.", +'hint_pass' => "Заполнение данного поля необходимо только в случае если вы хотите сменить свой текущий пароль.", +'hint_vtitle' => "Укажите вопрос вашего голосования.", +'hint_vcat' => "Категория в которой будет показываться ваш опрос.", +'hint_stitle' => "Название статической страницы. Допустимо использование только латинских символов без пробелов", +'hint_sdesc' => "Краткое описание статической страницы.", +'hint_user' => "По умолчанию в списке пользователей выводятся только пользователи со статусом не менее журналиста. Для просмотра списка всех участников оставьте поле для поиска пустым.", +'hint_banned' => "Отметьте данное поле, для того чтобы запретить пользователю доступ на сайт.", +'hint_catname' => "Имя вашей новой категории. Данное поле обязательно к заполнению.", +'hint_cataltname' => "Используется для просмотра всех статей в данной категории. Данное поле обязательно к заполнению. Допустимо использование только латинских символов", +'hint_caticon' => "Ссылка на иконку для данной категории, вывод настраивается в шаблонах.", +'hint_cattempl' => "Вы можете установить для данной категории отдельный шаблон, отличный от используемого по умолчанию.", +'hint_mail' => "Введите E-Mail участника для поиска.", + + +// add v.2.7 +'opt_sys_cpm' => "Количество комментариев на страницу", +'opt_sys_cpmd' => "Укажите сколько комментариев выводить на одну страницу", +'opt_sys_csort' => "Порядок сортировки комментариев", +'opt_sys_csortd' => "Выберите порядок сортировки комментариев", +// add v.2.6 + +'opt_sys_sort' => "Критерий сортировки новостей", +'opt_sys_sortd' => "Выберите критерий для сортировки новостей", +'opt_sys_sdate' => "По дате публикации", +'opt_sys_srate' => "По рейтингу", +'opt_sys_sview' => "По просмотрам", +'opt_sys_salph' => "По алфавиту", +'opt_sys_msort' => "Порядок сортировки новостей", +'opt_sys_msortd' => "Выберите порядок сортировки новостей", +'opt_sys_mminus' => "По убыванию", +'opt_sys_mplus' => "По возрастанию", +'opt_sys_code' => "Код безопасности", +'opt_sys_coded' => "Отображение кода безопасности при регистрации для защиты от автоматической регистрации", +'edit_fix' => "Важно:", +'edit_search_news' => "Поиск по новостям:", +'addnews_allow_rate' => "Разрешить рейтинг статьи", +'opt_newssys' => "Настройки вывода новостей", +'opt_sys_offline' => "Выключить сайт:", +'opt_sys_offlined' => "Перевести сайт в состояние offline, для проведения технических работ", +'opt_sm_offline' => "Временно отключенный сайт", +'opt_sm_offd' => "В данном разделе настраивается вывод страницы при временном отключении сайта", +'extra_info' => "Дополнительная информация", +'extra_minfo' => "О себе:", + + +// end 2.6 + +'undefined' => "Неопределено", + +'opt_ss_m' => "Общий макет страницы", +'opt_ss_m1' => "В данном разделе настраивается вывод общего макета страницы", +'opt_cr_err' => "Не удалось создать шаблон с выбранным именем", + + +'images_add_tl' => "Добавить еще одно поле для загрузки картинки", +'images_rem_tl' => "Удалить последнее поле для загрузки картинки", +'images_align' => "Выравнивание", +'images_left' => "По левому краю", +'images_right' => "По правому краю", +'images_center' => "По центру", +'images_water' => "Наложить водяной знак на картинку", +'images_big' => "Слишком большое изображение", + +'cat_parent' => "Основная категория:", +'cat_skin' => "Установить другой шаблон для категории:", +'cat_skin_sel' => "Шаблон по умолчанию", +'cat_skin_t' => "Шаблон", + +'opt_sys_sc' => "Разрешить посетителям смену скина на сайте", +'opt_sys_scd' => "Если Вы используете несколько скинов на сайте, то вы можете разрешить посетителям смену скина", +'opt_r_v' => "Голосование на сайте", +'opt_r_vd' => "В данном разделе настраивается модуль голосований на сайте", + +'opt_sys_voc' => "Включить голосования на сайте", +'opt_sys_vocd' => "Включение или отключения модуля общего голосования на сайте", +'opt_sys_toc' => "Включить вывод самых рейтинговых статей на сайте", +'opt_sys_tocd' => "Отключение данного модуля позволяет сэкономить 1 запрос к базе данных", +'opt_sys_newc' => "Количество новостей на страницу", +'opt_sys_newd' => "Количество кратких новостей, которое будет выводиться на страницу", + +'opt_general_sys' => "Настройка параметров скрипта (используйте навигацию для доступа к разделам)", +'opt_allsys' => "Общие настройки скрипта", +'opt_commsys' => "Настройка комментариев", +'opt_dbsys' => "Оптимизация запросов к базе данных", +'opt_usersys' => "Настройки для пользователей", +'opt_imagesys' => "Настройка работы с изображениями", +'opt_sys_rn' => "Включить счетчик просмотров новостей", +'opt_sys_rnd' => "Отключение счетчика экономит один запрос", +'opt_sys_wda' => "Включить WYSIWYG редактор в админпанели:", +'opt_sys_wdad' => "Если 'Да', то будет включен WYSIWYG редактор, если 'Нет', то будут использоваться BBCODES", +'opt_sys_wds' => "Включить WYSIWYG редактор при добавлении новостей с сайта", +'opt_sys_wdsd' => "Если 'Да', то будет включен WYSIWYG редактор, если 'Нет', то будут использоваться BBCODES", +'opt_sys_wdcom' => "Включить WYSIWYG редактор для комментариев и персональных сообщений", +'opt_sys_ncom' => "Негативный комментарий", +'opt_sys_ncomd' => "Рейтинг комментария, при котором он считается негативным", +'opt_sys_npro' => "Как поступать с негативными", +'opt_sys_nprod' => "Как поступать с комментарием если он становится негативным", +'opt_sys_npro_del' => "Удалить", +'opt_sys_npro_hid' => "Спрятать", +'opt_sys_wdscomd' => "Если Да то будет включен WYSIWYG редактор, если нет то будут использоваться BBCODES", +'opt_sys_wdcom' => "Включить WYSIWYG редактор для комментариев и персональных сообщений", +'opt_sys_aiu' => "Разрешить пользователям загружать картинки", +'opt_sys_aiud' => "Вы можете разрешить или запретить пользователям загружать изображения на сервер при добавлении новости с сайта", +'err_noupload' => "Администратором была отключена возможность загрузки изображений на сервер.", +'err_notlogged' => "Вы не авторизированы на сайте", +'opt_sys_cac' => "Включить кеширование на сайте", +'opt_sys_cad' => "Кеширование существенно сокращает нагрузку на сервер, сводя количество запросов к минимуму", +'opt_sys_dim' => "Автоматическое удаление изображений", +'opt_sys_dimd' => "Введите количество дней через которое будут удалены картинки которые были загружены на сервер но не добавлены в новость", +'opt_sys_maxsize' => "Максимально допустимый объём изображения", +'opt_sys_maxsized' => "Введите максимальный объём загружаемого изображения (в килобайтах)", +'opt_vote' => "Управление голосованиями", +'opt_votec' => "Создание и редактирование различных опросов или голосований на вашем сайте", +'vote_nodata' => "На данный момент еще небыло создано опросов на сайте", +'vote_count' => "Голосов", +'vote_action' => "Действие", +'vote_confirm' => "Вы действительно желаете удалить выбранный опрос", +'vote_title' => "Вопрос", +'vote_body' => "Варианты ответов", +'vote_str_1' => "Каждая новая строка
является новым вариантом
ответа", +'vote_str_2' => "Опрос был успешно удален", +'vote_str_3' => "Опрос был успешно добавлен", +'vote_str_4' => "Опрос был успешно обновлен", +'vote_clear' => "Вы действительно желаете обнулить данный опрос", +'vote_clear1' => "Обнулить результаты голосования", +'vote_clear2' => "очистить", +'vote_clear3' => "Результаты голосования были успешно очищены", +'vote_alert' => "Все поля обязательны к заполнению", + +'last_comm' => "последние комментарии", + +'skin_title' => "Панель управления", +'skin_main' => "Главная", +'skin_view' => "Просмотр сайта", +'skin_help' => "Помощь", +'skin_logout' => "Выход", +'skin_addnews' => "Добавить новость", +'skin_editnews' => "Редактировать новость", +'skin_option' => "Настройки", + +'xfield_title' => "Добавление нового дополнительного поля", +'xfield_xname' => "Название поля", +'xfield_xdescr' => "Описание поля", +'xfield_xcat' => "Категория", +'xfield_xall' => "Все", +'xfield_xtype' => "Тип поля", +'xfield_xstr' => "Одна строка", +'xfield_xarea' => "Несколько строк", +'xfield_xsel' => "Список", +'xfield_xfaul' => "Значение по умолчанию", +'xfield_xw' => "Использовать при желании (можно оставить поле пуcтым)", +'xfield_xlist' => "Список дополнительных полей", +'xfield_xwt' => "При желании", +'xfield_xnof' => "Дополнительных полей нет!", +'xfield_xact' => "Выберите действие", +'xfield_xedit' => "Редактировать", +'xfield_xdel' => "Удалить", +'xfield_xo' => "Сдвинуть вверх", +'xfield_xu' => "Сдвинуть вниз", +'xfield_xhelp' => "Что такое дополнительные поля?", +'xfield_xerr1' => "Вы должны заполнить все необходимые поля.", +'xfield_xerr2' => "Недействительный запрос, возможно ошибка в модуле", + +'safe_mode_on' => "Включен", +'safe_mode_off' => "Выключен", + +'time_0' => "Доброе утро,", +'time_1' => "Добрый день,", +'time_2' => "Добрый вечер,", +'time_3' => "Доброй ночи,", + +'stat_all' => "Общая статистика сайта:", +'stat_allnews' => "Общее количество новостей:", +'stat_comments' => "Всего комментариев:", +'stat_users' => "Зарегистрировано пользователей:", +'stat_mod' => "Новости ожидающие проверки:", +'stat_auto' => "Автопроверка системы:", +'stat_php' => "Версия PHP:", +'stat_mysql' => "Версия MySQL:", +'stat_gd' => "Версия GD:", +'stat_safemode' => "Безопасный режим:", +'stat_maxmem' => "Выделено оперативной памяти:", +'stat_func' => "Отключенные функции:", +'stat_bd' => "Размер базы данных:", +'stat_maxfile' => "Максимальный размер загружаемого файла:", +'stat_bild' => "Размер папки Uploads:", + +'stat_phperror' => "Внимание!
Версия php-интерпретатора, установленная на сервере, слишком старая. Возможна некорректная работа скрипта с этой версией, поэтому мы рекомендуем связаться с администрацией хостинга для обновления версии php! Скачать последнюю версию можно на официальном сайте.", +'stat_safeskin' => "Внимание!
Невозможно загрузить выбранный в настройках скин. Автоматически загружен скин по умолчанию!
Проверьте наличие файлов скина на сервере!", +'stat_nofree' => "Внимание!
Системой обнаружено, что на сервере мало свободного места. Вам необходимо предпринять меры по увеличению дискового пространства для нормальной работы скрипта. Также необходимо сделать резервную копию базы новостей!", + +'addnews' => "Добавить новость", +'addnews_denied' => "Доступ запрещен", +'addnews_perm' => "Вы не можете добавлять новости", +'addnews_alert' => "У вашей статьи должен быть хотя бы заголовок и краткая версия", +'addnews_news' => "Добавление новости в базу данных", +'addnews_title' => "Заголовок статьи:", +'addnews_url' => "ЧПУ URL статьи:", +'addnews_date' => "Дата:", +'addnews_cat' => "Категория:", +'addnews_short' => "Краткое описание:", +'addnews_bild' => "загрузить файлы", +'addnews_full' => "Полное описание:", +'addnews_alt' => "необязательно", +'addnews_comm' => "Разрешить комментарии", +'addnews_main' => "Публиковать на главной", +'addnews_mod' => "Опубликовать новость на сайте", +'addnews_fix' => "Зафиксировать новость", +'addnews_error' => "Ошибка !!!", +'addnews_erdate' => "Недопустимый формат даты.", +'addnews_ertitle' => "Заголовок не может быть пустым.", +'addnews_erstory' => "Поля не могут быть пустыми.", +'addnews_ermax' => "Слишком длинный заголовок.", +'addnews_ok' => "Новость добавлена", +'addnews_ok_1' => "Новость", +'addnews_ok_2' => "была успешно добавлена!", + +'cat_perm' => "Вы не можете редактировать категории", +'cat_error' => "Ошибка !!!", +'cat_ername' => "Введите имя категории!", +'cat_erurl' => "Введите альтернативное имя категории!", +'cat_icon' => "(при желании)", +'cat_eradd' => "Категория с таким именем уже существует!", +'cat_addok' => "Категория добавлена", +'cat_addok_1' => "Категория была успешно добавлена!", +'cat_noid' => "Нет ID категории!", +'cat_delok' => "Категория удалена", +'cat_delok_1' => "Категория была успешно удалена!", +'cat_head' => "Категории", +'cat_edit' => "Редактирование категории", +'cat_name' => "Имя:", +'cat_url' => "Альтернативное имя:", +'cat_addicon' => "Иконка:", +'cat_noname' => "Введите название категории!", +'cat_editok' => "Изменения сохранены", +'cat_editok_1' => "Изменения были успешно сохранены", +'cat_add' => "Добавление новой категории", +'cat_info' => "Что такое категории? Как их использовать?", +'cat_ed' => "правка", +'cat_del' => "удалить", +'cat_nocat' => "Категорий нет
Категории создаются при желании, вы можете прекрасно обойтись и без них", +'cat_list' => "Список категорий", +'cat_cat' => "Категория:", +'cat_action' => "Действие:", + +'db_denied' => "Вы не имеете доступа в данный раздел", +'db_ok' => "Дeйствие выполнено", +'db_ok_1' => "Выбранное действие успешно выполнено", +'db_prev' => "Вернуться назад", +'db_err' => "Ошибка выполнения", +'db_err_1' => "Выбранное действие не удалось выполнить", +'db_err_2' => "Расширение у загружаемого файла должно быть *.sql", +'db_err_3' => "Ошибка загрузки файла, восстановление базы данных остановлено", +'db_ok_2' => "Восстановление базы данных успешно завершено", +'db_ok_3' => "Было выполнено", +'db_ok_4' => "успешных запросов", +'db_ok_5' => "Не удалось выполнить", +'db_ok_6' => "запросов", +'db_info' => "Настройка и оптимизация базы данных", +'db_action' => "Выполнить действие", +'db_opt' => "Оптимизация базы данных", +'db_opt_i' => "Вы можете произвести оптимизацию базы данных, тем самым будет сэкономлено немного места на диске, а также ускорена работа базы данных. Рекомендуется использовать данную функцию минимум один раз в неделю.", +'db_re' => "Ремонт базы данных", +'db_re_i' => "при неожиданной остановке MySQL сервера, во время выполнения каких-либо действий, может произойти повреждение структуры таблиц, использование этой функции поможет решить вам эту проблему.", +'db_back' => "Сохранение резервной копии", +'db_load' => "Загрузка резервной копии с диска", +'db_load_a' => "Загрузить", + +'edit_denied' => "У вас нет прав для редактирования данной статьи", +'edit_head' => "Редактирование новостей", +'edit_act' => "Редактировать данную новость", +'edit_yes' => "да", +'edit_no' => "нет", +'edit_stat' => "Показано статей:", +'edit_stat_1' => "Всего найдено статей в базе данных:", +'edit_cat' => "Категория:", +'edit_opt' => "настройки", +'edit_all' => "- Все -", +'edit_au' => "Автор:", +'edit_page' => "Новостей на страницу:", +'edit_act_1' => "Показать", +'edit_nonews' => "- Не найдено статей -", +'edit_title' => "Заголовок", +'edit_com' => "Комментарии", +'edit_approve' => " Модерация ", +'edit_cl' => "Категория", +'edit_autor' => "Автор", +'edit_selall' => "Выбрать все", +'edit_prev' => "Пред.", +'edit_next' => "Далее", +'edit_selact' => "-- Действие --", +'edit_seldel' => "Удалить", +'edit_selcat' => "Изменить категорию", +'edit_nonews' => "Выбранная вами статья не найдена!", +'edit_cdel' => "Вы действительно хотите удалить эту статью?", +'edit_etitle' => "Редактирование новости", +'edit_info' => "Информация:", +'edit_eau' => "опубликовал:", +'edit_et' => "Заголовок:", +'edit_alturl' => "ЧПУ URL статьи:", +'edit_edate' => "Дата:", +'edit_ecal' => "Выбор даты с помощью календаря", +'edit_ndate' => "Не изменять дату", +'edit_jdate' => "текущая дата и время", +'edit_ac' => "Разрешить комментарии", +'edit_amain' => "Публиковать на главной", +'edit_allow' => "Опубликовать новость на сайте", +'edit_afix' => "Зафиксировать новость", +'edit_dnews' => "Удалить", +'edit_delok' => "Новость удалена", +'edit_delok_1' => "Статья была успешно удалена.
Если к этой статье были комментарии, то они удалены тоже", +'edit_delok_2' => "Статья была успешно удалена.
Нельзя удалить комментарии к этой статье!!!", +'edit_alleok' => "Изменения сохранены", +'edit_alleok_1' => "Изменения были успешно сохранены", +'edit_allerr' => "Статья не может быть обнаружена, или возникла какая-то проблема с базой данных", + +'user_denied' => "Вы не можете редактировать пользователей", +'user_head' => "Пользователи", +'user_auser' => "Добавить пользователя", +'user_newlogin' => "Новый логин:", +'user_deluser' => "Вы уверены, что хотите удалить этого пользователя?", +'user_name' => "Имя:", +'user_pass' => "Пароль:", +'user_mail' => "E-mail:", +'user_acc' => "Группа:", +'user_se' => "Поиск пользователя", +'user_list' => "Список пользователей", +'user_reg' => "Дата регистрации:", +'user_news' => "Публикаций:", +'user_action' => "Действие:", +'user_last' => "Дата посещения:", +'user_edit' => "изменить", +'user_del' => "удалить", +'user_err' => "Ошибка !!!", +'user_err_1' => "Необходимо заполнить все поля", +'user_err_2' => "Заполните поле 'Пароль'!", +'user_err_3' => "Пользователь с таким именем уже есть !", +'user_err_4' => "Данный E-Mail уже зарегистрирован на другого пользователя!", +'user_addok' => "Пользователь добавлен", +'user_ok' => "Пользователь", +'user_ok_1' => "был успешно зарегистрирован в группе", +'user_edhead' => "Редактирование пользователя", +'user_newpass' => "Новый пароль:", +'user_banned' => "Забанен:", +'user_save' => "Сохранить", +'user_can' => "Отмена", +'user_nouser' => "Данный пользователь не найден.", +'user_editok' => "Изменения сохранены", +'user_undel' => "Этого пользователя невозможно удалить!", +'user_delok' => "Пользователь удален", +'user_delok_1' => "был успешно удален.", + +'images_head' => "Управление картинками", +'images_renok' => "Файл успешно переименован", +'images_renerr' => "Переименовать не удалось", +'images_renerr_1' => "Неверное расширение", +'images_uperr' => "Укажите загружаемую картинку!!!", +'images_uperr_1' => "Такая картинка уже есть!!!", +'images_uperr_2' => "Загрузка таких типов файлов запрещена!!!", +'images_uperr_3' => "Невозможно загрузить файл на сервер", +'images_upok' => "Картинка загружена", +'images_thok' => "Уменьшенная копия картинки создана", +'images_uptitle' => "Загрузка файлов на сервер", +'images_uphard' => "С жесткого диска:", +'images_upurl' => "С сервера (URL):", +'images_aren' => "Перезаписать, если уже есть?", +'images_nogd' => "Уменьшение картинки невозможно!
Не загружен модуль GD2", +'images_ath' => "Автоматически уменьшать картинки", +'images_iln' => "Файлы загруженные для данной новости", +'images_view' => "просмотр", +'images_lgem' => "Файлы загруженные на сервер (общая папка)", +'images_thn' => "уменьшенная копия", +'images_rename' => "переименовать", +'images_del' => "Удалить файлы", +'images_size' => "Общий размер всех файлов:", +'images_listdir' => "Выберите директорию:", +'images_foto' => "Загруженные аватары", +'images_thumb' => "Уменьшенные картинки", +'images_news' => "Картинки к новостям", +'images_delerr' => "Невозможно удалить картинку!", +'images_delerr_1' => "Выберите картинки, которые нужно удалить!", +'images_delok' => "Удаление завершено!", +'images_delok_1' => "Картинка была успешно удалена.", + +'bb_url' => "Введите полный URL ссылки", +'bb_page' => "Введите номер страницы", +'bb_url_name' => "Введите название сайта", +'bb_page_name' => "Введите описание ссылки", +'bb_image' => "Введите полный URL изображения", +'bb_email' => "Введите e-mail адрес", +'bb_code' => "Использование: [CODE] Здесь Ваш код.. [/CODE]", +'bb_quote' => "Использование: [QUOTE] Здесь Ваша Цитата.. [/QUOTE]", +'bb_no_url' => "Вы должны ввести URL", +'bb_no_title' => "Вы должны ввести название", +'bb_no_email' => "Вы должны ввести e-mail адрес", +'bb_prompt_start' => "Введите текст для форматирования", +'bb_img_title' => "Введите по какому краю выравнивать картинку (left, center, right)", +'bb_email_title' => "Введите описание ссылки (необязательно)", +'bb_b_center' => "По центру", +'bb_b_quote' => " Цитата ", +'bb_b_left' => "Слева", +'bb_b_right' => "Справа", +'bb_bb_page' => "Страница", +'bb_b_color' => "ЦВЕТ", +'bb_b_blue' => "Синий", +'bb_b_red' => "Красный", +'bb_b_purple' => "Пурпурный", +'bb_b_orange' => "Оранжевый", +'bb_b_yellow' => "Жёлтый", +'bb_b_gray' => "Серый", +'bb_b_green' => "Зелёный", +'bb_b_seagreen' => "Морской волны", +'bb_b_lime' => "Лайм", +'bb_b_brown' => "Коричневый", +'bb_b_pink' => "Розовый", +'bb_b_tomato' => "Томатный", +'bb_b_magenta' => "Фиолетовый", +'bb_b_slategray' => "Темно-серый", +'bb_b_navy' => "Темно-синий", +'bb_b_deepskyblue' => "Голубой", +'bb_b_close' => "Закрыть тэги", +'bb_b_url' => "Ссылка", +'bb_b_img' => "Картинка", +'bb_b_mail' => "E-Mail", +'bb_b_break' => "Разрыв", +'bb_b_page' => "Ссылка на страницу", +'bb_t_b' => "Полужирный", +'bb_t_i' => "Наклонный текст", +'bb_t_h' => "Скрывает текcт от незарегистрированных посетителей", +'bb_t_u' => "Подчеркнутый текст", +'bb_t_s' => "Зачеркнутый текст", +'bb_t_l' => "Выравнивание по левому краю", +'bb_t_c' => "По центру", +'bb_t_r' => "Выравнивание по правому краю", +'bb_t_cl' => "Закрыть все открытые теги", +'bb_t_url' => "Вставка ссылки", +'bb_t_img' => "Вставка картинки", +'bb_t_quote' => "Вставка цитаты", +'bb_t_code' => "Вставка исходного кода", +'bb_t_m' => "Вставка email", +'bb_t_br' => "Вставка разрыва между страницами", +'bb_t_p' => "Вставка ссылки на страницу", + +'mass_error' => "Ошибка!!!", +'mass_denied' => "Выберите статьи", +'mass_head' => "Удаление новостей", +'mass_confirm' => "Вы уверены, что хотите удалить выбранные", +'mass_confirm_1' => "новости?", +'mass_no' => "Нет", +'mass_yes' => "Да", +'mass_sel' => "Выберите статьи", +'mass_delok' => "Все выбранные Вами статьи успешно удалены!", +'mass_notok' => "Удаление новостей (найдены ошибки!!!)", +'mass_i' => "из", +'mass_notok_1' => "новостей удалены", +'mass_cat' => "Изменение категорий статей", +'mass_cat_1' => "Изменение категории", +'mass_cat_2' => "Изменить категорию для выбранных статей", +'mass_cat_3' => "на:", +'mass_cat_ok' => "Категория изменена", +'mass_cat_ok_1' => "Категория для выбранных Вами статей изменена", +'mass_cat_notok' => "Категория изменена (с ошибками)", +'mass_cat_notok_1' => "Не удалось изменить категорию у всех выбранных статей", +'mass_noact' => "Выберите действие", +'mass_noact_1' => "Выберите действие из выпадающего меню", + +'opt_head' => "Настройки", +'opt_priv' => "Личные настройки", +'opt_privc' => "Управление и настройка вашего личного профиля пользователя.", +'opt_all' => "Настройка системы", +'opt_allc' => "Настройка общих параметров скрипта, а также настройка вывода новостей и комментариев, настройка системы безопасности скрипта", +'opt_static' => "Статические страницы", +'opt_staticd' => "Создание и редактирование страниц, которые как правило редко изменяются и имеют постоянный адрес", +'opt_t' => "Шаблоны сайта", +'opt_tc' => "Создание и редактирование шаблонов, которые используются на вашем сайте, а также назначение различных языков этим шаблонам", +'opt_user' => "Редактирование пользователей", +'opt_userc' => "Управление зарегистрированными на сайте пользователями, редактирование их профилей и блокировка аккаунта", +'opt_img' => "Управление картинками", +'opt_imgc' => "Загрузка изображений и управление уже загруженными картинками на сервере", +'opt_cat' => "Категории", +'opt_catc' => "Создание и управление категориями в новостях, назначение шаблонов и порядок сортировки для категорий", +'opt_fil' => "Фильтр слов", +'opt_filc' => "Настройка фильтра слов, который будет удалять или заменять указанные слова при добавлении новостей или комментариев", +'opt_email' => "Шаблоны E-Mail сообщений", +'opt_emailc' => "Настройка шаблонов E-Mail сообщений, которые отсылает скрипт с сайта при регистрации пользователя, восстановлении пароля и т.д.", +'opt_xfil' => "Дополнительные поля новостей", +'opt_xfilc' => "Создание дополнительных полей для новостей, которые предназначены для более удобного добавления новостей на сайте", +'opt_db' => "Управление базой данных", +'opt_dbc' => "Настройка и оптимизация базы данных, а также резервное копирование и восстановление базы данных", +'opt_hopt' => "Настройки скрипта", +'opt_hprv' => "Редактирование собственного профиля", +'opt_fullname' => "Полное имя:", +'opt_land' => "Место жительства:", +'opt_icq' => "Номер ICQ:", +'opt_altpassw' => "Старый пароль:", +'opt_hmail' => "Не получать писем от других посетителей", +'opt_peok' => "Ваша персональная информация была успешно сохранена", +'opt_errpass' => "Введен неверный старый пароль", +'opt_denied' => "Доступ отклонен", +'opt_errfo' => "Невозможно открыть папку /data/templates/", +'opt_newtemp' => "Создание нового шаблона", +'opt_newtemp_1' => "Создать новый шаблон на базе:", +'opt_msgnew' => "с названием", +'opt_error' => "Ошибка!!!", +'opt_error_1' => "Название шаблона должно состоять только из букв и цифр!", +'opt_error_2' => "Шаблон с таким именем уже существует!", +'opt_error_3' => "Невозможно скопировать базовый файл шаблона", +'opt_error_4' => "Вы не можете удалить шаблон, используемый по умолчанию!", +'opt_error_5' => "Невозможно удалить шаблон", +'opt_info' => "Шаблон создан!", +'opt_info_1' => "Новый шаблон был успешно создан", +'opt_info_2' => "Вы действительно хотите удалить шаблон", +'opt_info_3' => "Удаление шаблона", +'opt_info_4' => "Выбранный шаблон был успешно удален", +'opt_yes' => "Да, удалить шаблон", +'opt_no' => "Отмена", +'opt_dellink' => "удалить шаблон", +'opt_theads' => "Шаблон:", +'opt_edit_head' => "Управление шаблонами", +'opt_newtepled' => "Выбрать другой:", +'opt_temphelp' => "Что такое шаблоны?", +'opt_enewtepl' => "создать новый", +'opt_edteil' => "Редактирование разделов шаблона:", +'opt_ss_h' => "Краткое содержание", +'opt_ss_d' => "В данном разделе настраивается вывод коротких новостей", +'opt_fs_h' => "Статья целиком", +'opt_fs_d' => "В данном разделе настраивается вывод полной новости", +'opt_an_h' => "Добавление новости", +'opt_an_d' => "В данном разделе настраивается форма, которая выводится посетителям при добавлении новостей", +'opt_c_h' => "Комментарии", +'opt_c_d' => "В данном разделе настраивается вывод комментариев", +'opt_fc_h' => "Форма добавления либо изменения комментария", +'opt_fc_d' => "В данном разделе настраивается вывод формы для добавления либо изменения комментария
(не рекомендуется изменять пользователям плохо владеющим HTML)", +'opt_n_h' => "Предыдущая и следующая страницы для новостей", +'opt_n_d' => "В данном разделе настраивается вывод навигации для новостей", +'opt_u_h' => "Информация о посетителе", +'opt_u_d' => "В данном разделе настраивается вывод профиля посетителя
(не рекомендуется изменять пользователям плохо владеющим HTML)", +'opt_se_hf' => "Форма поиска", +'opt_se_df' => "В данном разделе настраивается вывод формы для поиска по сайту", +'opt_se_h' => "Результаты поиска", +'opt_se_d' => "В данном разделе настраивается вывод результатов поиска по сайту", +'opt_se_h' => "Результаты поиска", +'opt_st_h' => "Статистика сайта", +'opt_st_d' => "В данном разделе настраивается вывод общей статистики сайта", +'opt_er_h' => "Вывод информации и ошибок", +'opt_er_d' => "В данном разделе настраивается вывод формы в случае возникновения ошибок", +'opt_r_h' => "Регистрация посетителя на сайте", +'opt_r_d' => "В данном разделе настраивается вывод регистрации на сайте
(не рекомендуется изменять пользователям плохо владеющим HTML)", +'opt_pa_h' => "Форма для запроса забытого пароля", +'opt_pa_d' => "В данном разделе настраивается вывод формы для восстановления забытого пароля", +'opt_pa_d_1' => "
", +'opt_sm_h' => "Форма для отправки E-Mail писем пользователям и администрации", +'opt_sm_d' => "В данном разделе настраивается вывод формы для отправки E-Mail писем пользователям и администрации", +'opt_pm_h' => "Персональные сообщения", +'opt_pm_d' => "В данном разделе настраивается вывод персональных сообщений", + +'opt_editok' => "Изменения сохранены", +'opt_editok_1' => "Шаблон успешно сохранен", +'opt_sysok' => "Настройки сохранены", +'opt_sysok_1' => "Настройки были успешно сохранены", + +'opt_sys_hth' => "Настройка путей к скрипту", +'opt_sys_ht' => "Название сайта:", +'opt_sys_htd' => "например: \"Моя домашняя страница\"", +'opt_sys_hu' => "Домашняя страница сайта:", +'opt_sys_hud' => "Укажите имя основного домена на котором располагается ваш сайт. Например: http://yoursite.com/ Внимание, наличие слеша на конце в имени домена обязательно.", +'opt_sys_sd' => "Полный путь к директории скрипта:", +'opt_sys_sdd' => "например: http://yoursite.com/news/", +'opt_sys_hp' => "Версия для печати:", +'opt_sys_hpd' => "например: http://yoursite.com/print1.php", +'opt_sys_all' => "Общие настройки", + +'opt_sys_amail' => "E-Mail адрес администратора:", +'opt_sys_amaild' => "Введите E-Mail адрес администратора сайта", + +'opt_sys_al' => "Используемый язык:", +'opt_sys_ald' => "Выберите язык, который будет использоваться при работе с системой", +'opt_sys_as' => "Шаблон сайта по умолчанию:", +'opt_sys_asd' => "Выберите шаблон, который будет использоваться на сайте", +'opt_sys_aw' => "Автоматическая разбивка длинных слов:", +'opt_sys_awd' => "в случае превышения заданного числа символов", +'opt_sys_af' => "Защита от флуда:", +'opt_sys_afd' => "указывается в секундах; 0 = защиты нет", +'opt_sys_am' => "Смайлики:", +'opt_sys_amd' => "разделяются запятыми (,)", +'opt_sys_at' => "Коррекция временных зон:", +'opt_sys_atd' => "в минутах; т.е.: 180=+3 часа; -120=-2 часа. Текущее время сервера с учетом коррекции:", +'opt_sys_an' => "Формат времени для новостей:", +'opt_sys_and' => "помощь по работе функции", +'opt_sys_ag' => "Включить gzip сжатие:", +'opt_sys_agd' => "Данная опция позволяет существенно сжать выход сгенерированного кода, и тем самым сэкономить на траффике", +'opt_sys_ad' => "Скрывать ссылку на полную новость:", +'opt_sys_add' => "Скрывает ссылку на полную новость, если отсутствует полное описание", +'opt_sys_cch' => "Настройки комментариев", +'opt_sys_ct' => "Формат времени для комментариев:", +'opt_sys_dch' => "Оптимизация запросов к базе данных", +'opt_sys_dc' => "Включить ЧПУ:", +'opt_sys_dcd' => "Eсли 'Да', то ссылки на сайте будут форсироваться в виде псевдо URL, которые улучшают визуальное восприятие ссылки. Например http://site.ru/имя страницы.html", +'opt_sys_df' => "Разрешить фиксацию новостей:", +'opt_sys_dfd' => "Да - при добавлении, редактировании новости ее можно фиксировать", +'opt_sys_dk' => "Включить календарь:", +'opt_sys_dkd' => "Да - добавляет один запрос к базе
Нет - отключает вывод календаря", +'opt_sys_da' => "Включить вывод архивов:", +'opt_sys_dad' => "Да - добавляет один запрос к базе
Нет - отключает вывод архивов", +'opt_sys_uch' => "Настройки пользователей", +'opt_sys_ur' => "Включить поддержку регистрации и авторизации на сайте:", +'opt_sys_urd' => "Отключение регистрации позволяет сэкономить два запроса к базе данных", +'opt_sys_ut' => "Способ регистрации на сайте:", +'opt_sys_utd' => "При включении упрощенной системы регистрации не будет отсылаться письмо с активацией аккаунта", +'opt_sys_um' => "Максимальное количество зарегистрированных пользователей:", +'opt_sys_umd' => "0 если ограничений нет", +'opt_sys_ud' => "Автоматическое удаление зарегистрированных пользователей:", +'opt_sys_udd' => "Количество дней, через которое удалять пользователя если он не посещал сайт 0 = ограничений нет", +'opt_sys_ich' => "Настройка работы с изображениями", +'opt_sys_iw' => "Разрешить наложение водяных знаков:", +'opt_sys_iwd' => "При загрузке или копировании картинки на сервер, на нее будет наложен водяной знак", +'opt_sys_im' => "Минимальный размер для накладывания водяного знака:", +'opt_sys_imd' => "Минимальный размер любой из сторон изображения, до которого водяной знак накладываться не будет", +'opt_sys_ia' => "Размер уменьшенной копии загруженного изображения:", +'opt_sys_iad' => "Существует две возможности использования данной настройки:

Первая: Вы задаете максимальный размер в пикселях любой из сторон загружаемой картинки при превышении которого будет создаваться уменьшенная копия. Например: 400

Вторая: Вы задаете ширину и высоту уменьшенной копии изображения в формате ширина x высота. Например: 100x100", +'opt_sys_ij' => "Качество сжатия .jpg изображения:", +'opt_sys_ijd' => "Качество сжатия JPEG картинки при копировании на сервер", + +'opt_sys_yes' => "Да", +'opt_sys_no' => "Нет", +'opt_sys_reg' => "Упрощенный", +'opt_sys_reg_1' => "Расширенный", + +'word_head' => "Фильтр слов", +'word_error' => "Ошибка !!!", +'word_word' => "Введите слово", +'word_del' => "удалить", +'word_ar' => "Фильтр для данного слова уже назначен!!!", +'word_nof' => "Фильтр не назначен", +'word_rep' => "заменить на", +'word_blank' => "Заменяемое слово не может быть пустым", +'word_new' => "Добавление нового слова в фильтр", +'word_help' => "Введите слово или фразу, которую необходимо заменить или удалить.", +'word_help_1' => "Введите слово или фразу на которую необходимо заменить. Eсли оставить поле пустым, то слово будет удалено", +'word_red' => "ред.", +'word_empty' => "Список слов для фильтрации пуст", +'word_worte' => "Слова", +'word_lred' => "Заменить на", +'word_ledit' => "Редактировать", +'word_ldel' => "Удалить", +'word_help_2' => "Если Вы хотите, чтобы слово удалялось оставьте поле \"заменить\" пустым. Вы также можете использовать в поле \"заменить\" HTML код, или BB коды.", + +'mail_info' => "Настройка E-Mail сообщения, которое отсылается для активации аккаунта", +'mail_reg_info' => "При написании шаблона для данного сообщения вы можете использовать следующие теги:
{%username%} - имя пользователя желающего зарегистрироваться
{%validationlink%} - ссылка на активацию аккаунта
{%password%} - пароль пользователя, введенный при регистрации", +'mail_info_1' => "Настройка E-Mail сообщения, которое отсылается через форму обратной связи", +'mail_feed_info' => "При написании шаблона для данного сообщения вы можете использовать следующие теги:
{%username_to%} - имя получателя
{%username_from%} - имя отправителя
{%text%} - текст сообщения от пользователя
{%ip%} - IP адрес отправителя", +'mail_info_2' => "Настройка E-Mail сообщения, которое отсылается для восстановления забытого пароля", +'mail_lost_info' => "При написании шаблона для данного сообщения вы можете использовать следующие теги:
{%username%} - имя пользователя
{%lostlink%} - ссылка на генерацию пароля и ссылка на сброс блокировки по IP
{%ip%} - IP адрес отправителя", +'mail_addok' => "Обновление шаблонов завершено", +'mail_addok_1' => "Шаблоны для писем успешно обновлены", + +'static_head' => "Список статических страниц", +'static_title' => "Название:", +'static_descr' => "Описание:", +'static_view' => "Просмотреть страницу на сайте", +'static_templ' => "Текст:", +'static_edit' => "Редактирование страницы", +'static_addok' => "Обновление страницы завершено", +'static_addok_1' => "Статическая страница успешно сохранена", +'static_a' => "Создание новой страницы", +'static_err' => "Ошибка", +'static_err_1' => "Все поля обязательны к заполнению", +'static_del' => "Страница удалена", +'static_del_1' => "Выбранная страница была успешно удалена", +'static_confirm' => "Вы уверены что хотите удалить эту страницу", + +'xfield_error' => "Ошибка модуля", +'xfield_err_1' => "Невозможно сохранить файл", +'xfield_err_2' => "проверьте существование файла и выставленные на него права.", +'xfield_err_3' => "Невозможно загрузить файл", +'xfield_err_4' => "Проверьте существование файла и выставленные на него права на чтение.", +'xfield_err_5' => "Выберите поле, которое хотите удалить!", +'xfield_err_6' => "Вы действительно хотите удалить выбранное поле?", +'xfield_err_7' => "Выберите поле, которое хотите сдвинуть!", +'xfield_err_8' => "Выберите поле, которое хотите редактировать!", +'xfield_err_9' => "Полe с таким названием уже существует!", +'xfield_err_10' => "Если Вы выбираете список, то Вы должны вписать два или более пункта с различным значением!", +'xfield_err_11' => "Введите название и описание поля!", +'xfield_addh' => "Добавить новое", +'xfield_edith' => "Редактировать", +'xfield_fih' => "поле", +'xfield_afield' => "Добавление нового дополнительного поля", + +'index_msge' => "Выход", +'index_exit' => "Вы успешно вышли из системы, войти снова", +'index_errpass' => "Доступ отклонен!", +'index_inf' => "Для входа в административную панель Вам необходимо ввести Ваше имя и пароль.", +'index_denied' => "У вас нет доступа для данного раздела панели управления", + +'func_msg' => "Вернуться назад", + +); + + +//////////// +// Локализация для даты +$langdate = array ( +'January' => "января", +'February' => "февраля", +'March' => "марта", +'April' => "апреля", +'May' => "мая", +'June' => "июня", +'July' => "июля", +'August' => "августа", +'September' => "сентября", +'October' => "октября", +'November' => "ноября", +'December' => "декабря", +'Jan' => "янв", +'Feb' => "фев", +'Mar' => "мар", +'Apr' => "апр", +'Jun' => "июн", +'Jul' => "июл", +'Aug' => "авг", +'Sep' => "сен", +'Oct' => "окт", +'Nov' => "ноя", +'Dec' => "дек", + +'Sunday' => "Воскресенье", +'Monday' => "Понедельник", +'Tuesday' => "Вторник", +'Wednesday' => "Среда", +'Thursday' => "Четверг", +'Friday' => "Пятница", +'Saturday' => "Суббота", + +'Sun' => "Вс", +'Mon' => "Пн", +'Tue' => "Вт", +'Wed' => "Ср", +'Thu' => "Чт", +'Fri' => "Пт", +'Sat' => "Сб", + +); + +@setlocale(LC_ALL, array("ru_RU.CP1251", "ru_SU.CP1251", "ru_RU.KOI8-r", "ru_RU", "russian", "ru_SU", "ru")); +?> \ No newline at end of file diff --git a/language/Russian/adminpanel_repa.lng b/language/Russian/adminpanel_repa.lng new file mode 100644 index 0000000..b938084 --- /dev/null +++ b/language/Russian/adminpanel_repa.lng @@ -0,0 +1,158 @@ + "Административное повышение:", +'repa_st_tot_p' => "Административное понижение:", +'repa_st_repa_off' => "Отключенна репутация:", +'repa_st_freeze' => "Замороженно:", +'repa_adm_msg_lc' => "Административное изменение", +'repa_adm_plus' => "Административное повышение", +'repa_adm_plus_sub' => "Повышение (обнуление если стоит ноль) репутации пользователю администратором, выставьте число на сколько будет повышена репутация при нажатии кнопки \"Автора в плюс..\"", +'repa_adm_sub' => "Понижение (обнуление если стоит ноль) репутации пользователю администратором, выставьте число на сколько будет понижена репутация при нажатии кнопки \"Автора в минус..\"", +'repa_robo_sub' => "Имя выводимое в таблице истории репутации пользователя при понижении или повышении репутации (например \"Робот\")", +'avt_plus' => "Автора в плюс", +'repa_adm_msg' => "Сообщение к понижению", +'repa_adm_plus_msg' => "Сообщение к повышению", +'repa_adm_plus_com' => "Выводимый комментарий к повышению в таблице истории репутации пользователя", +'repa_msgs_adm_st' => "Включение сообщений об административном изменении:", +'repa_msgs_adm_su' => "Если да - при административном повышении или понижении репутации пользователю будет приходить ЛС с информацией о изменении", +'repa_msg_adm_tpl' => "Шаблон сообщения", +'repa_msg_adm_tsu' => "Шаблон получаемого ЛС
{%text%} - Комментарий к удалённому изменению", +'repa_stop_change_min' => "Запретить изменение, если репутация меньше", +'repa_stop_change_min_sub' => "Данная опция позволит заблокировать изменение пользователя, у которого репутация ниже нуля.
Если вы хотите отключить данную опцию, то введите в поле 0", +'repa_stop_change_sub' => "Время (дни) через которое пользователь сможет снова изменить репутацию тому же пользователю.
Так же в промежутке этого времени пользовать сможет отредактирвоать своё изменение пользователю (изменить комментарий или отношение)", +'repa_msg_top' => "Сообщение", +'repa_ban_desc' => "Шаблон сообщения о блокировке", +'repa_ban_desc_sub' => "Данный текст будет выводится заблокированному пользователю как причина блокировки на сайте", +'repa_msg_changed' => "Вам изменили репутацию", +'repa_type0' => "Стандартный", +'repa_type1' => "Расширенный", +'repa_type2' => "Подробный", +'opt_type_repa' => "Выбирите тип вывода репутации", +'opt_type_repa_sub' => "Данная опция позволит изменить вид вывода репутации у пользователей.
Стандартный - вывод репутации вида: - 10 +
Расширенный - вывод репутации вида: - (13|3) +
Подробный - вывод репутации вида: - (13|10|3) +", +'repa_msgs_del_st' => "Включение сообщений об удалении репутации:", +'repa_msgs_del_su' => "Если да - при удалении репутации пользователю придёт ЛС с информацией о удалении", +'repa_msg_del_tpl' => "Шаблон сообщения", +'repa_msg_del_tsu' => "Шаблон получаемого ЛС
{%kto%} - Автор
{%ot_kogo%} - Чьё изменение было удалено
{%text%} - Комментарий к удалённому изменению", +'repa_logs' => "Логи удаления", +'repa_logs_sub' => "Логи удаления репутации у пользователей", +'repa_skins' => "Выключить AJAX в данном шаблоне? При отключении - изменять репутацию можно будет на отдельной странице, а не на той же.", +'repa_skins_opt' => "Поддержка AJAX в шаблонах", +'repa_ban' => "Блокировка пользователей", +'repa_ban_sub' => "При достижении X репутации пользователь будет забанен на X дней", +'repa_ban_num' => "Репутация", +'repa_ban_num_sub' => "Выбирите при достижении какой репутации пользователь будет заблокирован", +'repa_ban_days' => "Кол-во дней", +'repa_ban_days_sub' => "Выбирите на сколько дней будет заблокирован пользователь", +'opt_repa_news' => "Вывод в новостях", +'opt_repa_news_sub' => "Вывод репутации автора статьи/новости в короткой и полной версии новости", +'opt_repa' => "Репутация", +'opt_repa_sub' => "Управление модулем
© Inrus & ShapeShifter", +'repa_value' => "Репутация:", +'repa_on' => "Включена", +'repa_off' => "Выключена", +'repa_stats' => "Статистика модуля", +'repa_st_on' => "Включен", +'repa_st_off' => "Выключен", +'repa_st_vr' => "Версия модуля:", +'repa_st_st' => "Статус модуля:", +'repa_st_ca' => "Изменений репутации:", +'repa_st_in' => "Положительных:", +'repa_st_es' => "Отрицательных:", +'repa_options' => "Опции", +'repa_m_opts' => "Настройки системы репутации", +'repa_m_sub' => "Конфигурация системы", +'repa_control' => "История изменений", +'repa_con_sub' => "Контроль за изменениями репутации", +'repa_info' => "Информация", +'repa_i_sb' => "Информация о модуле", +'repa_opts' => "Основные настройки", +'repa_h_op' => "Настройки вывода", +'repa_cts' => "Настройка контроля", +'repa_mop' => "Настройка сообщений", +'repa_grs' => "Настройка групп", +'repa_blp' => "Черный период", +'repa_stop_change' => "Запрет на повторое изменение", +'repa_stp' => "Настройка страницы статистики", +'opt_general_repa' => "Настройка параметров модуля (используйте навигацию для доступа к разделам)", +'opt_gen_st' => "Статус системы:", +'opt_gen_st_sub' => "Включение/Выключение системы рейтинга пользователей на сайте", +'opt_gen_min_sub' => "Установка минимального значения репутации", +'opt_gen_max_sub' => "Установка максимального значения репутации", +'opt_gen_comms' => "Комментарии", +'opt_gen_symb' => "Максимальное количество символов в комментариях", +'opt_gen_symb_min' => "Минимальное количество символов в комментариях", +'opt_gen_page' => "Вывод ссылки на страницу с изменением", +'opt_gen_page_sub' => "Добавления ссылки к комментарию с какой страницы было изменение", +'opt_gen_break' => "Автоматическая разбивка длинных слов:", +'opt_site_res' => "Количество выводимых результатов на сайте:", +'opt_cp_res' => "Количество выводимых результатов в КП:", +'opt_gen_c_sub' => "Включение/Выключение комментариев к изменению репутации пользователя", +'opt_gen_symb_sub' => "Укажите максимальное количество символов, которое может использовать пользватель при написании комментариев", +'opt_gen_symb_sub_min' => "Укажите минимальное количество символов, которое может использовать пользватель при написании комментариев", +'opt_gen_break_sub' => "В случае превышения заданного числа символов", +'opt_comm_st_on' => "Включены", +'opt_comm_st_off' => "Выключены", +'opt_site_sub' => "Количество выводимых на одну страницу результатов истории репутации на сайте", +'opt_cp_sub' => "Количество выводимых на одну страницу результатов истории репутации в админке", +'repa_adm' => "Административное понижение", +'repa_robot' => "Имя робота", +'repa_replace' => "Замена комментария", +'repa_adm_com' => "Выводимый комментарий к понижению в таблице истории репутации пользователя", +'repa_adm_rpm' => "Если будет удалено только сообщение из строки статистикаи изменений, то комментарий будет заменен этим сообщением", +'repa_msgs_st' => "Включение сообщений:", +'repa_msgs_su' => "Если да - при изменении репутации пользователю будет приходить ЛС с информацией о изменении", +'repa_msg_tpl' => "Шаблон сообщения", +'repa_msg_tsu' => "Шаблон получаемого ЛС
{%kto%} - Автор
{%what%} - повысил/понизил
{%text%} - комментарий к изменению", +'repa_rules' => "Вывод правил при изменении", +'repa_rules_su' => "На странице с формой изменений репутации будут выводится правила", +'repa_rules_tpl' => "Правила", +'repa_rules_tpl_su' => "Введите список правил.
В форме можно использовать bbcode.", +'repa_yes' => "Да", +'repa_no' => "Нет", +'repa_gr_fr' => "Количество допустимых изменений репутации совершаемых группой ", +'repa_gr_sc' => "Возможность модерировать репутацию с сайта другим пользователям", +'bl_period' => "Черный период", +'bl_per_su' => "Количство дней, которое пользователь не сможет изменять другим репутацию, начиная с первой секунды его регистрации", +'repa_st_page' => "Включение страцницы:", +'repa_st_p_sub' => "Если да - будет включена страница со списком пользователей с наивысшей репутацией
Страница будет доступна по этим ссылкам:
", +'repa_page_kol' => "Количество результатов", +'page_kolvo' => "Количество пользователей, которое нужно выводить на страницу", +'off_alt' => "Если страница выключена, будет выведено это сообщение", +'repa_save' => "Сохранить", +'repa_msg_chd' => "Комментарий изменен", +'repa_go_back' => "Вернуться назад", +'repa_cntrl' => "Контроль над изменениями репутации", +'repa_comm_ed' => "Редактирование комментария:", +'repa_done' => "Готово", +'repa_done_minus_1' => "Изменение репутации пользователя", +'repa_done_minus_2' => "успешно изменено! Его репутация ушла до", +'repa_done_minus_2' => "успешно изменено!", +'delcom' => "Удаление комментария", +'deleted' => "Комментарий успешно удален", +'opt_saved' => "Настройки успешно сохранены!", +'avt_minus' => "Автора в минус", +'full_del' => "Удалить полностью", +'delcom_done' => "Удалить комментарий", +'edit_this' => "Изменить комментарий", +'del_quest' => "Вы действительно хотите удалить это изменение?", +'repa_nothing' => "Изменений репутации не было.", +'repa_pages' => "Страницы:", +'repa_first_p' => "к начальной странице", +'repa_last_p' => "к последней странице", +'repa_how_pl' => "Положительно", +'repa_how_mn' => "Отрицательно", +'repa_how_tm' => "Административное наказание", +'repa_who' => "Кто (Автор)", +'repa_to' => "Кому (Адресат)", +'repa_supp' => "Отношение", +'repa_commst' => "Комментарий", +'r_mod_name' => "Репутация пользователей", +'r_total' => "Всего изменений:", +'repa_do_freeze' => "Заморозить репутацию", +'freeze_info' => "Если стоит галочка, у этого пользователя не будет права менять репутацию другим", + +); + +?> \ No newline at end of file diff --git a/language/Russian/chat.lng b/language/Russian/chat.lng new file mode 100644 index 0000000..28458cc --- /dev/null +++ b/language/Russian/chat.lng @@ -0,0 +1,52 @@ + "windows-1251", + +'mchat' => "DLE mChat", +'mchatc' => "Управление и настройка Мини-чата.", +'mc_conf' => "Настройка Мини-чата", +'mc_trunс' => "Чистка Мини-чата", +'mc_smiles' => "Смайлики", +'mc_colornik' => "Подсветка ника", +'mc_colornikc' => "Включить подсветку ника администратор, редактора, журналиста
(настройка цвета во вкладке \"Color Nik\")", +'mc_showdate' => "Показывать дату", +'mc_showdatec' => "Показывать дату в окне чата", +'mc_limit' => "Количество сообщений в истории сообщений", +'mc_limitc' => "Укажите сколько сообщений выводить в истории сообщений", +'mc_limitb' => "Количество сообщений в блоке", +'mc_limitbc' => "Укажите сколько сообщений выводить в окне чата", +'mc_guest' => "Разрешит гостю добавлять сообщения", +'mc_guestc' => "Если 'Нет', то гости не смогут добавлять сообщения. Если 'Да', тогда гости смогут добавлять сообщения.", +'mc_timestamp' => "Формат времени", +'mc_timestampa' => "Формат времени в админке", +'mc_refresh' => "Авто обновление окна", +'mc_refreshc' => "в секундах, 0 - не ставить", +'mc_dbrows' => "Автоматическая чистка БД mСhat", +'mc_dbrowsc' => "количество записей хранимых в БД, 0 = хранить все записи", +'mc_spam' => "Защита от флуда", +'mc_spamc' => "указывается в секундах; 0 = защиты нет", +'mc_sc' => "Количество колонок со смайликами", +'mc_scc' => "Укажите количество колонок со смайликами", +'mc_trun' => "Вы уверены, что хотите очистить чат (все сообщения будут удалены)", +'mc_addmssa' => "Добавить сообщения от админа", +'mc_addmssok' => "Сообщение успешно добавлено", +'mc_main' => "Список сообщений", +'mc_mess_page' => "Cообщений на страницу:", +'mc_stat' => "Показано сообщений:", +'mc_stat1' => "Всего сообщений в базе данных:", +'mc_mess_delok' => "Все выбранные Вами сообщения успешно удалены!", +'mc_mess_notok' => "Удаление сообщений (найдены ошибки!!!)", +'mc_mess_notok_1' => "сообщений удалены", +'mc_color1' => "Для Администраторов", +'mc_color2' => "Для Главныех редакторов", +'mc_color3' => "Для Журналистов", +'mc_version' => "Мини-чата версия", +'mc_ver_you' => "Ваша текущая версия:", +'mc_ver_full' => "Последняя версия:", +'mc_load_verfull' => "Cкачать последнию версию!", +'mc_smail' => "Путь к смайлам", +'mc_smailb' => "Путь к смайлам по умолчанию это папка 'engine/modules/mchat/smiles'", +); +?> diff --git a/language/Russian/friends.lng b/language/Russian/friends.lng new file mode 100644 index 0000000..e00070a --- /dev/null +++ b/language/Russian/friends.lng @@ -0,0 +1,16 @@ + "Вы не можете предложить этому пользователю дружбу", +'invite' => "Предложение дружбы", +'is_friend' => "Пользователь которому вы предлагаете дружбу, присутствует в списке ваших друзей", +'friend_send' => "Предложение дружбы отправлено", +'friend_subj' => "Предложение дружбы", +'friend_act' => "Действия успешно выполнено", +'err_act' => "Не возможно выполнить действие", + +); + + +?> \ No newline at end of file diff --git a/language/Russian/help.lng b/language/Russian/help.lng new file mode 100644 index 0000000..444b4a8 --- /dev/null +++ b/language/Russian/help.lng @@ -0,0 +1,62 @@ + + + + + +
+Шаблоны используются для легкого изменения отображения новостей. Вы можете изменять различные части шаблона, которые используются для различных частей отображения новостей. Например, часть шаблона "Краткое содержание" используется, чтобы изменить вид активных новостей, "Статья целиком", чтобы изменить вид полной статьи, "Комментарий", чтобы изменить вид комментариев и т.д.

+При редактировании частей шаблона Вы можете использовать HTML, чтобы изменить различные структуры и т.д. Также Вы будете должны добавить некоторые специальные обозначения в ваших шаблонах, чтобы определить место, где будет показано название новости, имя автора, дата и т.д. Каждой части шаблона соответствует определенное обозначение.
+Значения переменных можно посмотреть на странице редактирования шаблонов при щелчке на названии части шаблона. Например {title} будет выводить название статьи, а {author} автора статьи и т.д.

+Вы можете использовать несколько различных шаблонов. +HTML; + +$help_sections['date'] = << + + + + +
+В строке формата распознаются следующие символы: + +HTML; + +?> \ No newline at end of file diff --git a/language/Russian/img.lng b/language/Russian/img.lng new file mode 100644 index 0000000..df3475f --- /dev/null +++ b/language/Russian/img.lng @@ -0,0 +1,21 @@ + "windows-1251", + +'img_heading' => "Настройки картинки", + +'img_off' => "Модуль выключен", +'img_gallery' => "Режим галереи включен", +'img_server' => "Разрешить загрузку с сервера", +'img_width' => "Ширина картинки", +'img_taglimit' => "Количество выводимых тегами картинок в новости", +'img_doeditcfg' => "Сохранить настройки", +'opt_conok' => "Настройки сохранены", +'opt_conok_1' => "Настройки сохранены успешно", + +'db_prev' => "Вернуться назад", +'func_msg' => "Вернуться назад", +); +?> diff --git a/language/Russian/rating.lng b/language/Russian/rating.lng new file mode 100644 index 0000000..025196c --- /dev/null +++ b/language/Russian/rating.lng @@ -0,0 +1,39 @@ + "windows-1251", +'options_p' => "Настройка модуля", +'opt_denied' => "Доступ отклонен", +'info' => "Информация", +'desc_about_p' => "Подробная информация о модуле", +'desc_options_p'=> "Управление общими функциями модуля", +'navig' => "Навигация админцентра модуля подсказок", + +'about' => "Информация о модуле", +'name_mod' => "Название", +'ver_mod' => "Версия модуля", +'autor' => "Модифицировал", +'site' => "Сайт", +'admin' => "Не учитывать статус Администратора и Гл.редактора", +'admin_i' => "Если включено, то рейтинг Администратора и Гл.Редактора считается как у обычных пользователей, иначе максимален(на одну ступень ниже у Гл.Редактора).", +'txt' => "Включить текстовые статусы", +'txt_i' => "Если да, то будут отображаться текстовые статусы, иначе только статус-картинки.", +'yes' => "Да", +'no' => "Нет", +'suc_save_1' => "Настройки системы были успешно сохранены", +'suc_save' => "Настройки сохранены", +'save' => "Сохранить", +'func_msg' => "Вернуться назад", +'save_conf' => "Настройки успешно сохранены!", + +'upd_01' => "вы используете устаревшую версию модуля, рекомендуется выполнить обновление", +'upd_02' => "вы используете актуальную версию модуля, следите за обновлениями", +'upd_03' => "не удалось подключится к удаленному серверу, повторите попытку немного позднее", +'upd_04' => "вы используете неопределенную версию модуля, установите последнюю версию", + +'last_ver' => "Последняя версия", +'error_upd' => "Произошла ошибка подключения к нашему серверу. Приносим свои извинения, попробуйте пожалуйста позже.", + +); +?> \ No newline at end of file diff --git a/language/Russian/table.lng b/language/Russian/table.lng new file mode 100644 index 0000000..4176bf9 --- /dev/null +++ b/language/Russian/table.lng @@ -0,0 +1,131 @@ + 'Главное меню', +'main_control' => 'Редактировать заказы', +'main_control_descr' => 'Управление заказами на сайте', +'main_options' => 'Настройка модуля', +'main_options_descr' => 'Настройка основных параметров модуля', + +'etitle' => 'Редактирование заказа', +'edit_head' => 'Редактирование заказов', +'orders_list' => 'Список заказов на сайте', +'orders_advanced_search' => 'Расширенный поиск заказов', +'edit_stat' => 'Показано заказов:', +'edit_stat_1' => 'Всего найдено заказов в базе данных:', +'edit_search_orderss' => 'Поиск по заказам:', +'edit_page' => 'Заказов на страницу:', +'search_by_date' => 'Дата заказа:', +'search_by_status' => 'Статус заказов:', +'orders_order' => 'Порядок сортировки заказов', +'edit_noorders' => 'Выбранный вами заказ не найден!', +'edit_act' => 'Редактировать данный заказ', +'edit_date' => 'Дата', +'edit_author' => 'Автор', +'edit_title' => 'Заголовок', +'edit_status' => 'Статус', +'edit_status1' => 'Статус:', +'edit_cat' => 'Категория', +'cat_in_none' => '- Без категории -', +'orders_status_all' => 'Все заказы', +'edit_status_0' => 'Ожидается', +'edit_status_1' => 'Принято', +'edit_status_2' => 'Отклонено', +'edit_status_3' => 'Выполнено', +'edit_runame' => 'Название (Рус.):', +'edit_enname' => 'Оригинальное название:', +'edit_category' => 'Тип файла:', +'edit_fileyear' => 'Год издания:', +'edit_link' => 'Сообщение:', +'edit_answer' => 'Примечание:
Причина ошибки заказа.
*Каждую ссылку, с новой строчки!', +'edit_cdel' => 'Вы действительно хотите удалить выбранный заказ?', +'edit_delok' => 'Заказ удален', +'edit_delok_1' => 'Заказ был успешно удален.', +'edit_allerr' => 'Заказ не может быть обнаружен, или возникла какая-то проблема с базой данных', +'addorders_alert' => 'У вашего заказа должен быть хотя бы заголовок', +'btn_save' => 'Сохранить', +'go_page_orders' => 'В стол заказов', +'mass_head' => "Удаление заказов", +'mass_confirm' => "Вы уверены, что хотите удалить выбранные", +'mass_confirm_1' => "заказы?", +'mass_denied' => "Выберите заказы", +'mass_error' => "Ошибка!!!", +'mass_no' => "Нет", +'mass_yes' => "Да", +'mass_sel' => "Выберите заказы", +'mass_delok' => "Все выбранные Вами заказы успешно удалены!", +'mass_notok' => "Удаление заказов (найдены ошибки!!!)", +'mass_i' => "из", +'mass_notok_1' => "заказов удалены", + +'opt_list' => 'Общая конфигурация', +'opt_tab_offline' => 'Выключить модуль "Стол Заказов:"', +'opt_tab_offlined' => 'Перевести "Стол Заказов" в состояние offline, для проведения технических работ', +'opt_tab_category' => 'Категории', +'opt_tab_categoryd' => 'разделяются запятыми (,)', +'opt_tab_timeweek' => 'Период, через который разрешено добавлять следующий заказ', +'opt_tab_timeweekd' => 'указывается в днях; 0 = защиты нет', +'opt_tab_auto_wrap' => 'Автоматическая разбивка длинных слов в сообщении:', +'opt_tab_auto_wrapd' => 'в случае превышения заданного числа символов', +'opt_tab_orders_number' => 'Количество заказов на страницу:', +'opt_tab_orders_numberd' => 'Количество заказов, которое будет выводиться на страницу', +'opt_tab_msgs' => 'Отсылать в ПС/E-Mail уведомление о добавлении заказа:', +'opt_tab_msgsd' => 'Если "Да", при добавлении заказа на сайте, в ПС/E-Mail указанных в настройках будет отправлено соответствующее уведомление.', +'opt_tab_msgs1' => 'Отсылать в ПС/E-Mail уведомление о состоянии заказа:', +'opt_tab_msgsd1' => 'Если "Да", при изменении состояния заказа на сайте, на ПС/E-Mail указанный в профиле пользователя будет отправлено соответствующее уведомление о состоянии заказа.', +'opt_tab_msgs_type' => 'Метод отправки уведомлений:', +'opt_tab_msgs_typed' => 'Если "ПС на сайте", при добавлении заказа или его смене состояния, на ЛС будет отправлено соответствующее уведомление, в противном случае сообщение будет отправлено на E-Mail указанный в профиле пользователя.', +'opt_tab_msgs_type1' => 'ПС на сайте', +'opt_tab_msgs_type2' => 'E-mail', +'opt_tab_an' => 'Формат времени для заказов:', +'opt_tab_msort' => 'Порядок сортировки заказов', +'opt_tab_msortd' => 'Выберите порядок сортировки заказов', +'opt_tab_toc' => 'Включить вывод самых последних заказов на сайте', +'opt_tab_tocd' => 'Отключение данного модуля позволяет сэкономить 1 запрос к базе данных', +'opt_tab_toporders_number' => 'Количество заказов в ТОП, на страницу:', +'opt_tab_toporders_numberd' => 'Укажите сколько заказов выводить в ТОП:', +'opt_tab_grouplevel' => 'Отправлять уведомление о добавлении заказа, пользователям следующей группы:', +'opt_tab_groupleveld' => 'Выберите группу пользователей, которым хотите, что б приходило уведомление о добавлении заказа на сайте.', +'opt_tab_mail_info1' => 'Шаблон ПС/E-Mail сообщения', +'opt_tab_mail_info2' => 'Настройка шаблона ПС/E-Mail сообщения, которое отсылается при добавлении нового заказа на сайте', +'opt_tab_mail_info3' => 'Настройка шаблона ПС/E-Mail сообщения, которое отсылается при смене состояния заказа на сайте', +'mail_pm_info1' => 'При написании шаблона для данного сообщения вы можете использовать следующие теги:
{%username_from%} - имя пользователя добавивший заказ
{%category%} - категория, в которую добавлен заказ
{%text%} - краткая информация о заказе
{%date%} - дата добавления заказа
{%ip%} - IP адрес отправителя', +'mail_pm_info2' => 'При написании шаблона для данного сообщения вы можете использовать следующие теги:
{%username%} - имя получателя
{%username_editor%} - имя пользователя, обработавшего заказ
{%date%} - дата получения сообщения
{%status%} - статус заказа', +'key_info' => 'Код скрипта:', +'key_info1' => 'Внимание! Здесь введите код, полученный при покупке скрипта. В противном случае возможны проблемы при обращении в тех.поддержку.', +'key_trial' => 'Неверный формат лицензионного кода. Дальнейшая работа невозможна.', +'edit_denied' => 'У вас нет прав для редактирования данного заказа', +'trial_limit' => 'Были превышены лимиты модуля. Дальнейшая работа невозможна.', +'not_user_id' => 'Для отправки ПС пользователю на сайте, user id не найден', +'opt_btn_save' => 'Сохранить настройки', + +'offline' => 'Стол Заказов временно закрыт.', +'description' => 'Стол заказов', +'description2' => 'Добавление заказа', +'not_orders' => 'На данный момент заказов нет.', +'edit' => '[Редактировать]', +'download' => '[Скачать]', +'err_name' => '
  • Вы не указали требуемое название заказа
  • ', +'err_category' => '
  • Вы не указали категорию
  • ', +'err_year' => '
  • Вы не указали "Год издания"
  • ', +'err_year_type' => '
  • "Год издания " должен быть только из цифр
  • ', +'err_link' => '
  • Вы не указали "Ссылку на скачивание"
  • ', +'orders_err_name' => 'Слишком длинное "Название (Рус.)",', +'orders_err_enname' => 'Слишком длинное "Оригинальное название (Eng.)",', +'orders_err_category' => 'Слишком длинная категория,', +'orders_err_year' => 'Слишком длинный "Год издания",', +'orders_err_year_type' => '"Год издания" должен быть только из цифр', +'not_logged' => 'Уважаемый посетитель, Вы зашли на сайт как незарегистрированный пользователь. Мы рекомендуем Вам зарегистрироваться либо зайти на сайт под своим именем.', +'one_orders' => 'Уважаемый посетитель, Вы уже сделали один заказ!
    Ждите выполнения заказа, либо можете заказать на следующий день.
    Вернуться назад', +'cause0' => '

    Причина: ', +'cause1' => '

    Причина: не указана.', +'downloadd' => '

    Download:
    ', + +'msgs_subject' => 'Новый заказ', +'msgs_subject_usr' => 'Смена состояния заказа', +'msg_user_from' => 'Стол-Заказов', + +); + +?> \ No newline at end of file diff --git a/language/Russian/website.lng b/language/Russian/website.lng new file mode 100644 index 0000000..1dc25d5 --- /dev/null +++ b/language/Russian/website.lng @@ -0,0 +1,623 @@ + "windows-1251", +'dle_spam_agree' => "Вы действительно считаете выбранное сообщение спамом?", +'pm_spamok' => "Сообщение о СПАМе отправлено администрации. ", +'pm_err_spam' => "Уведомление о СПАМе не было отослано администрации. ", +'online_notusers' => "Отсутствуют.", 'online_notbots' => "Отсутствуют.", +'online_notlusers' => "Отсутствуют.", +'online_notlbots' => "Отсутствуют.", +'online_was' => "Был: ", +'online_back' => "назад", +'online_os' => "ОС: ", +'online_browser' => "Браузер: ", +'online_country' => "Страна: ", +'online_city' => "Город: ", +'online_group' => "В группе: ", +'online_paddcomments' => "Добавляет комментарий в: ", +'online_preadnews' => "Читает новость: ", +'online_pincategory' => "Находится в разделе: ", +'online_pposin' => "Находится в: ", +'online_pmainpage' => "Находится на главной странице.", +'online_lpaddcomments' => "Добавлял комментарий в: ", +'online_lpreadnews' => "Читал новость: ", +'online_lpincategory' => "Находился в разделе: ", +'online_lpposin' => "Находился в: ", 'online_lpmainpage' => "Находился на главной странице.", +'online_robots' => " Роботы", +'online_stamp01' => "секунду", +'online_stamp02' => "секунды", +'online_stamp03' => "секунд", +'online_stamp11' => "минуту", +'online_stamp12' => "минуты", +'online_stamp13' => "минут", +'online_stamp21' => "час", +'online_stamp22' => "часа", +'online_stamp23' => "часов", +'online_stamp31' => "день", +'online_stamp32' => "дня", +'online_stamp33' => "дней", +'online_stamp41' => "неделю", +'online_stamp42' => "недели", +'online_stamp43' => "недель", +'online_stamp51' => "месяц", +'online_stamp52' => "месяца", +'online_stamp53' => "месяцев", +'online_stamp61' => "год", +'online_stamp62' => "года", +'online_stamp63' => "лет", +'online_stamp71' => "век", +'online_stamp72' => "века", +'online_stamp73' => "веков", +'wysiwyg_language' => "ru", +'loginza_err1' => "Произошла ошибка при подключении к Loginza", +'loginza_err2' => "Нет идентификатора пользователя.", +'loginza_err3' => "Вы уже зарегистрированы с почтовым ящиком указанным в профиле OpenID.", +'comr_self' => "За себя нельзя", +'comr_del' => "Будет удалено", +'comr_hidden' => "Комментарий скрыт в связи с низким рейтингом", +'comr_hide' => "Будет скрыто", +'comr_already' => "Вы уже проголосовали", +'comr_login' => "Авторизуйтесь", + +'add_ok_ok' => "Новость отредактирована", +'add_ok_1_1' => "Ваша новость успешно отредактирована.", +'add_ok_2_1' => "Ваша новость была успешно отредактирована. После проверки администратором она будет опубликована на сайте.", +'add_ok_3_1' => "Ваша новость была успешно отредактирована. Однако, в связи с тем, что Вы можете публиковать новости без модерации не во все разделы, Ваша новость будет опубликована только после проверки администратором сайта.", + +// 8.3 +'lost_password' => "Для восстановления пароля на сайте проследуйте по ссылке:", +'lost_ip' => "Для сброса блокировки по IP на сайте проследуйте по ссылке:", +'lost_clear_ip' => "Блокировка по IP снята", +'lost_clear_ip_1' => "С пользователя {username} блокировка по IP успешно снята.", +'lost_mfg' => "С уважением,\nАдминистрация сайта", +'c_subscribe' => "Подписаться на комментарии", +'admin' => "Администратор", +'news_err_37' => "Сообщение содержит недопустимый к публикации текст.", +'news_err_38' => "Информация о себе или ваша подпись содержит недопустимый к публикации текст.", +'news_err_39' => "Ваша новость содержит недопустимый к публикации текст.", +'unsubscribe_ok' => "Вы были успешно отписаны от комментариев выбранной новости.", +'unsubscribe_err' => "Вы не подписаны на комментарии данной новости.", +'nav_trennen' => "...", +// 8.3 + +// 8.2 +'thumb_playtitle' => "Просмотр слайдшоу (пробел)", +'thumb_pausetitle' => "Пауза", +'thumb_previoustitle' => "Предыдущее изображение", +'thumb_nexttitle' => "Следующее изображение", +'thumb_movetitle' => "Переместить", +'thumb_closetitle' => "Закрыть (Esc)", +'nl_info_2' => "Пользователь", +'news_info_6' => "Комментировать новости на сайте возможно только в течении {days} дней со дня публикации.", +'search_s_go' => "перейти на страницу", +// 8.2 + +// 8.0 +'feed_err_8' => "

  • Вы не можете отправлять данному пользователю E-Mail сообщений.
  • ", +'bb_flash' => "Введите размеры флеш ролика (ширина, высота)", +'bb_flash_url' => "Введите ссылку на флеш ролик", +'inset_flash_link' => "вставить флеш", +// 8.0 + +// 7.5 +'news_err_32' => "
  • Администратором сайта была запрещена загрузка аватаров для вашей группы.
  • ", +'not_allowed_sig' => "
  • Слишком длинная подпись!
  • ", +'news_err_33' => "Сообщение содержит недопустимые к публикации теги.", +'news_err_34' => "Информация о себе или ваша подпись содержит недопустимые к публикации теги.", +'tags_count' => "Найдено новостей:", +'news_err_35' => "
  • Полное имя содержит недопустимые к публикации символы!
  • ", +'news_err_36' => "
  • Место жительства содержит недопустимые к публикации символы!
  • ", +// 7.5 + +// 7.3 +'reg_err_30' => "Имя пользователя не может быть пустым!", +'reg_err_31' => "Длина пароля должна быть не менее 6 символов!", +'reg_err_32' => "Оба введенных пароля должны быть идентичны!", +'reg_err_33' => "Введен неверный E-Mail адрес!", +'rss_user' => "Отслеживание всех новостей пользователя по RSS", +'show_archive' => "Показать весь архив", +'no_message' => "На данный момент у вас нет персональных сообщений", +'spoiler_title' => "Показать / Скрыть текст", +// 7.3 + +// 7.2 +'news_info_2' => "Администратором сайта вам было запрещено оставлять комментарии на данном сайте до {date}. Это полностью автоматический процесс блокировки и от вас не требуется ничего делать для его ускорения или прекращения.", +'news_info_3' => "Администратором сайта вам было запрещено оставлять комментарии на данном сайте.", +'news_info_4' => "Администратором сайта вам было запрещено добавлять новости на данном сайте до {date}. Это полностью автоматический процесс блокировки и от вас не требуется ничего делать для его ускорения или прекращения.", +'news_info_5' => "Администратором сайта вам было запрещено добавлять новости на данном сайте.", +'loading' => "Загрузка...", +'mail_pm' => "Новое персональное сообщение", +'sort_main' => "Сортировать новости по:", +'sort_by_date' => "дата", +'sort_by_rating' => "рейтинг", +'sort_by_read' => "просмотры", +'sort_by_title' => "алфавит", +'sort_by_comm' => "комментарии", +'rules_accept' => "Принимаю", +'rules_decline' => "Не принимаю", +'reg_err_21' => "
  • Администратором было запрещено использовать данный логин для регистрации{descr}
  • ", +'reg_err_22' => ", по причине: {descr}", +'reg_err_23' => "
  • Администратором было запрещено использовать данный E-Mail для регистрации{descr}
  • ", +'reason' => "Указать причину редактирования:", +'tag_cloud' => "Облако тегов", +'last_news' => "Последние новости", +'all_tags' => "Показать все теги", +// 7.2 + +// 7.0 +'sig_not_allowed' => "Не заполняйте данное поле, т.к. для вашей группы запрещено использование подписи в комментариях.", +'related_not_found' => "Похожих новостей не найдено.", +'add_err_9' => "Администратором сайта был установлен лимит на максимальное количество новостей, допустимых к ожиданию на модерацию. На данный момент на сайт добавлено максимальное количество новостей, которые ожидают проверки администратором. Попробуйте добавить вашу новость немного позднее.", +// 7.0 + +// 6.7 +'news_delnews' => "Удалить новость", +'news_del_ok' => "Выбранная Вами новость была успешно удалена.", +// 6.7 + +// 6.5 +'time_heute' => "Сегодня", +'time_gestern' => "Вчера", +'thumb_expandtitle' => "Развернуть до полного размера", +'thumb_restore' => "Кликните для закрытия картинки, нажмите и удерживайте для перемещения", +'thumb_focustitle' => "Сфокусировать", +'thumb_cancel' => "Нажмите для отмены", +'all_user_news' => "Просмотреть все публикации", +'show_user_news' => "Все публикации пользователя", +'menu_fnews' => "Найти все публикации", +'reg_next' => "Продолжить регистрацию на сайте", +'xf_not_notig' => "необязательно", +// 6.5 + +// 6.3 +'no_limit' => "неограниченно", +'title_catalog' => "Каталог", +// 6.3 + +// 6.2 +'s_fsrelate' => "Наиболее подходящие", +// 6.2 + +// 6.0 +'reload_code' => "обновить, если не виден код", +'news_err_31' => "Ваш комментарий добавлен в базу. После проверки комментария администратором, он будет опубликован на сайте.", +'bb_t_font' => "Шрифт", +'bb_t_size' => "Размер", +// 6.0 + +// 5.7 +'mail_news' => "Новая новость на модерации", +'mail_comments' => "Новый комментарий на сайте", +'bb_t_leech' => "Вставка защищенной ссылки", +// 5.7 + +// 5.5 +'s_ffullstart' => "Расширенный поиск", +'user_logged' => "Вы успешно авторизованы на сайте.", +// 5.5 + +// 5.3 +'bb_t_emo' => "Вставка смайликов", +'pm_to' => "Получатель", +'approve' => "(Ожидает проверки администратором)", +'ip_info' => "Информация о IP адресе", +'ip_tools' => "Поиск других пользователей", +'ip_ban' => "Забанить адрес", +// 5.3 + +// 5.2 +'bb_t_code' => "Вставка исходного кода", +'title_last' => "Комментарии", +'title_lost' => "Восстановление пароля", +'title_search' => "Поиск по сайту", +'bb_t_video' => "Вставка видео", +'menu_profile' => "Просмотр профиля", +'menu_fcomments' => "Найти все комментарии", +'menu_send' => "Отправить сообщение", +'menu_uedit' => "Админцентр", +// 5.2 + +'fav_notfound' => "Вы ничего не вносили в свои закладки", +'news_err_30' => "Введен неверный код безопасности", +'confirm_ok' => "Ваш E-Mail: {email} подтвержден и допущен к регистрации на сайте. Ваш логин на сайте: {login}. Вы можете продолжить регистрацию на сайте, пройдя по указанной ссылке.", +'s_allcat' => "- Искать во всех разделах -", +'s_con' => "Поиск по содержанию", +'s_word' => "Слова для поиска:", +'s_whint' => "Для поиска по нескольким
    альтернативным строкам
    используйте выражение
    строка1 OR строка2 OR ...", +'s_ncom1' => "Искать в комментариях", +'s_ncall' => "Искать в статьях и комментариях", +'s_ncom' => "Искать в статьях", +'s_tnews' => "Искать в заголовках статей", +'s_nid' => "Искать по номеру статьи", +'s_static' => "Искать в статических страницах", +'s_mname' => "Поиск по имени пользователя", +'s_fall' => "Найти статьи или комментарии", +'s_fname' => "Имя пользователя:", +'s_fgname' => "Точное имя", +'s_fart' => "Найти статьи с", +'s_fmin' => "Не менее чем", +'s_fmax' => "Не более чем", +'s_wcomm' => "комментариями", +'s_fdaten' => "Временной период", +'s_tall' => "За все время", +'s_tlast' => "С последнего визита", +'s_tday' => "За сутки назад", +'s_tweek' => "За неделю назад", +'s_ttweek' => "За 2 недели назад", +'s_tmoth' => "За месяц назад", +'s_tfmoth' => "За 3 месяца назад", +'s_tsmoth' => "За 6 месяцев назад", +'s_tyear' => "За год назад", +'s_fnew' => "и новее", +'s_falt' => "и старее", +'s_fsoft' => "Сортировка результата поиска", +'s_fsdate' => "Дата статьи или комментария", +'s_fstitle' => "Заголовок статьи", +'s_fscnum' => "Количество комментариев", +'s_fsnnum' => "Количество просмотров", +'s_fsaut' => "Имя автора", +'s_fscat' => "Раздел", +'s_fsrate' => "Рейтинг статьи", +'s_fsdesc' => "По убыванию", +'s_fsasc' => "По возрастанию", +'s_vlegend' => "Показывать результат поиска как", +'s_vnum' => "Результатов на страницу:", +'s_vwie' => "Результаты поиска как", +'s_vjump' => "Показать результат №:", +'s_vnews' => "Статьи", +'s_vtitle' => "Заголовки", +'s_fcats' => "Поиск по разделам", +'s_fstart' => "Начать поиск", +'s_fstop' => "Сбросить", +'s_freset' => "Вернуть", +'static_denied' => "У вас недостаточно прав для просмотра выбранной страницы.", +'i_quote' => "Цитата:", +'feed_error' => "Посетители, находящиеся в группе \"{group}\", могут использовать обратную связь на сайте только для связи с администрацией сайта.", +'search_denied' => "Посетители, находящиеся в группе \"{group}\", не могут использовать поиск по сайту.", +'news_err_id' => "Не задан идентификатор новости.", +'comm_req_f' => "Заполните все необходимые поля", +'ip_block_login' => "Внимание, Вы включили автоматическую блокировку по IP вашего аккаунта, доступ к вашему аккаунту с данной подсети запрещен.", +'mod_list_f' => "Ваших новостей, ожидающих модерации, нет", +'ip_block' => "Ваш IP адрес или подсеть были заблокированы администратором", +'pm_alert' => "Уважаемый {user} с момента вашего отсутствия на сайте вам было прислано {num} новых персональных сообщений.", +'pm_asub' => "Тема:", +'pm_atitle' => "Получены персональные сообщения", +'pm_mtitle' => "Нажмите и удерживайте, для перемещения окна", +'pm_aread' => "Прочитать сообщения", +'pm_close' => "Закрыть окно", +'att_dcount' => "cкачиваний:", +'att_denied' => "Вы не можете скачивать файлы с нашего сервера", + +'banned_info' => "Неограниченно.", +'fav_error' => "Данный раздел доступен только зарегистрированным пользователям", + +'aj_allowbr' => "Автоперенос строк", +'pm_selall' => "Выбрать все", +'b_del' => "Удалить выбранное", +'last_comm' => "Последние комментарии", +'err_last' => "Комментарии отсутствуют", + +'top_name' => "Имя", +'top_status' => "Группа", +'top_reg' => "Регистрация", +'top_last' => "Последнее посещение", +'top_nnum' => "Публикаций", +'top_cnum' => "Комментариев", +'top_pm' => "ПС", + +'use_ajax_edit' => "Вы уверены, что хотите отредактировать новость?", +'ajax_comm_edit' => "Вы уверены, что хотите отредактировать комментарий?", +'ajax_info' => "Загрузка. Пожалуйста, подождите...", +'menu_short' => "Быстрое редактирование", +'menu_full' => "Полное редактирование", + + +'addnews_allow_rate' => "Разрешить рейтинг статьи", +'sec_image' => "Включите эту картинку для отображения кода безопасности", +'reg_err_19' => "
  • Код безопасности не соответствует отображённому
  • ", +'reg_err_20' => "
  • Данное имя уже зарегистрировано
  • ", +'reg_ok_ajax' => "Вы можете использовать данное имя для регистрации", + +'news_page_err' => "К сожалению, данная страница для Вас не доступна: возможно, был изменен ее адрес или она была удалена. Пожалуйста, воспользуйтесь поиском.", +'bb_t_up' => "Загрузка файлов и изображений на сервер", +'bb_b_up' => "Загрузка", +'next_moth' => "Следующий месяц", +'prev_moth' => "Предыдущий месяц", +'cal_post' => "Все посты за", +'title_users' => "Пользователи", +'title_new' => "Непрочитанное", +'title_date' => "Материалы за", +'title_stats' => "Статистика сайта", +'title_addnews' => "Добавление новости", +'title_register' => "Регистрация посетителя", +'title_fav' => "Мои закладки", +'title_pm' => "Персональные сообщения", +'title_feed' => "Обратная связь", +'title_year' => "год", +'title_year1' => "года", +'vote_set' => "Голосовать", +'vote_result' => "Результаты", +'poll_failed' => "Вы должны выбрать минимум один из вариантов опроса", + +'excellent' => "Отлично", +'good' => "Хорошо", +'fair' => "Средне", +'poor' => "Приемлемо", +'useless' => "Плохо", +'rated' => "Рейтинг статьи:", +'voten' => "голосов:", +'yrate' => "Ваша оценка:", +'entrat' => "Оценить", +'unorat' => "еще нет рейтинга", +'urated' => "Рейтинг пользователя", + +'templ_err_1' => "Шаблон", +'templ_err_2' => "не существует! Проверьте правильность написания!", + +'all_info' => "Информация", +'all_prev' => "Вернуться назад", +'all_err' => "Ваш браузер не поддерживает Javascript. Мы рекомендуем включить Вам эту поддержку.", +'all_err_1' => "Внимание, обнаружена ошибка", + +'reg_err_1' => "
  • Оба введенных пароля должны быть идентичны!
  • ", +'reg_err_2' => "
  • Длина пароля должна быть не менее 6 символов и не более 16!
  • ", +'reg_err_3' => "
  • Длина имени не может превышать 20 символов!
  • ", +'reg_err_4' => "
  • Вы используете недопустимое для регистрации имя!
  • ", +'reg_err_5' => "
  • Вы используете недопустимый пароль!
  • ", +'reg_err_6' => "
  • Введен неверный E-Mail адрес!
  • ", +'reg_err_7' => "
  • Имя пользователя не может быть пустым!
  • ", +'reg_err_8' => "
  • Пользователь с таким именем или E-Mail адресом уже зарегистрирован!
  • ", +'reg_err_9' => "Администратором сайта была отключена поддержка регистрации на сайте.", +'reg_err_10' => "На сайте уже зарегистрировано максимально допустимое количество пользователей. Попробуйте зарегистрироваться позже.", +'reg_err_11' => "Ошибка регистрации", +'reg_err_12' => "
  • Произошла ошибка при загрузке аватара.
  • ", +'reg_err_13' => "
  • К загрузке разрешены только файлы с расширением JPG или PNG.
  • ", +'reg_err_14' => "
  • Слишком длинная информация о себе!
  • ", +'reg_err_15' => "
  • Введено слишком длинное имя!
  • ", +'reg_err_16' => "
  • Страны с таким длинным названием не бывает!
  • ", +'reg_err_17' => "
  • Введен слишком длинный номер ICQ!
  • ", +'reg_err_18' => "Внимание, обнаружена ошибка", +'reg_ok' => "Регистрация успешно завершена", +'reg_ok_1' => "Благодарим Вас за регистрацию на нашем сайте! Теперь Вы можете войти на сайт, используя Ваш логин и пароль.", + +'reg_subj' => "Активация аккаунта", +'reg_vhead' => "Отправлен запрос на активацию", +'reg_vtext' => "Запрос на регистрацию принят.

    Администрация сайта требует реальности всех вводимых E-mail адресов. Через 10 минут (возможно и раньше) Вы получите письмо с инструкциями следующего шага. Еще немного, и Вы будете зарегистрированы на сайте. Если в течении этого времени Вы не получили письма с подтверждением, то повторите попытку используя другой E-Mail адрес или обратитесь к администратору сайта.
    Внимание! Возможны проблемы с доставкой на E-mail адреса бесплатных почтовых серверов.", + +'add_err_1' => "
  • Заголовок не может быть пустым
  • ", +'add_err_2' => "
  • Введен слишком длинный заголовок
  • ", +'xfield_xerr1' => "
  • Вы должны заполнить все необходимые поля.
  • ", +'add_err_5' => "
  • Необходимо заполнить поле с краткой новостью
  • ", +'add_err_6' => "Внимание, обнаружена ошибка", +'add_err_7' => "У вашей статьи должен быть хотя бы заголовок и краткая версия", +'add_err_8' => "К сожалению у вас нет прав для публикации новостей на сайте.
    Unfortunately you do not have the right to publish news on the site.

    Получить право добавлять новости
    Obtain the right to add news
    ", +'add_err_9' => "Такая новость уже есть Извините но мы не можем Добавлять повторные новости!", +'add_ok' => "Новость добавлена", +'add_ok_1' => "Ваша новость была успешно добавлена в базу данных.", +'add_ok_2' => "Ваша новость была успешно добавлена в базу данных. После проверки администратором она будет опубликована на сайте.", +'add_ok_3' => "Ваша новость была успешно добавлена в базу данных. Однако, в связи с тем, что Вы можете публиковать новости без модерации не во все разделы, Ваша новость будет опубликована только после проверки администратором сайта.", +'add_noch' => "Добавить еще", +'add_or' => "или", +'add_al_com' => "Разрешить комментарии", +'add_al_m' => "Публиковать на главной", +'add_al_ap' => "Опубликовать новость на сайте", +'add_al_fix' => "Зафиксировать новость", + +'bb_url' => "Введите полный URL ссылки", +'bb_page' => "Введите номер страницы", +'bb_url_name' => "Введите название сайта", +'bb_page_name' => "Введите описание ссылки", +'bb_image' => "Введите полный URL изображения", +'bb_email' => "Введите e-mail адрес", +'bb_code' => "Использование: [CODE] Здесь Ваш код.. [/CODE]", +'bb_quote' => "Использование: [QUOTE] Здесь Ваша Цитата.. [/QUOTE]", +'bb_no_url' => "Вы должны ввести URL", +'bb_no_title' => "Вы должны ввести название", +'bb_no_email' => "Вы должны ввести e-mail адрес", +'bb_prompt_start' => "Введите текст для форматирования", +'bb_img_title' => "Введите по какому краю выравнивать картинку (left, center, right)", +'bb_email_title' => "Введите описание ссылки (необязательно)", +'bb_b_quote' => " Цитата ", +'bb_bb_page' => "Страница", +'bb_b_close' => "Закрыть всё", +'bb_b_url' => "Ссылка", +'bb_b_img' => "Картинка", +'bb_b_mail' => "E-Mail", +'bb_b_break' => "Разрыв", +'bb_b_page' => "Ссылка на страницу", +'bb_t_b' => "Полужирный", +'bb_t_i' => "Наклонный текст", +'bb_t_u' => "Подчеркнутый текст", +'bb_t_s' => "Зачеркнутый текст", +'bb_t_l' => "Выравнивание по левому краю", +'bb_t_c' => "По центру", +'bb_t_r' => "Выравнивание по правому краю", +'bb_t_cl' => "Закрыть все открытые теги", +'bb_t_url' => "Вставка ссылки", +'bb_t_img' => "Вставка картинки", +'bb_t_hide' => "Скрытый текст", +'bb_t_quote' => "Вставка цитаты", +'bb_t_translit' => "Преобразовать выбранный текст из транслитерации в кириллицу", +'bb_t_m' => "Вставка E-Mail", +'bb_t_br' => "Вставка разрыва между страницами", +'bb_t_p' => "Вставка ссылки на страницу", +'bb_b_cancel' => "Отменить", +'bb_t_cancel' => "Отменить редактирование и вернуть все в исходное состояние", +'bb_b_apply' => "Принять исправления", +'bb_t_apply' => "Отправить исправления на сервер", + +'comm_err_1' => "Работа с комментариями доступна только зарегистрированным пользователям", +'comm_err_2' => "Внимание, обнаружена ошибка", +'comm_err_3' => "У Вас нет прав для редактирования выбранного комментария.", +'comm_err_4' => "У Вас нет прав для удаления выбранного комментария.", +'comm_err_5' => "Действие не определено или не выбран комментарий.", + +'comm_ok' => "Действие успешно выполнено", +'comm_ok_1' => "Текст комментария был успешно изменен", +'comm_ok_2' => "Комментарий был успешно удален.", +'comm_title' => "Редактирование комментария", + +'login_err' => "Ошибка авторизации", +'login_err_1' => "Внимание, вход на сайт не был произведен. Возможно, Вы ввели неверное имя пользователя или пароль.", + +'search_err_2' => "К сожалению, поиск по сайту не дал никаких результатов. Попробуйте изменить или сократить Ваш запрос.", +'search_err_3' => "Введено пустое поле для поиска или строка поиска содержит менее 4 символов, в связи с чем поиск был приостановлен.", +'search_ok' => "По Вашему запросу найдено", +'search_ok_1' => "ответов", +'search_ok_2' => "Результаты запроса", +'search_title' => "Поиск по сайту", + +'lost_npass' => "Уважаемый посетитель! Согласно Вашему запросу для Вас был сгенерирован новый пароль. Для входа на сайт используйте следующие данные:", +'lost_login' => "Логин:", +'lost_pass' => "Пароль:", +'lost_info' => "После авторизации на сайте вы сможете изменить данный пароль на любой другой.", +'lost_gen' => "Новый пароль сгенерирован", +'lost_err' => "Пользователь с таким именем не запрашивал восстановление пароля, либо данная ссылка уже устарела. Допускается только одна попытка восстановления пароля по отправленной вам на e-mail ссылке. После чего вы должны повторно запрашивать восстановление пароля на e-mail", +'lost_subj' => "Восстановление забытого пароля", +'lost_ms' => "Уведомление отправлено", +'lost_ms_1' => "Уважаемый посетитель! В связи с тем что в целях безопасности все пароли хранятся в зашифрованном виде, мы не можем восстановить Ваш старый пароль. На ваш E-Mail адрес, указанный при регистрации, было отправлено уведомление для генерации нового пароля для Вас.", +'lost_err_1' => "Пользователь с таким именем или E-Mail не найден в базе данных", +'news_err_url' => "URL адреса сайтов, в поле \"О себе\" публиковать ЗАПРЕЩЕНО!", +'news_err_0' => "Вы ввели слишком короткий комментарий.", +'news_err_1' => "Вы ввели слишком длинное имя.", +'news_err_2' => "Вы ввели слишком длинный E-Mail адрес.", +'news_err_3' => "Вы ввели слишком длинный комментарий.", +'news_err_4' => "Включена защита от флуда.", +'news_err_5' => "Вы сможете добавить повторно комментарий для данной статьи только через", +'news_err_6' => "секунд", +'news_err_7' => "Извините, но Вы ввели имя зарегистрированного пользователя. Если Вы и есть этот пользователь, то Вам необходимо авторизироваться в панели управления.", +'news_err_9' => "Поле \"Имя\" является обязательным и не может быть пустым.", +'news_err_10' => "Извините, но Вы ввели неверный E-Mail адрес.", +'news_err_11' => "Поле \"Комментарий\" является обязательным и не может быть пустым.", +'news_err_12' => "К сожалению, данная страница для Вас не доступна, возможно был изменен ее адрес или она была удалена. Пожалуйста, воспользуйтесь поиском.", +'news_err_13' => "
  • У вас нет прав для редактирования этого профиля!
  • ", +'news_err_14' => "
  • Произошла ошибка при загрузки фотографии.
  • ", +'news_err_15' => "
  • К загрузке разрешены только файлы с расширением JPG или GIF.
  • ", +'news_err_16' => "
  • Максимальный размер загружаемой картинки не должен превышать 100 Kb.
  • ", +'news_err_17' => "
  • Введен неверный старый пароль!
  • ", +'news_err_18' => "
  • Оба введенных пароля должны быть идентичны!
  • ", +'news_err_19' => "
  • Длина пароля должна быть не менее 6 символов и не более 16!
  • ", +'news_err_20' => "
  • Вы используете недопустимый пароль!
  • ", +'news_err_21' => "
  • Введен неверный E-Mail адрес!
  • ", +'news_err_22' => "
  • Слишком длинная информация о себе!
  • ", +'news_err_23' => "
  • Введено слишком длинное имя!
  • ", +'news_err_24' => "
  • Страны с таким длинным названием не бывает!
  • ", +'news_err_25' => "
  • Введен слишком длинный номер ICQ!
  • ", +'news_err_26' => "Пользователь с таким именем не найден.", +'news_err_27' => "По данному критерию новости не найдены, либо у вас нет доступа для просмотра этих новостей", +'news_err_28' => "не имеют доступа для просмотра статей из данного раздела.", +'news_err_29' => "Комментирование новости отключено Администрацией портала...", + +'feed_err_1' => "
  • Вы не указали своё имя.
  • ", +'feed_err_2' => "
  • Вы не указали свой E-mail.
  • ", +'feed_err_3' => "
  • Неверно указан E-mail.
  • ", +'feed_err_4' => "
  • Вы не указали заголовок сообщения.
  • ", +'feed_err_5' => "
  • Вы не указали текст сообщения.
  • ", +'feed_err_6' => "Невозможно отправить Ваше сообщение.", +'feed_err_7' => "Данный пользователь не найден в базе данных, либо он не хочет получать письма от других пользователей", + +'feed_ok_1' => "Сообщение успешно отправлено", +'feed_ok_2' => "Ваше сообщение для", +'feed_ok_3' => "успешно отправлено.", +'feed_ok_4' => "Вернуться на главную.", + +'user_mem' => "Посетитель", +'user_ed' => "Журналист", +'user_re' => "Редактор", +'user_adm' => "Администратор", +'user_ban' => "Забанен", + +'news_next' => "Следующая страница", +'news_prev' => "Предыдущая страница", +'news_site' => "Страница", +'news_iz' => " из ", +'news_delcom' => "Вы действительно хотите удалить? Данное действие невозможно будет отменить", +'news_regus' => "
    Внимание! У вас нет прав для просмотра скрытого текста.
    Для того чтобы видеть скрытый текст Вам необходимо зарегистрироваться.

    Attention! You can view this text.
    To see the hidden text you must register.
    ", +'news_info_1' => "Только Зарегистрированные пользователи могут оставлять комментарии.", +'news_mail' => "отправить E-Mail", +'news_nomail' => "скрыт от просмотра", +'news_noamail' => "Не получать письма от других", +'news_option' => "редактировать профиль", +'news_addfav' => "Добавить новость в закладки", +'news_minfav' => "Удалить новость из закладок", +'news_addcom' => "Добавление комментария", +'news_pmnew' => "написать ПС", + +'pm_err_1' => "К сожалению, Вы не можете использовать персональные сообщения на сайте", +'pm_err_2' => "
  • Все поля обязательны к заполнению
  • ", +'pm_err_3' => "
  • Слишком длинный заголовок письма
  • ", +'pm_err_4' => "
  • Получатель с таким именем не найден
  • ", +'pm_err_8' => "
  • Количество персональных сообщений получателя достигло максимального значения, в связи с чем он не может больше получать персональные сообщения.
  • ", +'pm_err_5' => "Удаление персональных сообщений не было произведено. Либо Вы ничего не выбрали, либо у Вас нет на это прав.", +'pm_err_6' => "Сообщение с таким номером не найдено", +'pm_err_7' => "У Вас нет прав просматривать чужие персональные сообщения", +'pm_err_9' => "Ваш ящик достиг максимального количества полученных сообщений. Вы не сможете больше получать персональные сообщения до тех пор, пока не удалите лишние сообщения.", + 'pm_err_10' => "Вы пытаетесь отправить персональное сообщение самому себе!", +'pm_sendok' => "Ваше сообщение было успешно отправлено.", +'pm_confirm' => "Вы действительно желаете удалить данное сообщение", +'pm_noch' => "Отправить еще", +'pm_main' => "вернуться на главную страницу", +'pm_or' => "или", +'pm_delok' => "Выбранные сообщения были успешно удалены.", +'pm_subj' => "Тема сообщения", +'pm_from' => "Отправитель", +'pm_date' => "Дата", +'pm_action' => "Действие?", +'pm_del' => "удалить", + +); + +//////////// +// Локализация для даты +$langdate = array ( +'January' => "января", +'February' => "февраля", +'March' => "марта", +'April' => "апреля", +'May' => "мая", +'June' => "июня", +'July' => "июля", +'August' => "августа", +'September' => "сентября", +'October' => "октября", +'November' => "ноября", +'December' => "декабря", +'Jan' => "янв", +'Feb' => "фев", +'Mar' => "мар", +'Apr' => "апр", +'Jun' => "июн", +'Jul' => "июл", +'Aug' => "авг", +'Sep' => "сен", +'Oct' => "окт", +'Nov' => "ноя", +'Dec' => "дек", + +'Sunday' => "Воскресенье", +'Monday' => "Понедельник", +'Tuesday' => "Вторник", +'Wednesday' => "Среда", +'Thursday' => "Четверг", +'Friday' => "Пятница", +'Saturday' => "Суббота", + +'Sun' => "Вс", +'Mon' => "Пн", +'Tue' => "Вт", +'Wed' => "Ср", +'Thu' => "Чт", +'Fri' => "Пт", +'Sat' => "Сб", + +); + +# Для архива и календаря +$f = array('января', 'февраля', 'марта', 'апреля', 'мая', 'июня', 'июля', 'августа', 'сентября', 'октября', 'ноября', 'декабря'); +$r = array('Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь'); +$langdateshortweekdays = array("Вс","Пн","Вт","Ср","Чт","Пт","Сб"); + +@setlocale(LC_ALL, array("ru_RU.CP1251", "ru_SU.CP1251", "ru_RU.KOI8-r", "ru_RU", "russian", "ru_SU", "ru")); +?> \ No newline at end of file diff --git a/language/Russian/website_repa.lng b/language/Russian/website_repa.lng new file mode 100644 index 0000000..b5aca6e --- /dev/null +++ b/language/Russian/website_repa.lng @@ -0,0 +1,38 @@ + "Вы не можете изменяться репутацию самому себе.", +'repa_off' => "Пользователь отключил репутацию в своих настройках. Вы не можете изменять ему репутацию.", +'repa_user_not_found' => "Пользователь не найден.", +'repa_error_act' => "Не выбрано действие.", +'repa_no_com' => "Вы не ввели комментарий к изменению репутации.", +'repa_min_com' => "Вы ввели слишком маленький комментарий.", +'repa_stop_otr' => "Для изменения репутации другим пользователям ваша репутация должна быть равна или больше 0.", +'repa_edit_error' => "Вы не можете самому себе редактировать репутацию. Если вы считаете, что вам не по заслугам поставили + или -, то сообщите об этом другому модератору или стоящему выше по рангу пользователю для удаления изменённой репутации.", +'repa_history' => "В базе данных нет такого пользователя либо пользователь ещё никому не менял репутацию.", +'repa_not_logged' => "Вы не авторизованы на сайте. Зарегистрируйтесь или авторизуйтесь.", +'repa_not_selected' => "Не выбранная репутация для иземенния.", +'repa_selected_not_found' => "В базе данных не обнаружена запрашиваемая запись.", +'repa_access_no' => "Вы не имеете прав для редактирования данного изменения репутации.", +'gen_status_off' => "Этот модуль отключен администратором", +'title_repa' => "Репутация пользователя", +'title_repa_top' => "Лучшие пользователи", +'repa_nothing' => "Изменений небыло.", +'repa_first_p' => "к начальной странице", +'repa_last_pa' => "к последней странице", +'repa_up' => "Положительно", +'repa_down' => "Отрицательно", +'repa_adm' => "Административно", +'change_quest' => "Изменить репутацию пользователю", +'repa_already' => "Вы уже изменяли репутацию пользователю", +'repa_group_stop' => "Пользователям из Вашей группы нельзя менять репутацию другим.", +'repa_user_stop' => "Вы не можете воздействовать на репутацию других. Администратор заблокировал это действие для Вас", +'repa_bl_msg' => "До полученя права изменять репутацию другим Вы должны быть зарегистрированы не менее", +'repa_days' => " дней", +'repa_limit' => "Репутация дошла до лимита", +'repa_too_long' => "Слишком длинный текст комментария!", +'repa_msg_changed' => "Вам изменили репутацию", + +); +?> \ No newline at end of file diff --git a/out.php b/out.php new file mode 100644 index 0000000..baae1d2 --- /dev/null +++ b/out.php @@ -0,0 +1,44 @@ +
    Please visit {$_SERVER['HTTP_HOST']}" ); +} + +$tpl = new dle_template; +$tpl->dir = ( ROOT_DIR.'/templates/'); + +$tpl->load_template('redirect.tpl'); +$tpl->set('{title}', $config['short_title']); +$tpl->set('{home_url}', $config['http_home_url']); +$tpl->set( '{url}', $url ); +$tpl->compile( 'redirect' ); +$tpl->clear(); + +echo $tpl->result['redirect']; +die(); + +//@header ( 'Location: ' . $url ); + +//die ( "Link Redirect:

    Please click here." ); +?> \ No newline at end of file diff --git a/rating.php b/rating.php new file mode 100644 index 0000000..7cfa4cc --- /dev/null +++ b/rating.php @@ -0,0 +1,141 @@ + 6) show_error_image("The request can have maximum 6 characters"); + +if($query == 'game'){ + function get_xml($url) + { + $ch = curl_init($url); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($ch, CURLOPT_HEADER, 0); + curl_setopt($ch, CURLOPT_ENCODING, ""); + curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.8) Gecko/2009032609 Firefox/3.0.8"); + curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 120); + curl_setopt($ch, CURLOPT_TIMEOUT, 120); + + $content = curl_exec($ch); + curl_close($ch); + preg_match("!(.*?)!si", $content, $contens); + $content = $contens[1]; + return $content; + } + + $content = get_xml("http://www.igropoisk.com/rating/{$id}.xml"); + + $pic = imagecreatefrompng(RATING_DIR."game.png"); + $color = ImageColorAllocate($pic, 255, 255, 255); + imagealphablending($pic, true); + + imagestring($pic, 3, 6, 19, $content, $color); + +} elseif ($query == 'film'){ + function subX($dbl){ + switch ($dbl) { + case 1: + return 9; + break; + case 2: + return 8; + break; + case 3: + return 7; + break; + case 4: + return 6; + break; + case 5: + return 5; + break; + case 6: + return 4; + break; + case 7: + return 4; + break; + case 8: + return 3; + break; + case 9: + return 2; + break; + } + } + + $rating = file_get_contents("http://rating.kinopoisk.ru/{$id}.xml"); + + preg_match("/kp_rating num_vote=['\"](.+)['\"]>(.+)(.+) 0) ? imagecreatefrompng(RATING_DIR."rating.png") : imagecreatefrompng(RATING_DIR."kinopoisk.png"); + $star = imagecreatefrompng(RATING_DIR."star.png"); + $color = ImageColorAllocate($pic, 0, 0, 0); + $colorDown = ImageColorAllocate($pic, 120, 120, 120); + imagealphablending($pic, true); + + ($kino_rating > 10) ? $kino_rating = 10 : ""; + imagestring($pic, 3, 5, 19, $kino_rating, $color); + imagestring($pic, 1, 5+(strlen($kino_rating)+1)*6, 23, $kino_votes, $colorDown); + + if($imdb_rating > 0) { + ($imdb_rating > 10) ? $imdb_rating = 10 : ""; + imagestring($pic, 3, 191 - (strlen($imdb_rating)-1) * 7, 1, $imdb_rating, $color); + imagestring($pic, 1, 188 - (strlen($imdb_votes)-2) * 5, 17, $imdb_votes, $colorDown); + + for ($i = 0, $next = 0; $i != (int)$imdb_rating; $i++, $next = $next + 10) { + imagecopy($pic, $star, 109 + $next, 26, 0, 0, imagesx($star), imagesy($star)); + } + $imdb_rating = explode(".", $imdb_rating); + if(is_array($imdb_rating) and $imdb_rating[1] != 0) { + $dbl = (int)$imdb_rating[1]; + imagecopy($pic, $star, 109 + $next, 26, 0, 0, imagesx($star) - subX($dbl), imagesy($star)); + } + } +} + +imagesavealpha($pic, true); +imagepng($pic); +imagedestroy($pic); +$cache = ob_get_contents(); +ob_end_clean(); +echo $cache; +$fp = @fopen ($file, "w"); +@fwrite($fp, $cache); +@fclose($fp); +?> \ No newline at end of file diff --git a/robots.txt b/robots.txt new file mode 100644 index 0000000..7d74417 --- /dev/null +++ b/robots.txt @@ -0,0 +1,31 @@ +User-agent: * +Allow: /$ +Allow: /index.php$ +Allow: /sitemap* +Allow: /rss* +Allow: /*.html +Allow: /news/* +Allow: /films/* +Allow: /video/* +Allow: /music/* +Allow: /games/* +Allow: /soft/* +Allow: /library/* +Allow: /wallpapers/* +Allow: /forum/$ +Allow: /forum/forum_ +Allow: /forum/topic_ +Disallow: / +Crawl-delay: 0.5 +Host: files-sib.net +Sitemap: http://files-sib.net/sitemap.xml + +User-agent: Adsbot-Google +User-agent: Googlebot-Image +User-agent: Googlebot-Mobile +User-agent: Mediapartners-Google +User-agent: msnbot +User-agent: msnbot-media +User-agent: Slurp +User-agent: Yahoo-MMCrawler +Disallow: / \ No newline at end of file diff --git a/schema.sql b/schema.sql new file mode 100644 index 0000000..8523571 --- /dev/null +++ b/schema.sql @@ -0,0 +1,917 @@ +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES cp1251 */; + +-- -------------------------------------------------------- + +-- +-- Структура таблицы `cms_banned` +-- + +CREATE TABLE IF NOT EXISTS `cms_banned` ( + `id` smallint(5) NOT NULL AUTO_INCREMENT, + `users_id` mediumint(8) NOT NULL DEFAULT '0', + `descr` text NOT NULL, + `date` varchar(15) NOT NULL DEFAULT '', + `days` smallint(4) NOT NULL DEFAULT '0', + `ip` varchar(50) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `user_id` (`users_id`) +) ENGINE=MyISAM DEFAULT CHARSET=cp1251 AUTO_INCREMENT=1 ; + +-- -------------------------------------------------------- + +-- +-- Структура таблицы `cms_category` +-- + +CREATE TABLE IF NOT EXISTS `cms_category` ( + `id` smallint(5) NOT NULL AUTO_INCREMENT, + `parentid` smallint(5) NOT NULL DEFAULT '0', + `posi` smallint(5) NOT NULL DEFAULT '1', + `name` varchar(50) NOT NULL DEFAULT '', + `alt_name` varchar(50) NOT NULL DEFAULT '', + `descr` varchar(200) NOT NULL DEFAULT '', + `keywords` text NOT NULL, + `news_sort` varchar(10) NOT NULL DEFAULT '', + `news_msort` varchar(4) NOT NULL DEFAULT '', + `news_number` smallint(5) NOT NULL DEFAULT '0', + `metatitle` varchar(255) NOT NULL DEFAULT '', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=cp1251 AUTO_INCREMENT=1 ; + +-- -------------------------------------------------------- + +-- +-- Структура таблицы `cms_chat` +-- + +CREATE TABLE IF NOT EXISTS `cms_chat` ( + `id` int(5) NOT NULL AUTO_INCREMENT, + `name` varchar(100) NOT NULL DEFAULT '', + `message` text NOT NULL, + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `ip` varchar(16) NOT NULL DEFAULT '', + `user_id` mediumint(8) NOT NULL DEFAULT '0', + `mgroup` tinyint(2) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=cp1251 AUTO_INCREMENT=1 ; + +-- -------------------------------------------------------- + +-- +-- Структура таблицы `cms_comments` +-- + +CREATE TABLE IF NOT EXISTS `cms_comments` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `post_id` int(11) NOT NULL DEFAULT '0', + `user_id` mediumint(8) NOT NULL DEFAULT '0', + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `autor` varchar(40) NOT NULL DEFAULT '', + `email` varchar(40) NOT NULL DEFAULT '', + `text` text NOT NULL, + `ip` varchar(16) NOT NULL DEFAULT '', + `is_register` tinyint(1) NOT NULL DEFAULT '0', + `rating` smallint(5) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `user_id` (`user_id`), + FULLTEXT KEY `text` (`text`) +) ENGINE=MyISAM DEFAULT CHARSET=cp1251 AUTO_INCREMENT=1 ; + +-- -------------------------------------------------------- + +-- +-- Структура таблицы `cms_covers` +-- + +CREATE TABLE IF NOT EXISTS `cms_covers` ( + `id` int(10) NOT NULL AUTO_INCREMENT, + `newsid` int(10) NOT NULL, + `link` varchar(1000) NOT NULL, + `thumb` varchar(1000) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=cp1251 AUTO_INCREMENT=1 ; + +-- -------------------------------------------------------- + +-- +-- Структура таблицы `cms_email` +-- + +CREATE TABLE IF NOT EXISTS `cms_email` ( + `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(10) NOT NULL DEFAULT '', + `template` text NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=cp1251 AUTO_INCREMENT=1 ; + +-- -------------------------------------------------------- + +-- +-- Структура таблицы `cms_files` +-- + +CREATE TABLE IF NOT EXISTS `cms_files` ( + `id` mediumint(8) NOT NULL AUTO_INCREMENT, + `news_id` int(10) NOT NULL DEFAULT '0', + `name` varchar(250) NOT NULL DEFAULT '', + `onserver` varchar(250) NOT NULL DEFAULT '', + `author` varchar(40) NOT NULL DEFAULT '', + `date` varchar(15) NOT NULL DEFAULT '', + `dcount` smallint(5) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `news_id` (`news_id`) +) ENGINE=MyISAM DEFAULT CHARSET=cp1251 AUTO_INCREMENT=1 ; + +-- -------------------------------------------------------- + +-- +-- Структура таблицы `cms_forum_category` +-- + +CREATE TABLE IF NOT EXISTS `cms_forum_category` ( + `sid` int(11) NOT NULL AUTO_INCREMENT, + `cat_name` varchar(128) NOT NULL DEFAULT '', + `posi` tinyint(3) NOT NULL DEFAULT '0', + KEY `sid` (`sid`) +) ENGINE=MyISAM DEFAULT CHARSET=cp1251 AUTO_INCREMENT=1 ; + +-- -------------------------------------------------------- + +-- +-- Структура таблицы `cms_forum_email` +-- + +CREATE TABLE IF NOT EXISTS `cms_forum_email` ( + `id` int(11) NOT NULL DEFAULT '0', + `name` varchar(40) NOT NULL DEFAULT '', + `template` text NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=cp1251; + +-- -------------------------------------------------------- + +-- +-- Структура таблицы `cms_forum_files` +-- + +CREATE TABLE IF NOT EXISTS `cms_forum_files` ( + `file_id` int(11) NOT NULL AUTO_INCREMENT, + `file_type` varchar(10) NOT NULL DEFAULT '', + `forum_id` int(11) NOT NULL DEFAULT '0', + `topic_id` int(11) NOT NULL DEFAULT '0', + `post_id` int(11) NOT NULL DEFAULT '0', + `file_attach` tinyint(1) NOT NULL DEFAULT '0', + `file_name` varchar(250) NOT NULL DEFAULT '', + `onserver` varchar(250) NOT NULL DEFAULT '', + `file_author` varchar(40) NOT NULL DEFAULT '', + `file_date` int(10) NOT NULL DEFAULT '0', + `file_size` int(11) NOT NULL DEFAULT '0', + `dcount` int(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`file_id`) +) ENGINE=MyISAM DEFAULT CHARSET=cp1251 AUTO_INCREMENT=1 ; + +-- -------------------------------------------------------- + +-- +-- Структура таблицы `cms_forum_forums` +-- + +CREATE TABLE IF NOT EXISTS `cms_forum_forums` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `parentid` int(11) NOT NULL DEFAULT '0', + `main_id` int(11) NOT NULL DEFAULT '0', + `topics` mediumint(6) NOT NULL DEFAULT '0', + `posts` mediumint(6) NOT NULL DEFAULT '0', + `name` varchar(128) NOT NULL DEFAULT '', + `description` text NOT NULL, + `position` tinyint(3) NOT NULL DEFAULT '0', + `status` tinyint(1) NOT NULL DEFAULT '1', + `access_read` varchar(150) NOT NULL DEFAULT '', + `access_write` varchar(150) NOT NULL DEFAULT '', + `access_mod` varchar(150) NOT NULL DEFAULT '', + `access_topic` varchar(150) NOT NULL DEFAULT '', + `access_upload` varchar(150) NOT NULL DEFAULT '', + `access_download` varchar(150) NOT NULL DEFAULT '', + `f_last_tid` smallint(5) NOT NULL DEFAULT '0', + `f_last_title` varchar(70) NOT NULL DEFAULT '', + `f_last_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `f_last_poster_name` varchar(40) NOT NULL DEFAULT '', + `password` varchar(32) NOT NULL DEFAULT '', + `rules_title` varchar(128) NOT NULL DEFAULT '', + `rules` text NOT NULL, + `icon` varchar(40) NOT NULL DEFAULT '', + `moderators` varchar(150) NOT NULL DEFAULT '', + `postcount` tinyint(1) NOT NULL DEFAULT '1', + `fixpost` tinyint(1) NOT NULL DEFAULT '0', + `last_post_id` int(11) NOT NULL DEFAULT '0', + `banner` text NOT NULL, + `q_reply` tinyint(1) NOT NULL DEFAULT '1', + `i_edit` tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=cp1251 AUTO_INCREMENT=1 ; + +-- -------------------------------------------------------- + +-- +-- Структура таблицы `cms_forum_moderators` +-- + +CREATE TABLE IF NOT EXISTS `cms_forum_moderators` ( + `mid` mediumint(8) NOT NULL AUTO_INCREMENT, + `forum_id` int(11) NOT NULL DEFAULT '0', + `member_name` varchar(32) NOT NULL DEFAULT '', + `member_id` mediumint(8) NOT NULL DEFAULT '0', + `edit_post` tinyint(1) DEFAULT NULL, + `edit_topic` tinyint(1) DEFAULT NULL, + `delete_post` tinyint(1) DEFAULT NULL, + `delete_topic` tinyint(1) DEFAULT NULL, + `open_topic` tinyint(1) NOT NULL DEFAULT '0', + `close_topic` tinyint(1) DEFAULT NULL, + `mass_prune` tinyint(1) DEFAULT NULL, + `move_topic` tinyint(1) DEFAULT NULL, + `pin_topic` tinyint(1) DEFAULT NULL, + `unpin_topic` tinyint(1) DEFAULT NULL, + `is_group` tinyint(1) DEFAULT '0', + `group_id` smallint(3) DEFAULT NULL, + `combining_post` tinyint(1) NOT NULL DEFAULT '0', + `move_post` tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (`mid`), + KEY `forum_id` (`forum_id`), + KEY `group_id` (`group_id`), + KEY `member_id` (`member_id`) +) ENGINE=MyISAM DEFAULT CHARSET=cp1251 AUTO_INCREMENT=1 ; + +-- -------------------------------------------------------- + +-- +-- Структура таблицы `cms_forum_poll_log` +-- + +CREATE TABLE IF NOT EXISTS `cms_forum_poll_log` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `topic_id` int(10) unsigned NOT NULL DEFAULT '0', + `member` varchar(30) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `news_id` (`topic_id`,`member`) +) ENGINE=MyISAM DEFAULT CHARSET=cp1251 AUTO_INCREMENT=1 ; + +-- -------------------------------------------------------- + +-- +-- Структура таблицы `cms_forum_posts` +-- + +CREATE TABLE IF NOT EXISTS `cms_forum_posts` ( + `pid` int(11) NOT NULL AUTO_INCREMENT, + `topic_id` int(11) NOT NULL DEFAULT '0', + `post_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `post_author` varchar(40) NOT NULL DEFAULT '', + `post_text` text NOT NULL, + `post_ip` varchar(16) NOT NULL DEFAULT '', + `is_register` tinyint(1) NOT NULL DEFAULT '0', + `e_mail` varchar(40) NOT NULL DEFAULT '', + `edit_user` varchar(40) NOT NULL DEFAULT '0', + `edit_time` int(10) NOT NULL DEFAULT '0', + `hidden` tinyint(1) NOT NULL DEFAULT '0', + `is_count` tinyint(1) NOT NULL DEFAULT '1', + PRIMARY KEY (`pid`) +) ENGINE=MyISAM DEFAULT CHARSET=cp1251 AUTO_INCREMENT=1 ; + +-- -------------------------------------------------------- + +-- +-- Структура таблицы `cms_forum_sessions` +-- + +CREATE TABLE IF NOT EXISTS `cms_forum_sessions` ( + `id` varchar(60) NOT NULL DEFAULT '0', + `member_name` varchar(64) NOT NULL DEFAULT '', + `user_group` int(11) NOT NULL DEFAULT '5', + `member_id` mediumint(8) NOT NULL DEFAULT '0', + `ip` varchar(16) NOT NULL DEFAULT '', + `browser` varchar(200) NOT NULL DEFAULT '', + `running_time` int(10) NOT NULL DEFAULT '0', + `location` varchar(40) NOT NULL DEFAULT '', + `act_index` int(10) NOT NULL DEFAULT '0', + `act_forum` int(10) NOT NULL DEFAULT '0', + `act_topic` int(10) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `act_topic` (`act_topic`), + KEY `act_forum` (`act_forum`), + KEY `act_index` (`act_index`), + KEY `running_time` (`running_time`) +) ENGINE=MyISAM DEFAULT CHARSET=cp1251; + +-- -------------------------------------------------------- + +-- +-- Структура таблицы `cms_forum_subscription` +-- + +CREATE TABLE IF NOT EXISTS `cms_forum_subscription` ( + `sid` int(11) NOT NULL AUTO_INCREMENT, + `user_id` mediumint(8) NOT NULL DEFAULT '0', + `topic_id` int(10) NOT NULL DEFAULT '0', + PRIMARY KEY (`sid`) +) ENGINE=MyISAM DEFAULT CHARSET=cp1251 AUTO_INCREMENT=1 ; + +-- -------------------------------------------------------- + +-- +-- Структура таблицы `cms_forum_titles` +-- + +CREATE TABLE IF NOT EXISTS `cms_forum_titles` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `posts` int(11) NOT NULL DEFAULT '0', + `title` varchar(128) NOT NULL DEFAULT '', + `pips` varchar(128) NOT NULL DEFAULT '', + KEY `id` (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=cp1251 AUTO_INCREMENT=1 ; + +-- -------------------------------------------------------- + +-- +-- Структура таблицы `cms_forum_topics` +-- + +CREATE TABLE IF NOT EXISTS `cms_forum_topics` ( + `tid` int(11) NOT NULL AUTO_INCREMENT, + `forum_id` int(11) NOT NULL DEFAULT '0', + `title` varchar(70) NOT NULL DEFAULT '', + `topic_descr` varchar(70) NOT NULL DEFAULT '', + `post` int(11) NOT NULL DEFAULT '0', + `views` int(11) NOT NULL DEFAULT '0', + `author_topic` varchar(40) NOT NULL DEFAULT '', + `start_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `last_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `last_poster_name` varchar(40) NOT NULL DEFAULT '', + `topic_status` int(1) NOT NULL DEFAULT '0', + `hidden` int(1) NOT NULL DEFAULT '0', + `fixed` int(1) NOT NULL DEFAULT '1', + `poll_title` varchar(200) NOT NULL DEFAULT '', + `frage` varchar(200) NOT NULL DEFAULT '', + `poll_body` text NOT NULL, + `poll_count` mediumint(8) NOT NULL DEFAULT '0', + `answer` varchar(150) NOT NULL DEFAULT '', + `multiple` tinyint(1) NOT NULL DEFAULT '0', + `meta_descr` varchar(200) DEFAULT NULL, + `meta_keywords` text, + `first_post` int(11) NOT NULL DEFAULT '0', + `last_post_id` int(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`tid`) +) ENGINE=MyISAM DEFAULT CHARSET=cp1251 AUTO_INCREMENT=1 ; + +-- -------------------------------------------------------- + +-- +-- Структура таблицы `cms_forum_views` +-- + +CREATE TABLE IF NOT EXISTS `cms_forum_views` ( + `topic_id` int(11) NOT NULL DEFAULT '0', + `forum_id` int(11) NOT NULL DEFAULT '0', + `user_id` mediumint(8) NOT NULL DEFAULT '0', + `time` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=cp1251; + +-- -------------------------------------------------------- + +-- +-- Структура таблицы `cms_images` +-- + +CREATE TABLE IF NOT EXISTS `cms_images` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `images` text NOT NULL, + `news_id` int(10) NOT NULL DEFAULT '0', + `author` varchar(40) NOT NULL DEFAULT '', + `date` varchar(15) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `author` (`author`), + KEY `news_id` (`news_id`) +) ENGINE=MyISAM DEFAULT CHARSET=cp1251 AUTO_INCREMENT=1 ; + +-- -------------------------------------------------------- + +-- +-- Структура таблицы `cms_lostdb` +-- + +CREATE TABLE IF NOT EXISTS `cms_lostdb` ( + `id` mediumint(8) NOT NULL AUTO_INCREMENT, + `lostname` mediumint(8) NOT NULL DEFAULT '0', + `lostid` varchar(40) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `lostid` (`lostid`) +) ENGINE=MyISAM DEFAULT CHARSET=cp1251 AUTO_INCREMENT=1 ; + +-- -------------------------------------------------------- + +-- +-- Структура таблицы `cms_online` +-- + +CREATE TABLE IF NOT EXISTS `cms_online` ( + `uid` int(10) unsigned NOT NULL DEFAULT '0', + `session` char(32) NOT NULL, + `lastdate` int(10) unsigned NOT NULL DEFAULT '0', + `useragent` char(255) NOT NULL, + `ip` char(15) DEFAULT NULL, + PRIMARY KEY (`session`), + KEY `idx` (`uid`) +) ENGINE=MyISAM DEFAULT CHARSET=cp1251; + +-- -------------------------------------------------------- + +-- +-- Структура таблицы `cms_pm` +-- + +CREATE TABLE IF NOT EXISTS `cms_pm` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `subj` varchar(255) NOT NULL DEFAULT '', + `text` text NOT NULL, + `user` mediumint(8) NOT NULL DEFAULT '0', + `user_from` varchar(50) NOT NULL DEFAULT '', + `date` varchar(15) NOT NULL DEFAULT '', + `pm_read` char(3) NOT NULL DEFAULT '', + `folder` varchar(10) NOT NULL DEFAULT '', + `reply` tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `folder` (`folder`), + KEY `user` (`user`), + KEY `user_from` (`user_from`) +) ENGINE=MyISAM DEFAULT CHARSET=cp1251 AUTO_INCREMENT=1 ; + +-- -------------------------------------------------------- + +-- +-- Структура таблицы `cms_poll` +-- + +CREATE TABLE IF NOT EXISTS `cms_poll` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `news_id` int(10) unsigned NOT NULL DEFAULT '0', + `title` varchar(200) NOT NULL DEFAULT '', + `frage` varchar(200) NOT NULL DEFAULT '', + `body` text NOT NULL, + `votes` mediumint(8) NOT NULL DEFAULT '0', + `multiple` tinyint(1) NOT NULL DEFAULT '0', + `answer` varchar(150) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `news_id` (`news_id`) +) ENGINE=MyISAM DEFAULT CHARSET=cp1251 AUTO_INCREMENT=1 ; + +-- -------------------------------------------------------- + +-- +-- Структура таблицы `cms_poll_log` +-- + +CREATE TABLE IF NOT EXISTS `cms_poll_log` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `news_id` int(10) unsigned NOT NULL DEFAULT '0', + `member` varchar(30) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `news_id` (`news_id`,`member`) +) ENGINE=MyISAM DEFAULT CHARSET=cp1251 AUTO_INCREMENT=1 ; + +-- -------------------------------------------------------- + +-- +-- Структура таблицы `cms_post` +-- + +CREATE TABLE IF NOT EXISTS `cms_post` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `autor` varchar(40) NOT NULL DEFAULT '', + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `short_story` text NOT NULL, + `full_story` text NOT NULL, + `title` varchar(255) NOT NULL DEFAULT '', + `descr` varchar(200) NOT NULL DEFAULT '', + `keywords` text NOT NULL, + `category` varchar(200) NOT NULL DEFAULT '0', + `alt_name` varchar(200) NOT NULL DEFAULT '', + `comm_num` mediumint(8) unsigned NOT NULL DEFAULT '0', + `allow_comm` tinyint(1) NOT NULL DEFAULT '1', + `allow_main` tinyint(1) unsigned NOT NULL DEFAULT '1', + `allow_rate` tinyint(1) unsigned NOT NULL DEFAULT '1', + `approve` tinyint(1) NOT NULL DEFAULT '0', + `fixed` tinyint(1) NOT NULL DEFAULT '0', + `rating` smallint(5) NOT NULL DEFAULT '0', + `news_read` mediumint(8) unsigned NOT NULL DEFAULT '0', + `votes` tinyint(1) NOT NULL DEFAULT '0', + `access` varchar(150) NOT NULL DEFAULT '', + `remote_addr` varchar(255) NOT NULL, + `editdate` varchar(15) NOT NULL DEFAULT '', + `tags` varchar(255) NOT NULL DEFAULT '', + `metatitle` varchar(255) NOT NULL DEFAULT '', + `news_tid` smallint(5) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `autor` (`autor`), + KEY `alt_name` (`alt_name`), + KEY `category` (`category`), + KEY `approve` (`approve`), + KEY `allow_main` (`allow_main`), + KEY `date` (`date`), + KEY `comm_num` (`comm_num`), + KEY `tags` (`tags`), + FULLTEXT KEY `short_story` (`short_story`,`title`) +) ENGINE=MyISAM DEFAULT CHARSET=cp1251 AUTO_INCREMENT=1 ; + +-- -------------------------------------------------------- + +-- +-- Структура таблицы `cms_rate` +-- + +CREATE TABLE IF NOT EXISTS `cms_rate` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `type_id` int(10) NOT NULL DEFAULT '0', + `member` varchar(40) NOT NULL DEFAULT '', + `rating` int(1) NOT NULL DEFAULT '0', + `type` int(1) NOT NULL DEFAULT '1', + `date` varchar(15) NOT NULL, + `ip` varchar(16) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `news_id` (`type_id`), + KEY `member` (`member`), + KEY `ip` (`ip`) +) ENGINE=MyISAM DEFAULT CHARSET=cp1251 AUTO_INCREMENT=1 ; + +-- -------------------------------------------------------- + +-- +-- Структура таблицы `cms_reputation` +-- + +CREATE TABLE IF NOT EXISTS `cms_reputation` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `how` tinytext NOT NULL, + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `author` varchar(40) NOT NULL DEFAULT '', + `komu` varchar(40) NOT NULL DEFAULT '', + `text` text NOT NULL, + `url_page` text NOT NULL, + PRIMARY KEY (`id`), + FULLTEXT KEY `text` (`text`) +) ENGINE=MyISAM DEFAULT CHARSET=cp1251 AUTO_INCREMENT=1 ; + +-- -------------------------------------------------------- + +-- +-- Структура таблицы `cms_static` +-- + +CREATE TABLE IF NOT EXISTS `cms_static` ( + `id` mediumint(8) NOT NULL AUTO_INCREMENT, + `name` varchar(100) NOT NULL DEFAULT '', + `descr` varchar(255) NOT NULL DEFAULT '', + `template` text NOT NULL, + `allow_br` tinyint(1) NOT NULL DEFAULT '0', + `grouplevel` varchar(100) NOT NULL DEFAULT 'all', + `metadescr` varchar(200) NOT NULL DEFAULT '', + `metakeys` text NOT NULL, + `views` mediumint(8) NOT NULL DEFAULT '0', + `date` varchar(15) NOT NULL DEFAULT '', + `metatitle` varchar(255) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `name` (`name`), + FULLTEXT KEY `template` (`template`) +) ENGINE=MyISAM DEFAULT CHARSET=cp1251 AUTO_INCREMENT=1 ; + +-- -------------------------------------------------------- + +-- +-- Структура таблицы `cms_static_files` +-- + +CREATE TABLE IF NOT EXISTS `cms_static_files` ( + `id` mediumint(8) NOT NULL AUTO_INCREMENT, + `static_id` mediumint(8) NOT NULL DEFAULT '0', + `author` varchar(40) NOT NULL DEFAULT '', + `date` varchar(50) NOT NULL DEFAULT '', + `name` varchar(255) NOT NULL DEFAULT '', + `onserver` varchar(255) NOT NULL DEFAULT '', + `dcount` smallint(5) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `static_id` (`static_id`), + KEY `onserver` (`onserver`), + KEY `author` (`author`) +) ENGINE=MyISAM DEFAULT CHARSET=cp1251 AUTO_INCREMENT=1 ; + +-- -------------------------------------------------------- + +-- +-- Структура таблицы `cms_subscribe` +-- + +CREATE TABLE IF NOT EXISTS `cms_subscribe` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `user_id` int(11) NOT NULL DEFAULT '0', + `name` varchar(40) NOT NULL DEFAULT '', + `email` varchar(50) NOT NULL DEFAULT '', + `news_id` int(11) NOT NULL DEFAULT '0', + `hash` varchar(32) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `news_id` (`news_id`), + KEY `user_id` (`user_id`) +) ENGINE=MyISAM DEFAULT CHARSET=cp1251 AUTO_INCREMENT=1 ; + +-- -------------------------------------------------------- + +-- +-- Структура таблицы `cms_table` +-- + +CREATE TABLE IF NOT EXISTS `cms_table` ( + `id` int(6) NOT NULL AUTO_INCREMENT, + `date` varchar(15) NOT NULL DEFAULT '', + `autor` varchar(40) NOT NULL DEFAULT '', + `runame` varchar(40) NOT NULL DEFAULT '', + `enname` varchar(40) NOT NULL DEFAULT '', + `fileyear` varchar(4) NOT NULL DEFAULT '0000', + `category` varchar(20) NOT NULL DEFAULT '', + `answer` text, + `status` tinyint(1) NOT NULL DEFAULT '0', + `editor` varchar(40) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `id` (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=cp1251 AUTO_INCREMENT=1 ; + +-- -------------------------------------------------------- + +-- +-- Структура таблицы `cms_tags` +-- + +CREATE TABLE IF NOT EXISTS `cms_tags` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `news_id` int(11) NOT NULL DEFAULT '0', + `tag` varchar(100) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `news_id` (`news_id`), + KEY `tag` (`tag`) +) ENGINE=MyISAM DEFAULT CHARSET=cp1251 AUTO_INCREMENT=1 ; + +-- -------------------------------------------------------- + +-- +-- Структура таблицы `cms_torrents` +-- + +CREATE TABLE IF NOT EXISTS `cms_torrents` ( + `id` mediumint(8) NOT NULL AUTO_INCREMENT, + `news_id` int(10) NOT NULL DEFAULT '0', + `name` varchar(250) NOT NULL DEFAULT '', + `onserver` varchar(250) NOT NULL DEFAULT '', + `author` varchar(40) NOT NULL DEFAULT '', + `dcount` smallint(5) NOT NULL, + `info_hash` blob NOT NULL, + `size` bigint(20) NOT NULL, + `gold` tinyint(4) NOT NULL DEFAULT '0', + `leechers` int(11) NOT NULL DEFAULT '0', + `seeders` int(11) NOT NULL DEFAULT '0', + `completed` int(11) NOT NULL DEFAULT '0', + `flags` int(11) NOT NULL DEFAULT '0', + `mtime` int(11) NOT NULL, + `ctime` int(11) NOT NULL, + PRIMARY KEY (`id`), + KEY `news_id` (`news_id`) +) ENGINE=MyISAM DEFAULT CHARSET=cp1251 AUTO_INCREMENT=1 ; + +-- -------------------------------------------------------- + +-- +-- Структура таблицы `cms_usergroups` +-- + +CREATE TABLE IF NOT EXISTS `cms_usergroups` ( + `id` smallint(5) NOT NULL AUTO_INCREMENT, + `group_name` varchar(32) NOT NULL DEFAULT '', + `colour` varchar(40) NOT NULL, + `allow_cats` text NOT NULL, + `allow_adds` tinyint(1) NOT NULL DEFAULT '1', + `cat_add` text NOT NULL, + `allow_admin` tinyint(1) NOT NULL DEFAULT '0', + `allow_addc` tinyint(1) NOT NULL DEFAULT '0', + `allow_editc` tinyint(1) NOT NULL DEFAULT '0', + `allow_delc` tinyint(1) NOT NULL DEFAULT '0', + `edit_allc` tinyint(1) NOT NULL DEFAULT '0', + `del_allc` tinyint(1) NOT NULL DEFAULT '0', + `moderation` tinyint(1) NOT NULL DEFAULT '0', + `allow_all_edit` tinyint(1) NOT NULL DEFAULT '0', + `allow_edit` tinyint(1) NOT NULL DEFAULT '0', + `allow_pm` tinyint(1) NOT NULL DEFAULT '0', + `max_foto` varchar(10) NOT NULL DEFAULT '', + `allow_files` tinyint(1) NOT NULL DEFAULT '1', + `allow_hide` tinyint(1) NOT NULL DEFAULT '1', + `allow_short` tinyint(1) NOT NULL DEFAULT '0', + `allow_fixed` tinyint(1) NOT NULL DEFAULT '0', + `allow_feed` tinyint(1) NOT NULL DEFAULT '1', + `allow_search` tinyint(1) NOT NULL DEFAULT '1', + `allow_poll` tinyint(1) NOT NULL DEFAULT '1', + `allow_main` tinyint(1) NOT NULL DEFAULT '1', + `allow_rating` tinyint(1) NOT NULL DEFAULT '1', + `allow_offline` tinyint(1) NOT NULL DEFAULT '0', + `allow_image_upload` tinyint(1) NOT NULL DEFAULT '0', + `allow_file_upload` tinyint(1) NOT NULL DEFAULT '0', + `allow_tor_upload` tinyint(1) NOT NULL DEFAULT '0', + `allow_signature` tinyint(1) NOT NULL DEFAULT '0', + `allow_url` tinyint(1) NOT NULL DEFAULT '1', + `allow_image` tinyint(1) NOT NULL DEFAULT '0', + `max_signature` smallint(6) NOT NULL DEFAULT '0', + `max_info` smallint(6) NOT NULL DEFAULT '0', + `forum_post_edit` tinyint(1) NOT NULL DEFAULT '0', + `forum_post_del` tinyint(1) NOT NULL DEFAULT '0', + `forum_topic_set` tinyint(1) NOT NULL DEFAULT '0', + `forum_topic_edit` tinyint(1) NOT NULL DEFAULT '0', + `forum_topic_del` tinyint(1) NOT NULL DEFAULT '0', + `admin_addnews` tinyint(1) NOT NULL DEFAULT '0', + `admin_editnews` tinyint(1) NOT NULL DEFAULT '0', + `admin_categories` tinyint(1) NOT NULL DEFAULT '0', + `admin_editusers` tinyint(1) NOT NULL DEFAULT '0', + `admin_wordfilter` tinyint(1) NOT NULL DEFAULT '0', + `admin_static` tinyint(1) NOT NULL DEFAULT '0', + `admin_blockip` tinyint(1) NOT NULL DEFAULT '0', + `admin_iptools` tinyint(1) NOT NULL DEFAULT '0', + `admin_googlemap` tinyint(1) NOT NULL DEFAULT '0', + `admin_table` tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=cp1251 AUTO_INCREMENT=1 ; + +-- -------------------------------------------------------- + +-- +-- Структура таблицы `cms_users` +-- + +CREATE TABLE IF NOT EXISTS `cms_users` ( + `email` varchar(50) NOT NULL DEFAULT '', + `password` varchar(32) NOT NULL DEFAULT '', + `name` varchar(40) NOT NULL DEFAULT '', + `user_id` mediumint(8) NOT NULL AUTO_INCREMENT, + `time_zone` int(11) NOT NULL DEFAULT '0', + `news_num` smallint(6) NOT NULL DEFAULT '0', + `comm_num` mediumint(8) NOT NULL DEFAULT '0', + `user_group` smallint(5) NOT NULL DEFAULT '4', + `status` varchar(50) NOT NULL, + `lastdate` varchar(20) DEFAULT NULL, + `reg_date` varchar(20) DEFAULT NULL, + `banned` varchar(5) NOT NULL DEFAULT '', + `allow_mail` tinyint(1) NOT NULL DEFAULT '1', + `info` text NOT NULL, + `signature` text NOT NULL, + `foto` varchar(30) NOT NULL DEFAULT '', + `fullname` varchar(100) NOT NULL DEFAULT '', + `land` varchar(100) NOT NULL DEFAULT '', + `icq` varchar(20) NOT NULL DEFAULT '', + `skype` varchar(32) NOT NULL, + `favorites` text NOT NULL, + `pm_all` smallint(5) NOT NULL DEFAULT '0', + `pm_unread` smallint(5) NOT NULL DEFAULT '0', + `allowed_ip` varchar(255) NOT NULL DEFAULT '', + `hash` varchar(32) NOT NULL DEFAULT '', + `logged_ip` varchar(16) NOT NULL DEFAULT '', + `restricted` tinyint(1) NOT NULL DEFAULT '0', + `restricted_days` smallint(4) NOT NULL DEFAULT '0', + `restricted_date` varchar(15) NOT NULL DEFAULT '', + `mail_lc` tinyint(1) NOT NULL DEFAULT '1', + `birthday` text NOT NULL, + `sex` int(1) NOT NULL, + `repa` mediumint(8) DEFAULT '0', + `repa_mod` varchar(20) NOT NULL DEFAULT '0|0', + `repa_off` tinyint(1) DEFAULT '0', + `r_freeze` varchar(5) NOT NULL, + `photo` varchar(30) NOT NULL, + `can_leech` tinyint(4) NOT NULL DEFAULT '1', + `wait_time` int(11) NOT NULL DEFAULT '0', + `torrent_pass_version` int(11) NOT NULL, + `downloaded` bigint(20) unsigned NOT NULL DEFAULT '0', + `uploaded` bigint(20) unsigned NOT NULL DEFAULT '0', + `forum_post` smallint(5) NOT NULL DEFAULT '0', + `forum_update` varchar(20) NOT NULL DEFAULT '0', + `forum_rank` varchar(40) NOT NULL DEFAULT '0', + `forum_pips` smallint(2) NOT NULL DEFAULT '0', + `forum_last` varchar(20) NOT NULL DEFAULT '0', + `forum_time` varchar(20) NOT NULL DEFAULT '0', + PRIMARY KEY (`user_id`), + UNIQUE KEY `name` (`name`), + UNIQUE KEY `email` (`email`) +) ENGINE=MyISAM DEFAULT CHARSET=cp1251 AUTO_INCREMENT=1 ; + +-- -------------------------------------------------------- + +-- +-- Структура таблицы `cms_users_friends` +-- + +CREATE TABLE IF NOT EXISTS `cms_users_friends` ( + `user_id` mediumint(9) NOT NULL DEFAULT '0', + `friend_id` mediumint(9) NOT NULL DEFAULT '0', + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `approve` tinyint(1) NOT NULL DEFAULT '0', + `porder` mediumint(2) NOT NULL DEFAULT '0', + KEY `approve` (`approve`), + KEY `user_id` (`user_id`) +) ENGINE=MyISAM DEFAULT CHARSET=cp1251; + +-- -------------------------------------------------------- + +-- +-- Структура таблицы `xbt_config` +-- + +CREATE TABLE IF NOT EXISTS `xbt_config` ( + `name` varchar(255) NOT NULL, + `value` varchar(255) NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=cp1251; + +-- +-- Дамп данных таблицы `xbt_config` +-- + +INSERT INTO `xbt_config` (`name`, `value`) VALUES +('announce_interval', '1800'), +('anonymous_announce', '1'), +('vip_group', '6'), +('anonymous_scrape', '0'), +('auto_register', '0'), +('clean_up_interval', '300'), +('column_files_completed', 'completed'), +('column_files_fid', 'id'), +('column_files_leechers', 'leechers'), +('column_files_seeders', 'seeders'), +('column_users_uid', 'user_id'), +('daemon', '1'), +('debug', '0'), +('full_scrape', '0'), +('freeday', '0'), +('gzip_scrape', '1'), +('listen_port', '2710'), +('log_access', '0'), +('log_announce', '0'), +('log_scrape', '0'), +('offline_message', ''), +('pid_file', '/var/run/xbt.pid'), +('query_log', ''), +('read_config_interval', '60'), +('read_db_interval', '60'), +('redirect_url', 'http://files-sib.net'), +('scrape_interval', '0'), +('table_files', 'cms_torrents'), +('table_users', 'cms_users'), +('write_db_interval', '15'), +('table_announce_log', 'xbt_announce_log'), +('cheaters', '0'), +('cheater_speed', '8388608'), +('freedaystart', '0'), +('freedaystop', '0'), +('torrent_pass_private_key', ''); + +-- -------------------------------------------------------- + +-- +-- Структура таблицы `xbt_deny_from_hosts` +-- + +CREATE TABLE IF NOT EXISTS `xbt_deny_from_hosts` ( + `begin` int(10) unsigned NOT NULL, + `end` int(10) unsigned NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=cp1251; + +-- -------------------------------------------------------- + +-- +-- Структура таблицы `xbt_files_users` +-- + +CREATE TABLE IF NOT EXISTS `xbt_files_users` ( + `fid` int(11) NOT NULL, + `uid` int(11) NOT NULL, + `active` tinyint(4) NOT NULL, + `announced` int(11) NOT NULL, + `completed` int(11) NOT NULL, + `downloaded` bigint(20) unsigned NOT NULL, + `left` bigint(20) unsigned NOT NULL, + `uploaded` bigint(20) unsigned NOT NULL, + `mtime` int(11) NOT NULL, + `timespent` int(11) NOT NULL, + `down_speed` int(11) NOT NULL, + `up_speed` int(11) NOT NULL, + `ipa` varchar(255) NOT NULL, + `port` int(11) NOT NULL, + `downloadedz` bigint(11) unsigned NOT NULL, + `uploadedz` bigint(11) unsigned NOT NULL, + UNIQUE KEY `fid` (`fid`,`uid`), + KEY `uid` (`uid`) +) ENGINE=MyISAM DEFAULT CHARSET=cp1251; + +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; diff --git a/system/ajax/addcomments.php b/system/ajax/addcomments.php new file mode 100644 index 0000000..892fa6f --- /dev/null +++ b/system/ajax/addcomments.php @@ -0,0 +1,75 @@ +get( "usergroup" ); +if( ! $user_group ) { + $user_group = array (); + $db->query( "SELECT * FROM " . USERPREFIX . "_usergroups ORDER BY id ASC" ); + while ( $row = $db->get_row() ) {$user_group[$row['id']] = array (); + foreach ( $row as $key => $value ) {$user_group[$row['id']][$key] = stripslashes($value);} + } + $cache->set( "usergroup", $user_group ); + $db->free(); +} + +@include_once ROOT_DIR . '/language/' . $config['langs'] . '/website.lng'; +$config['charset'] = ($lang['charset'] != '') ? $lang['charset'] : $config['charset']; + +require_once SYSTEM_DIR . '/modules/sitelogin.php'; + +$tpl = new dle_template( ); +$tpl->dir = ROOT_DIR . '/templates/' . $_REQUEST['skin']; +define( 'TEMPLATE_DIR', $tpl->dir ); +$ajax_adds = true; + +$_POST['name'] = convert_unicode( $_POST['name'], $config['charset'] ); +$_POST['mail'] = convert_unicode( $_POST['mail'], $config['charset'] ); +$_POST['comments'] = convert_unicode( $_POST['comments'], $config['charset'] ); + +require_once SYSTEM_DIR . '/modules/addcomments.php'; + +if( $CN_HALT != TRUE ) { + include_once SYSTEM_DIR . '/classes/comments.class.php'; + $comments = new Comments( $db, 1, 1 ); + $comments->query = "SELECT " . PREFIX . "_comments.id, post_id, " . PREFIX . "_comments.user_id, date, autor as gast_name, " . PREFIX . "_comments.email as gast_email, text, ip, is_register, name, rating, " . USERPREFIX . "_users.email, news_num, comm_num, user_group, signature, foto, repa, repa_mod, repa_off FROM " . PREFIX . "_comments LEFT JOIN " . USERPREFIX . "_users ON " . PREFIX . "_comments.user_id=" . USERPREFIX . "_users.user_id WHERE " . PREFIX . "_comments.post_id = '$post_id' order by id DESC"; + $comments->build_comments('ajax'); +} $clear_value = "form.comments.value = '';"; + +if( $CN_HALT ) { + $stop = implode( '

    ', $stop ); + $tpl->result['content'] = ""; +} else { + $tpl->result['content'] = "
    ".$tpl->result['content']."
    "; + $tpl->result['content'] .= << + var timeval = new Date().getTime(); + var form = document.getElementById('dle-comments-form'); + {$clear_value} + +HTML; +} + +$tpl->result['content'] = str_replace( '{THEME}', $config['http_home_url'] . 'templates/' . $_REQUEST['skin'], $tpl->result['content'] ); +@header( "Content-type: text/html; charset=" . $config['charset'] ); +echo $tpl->result['content']; +?> \ No newline at end of file diff --git a/system/ajax/bbcode.php b/system/ajax/bbcode.php new file mode 100644 index 0000000..5f5b3ad --- /dev/null +++ b/system/ajax/bbcode.php @@ -0,0 +1,134 @@ + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
     
    +
    +
    +
    + +HTML; + +} +else { + + $addform = "document.ajaxcomments".$id; + $startform = "dleeditcomments".$id; + + if ($user_group[$member_id['user_group']]['allow_url']) + { + $url_link = "
    "; + } + else {$url_link = "";} + + if ($user_group[$member_id['user_group']]['allow_image']) + { + $image_link = "
    "; + } + else $image_link = ""; + +$code = << +
    +
    +
    +
    +
    +
    +
    +
    +
    +{$url_link} +{$image_link} +
    +
    +
    +
    +
    +
    +
    + + +HTML; +} + + +$script_code = @file_get_contents(SYSTEM_DIR."/ajax/bbcodes.js"); +$script_code .= << + +HTML; + + +$bb_code = << + + + + + MySQL Error! +
    ------------------------
    +
    + + The Error returned was: +
    + '.$error.' + +

    + Error Number: +
    + '.$error_num.' +
    +
    + +
    + + + '; + + exit(); + } else return false; + } + +} +?> \ No newline at end of file diff --git a/system/classes/navigation.class.php b/system/classes/navigation.class.php new file mode 100644 index 0000000..a93320d --- /dev/null +++ b/system/classes/navigation.class.php @@ -0,0 +1,125 @@ +URL ); + if( $return == "url" ) return $link; + if( $title ) $page = $title; + return "{$page} "; + } + + // Генерирует лист ссылок + function LPage( $start, $end ){ + + while( $start < $end ) + { + if( $start == $this->Page ) + $navigation .= "".$start."\n"; + else + $navigation .= $this->CNPage( $start ); + $start++; + } + + return $navigation; + } + + // Формирование навигации происходит в этой функции + function BuildNavigation(){ + global $tpl; + + // Если ноль страниц, то навигацию не формируем + if( $this->Total < 2 ) return; + + // Отчищаем старую сгенерированную навигацию + //$tpl->result[ $this->Compile ] = ""; + + // Чтобы не было недоразумений + if( $this->Page < 1 ) $this->Page = 1; + if( $this->Page > $this->Total ) $this->Page = $this->Total; + + $first = $this->Page - 4; // Сколько страниц выводится слева от активной + $last = $this->Page + 5; // Сколько страниц выводится справа от активной + $PPage = $this->CNPage( $this->Page - 1 , "", "url" ); // Предыдущая страница + $NPage = $this->CNPage( $this->Page + 1 , "", "url" ); // Следующая страница + $PageMin = 8; // Минимально значение для начала пагинации + $PageMax = $this->Total - 8; // Максимально значение для начала пагинации + $divider = "... "; // На что заменяем пробелы + + // Подгрузка шаблона + $tpl->load_template( $this->Tpl ); + + // Предыдущая страница + if( $this->Page > 1 ) + $tpl->set_block( "'\[prev-link\](.*?)\[/prev-link\]'si", "\\1" ); + else + $tpl->set_block( "'\[prev-link\](.*?)\[/prev-link\]'si", "\\1" ); + + // Слудеющая страница + if( $this->Page < $this->Total ) + $tpl->set_block( "'\[next-link\](.*?)\[/next-link\]'si", "\\1" ); + else + $tpl->set_block( "'\[next-link\](.*?)\[/next-link\]'si", "\\1" ); + + // Если страниц меньше чем 10 + if( $this->Total < 10 ) + { + $navigation = $this->LPage( 1, $this->Total + 1 ); + $navigation = $navigation; + } + else + { + // По середине + if( ( $this->Page >= $PageMin - 2 ) and ( $this->Page <= $PageMax + 2 ) ) + { + $navigation = $this->LPage( $first, $last ); + $navigation = $this->CNPage( "1" ).$divider.$navigation.$divider.$this->CNPage( $this->Total ); + } + // Если страница не больше 8 - ой + elseif( $this->Page < $PageMin ) + { + $navigation = $this->LPage( 1, $PageMin + 1 ); + $navigation = $navigation.$divider.$this->CNPage( $this->Total ); + } + // Если страница больше пред 8 - ми последней + elseif( $this->Page > $PageMax ) + { + $navigation = $this->LPage( $PageMax, $this->Total + 1 ); + $navigation = $this->CNPage( "1" ).$divider.$navigation; + } + } + + // Назначение тегов для шаблона + $tpl->set( "{pages}", $navigation ); + $tpl->set( "{page}", $this->Page ); + $tpl->set( "{count_page}", $this->Total ); + + if( $this->Total < 2 ) + { + $tpl->set_block( "'\[page\](.*?)\[/page\]'si", "" ); + } + else + { + $tpl->set( "[page]", "" ); + $tpl->set( "[/page]", "" ); + } + + // Формирование шаблона + $tpl->compile( $this->Compile ); + + // Очистка класса шаблонов от навигации + $tpl->clear(); + + // Очистка навигации + unset( $navigation ); + } +} + +?> \ No newline at end of file diff --git a/system/classes/parse.class.php b/system/classes/parse.class.php new file mode 100644 index 0000000..9d0d337 --- /dev/null +++ b/system/classes/parse.class.php @@ -0,0 +1,1028 @@ + '8', 2 => '10', 3 => '12', 4 => '14', 5 => '18', 6 => '24', 7 => '36' ); + + function ParseFilter($tagsArray = array(), $attrArray = array(), $tagsMethod = 0, $attrMethod = 0, $xssAuto = 1) { + for($i = 0; $i < count( $tagsArray ); $i ++) + $tagsArray[$i] = strtolower( $tagsArray[$i] ); + for($i = 0; $i < count( $attrArray ); $i ++) + $attrArray[$i] = strtolower( $attrArray[$i] ); + $this->tagsArray = ( array ) $tagsArray; + $this->attrArray = ( array ) $attrArray; + $this->tagsMethod = $tagsMethod; + $this->attrMethod = $attrMethod; + $this->xssAuto = $xssAuto; + } + + function process($source) { + if( function_exists( "get_magic_quotes_gpc" ) && get_magic_quotes_gpc() ) $source = stripslashes( $source ); + $source = $this->remove( $this->decode( $source ) ); + if( $this->code_count ) { + foreach ( $this->code_text as $key_find => $key_replace ) { + $find[] = $key_find; + $replace[] = $key_replace; + } + $source = str_replace( $find, $replace, $source ); + } + + $this->code_count = 0; + $this->code_text = array (); + $source = preg_replace( "#\{include#i", "{include", $source ); + + $source = preg_replace( "#", "?>", $source ); + + $source = addslashes( $source ); + return $source; + + } + + function remove($source) { + $loopCounter = 0; + while ( $source != $this->filterTags( $source ) ) { + $source = $this->filterTags( $source ); + $loopCounter ++; + } + return $source; + } + + function filterTags($source) { + $preTag = NULL; + $postTag = $source; + $tagOpen_start = strpos( $source, '<' ); + while ( $tagOpen_start !== FALSE ) { + $preTag .= substr( $postTag, 0, $tagOpen_start ); + $postTag = substr( $postTag, $tagOpen_start ); + $fromTagOpen = substr( $postTag, 1 ); + $tagOpen_end = strpos( $fromTagOpen, '>' ); + if( $tagOpen_end === false ) break; + $tagOpen_nested = strpos( $fromTagOpen, '<' ); + if( ($tagOpen_nested !== false) && ($tagOpen_nested < $tagOpen_end) ) { + $preTag .= substr( $postTag, 0, ($tagOpen_nested + 1) ); + $postTag = substr( $postTag, ($tagOpen_nested + 1) ); + $tagOpen_start = strpos( $postTag, '<' ); + continue; + } + $tagOpen_nested = (strpos( $fromTagOpen, '<' ) + $tagOpen_start + 1); + $currentTag = substr( $fromTagOpen, 0, $tagOpen_end ); + $tagLength = strlen( $currentTag ); + if( ! $tagOpen_end ) { + $preTag .= $postTag; + $tagOpen_start = strpos( $postTag, '<' ); + } + $tagLeft = $currentTag; + $attrSet = array (); + $currentSpace = strpos( $tagLeft, ' ' ); + if( substr( $currentTag, 0, 1 ) == "/" ) { + $isCloseTag = TRUE; + list ( $tagName ) = explode( ' ', $currentTag ); + $tagName = substr( $tagName, 1 ); + } else { + $isCloseTag = FALSE; + list ( $tagName ) = explode( ' ', $currentTag ); + } + if( (! preg_match( "/^[a-z][a-z0-9]*$/i", $tagName )) || (! $tagName) || ((in_array( strtolower( $tagName ), $this->tagBlacklist )) && ($this->xssAuto)) ) { + $postTag = substr( $postTag, ($tagLength + 2) ); + $tagOpen_start = strpos( $postTag, '<' ); + continue; + } + while ( $currentSpace !== FALSE ) { + $fromSpace = substr( $tagLeft, ($currentSpace + 1) ); + $nextSpace = strpos( $fromSpace, ' ' ); + $openQuotes = strpos( $fromSpace, '"' ); + $closeQuotes = strpos( substr( $fromSpace, ($openQuotes + 1) ), '"' ) + $openQuotes + 1; + if( strpos( $fromSpace, '=' ) !== FALSE ) { + if( ($openQuotes !== FALSE) && (strpos( substr( $fromSpace, ($openQuotes + 1) ), '"' ) !== FALSE) ) $attr = substr( $fromSpace, 0, ($closeQuotes + 1) ); + else $attr = substr( $fromSpace, 0, $nextSpace ); + } else + $attr = substr( $fromSpace, 0, $nextSpace ); + if( ! $attr ) $attr = $fromSpace; + $attrSet[] = $attr; + $tagLeft = substr( $fromSpace, strlen( $attr ) ); + $currentSpace = strpos( $tagLeft, ' ' ); + } + $tagFound = in_array( strtolower( $tagName ), $this->tagsArray ); + if( (! $tagFound && $this->tagsMethod) || ($tagFound && ! $this->tagsMethod) ) { + if( ! $isCloseTag ) { + $attrSet = $this->filterAttr( $attrSet, strtolower( $tagName ) ); + $preTag .= '<' . $tagName; + for($i = 0; $i < count( $attrSet ); $i ++) + $preTag .= ' ' . $attrSet[$i]; + if( strpos( $fromTagOpen, "'; + else $preTag .= ' />'; + } else + $preTag .= ''; + } + $postTag = substr( $postTag, ($tagLength + 2) ); + $tagOpen_start = strpos( $postTag, '<' ); + } + $preTag .= $postTag; + return $preTag; + } + + function filterAttr($attrSet, $tagName) { + + global $config; + + $newSet = array (); + for($i = 0; $i < count( $attrSet ); $i ++) { + if( ! $attrSet[$i] ) continue; + + $attrSet[$i] = trim( $attrSet[$i] ); + + $exp = strpos( $attrSet[$i], '=' ); + if( $exp === false ) $attrSubSet = Array ($attrSet[$i] ); + else { + $attrSubSet = Array (); + $attrSubSet[] = substr( $attrSet[$i], 0, $exp ); + $attrSubSet[] = substr( $attrSet[$i], $exp + 1 ); + } + $attrSubSet[1] = stripslashes( $attrSubSet[1] ); + + list ( $attrSubSet[0] ) = explode( ' ', $attrSubSet[0] ); + + $attrSubSet[0] = strtolower( $attrSubSet[0] ); + + if( (! preg_match( "/^[a-z]*$/i", $attrSubSet[0] )) || (($this->xssAuto) && ((in_array( $attrSubSet[0], $this->attrBlacklist )) || (substr( $attrSubSet[0], 0, 2 ) == 'on'))) ) continue; + if( $attrSubSet[1] ) { + $attrSubSet[1] = str_replace( '&#', '', $attrSubSet[1] ); + $attrSubSet[1] = preg_replace( '/\s+/', ' ', $attrSubSet[1] ); + $attrSubSet[1] = str_replace( '"', '', $attrSubSet[1] ); + if( (substr( $attrSubSet[1], 0, 1 ) == "'") && (substr( $attrSubSet[1], (strlen( $attrSubSet[1] ) - 1), 1 ) == "'") ) $attrSubSet[1] = substr( $attrSubSet[1], 1, (strlen( $attrSubSet[1] ) - 2) ); + } + + if( ((strpos( strtolower( $attrSubSet[1] ), 'expression' ) !== false) && ($attrSubSet[0] == 'style')) || (strpos( strtolower( $attrSubSet[1] ), 'javascript:' ) !== false) || (strpos( strtolower( $attrSubSet[1] ), 'behaviour:' ) !== false) || (strpos( strtolower( $attrSubSet[1] ), 'vbscript:' ) !== false) || (strpos( strtolower( $attrSubSet[1] ), 'mocha:' ) !== false) || (strpos( strtolower( $attrSubSet[1] ), 'data:' ) !== false and $attrSubSet[0] == "href") || (strpos( strtolower( $attrSubSet[1] ), 'data:' ) !== false and $attrSubSet[0] == "src") || ($attrSubSet[0] == "href" and strpos( strtolower( $attrSubSet[1] ), $config['admin_path'] ) !== false and preg_match( "/[?&%<\[\]]/", $attrSubSet[1] )) || (strpos( strtolower( $attrSubSet[1] ), 'livescript:' ) !== false) ) continue; + + $attrFound = in_array( $attrSubSet[0], $this->attrArray ); + if( (! $attrFound && $this->attrMethod) || ($attrFound && ! $this->attrMethod) ) { + if( $attrSubSet[1] ) $newSet[] = $attrSubSet[0] . '="' . $attrSubSet[1] . '"'; + elseif( $attrSubSet[1] == "0" ) $newSet[] = $attrSubSet[0] . '="0"'; + else $newSet[] = $attrSubSet[0] . '=""'; + } + } + ; + return $newSet; + } + + function decode($source) { + global $config; + + if( $this->allow_code ) + $source = preg_replace_callback( "#\[code\](.+?)\[/code\]#is", array( &$this, 'code_tag'), $source ); + + if( $this->safe_mode AND !$this->wysiwyg ) { + + $source = htmlspecialchars( $source, ENT_QUOTES, $config['charset'] ); + $source = str_replace( '&', '&', $source ); + + } else { + + $source = str_replace( "<>", "<>", str_replace( ">>", ">>", str_replace( "<<", "<<", $source ) ) ); + $source = str_replace( "\"$smile\""; + } + + $source = preg_replace( $find, $replace, $source ); + $source = preg_replace( "#allow_php ) { + $source = str_replace( "", "?>", $source ); + } + + //if ($config['parse_links']) { + // $source = preg_replace("#(^|\s|>)((http|https|ftp)://\w+[^\s\[\]\<]+)#i", '\\1[leech]\\2[/leech]', $source); + //} + + $count_start = substr_count ($source, "[quote"); + $count_end = substr_count ($source, "[/quote]"); + if ($count_start AND $count_start == $count_end) { + $source = preg_replace( "#\[quote\]#i", "
    ", $source ); + $source = preg_replace( "#\[quote=(.+?)\]#i", "
    {$lang['i_quote']} \\1
    ", $source ); + $source = preg_replace( "#\[/quote\]#i", "
    ", $source ); + } + + $count_start = substr_count ($source, "[screens"); + $count_end = substr_count ($source, "[/screens]"); + if ($count_start AND $count_start == $count_end) { + $source = preg_replace( "#\[screens\]#i", "
    ", $source ); + $source = preg_replace( "#\[/screens\]#i", "
    ", $source ); + } + + $count_start = substr_count ($source, "[spoiler"); + $count_end = substr_count ($source, "[/spoiler]"); + if ($count_start AND $count_start == $count_end) { + $source = preg_replace( "#\[spoiler\]#ie", "\$this->build_spoiler('')", $source ); + $source = preg_replace( "#\[spoiler=(.+?)\]#ie", "\$this->build_spoiler('\\1')", $source ); + $source = preg_replace( "#\[/spoiler\]#i", "
    ", $source ); + } + + $source = preg_replace( "#\[code\](.+?)\[/code\]#is", "
    \\1
    ", $source ); + $source = preg_replace( "#\[(left|right|center)\](.+?)\[/\\1\]#is", "
    \\2
    ", $source ); + + $source = preg_replace( "#\[b\](.+?)\[/b\]#is", "\\1", $source ); + $source = preg_replace( "#\[i\](.+?)\[/i\]#is", "\\1", $source ); + $source = preg_replace( "#\[u\](.+?)\[/u\]#is", "\\1", $source ); + $source = preg_replace( "#\[s\](.+?)\[/s\]#is", "\\1", $source ); + + $source = preg_replace( "#\[kp=(.+?)\]#is", "", $source ); + $source = preg_replace( "#\[game=(.+?)\]#is", "", $source ); + + if( $this->allow_url ) { + $source = preg_replace( "#\[url\](\S.+?)\[/url\]#ie", "\$this->build_url(array('html' => '\\1', 'show' => '\\1'))", $source ); + $source = preg_replace( "#\[url\s*=\s*\"\;\s*(\S+?)\s*\"\;\s*\](.*?)\[\/url\]#ie", "\$this->build_url(array('html' => '\\1', 'show' => '\\2'))", $source ); + $source = preg_replace( "#\[url\s*=\s*(\S.+?)\s*\](.*?)\[\/url\]#ie", "\$this->build_url(array('html' => '\\1', 'show' => '\\2'))", $source ); + $source = preg_replace( "#\[leech\](\S.+?)\[/leech\]#ie", "\$this->build_url(array('html' => '\\1', 'show' => '\\1', 'leech' => '1'))", $source ); + $source = preg_replace( "#\[leech\s*=\s*\"\;\s*(\S+?)\s*\"\;\s*\](.*?)\[\/leech\]#ie", "\$this->build_url(array('html' => '\\1', 'show' => '\\2', 'leech' => '1'))", $source ); + $source = preg_replace( "#\[leech\s*=\s*(\S.+?)\s*\](.*?)\[\/leech\]#ie", "\$this->build_url(array('html' => '\\1', 'show' => '\\2', 'leech' => '1'))", $source ); + } else { + if( stristr( $source, "[url" ) !== false ) $this->not_allowed_tags = true; + if( stristr( $source, "[leech" ) !== false ) $this->not_allowed_tags = true; + if( stristr( $source, "<a" ) !== false ) $this->not_allowed_tags = true; + } + + if( $this->allow_image ) { + $source = preg_replace( "#\[img\](.+?)\[/img\]#ie", "\$this->build_image('\\1')", $source ); + $source = preg_replace( "#\[img=(.+?)\](.+?)\[/img\]#ie", "\$this->build_image('\\2', '\\1')", $source ); + } else { + if( stristr( $source, "[img" ) !== false ) $this->not_allowed_tags = true; + if( stristr( $source, "<img" ) !== false ) $this->not_allowed_tags = true; + } + + $source = preg_replace( "#\[email\s*=\s*\"\;([\.\w\-]+\@[\.\w\-]+\.[\.\w\-]+)\s*\"\;\s*\](.*?)\[\/email\]#ie", "\$this->build_email(array('html' => '\\1', 'show' => '\\2'))", $source ); + $source = preg_replace( "#\[email\s*=\s*([\.\w\-]+\@[\.\w\-]+\.[\w\-]+)\s*\](.*?)\[\/email\]#ie", "\$this->build_email(array('html' => '\\1', 'show' => '\\2'))", $source ); + + if( ! $this->safe_mode ) { + $source = preg_replace( "'\[thumb\]([^\[]*)([/\\\\])(.*?)\[/thumb\]'ie", "\$this->build_thumb('\$1\$2\$3', '\$1\$2thumbs\$2\$3')", $source ); + $source = preg_replace( "'\[thumb=(.*?)\]([^\[]*)([/\\\\])(.*?)\[/thumb\]'ie", "\$this->build_thumb('\$2\$3\$4', '\$2\$3thumbs\$3\$4', '\$1')", $source ); + $source = preg_replace( "#\[video\s*=\s*(\S.+?)\s*\]#ie", "\$this->build_video('\\1')", $source ); + $source = preg_replace( "#\[audio\s*=\s*(\S.+?)\s*\]#ie", "\$this->build_audio('\\1')", $source ); + $source = preg_replace( "#\[flash=([^\]]+)\](.+?)\[/flash\]#ies", "\$this->build_flash('\\1', '\\2')", $source ); + $source = preg_replace( "#\[media=([^\]]+)\]#ies", "\$this->build_media('\\1')", $source ); + + $source = preg_replace( "#\[size=([^\]]+)\]#ie", "\$this->font_change(array('tag'=>'size','1'=>'\\1'))", $source ); + $source = preg_replace( "#\[font=([^\]]+)\]#ie", "\$this->font_change(array('tag'=>'font','1'=>'\\1'))", $source ); + $source = str_replace("[/size]", "", $source); + $source = str_replace("[/font]", "", $source); + } + + $source = preg_replace( "#\[color=([^\]]+)\]#ie", "\$this->font_change(array('tag'=>'color','1'=>'\\1'))", $source ); + $source = str_replace("[/color]", "", $source); + + $source = str_replace( "__CODENR__", "\r", $source ); + $source = str_replace( "__CODENN__", "\n", $source ); + + if( $this->filter_mode ) $source = $this->word_filter( $source ); + + return trim( $source ); + + } + + function decodeBBCodes($txt, $use_html = TRUE, $wysiwig = "no") { + global $config; + + $find = array (); + $result = array (); + $txt = stripslashes( $txt ); + if( $this->filter_mode ) $txt = $this->word_filter( $txt, false ); + + $txt = preg_replace( "#(.+?)#ie", "\$this->decode_thumb('\\1')", $txt ); + $txt = preg_replace( "#(.+?)#ie", "\$this->decode_newthumb('\\1')", $txt ); + + $txt = preg_replace( "#(.+?)#", '[screens]', $txt ); + $txt = preg_replace( "#(.+?)#", '[/screens]', $txt ); + + $txt = preg_replace( "#(.+?)#", '[quote]', $txt ); + $txt = preg_replace( "#(.+?)#", "[quote=\\1]", $txt ); + $txt = preg_replace( "#(.+?)#", '[/quote]', $txt ); + $txt = preg_replace( "#(.+?)#", '[code]', $txt ); + $txt = preg_replace( "#(.+?)#", '[/code]', $txt ); + $txt = preg_replace( "#(.+?)#ie", "\$this->decode_leech('\\1\\2', '\\3')", $txt ); + $txt = preg_replace( "#(.+?)src=\"(.+?)\"(.+?)#is", '[video=\\2]', $txt ); + $txt = preg_replace( "#(.+?)#is", '[video=\\1]', $txt ); + $txt = preg_replace( "#(.+?)#is", '[audio=\\1]', $txt ); + $txt = preg_replace( "#(.+?)#ies", "\$this->decode_dle_img('\\1')", $txt ); + $txt = preg_replace( "#(.+?)#is", '[media=\\1]', $txt ); + $txt = preg_replace( "#(.+?)#is", '[media=\\1]', $txt ); + $txt = preg_replace( "#(.+?)#ies", "\$this->decode_flash('\\1')", $txt ); + $txt = preg_replace( "#(.+?)#is", '[spoiler]', $txt ); + $txt = preg_replace( "#(.+?)#is", '[spoiler=\\1]', $txt ); + $txt = str_replace( "", '[/spoiler]', $txt ); + + $txt = preg_replace( "#(.+?)#is", "[kp=\\1]", $txt ); + $txt = preg_replace( "#(.+?)#is", "[game=\\1]", $txt ); + $txt = preg_replace( "#(.+?)#is", "[i]\\1[/i]", $txt ); + $txt = preg_replace( "#(.+?)#is", "[b]\\1[/b]", $txt ); + $txt = preg_replace( "#(.+?)#is", "[s]\\1[/s]", $txt ); + $txt = preg_replace( "#(.+?)#is", "[u]\\1[/u]", $txt ); + $txt = preg_replace( "#
    (.+?)
    #is", "[center]\\1[/center]", $txt ); + $txt = preg_replace( "##ie", "\$this->decode_img('\\1', '\\2')", $txt ); + + $txt = preg_replace( "#(.+?)#", "[email=\\1]\\2[/email]", $txt ); + $txt = preg_replace( "#(.+?)#ie", "\$this->decode_url('\\1\\2', '\\3')", $txt ); + $txt = preg_replace( "#(.+?)#ie", "\$this->decode_url('\\1\\2', '\\3')", $txt ); + + $txt = preg_replace( "#(.+?)#", "[size=\\1]", $txt ); + $txt = preg_replace( "#(.+?)#", "[color=\\1]", $txt ); + $txt = preg_replace( "#(.+?)#", "[font=\\1]", $txt ); + + $txt = str_replace( "", "[/size]", $txt ); + $txt = str_replace( "", "[/color]", $txt ); + $txt = str_replace( "", "[/font]", $txt ); + + while ( preg_match( "#
    (.+?)
    #is", $txt ) ) { + $txt = preg_replace( "#
    (.+?)
    #is", "[left]\\1[/left]", $txt ); + } + while ( preg_match( "#
    (.+?)
    #is", $txt ) ) { + $txt = preg_replace( "#
    (.+?)
    #is", "[right]\\1[/right]", $txt ); + } + while ( preg_match( "#
    (.+?)
    #is", $txt ) ) { + $txt = preg_replace( "#
    (.+?)
    #is", "[center]\\1[/center]", $txt ); + } + + $txt = preg_replace( "#(.+?)#is", ':\\1:', $txt ); + $smilies_arr = explode( ",", $config['smilies'] ); + foreach ( $smilies_arr as $smile ) { + $smile = trim( $smile ); + $replace[] = ":$smile:"; + $find[] = "#['\"]"#is"; + } + $txt = preg_replace( $find, $replace, $txt ); + + if( ! $use_html ) { + $txt = str_ireplace( "
    ", "\n", $txt ); + $txt = str_ireplace( "
    ", "\n", $txt ); + } + + if (!$this->safe_mode) $txt = htmlspecialchars( $txt, ENT_QUOTES ); + $txt = preg_replace( "#\[code\](.+?)\[/code\]#ies", "\$this->decode_code('\\1', '{$use_html}')", $txt ); + + return trim( $txt ); + } + + function font_change($tags) { + if( ! is_array( $tags ) ) {return;} + $style = $tags['1']; + $type = $tags['tag']; + $style = str_replace( '"', '', $style ); + $style = preg_replace( "/[&\(\)\.\%\[\]<>\'\"]/", "", preg_replace( "#^(.+?)(?:;|$)#", "\\1", $style ) ); + if( $type == 'size' ) { + $style = intval( $style ); + if( $this->font_sizes[$style] ) { + $real = $this->font_sizes[$style]; + } else {$real = 12;} + return ""; + } + if( $type == 'font' ) { + $style = preg_replace( "/[^\d\w\#\-\_\s]/s", "", $style ); + return ""; + } + $style = preg_replace( "/[^\d\w\#\s]/s", "", $style ); + return ""; + } + + function build_email($url = array()) { + $url['html'] = $this->clear_url( $url['html'] ); + $url['show'] = stripslashes( $url['show'] ); + return "{$url['show']}"; + } + + function build_flash($size, $url) { + $size = explode(",", $size); + $width = trim(intval($size[0])); + $height = trim(intval($size[1])); + if (!$width OR !$height) return "[flash=".implode(",",$size)."]".$url."[/flash]"; + $url = $this->clear_url( urldecode( $url ) ); + if( $url == "" ) return; + $type = explode( ".", $url ); + $type = strtolower( end( $type ) ); + if ( strtolower($type) != "swf" ){return "[flash=".implode(",",$size)."]".$url."[/flash]";} + return ""; + } + + function decode_flash($url) + { + $url = explode( "||", $url ); + return '[flash='.$url[0].','.$url[1].']'.$url[2].'[/flash]'; + } + + function build_media($url) { + $url = $this->clear_url( urldecode( $url ) ); + $url = str_replace("&","&", $url ); + + if( $url == "" ) return; + $source = @parse_url ( $url ); + + $source['host'] = str_replace( "www.", "", strtolower($source['host']) ); + + if ($source['host'] != "youtube.com" AND $source['host'] != "vk.com") return "[media=".$url."]"; + + if ($source['host'] == "youtube.com") { + $a = explode('&', $source['query']); + $i = 0; + + while ($i < count($a)) { + $b = explode('=', $a[$i]); + if ($b[0] == "v") $video_link = $b[1]; + $i++; + } + + return ''; + } + elseif ($source['host'] == "vk.com") { + return ''; + } + } + + function build_url($url = array()) { + global $config; + + $skip_it = 0; + + if( preg_match( "/([\.,\?]|!)$/", $url['show'], $match ) ) { + $url['end'] .= $match[1]; + $url['show'] = preg_replace( "/([\.,\?]|!)$/", "", $url['show'] ); + } + + $url['html'] = $this->clear_url( $url['html'] ); + $url['show'] = stripslashes( $url['show'] ); + + if( $this->safe_mode ) { + $url['show'] = str_replace( " ", " ", $url['show'] ); + if (strlen(trim($url['show'])) < 3 ) + return "[url=" . $url['html'] . "]" . $url['show'] . "[/url]"; + } + + if( strpos( $url['html'], $config['http_home_url'] ) !== false AND strpos( $url['html'], $config['admin_path'] ) !== false ) { + return "[url=" . $url['html'] . "]" . $url['show'] . "[/url]"; + } + + if( ! preg_match( "#^(http|news|https|ed2k|ftp|aim|mms)://|(magnet:?)#", $url['html'] ) AND $url['html'][0] != "/" AND $url['html'][0] != "#") { + $url['html'] = 'http://' . $url['html']; + } + + if ($url['html'] == 'http://' ) return "[url=" . $url['html'] . "]" . $url['show'] . "[/url]"; + + $url['show'] = str_replace( "&amp;", "&", $url['show'] ); + $url['show'] = preg_replace( "/javascript:/i", "javascript: ", $url['show'] ); + + if( preg_match( "/^check_home( $url['html'] ) OR $url['html'][0] == "/" OR $url['html'][0] == "#"){ + return "" . $show . "" . $url['end']; + }else{ + $url['html'] = $config['http_home_url'] . "out.php?url=" . rawurlencode( base64_encode( $url['html'] ) ); + return "" . $show . "" . $url['end']; + } + } + + function code_tag($txt = "") { + if( $txt == "" ) { + return; + } + $this->code_count ++; + $txt = str_replace( "&", "&", $txt ); + $txt = str_replace( "<", "<", $txt ); + $txt = str_replace( "'", "'", $txt ); + $txt = str_replace( ">", ">", $txt ); + $txt = str_replace( "<", "<", $txt ); + $txt = str_replace( ">", ">", $txt ); + $txt = str_replace( """, """, $txt ); + $txt = str_replace( "\\\"", """, $txt ); + $txt = str_replace( ":", ":", $txt ); + $txt = str_replace( "[", "[", $txt ); + $txt = str_replace( "]", "]", $txt ); + $txt = str_replace( ")", ")", $txt ); + $txt = str_replace( "(", "(", $txt ); + $txt = str_replace( "\r", "", $txt ); + $txt = str_replace( "\n", "
    ", $txt ); + $txt = preg_replace( "#\s{1};#", ";", $txt ); + $txt = preg_replace( "#\t#", "    ", $txt ); + $txt = preg_replace( "#\s{2}#", "  ", $txt ); + + $p = "[code]{" . $this->code_count . "}[/code]"; + + $this->code_text[$p] = "[code]{$txt}[/code]"; + + return $p; + } + + function decode_code($txt = "", $use_html) { + +// $txt = stripslashes( $txt ); + $txt = str_replace( "&", "&", $txt ); + + if( $use_html ) { + $txt = str_replace( "<br />", "\n", $txt ); + } + + return "[code]".$txt."[/code]"; + } + + function build_video($url) { + global $config; + + $option = explode( "|", trim( $url ) ); + + $url = $this->clear_url( urldecode( $option[0] ) ); + + $type = explode( ".", $url ); + $type = strtolower( end( $type ) ); + + if( preg_match( "/[?&;%<\[\]]/", $url ) ) { + + return "[video=" . $url . "]"; + + } + + if( $option[1] != "" ) { + + $option[1] = htmlspecialchars( strip_tags( stripslashes( $option[1] ) ), ENT_QUOTES ); + $decode_url = $url . "|" . $option[1]; + + } else + $decode_url = $url; + + if( $type == "flv" or $type == "f4v" or $type == "mp4" or $type == "mov" or $type == "m4a" or $type == "mp4v" or $type == "3gp" or $type == "3g2" ) { + $url = array (); + $url = implode( ", ", $url ); + return "
    "; + } elseif( $type == "avi" or $type == "divx" ) { + + return "video_config['width']}\" height=\"{$this->video_config['height']}\" codebase=\"http://go.divx.com/plugin/DivXBrowserPlugin.cab\"> + + + video_config['play']}\" /> + + + video_config['width']}\" height=\"{$this->video_config['height']}\" mode=\"zero\" autoPlay=\"{$this->video_config['play']}\" previewImage=\"{$option[1]}\" pluginspage=\"http://go.divx.com/plugin/download/\"> + + "; + + } else { + + return "video_config['width']}\" height=\"{$this->video_config['height']}\" classid=\"CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6\" standby=\"Loading Microsoft Windows Media Player components...\" type=\"application/x-oleobject\"> + + video_config['play']}\" /> + + + + + video_config['width']}\" height=\"{$this->video_config['height']}\" type=\"application/x-mplayer2\" autorewind=\"1\" showstatusbar=\"1\" showcontrols=\"1\" autostart=\"{$this->video_config['play']}\" allowchangedisplaysize=\"1\" volume=\"70\" stretchtofit=\"1\"> + "; + } + + } + + function build_audio($url) { + global $config; + + if( $url == "" ) return; + + if( preg_match( "/[?&;%<\[\]]/", $url ) ) { + + return "[audio=" . $url . "]"; + } + + $url = $this->clear_url( urldecode( $url ) ); + + $list = explode( ",", $url ); + $url = urlencode(trim($list[0])); + + $list = implode( ",", $list ); + $id_player = md5( microtime() ); + $color = array (); + + return ""; + } + + function build_image($url = "", $align = "") { + global $config; + + $url = trim( $url ); + $url = urldecode( $url ); + $option = explode( "|", trim( $align ) ); + $align = $option[0]; + + if( $align != "left" and $align != "right" ) $align = ''; + + if( preg_match( "/[?&;%<\[\]]/", $url ) ) { + if( $align != "" ) return "[img=" . $align . "]" . $url . "[/img]"; + else return "[img]" . $url . "[/img]"; + } + + $url = $this->clear_url( urldecode( $url ) ); + $info = $url; + $info = $info."|".$align; + if( $url == "" ) return; + + if( $option[1] != "" ) { + $alt = htmlspecialchars( strip_tags( stripslashes( $option[1] ) ), ENT_QUOTES ); + $info = $info."|".$alt; + $caption = "" . $alt . ""; + $alt = "alt=\"" . $alt . "\" title=\"" . $alt . "\" "; + } else { + $alt = htmlspecialchars( strip_tags( stripslashes( $_POST['title'] ) ), ENT_QUOTES ); + $caption = ""; + $alt = "alt=\"" . $alt . "\" title=\"" . $alt . "\" "; + } + + if( intval( $config['tag_img_width'] ) ) { + if (clean_url( $config['http_home_url'] ) != clean_url ( $url ) ) { + $img_info = @getimagesize( $url ); + if( $img_info[0] > $config['tag_img_width'] ) { + $out_heigh = ($img_info[1] / 100) * ($config['tag_img_width'] / ($img_info[0] / 100)); + $out_heigh = floor( $out_heigh ); + if( $align == '' ) return "{$caption}"; + else return "{$caption}"; + } + } + } + + + if( $align == '' ) return ""; + else return ""; + } + + function decode_dle_img($txt) { + $txt = stripslashes( $txt ); + $txt = explode("|", $txt ); + $url = $txt[0]; + $align = $txt[1]; + $alt = $txt[2]; + $extra = ""; + + if( ! $align and ! $alt ) return "[img]" . $url . "[/img]"; + + if( $align ) $extra = $align; + if( $alt ) { + + $alt = str_replace("'", "'", $alt); + $alt = str_replace(""", '"', $alt); + $alt = str_replace("&", '&', $alt); + $extra .= "|" . $alt; + } + return "[img=" . $extra . "]" . $url . "[/img]"; + } + + function build_thumb($gurl = "", $url = "", $align = "") { + $url = trim( $url ); + $gurl = trim( $gurl ); + $option = explode( "|", trim( $align ) ); + + $align = $option[0]; + + if( $align != "left" and $align != "right" ) $align = ''; + + if( preg_match( "/[?&;%<\[\]]/", $gurl ) ) { + if( $align != "" ) return "[thumb=" . $align . "]" . $gurl . "[/thumb]"; + else return "[thumb]" . $gurl . "[/thumb]"; + } + + $url = $this->clear_url( urldecode( $url ) ); + $gurl = $this->clear_url( urldecode( $gurl ) ); + + if( $gurl == "" or $url == "" ) return; + + if( $option[1] != "" ) { + $alt = htmlspecialchars( strip_tags( stripslashes( $option[1] ) ), ENT_QUOTES ); + $caption = "" . $alt . ""; + $alt = "alt=\"" . $alt . "\" title=\"" . $alt . "\" "; + } else { + $alt = htmlspecialchars( strip_tags( stripslashes( $_POST['title'] ) ), ENT_QUOTES ); + $alt = "alt='" . $alt . "' title='" . $alt . "' "; + $caption = ""; + } + + if( $align == '' ) return "{$caption}"; + else return "{$caption}"; + } + + function build_spoiler($title = "") { + global $lang; + + $title = trim( $title ); + + $title = stripslashes( $title ); + $title = str_replace( "&amp;", "&", $title ); + $title = preg_replace( "/javascript:/i", "javascript: ", $title ); + + $id_spoiler = "sp".md5( microtime() ); + + if( ! $title ) {return "
    \"\" " . $lang['spoiler_title'] . "
    "; + } else {return "
    \"\" " . $title . "
    ";} + } + + function clear_url($url) { + + $url = strip_tags( trim( stripslashes( $url ) ) ); + + $url = str_replace( '\"', '"', $url ); + $url = str_replace( "'", "", $url ); + $url = str_replace( '"', "", $url ); + + if( ! $this->safe_mode or $this->wysiwyg ) {$url = htmlspecialchars( $url, ENT_QUOTES );} + + $url = str_ireplace( "document.cookie", "document.cookie", $url ); + $url = str_replace( " ", "%20", $url ); + $url = str_replace( "<", "<", $url ); + $url = str_replace( ">", ">", $url ); + $url = preg_replace( "/javascript:/i", "javascript:", $url ); + $url = preg_replace( "/data:/i", "data:", $url ); + + return $url; + } + + function decode_leech($url = "", $show = "") { + + $show = stripslashes( $show ); + + if( $this->leech_mode ) return "[url=" . $url . "]" . $show . "[/url]"; + + $url = explode( "url=", $url ); + $url = end( $url ); + $url = rawurldecode( $url ); + $url = base64_decode( $url ); + $url = str_replace("&","&", $url ); + + return "[url=" . $url . "]" . $show . "[/url]"; + } + + function decode_url($url = "", $show = "") { + + $show = stripslashes( $show ); + + $url = str_replace("&","&", $url ); + + return "[url=" . $url . "]" . $show . "[/url]"; + } + + function decode_thumb($txt) { + $align = false; + $alt = false; + $extra = ""; + $txt = stripslashes( $txt ); + + $url = str_replace( "safe_mode ) $allow_find = false; + if ( $word_arr[5] == 2 AND !$this->safe_mode ) $allow_find = false; + + if ( $allow_find ) { + + if( $word_arr[3] ) { + + $find_text = "#(^|\b|\s|\
    )" . preg_quote( $word_arr[1], "#" ) . "(\b|!|\?|\.|,|$)#".$register; + + if( $word_arr[2] == "" ) $replace_text = "\\1"; + else $replace_text = "\\1" . $word_arr[2] . ""; + + } else { + + $find_text = "#(" . preg_quote( $word_arr[1], "#" ) . ")#".$register; + + if( $word_arr[2] == "" ) $replace_text = ""; + else $replace_text = "" . $word_arr[2] . ""; + + } + + if ( $word_arr[6] ) { + + if ( preg_match($find_text, $source) ) { + + $this->not_allowed_text = true; + return $source; + + } + + } else { + + $find[] = $find_text; + $replace[] = $replace_text; + } + + } + + } + + if( !count( $find ) ) return $source; + + $source = preg_split( '((>)|(<))', $source, - 1, PREG_SPLIT_DELIM_CAPTURE ); + $count = count( $source ); + + for($i = 0; $i < $count; $i ++) { + if( $source[$i] == "<" or $source[$i] == "[" ) { + $i ++; + continue; + } + + if( $source[$i] != "" ) $source[$i] = preg_replace( $find, $replace, $source[$i] ); + } + + $source = join( "", $source ); + + } else { + + $source = preg_replace( "#(.+?)#", "\\1", $source ); + + } + + return $source; + } + +} +?> \ No newline at end of file diff --git a/system/classes/rss.class.php b/system/classes/rss.class.php new file mode 100644 index 0000000..d265534 --- /dev/null +++ b/system/classes/rss.class.php @@ -0,0 +1,240 @@ +max_news = $max; + + $this->xml_parser = xml_parser_create(); + xml_set_object( $this->xml_parser, $this ); + xml_set_element_handler( $this->xml_parser, "startElement", "endElement" ); + xml_set_character_data_handler( $this->xml_parser, 'elementContent' ); + $this->rss_option = xml_parser_get_option( $this->xml_parser, XML_OPTION_TARGET_ENCODING ); + + if( ! ($data = $this->_get_contents( $file )) ) { + $this->content[0]['title'] = "Fatal Error"; + $this->content[0]['description'] = "Fatal Error: could not open XML input (" . $file . ")"; + $this->content[0]['link'] = "#"; + $this->content[0]['date'] = time(); + } + + preg_replace( "#encoding=\"(.+?)\"#ie", "\$this->get_charset('\\1')", $data ); + + if( ! xml_parse( $this->xml_parser, $data ) ) { + + $error_code = xml_get_error_code( $this->xml_parser ); + $error_line = xml_get_current_line_number( $this->xml_parser ); + + if( $error_code == 4 ) { + + $this->content = array (); + $this->index = 0; + $this->tag_open = false; + $this->tagname = ""; + + $this->xml_parser = xml_parser_create(); + xml_set_object( $this->xml_parser, $this ); + xml_set_element_handler( $this->xml_parser, "startElement", "endElement" ); + xml_set_character_data_handler( $this->xml_parser, 'elementContent' ); + $this->rss_option = xml_parser_get_option( $this->xml_parser, XML_OPTION_TARGET_ENCODING ); + + $data = iconv( $this->rss_charset, "utf-8", $data ); + + if( ! xml_parse( $this->xml_parser, $data ) ) { + + $this->content[0]['title'] = "XML error in File: " . $file; + $this->content[0]['description'] = sprintf( "XML error: %s at line %d", xml_error_string( xml_get_error_code( $this->xml_parser ) ), xml_get_current_line_number( $this->xml_parser ) ); + $this->content[0]['link'] = "#"; + $this->content[0]['date'] = time(); + + } + + } else { + + $this->content[0]['title'] = "XML error in File: " . $file; + $this->content[0]['description'] = sprintf( "XML error: %s at line %d", xml_error_string( $error_code ), $error_line ); + $this->content[0]['link'] = "#"; + $this->content[0]['date'] = time(); + + } + + } + + xml_parser_free( $this->xml_parser ); + } + + function _get_contents($file) { + + $data = false; + + if( function_exists( 'curl_init' ) ) { + + $ch = curl_init(); + curl_setopt( $ch, CURLOPT_URL, $file ); + curl_setopt( $ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT'] ); + @curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1 ); + curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); + curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 10 ); + + $data = curl_exec( $ch ); + curl_close( $ch ); + + } + + if( $data ) { + + return $data; + + } else { + + $data = @file_get_contents( $file ); + + if( $data ) return $data; + else return false; + + } + + } + + function pre_parse($date) { + + global $config; + + $i = 0; + + foreach ( $this->content as $content ) { + + $content_date = strtotime( $content['date'] ); + + if( $date ) { + $this->content[$i]['date'] = time() + ($config['date_adjust'] * 60); + } else { + $this->content[$i]['date'] = $content_date; + } + + if( ! $i ) $this->lastdate = $content_date; + + if( $i and $content_date > $this->lastdate ) $this->lastdate = $content_date; + + if( $this->pre_lastdate != "" and $this->pre_lastdate >= $content_date ) { + unset( $this->content[$i] ); + $i ++; + continue; + } + + $this->content[$i]['description'] = rtrim( $this->content[$i]['description'] ); + $this->content[$i]['content'] = rtrim( $this->content[$i]['content'] ); + + if( $this->content[$i]['content'] != '' ) { + $this->content[$i]['description'] = $this->content[$i]['content']; + } + unset( $this->content[$i]['content'] ); + + if( preg_match_all( "#
    #si", $this->content[$i]['description'], $out ) ) { + + $this->content[$i]['description'] = preg_replace( "#
    #si", "", $this->content[$i]['description'] ); + $this->content[$i]['description'] = substr( $this->content[$i]['description'], 0, - 6 ); + + } + + $i ++; + } + + } + + function startElement($parser, $name, $attrs) { + + if( $name == "ITEM" ) { + $this->tag_open = true; + } + + $this->tagname = $name; + } + + function endElement($parser, $name) { + + if( $name == "ITEM" ) { + $this->index ++; + $this->tag_open = false; + } + } + + function elementContent($parser, $data) { + + if( $this->tag_open and $this->index < $this->max_news ) { + + switch ($this->tagname) { + case 'TITLE' : + $this->content[$this->index]['title'] .= $data; + break; + case 'DESCRIPTION' : + $this->content[$this->index]['description'] .= $data; + break; + case 'CONTENT:ENCODED' : + $this->content[$this->index]['content'] .= $data; + break; + case 'LINK' : + $this->content[$this->index]['link'] .= $data; + break; + case 'PUBDATE' : + $this->content[$this->index]['date'] .= $data; + break; + case 'CATEGORY' : + $this->content[$this->index]['category'] .= $data; + break; + case 'DC:CREATOR' : + $this->content[$this->index]['author'] .= $data; + break; + + } + } + + } + + function get_charset($charset) { + + if( $this->rss_charset == '' ) $this->rss_charset = strtolower( $charset ); + + } + + function convert($from, $to) { + + if( $from == '' ) return; + + if( function_exists( 'iconv' ) ) { + $i = 0; + + foreach ( $this->content as $content ) { + + if( @iconv( $from, $to . "//IGNORE", $this->content[$i]['title'] ) ) $this->content[$i]['title'] = @iconv( $from, $to . "//IGNORE", $this->content[$i]['title'] ); + + if( @iconv( $from, $to . "//IGNORE", $this->content[$i]['description'] ) ) $this->content[$i]['description'] = @iconv( $from, $to . "//IGNORE", $this->content[$i]['description'] ); + + if( $this->content[$i]['content'] and @iconv( $from, $to . "//IGNORE", $this->content[$i]['content'] ) ) $this->content[$i]['content'] = @iconv( $from, $to . "//IGNORE", $this->content[$i]['content'] ); + + if( $this->content[$i]['category'] and @iconv( $from, $to . "//IGNORE", $this->content[$i]['category'] ) ) $this->content[$i]['category'] = @iconv( $from, $to . "//IGNORE", $this->content[$i]['category'] ); + + if( $this->content[$i]['author'] and @iconv( $from, $to . "//IGNORE", $this->content[$i]['author'] ) ) $this->content[$i]['author'] = @iconv( $from, $to . "//IGNORE", $this->content[$i]['author'] ); + + $i ++; + + } + } + } +} + +?> \ No newline at end of file diff --git a/system/classes/sphinx.api.php b/system/classes/sphinx.api.php new file mode 100644 index 0000000..e8ec772 --- /dev/null +++ b/system/classes/sphinx.api.php @@ -0,0 +1,1611 @@ +=8 ) + { + $v = (int)$v; + return pack ( "NN", $v>>32, $v&0xFFFFFFFF ); + } + + // x32, int + if ( is_int($v) ) + return pack ( "NN", $v < 0 ? -1 : 0, $v ); + + // x32, bcmath + if ( function_exists("bcmul") ) + { + if ( bccomp ( $v, 0 ) == -1 ) + $v = bcadd ( "18446744073709551616", $v ); + $h = bcdiv ( $v, "4294967296", 0 ); + $l = bcmod ( $v, "4294967296" ); + return pack ( "NN", (float)$h, (float)$l ); // conversion to float is intentional; int would lose 31st bit + } + + // x32, no-bcmath + $p = max(0, strlen($v) - 13); + $lo = abs((float)substr($v, $p)); + $hi = abs((float)substr($v, 0, $p)); + + $m = $lo + $hi*1316134912.0; // (10 ^ 13) % (1 << 32) = 1316134912 + $q = floor($m/4294967296.0); + $l = $m - ($q*4294967296.0); + $h = $hi*2328.0 + $q; // (10 ^ 13) / (1 << 32) = 2328 + + if ( $v<0 ) + { + if ( $l==0 ) + $h = 4294967296.0 - $h; + else + { + $h = 4294967295.0 - $h; + $l = 4294967296.0 - $l; + } + } + return pack ( "NN", $h, $l ); +} + +/// pack 64-bit unsigned +function sphPackU64 ( $v ) +{ + assert ( is_numeric($v) ); + + // x64 + if ( PHP_INT_SIZE>=8 ) + { + assert ( $v>=0 ); + + // x64, int + if ( is_int($v) ) + return pack ( "NN", $v>>32, $v&0xFFFFFFFF ); + + // x64, bcmath + if ( function_exists("bcmul") ) + { + $h = bcdiv ( $v, 4294967296, 0 ); + $l = bcmod ( $v, 4294967296 ); + return pack ( "NN", $h, $l ); + } + + // x64, no-bcmath + $p = max ( 0, strlen($v) - 13 ); + $lo = (int)substr ( $v, $p ); + $hi = (int)substr ( $v, 0, $p ); + + $m = $lo + $hi*1316134912; + $l = $m % 4294967296; + $h = $hi*2328 + (int)($m/4294967296); + + return pack ( "NN", $h, $l ); + } + + // x32, int + if ( is_int($v) ) + return pack ( "NN", 0, $v ); + + // x32, bcmath + if ( function_exists("bcmul") ) + { + $h = bcdiv ( $v, "4294967296", 0 ); + $l = bcmod ( $v, "4294967296" ); + return pack ( "NN", (float)$h, (float)$l ); // conversion to float is intentional; int would lose 31st bit + } + + // x32, no-bcmath + $p = max(0, strlen($v) - 13); + $lo = (float)substr($v, $p); + $hi = (float)substr($v, 0, $p); + + $m = $lo + $hi*1316134912.0; + $q = floor($m / 4294967296.0); + $l = $m - ($q * 4294967296.0); + $h = $hi*2328.0 + $q; + + return pack ( "NN", $h, $l ); +} + +// unpack 64-bit unsigned +function sphUnpackU64 ( $v ) +{ + list ( $hi, $lo ) = array_values ( unpack ( "N*N*", $v ) ); + + if ( PHP_INT_SIZE>=8 ) + { + if ( $hi<0 ) $hi += (1<<32); // because php 5.2.2 to 5.2.5 is totally fucked up again + if ( $lo<0 ) $lo += (1<<32); + + // x64, int + if ( $hi<=2147483647 ) + return ($hi<<32) + $lo; + + // x64, bcmath + if ( function_exists("bcmul") ) + return bcadd ( $lo, bcmul ( $hi, "4294967296" ) ); + + // x64, no-bcmath + $C = 100000; + $h = ((int)($hi / $C) << 32) + (int)($lo / $C); + $l = (($hi % $C) << 32) + ($lo % $C); + if ( $l>$C ) + { + $h += (int)($l / $C); + $l = $l % $C; + } + + if ( $h==0 ) + return $l; + return sprintf ( "%d%05d", $h, $l ); + } + + // x32, int + if ( $hi==0 ) + { + if ( $lo>0 ) + return $lo; + return sprintf ( "%u", $lo ); + } + + $hi = sprintf ( "%u", $hi ); + $lo = sprintf ( "%u", $lo ); + + // x32, bcmath + if ( function_exists("bcmul") ) + return bcadd ( $lo, bcmul ( $hi, "4294967296" ) ); + + // x32, no-bcmath + $hi = (float)$hi; + $lo = (float)$lo; + + $q = floor($hi/10000000.0); + $r = $hi - $q*10000000.0; + $m = $lo + $r*4967296.0; + $mq = floor($m/10000000.0); + $l = $m - $mq*10000000.0; + $h = $q*4294967296.0 + $r*429.0 + $mq; + + $h = sprintf ( "%.0f", $h ); + $l = sprintf ( "%07.0f", $l ); + if ( $h=="0" ) + return sprintf( "%.0f", (float)$l ); + return $h . $l; +} + +// unpack 64-bit signed +function sphUnpackI64 ( $v ) +{ + list ( $hi, $lo ) = array_values ( unpack ( "N*N*", $v ) ); + + // x64 + if ( PHP_INT_SIZE>=8 ) + { + if ( $hi<0 ) $hi += (1<<32); // because php 5.2.2 to 5.2.5 is totally fucked up again + if ( $lo<0 ) $lo += (1<<32); + + return ($hi<<32) + $lo; + } + + // x32, int + if ( $hi==0 ) + { + if ( $lo>0 ) + return $lo; + return sprintf ( "%u", $lo ); + } + // x32, int + elseif ( $hi==-1 ) + { + if ( $lo<0 ) + return $lo; + return sprintf ( "%.0f", $lo - 4294967296.0 ); + } + + $neg = ""; + $c = 0; + if ( $hi<0 ) + { + $hi = ~$hi; + $lo = ~$lo; + $c = 1; + $neg = "-"; + } + + $hi = sprintf ( "%u", $hi ); + $lo = sprintf ( "%u", $lo ); + + // x32, bcmath + if ( function_exists("bcmul") ) + return $neg . bcadd ( bcadd ( $lo, bcmul ( $hi, "4294967296" ) ), $c ); + + // x32, no-bcmath + $hi = (float)$hi; + $lo = (float)$lo; + + $q = floor($hi/10000000.0); + $r = $hi - $q*10000000.0; + $m = $lo + $r*4967296.0; + $mq = floor($m/10000000.0); + $l = $m - $mq*10000000.0 + $c; + $h = $q*4294967296.0 + $r*429.0 + $mq; + + $h = sprintf ( "%.0f", $h ); + $l = sprintf ( "%07.0f", $l ); + if ( $h=="0" ) + return $neg . sprintf( "%.0f", (float)$l ); + return $neg . $h . $l; +} + + +/// sphinx searchd client class +class SphinxClient +{ + var $_host; ///< searchd host (default is "localhost") + var $_port; ///< searchd port (default is 3312) + var $_offset; ///< how many records to seek from result-set start (default is 0) + var $_limit; ///< how many records to return from result-set starting at offset (default is 20) + var $_mode; ///< query matching mode (default is SPH_MATCH_ALL) + var $_weights; ///< per-field weights (default is 1 for all fields) + var $_sort; ///< match sorting mode (default is SPH_SORT_RELEVANCE) + var $_sortby; ///< attribute to sort by (defualt is "") + var $_min_id; ///< min ID to match (default is 0, which means no limit) + var $_max_id; ///< max ID to match (default is 0, which means no limit) + var $_filters; ///< search filters + var $_groupby; ///< group-by attribute name + var $_groupfunc; ///< group-by function (to pre-process group-by attribute value with) + var $_groupsort; ///< group-by sorting clause (to sort groups in result set with) + var $_groupdistinct;///< group-by count-distinct attribute + var $_maxmatches; ///< max matches to retrieve + var $_cutoff; ///< cutoff to stop searching at (default is 0) + var $_retrycount; ///< distributed retries count + var $_retrydelay; ///< distributed retries delay + var $_anchor; ///< geographical anchor point + var $_indexweights; ///< per-index weights + var $_ranker; ///< ranking mode (default is SPH_RANK_PROXIMITY_BM25) + var $_maxquerytime; ///< max query time, milliseconds (default is 0, do not limit) + var $_fieldweights; ///< per-field-name weights + var $_overrides; ///< per-query attribute values overrides + var $_select; ///< select-list (attributes or expressions, with optional aliases) + + var $_error; ///< last error message + var $_warning; ///< last warning message + var $_connerror; ///< connection error vs remote error flag + + var $_reqs; ///< requests array for multi-query + var $_mbenc; ///< stored mbstring encoding + var $_arrayresult; ///< whether $result["matches"] should be a hash or an array + var $_timeout; ///< connect timeout + + ///////////////////////////////////////////////////////////////////////////// + // common stuff + ///////////////////////////////////////////////////////////////////////////// + + /// create a new client object and fill defaults + function SphinxClient () + { + // per-client-object settings + $this->_host = "localhost"; + $this->_port = 3312; + $this->_path = false; + $this->_socket = false; + + // per-query settings + $this->_offset = 0; + $this->_limit = 20; + $this->_mode = SPH_MATCH_ALL; + $this->_weights = array (); + $this->_sort = SPH_SORT_RELEVANCE; + $this->_sortby = ""; + $this->_min_id = 0; + $this->_max_id = 0; + $this->_filters = array (); + $this->_groupby = ""; + $this->_groupfunc = SPH_GROUPBY_DAY; + $this->_groupsort = "@group desc"; + $this->_groupdistinct= ""; + $this->_maxmatches = 1000; + $this->_cutoff = 0; + $this->_retrycount = 0; + $this->_retrydelay = 0; + $this->_anchor = array (); + $this->_indexweights= array (); + $this->_ranker = SPH_RANK_PROXIMITY_BM25; + $this->_maxquerytime= 0; + $this->_fieldweights= array(); + $this->_overrides = array(); + $this->_select = "*"; + + $this->_error = ""; // per-reply fields (for single-query case) + $this->_warning = ""; + $this->_connerror = false; + + $this->_reqs = array (); // requests storage (for multi-query case) + $this->_mbenc = ""; + $this->_arrayresult = false; + $this->_timeout = 0; + } + + function __destruct() + { + if ( $this->_socket !== false ) + fclose ( $this->_socket ); + } + + /// get last error message (string) + function GetLastError () + { + return $this->_error; + } + + /// get last warning message (string) + function GetLastWarning () + { + return $this->_warning; + } + + /// get last error flag (to tell network connection errors from searchd errors or broken responses) + function IsConnectError() + { + return $this->_connerror; + } + + /// set searchd host name (string) and port (integer) + function SetServer ( $host, $port = 0 ) + { + assert ( is_string($host) ); + if ( $host[0] == '/') + { + $this->_path = 'unix://' . $host; + return; + } + if ( substr ( $host, 0, 7 )=="unix://" ) + { + $this->_path = $host; + return; + } + + assert ( is_int($port) ); + $this->_host = $host; + $this->_port = $port; + $this->_path = ''; + + } + + /// set server connection timeout (0 to remove) + function SetConnectTimeout ( $timeout ) + { + assert ( is_numeric($timeout) ); + $this->_timeout = $timeout; + } + + + function _Send ( $handle, $data, $length ) + { + if ( feof($handle) || fwrite ( $handle, $data, $length ) !== $length ) + { + $this->_error = 'connection unexpectedly closed (timed out?)'; + $this->_connerror = true; + return false; + } + return true; + } + + ///////////////////////////////////////////////////////////////////////////// + + /// enter mbstring workaround mode + function _MBPush () + { + $this->_mbenc = ""; + if ( ini_get ( "mbstring.func_overload" ) & 2 ) + { + $this->_mbenc = mb_internal_encoding(); + mb_internal_encoding ( "latin1" ); + } + } + + /// leave mbstring workaround mode + function _MBPop () + { + if ( $this->_mbenc ) + mb_internal_encoding ( $this->_mbenc ); + } + + /// connect to searchd server + function _Connect () + { + if ( $this->_socket !== false ) + return $this->_socket; + + $errno = 0; + $errstr = ""; + $this->_connerror = false; + + if ( $this->_path ) + { + $host = $this->_path; + $port = 0; + } + else + { + $host = $this->_host; + $port = $this->_port; + } + + if ( $this->_timeout<=0 ) + $fp = @fsockopen ( $host, $port, $errno, $errstr ); + else + $fp = @fsockopen ( $host, $port, $errno, $errstr, $this->_timeout ); + + if ( !$fp ) + { + if ( $this->_path ) + $location = $this->_path; + else + $location = "{$this->_host}:{$this->_port}"; + + $errstr = trim ( $errstr ); + $this->_error = "connection to $location failed (errno=$errno, msg=$errstr)"; + $this->_connerror = true; + return false; + } + + // send my version + // this is a subtle part. we must do it before (!) reading back from searchd. + // because otherwise under some conditions (reported on FreeBSD for instance) + // TCP stack could throttle write-write-read pattern because of Nagle. + if ( !$this->_Send ( $fp, pack ( "N", 1 ), 4 ) ) + { + fclose ( $fp ); + $this->_error = "failed to send client protocol version"; + return false; + } + + // check version + list(,$v) = unpack ( "N*", fread ( $fp, 4 ) ); + $v = (int)$v; + if ( $v<1 ) + { + fclose ( $fp ); + $this->_error = "expected searchd protocol version 1+, got version '$v'"; + return false; + } + + return $fp; + } + + /// get and check response packet from searchd server + function _GetResponse ( $fp, $client_ver ) + { + $response = ""; + $len = 0; + + $header = fread ( $fp, 8 ); + if ( strlen($header)==8 ) + { + list ( $status, $ver, $len ) = array_values ( unpack ( "n2a/Nb", $header ) ); + $left = $len; + while ( $left>0 && !feof($fp) ) + { + $chunk = fread ( $fp, $left ); + if ( $chunk ) + { + $response .= $chunk; + $left -= strlen($chunk); + } + } + } + if ( $this->_socket === false ) + fclose ( $fp ); + + // check response + $read = strlen ( $response ); + if ( !$response || $read!=$len ) + { + $this->_error = $len + ? "failed to read searchd response (status=$status, ver=$ver, len=$len, read=$read)" + : "received zero-sized searchd response"; + return false; + } + + // check status + if ( $status==SEARCHD_WARNING ) + { + list(,$wlen) = unpack ( "N*", substr ( $response, 0, 4 ) ); + $this->_warning = substr ( $response, 4, $wlen ); + return substr ( $response, 4+$wlen ); + } + if ( $status==SEARCHD_ERROR ) + { + $this->_error = "searchd error: " . substr ( $response, 4 ); + return false; + } + if ( $status==SEARCHD_RETRY ) + { + $this->_error = "temporary searchd error: " . substr ( $response, 4 ); + return false; + } + if ( $status!=SEARCHD_OK ) + { + $this->_error = "unknown status code '$status'"; + return false; + } + + // check version + if ( $ver<$client_ver ) + { + $this->_warning = sprintf ( "searchd command v.%d.%d older than client's v.%d.%d, some options might not work", + $ver>>8, $ver&0xff, $client_ver>>8, $client_ver&0xff ); + } + + return $response; + } + + ///////////////////////////////////////////////////////////////////////////// + // searching + ///////////////////////////////////////////////////////////////////////////// + + /// set offset and count into result set, + /// and optionally set max-matches and cutoff limits + function SetLimits ( $offset, $limit, $max=0, $cutoff=0 ) + { + assert ( is_int($offset) ); + assert ( is_int($limit) ); + assert ( $offset>=0 ); + assert ( $limit>0 ); + assert ( $max>=0 ); + $this->_offset = $offset; + $this->_limit = $limit; + if ( $max>0 ) + $this->_maxmatches = $max; + if ( $cutoff>0 ) + $this->_cutoff = $cutoff; + } + + /// set maximum query time, in milliseconds, per-index + /// integer, 0 means "do not limit" + function SetMaxQueryTime ( $max ) + { + assert ( is_int($max) ); + assert ( $max>=0 ); + $this->_maxquerytime = $max; + } + + /// set matching mode + function SetMatchMode ( $mode ) + { + assert ( $mode==SPH_MATCH_ALL + || $mode==SPH_MATCH_ANY + || $mode==SPH_MATCH_PHRASE + || $mode==SPH_MATCH_BOOLEAN + || $mode==SPH_MATCH_EXTENDED + || $mode==SPH_MATCH_FULLSCAN + || $mode==SPH_MATCH_EXTENDED2 ); + $this->_mode = $mode; + } + + /// set ranking mode + function SetRankingMode ( $ranker ) + { + assert ( $ranker>=0 && $ranker_ranker = $ranker; + } + + /// set matches sorting mode + function SetSortMode ( $mode, $sortby="" ) + { + assert ( + $mode==SPH_SORT_RELEVANCE || + $mode==SPH_SORT_ATTR_DESC || + $mode==SPH_SORT_ATTR_ASC || + $mode==SPH_SORT_TIME_SEGMENTS || + $mode==SPH_SORT_EXTENDED || + $mode==SPH_SORT_EXPR ); + assert ( is_string($sortby) ); + assert ( $mode==SPH_SORT_RELEVANCE || strlen($sortby)>0 ); + + $this->_sort = $mode; + $this->_sortby = $sortby; + } + + /// bind per-field weights by order + /// DEPRECATED; use SetFieldWeights() instead + function SetWeights ( $weights ) + { + assert ( is_array($weights) ); + foreach ( $weights as $weight ) + assert ( is_int($weight) ); + + $this->_weights = $weights; + } + + /// bind per-field weights by name + function SetFieldWeights ( $weights ) + { + assert ( is_array($weights) ); + foreach ( $weights as $name=>$weight ) + { + assert ( is_string($name) ); + assert ( is_int($weight) ); + } + $this->_fieldweights = $weights; + } + + /// bind per-index weights by name + function SetIndexWeights ( $weights ) + { + assert ( is_array($weights) ); + foreach ( $weights as $index=>$weight ) + { + assert ( is_string($index) ); + assert ( is_int($weight) ); + } + $this->_indexweights = $weights; + } + + /// set IDs range to match + /// only match records if document ID is beetwen $min and $max (inclusive) + function SetIDRange ( $min, $max ) + { + assert ( is_numeric($min) ); + assert ( is_numeric($max) ); + assert ( $min<=$max ); + $this->_min_id = $min; + $this->_max_id = $max; + } + + /// set values set filter + /// only match records where $attribute value is in given set + function SetFilter ( $attribute, $values, $exclude=false ) + { + assert ( is_string($attribute) ); + assert ( is_array($values) ); + assert ( count($values) ); + + if ( is_array($values) && count($values) ) + { + foreach ( $values as $value ) + assert ( is_numeric($value) ); + + $this->_filters[] = array ( "type"=>SPH_FILTER_VALUES, "attr"=>$attribute, "exclude"=>$exclude, "values"=>$values ); + } + } + + /// set range filter + /// only match records if $attribute value is beetwen $min and $max (inclusive) + function SetFilterRange ( $attribute, $min, $max, $exclude=false ) + { + assert ( is_string($attribute) ); + assert ( is_numeric($min) ); + assert ( is_numeric($max) ); + assert ( $min<=$max ); + + $this->_filters[] = array ( "type"=>SPH_FILTER_RANGE, "attr"=>$attribute, "exclude"=>$exclude, "min"=>$min, "max"=>$max ); + } + + /// set float range filter + /// only match records if $attribute value is beetwen $min and $max (inclusive) + function SetFilterFloatRange ( $attribute, $min, $max, $exclude=false ) + { + assert ( is_string($attribute) ); + assert ( is_float($min) ); + assert ( is_float($max) ); + assert ( $min<=$max ); + + $this->_filters[] = array ( "type"=>SPH_FILTER_FLOATRANGE, "attr"=>$attribute, "exclude"=>$exclude, "min"=>$min, "max"=>$max ); + } + + /// setup anchor point for geosphere distance calculations + /// required to use @geodist in filters and sorting + /// latitude and longitude must be in radians + function SetGeoAnchor ( $attrlat, $attrlong, $lat, $long ) + { + assert ( is_string($attrlat) ); + assert ( is_string($attrlong) ); + assert ( is_float($lat) ); + assert ( is_float($long) ); + + $this->_anchor = array ( "attrlat"=>$attrlat, "attrlong"=>$attrlong, "lat"=>$lat, "long"=>$long ); + } + + /// set grouping attribute and function + function SetGroupBy ( $attribute, $func, $groupsort="@group desc" ) + { + assert ( is_string($attribute) ); + assert ( is_string($groupsort) ); + assert ( $func==SPH_GROUPBY_DAY + || $func==SPH_GROUPBY_WEEK + || $func==SPH_GROUPBY_MONTH + || $func==SPH_GROUPBY_YEAR + || $func==SPH_GROUPBY_ATTR + || $func==SPH_GROUPBY_ATTRPAIR ); + + $this->_groupby = $attribute; + $this->_groupfunc = $func; + $this->_groupsort = $groupsort; + } + + /// set count-distinct attribute for group-by queries + function SetGroupDistinct ( $attribute ) + { + assert ( is_string($attribute) ); + $this->_groupdistinct = $attribute; + } + + /// set distributed retries count and delay + function SetRetries ( $count, $delay=0 ) + { + assert ( is_int($count) && $count>=0 ); + assert ( is_int($delay) && $delay>=0 ); + $this->_retrycount = $count; + $this->_retrydelay = $delay; + } + + /// set result set format (hash or array; hash by default) + /// PHP specific; needed for group-by-MVA result sets that may contain duplicate IDs + function SetArrayResult ( $arrayresult ) + { + assert ( is_bool($arrayresult) ); + $this->_arrayresult = $arrayresult; + } + + /// set attribute values override + /// there can be only one override per attribute + /// $values must be a hash that maps document IDs to attribute values + function SetOverride ( $attrname, $attrtype, $values ) + { + assert ( is_string ( $attrname ) ); + assert ( in_array ( $attrtype, array ( SPH_ATTR_INTEGER, SPH_ATTR_TIMESTAMP, SPH_ATTR_BOOL, SPH_ATTR_FLOAT, SPH_ATTR_BIGINT ) ) ); + assert ( is_array ( $values ) ); + + $this->_overrides[$attrname] = array ( "attr"=>$attrname, "type"=>$attrtype, "values"=>$values ); + } + + /// set select-list (attributes or expressions), SQL-like syntax + function SetSelect ( $select ) + { + assert ( is_string ( $select ) ); + $this->_select = $select; + } + + ////////////////////////////////////////////////////////////////////////////// + + /// clear all filters (for multi-queries) + function ResetFilters () + { + $this->_filters = array(); + $this->_anchor = array(); + } + + /// clear groupby settings (for multi-queries) + function ResetGroupBy () + { + $this->_groupby = ""; + $this->_groupfunc = SPH_GROUPBY_DAY; + $this->_groupsort = "@group desc"; + $this->_groupdistinct= ""; + } + + /// clear all attribute value overrides (for multi-queries) + function ResetOverrides () + { + $this->_overrides = array (); + } + + ////////////////////////////////////////////////////////////////////////////// + + /// connect to searchd server, run given search query through given indexes, + /// and return the search results + function Query ( $query, $index="*", $comment="" ) + { + assert ( empty($this->_reqs) ); + + $this->AddQuery ( $query, $index, $comment ); + $results = $this->RunQueries (); + $this->_reqs = array (); // just in case it failed too early + + if ( !is_array($results) ) + return false; // probably network error; error message should be already filled + + $this->_error = $results[0]["error"]; + $this->_warning = $results[0]["warning"]; + if ( $results[0]["status"]==SEARCHD_ERROR ) + return false; + else + return $results[0]; + } + + /// helper to pack floats in network byte order + function _PackFloat ( $f ) + { + $t1 = pack ( "f", $f ); // machine order + list(,$t2) = unpack ( "L*", $t1 ); // int in machine order + return pack ( "N", $t2 ); + } + + /// add query to multi-query batch + /// returns index into results array from RunQueries() call + function AddQuery ( $query, $index="*", $comment="" ) + { + // mbstring workaround + $this->_MBPush (); + + // build request + $req = pack ( "NNNNN", $this->_offset, $this->_limit, $this->_mode, $this->_ranker, $this->_sort ); // mode and limits + $req .= pack ( "N", strlen($this->_sortby) ) . $this->_sortby; + $req .= pack ( "N", strlen($query) ) . $query; // query itself + $req .= pack ( "N", count($this->_weights) ); // weights + foreach ( $this->_weights as $weight ) + $req .= pack ( "N", (int)$weight ); + $req .= pack ( "N", strlen($index) ) . $index; // indexes + $req .= pack ( "N", 1 ); // id64 range marker + $req .= sphPackU64 ( $this->_min_id ) . sphPackU64 ( $this->_max_id ); // id64 range + + // filters + $req .= pack ( "N", count($this->_filters) ); + foreach ( $this->_filters as $filter ) + { + $req .= pack ( "N", strlen($filter["attr"]) ) . $filter["attr"]; + $req .= pack ( "N", $filter["type"] ); + switch ( $filter["type"] ) + { + case SPH_FILTER_VALUES: + $req .= pack ( "N", count($filter["values"]) ); + foreach ( $filter["values"] as $value ) + $req .= sphPackI64 ( $value ); + break; + + case SPH_FILTER_RANGE: + $req .= sphPackI64 ( $filter["min"] ) . sphPackI64 ( $filter["max"] ); + break; + + case SPH_FILTER_FLOATRANGE: + $req .= $this->_PackFloat ( $filter["min"] ) . $this->_PackFloat ( $filter["max"] ); + break; + + default: + assert ( 0 && "internal error: unhandled filter type" ); + } + $req .= pack ( "N", $filter["exclude"] ); + } + + // group-by clause, max-matches count, group-sort clause, cutoff count + $req .= pack ( "NN", $this->_groupfunc, strlen($this->_groupby) ) . $this->_groupby; + $req .= pack ( "N", $this->_maxmatches ); + $req .= pack ( "N", strlen($this->_groupsort) ) . $this->_groupsort; + $req .= pack ( "NNN", $this->_cutoff, $this->_retrycount, $this->_retrydelay ); + $req .= pack ( "N", strlen($this->_groupdistinct) ) . $this->_groupdistinct; + + // anchor point + if ( empty($this->_anchor) ) + { + $req .= pack ( "N", 0 ); + } else + { + $a =& $this->_anchor; + $req .= pack ( "N", 1 ); + $req .= pack ( "N", strlen($a["attrlat"]) ) . $a["attrlat"]; + $req .= pack ( "N", strlen($a["attrlong"]) ) . $a["attrlong"]; + $req .= $this->_PackFloat ( $a["lat"] ) . $this->_PackFloat ( $a["long"] ); + } + + // per-index weights + $req .= pack ( "N", count($this->_indexweights) ); + foreach ( $this->_indexweights as $idx=>$weight ) + $req .= pack ( "N", strlen($idx) ) . $idx . pack ( "N", $weight ); + + // max query time + $req .= pack ( "N", $this->_maxquerytime ); + + // per-field weights + $req .= pack ( "N", count($this->_fieldweights) ); + foreach ( $this->_fieldweights as $field=>$weight ) + $req .= pack ( "N", strlen($field) ) . $field . pack ( "N", $weight ); + + // comment + $req .= pack ( "N", strlen($comment) ) . $comment; + + // attribute overrides + $req .= pack ( "N", count($this->_overrides) ); + foreach ( $this->_overrides as $key => $entry ) + { + $req .= pack ( "N", strlen($entry["attr"]) ) . $entry["attr"]; + $req .= pack ( "NN", $entry["type"], count($entry["values"]) ); + foreach ( $entry["values"] as $id=>$val ) + { + assert ( is_numeric($id) ); + assert ( is_numeric($val) ); + + $req .= sphPackU64 ( $id ); + switch ( $entry["type"] ) + { + case SPH_ATTR_FLOAT: $req .= $this->_PackFloat ( $val ); break; + case SPH_ATTR_BIGINT: $req .= sphPackI64 ( $val ); break; + default: $req .= pack ( "N", $val ); break; + } + } + } + + // select-list + $req .= pack ( "N", strlen($this->_select) ) . $this->_select; + + // mbstring workaround + $this->_MBPop (); + + // store request to requests array + $this->_reqs[] = $req; + return count($this->_reqs)-1; + } + + /// connect to searchd, run queries batch, and return an array of result sets + function RunQueries () + { + if ( empty($this->_reqs) ) + { + $this->_error = "no queries defined, issue AddQuery() first"; + return false; + } + + // mbstring workaround + $this->_MBPush (); + + if (!( $fp = $this->_Connect() )) + { + $this->_MBPop (); + return false; + } + + // send query, get response + $nreqs = count($this->_reqs); + $req = join ( "", $this->_reqs ); + $len = 4+strlen($req); + $req = pack ( "nnNN", SEARCHD_COMMAND_SEARCH, VER_COMMAND_SEARCH, $len, $nreqs ) . $req; // add header + + if ( !( $this->_Send ( $fp, $req, $len+8 ) ) || + !( $response = $this->_GetResponse ( $fp, VER_COMMAND_SEARCH ) ) ) + { + $this->_MBPop (); + return false; + } + + // query sent ok; we can reset reqs now + $this->_reqs = array (); + + // parse and return response + return $this->_ParseSearchResponse ( $response, $nreqs ); + } + + /// parse and return search query (or queries) response + function _ParseSearchResponse ( $response, $nreqs ) + { + $p = 0; // current position + $max = strlen($response); // max position for checks, to protect against broken responses + + $results = array (); + for ( $ires=0; $ires<$nreqs && $p<$max; $ires++ ) + { + $results[] = array(); + $result =& $results[$ires]; + + $result["error"] = ""; + $result["warning"] = ""; + + // extract status + list(,$status) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; + $result["status"] = $status; + if ( $status!=SEARCHD_OK ) + { + list(,$len) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; + $message = substr ( $response, $p, $len ); $p += $len; + + if ( $status==SEARCHD_WARNING ) + { + $result["warning"] = $message; + } else + { + $result["error"] = $message; + continue; + } + } + + // read schema + $fields = array (); + $attrs = array (); + + list(,$nfields) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; + while ( $nfields-->0 && $p<$max ) + { + list(,$len) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; + $fields[] = substr ( $response, $p, $len ); $p += $len; + } + $result["fields"] = $fields; + + list(,$nattrs) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; + while ( $nattrs-->0 && $p<$max ) + { + list(,$len) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; + $attr = substr ( $response, $p, $len ); $p += $len; + list(,$type) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; + $attrs[$attr] = $type; + } + $result["attrs"] = $attrs; + + // read match count + list(,$count) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; + list(,$id64) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; + + // read matches + $idx = -1; + while ( $count-->0 && $p<$max ) + { + // index into result array + $idx++; + + // parse document id and weight + if ( $id64 ) + { + $doc = sphUnpackU64 ( substr ( $response, $p, 8 ) ); $p += 8; + list(,$weight) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; + } + else + { + list ( $doc, $weight ) = array_values ( unpack ( "N*N*", + substr ( $response, $p, 8 ) ) ); + $p += 8; + + if ( PHP_INT_SIZE>=8 ) + { + // x64 route, workaround broken unpack() in 5.2.2+ + if ( $doc<0 ) $doc += (1<<32); + } else + { + // x32 route, workaround php signed/unsigned braindamage + $doc = sprintf ( "%u", $doc ); + } + } + $weight = sprintf ( "%u", $weight ); + + // create match entry + if ( $this->_arrayresult ) + $result["matches"][$idx] = array ( "id"=>$doc, "weight"=>$weight ); + else + $result["matches"][$doc]["weight"] = $weight; + + // parse and create attributes + $attrvals = array (); + foreach ( $attrs as $attr=>$type ) + { + // handle 64bit ints + if ( $type==SPH_ATTR_BIGINT ) + { + $attrvals[$attr] = sphUnpackI64 ( substr ( $response, $p, 8 ) ); $p += 8; + continue; + } + + // handle floats + if ( $type==SPH_ATTR_FLOAT ) + { + list(,$uval) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; + list(,$fval) = unpack ( "f*", pack ( "L", $uval ) ); + $attrvals[$attr] = $fval; + continue; + } + + // handle everything else as unsigned ints + list(,$val) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; + if ( $type & SPH_ATTR_MULTI ) + { + $attrvals[$attr] = array (); + $nvalues = $val; + while ( $nvalues-->0 && $p<$max ) + { + list(,$val) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; + $attrvals[$attr][] = sprintf ( "%u", $val ); + } + } else if ( $type==SPH_ATTR_STRING ) + { + $attrvals[$attr] = substr ( $response, $p, $val ); + $p += $val; + } else + { + $attrvals[$attr] = sprintf ( "%u", $val ); + } + } + + if ( $this->_arrayresult ) + $result["matches"][$idx]["attrs"] = $attrvals; + else + $result["matches"][$doc]["attrs"] = $attrvals; + } + + list ( $total, $total_found, $msecs, $words ) = + array_values ( unpack ( "N*N*N*N*", substr ( $response, $p, 16 ) ) ); + $result["total"] = sprintf ( "%u", $total ); + $result["total_found"] = sprintf ( "%u", $total_found ); + $result["time"] = sprintf ( "%.3f", $msecs/1000 ); + $p += 16; + + while ( $words-->0 && $p<$max ) + { + list(,$len) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; + $word = substr ( $response, $p, $len ); $p += $len; + list ( $docs, $hits ) = array_values ( unpack ( "N*N*", substr ( $response, $p, 8 ) ) ); $p += 8; + $result["words"][$word] = array ( + "docs"=>sprintf ( "%u", $docs ), + "hits"=>sprintf ( "%u", $hits ) ); + } + } + + $this->_MBPop (); + return $results; + } + + ///////////////////////////////////////////////////////////////////////////// + // excerpts generation + ///////////////////////////////////////////////////////////////////////////// + + /// connect to searchd server, and generate exceprts (snippets) + /// of given documents for given query. returns false on failure, + /// an array of snippets on success + function BuildExcerpts ( $docs, $index, $words, $opts=array() ) + { + assert ( is_array($docs) ); + assert ( is_string($index) ); + assert ( is_string($words) ); + assert ( is_array($opts) ); + + $this->_MBPush (); + + if (!( $fp = $this->_Connect() )) + { + $this->_MBPop(); + return false; + } + + ///////////////// + // fixup options + ///////////////// + + if ( !isset($opts["before_match"]) ) $opts["before_match"] = ""; + if ( !isset($opts["after_match"]) ) $opts["after_match"] = ""; + if ( !isset($opts["chunk_separator"]) ) $opts["chunk_separator"] = " ... "; + if ( !isset($opts["limit"]) ) $opts["limit"] = 256; + if ( !isset($opts["around"]) ) $opts["around"] = 5; + if ( !isset($opts["exact_phrase"]) ) $opts["exact_phrase"] = false; + if ( !isset($opts["single_passage"]) ) $opts["single_passage"] = false; + if ( !isset($opts["use_boundaries"]) ) $opts["use_boundaries"] = false; + if ( !isset($opts["weight_order"]) ) $opts["weight_order"] = false; + if ( !isset($opts["query_mode"]) ) $opts["query_mode"] = false; + + ///////////////// + // build request + ///////////////// + + // v.1.0 req + $flags = 1; // remove spaces + if ( $opts["exact_phrase"] ) $flags |= 2; + if ( $opts["single_passage"] ) $flags |= 4; + if ( $opts["use_boundaries"] ) $flags |= 8; + if ( $opts["weight_order"] ) $flags |= 16; + if ( $opts["query_mode"] ) $flags |= 32; + $req = pack ( "NN", 0, $flags ); // mode=0, flags=$flags + $req .= pack ( "N", strlen($index) ) . $index; // req index + $req .= pack ( "N", strlen($words) ) . $words; // req words + + // options + $req .= pack ( "N", strlen($opts["before_match"]) ) . $opts["before_match"]; + $req .= pack ( "N", strlen($opts["after_match"]) ) . $opts["after_match"]; + $req .= pack ( "N", strlen($opts["chunk_separator"]) ) . $opts["chunk_separator"]; + $req .= pack ( "N", (int)$opts["limit"] ); + $req .= pack ( "N", (int)$opts["around"] ); + + // documents + $req .= pack ( "N", count($docs) ); + foreach ( $docs as $doc ) + { + assert ( is_string($doc) ); + $req .= pack ( "N", strlen($doc) ) . $doc; + } + + //////////////////////////// + // send query, get response + //////////////////////////// + + $len = strlen($req); + $req = pack ( "nnN", SEARCHD_COMMAND_EXCERPT, VER_COMMAND_EXCERPT, $len ) . $req; // add header + if ( !( $this->_Send ( $fp, $req, $len+8 ) ) || + !( $response = $this->_GetResponse ( $fp, VER_COMMAND_EXCERPT ) ) ) + { + $this->_MBPop (); + return false; + } + + ////////////////// + // parse response + ////////////////// + + $pos = 0; + $res = array (); + $rlen = strlen($response); + for ( $i=0; $i $rlen ) + { + $this->_error = "incomplete reply"; + $this->_MBPop (); + return false; + } + $res[] = $len ? substr ( $response, $pos, $len ) : ""; + $pos += $len; + } + + $this->_MBPop (); + return $res; + } + + + ///////////////////////////////////////////////////////////////////////////// + // keyword generation + ///////////////////////////////////////////////////////////////////////////// + + /// connect to searchd server, and generate keyword list for a given query + /// returns false on failure, + /// an array of words on success + function BuildKeywords ( $query, $index, $hits ) + { + assert ( is_string($query) ); + assert ( is_string($index) ); + assert ( is_bool($hits) ); + + $this->_MBPush (); + + if (!( $fp = $this->_Connect() )) + { + $this->_MBPop(); + return false; + } + + ///////////////// + // build request + ///////////////// + + // v.1.0 req + $req = pack ( "N", strlen($query) ) . $query; // req query + $req .= pack ( "N", strlen($index) ) . $index; // req index + $req .= pack ( "N", (int)$hits ); + + //////////////////////////// + // send query, get response + //////////////////////////// + + $len = strlen($req); + $req = pack ( "nnN", SEARCHD_COMMAND_KEYWORDS, VER_COMMAND_KEYWORDS, $len ) . $req; // add header + if ( !( $this->_Send ( $fp, $req, $len+8 ) ) || + !( $response = $this->_GetResponse ( $fp, VER_COMMAND_KEYWORDS ) ) ) + { + $this->_MBPop (); + return false; + } + + ////////////////// + // parse response + ////////////////// + + $pos = 0; + $res = array (); + $rlen = strlen($response); + list(,$nwords) = unpack ( "N*", substr ( $response, $pos, 4 ) ); + $pos += 4; + for ( $i=0; $i<$nwords; $i++ ) + { + list(,$len) = unpack ( "N*", substr ( $response, $pos, 4 ) ); $pos += 4; + $tokenized = $len ? substr ( $response, $pos, $len ) : ""; + $pos += $len; + + list(,$len) = unpack ( "N*", substr ( $response, $pos, 4 ) ); $pos += 4; + $normalized = $len ? substr ( $response, $pos, $len ) : ""; + $pos += $len; + + $res[] = array ( "tokenized"=>$tokenized, "normalized"=>$normalized ); + + if ( $hits ) + { + list($ndocs,$nhits) = array_values ( unpack ( "N*N*", substr ( $response, $pos, 8 ) ) ); + $pos += 8; + $res [$i]["docs"] = $ndocs; + $res [$i]["hits"] = $nhits; + } + + if ( $pos > $rlen ) + { + $this->_error = "incomplete reply"; + $this->_MBPop (); + return false; + } + } + + $this->_MBPop (); + return $res; + } + + function EscapeString ( $string ) + { + $from = array ( '\\', '(',')','|','-','!','@','~','"','&', '/', '^', '$', '=' ); + $to = array ( '\\\\', '\(','\)','\|','\-','\!','\@','\~','\"', '\&', '\/', '\^', '\$', '\=' ); + + return str_replace ( $from, $to, $string ); + } + + ///////////////////////////////////////////////////////////////////////////// + // attribute updates + ///////////////////////////////////////////////////////////////////////////// + + /// batch update given attributes in given rows in given indexes + /// returns amount of updated documents (0 or more) on success, or -1 on failure + function UpdateAttributes ( $index, $attrs, $values, $mva=false ) + { + // verify everything + assert ( is_string($index) ); + assert ( is_bool($mva) ); + + assert ( is_array($attrs) ); + foreach ( $attrs as $attr ) + assert ( is_string($attr) ); + + assert ( is_array($values) ); + foreach ( $values as $id=>$entry ) + { + assert ( is_numeric($id) ); + assert ( is_array($entry) ); + assert ( count($entry)==count($attrs) ); + foreach ( $entry as $v ) + { + if ( $mva ) + { + assert ( is_array($v) ); + foreach ( $v as $vv ) + assert ( is_int($vv) ); + } else + assert ( is_int($v) ); + } + } + + // build request + $req = pack ( "N", strlen($index) ) . $index; + + $req .= pack ( "N", count($attrs) ); + foreach ( $attrs as $attr ) + { + $req .= pack ( "N", strlen($attr) ) . $attr; + $req .= pack ( "N", $mva ? 1 : 0 ); + } + + $req .= pack ( "N", count($values) ); + foreach ( $values as $id=>$entry ) + { + $req .= sphPackU64 ( $id ); + foreach ( $entry as $v ) + { + $req .= pack ( "N", $mva ? count($v) : $v ); + if ( $mva ) + foreach ( $v as $vv ) + $req .= pack ( "N", $vv ); + } + } + + // connect, send query, get response + if (!( $fp = $this->_Connect() )) + return -1; + + $len = strlen($req); + $req = pack ( "nnN", SEARCHD_COMMAND_UPDATE, VER_COMMAND_UPDATE, $len ) . $req; // add header + if ( !$this->_Send ( $fp, $req, $len+8 ) ) + return -1; + + if (!( $response = $this->_GetResponse ( $fp, VER_COMMAND_UPDATE ) )) + return -1; + + // parse response + list(,$updated) = unpack ( "N*", substr ( $response, 0, 4 ) ); + return $updated; + } + + ///////////////////////////////////////////////////////////////////////////// + // persistent connections + ///////////////////////////////////////////////////////////////////////////// + + function Open() + { + if ( $this->_socket !== false ) + { + $this->_error = 'already connected'; + return false; + } + if ( !$fp = $this->_Connect() ) + return false; + + // command, command version = 0, body length = 4, body = 1 + $req = pack ( "nnNN", SEARCHD_COMMAND_PERSIST, 0, 4, 1 ); + if ( !$this->_Send ( $fp, $req, 12 ) ) + return false; + + $this->_socket = $fp; + return true; + } + + function Close() + { + if ( $this->_socket === false ) + { + $this->_error = 'not connected'; + return false; + } + + fclose ( $this->_socket ); + $this->_socket = false; + + return true; + } + + ////////////////////////////////////////////////////////////////////////// + // status + ////////////////////////////////////////////////////////////////////////// + + function Status () + { + $this->_MBPush (); + if (!( $fp = $this->_Connect() )) + { + $this->_MBPop(); + return false; + } + + $req = pack ( "nnNN", SEARCHD_COMMAND_STATUS, VER_COMMAND_STATUS, 4, 1 ); // len=4, body=1 + if ( !( $this->_Send ( $fp, $req, 12 ) ) || + !( $response = $this->_GetResponse ( $fp, VER_COMMAND_STATUS ) ) ) + { + $this->_MBPop (); + return false; + } + + $res = substr ( $response, 4 ); // just ignore length, error handling, etc + $p = 0; + list ( $rows, $cols ) = array_values ( unpack ( "N*N*", substr ( $response, $p, 8 ) ) ); $p += 8; + + $res = array(); + for ( $i=0; $i<$rows; $i++ ) + for ( $j=0; $j<$cols; $j++ ) + { + list(,$len) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; + $res[$i][] = substr ( $response, $p, $len ); $p += $len; + } + + $this->_MBPop (); + return $res; + } +} + +// +// $Id$ +// \ No newline at end of file diff --git a/system/classes/swfupload/cancelbutton.gif b/system/classes/swfupload/cancelbutton.gif new file mode 100644 index 0000000..eab2a40 Binary files /dev/null and b/system/classes/swfupload/cancelbutton.gif differ diff --git a/system/classes/swfupload/fileprogress.js b/system/classes/swfupload/fileprogress.js new file mode 100644 index 0000000..759fec1 --- /dev/null +++ b/system/classes/swfupload/fileprogress.js @@ -0,0 +1,151 @@ +/* + A simple class for displaying file information and progress + Note: This is a demonstration only and not part of SWFUpload. + Note: Some have had problems adapting this class in IE7. It may not be suitable for your application. +*/ + +// Constructor +// file is a SWFUpload file object +// targetID is the HTML element id attribute that the FileProgress HTML structure will be added to. +// Instantiating a new FileProgress object with an existing file will reuse/update the existing DOM elements +function FileProgress(file, targetID) { + this.fileProgressID = file.id; + + this.opacity = 100; + this.height = 0; + + this.fileProgressWrapper = document.getElementById(this.fileProgressID); + if (!this.fileProgressWrapper) { + this.fileProgressWrapper = document.createElement("div"); + this.fileProgressWrapper.className = "progressWrapper"; + this.fileProgressWrapper.id = this.fileProgressID; + + this.fileProgressElement = document.createElement("div"); + this.fileProgressElement.className = "progressContainer"; + + var progressCancel = document.createElement("a"); + progressCancel.className = "progressCancel"; + progressCancel.href = "#"; + progressCancel.style.visibility = "hidden"; + progressCancel.appendChild(document.createTextNode(" ")); + + var progressText = document.createElement("div"); + progressText.className = "progressName"; + progressText.appendChild(document.createTextNode(file.name)); + + var progressBar = document.createElement("div"); + progressBar.className = "progressBarInProgress"; + + var progressStatus = document.createElement("div"); + progressStatus.className = "progressBarStatus"; + progressStatus.innerHTML = " "; + + this.fileProgressElement.appendChild(progressCancel); + this.fileProgressElement.appendChild(progressText); + this.fileProgressElement.appendChild(progressStatus); + this.fileProgressElement.appendChild(progressBar); + + this.fileProgressWrapper.appendChild(this.fileProgressElement); + + document.getElementById(targetID).appendChild(this.fileProgressWrapper); + } else { + this.fileProgressElement = this.fileProgressWrapper.firstChild; + } + + this.height = this.fileProgressWrapper.offsetHeight; + +} +FileProgress.prototype.setProgress = function (percentage) { + this.fileProgressElement.className = "progressContainer green"; + this.fileProgressElement.childNodes[3].className = "progressBarInProgress"; + this.fileProgressElement.childNodes[3].style.width = percentage + "%"; +}; +FileProgress.prototype.setComplete = function () { + this.fileProgressElement.className = "progressContainer blue"; + this.fileProgressElement.childNodes[3].className = "progressBarComplete"; + this.fileProgressElement.childNodes[3].style.width = ""; + + var oSelf = this; + setTimeout(function () { + oSelf.disappear(); + }, 10000); +}; +FileProgress.prototype.setError = function () { + this.fileProgressElement.className = "progressContainer red"; + this.fileProgressElement.childNodes[3].className = "progressBarError"; + this.fileProgressElement.childNodes[3].style.width = ""; + + var oSelf = this; + setTimeout(function () { + oSelf.disappear(); + }, 5000); +}; +FileProgress.prototype.setCancelled = function () { + this.fileProgressElement.className = "progressContainer"; + this.fileProgressElement.childNodes[3].className = "progressBarError"; + this.fileProgressElement.childNodes[3].style.width = ""; + + var oSelf = this; + setTimeout(function () { + oSelf.disappear(); + }, 2000); +}; +FileProgress.prototype.setStatus = function (status) { + this.fileProgressElement.childNodes[2].innerHTML = status; +}; + +// Show/Hide the cancel button +FileProgress.prototype.toggleCancel = function (show, swfUploadInstance) { + this.fileProgressElement.childNodes[0].style.visibility = show ? "visible" : "hidden"; + if (swfUploadInstance) { + var fileID = this.fileProgressID; + this.fileProgressElement.childNodes[0].onclick = function () { + swfUploadInstance.cancelUpload(fileID); + return false; + }; + } +}; + +// Fades out and clips away the FileProgress box. +FileProgress.prototype.disappear = function () { + + var reduceOpacityBy = 15; + var reduceHeightBy = 4; + var rate = 30; // 15 fps + + if (this.opacity > 0) { + this.opacity -= reduceOpacityBy; + if (this.opacity < 0) { + this.opacity = 0; + } + + if (this.fileProgressWrapper.filters) { + try { + this.fileProgressWrapper.filters.item("DXImageTransform.Microsoft.Alpha").opacity = this.opacity; + } catch (e) { + // If it is not set initially, the browser will throw an error. This will set it if it is not set yet. + this.fileProgressWrapper.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=" + this.opacity + ")"; + } + } else { + this.fileProgressWrapper.style.opacity = this.opacity / 100; + } + } + + if (this.height > 0) { + this.height -= reduceHeightBy; + if (this.height < 0) { + this.height = 0; + } + + this.fileProgressWrapper.style.height = this.height + "px"; + } + + if (this.height > 0 || this.opacity > 0) { + var oSelf = this; + setTimeout(function () { + oSelf.disappear(); + }, rate); + } else { + this.fileProgressWrapper.style.display = "none"; + } +}; \ No newline at end of file diff --git a/system/classes/swfupload/handlers.js b/system/classes/swfupload/handlers.js new file mode 100644 index 0000000..d04a853 --- /dev/null +++ b/system/classes/swfupload/handlers.js @@ -0,0 +1,200 @@ +/* Demo Note: This demo uses a FileProgress class that handles the UI for displaying the file name and percent complete. +The FileProgress class is not part of SWFUpload. +*/ + + +/* ********************** + Event Handlers + These are my custom event handlers to make my + web application behave the way I went when SWFUpload + completes different tasks. These aren't part of the SWFUpload + package. They are part of my application. Without these none + of the actions SWFUpload makes will show up in my application. + ********************** */ +function fileQueued(file) { + try { + var progress = new FileProgress(file, this.customSettings.progressTarget); + progress.setStatus("В очереди ..."); + progress.toggleCancel(true, this); + + } catch (ex) { + this.debug(ex); + } + +} + +function fileQueueError(file, errorCode, message) { + try { + if (errorCode === SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED) { + alert("Вы выбрали слишком много файлов.\n" + (message === 0 ? "Вы превысили лимит." : "Вы можете выбрать " + (message > 1 ? "не более " + message + " файлов." : "один файл."))); + return; + } + + var progress = new FileProgress(file, this.customSettings.progressTarget); + progress.setError(); + progress.toggleCancel(false); + + switch (errorCode) { + case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT: + progress.setStatus("Файл слишком большой."); + this.debug("Error Code: File too big, File name: " + file.name + ", File size: " + file.size + ", Message: " + message); + break; + case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE: + progress.setStatus("Невозможно загрузить файл нулевого размера."); + this.debug("Error Code: Zero byte file, File name: " + file.name + ", File size: " + file.size + ", Message: " + message); + break; + case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE: + progress.setStatus("Неверный тип файла."); + this.debug("Error Code: Invalid File Type, File name: " + file.name + ", File size: " + file.size + ", Message: " + message); + break; + default: + if (file !== null) { + progress.setStatus("Неизвестная ошибка"); + } + this.debug("Error Code: " + errorCode + ", File name: " + file.name + ", File size: " + file.size + ", Message: " + message); + break; + } + } catch (ex) { + this.debug(ex); + } +} + +function fileDialogComplete(numFilesSelected, numFilesQueued) { + try { + if (numFilesSelected > 0) { + document.getElementById(this.customSettings.cancelButtonId).disabled = false; + } + + /* I want auto start the upload and I can do that here */ + + elements = document.getElementById("form").elements; + for(i=0; i < elements.length; i++) { + name = elements[i].name + if (name) { + value = ''; + switch(elements[i].type) { + case "select" : + value = elements[i].options[elements[i].selectedIndex].value + break; + case "radio": + case "checkbox": + value = elements[i].checked ? 1: 0; + break; + default: + value = elements[i].value; + break; + } + this.addPostParam(name, value); + } + } + + + this.startUpload(); + + } catch (ex) { + this.debug(ex); + } +} + +function uploadStart(file) { + try { + /* I don't want to do any file validation or anything, I'll just update the UI and + return true to indicate that the upload should start. + It's important to update the UI here because in Linux no uploadProgress events are called. The best + we can do is say we are uploading. + */ + var progress = new FileProgress(file, this.customSettings.progressTarget); + progress.setStatus("Загрузка..."); + progress.toggleCancel(true, this); + } + catch (ex) {} + + return true; +} + +function uploadProgress(file, bytesLoaded, bytesTotal) { + try { + var percent = Math.ceil((bytesLoaded / bytesTotal) * 100); + + var progress = new FileProgress(file, this.customSettings.progressTarget); + progress.setProgress(percent); + progress.setStatus("Загрузка..."); + } catch (ex) { + this.debug(ex); + } +} + +function uploadSuccess(file, serverData) { + try { + var progress = new FileProgress(file, this.customSettings.progressTarget); + progress.setComplete(); + progress.setStatus("Завершено."); + progress.toggleCancel(false); + + } catch (ex) { + this.debug(ex); + } +} + +function uploadError(file, errorCode, message) { + try { + var progress = new FileProgress(file, this.customSettings.progressTarget); + progress.setError(); + progress.toggleCancel(false); + + switch (errorCode) { + case SWFUpload.UPLOAD_ERROR.HTTP_ERROR: + progress.setStatus("Ошибка: " + message); + this.debug("Error Code: HTTP Error, File name: " + file.name + ", Message: " + message); + break; + case SWFUpload.UPLOAD_ERROR.UPLOAD_FAILED: + progress.setStatus("Ошибка загрузки."); + this.debug("Error Code: Upload Failed, File name: " + file.name + ", File size: " + file.size + ", Message: " + message); + break; + case SWFUpload.UPLOAD_ERROR.IO_ERROR: + progress.setStatus("Server (IO) Error"); + this.debug("Error Code: IO Error, File name: " + file.name + ", Message: " + message); + break; + case SWFUpload.UPLOAD_ERROR.SECURITY_ERROR: + progress.setStatus("Ошибка безопасности"); + this.debug("Error Code: Security Error, File name: " + file.name + ", Message: " + message); + break; + case SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED: + progress.setStatus("Превышен лимит загрузки."); + this.debug("Error Code: Upload Limit Exceeded, File name: " + file.name + ", File size: " + file.size + ", Message: " + message); + break; + case SWFUpload.UPLOAD_ERROR.FILE_VALIDATION_FAILED: + progress.setStatus("Ошибка идентификации. Загрузка пропущена."); + this.debug("Error Code: File Validation Failed, File name: " + file.name + ", File size: " + file.size + ", Message: " + message); + break; + case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED: + // If there aren't any files left (they were all cancelled) disable the cancel button + if (this.getStats().files_queued === 0) { + document.getElementById(this.customSettings.cancelButtonId).disabled = true; + } + progress.setStatus("Отменено"); + progress.setCancelled(); + break; + case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED: + progress.setStatus("Остановлено"); + break; + default: + progress.setStatus("Неизвестная ошибка: " + errorCode); + this.debug("Error Code: " + errorCode + ", File name: " + file.name + ", File size: " + file.size + ", Message: " + message); + break; + } + } catch (ex) { + this.debug(ex); + } +} + +function uploadComplete(file) { + if (this.getStats().files_queued === 0) { + document.getElementById(this.customSettings.cancelButtonId).disabled = true; + } +} + +// This event comes from the Queue Plugin +function queueComplete(numFilesUploaded) { +setTimeout('location.replace( window.location )', 2000); +} diff --git a/system/classes/swfupload/swfupload.js b/system/classes/swfupload/swfupload.js new file mode 100644 index 0000000..7d309d6 --- /dev/null +++ b/system/classes/swfupload/swfupload.js @@ -0,0 +1,840 @@ +/** + * SWFUpload v2.1.0 by Jacob Roberts, Feb 2008, http://www.swfupload.org, http://swfupload.googlecode.com, http://www.swfupload.org + * -------- -------- -------- -------- -------- -------- -------- -------- + * SWFUpload is (c) 2006 Lars Huring, Olov Nilzйn and Mammon Media and is released under the MIT License: + * http://www.opensource.org/licenses/mit-license.php + * + * See Changelog.txt for version history + * + */ + + +/* *********** */ +/* Constructor */ +/* *********** */ + +var SWFUpload = function (settings) { + this.initSWFUpload(settings); +}; + +SWFUpload.prototype.initSWFUpload = function (settings) { + try { + this.customSettings = {}; // A container where developers can place their own settings associated with this instance. + this.settings = settings; + this.eventQueue = []; + this.movieName = "SWFUpload_" + SWFUpload.movieCount++; + this.movieElement = null; + + // Setup global control tracking + SWFUpload.instances[this.movieName] = this; + + // Load the settings. Load the Flash movie. + this.initSettings(); + this.loadFlash(); + this.displayDebugInfo(); + } catch (ex) { + delete SWFUpload.instances[this.movieName]; + throw ex; + } +}; + +/* *************** */ +/* Static Members */ +/* *************** */ +SWFUpload.instances = {}; +SWFUpload.movieCount = 0; +SWFUpload.version = "2.2.0 Alpha"; +SWFUpload.QUEUE_ERROR = { + QUEUE_LIMIT_EXCEEDED : -100, + FILE_EXCEEDS_SIZE_LIMIT : -110, + ZERO_BYTE_FILE : -120, + INVALID_FILETYPE : -130 +}; +SWFUpload.UPLOAD_ERROR = { + HTTP_ERROR : -200, + MISSING_UPLOAD_URL : -210, + IO_ERROR : -220, + SECURITY_ERROR : -230, + UPLOAD_LIMIT_EXCEEDED : -240, + UPLOAD_FAILED : -250, + SPECIFIED_FILE_ID_NOT_FOUND : -260, + FILE_VALIDATION_FAILED : -270, + FILE_CANCELLED : -280, + UPLOAD_STOPPED : -290 +}; +SWFUpload.FILE_STATUS = { + QUEUED : -1, + IN_PROGRESS : -2, + ERROR : -3, + COMPLETE : -4, + CANCELLED : -5 +}; +SWFUpload.BUTTON_ACTION = { + SELECT_FILE : -100, + SELECT_FILES : -110, + START_UPLOAD : -120 +}; + +/* ******************** */ +/* Instance Members */ +/* ******************** */ + +// Private: initSettings ensures that all the +// settings are set, getting a default value if one was not assigned. +SWFUpload.prototype.initSettings = function () { + this.ensureDefault = function (settingName, defaultValue) { + this.settings[settingName] = (this.settings[settingName] == undefined) ? defaultValue : this.settings[settingName]; + }; + + // Upload backend settings + this.ensureDefault("upload_url", ""); + this.ensureDefault("file_post_name", "Filedata"); + this.ensureDefault("post_params", {}); + this.ensureDefault("use_query_string", false); + this.ensureDefault("requeue_on_error", false); + + // File Settings + this.ensureDefault("file_types", "*.*"); + this.ensureDefault("file_types_description", "All Files"); + this.ensureDefault("file_size_limit", 0); // Default zero means "unlimited" + this.ensureDefault("file_upload_limit", 0); + this.ensureDefault("file_queue_limit", 0); + + // Flash Settings + this.ensureDefault("flash_url", "swfupload_f9.swf"); + this.ensureDefault("flash_color", "#FFFFFF"); + this.ensureDefault("flash_wmode", "transparent"); + this.ensureDefault("flash_container_id", null); + this.ensureDefault("flash_width", '100%'); + this.ensureDefault("flash_height", '100%'); + + // Button Settings + /* + this.ensureDefault("button_image_url", 0); + this.ensureDefault("button_width", 1); + this.ensureDefault("button_height", 1); + this.ensureDefault("button_text", ""); + this.ensureDefault("button_text_style", ""); + this.ensureDefault("button_action", SWFUpload.BUTTON_ACTION.SELECT_FILES); + this.ensureDefault("button_disabled", false); + this.ensureDefault("button_placeholder_id", null); + */ + + // Debug Settings + this.ensureDefault("debug", false); + this.settings.debug_enabled = this.settings.debug; // Here to maintain v2 API + + // Event Handlers + this.settings.return_upload_start_handler = this.returnUploadStart; + this.ensureDefault("swfupload_loaded_handler", null); + this.ensureDefault("file_dialog_start_handler", null); + this.ensureDefault("file_queued_handler", null); + this.ensureDefault("file_queue_error_handler", null); + this.ensureDefault("file_dialog_complete_handler", null); + + this.ensureDefault("upload_start_handler", null); + this.ensureDefault("upload_progress_handler", null); + this.ensureDefault("upload_error_handler", null); + this.ensureDefault("upload_success_handler", null); + this.ensureDefault("upload_complete_handler", null); + + this.ensureDefault("debug_handler", this.debugMessage); + + this.ensureDefault("custom_settings", {}); + + // Other settings + this.customSettings = this.settings.custom_settings; + + delete this.ensureDefault; +}; + +SWFUpload.prototype.loadFlash = function () { + this.insertFlash(); +}; + +// Private: appendFlash gets the HTML tag for the Flash +// It then appends the flash to the body +SWFUpload.prototype.appendFlash = function () { + var targetElement, container; + + // Make sure an element with the ID we are going to use doesn't already exist + if (document.getElementById(this.movieName) !== null) { + throw "ID " + this.movieName + " is already in use. The Flash Object could not be added"; + } + + // Get the body tag where we will be adding the flash movie + targetElement = document.getElementsByTagName("body")[0]; + + if (targetElement == undefined) { + throw "Could not find the 'body' element."; + } + + // Append the container and load the flash + container = document.createElement("div"); + container.style.width = "1px"; + container.style.height = "1px"; + + targetElement.appendChild(container); + container.innerHTML = this.getFlashHTML(); // Using innerHTML is non-standard but the only sensible way to dynamically add Flash in IE (and maybe other browsers) +}; + +// Private: insertFlash inserts the flash movie into the container element. +SWFUpload.prototype.insertFlash = function () { + var targetElement, container; + + // Make sure an element with the ID we are going to use doesn't already exist + if (document.getElementById(this.movieName) !== null) { + throw "ID " + this.movieName + " is already in use. The Flash Object could not be added"; + } + + // Get the container elt into which we'll insert the flash movie + containerElement = document.getElementById(this.settings.flash_container_id); + + if (containerElement == undefined) { + throw "Could not find the container element."; + } + + // place flash embed inside the container element + containerElement.innerHTML = this.getFlashHTML(); +}; + +// Private: getFlashHTML generates the object tag needed to embed the flash in to the document +SWFUpload.prototype.getFlashHTML = function () { + // Flash Satay object syntax: http://www.alistapart.com/articles/flashsatay + return ['', + '', + '', + '', + '', + '', + '', + '', + ''].join(""); +}; + +// Private: getFlashVars builds the parameter string that will be passed +// to flash in the flashvars param. +SWFUpload.prototype.getFlashVars = function () { + // Build a string from the post param object + var paramString = this.buildParamString(); + + // Build the parameter string + return ["movieName=", encodeURIComponent(this.movieName), + "&uploadURL=", encodeURIComponent(this.settings.upload_url), + "&useQueryString=", encodeURIComponent(this.settings.use_query_string), + "&requeueOnError=", encodeURIComponent(this.settings.requeue_on_error), + "&params=", encodeURIComponent(paramString), + "&filePostName=", encodeURIComponent(this.settings.file_post_name), + "&fileTypes=", encodeURIComponent(this.settings.file_types), + "&fileTypesDescription=", encodeURIComponent(this.settings.file_types_description), + "&fileSizeLimit=", encodeURIComponent(this.settings.file_size_limit), + "&fileUploadLimit=", encodeURIComponent(this.settings.file_upload_limit), + "&fileQueueLimit=", encodeURIComponent(this.settings.file_queue_limit), + //"&buttonImage_url=", encodeURIComponent(this.settings.button_image_url), + //"&buttonWidth=", encodeURIComponent(this.settings.button_width), + //"&buttonHeight=", encodeURIComponent(this.settings.button_height), + //"&buttonText=", encodeURIComponent(this.settings.button_text), + //"&buttonTextStyle=", encodeURIComponent(this.settings.button_text_style), + //"&buttonAction=", encodeURIComponent(this.settings.button_action), + //"&buttonDisabled=", encodeURIComponent(this.settings.button_disabled) + ].join(""); +}; + +// Public: getMovieElement retrieves the DOM reference to the Flash element added by SWFUpload +// The element is cached after the first lookup +SWFUpload.prototype.getMovieElement = function () { + if (this.movieElement == undefined) { + this.movieElement = document.getElementById(this.movieName); + } + + if (this.movieElement === null) { + throw "Could not find Flash element"; + } + + return this.movieElement; +}; + +// Private: buildParamString takes the name/value pairs in the post_params setting object +// and joins them up in to a string formatted "name=value&name=value" +SWFUpload.prototype.buildParamString = function () { + var postParams = this.settings.post_params; + var paramStringPairs = []; + + if (typeof(postParams) === "object") { + for (var name in postParams) { + if (postParams.hasOwnProperty(name)) { + paramStringPairs.push(encodeURIComponent(name.toString()) + "=" + encodeURIComponent(postParams[name].toString())); + } + } + } + + return paramStringPairs.join("&"); +}; + +// Public: Used to remove a SWFUpload instance from the page. This method strives to remove +// all references to the SWF, and other objects so memory is properly freed. +// Returns true if everything was destroyed. Returns a false if a failure occurs leaving SWFUpload in an inconsistant state. +SWFUpload.prototype.destroy = function () { + try { + // Make sure Flash is done before we try to remove it + this.stopUpload(); + + // Remove the SWFUpload DOM nodes + var movieElement = null; + try { + movieElement = this.getMovieElement(); + } catch (ex) { + } + + if (movieElement != undefined && movieElement.parentNode != undefined && typeof(movieElement.parentNode.removeChild) === "function") { + var container = movieElement.parentNode; + if (container != undefined) { + container.removeChild(movieElement); + if (container.parentNode != undefined && typeof(container.parentNode.removeChild) === "function") { + container.parentNode.removeChild(container); + } + } + } + + // Destroy references + SWFUpload.instances[this.movieName] = null; + delete SWFUpload.instances[this.movieName]; + + delete this.movieElement; + delete this.settings; + delete this.customSettings; + delete this.eventQueue; + delete this.movieName; + + return true; + } catch (ex1) { + return false; + } +}; + +// Public: displayDebugInfo prints out settings and configuration +// information about this SWFUpload instance. +// This function (and any references to it) can be deleted when placing +// SWFUpload in production. +SWFUpload.prototype.displayDebugInfo = function () { + this.debug( + [ + "---SWFUpload Instance Info---\n", + "Version: ", SWFUpload.version, "\n", + "Movie Name: ", this.movieName, "\n", + "Settings:\n", + "\t", "upload_url: ", this.settings.upload_url, "\n", + "\t", "use_query_string: ", this.settings.use_query_string.toString(), "\n", + "\t", "file_post_name: ", this.settings.file_post_name, "\n", + "\t", "post_params: ", this.settings.post_params.toString(), "\n", + "\t", "file_types: ", this.settings.file_types, "\n", + "\t", "file_types_description: ", this.settings.file_types_description, "\n", + "\t", "file_size_limit: ", this.settings.file_size_limit, "\n", + "\t", "file_upload_limit: ", this.settings.file_upload_limit, "\n", + "\t", "file_queue_limit: ", this.settings.file_queue_limit, "\n", + "\t", "flash_url: ", this.settings.flash_url, "\n", + "\t", "flash_color: ", this.settings.flash_color, "\n", + "\t", "debug: ", this.settings.debug.toString(), "\n", + "\t", "custom_settings: ", this.settings.custom_settings.toString(), "\n", + "Event Handlers:\n", + "\t", "swfupload_loaded_handler assigned: ", (typeof(this.settings.swfupload_loaded_handler) === "function").toString(), "\n", + "\t", "file_dialog_start_handler assigned: ", (typeof(this.settings.file_dialog_start_handler) === "function").toString(), "\n", + "\t", "file_queued_handler assigned: ", (typeof(this.settings.file_queued_handler) === "function").toString(), "\n", + "\t", "file_queue_error_handler assigned: ", (typeof(this.settings.file_queue_error_handler) === "function").toString(), "\n", + "\t", "upload_start_handler assigned: ", (typeof(this.settings.upload_start_handler) === "function").toString(), "\n", + "\t", "upload_progress_handler assigned: ", (typeof(this.settings.upload_progress_handler) === "function").toString(), "\n", + "\t", "upload_error_handler assigned: ", (typeof(this.settings.upload_error_handler) === "function").toString(), "\n", + "\t", "upload_success_handler assigned: ", (typeof(this.settings.upload_success_handler) === "function").toString(), "\n", + "\t", "upload_complete_handler assigned: ", (typeof(this.settings.upload_complete_handler) === "function").toString(), "\n", + "\t", "debug_handler assigned: ", (typeof(this.settings.debug_handler) === "function").toString(), "\n" + ].join("") + ); +}; + +/* Note: addSetting and getSetting are no longer used by SWFUpload but are included + the maintain v2 API compatibility +*/ +// Public: (Deprecated) addSetting adds a setting value. If the value given is undefined or null then the default_value is used. +SWFUpload.prototype.addSetting = function (name, value, default_value) { + if (value == undefined) { + return (this.settings[name] = default_value); + } else { + return (this.settings[name] = value); + } +}; + +// Public: (Deprecated) getSetting gets a setting. Returns an empty string if the setting was not found. +SWFUpload.prototype.getSetting = function (name) { + if (this.settings[name] != undefined) { + return this.settings[name]; + } + + return ""; +}; + + + +// Private: callFlash handles function calls made to the Flash element. +// Calls are made with a setTimeout for some functions to work around +// bugs in the ExternalInterface library. +SWFUpload.prototype.callFlash = function (functionName, argumentArray) { + argumentArray = argumentArray || []; + + var self = this; + var callFunction = function () { + var movieElement = self.getMovieElement(); + var returnValue; + if (typeof(movieElement[functionName]) === "function") { + // We have to go through all this if/else stuff because the Flash functions don't have apply() and only accept the exact number of arguments. + if (argumentArray.length === 0) { + returnValue = movieElement[functionName](); + } else if (argumentArray.length === 1) { + returnValue = movieElement[functionName](argumentArray[0]); + } else if (argumentArray.length === 2) { + returnValue = movieElement[functionName](argumentArray[0], argumentArray[1]); + } else if (argumentArray.length === 3) { + returnValue = movieElement[functionName](argumentArray[0], argumentArray[1], argumentArray[2]); + } else { + throw "Too many arguments"; + } + + // Unescape file post param values + if (returnValue != undefined && typeof(returnValue.post) === "object") { + returnValue = self.unescapeFilePostParams(returnValue); + } + + return returnValue; + } else { + throw "Invalid function name"; + } + }; + + return callFunction(); +}; + + +/* ***************************** + -- Flash control methods -- + Your UI should use these + to operate SWFUpload + ***************************** */ + +// Public: selectFile causes a File Selection Dialog window to appear. This +// dialog only allows 1 file to be selected. WARNING: this function does not work in Flash Player 10 +SWFUpload.prototype.selectFile = function () { + this.callFlash("SelectFile"); +}; + +// Public: selectFiles causes a File Selection Dialog window to appear/ This +// dialog allows the user to select any number of files +// Flash Bug Warning: Flash limits the number of selectable files based on the combined length of the file names. +// If the selection name length is too long the dialog will fail in an unpredictable manner. There is no work-around +// for this bug. WARNING: this function does not work in Flash Player 10 +SWFUpload.prototype.selectFiles = function () { + this.callFlash("SelectFiles"); +}; + + +// Public: startUpload starts uploading the first file in the queue unless +// the optional parameter 'fileID' specifies the ID +SWFUpload.prototype.startUpload = function (fileID) { + this.callFlash("StartUpload", [fileID]); +}; + +/* Cancels a the file upload. You must specify a file_id */ +// Public: cancelUpload cancels any queued file. The fileID parameter +// must be specified. +SWFUpload.prototype.cancelUpload = function (fileID) { + this.callFlash("CancelUpload", [fileID]); +}; + +// Public: stopUpload stops the current upload and requeues the file at the beginning of the queue. +// If nothing is currently uploading then nothing happens. +SWFUpload.prototype.stopUpload = function () { + this.callFlash("StopUpload"); +}; + +/* ************************ + * Settings methods + * These methods change the SWFUpload settings. + * SWFUpload settings should not be changed directly on the settings object + * since many of the settings need to be passed to Flash in order to take + * effect. + * *********************** */ + +// Public: getStats gets the file statistics object. +SWFUpload.prototype.getStats = function () { + return this.callFlash("GetStats"); +}; + +// Public: setStats changes the SWFUpload statistics. You shouldn't need to +// change the statistics but you can. Changing the statistics does not +// affect SWFUpload accept for the successful_uploads count which is used +// by the upload_limit setting to determine how many files the user may upload. +SWFUpload.prototype.setStats = function (statsObject) { + this.callFlash("SetStats", [statsObject]); +}; + +// Public: getFile retrieves a File object by ID or Index. If the file is +// not found then 'null' is returned. +SWFUpload.prototype.getFile = function (fileID) { + if (typeof(fileID) === "number") { + return this.callFlash("GetFileByIndex", [fileID]); + } else { + return this.callFlash("GetFile", [fileID]); + } +}; + +// Public: addFileParam sets a name/value pair that will be posted with the +// file specified by the Files ID. If the name already exists then the +// exiting value will be overwritten. +SWFUpload.prototype.addFileParam = function (fileID, name, value) { + return this.callFlash("AddFileParam", [fileID, name, value]); +}; + +// Public: removeFileParam removes a previously set (by addFileParam) name/value +// pair from the specified file. +SWFUpload.prototype.removeFileParam = function (fileID, name) { + this.callFlash("RemoveFileParam", [fileID, name]); +}; + +// Public: setUploadUrl changes the upload_url setting. +SWFUpload.prototype.setUploadURL = function (url) { + this.settings.upload_url = url.toString(); + this.callFlash("SetUploadURL", [url]); +}; + +// Public: setPostParams changes the post_params setting +SWFUpload.prototype.setPostParams = function (paramsObject) { + this.settings.post_params = paramsObject; + this.callFlash("SetPostParams", [paramsObject]); +}; + +// Public: addPostParam adds post name/value pair. Each name can have only one value. +SWFUpload.prototype.addPostParam = function (name, value) { + this.settings.post_params[name] = value; + this.callFlash("SetPostParams", [this.settings.post_params]); +}; + +// Public: removePostParam deletes post name/value pair. +SWFUpload.prototype.removePostParam = function (name) { + delete this.settings.post_params[name]; + this.callFlash("SetPostParams", [this.settings.post_params]); +}; + +// Public: setFileTypes changes the file_types setting and the file_types_description setting +SWFUpload.prototype.setFileTypes = function (types, description) { + this.settings.file_types = types; + this.settings.file_types_description = description; + this.callFlash("SetFileTypes", [types, description]); +}; + +// Public: setFileSizeLimit changes the file_size_limit setting +SWFUpload.prototype.setFileSizeLimit = function (fileSizeLimit) { + this.settings.file_size_limit = fileSizeLimit; + this.callFlash("SetFileSizeLimit", [fileSizeLimit]); +}; + +// Public: setFileUploadLimit changes the file_upload_limit setting +SWFUpload.prototype.setFileUploadLimit = function (fileUploadLimit) { + this.settings.file_upload_limit = fileUploadLimit; + this.callFlash("SetFileUploadLimit", [fileUploadLimit]); +}; + +// Public: setFileQueueLimit changes the file_queue_limit setting +SWFUpload.prototype.setFileQueueLimit = function (fileQueueLimit) { + this.settings.file_queue_limit = fileQueueLimit; + this.callFlash("SetFileQueueLimit", [fileQueueLimit]); +}; + +// Public: setFilePostName changes the file_post_name setting +SWFUpload.prototype.setFilePostName = function (filePostName) { + this.settings.file_post_name = filePostName; + this.callFlash("SetFilePostName", [filePostName]); +}; + +// Public: setUseQueryString changes the use_query_string setting +SWFUpload.prototype.setUseQueryString = function (useQueryString) { + this.settings.use_query_string = useQueryString; + this.callFlash("SetUseQueryString", [useQueryString]); +}; + +// Public: setRequeueOnError changes the requeue_on_error setting +SWFUpload.prototype.setRequeueOnError = function (requeueOnError) { + this.settings.requeue_on_error = requeueOnError; + this.callFlash("SetRequeueOnError", [requeueOnError]); +}; + +// Public: setDebugEnabled changes the debug_enabled setting +SWFUpload.prototype.setDebugEnabled = function (debugEnabled) { + this.settings.debug_enabled = debugEnabled; + this.callFlash("SetDebugEnabled", [debugEnabled]); +}; + +// Public: setButtonImageURL loads a button image sprite +SWFUpload.prototype.setButtonImageURL = function (buttonImageURL) { + this.settings.button_image_url = buttonImageURL; + this.callFlash("SetButtonImageURL", [buttonImageURL]); +}; + +// Public: setButtonDimensions resizes the Flash Movie and button +SWFUpload.prototype.setButtonDimensions = function (width, height) { + this.settings.button_width = width; + this.settings.button_height = height; + + this.callFlash("SetButtonDimensions", [width, height]); +}; +// Public: setButtonText Changes the text overlaid on the button +SWFUpload.prototype.setButtonText = function (html) { + this.settings.button_text= html; + this.callFlash("SetButtonText", [html]); +}; +// Public: setButtonTextStyle changes the CSS used to style the HTML/Text overlaid on the button +SWFUpload.prototype.setButtonTextStyle = function (css) { + this.settings.button_text_style = css; + this.callFlash("SetButtonTextStyle", [css]); +}; +// Public: setButtonDisabled disables/enables the button +SWFUpload.prototype.setButtonDisabled = function (isDisabled) { + this.settings.button_disabled = isDisabled; + this.callFlash("SetButtonDisabled", [isDisabled]); +}; +// Public: setButtonAction sets the action that occurs when the button is clicked +SWFUpload.prototype.setButtonAction = function (buttonAction) { + this.settings.button_action = buttonAction; + this.callFlash("SetButtonAction", [buttonAction]); +}; + +/* ******************************* + Flash Event Interfaces + These functions are used by Flash to trigger the various + events. + + All these functions a Private. + + Because the ExternalInterface library is buggy the event calls + are added to a queue and the queue then executed by a setTimeout. + This ensures that events are executed in a determinate order and that + the ExternalInterface bugs are avoided. +******************************* */ + +SWFUpload.prototype.queueEvent = function (handlerName, argumentArray) { + // Warning: Don't call this.debug inside here or you'll create an infinite loop + + if (argumentArray == undefined) { + argumentArray = []; + } else if (!(argumentArray instanceof Array)) { + argumentArray = [argumentArray]; + } + + var self = this; + if (typeof(this.settings[handlerName]) === "function") { + // Queue the event + this.eventQueue.push(function () { + this.settings[handlerName].apply(this, argumentArray); + }); + + // Execute the next queued event + setTimeout(function () { + self.executeNextEvent(); + }, 0); + + } else if (this.settings[handlerName] !== null) { + throw "Event handler " + handlerName + " is unknown or is not a function"; + } +}; + +// Private: Causes the next event in the queue to be executed. Since events are queued using a setTimeout +// we must queue them in order to garentee that they are executed in order. +SWFUpload.prototype.executeNextEvent = function () { + // Warning: Don't call this.debug inside here or you'll create an infinite loop + + var f = this.eventQueue ? this.eventQueue.shift() : null; + if (typeof(f) === "function") { + f.apply(this); + } +}; + +// Private: unescapeFileParams is part of a workaround for a flash bug where objects passed through ExternalInterfance cannot have +// properties that contain characters that are not valid for JavaScript identifiers. To work around this +// the Flash Component escapes the parameter names and we must unescape again before passing them along. +SWFUpload.prototype.unescapeFilePostParams = function (file) { + var reg = /[$]([0-9a-f]{4})/i; + var unescapedPost = {}; + var uk; + + if (file != undefined) { + for (var k in file.post) { + if (file.post.hasOwnProperty(k)) { + uk = k; + var match; + while ((match = reg.exec(uk)) !== null) { + uk = uk.replace(match[0], String.fromCharCode(parseInt("0x"+match[1], 16))); + } + unescapedPost[uk] = file.post[k]; + } + } + + file.post = unescapedPost; + } + + return file; +}; + +SWFUpload.prototype.flashReady = function () { + // Check that the movie element is loaded correctly with its ExternalInterface methods defined + var movieElement = this.getMovieElement(); + if (typeof(movieElement.StartUpload) !== "function") { + throw "ExternalInterface methods failed to initialize."; + } + + this.queueEvent("swfupload_loaded_handler"); +}; + + +/* This is a chance to do something before the browse window opens */ +SWFUpload.prototype.fileDialogStart = function () { + this.queueEvent("file_dialog_start_handler"); +}; + + +/* Called when a file is successfully added to the queue. */ +SWFUpload.prototype.fileQueued = function (file) { + file = this.unescapeFilePostParams(file); + this.queueEvent("file_queued_handler", file); +}; + + +/* Handle errors that occur when an attempt to queue a file fails. */ +SWFUpload.prototype.fileQueueError = function (file, errorCode, message) { + file = this.unescapeFilePostParams(file); + this.queueEvent("file_queue_error_handler", [file, errorCode, message]); +}; + +/* Called after the file dialog has closed and the selected files have been queued. + You could call startUpload here if you want the queued files to begin uploading immediately. */ +SWFUpload.prototype.fileDialogComplete = function (numFilesSelected, numFilesQueued) { + this.queueEvent("file_dialog_complete_handler", [numFilesSelected, numFilesQueued]); +}; + +SWFUpload.prototype.uploadStart = function (file) { + file = this.unescapeFilePostParams(file); + this.queueEvent("return_upload_start_handler", file); +}; + +SWFUpload.prototype.returnUploadStart = function (file) { + var returnValue; + if (typeof(this.settings.upload_start_handler) === "function") { + file = this.unescapeFilePostParams(file); + returnValue = this.settings.upload_start_handler.call(this, file); + } else if (this.settings.upload_start_handler != undefined) { + throw "upload_start_handler must be a function"; + } + + // Convert undefined to true so if nothing is returned from the upload_start_handler it is + // interpretted as 'true'. + if (returnValue === undefined) { + returnValue = true; + } + + returnValue = !!returnValue; + + this.callFlash("ReturnUploadStart", [returnValue]); +}; + + + +SWFUpload.prototype.uploadProgress = function (file, bytesComplete, bytesTotal) { + file = this.unescapeFilePostParams(file); + this.queueEvent("upload_progress_handler", [file, bytesComplete, bytesTotal]); +}; + +SWFUpload.prototype.uploadError = function (file, errorCode, message) { + file = this.unescapeFilePostParams(file); + this.queueEvent("upload_error_handler", [file, errorCode, message]); +}; + +SWFUpload.prototype.uploadSuccess = function (file, serverData) { + file = this.unescapeFilePostParams(file); + this.queueEvent("upload_success_handler", [file, serverData]); +}; + +SWFUpload.prototype.uploadComplete = function (file) { + file = this.unescapeFilePostParams(file); + this.queueEvent("upload_complete_handler", file); +}; + +/* Called by SWFUpload JavaScript and Flash functions when debug is enabled. By default it writes messages to the + internal debug console. You can override this event and have messages written where you want. */ +SWFUpload.prototype.debug = function (message) { + this.queueEvent("debug_handler", message); +}; + + +/* ********************************** + Debug Console + The debug console is a self contained, in page location + for debug message to be sent. The Debug Console adds + itself to the body if necessary. + + The console is automatically scrolled as messages appear. + + If you are using your own debug handler or when you deploy to production and + have debug disabled you can remove these functions to reduce the file size + and complexity. +********************************** */ + +// Private: debugMessage is the default debug_handler. If you want to print debug messages +// call the debug() function. When overriding the function your own function should +// check to see if the debug setting is true before outputting debug information. +SWFUpload.prototype.debugMessage = function (message) { + if (this.settings.debug) { + var exceptionMessage, exceptionValues = []; + + // Check for an exception object and print it nicely + if (typeof(message) === "object" && typeof(message.name) === "string" && typeof(message.message) === "string") { + for (var key in message) { + if (message.hasOwnProperty(key)) { + exceptionValues.push(key + ": " + message[key]); + } + } + exceptionMessage = exceptionValues.join("\n") || ""; + exceptionValues = exceptionMessage.split("\n"); + exceptionMessage = "EXCEPTION: " + exceptionValues.join("\nEXCEPTION: "); + SWFUpload.Console.writeLine(exceptionMessage); + } else { + SWFUpload.Console.writeLine(message); + } + } +}; + +SWFUpload.Console = {}; +SWFUpload.Console.writeLine = function (message) { + var console, documentForm; + + try { + console = document.getElementById("SWFUpload_Console"); + + if (!console) { + documentForm = document.createElement("form"); + document.getElementsByTagName("body")[0].appendChild(documentForm); + + console = document.createElement("textarea"); + console.id = "SWFUpload_Console"; + console.style.fontFamily = "monospace"; + console.setAttribute("wrap", "off"); + console.wrap = "off"; + console.style.overflow = "auto"; + console.style.width = "700px"; + console.style.height = "350px"; + console.style.margin = "5px"; + documentForm.appendChild(console); + } + + console.value += message + "\n"; + + console.scrollTop = console.scrollHeight - console.clientHeight; + } catch (ex) { + alert("Exception: " + ex.name + " Message: " + ex.message); + } +}; diff --git a/system/classes/swfupload/swfupload.queue.js b/system/classes/swfupload/swfupload.queue.js new file mode 100644 index 0000000..b04d87a --- /dev/null +++ b/system/classes/swfupload/swfupload.queue.js @@ -0,0 +1,77 @@ +/* + Queue Plug-in + + Features: + *Adds a cancelQueue() method for cancelling the entire queue. + *All queued files are uploaded when startUpload() is called. + *If false is returned from uploadComplete then the queue upload is stopped. + If false is not returned (strict comparison) then the queue upload is continued. + *Adds a QueueComplete event that is fired when all the queued files have finished uploading. + Set the event handler with the queue_complete_handler setting. + + */ + +var SWFUpload; +if (typeof(SWFUpload) === "function") { + SWFUpload.queue = {}; + + SWFUpload.prototype.initSettings = (function (oldInitSettings) { + return function () { + if (typeof(oldInitSettings) === "function") { + oldInitSettings.call(this); + } + + this.customSettings.queue_cancelled_flag = false; + this.customSettings.queue_upload_count = 0; + + this.settings.user_upload_complete_handler = this.settings.upload_complete_handler; + this.settings.upload_complete_handler = SWFUpload.queue.uploadCompleteHandler; + + this.settings.queue_complete_handler = this.settings.queue_complete_handler || null; + }; + })(SWFUpload.prototype.initSettings); + + SWFUpload.prototype.startUpload = function (fileID) { + this.customSettings.queue_cancelled_flag = false; + this.callFlash("StartUpload", false, [fileID]); + }; + + SWFUpload.prototype.cancelQueue = function () { + this.customSettings.queue_cancelled_flag = true; + this.stopUpload(); + + var stats = this.getStats(); + while (stats.files_queued > 0) { + this.cancelUpload(); + stats = this.getStats(); + } + }; + + SWFUpload.queue.uploadCompleteHandler = function (file) { + var user_upload_complete_handler = this.settings.user_upload_complete_handler; + var continueUpload; + + if (file.filestatus === SWFUpload.FILE_STATUS.COMPLETE) { + this.customSettings.queue_upload_count++; + } + + if (typeof(user_upload_complete_handler) === "function") { + continueUpload = (user_upload_complete_handler.call(this, file) === false) ? false : true; + } else { + continueUpload = true; + } + + if (continueUpload) { + var stats = this.getStats(); + if (stats.files_queued > 0 && this.customSettings.queue_cancelled_flag === false) { + this.startUpload(); + } else if (this.customSettings.queue_cancelled_flag === false) { + this.queueEvent("queue_complete_handler", [this.customSettings.queue_upload_count]); + this.customSettings.queue_upload_count = 0; + } else { + this.customSettings.queue_cancelled_flag = false; + this.customSettings.queue_upload_count = 0; + } + } + }; +} \ No newline at end of file diff --git a/system/classes/swfupload/swfupload.swf b/system/classes/swfupload/swfupload.swf new file mode 100644 index 0000000..2b94b5d Binary files /dev/null and b/system/classes/swfupload/swfupload.swf differ diff --git a/system/classes/swfupload/swfupload_f8.swf b/system/classes/swfupload/swfupload_f8.swf new file mode 100644 index 0000000..2d2893f Binary files /dev/null and b/system/classes/swfupload/swfupload_f8.swf differ diff --git a/system/classes/swfupload/swfupload_f9.swf b/system/classes/swfupload/swfupload_f9.swf new file mode 100644 index 0000000..115cb90 Binary files /dev/null and b/system/classes/swfupload/swfupload_f9.swf differ diff --git a/system/classes/templates.class.php b/system/classes/templates.class.php new file mode 100644 index 0000000..0072f4a --- /dev/null +++ b/system/classes/templates.class.php @@ -0,0 +1,225 @@ + '', 'vote' => '', 'speedbar' => '', 'content' => '' ); + var $allow_php_include = true; + + function set($name, $var) { + if( is_array( $var ) && count( $var ) ) { + foreach ( $var as $key => $key_var ) { + $this->set( $key, $key_var ); + } + } else + $this->data[$name] = $var; + } + + function set_block($name, $var) { + if( is_array( $var ) && count( $var ) ) { + foreach ( $var as $key => $key_var ) { + $this->set_block( $key, $key_var ); + } + } else + $this->block_data[$name] = $var; + } + + function load_template($tpl_name) { + + if( $this->CacheTemplate[ $tpl_name ] ){ + $this->copy_template = $this->CacheTemplate[ $tpl_name ]; + return true; + } + + if( $tpl_name == '' || ! file_exists( $this->dir . DIRECTORY_SEPARATOR . $tpl_name ) ) { + die( "Невозможно загрузить шаблон: " . $tpl_name ); + return false; + } + + $this->template = file_get_contents( $this->dir . DIRECTORY_SEPARATOR . $tpl_name ); + + if (strpos ( $this->template, "[aviable=" ) !== false) {$this->template = preg_replace ( "#\\[aviable=(.+?)\\](.*?)\\[/aviable\\]#ies", "\$this->check_module('\\1', '\\2')", $this->template );} + if (strpos ( $this->template, "[not-aviable=" ) !== false) {$this->template = preg_replace ( "#\\[not-aviable=(.+?)\\](.*?)\\[/not-aviable\\]#ies", "\$this->check_module('\\1', '\\2', false)", $this->template );} + if (strpos ( $this->template, "[not-group=" ) !== false) {$this->template = preg_replace ( "#\\[not-group=(.+?)\\](.*?)\\[/not-group\\]#ies", "\$this->check_group('\\1', '\\2', false)", $this->template );} + if (strpos ( $this->template, "[group=" ) !== false) {$this->template = preg_replace ( "#\\[group=(.+?)\\](.*?)\\[/group\\]#ies", "\$this->check_group('\\1', '\\2')", $this->template );} + if (strpos ( $this->template, "{include file=" ) !== false ) {$this->template = preg_replace( "#\\{include file=['\"](.+?)['\"]\\}#ies", "\$this->load_file('\\1', 'tpl')", $this->template );} + + $this->copy_template = $this->template; + + $this->CacheTemplate[ $tpl_name ] = $this->template; + + return true; + } + + function load_file( $name, $include_file = "tpl" ) { + global $db, $is_logged, $member_id, $cat_info, $config, $user_group, $category_id, $_TIME, $lang, $smartphone_detected, $dle_module; + + $name = str_replace( '..', '', $name ); + + $url = @parse_url ($name); + $type = explode( ".", $url['path'] ); + $type = strtolower( end( $type ) ); + + if ($type == "tpl") {return $this->sub_load_template( $name );} + + if ($include_file == "php") { + + if ( !$this->allow_php_include ) return; + + if ($type != "php") return "Для подключения допускаются только файлы с расширением .tpl или .php"; + + if ($url['path']{0} == "/" )$file_path = dirname (ROOT_DIR.$url['path']); + else $file_path = dirname (ROOT_DIR."/".$url['path']); + + $file_name = pathinfo($url['path']); + $file_name = $file_name['basename']; + + if ( stristr ( php_uname( "s" ) , "windows" ) === false ) + $chmod_value = @decoct(@fileperms($file_path)) % 1000; + + if ($chmod_value == 777 ) return "Файл {$url['path']} находится в папке, которая доступна для записи (CHMOD 777). В целях безопасности подключение файлов из таких папок невозможно. Измените права на папку, чтобы на нее небыло прав на запись."; + if ( !file_exists($file_path."/".$file_name) ) return "Файл {$url['path']} не найден, его загрузка невозможна."; + + if ( $url['query'] ) {parse_str( $url['query'] );} + + ob_start(); + $tpl = new dle_template( ); + $tpl->dir = TEMPLATE_DIR; + include $file_path."/".$file_name; + return ob_get_clean(); + } + return '{include file="'.$name.'"}'; + } + + function sub_load_template( $tpl_name ) { + + $tpl_name = totranslit( $tpl_name ); + + if( $tpl_name == '' || ! file_exists( $this->dir . DIRECTORY_SEPARATOR . $tpl_name ) ) { + return "Отсутствует файл шаблона: " . $tpl_name ; + return false; + } + $template = file_get_contents( $this->dir . DIRECTORY_SEPARATOR . $tpl_name ); + + if (strpos ( $template, "[aviable=" ) !== false) {$template = preg_replace ( "#\\[aviable=(.+?)\\](.*?)\\[/aviable\\]#ies", "\$this->check_module('\\1', '\\2')", $template );} + if (strpos ( $template, "[not-aviable=" ) !== false) {$template = preg_replace ( "#\\[not-aviable=(.+?)\\](.*?)\\[/not-aviable\\]#ies", "\$this->check_module('\\1', '\\2', false)", $template );} + if (strpos ( $template, "[not-group=" ) !== false) {$template = preg_replace ( "#\\[not-group=(.+?)\\](.*?)\\[/not-group\\]#ies", "\$this->check_group('\\1', '\\2', false)", $template );} + if (strpos ( $this->template, "{if " ) !== false) {$this->template = preg_replace ( "#{if (.+?)}(.*?){/if}#ies", "$this->check_else('1', '2', false)", $this->template );} + if (strpos ( $template, "[group=" ) !== false) {$template = preg_replace ( "#\\[group=(.+?)\\](.*?)\\[/group\\]#ies", "\$this->check_group('\\1', '\\2')", $template );} + + return $template; + } + + function check_module($aviable, $block, $action = true) { + global $dle_module; + + $aviable = explode( '|', $aviable ); + + $block = str_replace( '\"', '"', $block ); + + if( $action ) { + + if( ! (in_array( $dle_module, $aviable )) and ($aviable[0] != "global") ) return ""; + else return $block; + + } else { + + if( (in_array( $dle_module, $aviable )) ) return ""; + else return $block; + + } + + } + + function check_group($groups, $block, $action = true) { + global $member_id; + + $groups = explode( ',', $groups ); + + if( $action ) { + + if( ! in_array( $member_id['user_group'], $groups ) ) return ""; + + } else { + + if( in_array( $member_id['user_group'], $groups ) ) return ""; + + } + + $block = str_replace( '\"', '"', $block ); + + return $block; + + } + + function _clear() { + + $this->data = array (); + $this->block_data = array (); + $this->copy_template = $this->template; + + } + + function clear() { + + $this->data = array (); + $this->block_data = array (); + $this->copy_template = null; + $this->template = null; + + } + + function global_clear() { + + $this->data = array (); + $this->block_data = array (); + $this->result = array (); + $this->copy_template = null; + $this->template = null; + + } + + function compile($tpl) { + if( count( $this->block_data ) ) { + foreach ( $this->block_data as $key_find => $key_replace ) { + $find_preg[] = $key_find; + $replace_preg[] = $key_replace; + } + + $this->copy_template = preg_replace( $find_preg, $replace_preg, $this->copy_template ); + } + + foreach ( $this->data as $key_find => $key_replace ) { + $find[] = $key_find; + $replace[] = $key_replace; + } + + $this->copy_template = str_replace( $find, $replace, $this->copy_template ); + + if( strpos( $this->copy_template, "{include file=" ) !== false ) { + + $this->copy_template = preg_replace( "#\\{include file=['\"](.+?)['\"]\\}#ies", "\$this->load_file('\\1', 'php')", $this->copy_template ); + + } + + if( isset( $this->result[$tpl] ) ) $this->result[$tpl] .= $this->copy_template; + else $this->result[$tpl] = $this->copy_template; + + $this->_clear(); + } + + function check_else($condition, $block){ + global $GLOBALS; + extract($GLOBALS, EXTR_SKIP, ""); + if(is_array($matches=explode("{else}",$block))) { + $block=$matches[0]; + $else=$matches[1]; + } + if(eval(("return $condition;"))) return str_replace( '"', '"', $block ); + return str_replace( '"', '"', $else ); + } +} +?> \ No newline at end of file diff --git a/system/classes/thumb.class.php b/system/classes/thumb.class.php new file mode 100644 index 0000000..8893966 --- /dev/null +++ b/system/classes/thumb.class.php @@ -0,0 +1,258 @@ +img['format'] = "JPEG"; + $this->img['src'] = @imagecreatefromjpeg( $imgfile ); + } elseif( $info[2] == 3 ) { + $this->img['format'] = "PNG"; + $this->img['src'] = @imagecreatefrompng( $imgfile ); + } elseif( $info[2] == 1 ) { + $this->img['format'] = "GIF"; + $this->img['src'] = @imagecreatefromgif( $imgfile ); + } else { + echo "Not Supported File! Thumbnails can only be made from .jpg, gif and .png images!"; + @unlink( $imgfile ); + exit(); + } + + if( !$this->img['src'] ) { + echo "Not Supported File! Thumbnails can only be made from .jpg, gif and .png images!"; + @unlink( $imgfile ); + exit(); + + } + + $this->img['lebar'] = @imagesx( $this->img['src'] ); + $this->img['tinggi'] = @imagesy( $this->img['src'] ); + $this->img['lebar_thumb'] = $this->img['lebar']; + $this->img['tinggi_thumb'] = $this->img['tinggi']; + //default quality jpeg + $this->img['quality'] = 90; + } + + function size_auto($size = 100, $site = 0) { + + $size = explode ("x", $size); + + if ( count($size) == 2 ) { + $size[0] = intval($size[0]); + $size[1] = intval($size[1]); + return $this->crop( intval($size[0]), intval($size[1]) ); + + } else { + $size[0] = intval($size[0]); + return $this->scale( intval($size[0]), $site); + + } + + } + + function crop($nw, $nh) { + + $w = $this->img['lebar']; + $h = $this->img['tinggi']; + + if( $w <= $nw AND $h <= $nh ) { + $this->img['lebar_thumb'] = $w; + $this->img['tinggi_thumb'] = $h; + return 0; + } + + $nw = min($nw, $w); + $nh = min($nh, $h); + + $size_ratio = max($nw / $w, $nh / $h); + + $src_w = ceil($nw / $size_ratio); + $src_h = ceil($nh / $size_ratio); + + $sx = floor(($w - $src_w)/2); + $sy = floor(($h - $src_h)/2); + + $this->img['des'] = imagecreatetruecolor($nw, $nh); + + if ( $this->img['format'] == "PNG" ) { + imagealphablending( $this->img['des'], false); + imagesavealpha( $this->img['des'], true); + } + + imagecopyresampled($this->img['des'],$this->img['src'],0,0,$sx,$sy,$nw,$nh,$src_w,$src_h); + + $this->img['src'] = $this->img['des']; + return 1; + } + + function scale($size = 100, $site = 0) { + + $site = intval( $site ); + + if( $this->img['lebar'] <= $size and $this->img['tinggi'] <= $size ) { + $this->img['lebar_thumb'] = $this->img['lebar']; + $this->img['tinggi_thumb'] = $this->img['tinggi']; + return 0; + } + + switch ($site) { + + case "1" : + if( $this->img['lebar'] <= $size ) { + $this->img['lebar_thumb'] = $this->img['lebar']; + $this->img['tinggi_thumb'] = $this->img['tinggi']; + return 0; + } else { + $this->img['lebar_thumb'] = $size; + $this->img['tinggi_thumb'] = ($this->img['lebar_thumb'] / $this->img['lebar']) * $this->img['tinggi']; + } + + break; + + case "2" : + if( $this->img['tinggi'] <= $size ) { + $this->img['lebar_thumb'] = $this->img['lebar']; + $this->img['tinggi_thumb'] = $this->img['tinggi']; + return 0; + } else { + $this->img['tinggi_thumb'] = $size; + $this->img['lebar_thumb'] = ($this->img['tinggi_thumb'] / $this->img['tinggi']) * $this->img['lebar']; + } + + break; + + default : + + if( $this->img['lebar'] >= $this->img['tinggi'] ) { + $this->img['lebar_thumb'] = $size; + $this->img['tinggi_thumb'] = ($this->img['lebar_thumb'] / $this->img['lebar']) * $this->img['tinggi']; + + } else { + + $this->img['tinggi_thumb'] = $size; + $this->img['lebar_thumb'] = ($this->img['tinggi_thumb'] / $this->img['tinggi']) * $this->img['lebar']; + + } + + break; + } + if ($this->img['lebar_thumb'] < 1 ) $this->img['lebar_thumb'] = 1; + if ($this->img['tinggi_thumb'] < 1 ) $this->img['tinggi_thumb'] = 1; + $this->img['des'] = imagecreatetruecolor( $this->img['lebar_thumb'], $this->img['tinggi_thumb'] ); + + if ( $this->img['format'] == "PNG" ) { + imagealphablending( $this->img['des'], false); + imagesavealpha( $this->img['des'], true); + } + + @imagecopyresampled( $this->img['des'], $this->img['src'], 0, 0, 0, 0, $this->img['lebar_thumb'], $this->img['tinggi_thumb'], $this->img['lebar'], $this->img['tinggi'] ); + + $this->img['src'] = $this->img['des']; + return 1; + + } + + function jpeg_quality($quality = 90) { + //jpeg quality + $this->img['quality'] = $quality; + } + + function save($save = "") { + + if( $this->img['format'] == "JPG" || $this->img['format'] == "JPEG" ) { + //JPEG + imagejpeg( $this->img['src'], $save, $this->img['quality'] ); + } elseif( $this->img['format'] == "PNG" ) { + //PNG + imagealphablending( $this->img['src'], false); + imagesavealpha( $this->img['src'], true); + imagepng( $this->img['src'], $save ); + } elseif( $this->img['format'] == "GIF" ) { + //GIF + imagegif( $this->img['src'], $save ); + } + + imagedestroy( $this->img['src'] ); + } + + function show() { + if( $this->img['format'] == "JPG" || $this->img['format'] == "JPEG" ) { + //JPEG + imageJPEG( $this->img['src'], "", $this->img['quality'] ); + } elseif( $this->img['format'] == "PNG" ) { + //PNG + imagePNG( $this->img['src'] ); + } elseif( $this->img['format'] == "GIF" ) { + //GIF + imageGIF( $this->img['src'] ); + } + + imagedestroy( $this->img['src'] ); + } + + // ************************************************************************* + function insert_watermark($min_image) { + global $config; + $margin = 7; + + $this->watermark_image_light = ROOT_DIR . '/templates/' . $config['skin'] . '/images/watermark.png'; + $this->watermark_image_dark = ROOT_DIR . '/templates/' . $config['skin'] . '/images/watermark.png'; + + $image_width = imagesx( $this->img['src'] ); + $image_height = imagesy( $this->img['src'] ); + + list ( $watermark_width, $watermark_height ) = getimagesize( $this->watermark_image_light ); + + $watermark_x = $image_width - $margin - $watermark_width + $margin; + //$watermark_y = $image_height - $margin - $watermark_height; + $watermark_y = $image_height - $watermark_height; + + $watermark_x2 = $watermark_x + $watermark_width; + $watermark_y2 = $watermark_y + $watermark_height; + + if( $watermark_x < 0 or $watermark_y < 0 or $watermark_x2 > $image_width or $watermark_y2 > $image_height or $image_width < $min_image or $image_height < $min_image ) { + return; + } + + $test = imagecreatetruecolor( 1, 1 ); + imagecopyresampled( $test, $this->img['src'], 0, 0, $watermark_x, $watermark_y, 1, 1, $watermark_width, $watermark_height ); + $rgb = imagecolorat( $test, 0, 0 ); + + $r = ($rgb >> 16) & 0xFF; + $g = ($rgb >> 8) & 0xFF; + $b = $rgb & 0xFF; + + $max = min( $r, $g, $b ); + $min = max( $r, $g, $b ); + $lightness = ( double ) (($max + $min) / 510.0); + imagedestroy( $test ); + + $watermark_image = ($lightness < 0.5) ? $this->watermark_image_light : $this->watermark_image_dark; + + $watermark = imagecreatefrompng( $watermark_image ); + + imagealphablending( $this->img['src'], TRUE ); + imagealphablending( $watermark, TRUE ); + + if( $this->img['format'] == "PNG" ) { + $png8fix = imagecreatetruecolor( $image_width, $image_height ); + imagecopy( $png8fix, $this->img['src'], 0, 0, 0, 0, $image_width, $image_height ); + imagecopy( $png8fix, $watermark, $watermark_x, $watermark_y, 0, 0, $watermark_width, $watermark_height ); + imagecopy( $this->img['src'], $png8fix, 0, 0, 0, 0, $image_width, $image_height ); + imagedestroy( $png8fix ); + }else imagecopy( $this->img['src'], $watermark, $watermark_x, $watermark_y, 0, 0, $watermark_width, $watermark_height ); + + imagedestroy( $watermark ); + + } + +} +?> \ No newline at end of file diff --git a/system/classes/torrent.class.php b/system/classes/torrent.class.php new file mode 100644 index 0000000..e0a06ca --- /dev/null +++ b/system/classes/torrent.class.php @@ -0,0 +1,537 @@ + 4096 ) + return self::set_error( new Exception( 'Invalid piece lenth, must be between 32 and 4096' ) ); + if ( is_string( $meta ) ) + $meta = array( 'announce' => $meta ); + if ( $this->build( $data, $piece_length * 1024 ) ) + $this->touch(); + else + $meta = array_merge( $meta, $this->decode( $data ) ); + foreach( $meta as $key => $value ) + $this->{$key} = $value; + } + + public function __toString() { + return $this->encode( $this ); + } + + public function error() { + return empty( self::$_errors ) ? + false : + self::$_errors[0]->getMessage(); + } + + public function errors() { + return empty( self::$_errors ) ? + false : + self::$_errors; + } + + public function announce ( $announce = null ) { + if ( is_null( $announce ) ) + return ! isset( $this->{'announce-list'} ) ? + isset( $this->announce ) ? $this->announce : null : + $this->{'announce-list'}; + $this->touch(); + if ( is_string( $announce ) && isset( $this->announce ) ) + return $this->{'announce-list'} = self::announce_list( isset( $this->{'announce-list'} ) ? $this->{'announce-list'} : $this->announce, $announce ); + unset( $this->{'announce-list'} ); + if ( is_array( $announce ) || is_object( $announce ) ) + if ( ( $this->announce = self::first_announce( $announce ) ) && count( $announce ) > 1 ) + return $this->{'announce-list'} = self::announce_list( $announce ); + else + return $this->announce; + if ( ! isset( $this->announce ) && $announce ) + return $this->announce = (string) $announce; + unset( $this->announce ); + } + + public function comment ( $comment = null ) { + return is_null( $comment ) ? + isset( $this->comment ) ? $this->comment : null : + $this->touch( $this->comment = (string) $comment ); + } + + public function name ( $name = null ) { + return is_null( $name ) ? + isset( $this->info['name'] ) ? $this->info['name'] : null : + $this->touch( $this->info['name'] = (string) $name ); + } + + public function is_private ( $private = null ) { + return is_null( $private ) ? + ! empty( $this->info['private'] ) : + $this->touch( $this->info['private'] = $private ? 1 : 0 ); + } + + public function url_list ( $urls = null ) { + return is_null( $urls ) ? + isset( $this->{'url-list'} ) ? $this->{'url-list'} : null : + $this->touch( $this->{'url-list'} = is_string( $urls) ? $urls : (array) $urls ); + } + + public function httpseeds ( $urls = null ) { + return is_null( $urls ) ? + isset( $this->httpseeds ) ? $this->httpseeds : null : + $this->touch( $this->httpseeds = (array) $urls ); + } + + public function piece_length () { + return isset( $this->info['piece length'] ) ? + $this->info['piece length'] : + null; + } + + public function hash_info () { + return isset( $this->info ) ? + sha1( self::encode( $this->info ) ) : + null; + } + + public function content ( $precision = null ) { + $files = array(); + if ( isset( $this->info['files'] ) && is_array( $this->info['files'] ) ) + foreach ( $this->info['files'] as $file ) + $files[self::path( $file['path'], $this->info['name'] )] = $precision ? + self::format( $file['length'], $precision ) : + $file['length']; + elseif ( isset( $this->info['name'] ) ) + $files[$this->info['name']] = $precision ? + self::format( $this->info['length'], $precision ) : + $this->info['length']; + return $files; + } + + public function offset () { + $files = array(); + $size = 0; + if ( isset( $this->info['files'] ) && is_array( $this->info['files'] ) ) + foreach ( $this->info['files'] as $file ) + $files[self::path( $file['path'], $this->info['name'] )] = array( + 'startpiece' => floor( $size / $this->info['piece length'] ), + 'offset' => fmod( $size, $this->info['piece length'] ), + 'size' => $size += $file['length'], + 'endpiece' => floor( $size / $this->info['piece length'] ) + ); + elseif ( isset( $this->info['name'] ) ) + $files[$this->info['name']] = array( + 'startpiece' => 0, + 'offset' => 0, + 'size' => $this->info['length'], + 'endpiece' => floor( $this->info['length'] / $this->info['piece length'] ) + ); + return $files; + } + + public function size ( $precision = null ) { + $size = 0; + if ( isset( $this->info['files'] ) && is_array( $this->info['files'] ) ) + foreach ( $this->info['files'] as $file ) + $size += $file['length']; + elseif ( isset( $this->info['name'] ) ) + $size = $this->info['length']; + return is_null( $precision ) ? + $size : + self::format( $size, $precision ); + } + + public function scrape ( $announce = null, $hash_info = null, $timeout = self::timeout ) { + $packed_hash = urlencode( pack('H*', $hash_info ? $hash_info : $this->hash_info() ) ); + $handles = $scrape = array(); + if ( ! function_exists( 'curl_multi_init' ) ) + return self::set_error( new Exception( 'Install CURL with "curl_multi_init" enabled' ) ); + $curl = curl_multi_init(); + foreach ( (array) ($announce ? $announce : $this->announce()) as $tier ) + foreach ( (array) $tier as $tracker ) { + $tracker = str_ireplace( array( 'udp://', '/announce', ':80/' ), array( 'http://', '/scrape', '/' ), $tracker ); + if ( isset( $handles[$tracker] ) ) + continue; + $handles[$tracker] = curl_init( $tracker . '?info_hash=' . $packed_hash ); + curl_setopt( $handles[$tracker], CURLOPT_RETURNTRANSFER, true ); + curl_setopt( $handles[$tracker], CURLOPT_TIMEOUT, $timeout ); + curl_multi_add_handle( $curl, $handles[$tracker] ); + } + do { + while ( ( $state = curl_multi_exec( $curl, $running ) ) == CURLM_CALL_MULTI_PERFORM ); + if( $state != CURLM_OK ) + continue; + while ( $done = curl_multi_info_read( $curl ) ) { + $info = curl_getinfo( $done['handle'] ); + $tracker = explode( '?', $info['url'], 2 ); + $tracker = array_shift( $tracker ); + if ( empty( $info['http_code'] ) ) { + $scrape[$tracker] = self::set_error( new Exception( 'Tracker request timeout (' . $timeout . 's)' ), true ); + continue; + } elseif ( $info['http_code'] != 200 ) { + $scrape[$tracker] = self::set_error( new Exception( 'Tracker request failed (' . $info['http_code'] . ' code)' ), true ); + continue; + } + $data = curl_multi_getcontent( $done['handle'] ); + $stats = self::decode_data( $data ); + curl_multi_remove_handle( $curl, $done['handle'] ); + $scrape[$tracker] = empty( $stats['files'] ) ? + self::set_error( new Exception( 'Empty scrape data' ), true ) : + array_shift( $stats['files'] ) + ( empty( $stats['flags'] ) ? array() : $stats['flags'] ); + } + } while ( $running ); + curl_multi_close( $curl ); + return $scrape; + } + + public function save ( $filename = null ) { + return file_put_contents( is_null( $filename ) ? $this->info['name'] . '.torrent' : $filename, $this->encode( $this ) ); + } + + public function send ( $filename = null ) { + $data = $this->encode( $this ); + header( 'Content-type: application/x-bittorrent' ); + header( 'Content-Length: ' . strlen( $data ) ); + header( 'Content-Disposition: attachment; filename="[files-sib.net]' . ( is_null( $filename ) ? $this->info['name'] . '.torrent' : $filename ) . '"' ); + exit( $data ); + } + + public function magnet ( $html = true ) { + $ampersand = $html ? '&' : '&'; + return sprintf( 'magnet:?xt=urn:btih:%2$s%1$sdn=%3$s%1$sxl=%4$d%1$str=%5$s', $ampersand, $this->hash_info(), urlencode( $this->name() ), $this->size(), implode( $ampersand .'tr=', self::untier( $this->announce() ) ) ); + } + + static public function encode ( $mixed ) { + switch ( gettype( $mixed ) ) { + case 'integer': + case 'double': + return self::encode_integer( $mixed ); + case 'object': + $mixed = get_object_vars( $mixed ); + case 'array': + return self::encode_array( $mixed ); + default: + return self::encode_string( (string) $mixed ); + } + } + + static private function encode_string ( $string ) { + return strlen( $string ) . ':' . $string; + } + + static private function encode_integer ( $integer ) { + return 'i' . $integer . 'e'; + } + + static private function encode_array ( $array ) { + if ( self::is_list( $array ) ) { + $return = 'l'; + foreach ( $array as $value ) + $return .= self::encode( $value ); + } else { + ksort( $array, SORT_STRING ); + $return = 'd'; + foreach ( $array as $key => $value ) + $return .= self::encode( strval( $key ) ) . self::encode( $value ); + } + return $return . 'e'; + } + + static protected function decode ( $string ) { + $data = is_file( $string ) || self::url_exists( $string ) ? + self::file_get_contents( $string ) : + $string; + return (array) self::decode_data( $data ); + } + + static private function decode_data ( & $data ) { + switch( self::char( $data ) ) { + case 'i': + $data = substr( $data, 1 ); + return self::decode_integer( $data ); + case 'l': + $data = substr( $data, 1 ); + return self::decode_list( $data ); + case 'd': + $data = substr( $data, 1 ); + return self::decode_dictionary( $data ); + default: + return self::decode_string( $data ); + } + } + + static private function decode_dictionary ( & $data ) { + $dictionary = array(); + $previous = null; + while ( ( $char = self::char( $data ) ) != 'e' ) { + if ( $char === false ) + return self::set_error( new Exception( 'Unterminated dictionary' ) ); + if ( ! ctype_digit( $char ) ) + return self::set_error( new Exception( 'Invalid dictionary key' ) ); + $key = self::decode_string( $data ); + if ( isset( $dictionary[$key] ) ) + return self::set_error( new Exception( 'Duplicate dictionary key' ) ); + if ( $key < $previous ) + return self::set_error( new Exception( 'Missorted dictionary key' ) ); + $dictionary[$key] = self::decode_data( $data ); + $previous = $key; + } + $data = substr( $data, 1 ); + return $dictionary; + } + + static private function decode_list ( & $data ) { + $list = array(); + while ( ( $char = self::char( $data ) ) != 'e' ) { + if ( $char === false ) + return self::set_error( new Exception( 'Unterminated list' ) ); + $list[] = self::decode_data( $data ); + } + $data = substr( $data, 1 ); + return $list; + } + + static private function decode_string ( & $data ) { + if ( self::char( $data ) === '0' && substr( $data, 1, 1 ) != ':' ) + self::set_error( new Exception( 'Invalid string length, leading zero' ) ); + if ( ! $colon = @strpos( $data, ':' ) ) + return self::set_error( new Exception( 'Invalid string length, colon not found' ) ); + $length = intval( substr( $data, 0, $colon ) ); + if ( $length + $colon + 1 > strlen( $data ) ) + return self::set_error( new Exception( 'Invalid string, input too short for string length' ) ); + $string = substr( $data, $colon + 1, $length ); + $data = substr( $data, $colon + $length + 1 ); + return $string; + } + + static private function decode_integer ( & $data ) { + $start = 0; + $end = strpos( $data, 'e'); + if ( $end === 0 ) + self::set_error( new Exception( 'Empty integer' ) ); + if ( self::char( $data ) == '-' ) + $start++; + if ( substr( $data, $start, 1 ) == '0' && $end > $start + 1 ) + self::set_error( new Exception( 'Leading zero in integer' ) ); + if ( ! ctype_digit( substr( $data, $start, $start ? $end - 1 : $end ) ) ) + self::set_error( new Exception( 'Non-digit characters in integer' ) ); + $integer = substr( $data, 0, $end ); + $data = substr( $data, $end + 1 ); + + return 0 + $integer; + } + + protected function build ( $data, $piece_length ) { + if ( is_null( $data ) ) + return false; + elseif ( is_array( $data ) && self::is_list( $data ) ) + return $this->info = $this->files( $data, $piece_length ); + elseif ( is_dir( $data ) ) + return $this->info = $this->folder( $data, $piece_length ); + elseif ( ( is_file( $data ) || self::url_exists( $data ) ) && ! self::is_torrent( $data ) ) + return $this->info = $this->file( $data, $piece_length ); + else + return false; + } + + protected function touch ( $void = null ) { + $this->{'created by'} = 'Files-Sib.NET Tracker'; + $this->{'creation date'} = time(); + return $void; + } + + static protected function set_error ( $exception, $message = false ) { + return ( array_unshift( self::$_errors, $exception ) && $message ) ? $exception->getMessage() : false; + } + + static protected function announce_list( $announce, $merge = array() ) { + return array_map( create_function( '$a', 'return (array) $a;' ), array_merge( (array) $announce, (array) $merge ) ); + } + + static protected function first_announce( $announce ) { + while ( is_array( $announce ) ) + $announce = reset( $announce ); + return $announce; + } + + static protected function pack ( & $data ) { + return pack('H*', sha1( $data ) ) . ( $data = null ); + } + + static protected function path ( $path, $folder ) { + array_unshift( $path, $folder ); + return join( DIRECTORY_SEPARATOR, $path ); + } + + static protected function is_list ( $array ) { + foreach ( array_keys( $array ) as $key ) + if ( ! is_int( $key ) ) + return false; + return true; + } + + private function pieces ( $handle, $piece_length, $last = true ) { + static $piece, $length; + if ( empty( $length ) ) + $length = $piece_length; + $pieces = null; + while ( ! feof( $handle ) ) { + if ( ( $length = strlen( $piece .= fread( $handle, $length ) ) ) == $piece_length ) + $pieces .= self::pack( $piece ); + elseif ( ( $length = $piece_length - $length ) < 0 ) + return self::set_error( new Exception( 'Invalid piece length!' ) ); + } + fclose( $handle ); + return $pieces . ( $last && $piece ? self::pack( $piece ) : null); + } + + private function file ( $file, $piece_length ) { + if ( ! $handle = self::fopen( $file, $size = self::filesize( $file ) ) ) + return self::set_error( new Exception( 'Failed to open file: "' . $file . '"' ) ); + if ( self::is_url( $file ) ) + $this->url_list( $file ); + $path = explode( DIRECTORY_SEPARATOR, $file ); + return array( + 'length' => $size, + 'name' => end( $path ), + 'piece length' => $piece_length, + 'pieces' => $this->pieces( $handle, $piece_length ) + ); + } + + private function files ( $files, $piece_length ) { + if ( ! self::is_url( current( $files ) ) ) + $files = array_map( 'realpath', $files ); + sort( $files ); + usort( $files, create_function( '$a,$b', 'return strrpos($a,DIRECTORY_SEPARATOR)-strrpos($b,DIRECTORY_SEPARATOR);' ) ); + $first = current( $files ); + $root = dirname( $first ); + if ( $url = self::is_url( $first ) ) + $this->url_list( dirname( $root ) . DIRECTORY_SEPARATOR ); + $path = explode( DIRECTORY_SEPARATOR, dirname( $url ? $first : realpath( $first ) ) ); + $pieces = null; $info_files = array(); $count = count( $files ) - 1; + foreach ( $files as $i => $file ) { + if ( $path != array_intersect_assoc( $file_path = explode( DIRECTORY_SEPARATOR, $file ), $path ) ) { + self::set_error( new Exception( 'Files must be in the same folder: "' . $file . '" discarded' ) ); + continue; + } + if ( ! $handle = self::fopen( $file, $filesize = self::filesize( $file ) ) ) { + self::set_error( new Exception( 'Failed to open file: "' . $file . '" discarded' ) ); + continue; + } + $pieces .= $this->pieces( $handle, $piece_length, $count == $i ); + $info_files[] = array( + 'length' => $filesize, + 'path' => array_diff( $file_path, $path ) + ); + } + return array( + 'files' => $info_files, + 'name' => end( $path ), + 'piece length' => $piece_length, + 'pieces' => $pieces + ); + + } + + private function folder ( $dir, $piece_length ) { + return $this->files( self::scandir( $dir ), $piece_length ); + } + + static private function char ( $data ) { + return empty( $data ) ? + false : + substr( $data, 0, 1 ); + } + + static public function format ( $size, $precision = 2 ) { + $units = array ('octets', 'Kb', 'Mb', 'Gb', 'Tb'); + while( ( $next = next( $units ) ) && $size > 1024 ) + $size /= 1024; + return round( $size, $precision ) . ' ' . ( $next ? prev( $units ) : end( $units ) ); + } + + static public function filesize ( $file ) { + if ( is_file( $file ) ) + return (double) sprintf( '%u', @filesize( $file ) ); + else if ( $content_length = preg_grep( $pattern = '#^Content-Length:\s+(\d+)$#i', (array) @get_headers( $file ) ) ) + return (int) preg_replace( $pattern, '$1', reset( $content_length ) ); + } + + static public function fopen ( $file, $size = null ) { + if ( ( is_null( $size ) ? self::filesize( $file ) : $size ) <= 2 * pow( 1024, 3 ) ) + return fopen( $file, 'r' ); + elseif ( PHP_OS != 'Linux' ) + return self::set_error( new Exception( 'File size is greater than 2GB. This is only supported under Linux' ) ); + elseif ( ! is_readable( $file ) ) + return false; + else + return popen( 'cat ' . escapeshellarg( realpath( $file ) ), 'r' ); + } + + static public function scandir ( $dir ) { + $paths = array(); + foreach ( scandir( $dir ) as $item ) + if ( $item != '.' && $item != '..' ) + if ( is_dir( $path = realpath( $dir . DIRECTORY_SEPARATOR . $item ) ) ) + $paths = array_merge( self::scandir( $path ), $paths ); + else + $paths[] = $path; + return $paths; + } + + static public function is_url ( $url ) { + return preg_match( '#^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$#i', $url ); + } + + static public function url_exists ( $url ) { + return self::is_url( $url ) ? + (bool) self::filesize ( $url ) : + false; + } + + static public function is_torrent ( $file, $timeout = self::timeout ) { + return ( $start = self::file_get_contents( $file, $timeout, 0, 11 ) ) && $start === 'd8:announce' || $start === 'd10:created'; + } + + static public function file_get_contents ( $file, $timeout = self::timeout, $offset = null, $length = null ) { + if ( is_file( $file ) || ini_get( 'allow_url_fopen' ) ) { + $context = ! is_file( $file ) && $timeout ? + stream_context_create( array( 'http' => array( 'timeout' => $timeout ) ) ) : + null; + return ! is_null( $offset ) ? $length ? + @file_get_contents( $file, false, $context, $offset, $length ) : + @file_get_contents( $file, false, $context, $offset ) : + @file_get_contents( $file, false, $context ); + } elseif ( ! function_exists( 'curl_init' ) ) + return self::set_error( new Exception( 'Install CURL or enable "allow_url_fopen"' ) ); + $handle = curl_init( $file ); + if ( $timeout ) + curl_setopt( $handle, CURLOPT_TIMEOUT, $timeout ); + if ( $offset || $length ) + curl_setopt( $handle, CURLOPT_RANGE, $offset . '-' . ( $length ? $offset + $length -1 : null ) ); + curl_setopt( $handle, CURLOPT_RETURNTRANSFER, 1 ); + $content = curl_exec( $handle ); + $size = curl_getinfo( $handle, CURLINFO_CONTENT_LENGTH_DOWNLOAD ); + curl_close( $handle ); + return ( $offset && $size == -1 ) || ( $length && $length != $size ) ? $length ? + substr( $content, $offset, $length) : + substr( $content, $offset) : + $content; + } + + static public function untier( $announces ) { + $list = array(); + foreach ( (array) $announces as $tier ) { + is_array( $tier ) ? + $list = array_merge( $list, self::untier( $tier ) ) : + array_push( $list, $tier ); + } + return $list; + } + + public function upload($torrent){ + + } +} \ No newline at end of file diff --git a/system/cron.php b/system/cron.php new file mode 100644 index 0000000..7476a39 --- /dev/null +++ b/system/cron.php @@ -0,0 +1,38 @@ +get ( "cron" ); +if (date ( "Y-m-d", $cron_time ) != date ( "Y-m-d", $_TIME )) $cron = true; + +if($cron) { + $cache->set( "cron", $_TIME ); + + $db->query( "DELETE FROM " . USERPREFIX . "_banned WHERE days != '0' AND date < '$_TIME' AND users_id = '0'" ); + $cache->delete('banned.php' ); + + if( intval( $config['max_image_days'] ) ) { + $thisdate = $_TIME - ($config['max_image_days'] * 3600 * 24); + $db->query( "SELECT images FROM " . PREFIX . "_images where date < '$thisdate' AND news_id = '0'" ); + while ( $row = $db->get_row() ) { + $listimages = explode( "|||", $row['images'] ); + if( $row['images'] != "" ) foreach ( $listimages as $dataimages ) { + $url_image = explode( "/", $dataimages ); + if( count( $url_image ) == 2 ) { + $folder_prefix = $url_image[0] . "/"; + $dataimages = $url_image[1]; + } else { + $folder_prefix = ""; + $dataimages = $url_image[0]; + } + @unlink( ROOT_DIR . "/uploads/posts/" . $folder_prefix . $dataimages ); + @unlink( ROOT_DIR . "/uploads/posts/" . $folder_prefix . "thumbs/" . $dataimages ); + }} + $db->free(); + $db->query( "DELETE FROM " . PREFIX . "_images where date < '$thisdate' AND news_id = '0'" ); + } + $cache->clear(); +} +?> \ No newline at end of file diff --git a/system/engine.php b/system/engine.php new file mode 100644 index 0000000..07a8924 --- /dev/null +++ b/system/engine.php @@ -0,0 +1,464 @@ +:]]' AND "; + } else {$stop_list = "category IN ('" . implode ( "','", $allow_list ) . "') AND ";} + } else $stop_list = ""; + + if ($user_group[$member_id['user_group']]['allow_short']) $stop_list = ""; + + $sql_select = "SELECT id, autor, date, short_story, SUBSTRING(full_story, 1, 15) as full_story, title, category, alt_name, comm_num, allow_comm, allow_main, allow_rate, fixed, rating, news_read, remote_addr, tags FROM " . PREFIX . "_post WHERE {$stop_list}approve AND allow_main" . $where_date . " ORDER BY " . $fixed . $news_sort_by . " " . $news_direction_by . " LIMIT " . $cstart . "," . $config['news_number']; + $sql_count = "SELECT COUNT(*) as count FROM " . PREFIX . "_post WHERE {$stop_list}approve AND allow_main" . $where_date; + $sql_news = ""; + + // ################ Вывод отдельной категории ################# + if ($do == "cat" and $category != '' and $subaction == '') { + $newsmodule = true; + + if (! $category_id) $category_id = 'not detected'; + if ($allow_list[0] != "all") {if (! $user_group[$member_id['user_group']]['allow_short'] and ! in_array ( $category_id, $allow_list )) $category_id = 'not detected';} + + $get_cats = get_sub_cats ( $category_id ); + + if ($cat_info[$category_id]['news_sort'] != "") $news_sort_by = $cat_info[$category_id]['news_sort']; + if ($cat_info[$category_id]['news_msort'] != "") $news_direction_by = $cat_info[$category_id]['news_msort']; + if ($cat_info[$category_id]['news_number']) $config['news_number'] = $cat_info[$category_id]['news_number']; + + if ($cstart) { + $cstart = $cstart - 1; + $cstart = $cstart * $config['news_number']; + } + + $url_page = $config['http_home_url'] . get_url ( $category_id ); + $user_query = "do=cat&category=" . $cat_info[$category_id]['alt_name']; + + if ($config['allow_multi_category']) {$where_category = "category regexp '[[:<:]](" . $get_cats . ")[[:>:]]'"; + } else { + $get_cats = str_replace ( "|", "','", $get_cats ); + $where_category = "category IN ('" . $get_cats . "')"; + } + + if (isset ( $_SESSION['dle_sort_cat'] )) $news_sort_by = $_SESSION['dle_sort_cat']; + if (isset ( $_SESSION['dle_direction_cat'] )) $news_direction_by = $_SESSION['dle_direction_cat']; + + $sql_select = "SELECT id, autor, date, short_story, SUBSTRING(full_story, 1, 15) as full_story, title, category, alt_name, comm_num, allow_comm, allow_main, allow_rate, fixed, rating, news_read, remote_addr, tags FROM " . PREFIX . "_post WHERE {$where_category} AND approve" . $where_date . " ORDER BY " . $fixed . $news_sort_by . " " . $news_direction_by . " LIMIT " . $cstart . "," . $config['news_number']; + $sql_count = "SELECT COUNT(*) as count FROM " . PREFIX . "_post WHERE {$where_category} AND approve" . $where_date; + + } elseif ($do == 'lastnews') { + // ################ Вывод всех последних новостей ################# + if ($cstart) { + $cstart = $cstart - 1; + $cstart = $cstart * $config['news_number']; + } + $newsmodule = true; + $url_page = $config['http_home_url'] . "lastnews"; + $user_query = "do=lastnews"; + + if (isset ( $_SESSION['dle_sort_lastnews'] )) $news_sort_by = $_SESSION['dle_sort_lastnews']; else $news_sort_by = "date"; + if (isset ( $_SESSION['dle_direction_lastnews'] )) $news_direction_by = $_SESSION['dle_direction_lastnews']; else $news_direction_by = "DESC"; + + $sql_select = "SELECT id, autor, date, short_story, SUBSTRING(full_story, 1, 15) as full_story, title, category, alt_name, comm_num, allow_comm, allow_main, allow_rate, rating, news_read, approve, remote_addr, tags FROM " . PREFIX . "_post where {$stop_list}approve" . $where_date . " ORDER BY " . $news_sort_by . " " . $news_direction_by . " LIMIT " . $cstart . "," . $config['news_number']; + $sql_count = "SELECT COUNT(*) as count FROM " . PREFIX . "_post where {$stop_list}approve" . $where_date; + + } elseif ($do == 'tags') { + // ################ Поиск новостей по тегу ################# + if ($cstart) { + $cstart = $cstart - 1; + $cstart = $cstart * $config['news_number']; + } + + $newsmodule = true; + + $tag = $db->safesql ( htmlspecialchars ( strip_tags ( stripslashes ( trim ( urldecode ( $_GET['tag'] ) ) ) ), ENT_QUOTES ) ); + $url_page = $config['http_home_url'] . "tags/" . urlencode ( $tag ); + $user_query = "do=tags&tag=" . urlencode ( $tag ); + + if (isset ( $_SESSION['dle_sort_tags'] )) $news_sort_by = $_SESSION['dle_sort_tags']; + if (isset ( $_SESSION['dle_direction_tags'] )) $news_direction_by = $_SESSION['dle_direction_tags']; + + $db->query ( "SELECT news_id FROM " . PREFIX . "_tags WHERE tag='{$tag}'" ); + $tag_array = array (); + + while ( $row = $db->get_row () ) {$tag_array[] = $row['news_id'];} + + if (count ( $tag_array )) {$tag_array = "(" . implode ( ",", $tag_array ) . ")"; + } else {$tag_array = "('undefined')";} + + $db->free (); + + $sql_select = "SELECT id, autor, date, short_story, SUBSTRING(full_story, 1, 15) as full_story, title, category, alt_name, comm_num, allow_comm, allow_main, allow_rate, rating, news_read, approve, remote_addr, tags FROM " . PREFIX . "_post where {$stop_list}id IN {$tag_array} AND approve" . $where_date . " ORDER BY " . $news_sort_by . " " . $news_direction_by . " LIMIT " . $cstart . "," . $config['news_number']; + $sql_count = "SELECT COUNT(*) as count FROM " . PREFIX . "_post where {$stop_list}id IN {$tag_array} AND approve" . $where_date; + $allow_active_news = true; + + $tag_array = array (); + unset ( $tag_array ); + + } elseif ($subaction == 'userinfo') { + // ################ Вывод профиля пользователя ################# + if ($cstart) { + $cstart = $cstart - 1; + $cstart = $cstart * $config['news_number']; + } + + $url_page = $config['http_home_url'] . "user/" . urlencode ( $user ); + $user_query = "subaction=userinfo&user=" . urlencode ( $user ); + + if ($member_id['name'] == $user or $user_group[$member_id['user_group']]['allow_all_edit']) { + if (isset ( $_SESSION['dle_sort_userinfo'] )) $news_sort_by = $_SESSION['dle_sort_userinfo']; + if (isset ( $_SESSION['dle_direction_userinfo'] )) $news_direction_by = $_SESSION['dle_direction_userinfo']; + + $sql_select = "SELECT id, autor, date, short_story, SUBSTRING(full_story, 1, 15) as full_story, title, category, alt_name, comm_num, allow_comm, allow_main, allow_rate, approve, fixed, rating, news_read, remote_addr, tags FROM " . PREFIX . "_post WHERE autor = '$user' AND approve = '0' ORDER BY " . $news_sort_by . " " . $news_direction_by . " LIMIT " . $cstart . "," . $config['news_number']; + $sql_count = "SELECT COUNT(*) as count FROM " . PREFIX . "_post WHERE autor = '$user' AND approve = '0'"; + $allow_active_news = false; + } else {$allow_active_news = false;} + $cache->off(); + } elseif ($subaction == 'allnews') { + // ################ Вывод всех новостей пользователя ################# + if ($cstart) { + $cstart = $cstart - 1; + $cstart = $cstart * $config['news_number']; + } + + $newsmodule = true; + $url_page = $config['http_home_url'] . "user/" . urlencode ( $user ) . "/news"; + $user_query = "subaction=allnews&user=" . urlencode ( $user ); + + if (isset ( $_SESSION['dle_sort_allnews'] )) $news_sort_by = $_SESSION['dle_sort_allnews']; + if (isset ( $_SESSION['dle_direction_allnews'] )) $news_direction_by = $_SESSION['dle_direction_allnews']; + + $sql_select = "SELECT id, autor, date, short_story, SUBSTRING(full_story, 1, 15) as full_story, title, category, alt_name, comm_num, allow_comm, allow_main, allow_rate, rating, news_read, approve, remote_addr, tags FROM " . PREFIX . "_post where {$stop_list}autor = '$user' AND approve" . $where_date . " ORDER BY " . $news_sort_by . " " . $news_direction_by . " LIMIT " . $cstart . "," . $config['news_number']; + $sql_count = "SELECT COUNT(*) as count FROM " . PREFIX . "_post where {$stop_list}autor = '$user' AND approve" . $where_date; + + $allow_active_news = true; + //$config['allow_cache'] = false; + + } elseif ($subaction == 'newposts') { + // ################ Вывод непрочитанных новостей ################# + if ($cstart) { + $cstart = $cstart - 1; + $cstart = $cstart * $config['news_number']; + } + $newsmodule = true; + + $url_page = $config['http_home_url'] . "newposts"; + $user_query = "subaction=newposts"; + + $thistime = date ( "Y-m-d H:i:s", $_TIME ); + + if (isset ( $_SESSION['member_lasttime'] )) {$lasttime = date ( "Y-m-d H:i:s", $_SESSION['member_lasttime'] ); + } else {$lasttime = date ( "Y-m-d H:i:s", (time () + ($config['date_adjust'] * 60) - (3600 * 4)) );} + + if (isset ( $_SESSION['dle_sort_newposts'] )) $news_sort_by = $_SESSION['dle_sort_newposts']; + if (isset ( $_SESSION['dle_direction_newposts'] )) $news_direction_by = $_SESSION['dle_direction_newposts']; + + $sql_select = "SELECT id, autor, date, short_story, SUBSTRING(full_story, 1, 15) as full_story, title, category, alt_name, comm_num, allow_comm, allow_main, allow_rate, rating, news_read, remote_addr, tags FROM " . PREFIX . "_post where {$stop_list}approve AND date between '$lasttime' and '$thistime' order by " . $news_sort_by . " " . $news_direction_by . " LIMIT " . $cstart . "," . $config['news_number']; + $sql_count = "SELECT COUNT(*) as count FROM " . PREFIX . "_post where {$stop_list}approve AND date between '$lasttime' and '$thistime'"; + + $cache->off(); + } else { + + // ################ Новости на главной ################# + if ($year == '' and $month == '' and $day == '') { + if ($cstart) { + $cstart = $cstart - 1; + $cstart = $cstart * $config['news_number']; + } + + $url_page = substr ( $config['http_home_url'], 0, strlen ( $config['http_home_url'] ) - 1 ); + $user_query = ""; + + if (isset ( $_SESSION['dle_sort_main'] )) $news_sort_by = $_SESSION['dle_sort_main']; + if (isset ( $_SESSION['dle_direction_main'] )) $news_direction_by = $_SESSION['dle_direction_main']; + $sql_select = "SELECT id, autor, date, short_story, SUBSTRING(full_story, 1, 15) as full_story, title, category, alt_name, comm_num, allow_comm, allow_main, allow_rate, fixed, rating, news_read, remote_addr, tags FROM " . PREFIX . "_post WHERE {$stop_list}approve AND allow_main" . $where_date . " ORDER BY " . $fixed . $news_sort_by . " " . $news_direction_by . " LIMIT " . $cstart . "," . $config['news_number']; + $sql_count = "SELECT COUNT(*) as count FROM " . PREFIX . "_post WHERE {$stop_list}approve AND allow_main" . $where_date; + } + + // ################ Новости за год ################# + if ($year != '' and $month == '' and $day == '') { + if ($cstart) { + $cstart = $cstart - 1; + $cstart = $cstart * $config['news_number']; + } + + $newsmodule = true; + $url_page = $config['http_home_url'] . $year; + $user_query = "year=" . $year; + + if (isset ( $_SESSION['dle_sort_date'] )) $news_sort_by = $_SESSION['dle_sort_date']; + if (isset ( $_SESSION['dle_direction_date'] )) $news_direction_by = $_SESSION['dle_direction_date']; + $sql_select = "SELECT id, autor, date, short_story, SUBSTRING(full_story, 1, 15) as full_story, title, category, alt_name, comm_num, allow_comm, allow_main, allow_rate, rating, news_read, remote_addr, tags FROM " . PREFIX . "_post where {$stop_list}date >= '{$year}-01-01'AND date < '{$year}-01-01' + INTERVAL 1 YEAR AND approve" . $where_date . " ORDER BY " . $news_sort_by . " " . $news_direction_by . " LIMIT " . $cstart . "," . $config['news_number']; + $sql_count = "SELECT COUNT(*) as count FROM " . PREFIX . "_post where {$stop_list}date >= '{$year}-01-01'AND date < '{$year}-01-01' + INTERVAL 1 YEAR AND approve" . $where_date; + } + + // ################ Новости за месяц ################# + if ($year != '' and $month != '' and $day == '') { + if ($cstart) { + $cstart = $cstart - 1; + $cstart = $cstart * $config['news_number']; + } + + $newsmodule = true; + $url_page = $config['http_home_url'] . $year . "/" . $month; + $user_query = "year=" . $year . "&month=" . $month; + + if (isset ( $_SESSION['dle_sort_date'] )) $news_sort_by = $_SESSION['dle_sort_date']; + if (isset ( $_SESSION['dle_direction_date'] )) $news_direction_by = $_SESSION['dle_direction_date']; + + $sql_select = "SELECT id, autor, date, short_story, SUBSTRING(full_story, 1, 15) as full_story, title, category, alt_name, comm_num, allow_comm, allow_main, allow_rate, rating, news_read, remote_addr, tags FROM " . PREFIX . "_post where {$stop_list}date >= '{$year}-{$month}-01'AND date < '{$year}-{$month}-01' + INTERVAL 1 MONTH AND approve" . $where_date . " ORDER BY " . $news_sort_by . " " . $news_direction_by . " LIMIT " . $cstart . "," . $config['news_number']; + $sql_count = "SELECT COUNT(*) as count FROM " . PREFIX . "_post where {$stop_list}date >= '{$year}-{$month}-01'AND date < '{$year}-{$month}-01' + INTERVAL 1 MONTH AND approve" . $where_date; + } + + // ################ Новости за день ################# + if ($year != '' and $month != '' and $day != '' and $subaction == '') { + if ($cstart) { + $cstart = $cstart - 1; + $cstart = $cstart * $config['news_number']; + } + + $newsmodule = true; + $url_page = $config['http_home_url'] . $year . "/" . $month . "/" . $day; + $user_query = "year=" . $year . "&month=" . $month . "&day=" . $day; + + if (isset ( $_SESSION['dle_sort_date'] )) $news_sort_by = $_SESSION['dle_sort_date']; + if (isset ( $_SESSION['dle_direction_date'] )) $news_direction_by = $_SESSION['dle_direction_date']; + + $sql_select = "SELECT id, autor, date, short_story, SUBSTRING(full_story, 1, 15) as full_story, title, category, alt_name, comm_num, allow_comm, allow_main, allow_rate, rating, news_read, remote_addr, tags FROM " . PREFIX . "_post where {$stop_list}date >= '{$year}-{$month}-{$day}' AND date < '{$year}-{$month}-{$day}' + INTERVAL 24 HOUR AND approve" . $where_date . " ORDER BY " . $news_sort_by . " " . $news_direction_by . " LIMIT " . $cstart . "," . $config['news_number']; + $sql_count = "SELECT COUNT(*) as count FROM " . PREFIX . "_post where {$stop_list}date >= '{$year}-{$month}-{$day}' AND date < '{$year}-{$month}-{$day}' + INTERVAL 24 HOUR AND approve" . $where_date; + + } + + // ################ Новость целиком ################# + if ($subaction != '' or $newsid) { + if (! $newsid) $sql_news = "SELECT id, autor, date, short_story, full_story, title, category, descr, keywords, alt_name, comm_num, allow_comm, allow_rate, fixed, rating, news_read, approve, votes, access, remote_addr, tags, metatitle FROM " . PREFIX . "_post WHERE alt_name ='$news_name' AND date >= '{$year}-{$month}-{$day}' AND date < '{$year}-{$month}-{$day}' + INTERVAL 24 HOUR LIMIT 0,1"; + else $sql_news = "SELECT id, autor, date, short_story, full_story, title, category, descr, keywords, alt_name, comm_num, allow_comm, allow_rate, fixed, rating, news_read, approve, votes, access, remote_addr, tags, metatitle FROM " . PREFIX . "_post where id = '$newsid'"; + if ($subaction == '') $subaction = "showfull"; + }} + +//Отображение субкатегорий + if($category_id){ foreach($cat_info as $c) if($c['parentid']==$category_id) { + $cat_menu .= "» ". $c['name'] . "
    "; } + if ($cat_menu !='') + $cat_menu = "
    Категории
    ".$cat_menu."
    "; + } +//!Отображение субкатегорий + + if ( (intval($_GET['cstart']) == 1) && (strpos($_SERVER['REQUEST_URI'], '/page/1') !== false) ) { + $first_page_url = str_replace ( "/page/1", "", $_SERVER['REQUEST_URI'] ); + header("HTTP/1.0 301 Moved Permanently"); + header("Location: $first_page_url"); + die("Redirect"); + } + + if (($subaction == "showfull" or $subaction == "addcomment") and ((! isset ( $category ) or $category == ""))) { + + if ($_POST['subaction'] == "addcomment") { + $allow_add_comment = TRUE; + $allow_comments = TRUE; + $ajax_adds = false; + include_once (SYSTEM_DIR . '/modules/addcomments.php'); + } + + if ($subaction == "showfull") { + $allow_comments = TRUE; + include_once (SYSTEM_DIR . '/modules/show.full.php'); + } + + } else { + if ($subaction == 'userinfo') { + $allow_userinfo = TRUE; + include_once (SYSTEM_DIR . '/modules/profile.php'); + } else { + $allow_active_news = TRUE; + } + + //#################################################################################################################### + // Просмотр кратких новостей + //#################################################################################################################### + + + $_SESSION['referrer'] = $_SERVER['REQUEST_URI']; + + if ($do == "lastnews") { + $cache_prefix = "_lastnews"; + } elseif ($subaction == 'allnews') { + $cache_prefix = "_allnews_". $user; + } elseif ($do == 'tags') { + $cache_prefix = "_tagscl_". $tag; + } else { + $cache_prefix = "_"; + if ($month) $cache_prefix .= "month_" . $month; + if ($year) $cache_prefix .= "year_" . $year; + if ($day) $cache_prefix .= "day_" . $day; + if ($category) $cache_prefix .= "category_" . $category; + } + $cache_prefix .= "_tempate_" . $config['skin']; + if ($is_logged and ($user_group[$member_id['user_group']]['allow_edit'] and ! $user_group[$member_id['user_group']]['allow_all_edit'])) $cache->off(); + if (isset($_SESSION['dle_no_cache']) AND $_SESSION['dle_no_cache']) $config['allow_cache'] = false; + if ($cstart) $cache_id = ($cstart / $config['news_number']) + 1; else $cache_id = "1"; + + if ($cache_id < 6 and ! isset ( $_POST['login'] )) $active = $cache->open( "news", $cache_id . $cache_prefix, true ); + else $active = false; + + if ($active) { + $tpl->result['content'] .= $active; + $active = null; + } else { + include_once (SYSTEM_DIR . '/modules/show.short.php'); + + if ($config['files_allow'] == "yes"){ + if (strpos ( $tpl->result['content'], "[file=" ) !== false) {$tpl->result['content'] = show_file ( $tpl->result['content'], $attachments );} + if (strpos ( $tpl->result['content'], "[torrent=" ) !== false) {$tpl->result['content'] = show_torrent ( $tpl->result['content'], $attachments );} + } + if ($news_found and $cache_id < 6) $cache->save( "news", $tpl->result['content'], $cache_id . $cache_prefix, true ); +}}} + +/* +===================================================== + Вывод заголовка страницы +===================================================== +*/ +$titl_e = ''; +$nam_e = ''; + +if ($do == "cat" and $category != '' and $subaction == '') { + //решение проблемы с категориями, редирект на верный урл, добавление слеша в конец + if( $category_id AND $view_template != "rss") { + $re_cat = get_url( $category_id ); + + if ($re_cat != $_GET['category'] OR substr ( $_SERVER['REQUEST_URI'], - 1, 1 ) != '/' ) { + $re_url = explode ( "index.php", strtolower ( $_SERVER['PHP_SELF'] ) ); + $re_url = reset ( $re_url ); + + header("HTTP/1.0 301 Moved Permanently"); + header("Location: {$re_url}{$re_cat}/"); + die("Redirect"); + } + } + //решение проблемы с категориями, редирект на верный урл, добавление слеша в конец + + $metatags['description'] = ($cat_info[$category_id]['descr'] != '') ? $cat_info[$category_id]['descr'] : $metatags['description']; + $metatags['keywords'] = ($cat_info[$category_id]['keywords'] != '') ? $cat_info[$category_id]['keywords'] : $metatags['keywords']; + if ($cat_info[$category_id]['metatitle'] != '') $metatags['header_title'] = $cat_info[$category_id]['metatitle']; else $nam_e = stripslashes ( $cat_info[$category_id]['name'] ); + //$rss_url = $url_page . "/" . "rss.xml"; + +} +elseif ($subaction == "showfull") $rss_url = $config['http_home_url'] . "rss/comments/$newsid/"; +elseif ($subaction == 'userinfo')$nam_e = $user; +elseif ($subaction == 'allnews') $nam_e = $lang['show_user_news'] . ' ' . $user; +elseif ($subaction == 'newposts') $nam_e = $lang['title_new']; +elseif ($do == 'stats') $nam_e = $lang['title_stats']; +elseif ($do == 'addnews') $nam_e = $lang['title_addnews']; +elseif ($do == 'register') $nam_e = $lang['title_register']; +elseif ($do == 'favorites') $nam_e = $lang['title_fav']; +elseif ($do == 'pm') $nam_e = $lang['title_pm']; +elseif ($do == 'feedback') $nam_e = $lang['title_feed']; +elseif ($do == 'lastcomments') $nam_e = $lang['title_last']; +elseif ($do == 'lostpassword') $nam_e = $lang['title_lost']; +elseif ($do == 'search') $nam_e = $lang['title_search']; +elseif ($do == 'reputation') $nam_e = 'Репутация » '.$user; +elseif ($do == 'static') $titl_e = $static_descr; +elseif ($do == 'chat_history') $titl_e = " История сообщений Мини-чата"; +elseif ($do == 'tracker') $titl_e = "Список раздач"; +elseif ($do == 'lastnews') $nam_e = $lang['last_news']; +elseif ($do == 'tags') $nam_e = $tag; +elseif ($do == 'newslist') $metatags['title'] = $metatags['titles'].''.$cnt3.''.$cnt5.' » '.$config['home_title']; +else { + if ($year != '' and $month == '' and $day == '') $nam_e = $lang['title_date'] . ' ' . $year . ' ' . $lang['title_year']; + if ($year != '' and $month != '' and $day == '') $nam_e = $lang['title_date'] . ' ' . $r[$month - 1] . ' ' . $year . ' ' . $lang['title_year1']; + if ($year != '' and $month != '' and $day != '' and $subaction == '') $nam_e = $lang['title_date'] . ' ' . $day . '.' . $month . '.' . $year; + if (($subaction != '' or $newsid != '') and $news_found) $titl_e = $metatags['title']; +} + +if (intval($_GET['cstart']) > 1 ){ + $page_extra = ' » '.$lang['news_site'].' '.intval($_GET['cstart']); +} else $page_extra = ''; + +if ($nam_e) { + $metatags['title'] = $nam_e . $page_extra . ' » ' . $metatags['title']; + $rss_title = $metatags['title']; +} elseif ($titl_e) { + $metatags['title'] = $titl_e . $page_extra . ' » ' . $config['home_title']; +} else $metatags['title'] .= $page_extra; + +if ( $metatags['header_title'] ) $metatags['title'] = stripslashes($metatags['header_title']) . $page_extra; + +if (! $rss_url) { + $rss_url = $config['http_home_url'] . "rss/"; + $rss_title = $config['home_title']; + //$rss_url .= $config['http_home_url'] . "comments.xml"; +} + +$metatags = <<{$metatags['title']} + + + + +\n +HTML; + +if ($config['allow_rss']) $metatags .= << +HTML; +?> \ No newline at end of file diff --git a/system/file.php b/system/file.php new file mode 100644 index 0000000..924a4ed --- /dev/null +++ b/system/file.php @@ -0,0 +1,62 @@ +get( "usergroup" ); +if( ! $user_group ) {$user_group = array (); + $db->query( "SELECT * FROM " . USERPREFIX . "_usergroups ORDER BY id ASC" ); + while ( $row = $db->get_row() ) {$user_group[$row['id']] = array (); + foreach ( $row as $key => $value ) {$user_group[$row['id']][$key] = stripslashes($value);} + } + $cache->set( "usergroup", $user_group ); + $db->free(); +} + +if (! $is_logged) {$member_id['user_group'] = 5;} +if (! $user_group[$member_id['user_group']]['allow_files']) die ( "Access denied" ); + + $_SERVER['HTTP_REFERER'] = clean_url ( $_SERVER['HTTP_REFERER'] ); + $_SERVER['HTTP_HOST'] = clean_url ( $_SERVER['HTTP_HOST'] ); + if ($_SERVER['HTTP_HOST'] != $_SERVER['HTTP_REFERER']) { + @header ( 'Location: ' . $config['http_home_url'] ); + die ( "Access denied!!!

    Please visit {$config['http_home_url']}" ); + } + +$id = intval ( $_REQUEST['id'] ); + +if ($_REQUEST['area'] == "static") $row = $db->super_query ( "SELECT name, onserver FROM " . PREFIX . "_static_files WHERE id ='$id'" ); +else $row = $db->super_query ( "SELECT name, onserver FROM " . PREFIX . "_files WHERE id ='$id'" ); + +if (! $row) die ( "Access denied" ); + +$config['files_max_speed'] = intval ( $config['files_max_speed'] ); + +$file = new download ( FILE_DIR . $row['onserver'], $row['name'], $config['files_force'], $config['files_max_speed'] ); + +if ($_REQUEST['area'] == "static") { + if ($config['files_count'] == "yes" and ! $file->range) + $db->query ( "UPDATE " . PREFIX . "_static_files SET dcount=dcount+1 WHERE id ='$id'" ); +} else { + if ($config['files_count'] == "yes" and ! $file->range) + $db->query ( "UPDATE " . PREFIX . "_files SET dcount=dcount+1 WHERE id ='$id'" ); +} + +$db->close (); +$file->download_file (); +?> \ No newline at end of file diff --git a/system/forum/action/addpost.php b/system/forum/action/addpost.php new file mode 100644 index 0000000..ad18632 --- /dev/null +++ b/system/forum/action/addpost.php @@ -0,0 +1,252 @@ +process($post_text); + + $post_text = $db->safesql($parse->BB_Parse($post_text, FALSE)); + + $post_text = auto_wrap ($post_text); + + if (strlen($post_text) > $forum_config['post_maxlen']) + { + $post_maxlen = true; + } + else + { + $post_maxlen = false; + } + + $topic_title = $db->safesql(urldecode($topic_title)); + + if (!$is_logged) + { + $name = $db->safesql($parse->BB_Parse($parse->process($name), TRUE)); + + $mail = $db->safesql($parse->BB_Parse($parse->process($mail), TRUE)); + + $member_id['name'] = $name; + + if ($name) + { + $db->query("SELECT name from " . USERPREFIX . "_users where LOWER(name) = '".strtolower($name)."'"); + + if (!$db->num_rows()){ + $name_ok = true; + }else{ + $name_ok = false; + $stop .= $f_lang['err_name']; + } + $db->free(); + } + + if ($mail) + { + if(preg_match("/^[\.A-z0-9_\-]+[@][A-z0-9_\-]+([.][A-z0-9_\-]+)+[A-z]{1,4}$/", $mail)){ + $mail_ok = true; + }else{ + $mail_ok = false; + $stop .= $f_lang['err_mail']; + } + } + + if ($name_ok and $mail_ok) + { + $add_post_ok = true; + } + else + { + $add_post_ok = false; + } + } + else + { + $add_post_ok = true; + } + + $_TIME = time()+($config['date_adjust']*60); + + $topic_date = date ("Y-m-d H:i:s", $_TIME); + + $_IP = $db->safesql($_SERVER['REMOTE_ADDR']); + + if ($post_text and $topic_id and $forum_id and $add_post_ok and !$post_captcha and !$post_maxlen) + { + $postcount = intval ($forums_array[$forum_id]['postcount']); + + if ($forum_config['post_update']) + { + $row = $db->super_query("SELECT pid, topic_id, post_author, DATE_FORMAT(post_date,'%Y-%m-%d') as post_date, post_text, is_register, post_ip FROM " . PREFIX . "_forum_posts WHERE topic_id = '$topic_id' ORDER BY pid DESC LIMIT 0,1"); + + $post_id = $row['pid']; + + if ($row['post_author'] == $member_id['name'] AND $row['is_register']) $update_post = true; + elseif ($row['ip'] == $_IP AND !$row['is_register'] AND !$is_logged) $update_post = true; + + if ($row['post_date'] != date("Y-m-d", $_TIME)) $update_post = false; + + + } + + if (!$update_post){ + + $db->query("INSERT INTO " . PREFIX . "_forum_posts (topic_id, post_date, post_author, post_text, post_ip, is_register, e_mail, is_count) values ('$topic_id', '$topic_date', '$member_id[name]', '$post_text', '$_IP', '$is_logged', '$mail', '$postcount')"); + + $new_pid = $db->insert_id(); + + // update table // + + $db->query("UPDATE " . PREFIX . "_forum_topics SET post = post+1, last_date = '$topic_date', last_poster_name = '$member_id[name]', last_post_id = '$new_pid' WHERE tid = '$topic_id'"); + + $db->query("UPDATE " . PREFIX . "_forum_forums SET posts = posts+1, f_last_tid = '$topic_id', f_last_title = '$topic_title', f_last_date = '$topic_date', f_last_poster_name = '$member_id[name]', last_post_id = '$new_pid' WHERE id = '$forum_id'"); + + if ($is_logged) + { + if ($postcount) + { + $db->query("UPDATE " . PREFIX . "_users SET forum_post = forum_post+1 WHERE name = '$member_id[name]'"); + } + + $db->query("DELETE FROM " . PREFIX . "_forum_views WHERE topic_id = '$topic_id' and user_id != '$member_id[user_id]'"); + } + + if ($forum_config['set_sub_last_up'] and $is_parentid = $forums_array[$forum_id]['parentid']) + { + $db->query("UPDATE " . PREFIX . "_forum_forums SET f_last_tid = '$topic_id', f_last_title = '$topic_title', f_last_date ='$topic_date', f_last_poster_name = '$member_id[name]' WHERE id ='$is_parentid'"); + } + + } + else + { + $stop_subscription = true; + + $post_text = $db->safesql($row['post_text'] . "

    " . stripslashes($post_text)); + + $db->query("UPDATE " . PREFIX . "_forum_posts set post_text = '{$post_text}' WHERE pid = '{$post_id}'"); + + $new_pid = $post_id; + } + + if ($post_id) + { + if (stristr ($post_text, "[attachment=")) + { + $result = $db->query("SELECT * FROM " . PREFIX . "_forum_files + WHERE topic_id = '$topic_id' and file_attach = '0'"); + + while ($att = $db->get_row($result)) + { + if (stristr ($post_text, "[attachment=".$att['file_id']."]") OR stristr ($post_text, "[attachment=".$att['file_id'].":url]")) + { + $update_id[] = $att['file_id']; + } + } + + if ($update_id) + { + $update_list = implode(',', $update_id); + + $db->query("UPDATE " . PREFIX . "_forum_files SET topic_id = '$topic_id', post_id = '$new_pid', file_attach = '1' WHERE file_id IN ({$update_list})"); + } + } + } + + $cache->clear ('forum_show_last'); + + $topic_location = $forum_url."/topic_{$topic_id}/{$page}#post-{$new_pid}"; + + if (!$ajax_adds) + { + header("Location: {$topic_location}"); + } + + if ($forum_config['subscription'] AND !$stop_subscription) + { + $all_subscr = $db->query("SELECT name, email FROM ". PREFIX ."_forum_subscription AS t1 INNER JOIN ". PREFIX ."_users AS t2 ON t1.user_id = t2.user_id WHERE t1.topic_id = $topic_id and t1.user_id != '{$member_id['user_id']}'"); + + if ($db->num_rows($all_subscr)) + { + include_once SYSTEM_DIR.'/classes/mail.class.php'; + + $mail = new dle_mail ($config); + + $topic_link = $a_forum_url."showtopic={$topic_id}&lastpost=1#reply"; + + $topic_link_del = $config['http_home_url']."?do=forum&act=subscription&code=del&selected_id={$topic_id}"; + + $mail_tpl = $db->super_query("SELECT template FROM " . PREFIX . "_forum_email where name='subscription_text' LIMIT 0,1"); + + $mail_tpl['template'] = stripslashes($mail_tpl['template']); + + while ($mail_row = $db->get_row($all_subscr)) + { + $mail_result = str_replace("{%username_to%}", $mail_row['name'], $mail_tpl['template']); + + $mail_result = str_replace("{%username_from%}", $member_id['name'], $mail_result); + + $mail_result = str_replace("{%topic_name%}", $topic_title, $mail_result); + + $mail_result = str_replace("{%topic_link%}", $topic_link, $mail_result); + + $mail_result = str_replace("{%topic_link_del%}", $topic_link_del, $mail_result); + + $mail_title = "Уведомление об ответах на подписанную тему"; + + $mail->send ($mail_row['email'], $mail_title, $mail_result); + } + + } + } + + $cache->clear ('forum_show_last'); + } + + else + { + if (!$add_post_ok) + { + forum_msg($f_lang['all_info'], $stop); + + $add_post_error = $stop; + } + + elseif ($post_captcha) + { + forum_msg($f_lang['all_info'], $f_lang['captcha_stop']); + + $add_post_error = $f_lang['ajax_stop_2']; + } + + elseif ($post_maxlen) + { + forum_msg($f_lang['all_info'], $f_lang['maxlen_stop']); + + $add_post_error = $f_lang['ajax_stop_4']; + } + + else + { + forum_msg($f_lang['all_info'], $f_lang['values_error']); + + $add_post_error = $f_lang['ajax_stop_3']; + } + } + +?> \ No newline at end of file diff --git a/system/forum/action/addtopic.php b/system/forum/action/addtopic.php new file mode 100644 index 0000000..65c71ff --- /dev/null +++ b/system/forum/action/addtopic.php @@ -0,0 +1,325 @@ += $forum_config['min_post'] OR $member_id['user_group'] < 2){ + $access_topic = check_access($forums_array[$forum_id]['access_topic']); + }else{ + $access_topic = false; + forum_msg($f_lang['all_info'], "Для открытия новой темы нужно иметь минимум ".$forum_config['min_post']." полезных сообщений на форуме"); + } + //Открытие новой темы при минимуме сообщений на форуме у юзера. + + if ($access_topic) + { + if (!$_REQUEST['subaction']) + { + $access_upload = check_access($forums_array[$forum_id]['access_upload']); + + $upload_var = array('area' => "topic", 'forum_id' => $forum_id, 'topic_id' => get_salt(),); + + $tpl->set('[not-wysywyg]', ""); + + $tpl->set('{wysiwyg}',''); + + $tpl->set('[/not-wysywyg]',""); + + include_once SYSTEM_DIR.'/forum/sources/components/bbcode.php'; + + $topic_action_add = $a_forum_url."act=add_topic&subaction=1"; + + $tpl->load_template($tpl_dir.'addtopic.tpl'); + + $tpl->set('{bbcode}',$bb_code); + $tpl->set('{topic_title}',""); + $tpl->set('{topic_descr}',""); + $tpl->set('{text}',""); + + if ($is_logged) + { + $tpl->set_block("'\\[not-logged\\](.*?)\\[/not-logged\\]'si",""); + } + else + { + $tpl->set('[not-logged]',''); + $tpl->set('[/not-logged]',''); + } + + if (check_access($forum_config['tools_poll'])) + { + $tpl->set('[poll]',''); + $tpl->set('[/poll]',''); + } + else + { + $tpl->set_block("'\\[poll\\](.*?)\\[/poll\\]'si",""); + } + + if (check_access($forum_config['topic_captcha'])) + { + $tpl->set('[sec_code]',""); + $tpl->set('[/sec_code]',""); + + $path = parse_url($config['http_home_url']); + $anti_bot = !defined('FORUM_SUB_DOMAIN') ? 'system/modules/' : ''; + + $tpl->set('{sec_code}',"\"${lang['sec_image']}\""); + } + else + { + $tpl->set('{sec_code}',""); + $tpl->set_block("'\\[sec_code\\](.*?)\\[/sec_code\\]'si",""); + } + + $tpl->copy_template = "
    ".$tpl->copy_template." + +
    +
    "; + + $tpl->compile('dle_forum'); + + $tpl->clear(); + } + + else + { + if (check_access($forum_config['topic_captcha'])) + { + if ($_REQUEST['sec_code'] !== $_SESSION['sec_code_session'] and isset($_SESSION['sec_code_session'])) + { + $topic_captcha = true; + + $_SESSION['sec_code_session'] = FALSE; + } + } + else + { + $topic_captcha = false; + } + + if (!$topic_captcha){ + + require_once SYSTEM_DIR.'/classes/parse.class.php'; + + $parse = new ParseFilter(Array(), Array(), 1, 1); + + if (!$is_logged) + { + $name = $db->safesql($parse->process(trim($_POST['name']))); + $mail = $db->safesql($parse->process(trim($_POST['mail']))); + + $member_id['name'] = $name; + + $db->query("SELECT name from " . USERPREFIX . "_users where LOWER(name) = '".strtolower($name)."'"); + + if (!$db->num_rows() > 0) + { + $name_ok = true; + } + else + { + $name_ok = false; + } + + $db->free(); + + if(preg_match("/^[\.A-z0-9_\-]+[@][A-z0-9_\-]+([.][A-z0-9_\-]+)+[A-z]{1,4}$/", $mail)) + { + $mail_ok = true; + } + else + { + $mail_ok = false; + } + + if ($name_ok and $mail_ok) + { + $access_add = true; + } + else + { + $access_add = false; + + if (!$name_ok) $stop .= $f_lang['err_name']; + + if (!$mail_ok) $stop .= $f_lang['err_mail']; + } + } + else + { + $access_add = true; + } + + $topic_title = $db->safesql($parse->process($_POST['topic_title'])); + $topic_descr = $db->safesql($parse->process($_POST['topic_descr'])); + + $topic_text = $parse->process($_POST['post_text']); + + $topic_text = $db->safesql($parse->BB_Parse($topic_text, FALSE)); + + $topic_text = auto_wrap ($topic_text); + + if (strlen($topic_text) > $forum_config['post_maxlen']) + { + $post_maxlen = true; + + $stop .= $f_lang['ajax_stop_4']; + } + else + { + $post_maxlen = false; + } + + if ($topic_title and $topic_text and $access_add and !$post_maxlen) + { + $_IP = $db->safesql($_SERVER['REMOTE_ADDR']); + + $vote_title = trim($db->safesql($parse->process($_POST['vote_title']))); + $frage = trim($db->safesql($parse->process($_POST['frage']))); + $vote_body = $db->safesql($parse->BB_Parse($parse->process($_POST['vote_body']), false)); + $poll_multiple = intval($_POST['poll_multiple']); + + $_TIME = time()+($config['date_adjust']*60); + $topic_date = date ("Y-m-d H:i:s", $_TIME); + + if ($forum_config['meta_topic']) + { + $meta = forum_metatags($topic_title . ' ' . $topic_descr . ': ' . $topic_text); + } + else{ $meta = ""; } + + $db->query("INSERT INTO " . PREFIX . "_forum_topics (forum_id, title, topic_descr, author_topic, start_date, last_date, last_poster_name, poll_title, frage, poll_body, multiple, meta_descr, meta_keywords) values ('$forum_id', '$topic_title', '$topic_descr', '$member_id[name]', '$topic_date', '$topic_date', '$member_id[name]', '$vote_title', '$frage', '$vote_body', '$poll_multiple', '$meta[description]', '$meta[keywords]')"); + + $topic_id = $db->insert_id(); + + $db->query("INSERT INTO " . PREFIX . "_forum_posts (topic_id, post_date, post_author, post_text, post_ip, is_register, e_mail, is_count) values ('$topic_id', '$topic_date', '$member_id[name]', '$topic_text', '$_IP', '$is_logged', '$mail', '$postcount')"); + + $new_pid = $db->insert_id(); + + set_first_post_id ($topic_id, $new_pid); + + $db->query("UPDATE " . PREFIX . "_forum_forums SET topics = topics+1, f_last_tid = '$topic_id', f_last_title = '$topic_title', f_last_date ='$topic_date', f_last_poster_name = '$member_id[name]' WHERE id ='$forum_id'"); + + if ($forum_config['set_topic_post'] and $postcount and $is_logged) + { + $db->query("UPDATE " . PREFIX . "_users SET forum_post = forum_post+1 WHERE name = '$member_id[name]'"); + } + + if ($forum_config['set_sub_last_up'] and $is_parentid = $forums_array[$forum_id]['parentid']) + { + $db->query("UPDATE " . PREFIX . "_forum_forums SET f_last_tid = '$topic_id', f_last_title = '$topic_title', f_last_date = '$topic_date', f_last_poster_name = '$member_id[name]', last_post_id = '$new_pid' WHERE id = '$is_parentid'"); + } + + if ($subscription and $is_logged) + { + $db->query("SELECT * FROM " . PREFIX . "_forum_subscription WHERE topic_id = '$topic_id' and user_id = '{$member_id['user_id']}'"); + + if (!$db->num_rows() and $topic_id) + { + $db->query("INSERT INTO " . PREFIX . "_forum_subscription (user_id, topic_id) values ('{$member_id['user_id']}', '$topic_id')"); + } + } + + if ($_REQUEST['add_tid']) + { + if (stristr ($topic_text, "[attachment=")) + { + $result = $db->query("SELECT * FROM " . PREFIX . "_forum_files + WHERE topic_id = '{$_REQUEST['add_tid']}' and file_attach = '0'"); + + while ($att = $db->get_row($result)) + { + if (stristr($topic_text, "[attachment={$att['file_id']}]") OR stristr($topic_text, "/forum/files/{$att['onserver']}")) + { + $update_id[] = $att['file_id']; + } + } + + if ($update_id) + { + $update_list = implode(',', $update_id); + + $db->query("UPDATE " . PREFIX . "_forum_files SET topic_id = '$topic_id', post_id = '$new_pid', file_attach = '1' WHERE file_id IN ({$update_list})"); + } + } + } + + if ($forum_config['topic_email']) + { + $topic_link = $config['http_home_url']."?do=forum&showtopic={$topic_id}"; + + include_once SYSTEM_DIR.'/classes/mail.class.php'; + + $mail = new dle_mail ($config); + + $mail_tpl = $db->super_query("SELECT template FROM " . PREFIX . "_forum_email where name='new_topic' LIMIT 0,1"); + + $mail_tpl['template'] = stripslashes($mail_tpl['template']); + + $mail_result = str_replace("{%username%}", $member_id[name], $mail_tpl['template']); + + $mail_result = str_replace("{%date%}", $topic_date, $mail_result); + + $mail_result = str_replace("{%title%}", $topic_title, $mail_result); + + $mail_result = str_replace("{%link%}", $topic_link, $mail_result); + + $mail->send ($config['admin_mail'], "DLE Forum - NEW TOPIC", $mail_result); + } + + if ($forum_config['mod_rewrite']) + { + $topic_location = $forum_url."/topic_".$topic_id; + } + else + { + $topic_location = $forum_url."showtopic=".$topic_id; + } + + $cache->clear('forum_show_last'); + + header("Location: $topic_location"); + } + + else + { + forum_msg($f_lang['f_msg'], $f_lang['topic_add_stop'], 'stop', "
    ".$stop); + } + + } + + else + { + if ($topic_captcha) + { + forum_msg($f_lang['all_info'], $f_lang['captcha_stop']); + } + } + } + } + + else + { + $group_name = $user_group[$member_id['user_group']]['group_name']; + + forum_msg($f_lang['f_msg'], $f_lang['topic_add_ndeny'], 'user_group', $group_name); + } + + if ($forum_config['forum_bar']) + { + $bbr_fid = $forum_id; + $bbr_fname = $forums_array[$forum_id]['name']; + + $category_id = $forums_array[$forum_id]['main_id']; + + $bbr_cid = $category_id; + $bbr_name = $cats_array[$category_id]['cat_name']; + + $bbr_app = $f_lang['app_newtopic']; + } + +?> \ No newline at end of file diff --git a/system/forum/action/forum.php b/system/forum/action/forum.php new file mode 100644 index 0000000..66731b5 --- /dev/null +++ b/system/forum/action/forum.php @@ -0,0 +1,158 @@ +query("SELECT tid FROM " . PREFIX . "_forum_topics WHERE forum_id = '$fid'"); + + while ($row = $db->get_row($result_topics)) + { + $forum_topic++; + + $p_count = $db->super_query("SELECT COUNT(*) as count FROM " . PREFIX . "_forum_posts WHERE topic_id = '$row[tid]'"); + $posts_in_forum = ($posts_in_forum + $p_count['count']); + } + + if (!$forum_config['set_topic_post']) + { + $posts_in_forum = ($posts_in_forum - $forum_topic); + } + + if ($forum_config['topic_sort']) $sort_type = "last_date"; + else $sort_type = "tid"; + + $row1 = $db->super_query("SELECT * FROM ". PREFIX ."_forum_topics WHERE forum_id = '$fid' ORDER by $sort_type DESC"); + + $db->query("UPDATE " . PREFIX . "_forum_forums SET posts = '$posts_in_forum', topics = '$forum_topic', f_last_tid = '$row1[tid]', f_last_title = '$row1[title]', f_last_date ='$row1[last_date]', f_last_poster_name = '$row1[last_poster_name]' WHERE id = '$fid'"); + + header("Location: $_SERVER[HTTP_REFERER]"); + } + + else + { + header("Location: $_SERVER[HTTP_REFERER]"); + } + + break; + +// ******************************************************************************** +// USER +// ******************************************************************************** + case "user": + + $mname = $db->safesql($_REQUEST['mname']); + + if ($mname) + { + $get_count = $db->super_query("SELECT COUNT(*) as count FROM " . PREFIX . "_forum_topics WHERE author_topic = '$mname' and hidden = 0"); + + $count_all = $get_count['count']; + } + + if ($count_all){ + + if ($cstart) + { + $cstart = $cstart - 1; + $cstart = $cstart * $forum_config['topic_inpage']; + } + + if ($forum_config['topic_sort']) + { + $sort_type = "last_date"; + } + + else + { + $sort_type = "tid"; + } + +// ******************************************************************************** +// TOPIC VIEWS +// ******************************************************************************** + if ($is_logged) + { + $row_views = $db->query("SELECT topic_id FROM " . PREFIX . "_forum_views WHERE user_id = '$member_id[user_id]' and time > '$topic_a_time'"); + + $topic_views = array(); + + while ($row = $db->get_row($row_views)) + { + $topic_views[$row['topic_id']] = '1'; + } + } + + else + { + $row_views = explode(",", $_COOKIE['dle_forum_views']); + + foreach ($row_views as $value) + { + $topic_views[$value] = '1'; + } + } + + $config_inpage = $forum_config['topic_inpage']; + + $result_topics = $db->query("SELECT * FROM " . PREFIX . "_forum_topics WHERE author_topic = '$mname' and hidden = 0 ORDER BY fixed, ".$sort_type." DESC LIMIT ".$cstart.",".$forum_config['topic_inpage'].""); + + require_once SYSTEM_DIR.'/forum/sources/showtopics.php'; + + $icat = $forum_url."act=getforum&code=user&mname={$mname}&cstart="; + + require_once SYSTEM_DIR.'/forum/sources/components/navigation.php'; + + $tpl->load_template($tpl_dir.'forum.tpl'); + + $tpl->set('{forum}', $f_lang['app_user_topic'].': '.$mname); + + $tpl->set('{subforums}',''); + + $tpl->set('{topics}', $tpl->result['topics']); + + $tpl->set('{info}', $msg_info); + + $tpl->set('{navigation}', $tpl->result['navigation']); + + $tpl->set_block("'\\[options\\](.*?)\\[/options\\]'si",""); + + $tpl->set_block("'\\[rules\\](.*?)\\[/rules\\]'si",""); + + $tpl->set_block("'\\[new_topic\\](.*?)\\[/new_topic\\]'si",""); + + $tpl->set_block("'\\[selected\\](.*?)\\[/selected\\]'si",""); + + $tpl->set_block("'\\[fast-search\\](.*?)\\[/fast-search\\]'si",""); + + $tpl->set_block("'\\[moderation\\](.*?)\\[/moderation\\]'si",""); + + $tpl->set_block("'\\[online\\](.*?)\\[/online\\]'si",""); + + $tpl->compile('dle_forum'); + + $tpl->clear(); + + } + + else + { + forum_msg($f_lang['f_msg'], $f_lang['f_404']); + } + + $bbr_app = $f_lang['app_user_topic']; + + break; + } + +?> \ No newline at end of file diff --git a/system/forum/action/moderation.php b/system/forum/action/moderation.php new file mode 100644 index 0000000..c9a6c7b --- /dev/null +++ b/system/forum/action/moderation.php @@ -0,0 +1,520 @@ +query("UPDATE " . PREFIX . "_forum_topics SET topic_status = '0' WHERE tid = '$topic_id'"); + + $db->query("UPDATE " . PREFIX . "_forum_posts SET hidden = '0' WHERE topic_id = '$topic_id' and hidden NOT IN (1,6)"); + } + + header("Location: $_SERVER[HTTP_REFERER]"); + } + + else + { + die("Hacking attempt!"); + } + + break; + +// ******************************************************************************** +// CLOSE TOPIC +// ******************************************************************************** + case "02": + + if ($selectedtids and is_moderation(0, $selectedtids, 0) OR group_moderation($selectedtids, 'forum_topic_set')) + { + if (!moderator_value('close_topic', $forum_id, $m_member) AND !group_moderation($selectedtids, 'forum_topic_set')) die(); + + $selectedtids = explode(",",$selectedtids); + + foreach($selectedtids as $topic_id) + { + $topic_id = intval($topic_id); + if ( $topic_id == 0 ) continue; + $db->query("UPDATE " . PREFIX . "_forum_topics SET topic_status = '1' WHERE tid = '$topic_id'"); + + $db->query("UPDATE " . PREFIX . "_forum_posts SET hidden = '2' WHERE topic_id = '$topic_id' and hidden NOT IN (1,6)"); + } + + header("Location: {$_SERVER['HTTP_REFERER']}"); + } + + else + { + die("Hacking attempt!"); + } + + break; + +// ******************************************************************************** +// DEL TOPIC +// ******************************************************************************** + case "03": + + if ($selectedtids and is_moderation(0, $selectedtids, 0) OR group_moderation($selectedtids, 'forum_topic_del')) + { + if (!moderator_value('delete_topic', $forum_id, $m_member) AND !group_moderation($selectedtids, 'forum_topic_del')) die(); + + $selectedtids = explode(",",$selectedtids); + + foreach($selectedtids as $topic_id) + { + $topic_id = intval($topic_id); + if ( $topic_id == 0 ) continue; + $row_topic = $db->super_query("SELECT * FROM " . PREFIX . "_forum_topics WHERE tid = '$topic_id'"); + + $topic_id = $row_topic['tid']; + + $forum_id = $row_topic['forum_id']; + + $post_all = $row_topic['post']; + + if (!$forum_config['set_topic_post']) + { + $post_all = ($post_all - 1); + } + + if ($topic_id) + { + // user converting // + if ($forum_config['set_post_num_up']) + { + $query = $db->query("SELECT distinct post_author FROM " . PREFIX . "_forum_posts WHERE topic_id = '$topic_id'"); + + while ($row = $db->get_row($query)) + { + if ($forum_config['set_topic_post']) + { + $topic = $db->super_query("SELECT COUNT(*) as count FROM " . PREFIX . "_forum_topics WHERE author_topic = '$row[post_author]'"); + + $topic_num = $topic['count']; + } + + $post = $db->super_query("SELECT COUNT(*) as count FROM " . PREFIX . "_forum_posts WHERE post_author = '$row[post_author]'"); + + $post_num = $post['count']; + + $update = ($topic_num + $post_num); + + $db->query("UPDATE " . PREFIX . "_users SET forum_post = '$update' WHERE name ='$row[post_author]'"); + } + } + +// Удаление вложений вместе с темой + +$result = $db->query("SELECT * FROM " . PREFIX . "_forum_files WHERE topic_id = '" . $topic_id . "'"); + +while ($row = $db->get_row($result)) { + +if ($row['file_type'] == "file") { + +unlink(UPLOAD_DIR."files/" . $row['onserver']); + +} elseif ($row['file_type'] == "thumb") { + +unlink(UPLOAD_DIR."thumbs/" . $row['onserver']); + +unlink(UPLOAD_DIR."images/" . $row['onserver']); + +} else { + +unlink(UPLOAD_DIR."images/" . $row['onserver']); + +} + +} + +$db->query("DELETE FROM " . PREFIX . "_forum_files WHERE topic_id = '" . $topic_id . "'"); + +// конец удаления вложений вместе с темой + + $db->query("DELETE FROM " . PREFIX . "_forum_posts WHERE topic_id = '$topic_id'"); + + $db->query("DELETE FROM " . PREFIX . "_forum_topics WHERE `tid` = '$topic_id'"); + + $new_result = $db->super_query("SELECT * FROM ". PREFIX ."_forum_topics WHERE forum_id = '$forum_id' ORDER by start_date DESC"); + + $db->query("UPDATE " . PREFIX . "_forum_forums SET topics = topics-1, posts = posts-$post_all, f_last_tid = '$new_result[tid]', f_last_title = '$new_result[title]', f_last_date = '$new_result[last_date]', f_last_poster_name = '$new_result[last_poster_name]' WHERE id ='$forum_id'"); + + $db->query("DELETE FROM " . PREFIX . "_forum_poll_log WHERE topic_id = '$topic_id'"); + + // del discuss id // + $db->query("UPDATE " . PREFIX . "_post SET news_tid = '0' WHERE news_tid = '$topic_id'"); + + // del attachment // + $db->query("SELECT * FROM " . PREFIX . "_forum_files WHERE topic_id = '$topic_id'"); // and file_attach='1' + + while($row = $db->get_row()) + { + if ($row['file_type'] == "image") + { + @unlink(UPLOAD_DIR."images/".$row['onserver']); + } + + elseif ($row['file_type'] == "thumb") + { + @unlink(UPLOAD_DIR."thumbs/".$row['onserver']); + + @unlink(UPLOAD_DIR."images/".$row['onserver']); + } + + else + { + @unlink(UPLOAD_DIR."files/".$row['onserver']); + } + + $db->query("DELETE FROM " . PREFIX . "_forum_files WHERE file_id = '$row[file_id]'"); + } // end - del attachment // + } + } + + if ($forum_config['mod_rewrite']) + { + $forum_location = "{$forum_url}/forum_{$forum_id}"; + } + else + { + $forum_location = "{$forum_url}showforum={$forum_id}"; + } + + header("Location: {$forum_location}"); + } + + else + { + die("Hacking attempt!"); + } + + break; + +// ******************************************************************************** +// EDIT TOPIC TITLE +// ******************************************************************************** + case "04": + + $selectedtids = intval($selectedtids); + + if (!$subaction and is_moderation(0, $selectedtids, 0) OR !$subaction and group_moderation($selectedtids, 'forum_topic_edit')) + { + if (!moderator_value('edit_topic', $forum_id, $m_member) AND !group_moderation($selectedtids, 'forum_topic_edit')) die(); + + $row = $db->super_query("SELECT * FROM " . PREFIX . "_forum_topics WHERE tid = '{$selectedtids}'"); + + $topic_action_add = $a_forum_url."act=moderation&code=04&subaction=save&selected_id={$selectedtids}"; + + require_once SYSTEM_DIR.'/classes/parse.class.php'; + + $parse = new ParseFilter(); + + $parse->safe_mode = true; + + $topic_title = $parse->decodeBBCodes($row['title'], false); + $topic_descr = $parse->decodeBBCodes($row['topic_descr'], false); + + $tpl->load_template($tpl_dir.'edittopic.tpl'); + + $tpl->set('{topic_title}', $topic_title); + $tpl->set('{topic_descr}', $topic_descr); + + if (check_access($forum_config['tools_poll'])) + { + $tpl->set('[poll]',''); + $tpl->set('[/poll]',''); + + $tpl->set('{vote_title}', $parse->decodeBBCodes($row['poll_title'], false)); + $tpl->set('{frage}', $parse->decodeBBCodes($row['frage'], false)); + $tpl->set('{vote_body}', $parse->decodeBBCodes($row['poll_body'], false)); + } + else + { + $tpl->set_block("'\\[poll\\](.*?)\\[/poll\\]'si",""); + } + + $tpl->copy_template = "
    ".$tpl->copy_template."
    "; + + $tpl->compile('dle_forum'); + $tpl->clear(); + } + + if ($subaction == "save" and is_moderation(0, $selectedtids, 0) OR $subaction == "save" and group_moderation($selectedtids, 'forum_topic_edit')) + { + if (!moderator_value('edit_topic', $forum_id, $m_member) AND !group_moderation($selectedtids, 'forum_topic_edit')) die(); + + require_once SYSTEM_DIR.'/classes/parse.class.php'; + + $parse->safe_mode = true; + + $parse = new ParseFilter(Array(), Array(), 1, 1); + + $topic_title = $db->safesql($parse->process($_POST['topic_title'])); + $topic_descr = $db->safesql($parse->process($_POST['topic_descr'])); + $vote_title = trim($db->safesql($parse->process($_POST['vote_title']))); + $frage = trim($db->safesql($parse->process($_POST['frage']))); + $vote_body = $db->safesql($parse->BB_Parse($parse->process($_POST['vote_body']), false)); + $poll_multiple = intval($_POST['poll_multiple']); + + $db->query("UPDATE " . PREFIX . "_forum_topics SET title = '$topic_title', topic_descr = '$topic_descr', poll_title = '$vote_title', frage = '$frage', poll_body = '$vote_body', multiple = '$poll_multiple' WHERE tid = '$selectedtids'"); + + if ($forum_config['mod_rewrite']) + { + $topic_location = "{$forum_url}/topic_$selectedtids"; + } else + { + $topic_location = "{$forum_url}showtopic=$selectedtids"; + } + + header("Location: $topic_location"); + } + + $bbr_app = "Редактирование темы"; + + break; + +// ******************************************************************************** +// MOVE TOPIC +// ******************************************************************************** + case "05": + + if ($selectedtids and is_moderation(0, $selectedtids, 0)) + { + if (!moderator_value('move_topic', $is_mod['forum_id'], $m_member)) die(); + + $move_fid = $_REQUEST['move_fid']; + + if (!$subaction) + { + $topic_action_add = "{$a_forum_url}act=moderation&code=05&subaction=move&selected_id=$selectedtids"; + + $tpl->load_template($tpl_dir.'movetopic.tpl'); + + $tpl->set('{topic_title}', $topic_title); + $tpl->set('{forum}', $is_forum_name); + $tpl->set('{forum_list}', forum_list()); + + $tpl->copy_template = "
    ".$tpl->copy_template."
    "; + + $tpl->compile('dle_forum'); + $tpl->clear(); + } + + if ($subaction == "move" and $selectedtids and $move_fid) + { + $tid = $selectedtids; + + $selectedtids = explode(",",$selectedtids); + + $new_post_count = 0; + + $postcount = intval ($forums_array[$move_fid]['postcount']); + + foreach ($selectedtids as $topic_id) + { + $topic_id = intval($topic_id); + if ( $topic_id == 0 ) continue; + $db->query("UPDATE " . PREFIX . "_forum_topics SET forum_id = '$move_fid' WHERE tid = '$topic_id'"); + $tid_count++; + + $post = $db->super_query("SELECT COUNT(*) as count FROM " . PREFIX . "_forum_posts WHERE topic_id = '$topic_id'"); + + $post_count = $post_count + $post['count']; + + $db->query("UPDATE " . PREFIX . "_forum_posts SET is_count = '$postcount' WHERE topic_id = '$topic_id'"); + } + + $post_count = $post_count - $tid_count; + + if ($forum_config['topic_sort']) $sort_type = "last_date"; + else $sort_type = "tid"; + + $row1 = $db->super_query("SELECT * FROM ". PREFIX ."_forum_topics WHERE forum_id = '{$is_mod['forum_id']}' ORDER by $sort_type DESC"); + + $row2 = $db->super_query("SELECT * FROM ". PREFIX ."_forum_topics WHERE forum_id = '$move_fid' ORDER by $sort_type DESC"); + + $db->query("UPDATE " . PREFIX . "_forum_forums SET posts = posts-$post_count, topics = topics-$tid_count, f_last_tid = '$row1[tid]', f_last_title = '$row1[title]', f_last_date ='$row1[last_date]', f_last_poster_name = '$row1[last_poster_name]' WHERE id = '{$is_mod['forum_id']}'"); + + $db->query("UPDATE " . PREFIX . "_forum_forums SET posts = posts+$post_count, topics = topics+$tid_count, f_last_tid = '$row2[tid]', f_last_title = '$row2[title]', f_last_date ='$row2[last_date]', f_last_poster_name = '$row2[last_poster_name]' WHERE id = '$move_fid'"); + + if ($forum_config['mod_rewrite']) + { + $topic_location = "{$forum_url}/topic_$tid"; + + $forum_location = "{$forum_url}/forum_$move_fid"; + } + else + { + $topic_location = "{$forum_url}showtopic=$tid"; + + $forum_location = "{$forum_url}showforum=$move_fid"; + } + + if ($tid_count > 1) + { + header("Location: $forum_location"); + } + else + { + header("Location: $topic_location"); + } + } + + $bbr_app = "Перемещение темы"; + } + + break; + +// ******************************************************************************** +// HIDDEN TOPIC +// ******************************************************************************** + case "06": + + if ($selectedtids and is_moderation(0, $selectedtids, 0)) + { + $selectedtids = explode(",",$selectedtids); + + foreach($selectedtids as $topic_id) + { + $topic_id = intval($topic_id); + if ( $topic_id == 0 ) continue; + $db->query("UPDATE " . PREFIX . "_forum_topics SET hidden = '1' WHERE tid = '$topic_id'"); + + $db->query("UPDATE " . PREFIX . "_forum_posts SET hidden = '6' WHERE topic_id = '$topic_id' and hidden NOT IN (1,2)"); + } + + header("Location: {$_SERVER['HTTP_REFERER']}"); + } + + break; + +// ******************************************************************************** +// NOT HIDDEN TOPIC +// ******************************************************************************** + case "07": + + if ($selectedtids and is_moderation(0, $selectedtids, 0)) + { + $selectedtids = explode(",",$selectedtids); + + foreach($selectedtids as $topic_id) + { + $topic_id = intval($topic_id); + if ( $topic_id == 0 ) continue; + $db->query("UPDATE " . PREFIX . "_forum_topics SET hidden = '0' WHERE tid = '$topic_id'"); + + $db->query("UPDATE " . PREFIX . "_forum_posts SET hidden = '0' WHERE topic_id = '$topic_id' and hidden NOT IN (1,2)"); + } + + header("Location: {$_SERVER['HTTP_REFERER']}"); + } + + break; + +// ******************************************************************************** +// FIXED TOPIC +// ******************************************************************************** + case "08": + + if ($selectedtids and is_moderation(0, $selectedtids, 0)) + { + if (!moderator_value('pin_topic', $forum_id, $m_member)) die(); + + $selectedtids = explode(",",$selectedtids); + + foreach($selectedtids as $topic_id) + { + $topic_id = intval($topic_id); + if ( $topic_id == 0 ) continue; + $db->query("UPDATE " . PREFIX . "_forum_topics SET fixed = '0' WHERE tid = '$topic_id'"); + } + + header("Location: {$_SERVER['HTTP_REFERER']}"); + } + + break; + +// ******************************************************************************** +// NOT FIXED TOPIC +// ******************************************************************************** + case "09": + + if ($selectedtids and is_moderation(0, $selectedtids, 0)) + { + if (!moderator_value('unpin_topic', $forum_id, $m_member)) die(); + + $selectedtids = explode(",",$selectedtids); + + foreach($selectedtids as $topic_id) + { + $topic_id = intval($topic_id); + if ( $topic_id == 0 ) continue; + $db->query("UPDATE " . PREFIX . "_forum_topics SET fixed = '1' WHERE tid = '$topic_id'"); + } + + header("Location: {$_SERVER['HTTP_REFERER']}"); + } + + break; + +// ******************************************************************************** +// CALC +// ******************************************************************************** + case "10": + + $topic_id = intval($_REQUEST['tid']); + + if ($topic_id and is_moderation(0, $topic_id, 0)) + { + calk_topic_del ($topic_id); + + header("Location: {$_SERVER['HTTP_REFERER']}"); + } + + break; + +// ******************************************************************************** +// Default +// ******************************************************************************** + default: + + header("Location: {$_SERVER['HTTP_REFERER']}"); + + break; + } + +?> \ No newline at end of file diff --git a/system/forum/action/post.php b/system/forum/action/post.php new file mode 100644 index 0000000..fa7c135 --- /dev/null +++ b/system/forum/action/post.php @@ -0,0 +1,515 @@ +safesql($_POST['post_id']); + + $topic_title = $_POST['topic_ti']; + + $post_text = $_POST['post_text']; + + $name = $_POST['name']; + $mail = $_POST['mail']; + + $check_write = check_access($forums_array[$forum_id]['access_write']); + + if ($check_write) + { + require_once SYSTEM_DIR.'/forum/action/addpost.php'; + } + + else + { + $group_name = $user_group[$member_id['user_group']]['group_name']; + + forum_msg($f_lang['all_info'], $f_lang['topic_write'], 'user_group', $group_name); + } + + break; + +// ******************************************************************************** +// EDIT POST +// ******************************************************************************** + case "02": + + $pid = intval($_REQUEST['pid']); + + $page = intval($_REQUEST['p']); + + $post_n = intval($_REQUEST['pn']); + + if ($pid) + { + if (is_moderation(0, 0, $pid, 'forum_post_edit')) + { + include_once SYSTEM_DIR.'/classes/parse.class.php'; + + $parse = new ParseFilter(Array(), Array(), 1, 1); + + $row = $db->super_query("SELECT * FROM " . PREFIX . "_forum_posts WHERE `pid` = '$pid'"); + + $post_text = $parse->decodeBBCodes($row['post_text'], false); + + $topic_id = $row['topic_id']; + + $fid = $db->super_query("SELECT forum_id FROM " . PREFIX . "_forum_topics WHERE tid = '$topic_id'"); + + $forum_id = $fid['forum_id']; + + $access_upload = check_access($forums_array[$forum_id]['access_upload']); + + $upload_var = array('area'=>"post", 'forum_id'=>$forum_id, 'topic_id'=>$topic_id, 'post_id'=>$pid); + + if ($row['pid']) + { + $edit_post_action = $a_forum_url."act=post&code=03&pid=$pid&topic_id=$topic_id&p=$page&pn=$post_n"; + + $tpl->load_template($tpl_dir.'addpost.tpl'); + + $tpl->set('{title}', $f_lang['app_post_edit']); + + $tpl->set('[not-wysywyg]', ""); + + $tpl->set('{wysiwyg}',''); + + $tpl->set('[/not-wysywyg]',""); + + include_once SYSTEM_DIR.'/forum/sources/components/bbcode.php'; + + if (!$is_logged) + { + $tpl->set('[not-logged]',''); + $tpl->set('[/not-logged]',''); + } + + else + { + $tpl->set_block("'\\[not-logged\\](.*?)\\[/not-logged\\]'si",""); + } + + $tpl->set_block("'\\[sec_code\\](.*?)\\[/sec_code\\]'si",""); + + $tpl->set('{bbcode}',$bb_code); + $tpl->set('{text}',$post_text); + + $tpl->copy_template = "
    ".$tpl->copy_template."
    "; + + $tpl->compile('dle_forum'); + $tpl->clear(); + } + } + + else + { + forum_msg($f_lang['f_msg'], $f_lang['f_404']); + } + } + + else + { + forum_msg($f_lang['f_msg'], $f_lang['f_404']); + } + + break; + +// ******************************************************************************** +// SAVE POST +// ******************************************************************************** + case "03": + + $pid = intval($_REQUEST['pid']); + + $topic_id = intval($_REQUEST['topic_id']); + + $page = intval($_REQUEST['p']); + + $post_n = intval($_REQUEST['pn']); + + if (is_moderation(0, 0, $pid, 'forum_post_edit')) + { + include_once SYSTEM_DIR.'/classes/parse.class.php'; + + $parse = new ParseFilter(Array(), Array(), 1, 1); + + $post_text = $parse->process($_POST['post_text']); + + $post_text = $db->safesql($parse->BB_Parse($post_text, FALSE)); + + $post_text = auto_wrap ($post_text); + + if (strlen($post_text) > $forum_config['post_maxlen']) + { + $post_maxlen = true; + } + else + { + $post_maxlen = false; + } + + if ($post_text and !$post_maxlen) + { + $_TIME = time()+($config['date_adjust']*60); + + $edit_info = ", edit_user = '{$member_id[name]}', edit_time = '{$_TIME}'"; + + $db->query("UPDATE " . PREFIX . "_forum_posts SET post_text = '$post_text' {$edit_info} WHERE pid = '$pid'"); + + check_attachment($pid, $post_text); + + if ($forum_config['mod_rewrite']) + { + $topic_location = $forum_url."/topic_{$topic_id}/$page#post-$post_n"; + } + else + { + $topic_location = $forum_url."showtopic=$topic_id&cstart=$page#post-$post_n"; + } + + header("Location: $topic_location"); + } + + else + { + if ($post_maxlen) + { + forum_msg($f_lang['f_msg'], $f_lang['maxlen_stop']); + } + else + { + forum_msg($f_lang['f_msg'], $f_lang['topic_add_stop'], 'stop', ''); + } + + } + } + + else + { + forum_msg($f_lang['f_msg'], $f_lang['f_404']); + } + + break; + +// ******************************************************************************** +// DEL POST +// ******************************************************************************** + case "04": + + if (is_moderation(0, 0, $selected_id, 'forum_post_del')) + { + $selected_id = explode(",", $selected_id); + + foreach ($selected_id as $post_id) + { + $db->query("DELETE FROM " . PREFIX . "_forum_posts WHERE pid = '$post_id'"); + +// Удаление вложений вместе с сообщением + +$result = $db->query("SELECT * FROM " . PREFIX . "_forum_files WHERE post_id = '" . $post_id . "'"); + +while ($row = $db->get_row($result)) { + +if ($row['file_type'] == "file") { + +unlink(UPLOAD_DIR."files/" . $row['onserver']); + +} elseif ($row['file_type'] == "thumb") { + +unlink(UPLOAD_DIR."thumbs/" . $row['onserver']); + +unlink(UPLOAD_DIR."images/" . $row['onserver']); + +} else { + +unlink(UPLOAD_DIR."images/" . $row['onserver']); + +} + +} + +$db->query("DELETE FROM " . PREFIX . "_forum_files WHERE post_id = '" . $post_id . "'"); + +// конец удаления вложений вместе с темой + + $update_id[] = $post_id; + + $del_count++; + } + + if ($update_id) + { + $update_list = implode(',', $update_id); + + $db->query("UPDATE " . PREFIX . "_forum_files SET file_attach = '0' WHERE post_id IN ({$update_list})"); + } + + if ($is_mod['topic_id'] and $del_count) + { + calk_topic_del ($is_mod['topic_id'], $del_count); + } + + if ($forum_config['mod_rewrite']) $topic_location = $forum_url."/topic_".$is_mod['topic_id']; + + else $topic_location = $forum_url."showtopic=".$is_mod['topic_id']; + + header("Location: $topic_location"); + } + + else break; + + break; + +// ******************************************************************************** +// UN HIDDEN POST +// ******************************************************************************** + case "05": + + if ($selected_id and is_moderation(0, 0, $selected_id)) + { + $selected_id = explode(",", $selected_id); + + foreach ($selected_id as $post_id) + { + $db->query("UPDATE " . PREFIX . "_forum_posts SET hidden = '0' WHERE pid = '$post_id'"); + } + + header("Location: $_SERVER[HTTP_REFERER]"); + } + + else break; + + break; + +// ******************************************************************************** +// HIDDEN POST +// ******************************************************************************** + case "06": + + if ($selected_id and is_moderation(0, 0, $selected_id)) + { + $selected_id = explode(",", $selected_id); + + foreach ($selected_id as $post_id) + { + $db->query("UPDATE " . PREFIX . "_forum_posts SET hidden = '1' WHERE pid = '$post_id'"); + } + + header("Location: $_SERVER[HTTP_REFERER]"); + } + + else break; + + break; + +// ******************************************************************************** +// Combining POST +// ******************************************************************************** + case "07": + + if ($selected_id and is_moderation(0, 0, $selected_id, 'combining_post')) + { + $pid_list = $db->safesql($selected_id); + + $db->query("SELECT * FROM " . PREFIX . "_forum_posts WHERE pid IN ($pid_list)"); + + $join_posts_error = false; + + $post_author = array(); + + $posts_text = array(); + + $selected_id = array(); + + $topic_id = 0; + + while ($row = $db->get_row()) + { + $count++; + + $selected_id[] = $row['pid']; + + if ($count == 1) + { + $topic_id = $row['topic_id']; + } + + if (!in_array($row['post_author'], $post_author)) + { + $post_author[] = $row['post_author']; + } + + if ($row['topic_id'] !== $topic_id) + { + $join_posts_error = true; + } + + $posts_text[] = $row['post_text']; + } + + if ($count > 1 and !$join_posts_error) + { + $new_post = implode("

    ", $posts_text); + + $new_post = $db->safesql($new_post); + + foreach ($selected_id as $key => $value_pid) + { + $pid_count++; + + if ($pid_count == 1) + { + $edit_info = ", edit_user = '{$member_id[name]}', edit_time = '{$_TIME}'"; + + $db->query("UPDATE " . PREFIX . "_forum_posts SET post_text = '$new_post' {$edit_info} WHERE pid = '$value_pid'"); + } + else + { + $db->query("DELETE FROM " . PREFIX . "_forum_posts WHERE pid = '$value_pid'"); + + $del_count++; + } + } + + $del_count = $del_count + 1; + + calk_topic_del ($topic_id, $del_count); + + if ($forum_config['mod_rewrite']) $topic_location = $forum_url . "/topic_" . $topic_id; + + else $topic_location = $forum_url . "showtopic=" . $topic_id; + + header("Location: $topic_location"); + } + } + + break; + +// ******************************************************************************** +// Move POST +// ******************************************************************************** + case "08": + + $new_topic = $_REQUEST['new_topic']; + + $new_topic_id = 0; + + if (intval($new_topic) != 0) + { + $new_topic_id = intval ($new_topic); + } + else + { + preg_match_all("#topic_([0-9]{1,10})#", $new_topic, $matches); + + $new_topic_id = intval ($matches[1][0]); + + if (!$new_topic_id) + { + preg_match_all("#showtopic=([0-9]{1,10})#", $new_topic, $matches); + + $new_topic_id = intval ($matches[1][0]); + } + } + + if ($selected_id and is_moderation(0, 0, $selected_id, 'move_post')) + { + if (!$subaction) + { + $action_moveposts = $a_forum_url."act=post&code=08&subaction=move&selected_id={$selected_id}"; + + $tpl->load_template($tpl_dir.'moveposts.tpl'); + + $tpl->copy_template = "
    ".$tpl->copy_template."
    "; + + $tpl->compile('dle_forum'); + $tpl->clear(); + } + else + { + if ($new_topic_id) + { + $row = $db->super_query("SELECT * FROM " . PREFIX . "_forum_topics WHERE tid = $new_topic_id"); + + $new_forum_id = $row['forum_id']; + + if ($row['tid']) + { + // get info // + $post_id = intval($selected_id); + $row_post = $db->super_query("SELECT * FROM " . PREFIX . "_forum_posts WHERE pid = $post_id"); + $old_topic_id = $row_post['topic_id']; + + $row2 = $db->super_query("SELECT * FROM " . PREFIX . "_forum_topics WHERE tid = $old_topic_id"); + $old_forum_id = $row2['forum_id']; + // - // + + if ($old_topic_id == $new_topic_id) + { + die("error"); + } + + $in_post_id = array(); + + $selected_id = explode(",", $selected_id); + + foreach ($selected_id as $post_id) + { + $post_count++; + + $in_post_id[] = $post_id; + } + + $post_id_list = implode(',', $in_post_id); + + $db->query("UPDATE " . PREFIX . "_forum_posts SET topic_id = $new_topic_id WHERE pid IN ({$post_id_list})"); + + if ($old_forum_id == $new_forum_id) + { + unset ($post_count); + } + + calk_topic_del ($new_topic_id, $post_count, '+'); + + calk_topic_del ($old_topic_id, $post_count, '-'); + + if ($forum_config['mod_rewrite']) $topic_location = $forum_url . "/topic_" . $new_topic_id; + + else $topic_location = $forum_url . "showtopic=" . $new_topic_id; + + header("Location: $topic_location"); + } + } + } + } + + break; + +// ******************************************************************************** +// ERROR +// ******************************************************************************** + default: + + forum_msg($f_lang['f_msg'], $f_lang['f_404']); + + break; + } +?> \ No newline at end of file diff --git a/system/forum/action/topic.php b/system/forum/action/topic.php new file mode 100644 index 0000000..52490ad --- /dev/null +++ b/system/forum/action/topic.php @@ -0,0 +1,352 @@ +super_query("SELECT * FROM " . PREFIX . "_forum_topics WHERE tid = '$tid'"); + + $forum_id = $row_topic['forum_id']; + + $topic_title = stripslashes($row_topic['title']); + + $topic_title_last = urlencode($topic_title); + + $check_moderator = check_moderator($forums_array[$forum_id]['access_mod'], $forums_array[$forum_id]['moderators']); + + $check_write = check_access($forums_array[$forum_id]['access_write']); + + $page_n = @ceil(($row_topic['post'] + 1) / $forum_config['post_inpage']); + + if ($row_topic['topic_status'] and !$check_moderator) + { + $topic_status = false; + } + + else + { + $topic_status = true; + } + + if ($check_write and $topic_status) + { + $access_upload = check_access($forums_array[$forum_id]['access_upload']); + + $upload_var = array('area'=>"post", 'forum_id'=>$forum_id, 'topic_id'=>$tid, 'post_id'=>get_salt()); + + $tpl->load_template($tpl_dir.'addpost.tpl'); + + $tpl->set('{title}', $f_lang['app_reply']); + + $tpl->set('[not-wysywyg]', ""); + + $tpl->set('{wysiwyg}',''); + + $tpl->set('[/not-wysywyg]',""); + + include_once SYSTEM_DIR.'/forum/sources/components/bbcode.php'; + + if (!$is_logged) + { + $tpl->set('[not-logged]',''); + $tpl->set('[/not-logged]',''); + } + + else + { + $tpl->set_block("'\\[not-logged\\](.*?)\\[/not-logged\\]'si",""); + } + + if (check_access($forum_config['post_captcha'])) + { + $tpl->set('[sec_code]',""); + $tpl->set('[/sec_code]',""); + + $path = parse_url($config['http_home_url']); + $anti_bot = !defined('FORUM_SUB_DOMAIN') ? 'system/modules/' : ''; + + $tpl->set('{sec_code}',"\"${lang['sec_image']}\""); + } + else + { + $tpl->set('{sec_code}',""); + $tpl->set_block("'\\[sec_code\\](.*?)\\[/sec_code\\]'si",""); + } + + $tpl->set('{bbcode}',$bb_code); + $tpl->set('{text}',""); + + $add_post_action = $a_forum_url."act=post&code=add&page={$page_n}"; + + $tpl->copy_template = "
    ".$tpl->copy_template." + + + +
    +
    "; + + $tpl->compile('dle_forum'); + $tpl->clear(); + } + + else + { + $group_name = $user_group[$member_id['user_group']]['group_name']; + + forum_msg($f_lang['all_info'], $f_lang['topic_write'], 'user_group', $group_name); + } + + if ($forum_config['forum_bar']) + { + $bbr_fid = $forum_id; + $bbr_fname = $forums_array[$forum_id]['name']; + + $category_id = $forums_array[$forum_id]['main_id']; + + $bbr_cid = $category_id; + $bbr_name = $cats_array[$category_id]['cat_name']; + + $bbr_tid = $tid; + $bbr_tname = $topic_title; + + $bbr_app = $f_lang['app_reply']; + } + + break; + +// ******************************************************************************** +// FORWARD +// ******************************************************************************** + case "forward": + + if ($is_logged) + { + if (!$subaction) + { + $result = $db->super_query("SELECT * FROM " . PREFIX . "_forum_topics WHERE tid = '$tid'"); + + if ($result['tid']) + { + $topic_action_add = $a_forum_url."act=_topic&code=forward&subaction=send&tid={$tid}"; + + $tpl->load_template($tpl_dir.'send_frend.tpl'); + + $topic_link = $a_forum_url."showtopic={$tid}"; + + $tpl->set('{topic_title}', $result['title']); + $tpl->set('{topic_link}', $topic_link); + $tpl->set('{user_name}', $member_id['name']); + + $tpl->copy_template = "
    ".$tpl->copy_template."
    "; + + $tpl->compile('dle_forum'); + $tpl->clear(); + } + + else + { + forum_msg($f_lang['f_msg'], $f_lang['f_404']); + } + } + + else + { + $frend_name = strip_tags(stripslashes($_REQUEST['frend_name'])); + $frend_mail = strip_tags(stripslashes($_REQUEST['frend_mail'])); + $frend_title = strip_tags(stripslashes($_REQUEST['frend_title'])); + $frend_text = strip_tags(stripslashes($_REQUEST['frend_text'])); + + if ($frend_name and $frend_mail and $frend_title and $frend_text) + { + $mail_tpl = $db->super_query("SELECT template FROM " . PREFIX . "_forum_email where name='frend_text' LIMIT 0,1"); + + $mail_tpl['template'] = stripslashes($mail_tpl['template']); + + $mail_result = str_replace("{%username_from%}", $member_id['name'], $mail_tpl['template']); + + $mail_result = str_replace("{%username_to%}", $frend_name, $mail_result); + + $mail_result = str_replace("{%text%}", $frend_text, $mail_result); + + include_once SYSTEM_DIR.'/classes/mail.class.php'; + + $mail = new dle_mail ($config); + + $mail->send ($frend_mail, $frend_title, $mail_result); + + $topic_link = $a_forum_url."showtopic={$tid}"; + + forum_msg($f_lang['f_msg'], $f_lang['mail_send'], "link", $topic_link); + } + + else + { + forum_msg($f_lang['f_msg'], $f_lang['values_error']); + } + } + } + + else + { + $group_name = $user_group[$member_id['user_group']]['group_name']; + + forum_msg($f_lang['f_msg'], $f_lang['page_deny'], "user_group", $group_name); + } + + $bbr_app = $f_lang['title_forward']; + + break; + +// ******************************************************************************** +// PRINT +// ******************************************************************************** + case "print": + + $row_topic = $db->super_query("SELECT * FROM " . PREFIX . "_forum_topics WHERE tid = '$tid'"); + + $forum_id = $row_topic['forum_id']; + + $check_read = check_access($forums_array[$forum_id]['access_read']); + + if ($check_read) + { + if ($row_topic['topic_descr']) + { + $row_topic['title'] = $row_topic['title'].', '.$row_topic['topic_descr']; + } + + $result_posts = $db->query("SELECT p.*, u.* FROM " . PREFIX . "_forum_posts AS p LEFT JOIN " . USERPREFIX . "_users AS u ON p.post_author=u.name WHERE p.topic_id = '$tid' and p.hidden = '0' ORDER by pid"); + + while ($row = $db->get_row($result_posts)) + { + $row['post_date'] = strtotime($row['post_date']); + + $tpl->load_template($tpl_dir.'print/post.tpl'); + + $tpl->set('{author}', $row['post_author']); + + $tpl->set('{post-date}', show_date($row['post_date'])); + + $tpl->set('{text}', $row['post_text']); + + if ($member_id['forum_post'] >= $forum_config['post_hide']) + { + $tpl->set_block("'\[hide\](.*?)\[/hide\]'si","\\1"); + } + else + { + $hide_info = "Внимание! У вас нет прав, для просмотра скрытого текста. Необходимо $forum_config[post_hide] сообщений."; + + $tpl->set_block("'\\[hide\\](.*?)\\[/hide\\]'si","
    ".$hide_info."
    "); + } + + $tpl->compile('posts'); + $tpl->clear(); + } + + if (stristr ($tpl->result['posts'], "[attachment=")) + { + require_once SYSTEM_DIR.'/forum/sources/components/attachment.php'; + } + + $tpl->load_template($tpl_dir.'print/topic.tpl'); + + $tpl->set('{topic_link}', $a_forum_url."showtopic=".$row_topic['tid']); + + $tpl->set('{topic_title}', $row_topic['title']); + + $tpl->set('{post_list}', $tpl->result['posts']); + + $tpl->compile('topic_print'); + $tpl->clear(); + + die ($tpl->result['topic_print']); + } + + else + { + forum_msg($f_lang['f_msg'], $f_lang['f_404']); + } + + break; + +// ******************************************************************************** +// POST REPORT +// ******************************************************************************** + case "report": + + if ($is_logged AND !$forum_config['mod_report']) + { + if (!$subaction) + { + $report_action_add = $a_forum_url."act=_topic&code=report&subaction=add&tid={$tid}&pid={$pid}"; + + $tpl->load_template($tpl_dir.'report.tpl'); + + $tpl->copy_template = "
    ".$tpl->copy_template."
    "; + + $tpl->compile('dle_forum'); + $tpl->clear(); + } + + else + { + $report = strip_tags(stripslashes($_REQUEST['report'])); + + if ($tid AND $pid AND $report) + { + $mail_tpl = $db->super_query("SELECT template FROM " . PREFIX . "_forum_email where name='report_text' LIMIT 0,1"); + + $mail_tpl['template'] = stripslashes($mail_tpl['template']); + + $topic_link = $a_forum_url."showtopic={$tid}"; + + $mail_result = str_replace("{%username_from%}", $member_id['name'], $mail_tpl['template']); + + $mail_result = str_replace("{%text%}", $report, $mail_result); + + $mail_result = str_replace("{%topic_link%}", $topic_link, $mail_result); + + $mail_result = str_replace("{%post_id%}", $pid, $mail_result); + + include_once SYSTEM_DIR.'/classes/mail.class.php'; + + $mail = new dle_mail ($config); + + $mail->send ($config['admin_mail'], "DLE Forum - REPORT", $mail_result); + + forum_msg($f_lang['f_msg'], $f_lang['report_send'], "link", $topic_link); + } + + else + { + forum_msg($f_lang['f_msg'], $f_lang['values_error']); + } + } + } + + else + { + forum_msg($f_lang['f_msg'], $f_lang['f_404']); + } + + break; + + default: + + forum_msg($f_lang['f_msg'], $f_lang['f_404']); + + break; + } + +?> \ No newline at end of file diff --git a/system/forum/ajax/addpost.php b/system/forum/ajax/addpost.php new file mode 100644 index 0000000..c8eebff --- /dev/null +++ b/system/forum/ajax/addpost.php @@ -0,0 +1,59 @@ +dir = ROOT_DIR.'/templates/'.$_REQUEST['skin']; +define('TEMPLATE_DIR', $tpl->dir); + +$name = convert_unicode($_POST['name'], $config['charset']); +$mail = convert_unicode($_POST['mail'], $config['charset']); + +$post_text = trim(convert_unicode($_POST['post_text'], $config['charset'])); + +$topic_title = convert_unicode($_POST['topic_title'], $config['charset']); + +$topic_id = intval($_POST['topic_id']); + +$forum_id = intval($_POST['forum_id']); + +$post_id = $_POST['post_id']; + +$ajax_adds = TRUE; + +$access_mod = array(1); + +require_once SYSTEM_DIR.'/forum/action/addpost.php'; + +$clear_value = "form.post_text.value = '';"; + +if(!$add_post_error){ + +$result_posts = $db->query("SELECT * FROM " . PREFIX . "_forum_posts LEFT JOIN " . USERPREFIX . "_users ON " . PREFIX . "_forum_posts.post_author=" . USERPREFIX . "_users.name WHERE " . PREFIX . "_forum_posts.topic_id = '$topic_id' ORDER BY pid DESC LIMIT 1"); + +$tid = $topic_id; + +require_once SYSTEM_DIR.'/forum/sources/showposts.php'; + +$tpl->result['content'] = "
    ".$tpl->result['posts']."
    "; +$tpl->result['content'] = str_replace('{THEME}', $config['http_home_url'].'templates/'.$_REQUEST['skin'], $tpl->result['content']); + +$tpl->result['content'] .= << +var timeval = new Date().getTime(); +var form = document.getElementById('forum-post-form'); +{$clear_value} + +HTML; + +} + +else +{ + $tpl->result['content'] = ""; +} + +@header("Content-type: text/html; charset=".$config['charset']); +echo $tpl->result['content']; +?> \ No newline at end of file diff --git a/system/forum/ajax/dle_forum.js b/system/forum/ajax/dle_forum.js new file mode 100644 index 0000000..b64f3e5 --- /dev/null +++ b/system/forum/ajax/dle_forum.js @@ -0,0 +1,208 @@ +function ajax_post_edit ( p_id ){ + if ( ! c_cache[ p_id ] || c_cache[ p_id ] == '' ){ + c_cache[ p_id ] = $('#post-id-'+p_id).html(); + } + ShowLoading(''); + $.get( forum_ajax + "editpost.php", { id: p_id, action: "edit" }, function(data){ + HideLoading(''); + RunAjaxJS('post-id-'+p_id, data); + setTimeout(function() { + $("html:not(:animated)"+( ! $.browser.opera ? ",body:not(:animated)" : "")).animate({scrollTop: $("#post-id-" + p_id).offset().top - 70}, 700); + }, 100); + }); + return false; +}; +function ajax_cancel_post_edit( p_id ){ + if ( c_cache[ p_id ] != "" ) + {$("#post-id-"+p_id).html(c_cache[ p_id ]);} + return false; +}; +function ajax_save_post_edit( c_id ){ + var post_txt = ''; + comm_edit_id = c_id; + post_txt = $('#forum_post_'+c_id).val(); + ShowLoading(''); + $.post(forum_ajax + "editpost.php", { id: c_id, post_text: post_txt, action: "save" }, function(data){ + HideLoading(''); + $("#post-id-"+c_id).html(data); + }); + return false; +}; +function doAddPost(){ + var form = document.getElementById('forum-post-form'); + if (form.post_text.value == '' || form.post_text.value == ''){alert ( dle_req_field );return false;} + ShowLoading(''); + $.post(forum_ajax + "addpost.php", { topic_id: form.topic_id.value, forum_id: form.forum_id.value, post_id: form.post_id.value, topic_title: form.topic_title.value, name: form.name.value, mail: form.mail.value, post_text: form.post_text.value, skin: dle_skin }, function(data){ + HideLoading(''); + RunAjaxJS('ajax-post', data); + if (data != 'error' && document.getElementById('blind-animation')) { + $("html"+( ! $.browser.opera ? ",body" : "")).animate({scrollTop: $("#ajax-post").offset().top - 70}, 1100); + setTimeout(function() { $('#blind-animation').show('blind',{},0)}, 0); + } + }); +}; +function postDelete(url){ + var agree=confirm( 'Вы действительно хотите удалить это сообщение?' ); + if (agree) + document.location=url; +}; +function topicDelete(url){ + var agree=confirm( 'Вы действительно хотите удалить эту тему?' ); + if (agree) + document.location=url; +}; +function rowDelete(url){ + var agree=confirm( 'Вы действительно хотите удалить эту запись?' ); + if (agree) + document.location=url; +}; +function TopicMenu( tid, forum_url, moderation ){ +var menu=new Array(); +if (moderation) +{ + menu[0]='Пересчитать все в теме'; +} +menu[1]='Подписка на тему'; +menu[2]='Сообщить другу'; +menu[3]='Версия для печати'; +return menu; +}; +function ForumMenu( fid, moderation, forum_url ){ +var menu=new Array(); +if (moderation){ +menu[0]='Показать все скрытые темы'; +menu[1]='Пересчитать все в форуме'; +} +menu[3]='Активные темы'; +menu[4]='Темы без ответов'; +return menu; +}; +function PostEditMenu( pid, forum_url, page, post_n ){ +var menu=new Array(); +menu[0]='' + menu_short + ''; +menu[1]='' + menu_full + ''; +return menu; +}; +function FUserMenu( url, m_id, group, forum_url ){ +var menu=new Array(); + menu[0]='' + menu_profile + ''; + menu[1]='' + menu_send + ''; + menu[2]='Найти темы пользователя'; + if (group == '1') { + menu[3]='' + menu_uedit + ''; + } +return menu; +}; +function navigation(pages_count, url){ + var page = prompt("Перейти к странице", ""); + if (page) + { + if (pages_count >= page) + { + window.location.href = url + page; + } + } +}; +function PostLink(link){ + url = window.location; + var enterCause = prompt("Копирование прямой ссылки", url + "#post-" + link); +}; +function select_id( sid ){ + var saved = new Array(); + var clean = new Array(); + var add = 1; + tmp = document.modform.selected_id.value; + if( tmp != "" ) + { + saved = tmp.split(","); + } + for( i = 0 ; i < saved.length; i++ ) + { + if ( saved[i] != "" ) + { + if ( saved[i] == sid ) + { + add = 0; + } + else + { + clean[clean.length] = saved[i]; + } + } + } + + if ( add ) + { + clean[ clean.length ] = sid; + } + + newvalue = clean.join(','); + document.modform.selected_id.value = newvalue; +}; +function ShowHide( name, open ){ + if (document.getElementById( name ).style.display != "none") + { + document.getElementById( name ).style.display = "none"; + } + else + { + document.getElementById( name ).style.display = ""; + } + + if (open) + { + document.getElementById( name ).style.display = ""; + } +}; +function PostPreviewCompleted(){ + var post_main_obj = document.getElementById( 'post-preview' ); + var post_box_top = _get_obj_toppos( post_main_obj ); + if ( post_box_top ) + { + scroll( 0, post_box_top - 70 ); + } +}; +function PostPreview(){ + var post_text = ""; + post_text = document.getElementById('forum-post-form').post_text.value; + if (post_text == ''){alert('Заполните все необходимые поля');return false} + ShowLoading(''); + $.post(forum_ajax + "post.preview.php", { post_text: post_text, skin: dle_skin}, function(data){ + HideLoading(''); + $("#post-preview").html(data); + }); +}; +function uploadsform(open_url){ + $("#uploads-form").remove(); + ShowLoading(''); + $.post(forum_ajax + "uploads.form.php", {open_url: open_url}, function(data){ + HideLoading(''); + $("body").append( data ); + $('#uploads-form').dialog({ + autoOpen: true, + width: 470, + buttons: { + "Закрыть": function() { + $(this).dialog("close"); + $("#uploads-form").remove(); + }}}); + }); + return false; +}; +function forum_ins(name){ + var input = document.getElementById('forum-post-form').post_text; + if (dle_txt!= "") + { + input.value += dle_txt; + } + else + { + input.value += "[b]"+name+"[/b],"+"\n"; + } +}; +function CtrlEnter(event, form){ + if((event.ctrlKey) && ((event.keyCode == 0xA)||(event.keyCode == 0xD))) + { + form.submit.click(); + } +}; \ No newline at end of file diff --git a/system/forum/ajax/editpost.php b/system/forum/ajax/editpost.php new file mode 100644 index 0000000..063715d --- /dev/null +++ b/system/forum/ajax/editpost.php @@ -0,0 +1,104 @@ +super_query("SELECT * FROM " . PREFIX . "_forum_posts WHERE pid = $id"); + + if ($id != $row['pid']) die ("error"); + + $topic_id = $row['topic_id']; + + $upload_var = array('area'=>"post", 'forum_id'=>$forum_id, 'topic_id'=>$topic_id, 'post_id'=>$id); + + $ajax_post_id = $id; + + $upload_var['reply'] = "reply"; + + $post_text = $parse->decodeBBCodes($row['post_text'], false); + + $upload_var['bb_width'] = '99%'; + + include_once SYSTEM_DIR.'/forum/sources/components/bbcode.php'; + + $bb_code = str_replace ("{THEME}", $config['http_home_url']."templates/".$config['skin'], $bb_code); + + + $buffer = << +
    {$bb_code}
    +
    +
    + +
    + +HTML; +} + +// ******************************************************************************** +// SAVE POST +// ******************************************************************************** +elseif ($_REQUEST['action'] == "save") +{ + $post_text = trim(convert_unicode($_POST['post_text'], $config['charset'])); + + $post_text = $parse->process($post_text); + + $post_text = $parse->BB_Parse($post_text, FALSE); + + if (!$post_text) die ("error"); + + $post_text = auto_wrap ($post_text); + + if (strlen($post_text) > $forum_config['post_maxlen']) + { + die (""); + } + + $edit_info = ", edit_user = '{$member_id[name]}', edit_time = '{$_TIME}'"; + + $post_text = $db->safesql($post_text); + + $db->query("UPDATE " . PREFIX . "_forum_posts SET post_text = '$post_text' {$edit_info} WHERE pid = $id"); + + $post_text = preg_replace ("'\[hide\](.*?)\[/hide\]'si","\\1", $post_text); + + check_attachment($pid, $post_text); + + if (stristr ($post_text, "[attachment=")) + { + $row = $db->super_query("SELECT * FROM " . PREFIX . "_forum_posts WHERE pid = $id"); + + $tid = $row['topic_id']; + + $ajax_edit_attach = TRUE; + + require_once SYSTEM_DIR.'/forum/sources/components/attachment.php'; + } + + $buffer = stripslashes($post_text); + + $buffer = stripslashes($buffer); +} + +else die ("error"); + +@header("Content-type: text/html; charset=".$config['charset']); +echo $buffer; +?> \ No newline at end of file diff --git a/system/forum/ajax/init.php b/system/forum/ajax/init.php new file mode 100644 index 0000000..061cb38 --- /dev/null +++ b/system/forum/ajax/init.php @@ -0,0 +1,130 @@ +get ("usergroup"); + +if (!$user_group) +{ + $user_group = array (); + + $db->query("SELECT * FROM " . USERPREFIX . "_usergroups ORDER BY id ASC"); + + while ($row = $db->get_row()) + { + $user_group[$row['id']] = array (); + + foreach ($row as $key => $value) + { + $user_group[$row['id']][$key] = $value; + } + } + + $cache->set ("usergroup", $user_group); + + $db->free(); +} + +$config['charset'] = ($lang['charset'] != '') ? $lang['charset'] : $config['charset']; + +require_once SYSTEM_DIR . '/modules/sitelogin.php'; + +if (!$is_logged) +{ + $member_id['user_group'] = 5; +} + +if ($member_id['banned']) +{ + die ("Hacking attempt!"); +} + +if (!function_exists('convert_unicode')) +{ + function decode_to_utf8 ($int=0) + { + $t = ''; + + if ( $int < 0 ) + { + return chr(0); + } + else if ( $int <= 0x007f ) + { + $t .= chr($int); + } + else if ( $int <= 0x07ff ) + { + $t .= chr(0xc0 | ($int >> 6)); + $t .= chr(0x80 | ($int & 0x003f)); + } + else if ( $int <= 0xffff ) + { + $t .= chr(0xe0 | ($int >> 12)); + $t .= chr(0x80 | (($int >> 6) & 0x003f)); + $t .= chr(0x80 | ($int & 0x003f)); + } + else if ( $int <= 0x10ffff ) + { + $t .= chr(0xf0 | ($int >> 18)); + $t .= chr(0x80 | (($int >> 12) & 0x3f)); + $t .= chr(0x80 | (($int >> 6) & 0x3f)); + $t .= chr(0x80 | ($int & 0x3f)); + } + else + { + return chr(0); + } + + return $t; + } + + function convert_unicode ($t, $to = 'windows-1251') + { + $to = strtolower($to); + + if ($to == 'utf-8') { + + $t = preg_replace( '#%u([0-9A-F]{1,4})#ie', "decode_to_utf8(hexdec('\\1'))", utf8_encode($t) ); + $t = urldecode ($t); + + } else { + + $t = preg_replace( '#%u([0-9A-F]{1,4})#ie', "'&#' . hexdec('\\1') . ';'", $t ); + $t = urldecode ($t); + $t = @html_entity_decode($t, ENT_NOQUOTES, $to); + + } + + return $t; + } +} + +$tpl_dir = 'forum/'; + +?> \ No newline at end of file diff --git a/system/forum/ajax/poll.php b/system/forum/ajax/poll.php new file mode 100644 index 0000000..5ba85a8 --- /dev/null +++ b/system/forum/ajax/poll.php @@ -0,0 +1,148 @@ + $value) { + $alldata[] = intval($key).":".intval($value); + } + + $alldata = implode("|", $alldata); + + return $alldata; +} + +function get_votes ($all) { + + $data = array(); + + if ($all != "") { + $all = explode("|", $all); + + foreach ($all as $vote) { + list($answerid, $answervalue) = explode(":", $vote); + $data[$answerid] = intval($answervalue); + } + } + + return $data; +} + + $topic_id = intval($_REQUEST['topic_id']); + $answers = explode(" ", trim($_REQUEST['answer'])); + + $buffer = ""; + $vote_skin = strip_tags($_REQUEST['vote_skin']); + $_IP = $db->safesql($_SERVER['REMOTE_ADDR']); + + if ($is_logged) + $log_id = intval($member_id['user_id']); + else + $log_id = $_IP; + + $poll = $db->super_query("SELECT * FROM " . PREFIX . "_forum_topics WHERE tid = '{$topic_id}'"); + $log = $db->super_query("SELECT COUNT(*) as count FROM " . PREFIX . "_forum_poll_log WHERE topic_id = '{$topic_id}' AND member ='{$log_id}'"); + + if ($log['count'] AND $_REQUEST['action'] != "list") $_REQUEST['action'] = "results"; + $votes = ""; + + if ($_REQUEST['action'] == "vote") { + + $votes = votes ($poll['answer'], $answers); + $db->query("UPDATE ".PREFIX."_forum_topics set answer='$votes', poll_count=poll_count+".count($answers)." WHERE tid = '{$topic_id}'"); + $db->query("INSERT INTO ".PREFIX."_forum_poll_log (topic_id, member) VALUES('{$topic_id}', '$log_id')"); + + $_REQUEST['action'] = "results"; + } + + if ($_REQUEST['action'] == "results") { + + if ($votes == "") {$votes = $poll['answer']; $allcount = $poll['poll_count'];} else { $allcount = count($answers) + $poll['poll_count']; } + + $answer = get_votes ($votes); + $body = explode("
    ", stripslashes($poll['poll_body'])); + $pn = 0; + + for ($i = 0; $i < sizeof($body); $i++) { + + $num = $answer[$i]; + + if (!$num) $num = 0; + + ++$pn; if ($pn > 5) $pn = 1; + + if ($allcount != 0) $proc = (100 * $num) / $allcount; + else $proc = 0; + + $proc = round($proc, 0); + +$buffer .= << +
    +HTML; + + + } + + } + elseif ($_REQUEST['action'] == "list") { + + $body = explode("
    ", stripslashes($poll['poll_body'])); + + if (!$poll['multiple']){ + + for ($v = 0; $v < sizeof($body); $v++) { + if (!$v) $sel = "checked"; else $sel = ""; + +$buffer .= <<
    +HTML; + + } + } else { + + for ($v = 0; $v < sizeof($body); $v++) { + +$buffer .= <<
    +HTML; + + } + + } + + + } else die("error"); + + +@header("Content-type: text/css; charset=".$config['charset']); +echo $buffer; +?> \ No newline at end of file diff --git a/system/forum/ajax/post.preview.php b/system/forum/ajax/post.preview.php new file mode 100644 index 0000000..35988c7 --- /dev/null +++ b/system/forum/ajax/post.preview.php @@ -0,0 +1,38 @@ +dir = ROOT_DIR.'/templates/'.$_REQUEST['skin']; +define('TEMPLATE_DIR', $tpl->dir); + +$config['charset'] = ($lang['charset'] != '') ? $lang['charset'] : $config['charset']; + +$_POST['post_text'] = convert_unicode($_POST['post_text'], $config['charset']); + +$parse = new ParseFilter(Array(), Array(), 1, 1); + +$post_text = $parse->process($_POST['post_text']); + +$post_text = $parse->BB_Parse($post_text, FALSE); + +if( function_exists( "get_magic_quotes_gpc" ) && get_magic_quotes_gpc() ) $post_text = stripslashes( $post_text ); + +$tpl->load_template('forum/msg.tpl'); + +$tpl->set('{title}', "Preview"); +$tpl->set('{msg}', $post_text); + +$tpl->compile('content'); +$tpl->clear(); + +$tpl->result['content'] = str_replace('{THEME}', $config['http_home_url'].'templates/'.$_REQUEST['skin'], $tpl->result['content']); + +@header("Content-type: text/css; charset=".$config['charset']); + +echo $tpl->result['content']; + +?> \ No newline at end of file diff --git a/system/forum/ajax/uploads.form.php b/system/forum/ajax/uploads.form.php new file mode 100644 index 0000000..e47cf34 --- /dev/null +++ b/system/forum/ajax/uploads.form.php @@ -0,0 +1,34 @@ + + $('#uploads-form').dialog({ + autoOpen: true, + width: 470, + buttons: { + "Close": function() { + $(this).dialog("close"); + $("#uploads-form").remove(); + } + } + }); + +HTML; + +$content = << +HTML; + +@header("Content-type: text/html; charset=".$config['charset']); +@header( "Expires: Mon, 26 Jul 1997 05:00:00 GMT" ); +@header( "Last-Modified: " . gmdate( "D, d M Y H:i:s" ) . " GMT" ); +@header( "Cache-Control: no-store, no-cache, must-revalidate" ); +@header( "Cache-Control: post-check=0, pre-check=0", false ); +@header( "Pragma: no-cache" ); + +echo ""; + +?> \ No newline at end of file diff --git a/system/forum/images/post_icons/icon1.gif b/system/forum/images/post_icons/icon1.gif new file mode 100644 index 0000000..cbfdc65 Binary files /dev/null and b/system/forum/images/post_icons/icon1.gif differ diff --git a/system/forum/images/post_icons/icon10.gif b/system/forum/images/post_icons/icon10.gif new file mode 100644 index 0000000..fb65794 Binary files /dev/null and b/system/forum/images/post_icons/icon10.gif differ diff --git a/system/forum/images/post_icons/icon11.gif b/system/forum/images/post_icons/icon11.gif new file mode 100644 index 0000000..5177427 Binary files /dev/null and b/system/forum/images/post_icons/icon11.gif differ diff --git a/system/forum/images/post_icons/icon12.gif b/system/forum/images/post_icons/icon12.gif new file mode 100644 index 0000000..ff88ec7 Binary files /dev/null and b/system/forum/images/post_icons/icon12.gif differ diff --git a/system/forum/images/post_icons/icon13.gif b/system/forum/images/post_icons/icon13.gif new file mode 100644 index 0000000..1d62373 Binary files /dev/null and b/system/forum/images/post_icons/icon13.gif differ diff --git a/system/forum/images/post_icons/icon14.gif b/system/forum/images/post_icons/icon14.gif new file mode 100644 index 0000000..e0424ed Binary files /dev/null and b/system/forum/images/post_icons/icon14.gif differ diff --git a/system/forum/images/post_icons/icon2.gif b/system/forum/images/post_icons/icon2.gif new file mode 100644 index 0000000..8881e76 Binary files /dev/null and b/system/forum/images/post_icons/icon2.gif differ diff --git a/system/forum/images/post_icons/icon3.gif b/system/forum/images/post_icons/icon3.gif new file mode 100644 index 0000000..e853966 Binary files /dev/null and b/system/forum/images/post_icons/icon3.gif differ diff --git a/system/forum/images/post_icons/icon4.gif b/system/forum/images/post_icons/icon4.gif new file mode 100644 index 0000000..acd1fe8 Binary files /dev/null and b/system/forum/images/post_icons/icon4.gif differ diff --git a/system/forum/images/post_icons/icon5.gif b/system/forum/images/post_icons/icon5.gif new file mode 100644 index 0000000..2067f5b Binary files /dev/null and b/system/forum/images/post_icons/icon5.gif differ diff --git a/system/forum/images/post_icons/icon6.gif b/system/forum/images/post_icons/icon6.gif new file mode 100644 index 0000000..c46e720 Binary files /dev/null and b/system/forum/images/post_icons/icon6.gif differ diff --git a/system/forum/images/post_icons/icon7.gif b/system/forum/images/post_icons/icon7.gif new file mode 100644 index 0000000..dce2569 Binary files /dev/null and b/system/forum/images/post_icons/icon7.gif differ diff --git a/system/forum/images/post_icons/icon8.gif b/system/forum/images/post_icons/icon8.gif new file mode 100644 index 0000000..b66c9f1 Binary files /dev/null and b/system/forum/images/post_icons/icon8.gif differ diff --git a/system/forum/images/post_icons/icon9.gif b/system/forum/images/post_icons/icon9.gif new file mode 100644 index 0000000..c75b794 Binary files /dev/null and b/system/forum/images/post_icons/icon9.gif differ diff --git a/system/forum/language/English/admin.lng b/system/forum/language/English/admin.lng new file mode 100644 index 0000000..290b8df --- /dev/null +++ b/system/forum/language/English/admin.lng @@ -0,0 +1,377 @@ + "Welcome to admincp of DLE Forum", +'m_stats' => "Main forum stats", +'m_new_cat' => "Category", +'m_new_cat2' => "Create new category", +'m_new_forum' => "Forum", +'m_new_forum2' => "New forum title", +'m_content' => "Management", +'m_content2' => "Editing, list category and forums", +'m_rank' => "Rank", +'m_rank2' => "Create and edit users rank", +'m_tools' => "Settings", +'m_tools2' => "Settings of main forum function", +'m_discuss' => "Discuss", +'m_discuss2' => "Settings of button - Discuss on forum", +'m_email' => "System Messages", +'m_email2' => "Manage system messages.", +'m_service' => "Service", +'m_service2' => "Forum servise tools", +'m_usergroup' => "User group settings", +'m_usergroup2' => "Manage user group", +'m_help' => "Help", +'m_help2' => "Forum Help", + +'forum_version' => "Version DLE Forum:", +'licence_info' => "Licence type:", +'forum_status' => "Forum_status:", +'forum_topic' => "Forum topics:", +'forum_posts' => "Forum Posts:", +'forum_online' => "Online", +'forum_offline' => "Offline", +'forum_db_size' => "Database size:", +'forum_files' => "Files size:", +'forum_cache' => "Cache size:", +'clear_cache' => "Clear cache", +'check_updates' => "Check for updates", +'msg_updates' => "check updates", +'no_update' => "Cannot connect to the server. Try again later.", + +'cat_new' => "Create Category", +'cat_edit' => "Edit Category", +'cat_name' => "Category title", +'cat_ok_add1' => "Category was created", +'cat_ok_add2' => "Category was successfully created!", +'cat_ok_edit1' => "Category was edited", +'cat_ok_edit2' => "Category was successfully edited!", +'cat_err_name' => "Enter category title!", +'cat_button' => "Create category", + + +'forum_new' => "Create new forum", +'forum_mset' => "Main settings", +'forum_name' => "Forum title", +'forum_descr' => "Forum description", +'forum_cat' => "Category", +'forum_for' => "Subforum ?", +'password' => "Password", +'forum_icon' => "Forum Icon", +'forum_icon_hint' => "Icon prefix.
    f_new_X.gif
    f_nonew_X.gif
    fc_new_X.gif
    fc_nonew_X.gif
    where X prefix.", +'forum_rules' => "Rules", +'forum_rules1' => "Title", +'forum_rules2' => "Text", +'forum_access' => "Access settings", +'forum_ok_add1' => "Forum was created", +'forum_ok_add2' => "Forum was successfully created!", +'forum_err_name' => "Enter forum title", +'forum_button' => "Create forum", + +'forum_edit' => "Edit forum", +'forum_ok_edit1' => "Forum was edited", +'forum_ok_edit2' => "Forum was successfully edited!", + +'java_add_forum' => "Add forum", +'java_sort' => "Sort", +'java_sort_f' => "Sort forums", +'java_edit' => "Edit", +'java_ssort' => "Subforums", +'java_access' => "Access", +'java_moderator' => "Add moderator", +'java_del' => "Delete", + +'access_for_f' => "New access for all forums of this category", + +'access_forum_group' => "Group", +'access_forum_mod' => "Moderation", +'access_forum_topic' => "Topic creation", +'access_forum_write' => "Topic write", +'access_forum_read' => "Topic read", +'access_forum_upload' => "Upload files", +'access_forum_download' => "Download files", + +'titles_main' => "Users rank", +'titles_name' => "User rank", +'titles_pots' => "Required messages", +'titles_pips' => "Stars", +'titles_action' => "Action", +'titles_add' => "Add rank", +'titles_nname' => "Rank title", +'titles_npost' => "Minimum messages", +'titles_npips' => "Total stars", +'titles_edit' => "Edit rank", +'titles_uadd' => "Add rank to user", +'titles_uname' => "User name", +'titles_urname' => "User Rank", +'titles_error_name' => "User with this name not found!", + +'button_add' => "Add", +'button_edit' => "Edit", +'button_save' => "Save", +'button_sort' => "Sort", +'error' => "Error", +'error_x' => "Full all Fields!", +'label_edit' => "edit", +'label_del' => "delete", +'db_prev' => "go back", + +'tools_menu' => "Forum settings", + +'tools_global' => "Forum global settings", +'tools_name' => "Forum Title:", +'tools_name_' => "Example: \"Forum DLE Files Group\"", +'tools_url' => "URL with folder of forum:", +'tools_url_' => "Example: http://forum.dle-files.ru", +'tools_mrewrite' => "Enable search engine friendly URLs?", + +'tools_wysiwyg' => "Enable WYSIWYG editor", +'tools_offline' => "Disable Forum", +'tools_offline_' => "Enable or disable access to your forum.", +'tools_timestamp' => "Time zone offset:", +'tools_timestamp2' => "help on this function", +'tools_sessions' => "register sessions?", +'tools_sessions_' => "It is necessary for modules «Online», «who view forum», «who read topic»...", +'tools_ses_time' => "Time without any action of user", +'tools_ses_time_' => "After this time user status will be set as offline? (in minutesх)", +'tools_stats' => "Enable block with statistic of forum?", + +'tools_online' => "Show Online?", +'tools_online_' => "shows online users.", + +'tools_forum_bar' => "Enable Forumbar?", +'tools_forum_bar_' => "shows user's current location on the forum e.g. category, topic...", + +'tools_show' => "Topics and messages", +'tools_topics' => "Topics limit, in list of forum", +'tools_topics_' => "Default — 25", +'tools_hot' => "Limit of messages in topic", +'tools_hot_' => "Default — 30", +'tools_posts' => "Limit of messages, per topic page", +'tools_posts_' => "Default — 20", + +'tools_mhide' => "Number of messages to view hiden text", +'tools_mhide_' => "To view text between tags [HIDE] [/HIDE].", + +'tools_abc_topic' => "Maximum title simbols", + +'tools_post_update' => "mix messages?", +'tools_post_update2' => "If author of last or new message is the same the new message will be mix with old message and shows like one post .", +'tools_last_plink' => "Link to last topic page", +'tools_last_plink_' => "shows link to last topic page in block last post.", +'tools_hide_forum' => "Hide forums?", +'tools_hide_forum_' => "Hide forums for for one or another group.", +'tools_topic_sort' => "Sort topics by date?", +'tools_topic_sort_' => "Topics will be sort by date of last post.", +'tools_topic_email' => "E-mail notification of new topic creation", + +'tools_pr_imp' => "Pinned Topics prefix", +'tools_pr_vote' => "Topics with vote prefix", +'tools_pr_modr' => "Topics without moderation prefix", +'tools_pr_sub_f' => "Subforum prefix", + + +'tools_safety' => "Safety settings", +'tools_complaint' => "Disable module «Report»?", +'tools_flood' => "Flood control", +'tools_flood_' => "Number of seconds user must wait before being able to post another message. +leave empty to disable.", +'tools_search_captcha' => "Enable security code for search", + +'tools_preventions' => "Warn system", +'tools_prevntn_on' => "Warn", +'tools_prevntn_on_' => "Enable warn system?", +'tools_prevntn_max' => "Maximum warns", +'tools_prevntn_max_' => "Maximun number of warn to block user.", +'tools_prevntn_group' => "Group with disable warn", + +'tools_prevntn_g_show' => "Moderators", +'tools_prevntn_g_show_' => "Usergroup with access to view users warn magazine.", +'tools_prevntn_show' => "Access to user to view warn?", +'tools_prevntn_show_' => "With module enable user cant view warn status.", +'tools_prevntn_show_all' => "Acces to users to view all users warn status?", +'tools_prevntn_show_all_' => "With module enable user cant view all users warn status .", +'tools_prevntn_show_gr' => "Show warn status in group with disable warn?", + +'tools_warn_day' => "Warn limit to one user", +'tools_warn_day2' => "number of warn by moderator in one day.", + +'tools_modules' => "Modules tools", +'tools_mod_icq' => "ICQ status", +'tools_mod_icq_' => "module shows ICQ icon.", +'tools_mod_rank' => "Rank", +'tools_mod_rank_' => "module shows user rank by number of messages.", +'tools_subscr' => "Subscrition", +'tools_subscr_' => "after answer in topic user will receive e-mail.", +'tools_reputation' => "Reputation", +'tools_reputation_' => "Enable users reputation.", +'tools_poll' => "Poll", +'tools_poll_' => "usergroup with access to poll in topics.", +'tools_ses_forum' => "Show who view forum?", + +'tools_ses_topic' => "Show who read topic?", + +'tools_discuss' => "Button 'Discuss in forum'", +'tools_disc_on' => "Enable module", +'tools_disc_on_' => "Enable module «Discuss in forum».", +'tools_disc_title' => "Topic title", +'tools_disc_title_' => "Topic title, what will be created by presing on the button.", +'tools_disc_opt_1' => "News title", +'tools_disc_opt_2' => "Title by template", +'tools_disc_t_tpl' => "Template title", +'tools_disc_t_tpl_' => "example: article: {post_title}", +'tools_disc_post' => "Topic Description", +'tools_disc_post_' => "Topic Description, what will be created by presing on the button.", +'tools_disc_opt_3' => "Short news", +'tools_disc_opt_4' => "Full news", +'tools_disc_opt_5' => "Template", +'tools_disc_p_tpl' => "Template of topic description", +'tools_disc_p_tpl_' => "example: [url={post_link}]{post_title}[/url]
    If field is fill,when wthat text will be main description.", + +'tools_speed' => "Speed tools", +'tools_t_as_p' => "Created topic as user message?", +'tools_t_as_p_' => "if yes, when if user create topic it will be count as message post in user status.", +'tools_sp_num' => "Count number of messages?", +'tools_sp_num_' => "if yes, example, with deleted user topic or message will be recount number of post in user status. if no,when user messages will be count in known time.", +'tools_sp_num_date' => "messages count days", +'tools_sp_num_date_' => "example: one every day.", +'tools_new_t_day' => "Time of active topic", +'tools_new_t_day_' => "After this time without any answer in topic the topic will be old. example: 5 days.", +'tools_sp_sublast' => "Refresh forum with answer in subforums?", +'tools_sp_sublast_' => "shows last post in forum with answer in subforum.", + +'tools_uploads' => "Upload files on server settings", +'tools_upload' => "Enable file uploads on server", +'tools_upload_' => "Usergroup with access to upload any file.", +'tools_upload_type' => "File types to upload", +'tools_upload_type_' => "Enter file types separated by comma.", +'tools_img_upl' => "allow to users upload images", + +'tools_img_max_size' => "Maximum image size", +'tools_img_max_size_' => "Enter maximum image size in kb", +'tools_thumb_size' => "Auto resize large images:", +'tools_thumb_size_' => "Auto resize large images on upload (in Pixels).", +'tools_jpeg_quality' => "JPEG image compression:", +'tools_jpeg_quality_' => "Compression is applied to all uploaded JPEG images.", +'tools_img_width' => "Auto resize linked images", +'tools_img_width_' => "Enter maximum image size for tag [img] [/img], to disable this function enter 0.", + +'tools_licence' => "Licence", +'tools_licence_key' => "Licence key", +'tools_licence_key_' => "Enter Licence key.", +'tools_copyright' => "CopyRight", +'tools_copyright2' => "Show CopyRight?", +'tools_licence_name' => "Show «Registered to...»", +'tools_licence_name_' => "Example: DLE Files Group 2008", + +'t_f_save' => "Settings are saved", +'t_f_save1' => "Settings are successfully saved", + +'mail_subscr' => "E-Mail messages settings, For sibscrition", +'mail_subscr_' => "{%username_to%} - Name
    {%username_from%} - From
    {%topic_name%} - Topic title
    {%topic_link%} - Topic link
    {%topic_link_del%} - Subscrition link", +'mail_frend' => "E-Mail messages settings, Send to friend", +'mail_frend_' => "{%username_to%} - Name
    {%username_from%} - From
    {%text%} - message text", +'mail_report' => "E-Mail messages settings, For reports", +'mail_report_' => "{%username_from%} - Name
    {%text%} - message text
    {%topic_link%} - topic link
    {%post_id%} - message ID
    ", +'mail_new_topic' => "E-Mail messages settings, New topic created", +'mail_new_topic_' => "{%username%} - Topic author
    {%date%} - date of creation
    {%title%} - tpic title
    {%link%} - topic link", + +'email_ok' => "Settings are saved", +'email_ok2' => "Settings are successfully saved!", + +'trial_info' => "Warring!
    You using not activated version of script with limits you must enter the licence key.
    Activation of script on http://dle-files.ru", +'trial_login' => "Login:", +'trial_key' => "Key:", +'trial_act' => "Activate", +'licence_trial' => "Free version", +'licence_full' => "Licence activated", +'trial_limit' => "This trial version of Dle Forum has expired.", + +'group_list' => "Usergroup list", +'group_name' => "Group Name", +'group_users' => "Users", +'group_sel1' => "Edit", +'group_sel2' => "Delete", +'group_sel3' => "Cannot delete", +'group_edit' => "Edit group:", + +'group_colour' => "Group color", +'group_colour_' => "Usergroup color. (example: #CC0000)", + +'group_offline' => "Allow to view offline forum", +'group_post_edit' => "Can edit own posts?", +'group_post_del' => "Can delete own posts?", +'group_topic_set' => "Can open/close own topics?", +'group_topic_edit' => "Can edit own topics?", +'group_topic_del' => "Can delete own topics?", +'group_vote' => "Can poll?", +'group_flood' => "Enable Flood-control to this group?", +'group_html' => "Allow HTML in messages?", +'group_filter' => "Enable to this group word filter?", +'group_moderation' => "Moderation settings", + +'group_edit_ok' => "Edit group", +'group_edit_ok2' => "Group was edited!", + +'mod_edit_topic' => "Can change topics title?", +'mod_del_topic' => "Can delete topics/polls?", +'mod_edit_post' => "Can edit messages?", +'mod_del_post' => "Can delete messages", +'mod_open_topic' => "Can open topics?", +'mod_close_topic' => "Can close topics?", +'mod_move_topic' => "Can move topics?", +'mod_fixed_topic' => "Can pin topics?", +'mod_defixed_topic' => "Can unpin topics?", +'mod_warn_users' => "Can use warn user?", +'mod_multi_moderation' => "Can use multi moderation?", + +'mod_search_user' => "User search", +'mod_search_name' => "Enter username:", +'mod_config_set' => "Moderation settings", + +'mod_add' => "Moderator was added", +'mod_add2' => "Moderator was successfully added!", +'mod_edit_ok' => "Moderator was changed", +'mod_edit_ok2' => "Moderator was successfully changed!", + +'button_search' => "Search", + +'discuss_name' => "Category settings", +'discuss_cat_id' => "Category ID", +'discuss_category' => "Category", +'discuss_forum_id' => "Forum ID", +'discuss_forum' => "Forum", +'discuss_config' => "Topic description settings", +'discuss_t_text' => "Description", + +'svce_full' => "(Leave empty if you want to clean all)", + +'yes' => "Yes", +'no' => "No", + +'button_start' => "Start", + +'activation_send' => "Sending ...", +'trial_act1' => "Cannot connect to the server. Try again later.", +'trial_act2' => "Entered data not correspond to necessary.", +'trial_act3' => "Thank you! Your script was activated", +'trial_act4' => "Server fault Try again later.", + +// add for 2.3 // + +'tools_abc_last' => "The maximum length of the title of the topic in the block «Last Post»", +'tools_abc_last1' => "The maximum permitted length of the title of the topic in the block «Last Post»", +'tools_topic_captcha' => "Security code for a new topic", +'tools_topic_captcha1' => "User groups to which you want to include security code (CAPTCHA). You can select more than one group.", +'tools_post_captcha' => "Security code for new posts", +'tools_post_captcha1' => "User groups to which you want to include security code (CAPTCHA). You can select more than one group.", +'rep_edit_group' => "Moderators reputation", +'rep_edit_group2' => "Groups of users who may log Moderate reputation. You can select more than one group.", +'tools_post_maxlen' => "The maximum number of characters in the message", +'tools_post_maxlen2' => "Specify the maximum number of characters that can polzvatel to use when writing messages in the forum", +'tools_auto_wrap' => "Automatic distribution of long words", +'tools_auto_wrap2' => "In case of exceeding a specified number of characters", + +); + +?> \ No newline at end of file diff --git a/system/forum/language/English/forum.lng b/system/forum/language/English/forum.lng new file mode 100644 index 0000000..4951a8a --- /dev/null +++ b/system/forum/language/English/forum.lng @@ -0,0 +1,117 @@ + "Forum message", +'f_404' => "Reference, is «dead» or deleted. go back", +'page_deny' => "Members, of group {user_group}, cannot view this page.", + +'all_info' => "Information", + +'values_error' => "All fields are required! go back", + +'subforums' => " - подфорумы", + +'forum_read' => "Members, of group {user_group}, cannot view this forum.", +'topic_read' => "Members, of group {user_group}, cannot view this topic.", +'topic_write' => "Members, of group {user_group}, cannot leave post on this forum.", +'forum_down' => "Members, of group {user_group}, cannot download files on this forum.", + +'is_topics' => "
    Not found. it is poseble that in this forum not exist any topic, or the topic are to old and was deleted.
    ", + +'search_nresult' => "The search did not return any results. search again?", +'search_error' => " You have entered less than 4 characters!. search again?", + +'topic_yes' => "With answers", +'topic_no' => "Without answers", +'topic_closed' => "Topic closed", +'last_post' => "Last. post:", + +'mtf_op' => "Option", +'mtf_01' => " - Open", +'mtf_02' => " - Close", +'mtf_03' => " - Delete", +'mtf_05' => " - Move", +'mtf_06' => " - Hide", +'mtf_07' => " - Publish", +'mtf_08' => " - Pin", +'mtf_09' => " - Unpin", + +'time_heute' => "Today", +'time_gestern' => "Yesterday", + +'fs_new' => "There are new messages", +'fs_nonew' => "There are not new messages", + +'fl_topic' => "
    Topic:", +'fl_author' => "
    Author:", +'fl_nopost' => "There are not messages", +'fl_c_forum' => "Closed forum", + +'err_mail' => "E-mail address is incorrect!.", +'err_name' => "You have entered the name of a registered user. If you are this user you must login first.", + +'topic_add_stop' => "Fill out all required fields! {stop} go back", +'topic_add_ndeny' => "Members, of group {user_group}, cannot open topics on this forum.", + +'app_warn' => "Warn", +'app_rep' => "Reputation", +'app_subscr' => "Subscrition", +'app_getnew' => "New Messages", +'app_newtopic' => "New Topic", +'app_reply' => "Reply", +'app_user_topic' => "User topics", +'app_post_edit' => "Edit message", +'app_search' => "Search", + +'search_result' => "Search result", + +'u_log_empty' => "
    User magazine is empty.
    ", + +'f_reply' => "Fast reply", + +'getnew_title' => "Messages sice you last visited", +'all_read_link' => "Read all", + +'subscr_not' => "
    you dont have Subscrition on any topic.
    ", + +'search_result' => "Search result", +'search_topic' => "The search did not return any results. go back", + +'report_send' => "report was successfully send. go back", + +'mail_send' => "mail was successfully send go back", + +'title_forward' => "Send mail to friend", + +'edit_info' => "Message was edited by", + +'err_name' => "
  • Check spelling entered name!
  • ", +'err_mail' => "
  • Check spelling entered e-mail!
  • ", + +'h_post' => "Message hiden", + +'flood_stop' => "Flood protection is active, write your message in {time} seconds. go back", + +'discuss_no_cat' => " choise forum for this category of news. go back", +'discuss_off' => "This function is turned of. to create forum login forum. go back", + +// add for 2.3 // + +'captcha_stop' => "Security code does not match the display! Вернуться назад", +'maxlen_stop' => "The length of the message exceeds the limit! Вернуться назад", +'ajax_stop_1' => "He was activated flood control!", +'ajax_stop_2' => "Security code does not match the display!", +'ajax_stop_3' => "Заполните все необходимые поля!", +'ajax_stop_4' => "The length of the message exceeds the limit!", +'topic_last_p' => "By the last report:", +'last_visit' => "Since returning, the last time you were here", +'reg_name' => "
    Registered to ", + +); + +?> \ No newline at end of file diff --git a/system/forum/language/Russian/admin.lng b/system/forum/language/Russian/admin.lng new file mode 100644 index 0000000..aa2e9cb --- /dev/null +++ b/system/forum/language/Russian/admin.lng @@ -0,0 +1,413 @@ + "Добро пожаловать в админцентр DLE Forum", +'m_stats' => "Общая статистика форума", +'m_new_cat' => "Категория", +'m_new_cat2' => "Создание новой категории", +'m_new_forum' => "Форум", +'m_new_forum2' => "Создание нового форума", +'m_content' => "Управление", +'m_content2' => "Редактирование, сортировка категорий и форумов", +'m_rank' => "Звания", +'m_rank2' => "Создание и редактирование званий пользователей", +'m_tools' => "Настройка", +'m_tools2' => "Настройка общих параметров форума", +'m_discuss' => "Обсудить", +'m_discuss2' => "Настройка кнопки - Обсудить на форуме", +'m_email' => "Шаблоны E-Mail сообщений", +'m_email2' => "Настройка шаблонов E-Mail сообщений, которые отсылает форум.", +'m_service' => "Обслуживание", +'m_service2' => "Инструменты обслуживания форума", +'m_usergroup' => "Настройка групп пользователей", +'m_usergroup2' => "Управление группами пользователей на форуме, назначение прав доступа для этих групп", +'m_help' => "Справка", +'m_help2' => "Помощь и Документация по форуму", + +'forum_version' => "Версия DLE Forum:", +'licence_info' => "Тип лицензии скрипта:", +'forum_status' => "Режим работы форума:", +'forum_topic' => "Общее количество тем:", +'forum_posts' => "Общее количество сообщений:", +'forum_online' => "Включен", +'forum_offline' => "Выключен", +'forum_db_size' => "Общий размер базы данных форума:", +'forum_files' => "Общий размер прикрепленных файлов:", +'forum_cache' => "Общий размер кеша:", +'clear_cache' => "Очистить кеш", +'check_updates' => "Проверить наличие обновлений", +'msg_updates' => "Проверка обновлений", +'no_update' => "Не удалось подключится к удаленному серверу.", + +'cat_new' => "Создание новой категории", +'cat_edit' => "Редактирование категории", +'cat_name' => "Название категории", +'cat_ok_add1' => "Категория создана", +'cat_ok_add2' => "Категория успешно создана!", +'cat_ok_edit1' => "Категория отредактирована", +'cat_ok_edit2' => "Категория успешно отредактирована!", +'cat_err_name' => "Введите название категории!", +'cat_button' => "Создать категорию", + + +'forum_new' => "Создание нового форума", +'forum_mset' => "Основные настройки", +'forum_name' => "Название форума", +'forum_descr' => "Описание форума", +'forum_cat' => "Категория", +'forum_for' => "Подфорум ?", +'password' => "Пароль", +'forum_icon' => "Иконка форума", +'forum_icon_hint' => "Префикс для иконки.
    f_new_X.gif
    f_nonew_X.gif
    fc_new_X.gif
    fc_nonew_X.gif
    Где X префикс.", +'forum_rules' => "Правила", +'forum_rules1' => "Заголовок", +'forum_rules2' => "Текст", +'forum_access' => "Настройки доступа", +'forum_ok_add1' => "Форум создан", +'forum_ok_add2' => "Форум успешно создан!", +'forum_err_name' => "Введите название форума!", +'forum_button' => "Создать форум", + +'forum_edit' => "Редактирование форума", +'forum_ok_edit1' => "Форум отредактирован", +'forum_ok_edit2' => "Форум успешно отредактирован!", + +'java_add_forum' => "Добавить форум", +'java_sort' => "Сортировать", +'java_sort_f' => "Сортировать форумы", +'java_edit' => "Редактировать", +'java_ssort' => "Подфорумы", +'java_access' => "Задать права доступа", +'java_moderator' => "Добавить модератора", +'java_del' => "Удалить", + +'access_for_f' => "Новые права доступа для всех форумов данной категории", + +'access_forum_group' => "Группа", +'access_forum_mod' => "Модерация", +'access_forum_topic' => "Создание тем", +'access_forum_write' => "Ответ в темах", +'access_forum_read' => "Чтение тем", +'access_forum_upload' => "Загрузка файлов", +'access_forum_download' => "Скачивание файлов", + +'titles_main' => "Звания пользователей", +'titles_name' => "Звание посетителя", +'titles_pots' => "Требуется сообщений", +'titles_pips' => "Звездочки", +'titles_action' => "Действие", +'titles_add' => "Добавление звания", +'titles_nname' => "Название звания", +'titles_npost' => "Минимальное количество сообщений ", +'titles_npips' => "Количество звездочек", +'titles_edit' => "Редактирование звания", +'titles_uadd' => "Добавление звания пользователю", +'titles_uname' => "Имя пользователя", +'titles_urname' => "Звание пользователя", +'titles_error_name' => "Пользователь с таким именем не найден!", + +'button_add' => "Добавить", +'button_edit' => "Редактировать", +'button_save' => "Сохранить", +'button_sort' => "Отсортировать", +'error' => "Ошибка", +'error_x' => "Заполните все поля!", +'label_edit' => "правка", +'label_del' => "удалить", +'db_prev' => "Вернуться назад", + +'tools_menu' => "Настройка параметров форума", + +'tools_global' => "Глобальные Настройки форума", +'tools_name' => "Название форума:", +'tools_name_' => "Например: \"Форум DLE Files Group\"", +'tools_url' => "URL к папке с форумом:", +'tools_url_' => "Например: http://forum.dle-files.ru (без слеша)", +'tools_mrewrite' => "Включить ЧПУ?", +'tools_mrewrite_' => "Если 'Да', то ссылки будут иметь вид http://yourdomain.com/forum/topic_1", +'tools_wysiwyg' => "Включить WYSIWYG редактор", +'tools_wysiwyg2' => "Если Да то будет включен WYSIWYG редактор, если нет то будут использоваться BBCODES", +'tools_offline' => "Выключить форум", +'tools_offline_' => "Перевести форум в состояние offline, для проведения технических работ.", +'tools_timestamp' => "Формат времени:", +'tools_timestamp2' => "помощь по работе функции", +'tools_sessions' => "Регистрировать сессии?", +'tools_sessions_' => "Добавляет 1-2 запроса. Необходимо для модулей «Online», «кто просматривает форум», «кто читает тему»...", +'tools_ses_time' => "Период отсутствия активности пользователя", +'tools_ses_time_' => "Через сколько минут считать пользователя в offline? (в минутах)", +'tools_stats' => "Показывать блок со статистикой форума?", +'tools_stats_' => "Показывает блок со статистикой в нижней части главной страницы форума.", + +'tools_online' => "Показывать Online?", +'tools_online_' => "Показывает в блоке со статистикой сколько человек на форуме.", + +'tools_forum_bar' => "Показывать блок с местом положения на форуме?", +'tools_forum_bar_' => "Показывает название категории, форума…", + +'tools_show' => "Темы и Сообщения", +'tools_topics' => "Количество тем, отображаемых в списке тем форума", +'tools_topics_' => "По умолчанию — 25", +'tools_hot' => "Количество сообщений в теме, необходимых для присвоения статуса «горячей»?", +'tools_hot_' => "По умолчанию — 30", +'tools_posts' => "Количество сообщений, размещаемых на одной странице темы", +'tools_posts_' => "По умолчанию — 20", + +'tools_mhide' => "Кол-во сообщений для просмотра скрытого текста", +'tools_mhide_' => "Просмотр текста между тегами [HIDE] [/HIDE].", + +'tools_abc_topic' => "Максимальная длина заголовка тем", +'tools_abc_topic_' => "Максимальная разрешенная длина заголовка тем.", +'tools_post_update' => "Склеивать сообщения?", +'tools_post_update2' => "Если автор последнего и нового сообщения один и тот же, то сообщение склеится.", +'tools_last_plink' => "Ссылка на последнюю страницу темы", +'tools_last_plink_' => "Показывать ссылку на последнюю страницу темы в блоке Последнее сообщение.", +'tools_hide_forum' => "Скрывать форумы?", +'tools_hide_forum_' => "Скрывать форумы не доступные для просмотра определенной группой.", +'tools_topic_sort' => "Сортировать темы по дате?", +'tools_topic_sort_' => "Темы будут сортироваться по дате последнего ответа.", +'tools_topic_email' => "Отсылать E-Mail уведомление при создании темы", +'tools_topic_email_' => "Если 'Да', при создании темы на форуме, на E-Mail модератору будет отправлено соответствующее уведомление.", + +'tools_pr_imp' => "Префикс важных тем", +'tools_pr_imp_' => "Текст, отображаемый перед названием темы с таким статусом. Важная тема всегда в верхней части списка всех тем в форуме.", +'tools_pr_vote' => "Префикс опросов", +'tools_pr_vote_' => "Текст, отображаемый перед названием темы с таким статусом. Все темы, в которых есть опрос, отмечаются так.", +'tools_pr_modr' => "Префикс тем без модерации", +'tools_pr_modr_' => "Текст, отображаемый перед названием темы с таким статусом. Все темы, которые ожидают модерацию, отмечаются так.", +'tools_pr_sub_f' => "Префикс подфорумов", +'tools_pr_sub_f_' => "Текст, отображаемый перед выводом подфорумов.", + +'tools_safety' => "Настройки Безопасности", +'tools_complaint' => "Отключить кнопку «Жалоба»?", +'tools_complaint_' => "Отключить возможность вашим пользователям подавать жалобу о некорректном сообщении.", +'tools_flood' => "Флуд-контроль — интервал в секундах между возможностью публиковать сообщения", +'tools_flood_' => "Время, которое пользователи буду ждать перед возможность опубликовать еще одно сообщение после опубликованного. +Вы можете оставить поле пустым для отключения флуд-контроля.", +'tools_search_captcha' => "Код безопасности для поиска", +'tools_search_captcha_' => "Группы пользователей для которых нужно включить код безопасности (CAPTCHA). Можно выбрать более одной группы.", + +'tools_preventions' => "Система Предупреждений", +'tools_prevntn_on' => "Предупреждения", +'tools_prevntn_on_' => "Включить систему предупреждений?", +'tools_prevntn_max' => "Максимальный уровень предупреждений", +'tools_prevntn_max_' => "Максимальное количество предупреждений для блокировки пользователя.", +'tools_prevntn_group' => "Защищенные группы", +'tools_prevntn_group_' => "Группы пользователей, к которым невозможно применять предупреждения. +Можно выбрать более одной группы.", +'tools_prevntn_g_show' => "Модераторы", +'tools_prevntn_g_show_' => "Группы пользователей, которые могут просматривать журнал предупреждений. Можно выбрать более одной группы.", +'tools_prevntn_show' => "Разрешить пользователям видеть свой уровень предупреждений?", +'tools_prevntn_show_' => "Если включено, то пользователи смогут видеть свой текущий уровень предупреждений.", +'tools_prevntn_show_all' => "Разрешить пользователям видеть чужой уровень предупреждений?", +'tools_prevntn_show_all_' => "Если включено, то пользователи смогут видеть друг у друга уровень предупреждений.", +'tools_prevntn_show_gr' => "Показывать у защищенных групп уровень предупреждений?", +'tools_prevntn_show_gr_' => "Если включено, то у пользователей защищенных групп можно видеть текущий уровень предупреждений.", +'tools_warn_day' => "Предупреждения одному пользователю", +'tools_warn_day2' => "Сколько раз за день модератор может ставить предупреждение одному пользователю?", + +'tools_modules' => "Управление Модулями", +'tools_mod_icq' => "Статус ICQ", +'tools_mod_icq_' => "Модуль показывает статус-картинку пользователя ICQ.", +'tools_mod_rank' => "Звание Rank", +'tools_mod_rank_' => "Модуль показывает звание посетителя на сайте, в зависимости от кол-ва сообщений.", +'tools_subscr' => "Подписка на темы", +'tools_subscr_' => "После ответа в подписанную тему, будет отправлено письмо на e-mail.", +'tools_reputation' => "Репутация", +'tools_reputation_' => "Разрешить посетителям менять друг другу репутацию.", +'tools_poll' => "Опросы", +'tools_poll_' => "Группы пользователей, к которым разрешено создавать опросы в темах. Можно выбрать более одной группы.", +'tools_ses_forum' => "Показывать, кто просматривает форум?", +'tools_ses_forum_' => "Увеличивает количество запросов на 1 при каждом просмотре форума.", +'tools_ses_topic' => "Показывать, кто читает тему?", +'tools_ses_topic_' => "Увеличивает количество запросов на 1 при каждом просмотре темы.", + +'tools_discuss' => "Кнопка 'Обсудить на форуме'", +'tools_disc_on' => "Включить модуль", +'tools_disc_on_' => "Включить модуль «Обсудить на форуме».", +'tools_disc_title' => "Название темы", +'tools_disc_title_' => "Название темы, которая будет создана при нажатии на кнопку.", +'tools_disc_opt_1' => "Название новости", +'tools_disc_opt_2' => "Название по шаблону", +'tools_disc_t_tpl' => "Шаблон названия", +'tools_disc_t_tpl_' => "Например: Статья: {post_title}", +'tools_disc_post' => "Содержание темы", +'tools_disc_post_' => "Содержание темы, которая будет создана при нажатии на кнопку.", +'tools_disc_opt_3' => "Краткая новость", +'tools_disc_opt_4' => "Полная новость", +'tools_disc_opt_5' => "Шаблон", +'tools_disc_p_tpl' => "Шаблон содержания темы", +'tools_disc_p_tpl_' => "Например: [url={post_link}]{post_title}[/url]
    Если поле заполнено, то этот текст будет под основным содержанием.", + +'tools_speed' => "Настройки Быстродействия", +'tools_t_as_p' => "Считать созданную тему за сообщение?", +'tools_t_as_p_' => "Если да, то при создании темы, посетителю прибавиться одно сообщение на форуме.", +'tools_sp_num' => "Вычитать кол-во сообщений сразу?", +'tools_sp_num_' => "Если да, то например, при удалении темы или сообщения будет пересчет кол-ва сообщений у посетителя. Если нет, то подсчет кол-ва сообщений у посетителя будет производиться раз в определенный срок.", +'tools_sp_num_date' => "Срок пересчета сообщений", +'tools_sp_num_date_' => "Через сколько дней пересчитывать кол-во сообщений у посетителя. Например: раз в день.", +'tools_new_t_day' => "Срок активности темы", +'tools_new_t_day_' => "Через сколько дней тема устареет, если посетитель ее не прочитал. Например: 5 дней.", +'tools_sp_sublast' => "Обновлять форум при ответе в подфоруме?", +'tools_sp_sublast_' => "Будет обновляться блок последнее сообщение, при ответе в подфоруме.", + +'tools_uploads' => "Настройка загрузки файлов на сервер", +'tools_upload' => "Разрешить загрузку файлов на сервер", +'tools_upload_' => "Группы пользователей, которым будет разрешена загрузка не только картинок на сервер, но и других файлов.", +'tools_upload_type' => "Расширение файлов, допустимых к загрузке", +'tools_upload_type_' => "Укажите через запятую расширения файлов, которые разрешено закачивать.", +'tools_img_upl' => "Разрешить пользователям загружать картинки", +'tools_img_upl_' => "Вы можете разрешить или запретить пользователям загружать изображения на сервер.", +'tools_img_max_size' => "Максимально допустимый объём изображения", +'tools_img_max_size_' => "Введите максимальный объём загружаемого изображения (в килобайтах)", +'tools_thumb_size' => "Размер уменьшенной копии загруженного изображения:", +'tools_thumb_size_' => "Максимальный размер в пикселях любой из сторон загружаемой картинки при превышении которого будет создаваться уменьшенная копия.", +'tools_jpeg_quality' => "Качество сжатия .jpg изображения:", +'tools_jpeg_quality_' => "Качество сжатия JPEG картинки при копировании на сервер.", +'tools_img_width' => "Автоматическое изменение размера для удаленных изображений", +'tools_img_width_' => "Укажите максимальную ширину картинки для тега [img] [/img], после которой изображение будет пропорционально уменьшено, до указанного размера. Для отключения автоматического уменьшения введите 0.", + +'tools_licence' => "Лицензия", +'tools_licence_key' => "Регистрационный ключ", +'tools_licence_key_' => "Введите Регистрационный ключ.", +'tools_copyright' => "CopyRight", +'tools_copyright2' => "Отображать CopyRight?", +'tools_licence_name' => "Показывать «Зарегистрировано на...»", +'tools_licence_name_' => "Примеры: DLE Files Group 2008", + +'t_f_save' => "Настройки сохранены", +'t_f_save1' => "Настройки системы были успешно сохранены", + +'mail_subscr' => "Настройка E-Mail сообщения, которое отсылается при ответе в подписанную тему", +'mail_subscr_' => "{%username_to%} - имя получателя
    {%username_from%} - имя отправителя
    {%topic_name%} - название темы
    {%topic_link%} - ссылка на тему
    {%topic_link_del%} - ссылка для отписки от темы", +'mail_frend' => "Настройка E-Mail сообщения, которое отсылается при отправке письма другу", +'mail_frend_' => "{%username_to%} - имя получателя
    {%username_from%} - имя отправителя
    {%text%} - текст сообщения", +'mail_report' => "Настройка E-Mail сообщения, которое отсылается при отправке жалобы на сообщение", +'mail_report_' => "{%username_from%} - имя отправителя
    {%text%} - текст сообщения
    {%topic_link%} - ссылка на тему
    {%post_id%} - ID сообщения
    ", +'mail_new_topic' => "Настройка E-Mail сообщения, которое отсылается при создании новой темы", +'mail_new_topic_' => "{%username%} - автор темы
    {%date%} - дата создания
    {%title%} - название темы
    {%link%} - ссылка на тему", + +'email_ok' => "Обновление шаблонов завершено", +'email_ok2' => "Шаблоны для писем успешно обновлены!", + +'trial_info' => "Внимание!
    Вы используете неактивированную версию скрипта для снятия установленных ограничений, вам необходимо ввести ключ активации.
    Активация скрипта проходит на сервере http://dle-files.ru", +'trial_login' => "Логин:", +'trial_key' => "Ключ:", +'trial_act' => "Активировать", +'licence_trial' => "Бесплатная версия", +'licence_full' => "Лицензия активирована", +'trial_limit' => "Были превышены лимиты бесплатной версии скрипта. Дальнейшая работа невозможна.", + +'group_list' => "Список групп пользователей", +'group_name' => "Название группы", +'group_users' => "Пользователей", +'group_sel1' => "Редактировать", +'group_sel2' => "Удалить", +'group_sel3' => "Удалить невозможно", +'group_edit' => "Редактирование группы:", + +'group_colour' => "Цвет группы", +'group_colour_' => "Цвет группы при отображение в списке активных пользователей. (Например: #CC0000)", + +'group_offline' => "Разрешить просмотр отключенного форума?", +'group_post_edit' => "Могут редактировать свои сообщения?", +'group_post_del' => "Могут удалять свои сообщения?", +'group_topic_set' => "Могут открывать/закрывать свои темы?", +'group_topic_edit' => "Могут изменять названия и описания своих тем?", +'group_topic_del' => "Могут удалять свои темы?", +'group_vote' => "Могут голосовать (где разрешено)?", +'group_flood' => "Применять к пользователям данной группы флуд-контроль?", +'group_html' => "Могут использовать HTML в сообщениях?", +'group_filter' => "Применять к пользователям данной группы фильтры плохих слов?", +'group_moderation' => "Настройки модерации", + +'group_edit_ok' => "Редактирование группы", +'group_edit_ok2' => "Изменения в группу успешно внесены!", + +'mod_edit_topic' => "Может изменять название чужих тем?", +'mod_del_topic' => "Может удалять чужие темы/голосования?", +'mod_edit_post' => "Может редактировать чужие сообщения?", +'mod_del_post' => "Может удалять чужие сообщения?", +'mod_open_topic' => "Может открывать темы?", +'mod_close_topic' => "Может закрывать темы?", +'mod_move_topic' => "Может перемещать темы?", +'mod_fixed_topic' => "Может закреплять темы?", +'mod_defixed_topic' => "Может опускать темы?", +'mod_warn_users' => "Может предупреждать других пользователей?", +'mod_multi_moderation' => "Может использовать мульти-модерацию?", + +'mod_search_user' => "Поиск пользователя", +'mod_search_name' => "Введите имя пользователя:", +'mod_config_set' => "Настройки модерации", + +'mod_add' => "Модератор добавлен", +'mod_add2' => "Модератор успешно добавлен!", +'mod_edit_ok' => "Модератор изменен", +'mod_edit_ok2' => "Модератор успешно изменен!", + +'button_search' => "Найти", + +'discuss_name' => "Настройка соответствий категорий", +'discuss_cat_id' => "ID Категории", +'discuss_category' => "Категория", +'discuss_forum_id' => "ID Форума", +'discuss_forum' => "Форум", +'discuss_config' => "Настройка содержания темы", +'discuss_t_text' => "Содержание", + +'svce_full' => "(Оставьте поле пустым, если хотите очистить весь журнал)", + +'yes' => "Да", +'no' => "Нет", + +'button_start' => "Запустить", + +'activation_send' => "Отправка ...", +'trial_act1' => "Не удалось установить подключение к удаленному серверу.", +'trial_act2' => "Введенные данные не соответствуют необходимым.", +'trial_act3' => "Благодарим вас за покупку нашего скрипта!", +'trial_act4' => "Сбой в работе сервера. Повторите попытку позднее.", + +// add for 2.3 // + +'tools_abc_last' => "Максимальная длина названия темы в блоке «Последнее сообщение»", +'tools_abc_last1' => "Максимальная разрешенная длина названия темы в блоке «Последнее сообщение»", +'tools_topic_captcha' => "Код безопасности для новых тем", +'tools_topic_captcha1' => "Группы пользователей для которых нужно включить код безопасности (CAPTCHA). Можно выбрать более одной группы.", +'tools_post_captcha' => "Код безопасности для новых сообщений", +'tools_post_captcha1' => "Группы пользователей для которых нужно включить код безопасности (CAPTCHA). Можно выбрать более одной группы.", +'rep_edit_group' => "Модераторы репутации", +'rep_edit_group2' => "Группы пользователей которые могут модерировать журнал репутации. Можно выбрать более одной группы.", +'tools_post_maxlen' => "Максимальное количество символов в сообщениях", +'tools_post_maxlen2' => "Укажите максимальное количество символов, которое может использовать пользватель при написании сообщений на форуме", +'tools_auto_wrap' => "Автоматическая разбивка длинных слов", +'tools_auto_wrap2' => "В случае превышения заданного числа символов", + +// add for 2.4 // +'forum_posts_conf' => "Настройки сообщений", +'forum_postcount' => "Включить счетчик сообщений?", +'forum_fixpost' => "Закреплять первое сообщение?", +'meta_description' => "Описание (Description) форума:", +'meta_description2' => "Краткое описание, не более 200 символов", +'meta_keywords' => "Ключевые слова (Keywords) для форума:", +'meta_keywords2' => "Введите через запятую основные ключевые слова для вашего форума", +'meta_topic' => "Создавать мета теги для тем:", +'meta_topic2' => "Будут создаваться мета описание и ключевые слова для тем", +'check_updates' => "Проверка обновлений", +'check_updates_start' => "Подождите идет подключение к удаленному серверу ...", + +// add for 2.5 // +'group_youtube' => "Могут использовать тег youtubе?", +'group_youtube2' => "Данный тег предназначен для публикации видео на форуме с таких видеохранилищ как youtube.com и rutube.ru.", +'group_flash' => "Могут использовать тег flash?", +'group_flash2' => "Данный тег предназначен для вставки флеш роликов в формате swf.", +'mod_combining_post' => "Разрешить склеивать сообщения?", +'mod_move_post' => "Разрешить переносить сообщения из одной темы в другую?", +'forum_banner' => "Управление рекламными материалами", +'forum_banner2' => "Код баннера", +'tools_bot_agent' => "Показывать ботов?", +'tools_bot_agent2' => "Регистрировать сессии поисковых ботов.", +'forum_q_reply' => "Отображать форму быстрого ответа?", +'forum_i_edit' => "Отображать информацию о редактирование сообщения?", +); + +?> \ No newline at end of file diff --git a/system/forum/language/Russian/forum.lng b/system/forum/language/Russian/forum.lng new file mode 100644 index 0000000..ab5ce49 --- /dev/null +++ b/system/forum/language/Russian/forum.lng @@ -0,0 +1,123 @@ + "Сообщение форума", +'f_404' => "Ссылка, по которой вы попали на эту страницу является «мертвой» или удаленной. Вернуться назад", +'page_deny' => "Посетители, находящиеся в группе {user_group}, не могут просматривать данную страницу.", + +'all_info' => "Информация", + +'values_error' => "Заполните все необходимые поля! Вернуться назад", + +'subforums' => " - подфорумы", + +'forum_read' => "Посетители, находящиеся в группе {user_group}, не могут просматривать данный форум.", +'topic_read' => "Посетители, находящиеся в группе {user_group}, не могут просматривать данную тему.", +'topic_write' => "Посетители, находящиеся в группе {user_group}, не могут оставлять ответы в данном форуме.", +'forum_down' => "Посетители, находящиеся в группе {user_group}, не могут скачивать файлы из данного форума.", + +'is_topics' => "
    Не найдено ни одной темы. Возможно в этом форуме нет тем, либо они более стары и не соответствуют текущей сортировке.
    ", + +'search_nresult' => "К сожалению, Ваш поиск не дал никаких результатов.
    Попробуйте расширить параметры поиска, используя другое ключевое слово. Повторить поиск?", +'search_error' => " Введено пустое поле для поиска или строка поиска содержит менее 4 символов, в связи с чем поиск был приостановлен. Повторить поиск?", + +'topic_yes' => "Есть ответы", +'topic_no' => "Нет ответов", +'topic_closed' => "Тема закрыта", +'last_post' => "Посл. сообщение:", + +'mtf_op' => "Опции", +'mtf_01' => " - Открыть", +'mtf_02' => " - Закрыть", +'mtf_03' => " - Удалить", +'mtf_05' => " - Переместить", +'mtf_06' => " - Скрыть", +'mtf_07' => " - Опубликовать", +'mtf_08' => " - Закрепить", +'mtf_09' => " - Открепить", + +'time_heute' => "Сегодня", +'time_gestern' => "Вчера", + +'fs_new' => "Есть новые сообщения", +'fs_nonew' => "Нет новых сообщений", + +'fl_topic' => "
    Тема:", +'fl_author' => "
    Автор:", +'fl_nopost' => "Нет сообщений", +'fl_c_forum' => "Закрытый форум", + +'err_mail' => "Вы ввели неверный E-Mail адрес.", +'err_name' => "Вы ввели имя зарегистрированного пользователя. Если Вы есть этот пользователь, то Вам необходимо авторизироваться на сайте.", + +'topic_add_stop' => "Заполните все необходимые поля! {stop} Вернуться назад", +'topic_add_ndeny' => "Посетители, находящиеся в группе {user_group}, не могут открывать темы в данном форуме.", + +'app_warn' => "Предупреждения", +'app_rep' => "Репутация", +'app_subscr' => "Текущие подписки", +'app_getnew' => "Новые сообщения", +'app_newtopic' => "Новая тема", +'app_reply' => "Ответ", +'app_user_topic' => "Темы пользователя", +'app_post_edit' => "Редактирование сообщения", +'app_search' => "Поиск", + +'search_result' => "Результат поиска", + +'u_log_empty' => "
    Журнал пользователя пуст.
    ", + +'f_reply' => "Быстрый ответ", + +'getnew_title' => "Сообщения с Вашего последнего посещения", +'all_read_link' => "Прочитано", + +'subscr_not' => "
    Вы не подписаны ни на одну тему.
    ", + +'search_result' => "Результаты поиска", +'search_topic' => "К сожалению, Ваш поиск не дал никаких результатов. Назад", + +'report_send' => "Жалоба успешно отправлена. Вернуться назад", + +'mail_send' => "Письмо успешно отправлено Вернуться назад", + +'title_forward' => "Отправка письма другу", + +'edit_info' => "Сообщение отредактировал", + +'err_name' => "
  • Проврете правильность ввода имени!
  • ", +'err_mail' => "
  • Проврете правильность ввода e-mail!
  • ", + +'h_post' => "Сообщение скрыто", + +'flood_stop' => "Был активирован флуд-контроль, напишите ваше сообщение через {time} секунд. Назад", + +'discuss_no_cat' => "Для данной категории новостей не задан форум. Вернуться назад", +'discuss_off' => "Данная функция отключена. Для создания темы зайдите на форум. Вернуться назад", + +// add for 2.3 // + +'captcha_stop' => "Код безопасности не соответствует отображённому! Вернуться назад", +'maxlen_stop' => "Длинна сообщения превышает допустимый предел! Вернуться назад", +'ajax_stop_1' => "Был активирован флуд-контроль!", +'ajax_stop_2' => "Код безопасности не соответствует отображённому!", +'ajax_stop_3' => "Заполните все необходимые поля!", +'ajax_stop_4' => "Длинна сообщения превышает допустимый предел!", +'topic_last_p' => "К последнему сообщению:", +'last_visit' => "С возвращением, последний раз вы были здесь:", +'reg_name' => "
    Зарегистрировано на ", + +// add for 2.4 // + +'moderators' => "Модераторы:", +'spoiler_title' => "Показать / Скрыть текст", +'i_quote' => "Цитата:", + +); + +?> \ No newline at end of file diff --git a/system/forum/main.php b/system/forum/main.php new file mode 100644 index 0000000..c488a20 --- /dev/null +++ b/system/forum/main.php @@ -0,0 +1,197 @@ +:]]'"; + }else{ + $access_hide = ""; + } + + $result_content = $db->query("SELECT * FROM " . PREFIX . "_forum_category LEFT JOIN ". PREFIX ."_forum_forums ON ". PREFIX ."_forum_category.sid= ". PREFIX ."_forum_forums.main_id WHERE parentid = '0' {$access_hide} ORDER BY posi, position"); + + for ($i = 0; $row = $db->get_row($result_content); $i = $row['sid']) + { + if ($row['name']) + { + if (!$fcache->open('sub-'.$row['id'])) + { + if ($sub_forums_array != 'empty') + { + foreach ($sub_forums_array as $value) + { + if ($row['id'] == $value['parentid']) + { + $symbol_count++; + + if ($symbol_count > 1) $symbol = ", "; + + $sub_forums .= link_forum($value['id'], $value['name'], $symbol); + } + } + } + + $fcache->save('sub-'.$row['id'], $sub_forums); + } + else { $sub_forums = $fcache->open('sub-'.$row['id']); } + + if (!$fcache->open('moder-'.$row['id'])) + { + foreach ($forum_moderators as $moderators) + { + if ($moderators['forum_id'] == $row['id'] and $moderators['member_name']) + { + $mod_count++; + + if ($mod_count > 1) $mod_symbol = ", "; + + $moderators_list .= $mod_symbol . link_user($moderators['member_name']); + } + } + + $fcache->save('moder-'.$row['id'], $moderators_list); + } + else { $moderators_list = $fcache->open('moder-'.$row['id']); } + + $forum_link = link_forum($row['id'], $row['name']); + + $tpl->load_template($tpl_dir.'forums.tpl'); + + $tpl->set('{forum_id_rss}', $forum_url."/rss/forum_".$row['id'].".xml"); + $tpl->set('{status}', forum_status ($row['f_last_date'], $row['password'], $row['icon'])); + $tpl->set('{name}', $forum_link); + $tpl->set('{description}', stripslashes($row['description'])); + + if ($sub_forums){$tpl->set('{forums}', '
    ' . $forum_config['forum_pr_sub'].' '.$sub_forums); + } else {$tpl->set('{forums}', '');} + if ($moderators_list){$tpl->set('{moderators}', '
    ' . $f_lang['moderators'] . ' ' . $moderators_list); + } else {$tpl->set('{moderators}', '');} + + $tpl->set('{topics}', $row['topics']); + $tpl->set('{post}', $row['posts']); + $tpl->set('{last}', forum_last ($row['f_last_tid'], $row['f_last_title'], $row['f_last_poster_name'], $row['f_last_date'], $row['password'], $row['id'], $row['access_read'], $row['last_post_id'])); + + $tpl->compile("forums_{$row['main_id']}"); + $tpl->clear(); + + unset ($sub_forums); + unset ($symbol_count); + unset ($symbol); + unset ($moderators_list); + unset ($mod_count); + unset ($mod_symbol); + } + + if ($row['sid'] != $start_id){ + $category_link = link_category($start_id, $start_name); + $tpl->load_template($tpl_dir.'category.tpl'); + $tpl->set('{category}', $category_link); + $tpl->set('{forums}', $tpl->result["forums_{$start_id}"]); + $tpl->compile('dle_forum'); + $tpl->clear(); + } + + $start_id = $row['sid']; + $start_name = stripslashes($row['cat_name']); + } + + $category_link = link_category($start_id, $start_name); + + $tpl->load_template($tpl_dir.'category.tpl'); + + $tpl->set('{category}', $category_link); + $tpl->set('{forums}', $tpl->result["forums_{$start_id}"]); + + $tpl->compile('dle_forum'); + $tpl->clear(); + + if ($forum_config['stats']){require_once SYSTEM_DIR.'/forum/sources/modules/stats.php';} + + break; + + case "category": require_once SYSTEM_DIR.'/forum/sources/category.php'; break; + case "forum": require_once SYSTEM_DIR.'/forum/sources/showforum.php'; break; + case "topic": require_once SYSTEM_DIR.'/forum/sources/showtopic.php'; break; + case "add_topic": require_once SYSTEM_DIR.'/forum/action/addtopic.php'; break; + case "getforum": require_once SYSTEM_DIR.'/forum/action/forum.php'; break; + case "getnew": require_once SYSTEM_DIR.'/forum/sources/modules/getnew.php'; break; + case "search": require_once SYSTEM_DIR.'/forum/sources/modules/search.php'; break; + case "subscription": require_once SYSTEM_DIR.'/forum/sources/modules/subscription.php'; break; + case "moderation": require_once SYSTEM_DIR.'/forum/action/moderation.php'; break; + case "post": require_once SYSTEM_DIR.'/forum/action/post.php'; break; + case "_topic": require_once SYSTEM_DIR.'/forum/action/topic.php'; break; + case "user_posts": require_once SYSTEM_DIR.'/forum/sources/shapeshifter/forum_posts.php'; break; + +// ******************************************************************************** +// ATTACHMENT +// ******************************************************************************** + case "attachment": + $file_id = intval($_REQUEST['id']); + if ($file_id) + { + $row = $db->super_query("SELECT * FROM " . PREFIX . "_forum_files WHERE file_id = '$file_id'"); + + if ($row['file_id']) + { + if (count($forums_array)) + { + $access_download = $forums_array[$row['forum_id']]['access_download']; + + if (check_access($access_download)) + { + if ($row['file_type'] == "file"){ + $FILE_DIR = "files"; + } else { + $FILE_DIR = "images"; + } + + $db->query("UPDATE " . PREFIX . "_forum_files SET dcount = dcount+1 WHERE file_id = '$file_id'"); + @header("Location: {$config['http_home_url']}uploads/forum/{$FILE_DIR}/{$row['onserver']}"); + } + else + { + $group_name = $user_group[$member_id['user_group']]['group_name']; + forum_msg($f_lang['f_msg'], $f_lang['forum_down'], 'user_group', $group_name); + } + } + } + else + { + @header("HTTP/1.0 404 Not Found"); + forum_msg($f_lang['f_msg'], $f_lang['f_404']); + } + } + + else + { + @header("HTTP/1.0 404 Not Found"); + forum_msg($f_lang['f_msg'], $f_lang['f_404']); + } + break; + } + + if ($forum_config['forum_bar']) + { + $forum_bar = "".$forum_config['forum_title'].""; + if ($bbr_cid and $bbr_name){$forum_bar .= " » ".link_category($bbr_cid, $bbr_name);} + if ($bbr_fname and $bbr_fid){$forum_bar .= " » ".link_forum($bbr_fid, $bbr_fname);} + if ($bbr_tname and $bbr_tid){$forum_bar .= " » ".link_topic($bbr_tid, $bbr_tname);} + if ($bbr_app){$forum_bar .= " » ".$bbr_app."";} + $forum_bar = stripslashes($forum_bar); + } + + if (!defined('FORUM_SUB_DOMAIN')){require_once SYSTEM_DIR . $compile_php;} + + if ($forum_config['meta_descr'] and !$meta_topic){$metatags['description'] = $forum_config['meta_descr'];} + if ($forum_config['meta_keywords'] and !$meta_topic){$metatags['keywords'] = $forum_config['meta_keywords'];} +?> \ No newline at end of file diff --git a/system/forum/sources/category.php b/system/forum/sources/category.php new file mode 100644 index 0000000..4942559 --- /dev/null +++ b/system/forum/sources/category.php @@ -0,0 +1,142 @@ +:]]'"; + } + else + { + $access_hide = ""; + } + + $category_name = stripslashes($cats_array[$cid]['cat_name']); + + if ($category_name) + { + $result = $db->query("SELECT * FROM ". PREFIX ."_forum_forums WHERE main_id = $cid and parentid = 0 {$access_hide} ORDER by position"); + + while ($row = $db->get_row($result)) + { + if (!$fcache->open('sub-'.$row['id'])) + { + if ($sub_forums_array != 'empty') + { + foreach ($sub_forums_array as $value) + { + if ($row['id'] == $value['parentid']) + { + $symbol_count++; + + if ($symbol_count > 1) $symbol = ", "; + + $sub_forums .= link_forum($value['id'], $value['name'], $symbol); + } + } + } + + $fcache->save('sub-'.$row['id'], $sub_forums); + } + else { $sub_forums = $fcache->open('sub-'.$row['id']); } + + if (!$fcache->open('moder-'.$row['id'])) + { + foreach ($forum_moderators as $moderators) + { + if ($moderators['forum_id'] == $row['id'] and $moderators['member_name']) + { + $mod_count++; + + if ($mod_count > 1) $mod_symbol = ", "; + + $moderators_list .= $mod_symbol . link_user($moderators['member_name']); + } + } + + $fcache->save('moder-'.$row['id'], $moderators_list); + } + else { $moderators_list = $fcache->open('moder-'.$row['id']); } + + $tpl->load_template($tpl_dir.'forums.tpl'); + + $tpl->set('{status}', forum_status ($row['f_last_date'], $row['password'], $row['icon'])); + + $tpl->set('{name}', link_forum($row['id'], $row['name'])); + + $tpl->set('{description}', stripslashes($row['description'])); + + if ($sub_forums) + { + $tpl->set('{forums}', '
    '.$forum_config['forum_pr_sub'].' '.$sub_forums); + } + else { $tpl->set('{forums}', ''); } + + if ($moderators_list) + { + $tpl->set('{moderators}', '
    ' . $f_lang['moderators'] . ' ' . $moderators_list); + } + else { $tpl->set('{moderators}', ''); } + + $tpl->set('{topics}', $row['topics']); + + $tpl->set('{post}', $row['posts']); + + $tpl->set('{forum_id_rss}', $forum_url."/rss/forum_".$row['id'].".xml"); + + $tpl->set('{last}', forum_last ($row['f_last_tid'], $row['f_last_title'], $row['f_last_poster_name'], $row['f_last_date'], $row['password'], $row['id'], $row['access_read'], $row['last_post_id'])); + + $tpl->compile('forums'); + + $tpl->clear(); + + unset ($sub_forums); + + unset ($symbol_count); + + unset ($symbol); + + unset ($moderators_list); + + unset ($mod_count); + + unset ($mod_symbol); + } + + $tpl->load_template($tpl_dir.'category.tpl'); + + $tpl->set('{category}', $category_name); + + $tpl->set('{forums}', $tpl->result['forums']); + + $tpl->compile('dle_forum'); + + $tpl->clear(); + + $metatags['title'] = $forum_config['forum_title'].' » '.$category_name; + + if ($forum_config['forum_bar']) + { + $bbr_cid = $cid; + $bbr_name = $category_name; + } + } + + else + { + @header("HTTP/1.0 404 Not Found"); + + forum_msg($f_lang['f_msg'], $f_lang['f_404']); + } + } + + else + { + @header("HTTP/1.0 404 Not Found"); + + forum_msg($f_lang['f_msg'], $f_lang['f_404']); + } +?> \ No newline at end of file diff --git a/system/forum/sources/components/attachment.php b/system/forum/sources/components/attachment.php new file mode 100644 index 0000000..1343180 --- /dev/null +++ b/system/forum/sources/components/attachment.php @@ -0,0 +1,48 @@ +query("SELECT * FROM " . PREFIX . "_forum_files WHERE topic_id = '$tid' and file_attach = '1'"); + + while ($row = $db->get_row($get_attachment)) + { + if ($row['file_type'] == "image") + { + $img_full = $config['http_home_url'].'uploads/forum/images/'.$row['onserver']; + + $attachment = ""; + } + + elseif ($row['file_type'] == "thumb") + { + $img_full = $config['http_home_url'].'uploads/forum/images/'.$row['onserver']; + + $img_thumb = $config['http_home_url'].'uploads/forum/thumbs/'.$row['onserver']; + + $hs_expand = "onClick=\"return hs.expand(this)\""; + + $attachment = ""; + } + + else + { + $attachment_down = $a_forum_url."act=attachment&id=".$row['file_id']; + + $attachment = "{$row['file_name']} ({$row['dcount']} | ".mksize($row['file_size']).")"; + + //$onserver_url = "{$config['http_home_url']}uploads/forum/files/{$row['onserver']}"; + } + + if (!$ajax_edit_attach){ + $tpl->result['posts'] = str_replace('[attachment='.$row['file_id'].']', $attachment, $tpl->result['posts']); + //$tpl->result['posts'] = preg_replace("#\[attachment={$row['file_id']}:(.*)\]#i", $onserver_url, $tpl->result['posts']); + } + else{ + $post_text = str_replace('[attachment='.$row['file_id'].']', $attachment, $post_text); + //$post_text = preg_replace("#\[attachment={$row['file_id']}:(.*)\]#i", $onserver_url, $post_text); + } + } + +?> \ No newline at end of file diff --git a/system/forum/sources/components/bbcode.php b/system/forum/sources/components/bbcode.php new file mode 100644 index 0000000..b0e4c47 --- /dev/null +++ b/system/forum/sources/components/bbcode.php @@ -0,0 +1,179 @@ +"; + + $smilies = explode(",", $config['smilies']); + foreach($smilies as $smile) + { + $i++; $smile = trim($smile); + + $output .= "\"$smile\""; + + if ($i%3 == 0) $output .= ""; + + } + + $output .= ""; + + if ($ajax_post_id) + { + $ajax_post_id = '_'.$ajax_post_id; + + $addform = "document.forum_post_form".$ajax_post_id; + } + else + { + $addform = "document.getElementById( 'forum-post-form' )"; + } + + $startform = "post_text".$ajax_post_id; + + $add_id = false; + + if ($access_upload AND $forum_config['tools_upload'] OR $access_upload AND $forum_config['img_upload']) + { + $tag_upload = "
    "; + } + +if (!$upload_var['reply']){ + +$code = << +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +{$tag_upload} +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + +HTML; + +} + +else { + +$code = << +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +{$tag_upload} +
    +
    +
    +
    +
    +
    + + +HTML; + +} + +if ( stristr( $_SERVER['REQUEST_URI'], "pages.php" ) ) { + +$script_code = @file_get_contents(SYSTEM_DIR."/ajax/bbcodes.js"); +$script_code .= << + +HTML; + +} else { + +$script_code = << + + +HTML; + +} + +$bb_code = << + + + + + +
    + + + + + + + + + + + + + + + + +
    + + + + + +
    + +
    +
    + + +HTML; + + echo << + + + + + + + + + + + + + + + + + + + + +
    {$lang['v_ftitle']}[?]
    {$lang['vote_title']}[?]
    $lang[vote_body]
    $lang[vote_str_1]
    +
      {$lang['v_multi']}
    + +
    + + + + + + +HTML; + + echo << +   + + + + + +
    +
    + +HTML; + + echofooter(); + +} // ******************************************************************************** +// Do add News +// ******************************************************************************** +elseif( $action == "doaddnews" ) { + include_once SYSTEM_DIR . '/classes/parse.class.php'; + $parse = new ParseFilter( Array (), Array (), 1, 1 ); + + $allow_comm = isset( $_POST['allow_comm'] ) ? intval( $_POST['allow_comm'] ) : 0; + $allow_main = isset( $_POST['allow_main'] ) ? intval( $_POST['allow_main'] ) : 0; + $approve = isset( $_POST['approve'] ) ? intval( $_POST['approve'] ) : 0; + $allow_rating = isset( $_POST['allow_rating'] ) ? intval( $_POST['allow_rating'] ) : 0; + $news_fixed = isset( $_POST['news_fixed'] ) ? intval( $_POST['news_fixed'] ) : 0; + $category = $_POST['category']; + if( ! count( $category ) ) { + $category = array (); + $category[] = '0'; + } + $category_list = array(); + foreach ( $category as $value ) {$category_list[] = intval($value);} + $category_list = $db->safesql( implode( ',', $category ) ); + $allow_list = explode( ',', $user_group[$member_id['user_group']]['cat_add'] ); + foreach ( $category as $selected ) { + if( $allow_list[0] != "all" and ! in_array( $selected, $allow_list ) and $member_id['user_group'] != "1" ) $approve = 0; + } + + if( !$user_group[$member_id['user_group']]['moderation'] ) $approve = 0; + $title = $parse->process( trim( strip_tags ($_POST['title']) ) ); + + $full_story = $parse->process( $_POST['full_story'] ); + $short_story = $parse->process( $_POST['short_story'] ); + $full_story = $db->safesql( $parse->BB_Parse( $full_story, false ) ); + $short_story = $db->safesql( $parse->BB_Parse( $short_story, false ) ); + + if( $parse->not_allowed_text ) { + msg( "error", $lang['addnews_error'], $lang['news_err_39'], "javascript:history.go(-1)" ); + } + + $alt_name = $_POST['alt_name']; + $remote_addr = $_POST['remote_addr']; + + if( trim( $alt_name ) == "" or ! $alt_name ) $alt_name = totranslit( stripslashes( $title ), true, false ); + else $alt_name = totranslit( stripslashes( $alt_name ), true, false ); + + $title = $db->safesql( $title ); + + $metatags = create_metatags( $short_story . $full_story ); + + if( preg_match( "/[\||\'|\<|\>|\"|\!|\?|\$|\@|\/|\\\|\&\~\*\+]/", $_POST['tags'] ) ) $_POST['tags'] = ""; + else $_POST['tags'] = $db->safesql( htmlspecialchars( strip_tags( stripslashes( trim( $_POST['tags'] ) ) ), ENT_QUOTES ) ); + + if ( $_POST['tags'] ) { + $temp_array = array(); + $tags_array = array(); + $temp_array = explode (",", $_POST['tags']); + if (count($temp_array)) {foreach ( $temp_array as $value ) {if( trim($value) ) $tags_array[] = trim( $value );}} + if ( count($tags_array) ) $_POST['tags'] = implode(", ", $tags_array); else $_POST['tags'] = ""; + } + + // обработка опроса + if( trim( $_POST['vote_title'] != "" ) ) { + $add_vote = 1; + $vote_title = trim( $db->safesql( $parse->process( $_POST['vote_title'] ) ) ); + $frage = trim( $db->safesql( $parse->process( $_POST['frage'] ) ) ); + $vote_body = $db->safesql( $parse->BB_Parse( $parse->process( $_POST['vote_body'] ), false ) ); + $allow_m_vote = intval( $_POST['allow_m_vote'] ); + } else $add_vote = 0; + + // обработка доступа + if( $member_id['user_group'] < 3 ) { + $group_regel = array (); + foreach ( $_POST['group_extra'] as $key => $value ) {if( $value ) $group_regel[] = intval( $key ) . ':' . intval( $value );} + if( count( $group_regel ) ) $group_regel = implode( "||", $group_regel ); + else $group_regel = ""; + } else $group_regel = ''; + + // Обработка даты и времени + $added_time = time() + ($config['date_adjust'] * 60); + $newdate = $_POST['newdate']; + + if( $_POST['allow_date'] != "yes" ) { + if( (($newsdate = strtotime( $newdate )) === - 1) or !$newsdate ) {msg( "error", $lang['addnews_error'], $lang['addnews_erdate'], "javascript:history.go(-1)" ); + } else {$thistime = date( "Y-m-d H:i:s", $newsdate );} + if( ! intval( $config['no_date'] ) and $newsdate > $added_time ) {$thistime = date( "Y-m-d H:i:s", $added_time );} + } else $thistime = date( "Y-m-d H:i:s", $added_time ); + //////////////////////////// + + + if( trim( $title ) == "") {msg( "error", $lang['addnews_error'], $lang['addnews_alert'], "javascript:history.go(-1)" );} + if( strlen( $title ) > 255 ) {msg( "error", $lang['addnews_error'], $lang['addnews_error'], "javascript:history.go(-1)" );} + + $db->query( "INSERT INTO " . PREFIX . "_post (date, autor, short_story, full_story, title, descr, keywords, category, alt_name, allow_comm, approve, allow_main, fixed, allow_rate, votes, access, remote_addr, tags, metatitle) values ('$thistime', '{$member_id['name']}', '$short_story', '$full_story', '$title', '{$metatags['description']}', '{$metatags['keywords']}', '$category_list', '$alt_name', '$allow_comm', '$approve', '$allow_main', '$news_fixed', '$allow_rating', '$add_vote', '$group_regel', '$remote_addr', '{$_POST['tags']}', '{$metatags['title']}')" ); + + $row = $db->insert_id(); + + include (system_DIR . '/inc/newsimg/doaddimg.php'); + + if( $add_vote ) { + $db->query( "INSERT INTO " . PREFIX . "_poll (news_id, title, frage, body, votes, multiple) VALUES('{$row}', '$vote_title', '$frage', '$vote_body', 0, '$allow_m_vote')" ); + } + + if( $_POST['tags'] != "" and $approve ) { + $tags = array (); + $_POST['tags'] = explode( ",", $_POST['tags'] ); + foreach ( $_POST['tags'] as $value ) {$tags[] = "('" . $row . "', '" . trim( $value ) . "')";} + $tags = implode( ", ", $tags ); + $db->query( "INSERT INTO " . PREFIX . "_tags (news_id, tag) VALUES " . $tags ); + } + + $db->query( "UPDATE " . PREFIX . "_images set news_id='{$row}' where author = '{$member_id['name']}' AND news_id = '0'" ); + $db->query( "UPDATE " . PREFIX . "_torrents set news_id='{$row}' where author = '{$member_id['name']}' AND news_id = '0'" ); + $db->query( "UPDATE " . PREFIX . "_files set news_id='{$row}' where author = '{$member_id['name']}' AND news_id = '0'" ); + $db->query( "UPDATE " . USERPREFIX . "_users set news_num=news_num+1 where user_id='{$member_id['user_id']}'" ); + + $cache->clear(); + + msg( "info", $lang['addnews_ok'], $lang['addnews_ok_1'] . " \"" . stripslashes( stripslashes( $title ) ) . "\" " . $lang['addnews_ok_2'] ); +} +?> \ No newline at end of file diff --git a/system/inc/blockip.php b/system/inc/blockip.php new file mode 100644 index 0000000..1617fe5 --- /dev/null +++ b/system/inc/blockip.php @@ -0,0 +1,192 @@ +safesql( htmlspecialchars( strip_tags( trim( $_REQUEST['ip_add'] ) ) ) ); else $ip_add = ""; +if( isset( $_REQUEST['ip'] ) ) $ip = htmlspecialchars( strip_tags( trim( $_REQUEST['ip'] ) ) ); else $ip = ""; +if( isset( $_REQUEST['id'] ) ) $id = intval( $_REQUEST['id'] ); else $id = 0; + +if( $action == "add" ) { + if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) {die( "Hacking attempt! User not found" );} + include_once SYSTEM_DIR . '/classes/parse.class.php'; + + $parse = new ParseFilter( ); + $parse->safe_mode = true; + $banned_descr = $db->safesql( $parse->BB_Parse( $parse->process( $_POST['descr'] ), false ) ); + + if( (trim( $_POST['date'] ) == "") or (($_POST['date'] = strtotime( $_POST['date'] )) === - 1) ) { + $this_time = 0; + $days = 0; + } else { + $this_time = $_POST['date']; + $days = 1; + } + + if( ! $ip_add ) {msg( "error", $lang['ip_error'], $lang['ip_error'], "$PHP_SELF?mod=blockip" );} + + $row = $db->super_query( "SELECT id FROM " . PREFIX . "_banned WHERE ip ='$ip_add'" ); + + if ( $row['id'] ) {msg( "error", $lang['ip_error_1'], $lang['ip_error_1'], "$PHP_SELF?mod=blockip" );} + $db->query( "INSERT INTO " . USERPREFIX . "_banned (descr, date, days, ip) values ('$banned_descr', '$this_time', '$days', '$ip_add')" ); + $cache->delete('banned.php'); + +} elseif( $action == "delete" ) { + + if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) {die( "Hacking attempt! User not found" );} + + if( ! $id ) {msg( "error", $lang['ip_error'], $lang['ip_error'], "$PHP_SELF?mod=blockip" );} + + $db->query( "DELETE FROM " . USERPREFIX . "_banned WHERE id = '$id'" ); + $cache->delete('banned.php' ); +} + +echoheader( "", "" ); + +echo << + +
    +
    + + + + + + + + + + + + + + + + +
    + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + +
    {$lang['ip_example']}
    {$lang['ip_type']}
    {$lang['ban_date']} + +
    {$lang['ban_descr']}{$lang['ip_add_descr']}
     
    +
    +
    + + +
    +HTML; + +echo << + + + + + + + + + "; + $bg = ""; $i++; + } + +function makemcDropDown($options, $name, $selected) { + $output = "
    + + + + +
    +
    + + + + + + + + +HTML; + +$db->query( "SELECT * FROM " . USERPREFIX . "_banned WHERE users_id = '0' ORDER BY id DESC" ); + +$i = 0; +while ( $row = $db->get_row() ) { + $i ++; + + if( $row['date'] ) $endban = langdate( "j M Y H:i", $row['date'] ); + else $endban = $lang['banned_info']; + + echo " + + + + + + + + "; +} + +if( $i == 0 ) { + echo " + "; +} + +echo << + + + + + + + + +
     {$lang['ban_date']}{$lang['ban_descr']} 
    + {$row['ip']} + + {$endban} + + " . stripslashes( $row['descr'] ) . " + + [{$lang['ip_unblock']}]
    +


    $lang[ip_empty]

    +

    + +HTML; + +echofooter(); +?> \ No newline at end of file diff --git a/system/inc/categories.php b/system/inc/categories.php new file mode 100644 index 0000000..245a020 --- /dev/null +++ b/system/inc/categories.php @@ -0,0 +1,518 @@ + $posi ) { + if( $posi != "" ) { + $posi = intval( $posi ); + $id = intval( $id ); + $db->query( "UPDATE " . PREFIX . "_category SET posi='{$posi}' WHERE id = '{$id}'" ); + } + } + $cache->delete('category.php'); + header( "Location:$PHP_SELF?mod=categories" ); +} + +// ******************************************************************************** +// Добавление категории +// ******************************************************************************** +if( $action == "add" ) { + + if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) {die( "Hacking attempt! User not found" );} + + $quotes = array ("\x27", "\x22", "\x60", "\t", "\n", "\r" ); + + $cat_name = $db->safesql( htmlspecialchars( strip_tags( stripslashes($_POST['cat_name'] ) ), ENT_QUOTES) ); + $alt_cat_name = totranslit( stripslashes( $_POST['alt_cat_name'] ), true, false ); + + if( ! $cat_name ) {msg( "error", $lang['cat_error'], $lang['cat_ername'], "javascript:history.go(-1)" );} + if( ! $alt_cat_name ) {msg( "error", $lang['cat_error'], $lang['cat_erurl'], "javascript:history.go(-1)" );} + + if ( in_array($_POST['news_sort'], array("date", "rating", "news_read", "title")) ) { + $news_sort = $db->safesql( $_POST['news_sort'] ); + } else $news_sort = ""; + + if ( in_array($_POST['news_msort'], array("ASC", "DESC")) ) { + $news_msort = $db->safesql( $_POST['news_msort'] ); + } else $news_msort = ""; + + if ( $_POST['news_number'] > 0) $news_number = intval( $_POST['news_number'] ); else $news_number = 0; + if ( $_POST['category'] > 0) $category = intval( $_POST['category'] ); else $category = 0; + + $meta_title = $db->safesql( htmlspecialchars ( strip_tags( stripslashes( $_POST['meta_title'] ) ) ) ); + $description = $db->safesql( substr( strip_tags( stripslashes( $_POST['descr'] ) ), 0, 200 ) ); + $keywords = $db->safesql( str_replace( $quotes, " ", strip_tags( stripslashes( $_POST['keywords'] ) ) ) ); + + $row = $db->super_query( "SELECT alt_name FROM " . PREFIX . "_category WHERE alt_name ='{$alt_cat_name}'" ); + if( $row['alt_name'] ) {msg( "error", $lang['cat_error'], $lang['cat_eradd'], "?mod=categories" );} + + $db->query( "INSERT INTO " . PREFIX . "_category (parentid, name, alt_name, descr, keywords, news_sort, news_msort, news_number, metatitle) values ('$category', '$cat_name', '$alt_cat_name', '$description', '$keywords', '$news_sort', '$news_msort', '$news_number', '$meta_title')" ); + + $cache->delete('category.php'); + $cache->clear(); + + msg( "info", $lang['cat_addok'], $lang['cat_addok_1'], "?mod=categories" ); + +} +// ******************************************************************************** +// Удаление категории +// ******************************************************************************** +elseif( $action == "remove" ) { + + if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) {die( "Hacking attempt! User not found" );} + + function DeleteSubcategories($parentid) { + global $db; + + $subcategories = $db->query( "SELECT id FROM " . PREFIX . "_category WHERE parentid = '$parentid'" ); + while ( $subcategory = $db->get_row( $subcategories ) ) { + DeleteSubcategories( $subcategory['id'] ); + $db->query( "DELETE FROM " . PREFIX . "_category WHERE id = '" . $subcategory['id'] . "'" ); + } + } + + if( ! $catid ) { + msg( "error", $lang['cat_error'], $lang['cat_noid'], "$PHP_SELF?mod=categories" ); + } + + $row = $db->super_query( "SELECT count(*) as count FROM " . PREFIX . "_post WHERE category regexp '[[:<:]]($catid)[[:>:]]'" ); + + if( $row['count'] ) { + if( is_array( $_REQUEST['new_category'] ) ) { + if( ! in_array( $catid, $new_category ) ) { + $category_list = $db->safesql( htmlspecialchars( strip_tags( stripslashes( implode( ',', $_REQUEST['new_category']))), ENT_QUOTES ) ); + $db->query( "UPDATE " . PREFIX . "_post set category='$category_list' WHERE category regexp '[[:<:]]($catid)[[:>:]]'" ); + $db->query( "DELETE FROM " . PREFIX . "_category WHERE id='$catid'" ); + DeleteSubcategories( $catid ); + $cache->delete('category.php'); + $cache->clear(); + msg( "info", $lang['cat_delok'], $lang['cat_delok_1'], "?mod=categories" ); + } + } + msg( "info", $lang['all_info'], "
    {$lang['comm_move']}
    ", "$PHP_SELF?mod=categories" ); + } else { + + $db->query( "DELETE FROM " . PREFIX . "_category WHERE id='$catid'" ); + DeleteSubcategories( $catid ); + $cache->delete('category.php' ); + $cache->clear(); + msg( "info", $lang['cat_delok'], $lang['cat_delok_1'], "?mod=categories" ); + } +} +// ******************************************************************************** +// Редактирование категории +// ******************************************************************************** +elseif( $action == "edit" ) { + echoheader( "options", $lang['cat_head'] ); + + $catid = intval( $_GET['catid'] ); + + if( ! $catid ) {msg( "error", $lang['cat_error'], $lang['cat_noid'], "$PHP_SELF?mod=categories" );} + $row = $db->super_query( "SELECT * FROM " . PREFIX . "_category WHERE id = '$catid'" ); + if( ! $row['id'] ) msg( "error", $lang['cat_error'], $lang['cat_noid'], "$PHP_SELF?mod=categories" ); + + $categorylist = CategoryNewsSelection( $row['parentid'], 0 ); + + $row['name'] = stripslashes( preg_replace( array ("'\"'", "'\''" ), array (""", "'" ), $row['name'] ) ); + $row['metatitle'] = stripslashes( preg_replace( array ("'\"'", "'\''" ), array (""", "'" ), $row['metatitle'] ) ); + $row['descr'] = stripslashes( preg_replace( array ("'\"'", "'\''" ), array (""", "'" ), $row['descr'] ) ); + $row['keywords'] = stripslashes( preg_replace( array ("'\"'", "'\''" ), array (""", "'" ), $row['keywords'] ) ); + + $row['news_sort'] = makeDropDown( array ("" => $lang['sys_global'], "date" => $lang['opt_sys_sdate'], "rating" => $lang['opt_sys_srate'], "news_read" => $lang['opt_sys_sview'], "title" => $lang['opt_sys_salph'] ), "news_sort", $row['news_sort'] ); + $row['news_msort'] = makeDropDown( array ("" => $lang['sys_global'], "DESC" => $lang['opt_sys_mminus'], "ASC" => $lang['opt_sys_mplus'] ), "news_msort", $row['news_msort'] ); + + echo << +
    + + + + + + + + + + + + + + + + +
    + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    {$lang['cat_name']}[?]
    {$lang['cat_url']}[?]
    {$lang['meta_title']} ({$lang['meta_descr_max']})
    {$lang['meta_descr_cat']} ({$lang['meta_descr_max']})
    {$lang['meta_keys']}
    {$lang['cat_parent']}
    {$lang['opt_sys_sort']}{$row['news_sort']}
    {$lang['opt_sys_msort']}{$row['news_msort']}
    {$lang['opt_sys_newc']}[?]
      + + + +
    +
    +
    +HTML; + + echofooter(); + die(); + +} +// ******************************************************************************** +// Запись отредактированной категории +// ******************************************************************************** +elseif( $action == "doedit" ) { + + if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) {die( "Hacking attempt! User not found" );} + + $quotes = array ("\x27", "\x22", "\x60", "\t", "\n", "\r", '"' ); + + $cat_name = $db->safesql( htmlspecialchars( strip_tags( stripslashes($_POST['cat_name'] ) ), ENT_QUOTES) ); + $alt_cat_name = totranslit( stripslashes( $_POST['alt_cat_name'] ), true, false ); + + $catid = intval( $_POST['catid'] ); + $parentid = intval( $_POST['parentid'] ); + + $meta_title = $db->safesql( htmlspecialchars ( strip_tags( stripslashes( $_POST['meta_title'] ) ) ) ); + $description = $db->safesql( substr( strip_tags( stripslashes( $_POST['descr'] ) ), 0, 200 ) ); + $keywords = $db->safesql( str_replace( $quotes, " ", strip_tags( stripslashes( $_POST['keywords'] ) ) ) ); + + if ( in_array($_POST['news_sort'], array("date", "rating", "news_read", "title")) ) { + $news_sort = $db->safesql( $_POST['news_sort'] ); + } else $news_sort = ""; + + if ( in_array($_POST['news_msort'], array("ASC", "DESC")) ) { + $news_msort = $db->safesql( $_POST['news_msort'] ); + } else $news_msort = ""; + + if ( $_POST['news_number'] > 0)$news_number = intval( $_POST['news_number'] ); else $news_number = 0; + if( ! $catid ) {msg( "error", $lang['cat_error'], $lang['cat_noid'], "$PHP_SELF?mod=categories" );} + if( $cat_name == "" ) {msg( "error", $lang['cat_error'], $lang['cat_noname'], "javascript:history.go(-1)" );} + + $row = $db->super_query( "SELECT id, alt_name FROM " . PREFIX . "_category WHERE alt_name = '$alt_cat_name'" ); + + if( $row['id'] and $row['id'] != $catid ) { + msg( "error", $lang['cat_error'], $lang['cat_eradd'], "javascript:history.go(-1)" ); + } + + if( in_array( $parentid, get_sub_cats( $catid ) ) ) { + msg( "error", $lang['cat_error'], $lang['cat_noparentid'], "$PHP_SELF?mod=categories" ); + } + + $db->query( "UPDATE " . PREFIX . "_category set parentid='$parentid', name='$cat_name', alt_name='$alt_cat_name', descr='$description', keywords='$keywords', news_sort='$news_sort', news_msort='$news_msort', news_number='$news_number', metatitle='$meta_title' WHERE id='$catid'" ); + + $cache->delete('category.php' ); + $cache->clear(); + + msg( "info", $lang['cat_editok'], $lang['cat_editok_1'], "$PHP_SELF?mod=categories" ); +} +// ******************************************************************************** +// List all Categories +// ******************************************************************************** +echoheader( "options", $lang['cat_head'] ); + +$categorylist = CategoryNewsSelection( 0, 0 ); + +echo << +
    + + + + + + + + + + + + + + + + +
    + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    {$lang['cat_name']}[?]
    {$lang['cat_url']}[?]
    {$lang['meta_title']} ({$lang['meta_descr_max']})
    {$lang['meta_descr_cat']} ({$lang['meta_descr_max']})
    {$lang['meta_keys']}
    {$lang['cat_parent']}
    {$lang['opt_sys_sort']}
    {$lang['opt_sys_msort']}
    {$lang['opt_sys_newc']}[?]
      + + +
    +
    +
    +HTML; + +if( ! count( $cat_info ) ) { + + echo << + + + + + + + + + + + + + + + + +
    + + + + +
    +
    + + + + +
    {$lang['cat_nocat']}
    +
    + +HTML; + +} else { + + function DisplayCategories($parentid = 0, $sublevelmarker = '') { + global $lang, $cat_info, $config, $dle_login_hash; + + // start table + if( $parentid == 0 ) { + + echo << +
    + + + + + + + + + + + + + + + + +
    + + + + +
    +
    + + + + + + + + + + + +HTML; + + } else { + $sublevelmarker .= '--'; + } + + if( count( $cat_info ) ) { + + foreach ( $cat_info as $cats ) { + if( $cats['parentid'] == $parentid ) $root_category[] = $cats['id']; + } + + if( count( $root_category ) ) { + + foreach ( $root_category as $id ) { + + $category_name = $cat[$id]; + + if( $config['allow_alt_url'] == "yes" ) $link = "" . stripslashes( $cat_info[$id]['name'] ) . ""; + else $link = "" . stripslashes( $cat_info[$id]['name'] ) . ""; + + echo " + + + + + + + "; + + DisplayCategories( $id, $sublevelmarker ); + } + } + } + + // end table + if( $parentid == 0 ) { + + echo << + + +
    IDPosition{$lang['cat_cat']}{$lang['cat_url']}{$lang['cat_action']}
     " . $cat_info[$id]['id'] . " $sublevelmarker " . $link . ""; + if( $cat_info[$id]['alt_name'] != "" ) { + echo $cat_info[$id]['alt_name']; + } else { + echo "---"; + } + echo "[$lang[cat_ed]] [$lang[cat_del]]
    +
    +
    +HTML; + + } + } + + DisplayCategories(); +} + +echofooter(); +?> \ No newline at end of file diff --git a/system/inc/chat.php b/system/inc/chat.php new file mode 100644 index 0000000..cb7f5ad --- /dev/null +++ b/system/inc/chat.php @@ -0,0 +1,476 @@ + +
    + $title
    $description +
    + $field +
    + + + + + + + + + +
    + +
    +
    + + + + + + +
    ГлавнаяНастройкиЧистка чатаColor Ника
    +HTML; +} + +if (isset($url)) { + $url = rawurldecode($_GET['url']); + $url = @base64_decode($url); + $url = str_replace("&" , "&", $url); + + $_SERVER['HTTP_REFERER'] = reset_url($_SERVER['HTTP_REFERER']); + $_SERVER['HTTP_HOST'] = reset_url($_SERVER['HTTP_HOST']); + + if (($_SERVER['HTTP_HOST'] != $_SERVER['HTTP_REFERER']) OR $url == "") { @header('Location: /index.php'); die ("Access denied!!!

    Please visit {$_SERVER['HTTP_HOST']}"); } + @header('Location: '.$url); + die ("Link Redirect:

    Please click here."); +} + +if ($action == ""){ +echoheader("chat", $lang['opt_mchatc']); +chatmenu (); +if(!intval($chat_per_page)){ $chat_per_page = 30; } + +if (!isset($start_from)) $start_from = 0; + +if(!$user_group[$member_db[1]]['allow_all_edit'] AND $member_db[1] != 1) $author = $member_db[2]; + +$sql = "SELECT * FROM " . PREFIX . "_chat ORDER BY date DESC LIMIT $start_from,$chat_per_page"; +$db->query($sql); + if($start_from == "0"){ $start_from = ""; } + $i = $start_from; + $entries_showed = 0; +$entries = ""; +while($row = $db->get_array()){ $i++; + +$itemdate = date($chatconfig['timestampa'],strtotime($row['date'])); +$row['message'] = $parse->BB_Parse($parse->process(urldecode(stripcslashes($row['message'])))); + +$entries .= "$itemdate - "; +$entries .= "".$row['message'].""; +$entries .= "".$row['name']." + + "; +$entries_showed ++; +if($i >= $chat_per_page + $start_from){ break; } +} +$query_count = "SELECT COUNT(*) as count from " . PREFIX . "_chat"; +$result_count = $db->super_query($query_count); +$all_count = $result_count['count']; + +echo << + + +JSCRIPT; + +echo<< +
    + + + + + + + + + + "; + $entries_showed ++; + + if( $i >= $news_per_page + $start_from ) { + break; + } + } + + + // End prelisting + $result_count = $db->super_query( "SELECT COUNT(*) as count FROM " . PREFIX . "_post" . $where ); + + $all_count_news = $result_count['count']; + + /////////////////////////////////////////// + // Options Bar + $category_list = CategoryNewsSelection( $search_cat, 0, false ); + + echo << + + + + + + +
    + +
    + + + + + +
    + +{$entries} + +HTML; + +$npp_nav =""; + +if($start_from > 0) +{ + $previous = $start_from - $chat_per_page; + $npp_nav .= "<< $lang[edit_prev]"; +} +if($all_count > $chat_per_page){ + $npp_nav .= " [ "; + $enpages_count = @ceil($all_count/$chat_per_page); + $enpages_start_from = 0; + $enpages = ""; + for($j=1;$j<=$enpages_count;$j++){ + if($enpages_start_from != $start_from){ $enpages .= "$j "; } + else{ $enpages .= " $j "; } + $enpages_start_from += $chat_per_page; + } + $npp_nav .= $enpages; + $npp_nav .= " ] "; + } +if($all_count > $i) +{ + $how_next = $all_count - $i; + if($how_next > $chat_per_page){ $how_next = $chat_per_page; } + $npp_nav .= "$lang[edit_next] $how_next >>"; +} +if($entries_showed != 0){ +echo<< +HTML; +} + +echo<< +
      Сообщение + {$lang['edit_autor']} + +
    $npp_nav + + + +
    +HTML; + +echo << +
    + + + + + + + + +
    + +
    + + +
    {$lang_mc['mc_mess_page']}
    +
    +HTML; +echofooter(); +///--- Настройка скрипта ---/// +}elseif ($action == "configs"){ +echoheader("chat", $lang_mc['mc_conf']); +chatmenu (); +echo << +
    + + + + + + + + + + + + +
    + + +
    +
    + +HTML; + + showmcRow($lang_mc['mc_guest'], $lang_mc['mc_guestc'], makemcDropDown(array("yes"=>$lang['opt_sys_yes'],"no"=>$lang['opt_sys_no']), "save_con[guest]", "{$chatconfig['guest']}")); + showmcRow($lang_mc['mc_showdate'], $lang_mc['mc_showdatec'], makemcDropDown(array("yes"=>$lang['opt_sys_yes'],"no"=>$lang['opt_sys_no']), "save_con[show_date]", "{$chatconfig['show_date']}")); + showmcRow($lang_mc['mc_limitb'], $lang_mc['mc_limitbc'], ""); + showmcRow($lang_mc['mc_limit'], $lang_mc['mc_limitc'], ""); + showmcRow($lang_mc['mc_sc'], $lang_mc['mc_sc'], ""); + showmcRow($lang_mc['mc_timestamp'], "$lang[opt_sys_and]", ""); + showmcRow($lang_mc['mc_timestampa'], "$lang[opt_sys_and]", ""); + showmcRow($lang_mc['mc_smail'], $lang_mc['mc_smailb'], ""); + showmcRow($lang_mc['mc_refresh'], $lang_mc['mc_refreshc'], ""); + showmcRow($lang['opt_sys_aw'], $lang['opt_sys_awd'], ""); + showmcRow($lang_mc['mc_colornik'], $lang_mc['mc_colornikc'], makemcDropDown(array("yes"=>$lang['opt_sys_yes'],"no"=>$lang['opt_sys_no']), "save_con[color_nik]", "{$chatconfig['color_nik']}")); + +echo << +
    + + +
    +HTML; +echofooter(); +///--- Настройка скрипта end ---/// + +///--- Чистка чата ---/// +}elseif ($action == "trun"){ +echoheader("chat", $lang_mc['mc_trunс']); +chatmenu (); +echo << +
    + + + + + + + + + + + + +
    + + +
    +
    + + + + + +
    {$lang_mc['mc_trun']}
    +   + +
    +HTML; +echofooter(); +} +///--- Чистка чата end ---/// + +elseif($action == "mess_del"){ +echoheader("chat", $lang_mc['chatc']); +echo << +
    + + + + + + + + + + +
    + +
    +
    {$lang_mc['mass_confirm']} +HTML; + +echo "(".count($selected_mess).") сообщения

    +   + +"; +foreach($selected_mess as $id){ +echo "\n"; +} + +echo <<
    +HTML; +echofooter(); +exit; +///--- Add Message end ---/// +}elseif($action == "messedit"){ +echoheader("chat", $lang_mc['chatc']); +chatmenu (); +$row = $db->super_query("SELECT * FROM " . PREFIX . "_chat WHERE id = '$id'"); +$messtext = $parse->decodeBBCodes($row['message']); +echo << +
    + + + + + + + + +
    + +
    +HTML; + +include(SYSTEM_DIR.'/inc/include/inserttag.php'); + +echo << +HTML; + +echo <<
    {$bb_code}
    + + + +

    +
    +HTML; +echofooter(); +}elseif($action == "color"){ +echoheader("chat", $lang_mc['chatc']); +chatmenu (); +echo << +
    + + + + + + + + + + + + +
    + + +
    +
    + +HTML; + + showmcRow('1:', $lang_mc['mc_color1'], "", ""); + showmcRow('2:', $lang_mc['mc_color2'], "", ""); + showmcRow('3:', $lang_mc['mc_color3'], "", ""); + +echo << +
    + + + +
    +HTML; +echofooter(); +}elseif($action == "do_mess_edit"){ +$aeditmess = $db->safesql($parse->BB_Parse(parse_mcsmiles($parse->process($_POST['aeditmess'])))); +$result = $db->query("UPDATE " . PREFIX . "_chat SET message='$aeditmess' WHERE id='$id'"); +@header("Location: $PHP_SELF?mod=chat"); +}elseif($action == "do_mess_del"){ +$deleted_message = 0; +foreach ($selected_mess as $id){ +$id = intval($id); +$db->query("DELETE FROM " . PREFIX . "_chat WHERE id='$id'"); +$deleted_message ++; +$db->free(); } +if(count($selected_mess) == $deleted_message){ msg("info", $lang['word_ldel'], $lang_mc['mc_mess_delok'], "$PHP_SELF?mod=chat"); } +else{ msg("error", $lang_mc['mc_mess_notok'], "$deleted_message $lang[mass_i] ".count($selected_mess)." $lang[mass_notok_1]", "$PHP_SELF?mod=chat"); } +}elseif($action == "doaddmess") { +$amess = $db->safesql($parse->BB_Parse(parse_mcsmiles($parse->process($_POST['amess'])))); +$name = "Admin"; +$ip = $db->safesql($_SERVER['REMOTE_ADDR']); +$date = date ("Y-m-d H:i:s", time()+($config['date_adjust']*60)); + +if ($amess == "") msg("error",$lang['static_err'],$lang['static_err_1'], "javascript:history.go(-1)"); + +$db->query("INSERT INTO ".PREFIX."_chat (name, message, date, ip, `mgroup`, user_id) VALUES ('$name', '$amess', '$date', '$ip', '', '')"); +header("Location: $PHP_SELF?mod=chat&action=doaddmessok"); +}elseif($action == "doaddmessok"){ +msg("info", $lang_mc['mc_addmssok'], "$lang[mc_addmssok]

    $lang[db_prev]"); +}elseif($action == "dotrun") { +$db->query("TRUNCATE " . PREFIX . "_chat"); +header("Location: $PHP_SELF?mod=chat"); +}elseif($action == "dosaveconfigs") +{ + $find[] = "'\r'"; + $replace[] = ""; + $find[] = "'\n'"; + $replace[] = ""; + + $save_con = $save_con + $chatconfig; + + if($member_id['user_group'] != 1){ msg("error", $lang_p['opt_denied'], $lang_p['opt_denied']); } + $handler = fopen(SYSTEM_DIR.'/data/chat.config.php', "w"); + fwrite($handler, " $value) + { + $value=trim(stripslashes ($value)); + $value=htmlspecialchars ($value, ENT_QUOTES); + $value = preg_replace($find,$replace,$value); + fwrite($handler, "'{$name}' => \"{$value}\",\n\n"); + } + fwrite($handler, ");\n\n?>"); + fclose($handler); + + $cache->clear(); + msg("info", $lang['opt_sysok'], "$lang[opt_sysok_1]

    $lang[db_prev]"); +} +?> diff --git a/system/inc/clean.php b/system/inc/clean.php new file mode 100644 index 0000000..e665970 --- /dev/null +++ b/system/inc/clean.php @@ -0,0 +1,101 @@ +query("SHOW TABLE STATUS FROM `".DBNAME."`"); + $mysql_size = 0; + while ($r = $db->get_array()) { + if (strpos($r['Name'], PREFIX."_") !== false) + $mysql_size += $r['Data_length'] + $r['Index_length'] ; + } +$db->free(); + +$lang['clean_all'] = str_replace ('{datenbank}', ''.mksize($mysql_size).'', $lang['clean_all']); + +echoheader("", ""); + +echo << + + + + + +
    + + + + + + + + + + + + + + + + +
    + + + + +
    +
    + + + + +
    +

    {$lang['clean_all']}



    + +
    +
    +
    +
    +HTML; + + +echofooter(); +?> \ No newline at end of file diff --git a/system/inc/editnews.php b/system/inc/editnews.php new file mode 100644 index 0000000..3b26cdb --- /dev/null +++ b/system/inc/editnews.php @@ -0,0 +1,1292 @@ +safesql( trim( htmlspecialchars( $_REQUEST['author'] ) ) ); else $author = ""; +if( isset( $_REQUEST['ifdelete'] ) ) $ifdelete = $_REQUEST['ifdelete']; else $ifdelete = ""; +if( isset( $_REQUEST['news_fixed'] ) ) $news_fixed = $_REQUEST['news_fixed']; else $news_fixed = ""; +if( isset( $_REQUEST['search_cat'] ) ) $search_cat = intval( $_REQUEST['search_cat'] ); else $search_cat = ""; + +include_once SYSTEM_DIR . '/classes/parse.class.php'; + +$parse = new ParseFilter( Array (), Array (), 1, 1 ); + +if( $action == "list" ) { + + $_SESSION['admin_referrer'] = $_SERVER['REQUEST_URI']; + echoheader( "editnews", $lang['edit_head'] ); + + $search_field = $db->safesql( trim( htmlspecialchars( stripslashes( urldecode( $_REQUEST['search_field'] ) ), ENT_QUOTES ) ) ); + $search_author = $db->safesql( trim( htmlspecialchars( stripslashes( urldecode( $_REQUEST['search_author'] ) ), ENT_QUOTES ) ) ); + $fromnewsdate = $db->safesql( trim( htmlspecialchars( stripslashes( $_REQUEST['fromnewsdate'] ), ENT_QUOTES ) ) ); + $tonewsdate = $db->safesql( trim( htmlspecialchars( stripslashes( $_REQUEST['tonewsdate'] ), ENT_QUOTES ) ) ); + + $start_from = intval( $_REQUEST['start_from'] ); + $news_per_page = intval( $_REQUEST['news_per_page'] ); + $gopage = intval( $_REQUEST['gopage'] ); + + $_REQUEST['news_status'] = intval( $_REQUEST['news_status'] ); + $news_status_sel = array ('0' => '', '1' => '', '2' => '' ); + $news_status_sel[$_REQUEST['news_status']] = 'selected="selected"'; + + if( ! $news_per_page or $news_per_page < 1 ) { + $news_per_page = 50; + } + if( $gopage ) $start_from = ($gopage - 1) * $news_per_page; + + if( $start_from < 0 ) $start_from = 0; + + $where = array (); + + if( ! $user_group[$member_id['user_group']]['allow_all_edit'] and $member_id['user_group'] != 1 ) { + $where[] = "autor = '{$member_id['name']}'"; + } + + if( $search_field != "" ) { + $where[] = "(short_story like '%$search_field%' OR title like '%$search_field%' OR full_story like '%$search_field%')"; + } + + if( $search_author != "" ) { + $where[] = "autor like '$search_author%'"; + } + + if( $search_cat != "" ) { + if ($search_cat == -1) $where[] = "category = '' OR category = '0'"; + else $where[] = "category regexp '[[:<:]]($search_cat)[[:>:]]'"; + } + + if( $fromnewsdate != "" ) { + $where[] = "date >= '$fromnewsdate'"; + } + + if( $tonewsdate != "" ) { + $where[] = "date <= '$tonewsdate'"; + } + + if( $_REQUEST['news_status'] == 1 ) $where[] = "approve = '1'"; + elseif( $_REQUEST['news_status'] == 2 ) $where[] = "approve = '0'"; + + if( count( $where ) ) { + $where = implode( " AND ", $where ); + $where = " WHERE " . $where; + } else { + $where = ""; + } + + $order_by = array (); + + if( $_REQUEST['search_order_f'] == "asc" or $_REQUEST['search_order_f'] == "desc" ) $search_order_f = $_REQUEST['search_order_f']; + else $search_order_f = ""; + if( $_REQUEST['search_order_m'] == "asc" or $_REQUEST['search_order_m'] == "desc" ) $search_order_m = $_REQUEST['search_order_m']; + else $search_order_m = ""; + if( $_REQUEST['search_order_d'] == "asc" or $_REQUEST['search_order_d'] == "desc" ) $search_order_d = $_REQUEST['search_order_d']; + else $search_order_d = ""; + if( $_REQUEST['search_order_t'] == "asc" or $_REQUEST['search_order_t'] == "desc" ) $search_order_t = $_REQUEST['search_order_t']; + else $search_order_t = ""; + + if( ! empty( $search_order_f ) ) { + $order_by[] = "fixed $search_order_f"; + } + if( ! empty( $search_order_m ) ) { + $order_by[] = "approve $search_order_m"; + } + if( ! empty( $search_order_d ) ) { + $order_by[] = "date $search_order_d"; + } + if( ! empty( $search_order_t ) ) { + $order_by[] = "title $search_order_t"; + } + + $order_by = implode( ", ", $order_by ); + if( ! $order_by ) $order_by = "fixed desc, approve asc, date desc"; + + $search_order_fixed = array ('----' => '', 'asc' => '', 'desc' => '' ); + if( isset( $_REQUEST['search_order_f'] ) ) { + $search_order_fixed[$search_order_f] = 'selected'; + } else { + $search_order_fixed['desc'] = 'selected'; + } + $search_order_mod = array ('----' => '', 'asc' => '', 'desc' => '' ); + if( isset( $_REQUEST['search_order_m'] ) ) { + $search_order_mod[$search_order_m] = 'selected'; + } else { + $search_order_mod['asc'] = 'selected'; + } + $search_order_date = array ('----' => '', 'asc' => '', 'desc' => '' ); + if( isset( $_REQUEST['search_order_d'] ) ) { + $search_order_date[$search_order_d] = 'selected'; + } else { + $search_order_date['desc'] = 'selected'; + } + $search_order_title = array ('----' => '', 'asc' => '', 'desc' => '' ); + if( ! empty( $search_order_t ) ) { + $search_order_title[$search_order_t] = 'selected'; + } else { + $search_order_title['----'] = 'selected'; + } + + $db->query( "SELECT id, date, title, category, autor, alt_name, comm_num, approve, fixed, news_read, remote_addr FROM " . PREFIX . "_post" . $where . " ORDER BY " . $order_by . " LIMIT $start_from,$news_per_page" ); + + // Prelist Entries + if( $start_from == "0" ) { + $start_from = ""; + } + $i = $start_from; + $entries_showed = 0; + + $entries = ""; + + while ( $row = $db->get_array() ) { + + $i ++; + + $itemdate = date( "d.m.Y", strtotime( $row['date'] ) ); + + if( strlen( $row['title'] ) > 65 ) $title = substr( $row['title'], 0, 65 ) . " ..."; + else $title = $row['title']; + + $title = htmlspecialchars( stripslashes( $title ), ENT_QUOTES ); + $title = str_replace("&","&", $title ); + + $entries .= "
    + $itemdate - "; + + if( $row['fixed'] == '1' ) $entries .= "$lang[edit_fix] "; + + if( $row['comm_num'] > 0 ) { + + $full_link = $config['http_home_url'] . $row['id'] . "-" . $row['alt_name'] . ".html"; + + $comm_link = "{$row['comm_num']}"; + + } else { + $comm_link = $row['comm_num']; + } + + $entries .= "$title + {$row['news_read']}" . $comm_link; + + $entries .= ""; + + if( $row['approve'] ) $erlaub = "$lang[edit_yes]"; + else $erlaub = "$lang[edit_no]"; + $entries .= $erlaub; + + $entries .= ""; + + if( ! $row['category'] ) $my_cat = "---"; + else { + + $my_cat = array (); + $cat_list = explode( ',', $row['category'] ); + + foreach ( $cat_list as $element ) { + if( $element ) $my_cat[] = $cat[$element]; + } + $my_cat = implode( ',
    ', $my_cat ); + } + + $entries .= "$my_cat
    " . $row['autor'] . " + + + +
    + + + + + + + + + + + + + + + +
    + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    {$lang['edit_search_news']}{$lang['search_by_author']}
    {$lang['edit_cat']}{$lang['search_by_date']}{$lang['edit_fdate']} + + {$lang['edit_tdate']} + +
    {$lang['search_by_status']}{$lang['edit_page']}
    {$lang['news_order']}
    {$lang['news_order_fixed']}{$lang['edit_approve']}{$lang['search_by_date']}{$lang['edit_et']}
    + + + +
      + +
    +
    +
    + +HTML; + // End Options Bar + + + echo << + + +JSCRIPT; + + if( $entries_showed == 0 ) { + + echo << + + + + + + + + + + + + + + + + +
    + + + + + +
    {$lang['news_advanced_search']}
    +
    + + + + +
    {$lang['edit_nonews']}
    +
    +
    +HTML; + + } else { + + echo << + +
    +
    + + + + + + + + + +
    + + + + + +
    {$lang['news_advanced_search']}
    +
    + + + + + + + + + + +
    + + + + + {$entries} + +HTML; + + // pagination + + $npp_nav = "
    "; + + if( $start_from > 0 ) { + $previous = $start_from - $news_per_page; + $npp_nav .= "<< "; + } + + if( $all_count_news > $news_per_page ) { + + $enpages_count = @ceil( $all_count_news / $news_per_page ); + $enpages_start_from = 0; + $enpages = ""; + + if( $enpages_count <= 10 ) { + + for($j = 1; $j <= $enpages_count; $j ++) { + + if( $enpages_start_from != $start_from ) { + + $enpages .= "$j "; + + } else { + + $enpages .= "$j "; + } + + $enpages_start_from += $news_per_page; + } + + $npp_nav .= $enpages; + + } else { + + $start = 1; + $end = 10; + + if( $start_from > 0 ) { + + if( ($start_from / $news_per_page) > 4 ) { + + $start = @ceil( $start_from / $news_per_page ) - 3; + $end = $start + 9; + + if( $end > $enpages_count ) { + $start = $enpages_count - 10; + $end = $enpages_count - 1; + } + + $enpages_start_from = ($start - 1) * $news_per_page; + + } + + } + + if( $start > 2 ) { + + $enpages .= "1 ... "; + + } + + for($j = $start; $j <= $end; $j ++) { + + if( $enpages_start_from != $start_from ) { + + $enpages .= "$j "; + + } else { + + $enpages .= "$j "; + } + + $enpages_start_from += $news_per_page; + } + + $enpages_start_from = ($enpages_count - 1) * $news_per_page; + $enpages .= "... $enpages_count "; + + $npp_nav .= $enpages; + + } + + } + + if( $all_count_news > $i ) { + $how_next = $all_count_news - $i; + if( $how_next > $news_per_page ) { + $how_next = $news_per_page; + } + $npp_nav .= ">>"; + } + + $npp_nav .= "
    "; + + // pagination + + + if( $entries_showed != 0 ) { + echo << + +HTML; + + if( $all_count_news > $news_per_page ) { + + echo << +HTML; + + } + + } + + echo << + + +
      {$lang['edit_title']} +  {$lang['st_views']}  +  {$lang['edit_com']}  + {$lang['edit_approve']} + {$lang['edit_cl']} + {$lang['edit_autor']} + +
    {$npp_nav}
    + + + + +
    +{$lang['edit_go_page']} +
    +
    + +HTML; + + } + + echofooter(); +} + +// ******************************************************************************** +// Показ новости и редактирование +// ******************************************************************************** +elseif( $action == "editnews" ) { + $id = intval( $_GET['id'] ); + $row = $db->super_query( "SELECT * FROM " . PREFIX . "_post where id = '$id'" ); + + $found = FALSE; + + if( $id == $row['id'] ) $found = TRUE; + if( ! $found ) {msg( "error", $lang['cat_error'], $lang['edit_nonews'] );} + + $cat_list = explode( ',', $row['category'] ); + + $have_perm = 0; + + if( $user_group[$member_id['user_group']]['allow_edit'] and $row['autor'] == $member_id['name'] ) { + $have_perm = 1; + } + + if( $user_group[$member_id['user_group']]['allow_all_edit'] ) { + $have_perm = 1; + $allow_list = explode( ',', $user_group[$member_id['user_group']]['cat_add'] ); + + foreach ( $cat_list as $selected ) { + if( $allow_list[0] != "all" and !in_array( $selected, $allow_list ) AND $row['approve']) $have_perm = 0; + } + } + + if( ($member_id['user_group'] == 1) ) { + $have_perm = 1; + } + + if( ! $have_perm ) { + msg( "error", $lang['addnews_denied'], $lang['edit_denied'], "$PHP_SELF?mod=editnews&action=list" ); + } + + $row['title'] = $parse->decodeBBCodes( $row['title'], false ); + $row['title'] = str_replace("&","&", $row['title'] ); + $row['descr'] = $parse->decodeBBCodes( $row['descr'], false ); + $row['keywords'] = $parse->decodeBBCodes( $row['keywords'], false ); + $row['metatitle'] = stripslashes( $row['metatitle'] ); + + $row['short_story'] = $parse->decodeBBCodes( $row['short_story'], false ); + $row['full_story'] = $parse->decodeBBCodes( $row['full_story'], false ); + + $access = permload( $row['access'] ); + + if( $row['votes'] ) { + $poll = $db->super_query( "SELECT * FROM " . PREFIX . "_poll where news_id = '{$row['id']}'" ); + $poll['title'] = $parse->decodeBBCodes( $poll['title'], false ); + $poll['frage'] = $parse->decodeBBCodes( $poll['frage'], false ); + $poll['body'] = $parse->decodeBBCodes( $poll['body'], false ); + $poll['multiple'] = $poll['multiple'] ? "checked" : ""; + } + + echoheader( "editnews", $lang['edit_head'] ); + + echo " + "; + + echo "
    "; + + $categories_list = CategoryNewsSelection( $cat_list, 0 ); + if( $config['allow_multi_category'] ) $category_multiple = "class=\"cat_select\" multiple"; + else $category_multiple = ""; + + if( $member_id['user_group'] == 1 ) { + $author_info = ""; + } else { + $author_info = "{$row['autor']}"; + } + + + if ( $user_group[$member_id['user_group']]['admin_editusers'] ) { + $author_info .= " "; + } + + + echo << + + + + +
    + + + + + + + + + + + + + + + +
    + + + + +
    +
    +
    + +HTML; + + echo << + + + + + + + + + + + + + + + + + + + + +
    {$lang['v_ftitle']}[?]
    {$lang['vote_title']}[?]
    $lang[vote_body]
    $lang[vote_str_1]
    +
      {$lang['v_multi']}
    + +
    + + + + +
    +   +   + + + + + +
    +HTML; + + echo << +
    +
    +HTML; + + echofooter(); +} +// ******************************************************************************** +// Сохранение или удаление новости +// ******************************************************************************** +elseif( $action == "doeditnews" ) { + + $id = intval( $_GET['id'] ); + + $allow_comm = isset( $_POST['allow_comm'] ) ? intval( $_POST['allow_comm'] ) : 0; + $allow_main = isset( $_POST['allow_main'] ) ? intval( $_POST['allow_main'] ) : 0; + $approve = isset( $_POST['approve'] ) ? intval( $_POST['approve'] ) : 0; + $allow_rating = isset( $_POST['allow_rating'] ) ? intval( $_POST['allow_rating'] ) : 0; + $news_fixed = isset( $_POST['news_fixed'] ) ? intval( $_POST['news_fixed'] ) : 0; + $category = $_POST['category']; + if( ! count( $category ) ) { + $category = array (); + $category[] = '0'; + } + $category_list = array(); + foreach ( $category as $value ) {$category_list[] = intval($value);} + $category_list = $db->safesql( implode( ',', $category ) ); + + $allow_list = explode( ',', $user_group[$member_id['user_group']]['cat_add'] ); + foreach ( $category as $selected ) {if( $allow_list[0] != "all" and ! in_array( $selected, $allow_list ) and $member_id['user_group'] != 1 ) $approve = 0;} + + if( !$user_group[$member_id['user_group']]['moderation'] ) $approve = 0; + + $title = $parse->process( trim( strip_tags ($_POST['title']) ) ); + + $full_story = $parse->process( $_POST['full_story'] ); + $short_story = $parse->process( $_POST['short_story'] ); + + $full_story = $db->safesql( $parse->BB_Parse( $full_story, false ) ); + $short_story = $db->safesql( $parse->BB_Parse( $short_story, false ) ); + + if( $parse->not_allowed_text ) { + msg( "error", $lang['addnews_error'], $lang['news_err_39'], "javascript:history.go(-1)" ); + } + + if( trim( $title ) == "" and $ifdelete != "yes" ) msg( "error", $lang['cat_error'], $lang['addnews_ertitle'], "javascript:history.go(-1)" ); + if( strlen( $title ) > 255 ) {msg( "error", $lang['cat_error'], $lang['addnews_ermax'], "javascript:history.go(-1)" );} + + if( trim( $_POST['alt_name'] ) == "" or ! $_POST['alt_name'] ) $alt_name = totranslit( stripslashes( $title ) ); + else $alt_name = totranslit( stripslashes( $_POST['alt_name'] ) ); + + $remote_addr = $_POST['remote_addr']; + + $title = $db->safesql( $title ); + $metatags = create_metatags( $short_story . $full_story ); + + $catalog_url = $db->safesql( substr( htmlspecialchars( strip_tags( stripslashes( trim( $_POST['catalog_url'] ) ) ) ), 0, 3 ) ); + + if( preg_match( "/[\||\'|\<|\>|\"|\!|\?|\$|\@|\/|\\\|\&\~\*\+]/", $_POST['tags'] ) ) $_POST['tags'] = ""; + else $_POST['tags'] = $db->safesql( htmlspecialchars( strip_tags( stripslashes( trim( $_POST['tags'] ) ) ), ENT_QUOTES ) ); + + if ( $_POST['tags'] ) { + $temp_array = array(); + $tags_array = array(); + $temp_array = explode (",", $_POST['tags']); + if (count($temp_array)) { + foreach ( $temp_array as $value ) { + if( trim($value) ) $tags_array[] = trim( $value ); + }} + if ( count($tags_array) ) $_POST['tags'] = implode(", ", $tags_array); else $_POST['tags'] = ""; + } + + // обработка опроса + if( trim( $_POST['vote_title'] != "" ) ) { + $add_vote = 1; + $vote_title = trim( $db->safesql( $parse->process( $_POST['vote_title'] ) ) ); + $frage = trim( $db->safesql( $parse->process( $_POST['frage'] ) ) ); + $vote_body = $db->safesql( $parse->BB_Parse( $parse->process( $_POST['vote_body'] ), false ) ); + $allow_m_vote = intval( $_POST['allow_m_vote'] ); + } else $add_vote = 0; + + // обработка доступа + if( $member_id['user_group'] < 3 and $ifdelete != "yes" ) { + $group_regel = array (); + foreach ( $_POST['group_extra'] as $key => $value ) { + if( $value ) $group_regel[] = intval( $key ) . ':' . intval( $value ); + } + if( count( $group_regel ) ) $group_regel = implode( "||", $group_regel ); + else $group_regel = ""; + } else $group_regel = ''; + + $no_permission = FALSE; + $okdeleted = FALSE; + $okchanges = FALSE; + + $db->query( "SELECT id, title, autor, category, approve, tags FROM " . PREFIX . "_post where id = '$id'" ); + + while ( $row = $db->get_row() ) { + $item_db[0] = $row['id']; + $item_db[1] = $row['autor']; + $item_db[2] = $row['tags']; + $item_db[3] = $row['approve']; + $item_db[4] = $db->safesql( $row['title'] ); + $item_db[5] = explode( ',', $row['category'] ); + } + + $db->free(); + + if( $item_db[0] ) { + $have_perm = 0; + if( $user_group[$member_id['user_group']]['allow_all_edit'] ) $have_perm = 1; + if( $user_group[$member_id['user_group']]['allow_edit'] and $item_db[1] == $member_id['name'] ) {$have_perm = 1;} + + if( $ifdelete == "yes" ) { + $allow_list = explode( ',', $user_group[$member_id['user_group']]['cat_add'] ); + foreach ( $item_db[5] as $selected ) {if( $allow_list[0] != "all" AND !in_array($selected, $allow_list) ) $have_perm = 0;} + if( !$user_group[$member_id['user_group']]['moderation']) {$have_perm = 0; + }} + + if( ($member_id['user_group'] == 1) ) {$have_perm = 1;} + + if( $have_perm ) { + + if( $ifdelete != "yes" ) { + $okchanges = TRUE; + + // Обработка даты и времени + $added_time = time() + ($config['date_adjust'] * 60); + $newdate = $_POST['newdate']; + + if( $_POST['allow_date'] != "yes" ) { + if( $_POST['allow_now'] == "yes" ) $thistime = date( "Y-m-d H:i:s", $added_time ); + elseif( (($newsdate = strtotime( $newdate )) === - 1) or !$newsdate ) { + msg( "error", $lang['cat_error'], $lang['addnews_erdate'], "javascript:history.go(-1)" ); + } else { + $thistime = date( "Y-m-d H:i:s", $newsdate ); + + if( ! intval( $config['no_date'] ) and $newsdate > $added_time ) { + $thistime = date( "Y-m-d H:i:s", $added_time ); + } + } + + $result = $db->query( "UPDATE " . PREFIX . "_post set title='$title', date='$thistime', short_story='$short_story', full_story='$full_story', descr='{$metatags['description']}', keywords='{$metatags['keywords']}', category='$category_list', alt_name='$alt_name', allow_comm='$allow_comm', approve='$approve', allow_main='$allow_main', allow_rate='$allow_rating', fixed='$news_fixed', votes='$add_vote', access='$group_regel', remote_addr='$remote_addr', editdate='$added_time', tags='{$_POST['tags']}', metatitle='{$metatags['title']}' WHERE id='$item_db[0]'" ); + } else { + $result = $db->query( "UPDATE " . PREFIX . "_post set title='$title', short_story='$short_story', full_story='$full_story', descr='{$metatags['description']}', keywords='{$metatags['keywords']}', category='$category_list', alt_name='$alt_name', allow_comm='$allow_comm', approve='$approve', allow_main='$allow_main', allow_rate='$allow_rating', fixed='$news_fixed', votes='$add_vote', access='$group_regel', remote_addr='$remote_addr', editdate='$added_time', tags='{$_POST['tags']}', metatitle='{$metatags['title']}' WHERE id='$item_db[0]'" ); + } + + include (SYSTEM_DIR . '/inc/newsimg/doeditimg.php'); + + if( $add_vote ) { + $count = $db->super_query( "SELECT COUNT(*) as count FROM " . PREFIX . "_poll WHERE news_id = '$item_db[0]'" ); + if( $count['count'] ) $db->query( "UPDATE " . PREFIX . "_poll set title='$vote_title', frage='$frage', body='$vote_body', multiple='$allow_m_vote' WHERE news_id = '$item_db[0]'" ); + else $db->query( "INSERT INTO " . PREFIX . "_poll (news_id, title, frage, body, votes, multiple) VALUES('$item_db[0]', '$vote_title', '$frage', '$vote_body', 0, '$allow_m_vote')" ); + } else { + $db->query( "DELETE FROM " . PREFIX . "_poll WHERE news_id='$item_db[0]'" ); + $db->query( "DELETE FROM " . PREFIX . "_poll_log WHERE news_id='$item_db[0]'" ); + } + + // Смена автора публикации + if( $member_id['user_group'] == 1 and $_POST['new_author'] != $_POST['old_author'] ) { + $_POST['new_author'] = $db->safesql( $_POST['new_author'] ); + $row = $db->super_query( "SELECT user_id FROM " . USERPREFIX . "_users WHERE name = '{$_POST['new_author']}'" ); + if( $row['user_id'] ) { + + $db->query( "UPDATE " . PREFIX . "_post SET autor='{$_POST['new_author']}' WHERE id='$item_db[0]'" ); + $db->query( "UPDATE " . PREFIX . "_images SET author='{$_POST['new_author']}' WHERE news_id='$item_db[0]'" ); + $db->query( "UPDATE " . PREFIX . "_files SET author='{$_POST['new_author']}' WHERE news_id='$item_db[0]'" ); + $db->query( "UPDATE " . PREFIX . "_torrents SET author='{$_POST['new_author']}' WHERE news_id='$item_db[0]'" ); + + $db->query( "UPDATE " . USERPREFIX . "_users SET news_num=news_num+1 where user_id='{$row['user_id']}'" ); + $db->query( "UPDATE " . USERPREFIX . "_users SET news_num=news_num-1 where name='$item_db[1]'" ); + } else { + msg( "error", $lang['addnews_error'], $lang['edit_no_author'], "javascript:history.go(-1)" ); + } + } + + // Облако тегов + if( $_POST['tags'] != $item_db[2] or $approve != $item_db[3] ) { + $db->query( "DELETE FROM " . PREFIX . "_tags WHERE news_id = '$item_db[0]'" ); + if( $_POST['tags'] != "" and $approve ) { + $tags = array (); + $_POST['tags'] = explode( ",", $_POST['tags'] ); + foreach ( $_POST['tags'] as $value ) { + $tags[] = "('" . $item_db[0] . "', '" . trim( $value ) . "')"; + } + $tags = implode( ", ", $tags ); + $db->query( "INSERT INTO " . PREFIX . "_tags (news_id, tag) VALUES " . $tags ); + } + } + + } else { + + $db->query( "DELETE FROM " . PREFIX . "_post WHERE id='$item_db[0]'" ); + $db->query( "DELETE FROM " . PREFIX . "_comments WHERE post_id='$item_db[0]'" ); + $db->query( "DELETE FROM " . PREFIX . "_poll WHERE news_id='$item_db[0]'" ); + $db->query( "DELETE FROM " . PREFIX . "_poll_log WHERE news_id='$item_db[0]'" ); + $db->query( "DELETE FROM " . PREFIX . "_rate WHERE type_id='$item_db[0]' AND type=1" ); + $db->query( "DELETE FROM " . PREFIX . "_tags WHERE news_id = '$item_db[0]'" ); + $db->query( "UPDATE " . USERPREFIX . "_users set news_num=news_num-1 where name='$item_db[1]'" ); + + $okdeleted = TRUE; + + $db->query("SELECT id, link, thumb FROM " . PREFIX . "_covers WHERE newsid = '$item_db[0]'"); + + while($row_covers = $db->get_row()){ + + @unlink(ROOT_DIR."/uploads".$row_covers['link']); + @unlink(ROOT_DIR."/uploads".$row_covers['thumb']); + + } + + $db->query("DELETE FROM " . PREFIX . "_covers WHERE newsid = '$item_db[0]'"); + + $row = $db->super_query( "SELECT images FROM " . PREFIX . "_images where news_id = '$item_db[0]'" ); + + $listimages = explode( "|||", $row['images'] ); + + if( $row['images'] != "" ) foreach ( $listimages as $dataimages ) { + $url_image = explode( "/", $dataimages ); + + if( count( $url_image ) == 2 ) { + + $folder_prefix = $url_image[0] . "/"; + $dataimages = $url_image[1]; + + } else { + + $folder_prefix = ""; + $dataimages = $url_image[0]; + + } + + @unlink( ROOT_DIR . "/uploads/posts/" . $folder_prefix . $dataimages ); + @unlink( ROOT_DIR . "/uploads/posts/" . $folder_prefix . "thumbs/" . $dataimages ); + } + + $db->query( "DELETE FROM " . PREFIX . "_images WHERE news_id = '$item_db[0]'" ); + + $db->query("SELECT id, onserver FROM " . PREFIX . "_torrents WHERE news_id = '$item_db[0]'"); + + while($row_torrents = $db->get_row()){ + @unlink(ROOT_DIR."/uploads/torrents/".$row_torrents['onserver']); + } + + //$db->query("DELETE FROM " . PREFIX . "_torrents WHERE news_id = '$item_db[0]'"); + $db->query( "UPDATE " . PREFIX . "_torrents SET flags=1 where news_id='$item_db[0]'" ); + + $db->query( "SELECT id, onserver FROM " . PREFIX . "_files WHERE news_id = '$item_db[0]'" ); + + while ( $row = $db->get_row() ) { + + @unlink( ROOT_DIR . "/uploads/files/" . $row['onserver'] ); + } + $db->query( "DELETE FROM " . PREFIX . "_files WHERE news_id = '$item_db[0]'" ); + } + } else + $no_permission = TRUE; + } + + $cache->clear(); + + if( ! $_SESSION['admin_referrer'] ) { + + $_SESSION['admin_referrer'] = "?mod=editnews&action=list"; + + } + if( $no_permission ) { + msg( "error", $lang['addnews_error'], $lang['edit_denied'], $_SESSION['admin_referrer'] ); + } elseif( $okdeleted ) { + msg( "info", $lang['edit_delok'], $lang['edit_delok_1'], $_SESSION['admin_referrer'] ); + } elseif( $okchanges ) { + msg( "info", $lang['edit_alleok'], $lang['edit_alleok_1'], $_SESSION['admin_referrer'] ); + } else { + msg( "error", $lang['addnews_error'], $lang['edit_allerr'], $_SESSION['admin_referrer'] ); + } +} +?> \ No newline at end of file diff --git a/system/inc/editusers.php b/system/inc/editusers.php new file mode 100644 index 0000000..c5986a7 --- /dev/null +++ b/system/inc/editusers.php @@ -0,0 +1,1287 @@ + + + '; + + $grouplist = get_groups( 4 ); + + $search_name = $db->safesql( trim( htmlspecialchars( strip_tags( $_REQUEST['search_name'] ) ) ) ); + $search_mail = $db->safesql( trim( htmlspecialchars( strip_tags( $_REQUEST['search_mail'] ) ) ) ); + + echo << + + +
    +
    + + + + + + + + + + + + + + + + +
    + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + +
    {$lang['user_name']}
    {$lang['user_pass']}
    {$lang['user_mail']}
    {$lang['user_acc']} +
      + + +
    +
    +
    +HTML; + + if( $search_reglevel ) $group_list = get_groups( $search_reglevel ); + else $group_list = get_groups(); + + if( $search_banned == "yes" ) $ifch = "checked"; + + $search_order_user = array ('----' => '', 'asc' => '', 'desc' => '' ); + if( ! empty( $search_order_u ) ) { + $search_order_user[$search_order_u] = 'selected'; + } else { + $search_order_user['----'] = 'selected'; + } + $search_order_reg = array ('----' => '', 'asc' => '', 'desc' => '' ); + if( ! empty( $search_order_r ) ) { + $search_order_reg[$search_order_r] = 'selected'; + } else { + $search_order_reg['----'] = 'selected'; + } + $search_order_last = array ('----' => '', 'asc' => '', 'desc' => '' ); + if( ! empty( $search_order_l ) ) { + $search_order_last[$search_order_l] = 'selected'; + } else { + $search_order_last['----'] = 'selected'; + } + $search_order_news = array ('----' => '', 'asc' => '', 'desc' => '' ); + if( ! empty( $search_order_n ) ) { + $search_order_news[$search_order_n] = 'selected'; + } else { + $search_order_news['----'] = 'selected'; + } + $search_order_coms = array ('----' => '', 'asc' => '', 'desc' => '' ); + if( ! empty( $search_order_c ) ) { + $search_order_coms[$search_order_c] = 'selected'; + } else { + $search_order_coms['----'] = 'selected'; + } + + echo << +
    + + + + + + + + + + + + + + + + +
    + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    {$lang['user_name']}[?]{$lang['edit_regdate']}{$lang['edit_fdate']} + +{$lang['edit_tdate']} + +
    {$lang['user_mail']}[?]{$lang['edit_entedate']}{$lang['edit_fdate']} + +{$lang['edit_tdate']} + +
    {$lang['user_banned']}{$lang['edit_newsnum']}{$lang['edit_fdate']}[?]{$lang['edit_tdate']}[?]
    {$lang['user_acc']} + {$lang['edit_comsnum']}{$lang['edit_fdate']}[?]{$lang['edit_tdate']}[?]
    {$lang['user_order']}
    {$lang['user_name']}{$lang['user_reg']}{$lang['user_last']}{$lang['user_news']}{$lang['user_coms']}
    + + + + +
      + + + + + +
    +
    +
    +HTML; + + $where = array (); + + if( ! empty( $search ) ) { + $where[] = "name like '$search_name%'"; + } + if( ! empty( $search_mail ) ) { + $where[] = "email='$search_mail'"; + } + if( ! empty( $search_banned ) ) { + $search_banned = $db->safesql( $search_banned ); + $where[] = "banned='$search_banned'"; + } + if( ! empty( $fromregdate ) ) { + $where[] = "reg_date>='" . strtotime( $fromregdate ) . "'"; + } + if( ! empty( $toregdate ) ) { + $where[] = "reg_date<='" . strtotime( $toregdate ) . "'"; + } + if( ! empty( $fromentdate ) ) { + $where[] = "lastdate>='" . strtotime( $fromentdate ) . "'"; + } + if( ! empty( $toentdate ) ) { + $where[] = "lastdate<='" . strtotime( $toentdate ) . "'"; + } + if( ! empty( $search_news_f ) ) { + $search_news_f = intval( $search_news_f ); + $where[] = "news_num>='$search_news_f'"; + } + if( ! empty( $search_news_t ) ) { + $search_news_t = intval( $search_news_t ); + $where[] = "news_num<'$search_news_t'"; + } + if( ! empty( $search_coms_f ) ) { + $search_coms_f = intval( $search_coms_f ); + $where[] = "comm_num>='$search_coms_f'"; + } + if( ! empty( $search_coms_t ) ) { + $search_coms_t = intval( $search_coms_t ); + $where[] = "comm_num<'$search_coms_t'"; + } + if( $search_reglevel ) { + $search_reglevel = intval( $search_reglevel ); + $where[] = "user_group='$search_reglevel'"; + } + + $where = implode( " AND ", $where ); + if( ! $where ) $where = "user_group < '4'"; + + $order_by = array (); + + if( ! empty( $search_order_u ) ) { + $order_by[] = "name $search_order_u"; + } + if( ! empty( $search_order_r ) ) { + $order_by[] = "reg_date $search_order_r"; + } + if( ! empty( $search_order_l ) ) { + $order_by[] = "lastdate $search_order_l"; + } + if( ! empty( $search_order_n ) ) { + $order_by[] = "news_num $search_order_n"; + } + if( ! empty( $search_order_c ) ) { + $order_by[] = "comm_num $search_order_c"; + } + + $order_by = implode( ", ", $order_by ); + if( ! $order_by ) $order_by = "reg_date asc"; + + // ------ Запрос к базе + $query_count = "SELECT COUNT(*) as count FROM " . USERPREFIX . "_users WHERE $where"; + $result_count = $db->super_query( $query_count ); + $all_count_news = $result_count['count']; + + echo << + + +
    +
    + + + + + + + + + + + + + + + + +
    + + + + +
    +
    + + + + + + + + + + + + + + +HTML; + + $news_per_page = 50; + $start_from = intval( $start_from ); + $i = $start_from; + + // ------ Запрос к базе + $db->query( "SELECT user_id, name, user_group, reg_date, lastdate, news_num, comm_num, banned, r_freeze FROM " . USERPREFIX . "_users WHERE {$where} ORDER BY {$order_by} LIMIT {$start_from},{$news_per_page}" ); + + while ( $row = $db->get_row() ) { + $i ++; + + $last_login = langdate( 'd/m/Y - H:i', $row['lastdate'] ); + $user_name = "" . $row[name] . ""; + if( $row[news_num] == 0 ) { + $news_link = "$row[news_num]"; + } else { + $news_link = "[" . $row[news_num] . "]"; + } + if( $row[comm_num] == 0 ) { + $comms_link = $row['comm_num']; + } else { + $comms_link = "[" . $row[comm_num] . "]"; + } + $user_delete = "[" . $lang[user_del] . "]"; + + if( $row['banned'] == 'yes' ) $user_level = "" . $lang['user_ban'] . ""; + else $user_level = $user_group[$row['user_group']]['group_name']; + + if( $row['user_group'] == 1 ) $user_delete = ""; + + echo " + + + + + + + + "; + } + $db->free(); + + $npp_nav = ""; + + if( $start_from > 0 ) { + $previous = $start_from - $news_per_page; + $npp_nav .= "<< $lang[edit_prev]"; + } + + // pagination + + + if( $all_count_news > $news_per_page ) { + $npp_nav .= " [ "; + $enpages_count = @ceil( $all_count_news / $news_per_page ); + $enpages_start_from = 0; + $enpages = ""; + for($j = 1; $j <= $enpages_count; $j ++) { + if( $enpages_start_from != $start_from ) { + $enpages .= "$j "; + } else { + $enpages .= " $j "; + } + $enpages_start_from += $news_per_page; + } + $npp_nav .= $enpages; + $npp_nav .= " ] "; + } + + // pagination + + + if( $all_count_news > $i ) { + $how_next = $all_count_news - $i; + if( $how_next > $news_per_page ) { + $how_next = $news_per_page; + } + $npp_nav .= "$lang[edit_next] $how_next >>"; + } + + echo << + +
    {$lang['user_name']}{$lang['user_reg']} {$lang['user_last']} {$lang['user_news']}{$lang['user_coms']}{$lang['user_acc']}{$lang['user_action']}
    +  $user_name"; + echo (langdate( "d/m/Y - H:i", $row['reg_date'] )); + echo "  + $last_login  + $news_link + $comms_link +  $user_level + [$lang[user_edit]] $user_delete [$lang[bb_b_mail]] [$lang[nl_pm]] +
    {$npp_nav}
    +
    + + + + +
    +
    +
    +HTML; + + echofooter(); +} +// ******************************************************************************** +// Добавление пользователя +// ******************************************************************************** +elseif( $action == "adduser" ) { + if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) {die( "Hacking attempt! User not found" );} + + if( ! $_POST['regusername'] ) {msg( "error", $lang['user_err'], $lang['user_err_1'], "javascript:history.go(-1)" );} + + if( preg_match( "/[\||\'|\<|\>|\"|\!|\$|\@|\&\~\*\+]/", $_POST['regusername'] ) ) msg( "error", $lang['user_err'], $lang['user_err_1'], "javascript:history.go(-1)" ); + + if( ! $_POST['regpassword'] ) {msg( "error", $lang['user_err'], $lang['user_err_2'], "javascript:history.go(-1)" );} + if( empty( $_POST['regemail'] ) OR @count(explode("@", $_POST['regemail'])) != 2) {msg( "error", $lang['user_err_1'], $lang['user_err_1'], "javascript:history.go(-1)" );} + + $not_allow_symbol = array ("\x22", "\x60", "\t", '\n', '\r', "\n", "\r", '\\', ",", "/", "¬", "#", ";", ":", "~", "[", "]", "{", "}", ")", "(", "*", "^", "%", "$", "<", ">", "?", "!", '"', "'", " " ); + $regemail = $db->safesql(trim( str_replace( $not_allow_symbol, '', strip_tags( stripslashes( $_POST['regemail'] ) ) ) ) ); + + $row = $db->super_query( "SELECT name, email FROM " . USERPREFIX . "_users WHERE name = '$regusername' OR email = '$regemail'" ); + + if( $row['name'] ) {msg( "error", $lang['user_err'], $lang['user_err_3'], "javascript:history.go(-1)" );} + if( $row['email'] ) {msg( "error", $lang['user_err'], $lang['user_err_4'], "javascript:history.go(-1)" );} + + $add_time = time() + ($config['date_adjust'] * 60); + $regpassword = md5( md5( $_POST['regpassword'] ) ); + + $reglevel = intval( $_POST['reglevel'] ); + + if ( $member_id['user_group'] != 1 AND $reglevel < 2 ) $reglevel = 4; + + $db->query( "INSERT INTO " . USERPREFIX . "_users (name, password, email, user_group, reg_date, lastdate, info, signature, favorites) values ('$regusername', '$regpassword', '$regemail', '$reglevel', '$add_time', '$add_time','','','')" ); + + msg( "info", $lang['user_addok'], "$lang[user_ok] $regusername $lang[user_ok_1] {$user_group[$reglevel]['group_name']}", "$PHP_SELF?mod=editusers&action=list" ); +} +// ******************************************************************************** +// Редактирование пользователя +// ******************************************************************************** +elseif( $action == "edituser" ) { + + if( isset( $_REQUEST['user'] ) ) { + $user = $db->safesql( strip_tags( urldecode( $_GET['user'] ) ) ); + + if( $user != "" ) { + $row = $db->super_query( "SELECT user_id FROM " . USERPREFIX . "_users WHERE name = '$user'" ); + if( ! $row['user_id'] ) die( "User not found" ); + header( "Location: ?mod=editusers&action=edituser&id=" . $row['user_id'] ); + die( "User not found" ); + } + } + + $row = $db->super_query( "SELECT " . USERPREFIX . "_users.*, " . USERPREFIX . "_banned.days, " . USERPREFIX . "_banned.descr, " . USERPREFIX . "_banned.date as banned_date FROM " . USERPREFIX . "_users LEFT JOIN " . USERPREFIX . "_banned ON " . USERPREFIX . "_users.user_id=" . USERPREFIX . "_banned.users_id WHERE user_id = '$id'" ); + + if( ! $row['user_id'] ) die( "User not found" ); + + if ($row['user_id'] != 1) $delete_link = ""; else $delete_link = ""; + + if ($member_id['user_group'] != 1 AND $row['user_group'] == 1 ) + die( $lang['edit_not_admin'] ); + + include_once SYSTEM_DIR . '/classes/parse.class.php'; + + $parse = new ParseFilter( ); + + $row['fullname'] = $parse->decodeBBCodes( $row['fullname'], false ); + $row['icq'] = $parse->decodeBBCodes( $row['icq'], false ); + $row['skype'] = $parse->decodeBBCodes( $row['skype'], false ); + $row['land'] = $parse->decodeBBCodes( $row['land'], false ); + $row['info'] = $parse->decodeBBCodes( $row['info'], false ); + $row['signature'] = $parse->decodeBBCodes( $row['signature'], false ); + $row['descr'] = $parse->decodeBBCodes( $row['descr'], false ); + $row['status'] = $parse->decodeBBCodes( $row['status'], false ); + + echo << + + +{$lang['user_edhead']} + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +HTML; + + $last_date = langdate( "j F Y - H:i", $row['lastdate'] ); + $reg_date = langdate( "j F Y - H:i", $row['reg_date'] ); + + if( $row['foto'] ) { + $avatar = $config['http_home_url'] . "uploads/fotos/" . $row['foto']; + } else { + $avatar = 'http://gravatar.com/avatar/' . md5( stripslashes( $row['email'] ) ) . "?s=100&r=g&d=" . $config['http_home_url'] . 'templates/' . $config['skin'] . '/images/noavatar.png'; + } + + echo << + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {$output} + + + +
    IP:{$row['logged_ip']}
    {$lang['user_news']}{$row['news_num']}
    {$lang['user_last']}{$last_date}
    {$lang['user_reg']}{$reg_date}
    {$lang['user_mail']}
    {$lang['user_newlogin']}
    {$lang['user_newpass']}
    Статус
    {$lang['user_acc']}
    {$lang['user_banned']}[?]
    {$lang['ban_date']}[?] {$endban}
    {$lang['ban_descr']}
    {$lang['restricted']}
    {$lang['restricted_date']}[?] {$end_restricted}
    {$lang['user_del_comments']}
    {$lang['opt_fullname']}
    {$lang['opt_icq']}
    Логин Skype:
    {$lang['opt_land']}
    {$lang['repa_value']}
    {$lang['repa_do_freeze']}[?]
    {$lang['user_avatar']}
    {$lang['user_del_avatar']}
    {$lang['extra_minfo']}
    {$lang['extra_signature']}
          {$delete_link} + + + + +
    + +HTML; + + echo << +
    + + + +HTML; + +} +// ******************************************************************************** +// Сохранение отредактированной информации +// ******************************************************************************** +elseif( $action == "doedituser" ) { + + if( ! $id ) {die( $lang['user_nouser'] );} + if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) {die( "Hacking attempt! User not found" );} + + $row = $db->super_query( "SELECT user_id, user_group FROM " . USERPREFIX . "_users WHERE user_id = '$id'" ); + + if( ! $row['user_id'] ) die( "User not found" ); + + if ($member_id['user_group'] != 1 AND $row['user_group'] == 1 ) + die( $lang['edit_not_admin'] ); + + $editlevel = intval( $_POST['editlevel'] ); + + if ($member_id['user_group'] != 1 AND $editlevel < 2 ) + die( $lang['admin_not_access'] ); + + include_once SYSTEM_DIR . '/classes/parse.class.php'; + + $parse = new ParseFilter( ); + + $editlogin = $db->safesql( $parse->process( $_POST['editlogin'] ) ); + $editfullname = $db->safesql( $parse->process( $_POST['editfullname'] ) ); + + if ($_POST['editicq']) $editicq = intval( $_POST['editicq'] ); else $editicq = ""; + $editskype = $db->safesql( $parse->process( $_POST['editskype'] ) ); + + $editland = $db->safesql( $parse->process( $_POST['editland'] ) ); + $editrepa = $db->safesql($parse->process($_POST['editrepa'])); + $editinfo = $db->safesql( $parse->BB_Parse( $parse->process( $_POST['editinfo'] ), false ) ); + $editsignature = $db->safesql( $parse->BB_Parse( $parse->process( $_POST['editsignature'] ), false ) ); + $editmail = $db->safesql( $parse->process( $_POST['editmail'] ) ); + $editstatus = $db->safesql( $parse->process( $_POST['editstatus'] ) ); + + if ( $_POST['banned'] ) $banned = "yes"; + + $image = $_FILES['image']['tmp_name']; + $image_name = $_FILES['image']['name']; + $image_size = $_FILES['image']['size']; + $img_name_arr = explode( ".", $image_name ); + $type = end( $img_name_arr ); + + if( $image_name != "" ) $image_name = totranslit( stripslashes( $img_name_arr[0] ) ) . "." . totranslit( $type ); + + if( is_uploaded_file( $image ) ) { + + if( $image_size < 100000 ) { + + $allowed_extensions = array ("jpg", "png", "jpe", "jpeg", "gif" ); + + if( (in_array( $type, $allowed_extensions ) or in_array( strtolower( $type ), $allowed_extensions )) and $image_name ) { + include_once SYSTEM_DIR . '/classes/thumb.class.php'; + + $res = @move_uploaded_file( $image, ROOT_DIR . "/uploads/fotos/" . $id . "." . $type ); + + if( $res ) { + + @chmod( ROOT_DIR . "/uploads/fotos/" . $id . "." . $type, 0666 ); + $thumb = new thumbnail( ROOT_DIR . "/uploads/fotos/" . $id . "." . $type ); + + if( $thumb->size_auto( $user_group[$member_id['user_group']]['max_foto'] ) ) { + $thumb->jpeg_quality( $config['jpeg_quality'] ); + $thumb->save( ROOT_DIR . "/uploads/fotos/foto_" . $id . "." . $type ); + } else { + @rename( ROOT_DIR . "/uploads/fotos/" . $id . "." . $type, ROOT_DIR . "/uploads/fotos/foto_" . $id . "." . $type ); + } + + @chmod( ROOT_DIR . "/uploads/fotos/foto_" . $id . "." . $type, 0666 ); + $foto_name = "foto_" . $id . "." . $type; + + $db->query( "UPDATE " . USERPREFIX . "_users set foto='$foto_name' WHERE user_id='$id'" ); + + } + } + + } + + @unlink( ROOT_DIR . "/uploads/fotos/" . $id . "." . $type ); + } + + if( $_POST['del_foto'] == "yes" ) { + $row = $db->super_query( "SELECT foto FROM " . USERPREFIX . "_users WHERE user_id='$id'" ); + $db->query( "UPDATE " . USERPREFIX . "_users set foto='' WHERE user_id='$id'" ); + + @unlink( ROOT_DIR . "/uploads/fotos/" . $row['foto'] ); + } + + $sql_update = "UPDATE " . USERPREFIX . "_users set user_group='$editlevel', status='$editstatus', banned='$banned', r_freeze='$r_freeze', icq='$editicq', skype='$editskype', repa=$editrepa, land='$editland', info='$editinfo', signature='$editsignature', email='$editmail', fullname='$editfullname'"; + +if ($row['user_group'] != $editlevel) +{ + $cache->delete('user_color.php'); +} + + if( trim( $editlogin ) != "" ) { + + $row = $db->super_query( "SELECT user_id FROM " . USERPREFIX . "_users WHERE name='$editlogin'" ); + + if( ! $row['user_id'] ) { + + $row = $db->super_query( "SELECT name FROM " . USERPREFIX . "_users WHERE user_id='$id'" ); + $db->query( "UPDATE " . PREFIX . "_post SET autor='$editlogin' WHERE autor='{$row['name']}'" ); + $db->query( "UPDATE " . PREFIX . "_comments SET autor='$editlogin' WHERE autor='{$row['name']}' AND is_register='1'" ); + $db->query( "UPDATE " . USERPREFIX . "_pm SET user_from='$editlogin' WHERE user_from='{$row['name']}'" ); + $db->query( "UPDATE " . PREFIX . "_images SET author='$editlogin' WHERE author='{$row['name']}'" ); + + $db->query("UPDATE " . PREFIX . "_forum_files SET file_author='$editlogin' WHERE file_author='{$row['name']}'"); + $db->query("UPDATE " . PREFIX . "_forum_forums SET f_last_poster_name='$editlogin' WHERE f_last_poster_name='{$row['name']}'"); + $db->query("UPDATE " . PREFIX . "_forum_poll_log SET member='$editlogin' WHERE member='{$row['name']}'"); + $db->query("UPDATE " . PREFIX . "_forum_posts SET post_author='$editlogin' WHERE post_author='{$row['name']}'"); + $db->query("UPDATE " . PREFIX . "_forum_sessions SET member_name='$editlogin' WHERE member_name='{$row['name']}'"); + $db->query("UPDATE " . PREFIX . "_forum_topics SET author_topic='$editlogin' WHERE author_topic='{$row['name']}'"); + $db->query("UPDATE " . PREFIX . "_forum_topics SET last_poster_name='$editlogin' WHERE last_poster_name='{$row['name']}'"); + +$db->query("UPDATE " . USERPREFIX . "_reputation set author='$editlogin' WHERE author='{$row['name']}'"); +$db->query("UPDATE " . USERPREFIX . "_reputation set komu='$editlogin' WHERE komu='{$row['name']}'"); + + $sql_update .= ", name='$editlogin'"; + } else + msg( "error", $lang['addnews_error'], $lang['user_edit_found'], "javascript:history.go(-1)" ); + } + + if( $_POST['restricted'] ) { + + $restricted = intval( $_POST['restricted'] ); + $restricted_days = intval( $_POST['restricted_days'] ); + + $sql_update .= ", restricted='$restricted'"; + + if( $restricted_days != $_POST['prev_restricted'] ) { + + $restricted_date = time() + ($config['date_adjust'] * 60); + $restricted_date = $restricted_days ? $restricted_date + ($restricted_days * 60 * 60 * 24) : ''; + + $sql_update .= ", restricted_days='$restricted_days', restricted_date='$restricted_date'"; + + } + + } else { + + $sql_update .= ", restricted='0', restricted_days='0', restricted_date=''"; + + } + + if( trim( $editpass ) != "" ) { + $editpass = md5( md5( $_POST['editpass'] ) ); + $sql_update .= ", password='$editpass'"; + } + + $sql_update .= " WHERE user_id='$id'"; + + $db->query( $sql_update ); + + if( $banned ) { + $banned_descr = $db->safesql( $parse->BB_Parse( $parse->process( $_POST['banned_descr'] ), false ) ); + $this_time = time() + ($config['date_adjust'] * 60); + $banned_date = intval( $_POST['banned_date'] ); + $this_time = $banned_date ? $this_time + ($banned_date * 60 * 60 * 24) : 0; + + $row = $db->super_query( "SELECT users_id, days FROM " . USERPREFIX . "_banned WHERE users_id = '$id'" ); + + if( ! $row['users_id'] ) $db->query( "INSERT INTO " . USERPREFIX . "_banned (users_id, descr, date, days) values ('$id', '$banned_descr', '$this_time', '$banned_date')" ); + else { + + if( $row['days'] != $banned_date ) $db->query( "UPDATE " . USERPREFIX . "_banned set descr='$banned_descr', days='$banned_date', date='$this_time' WHERE users_id = '$id'" ); + else $db->query( "UPDATE " . USERPREFIX . "_banned set descr='$banned_descr' WHERE users_id = '$id'" ); + + } + + $cache->delete('banned.php' ); + + } else { + + $db->query( "DELETE FROM " . USERPREFIX . "_banned WHERE users_id = '$id'" ); + $cache->delete('banned.php' ); + + } + + if( $_POST['del_comments'] ) { + + $result = $db->query( "SELECT COUNT(*) as count, post_id FROM " . PREFIX . "_comments WHERE user_id='$id' AND is_register='1' GROUP BY post_id" ); + + while ( $row = $db->get_array( $result ) ) { + + $db->query( "UPDATE " . PREFIX . "_post SET comm_num=comm_num-{$row['count']} where id='{$row['post_id']}'" ); + + } + $db->free( $result ); + + $db->query( "UPDATE " . USERPREFIX . "_users set comm_num='0' where user_id ='$id'" ); + $db->query( "DELETE FROM " . PREFIX . "_comments WHERE user_id='$id' AND is_register='1'" ); + + } + + header( "Location: {$_SERVER['REQUEST_URI']}" ); + +} +// ******************************************************************************** +// Удаление пользователя +// ******************************************************************************** +elseif( $action == "dodeleteuser" ) { + + if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) { + + die( "Hacking attempt! User not found" ); + + } + + if( ! $id ) { + die( $lang['user_nouser'] ); + } + + if( $id == 1 ) { + die( $lang['user_undel'] ); + } + + + $row = $db->super_query( "SELECT user_id, user_group, name, foto FROM " . USERPREFIX . "_users WHERE user_id='$id'" ); + + if( ! $row['user_id'] ) die( "User not found" ); + + if ($member_id['user_group'] != 1 AND $row['user_group'] == 1 ) + die( $lang['user_undel'] ); + + + $db->query( "DELETE FROM " . USERPREFIX . "_pm WHERE user_from = '{$row['name']}' AND folder = 'outbox'" ); + + @unlink( ROOT_DIR . "/uploads/fotos/" . $row['foto'] ); + + $db->query( "delete FROM " . USERPREFIX . "_users WHERE user_id='$id'" ); + $db->query( "delete FROM " . USERPREFIX . "_banned WHERE users_id='$id'" ); + $db->query( "delete FROM " . USERPREFIX . "_pm WHERE user='$id'" ); + + if ($_GET['popup'] == "yes") { + + die( "".$lang[user_ok]." ".$lang[user_delok_1]."" ); + + } else { + + msg( "info", $lang['user_delok'], "$lang[user_ok] $user $lang[user_delok_1]", "$PHP_SELF?mod=editusers&action=list" ); + + } + +} elseif( $action == "dodelcomments" ) { + if( ! $id ) { + die( $lang['user_nouser'] ); + } + + if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) { + + die( "Hacking attempt! User not found" ); + + } + + $result = $db->query( "SELECT COUNT(*) as count, post_id FROM " . PREFIX . "_comments WHERE user_id='$id' AND is_register='1' GROUP BY post_id" ); + + while ( $row = $db->get_array( $result ) ) { + + $db->query( "UPDATE " . PREFIX . "_post set comm_num=comm_num-{$row['count']} where id='{$row['post_id']}'" ); + + } + $db->free( $result ); + + $db->query( "UPDATE " . USERPREFIX . "_users set comm_num='0' where user_id ='$id'" ); + $db->query( "DELETE FROM " . PREFIX . "_comments WHERE user_id='$id' AND is_register='1'" ); + + msg( "info", $lang['user_delok'], $lang['comm_alldel'], "$PHP_SELF?mod=editusers&action=list" ); +} +?> \ No newline at end of file diff --git a/system/inc/email.php b/system/inc/email.php new file mode 100644 index 0000000..7f3c2ee --- /dev/null +++ b/system/inc/email.php @@ -0,0 +1,188 @@ +'" ); + $replace = array ("<", ">" ); + + $reg_mail_text = preg_replace( $find, $replace, $db->safesql( $_POST['reg_mail_text'] ) ); + $feed_mail_text = preg_replace( $find, $replace, $db->safesql( $_POST['feed_mail_text'] ) ); + $lost_mail_text = preg_replace( $find, $replace, $db->safesql( $_POST['lost_mail_text'] ) ); + $new_news_text = preg_replace( $find, $replace, $db->safesql( $_POST['new_news_text'] ) ); + $news_mailv_text = preg_replace( $find,$replace, $db->safesql( $_POST['news_mailv_text'] ) ); + $news_mailn_text = preg_replace( $find,$replace, $db->safesql( $_POST['news_mailn_text'] ) ); + $new_comments_text = preg_replace( $find, $replace, $db->safesql( $_POST['new_comments_text'] ) ); + + $db->query( "UPDATE " . PREFIX . "_email set template='$reg_mail_text' where name='reg_mail'" ); + $db->query( "UPDATE " . PREFIX . "_email set template='$feed_mail_text' where name='feed_mail'" ); + $db->query( "UPDATE " . PREFIX . "_email set template='$lost_mail_text' where name='lost_mail'" ); + $db->query( "UPDATE " . PREFIX . "_email set template='$new_news_text' where name='new_news'" ); + $db->query( "UPDATE " . PREFIX . "_email set template='$news_mailv_text' where name='news_mailv'" ); + $db->query( "UPDATE " . PREFIX . "_email set template='$news_mailn_text' where name='news_mailn'" ); + $db->query( "UPDATE " . PREFIX . "_email set template='$new_comments_text' where name='comments'" ); + $db->query( "UPDATE " . PREFIX . "_email set template='$new_pm_text' where name='pm'" ); + + msg( "info", $lang['mail_addok'], $lang['mail_addok_1'], "?mod=email" ); + +} else { + + echoheader( "home", $lang['db_info'] ); + + $db->query( "SELECT name, template FROM " . PREFIX . "_email" ); + + while ( $row = $db->get_row() ) { + $$row['name'] = stripslashes( $row['template'] ); + } + $db->free(); + + echo << +
    + + + + + + + + + + + + + + + + +
    + + + + +
    +
    + + + + + + + +
    {$lang['mail_reg_info']}
    + + + + +
    +
    + + + + + + + +
    {$lang['mail_feed_info']}
    + + + + +
    +
    + + + + + + + +
    {$lang['mail_lost_info']}
    +
    + + + + + +
    +
    + + + + + + + +
    Можно использовать BB - коды и HTML
    +
    + + + + + +
    +
    + + + + + + + +
    Можно использовать BB - коды и HTML
    +
    + + + + + + +
    +
    + + + + + + + +
    {$lang['mail_comm_info']}
    +
    + + + + + + +
    +
    + + + + + + + +
    {$lang['mail_pm_info']}
    +

      
    + +
    + +
    +HTML; + + echofooter(); +} +?> \ No newline at end of file diff --git a/system/inc/files.php b/system/inc/files.php new file mode 100644 index 0000000..f6f7f40 --- /dev/null +++ b/system/inc/files.php @@ -0,0 +1,1498 @@ +safesql( strip_tags( urldecode( $_REQUEST['author'] ) ) ); else $author = ""; +if( intval( $_REQUEST['news_id'] ) ) $news_id = intval( $_REQUEST['news_id'] ); else $news_id = 0; + + +$config_path_image_upload = ROOT_DIR . "/uploads/" . $userdir . $sub_dir; + +$config['max_image'] = $_POST['t_size'] ? $_POST['t_size'] : $config['max_image']; + +$thumb_size = $config['max_image']; +$thumb_size = explode ("x", $thumb_size); + +if ( count($thumb_size) == 2) {$thumb_size = intval($thumb_size[0]) . "x" . intval($thumb_size[1]); +} else {$thumb_size = intval( $thumb_size[0] );} + +$config['max_image'] = $thumb_size; + +if( ! @is_dir( $config_path_image_upload ) ) msg( "error", $lang['addnews_denied'], "Directory {$userdir} not found" ); + +if( $action == "doimagedelete" ) { + + if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) {die( "Hacking attempt! User not found" );} + if( ! isset( $_POST['images'] ) ) {msg( "info", $lang['images_delerr'], $lang['images_delerr_1'], "$PHP_SELF?mod=files" );} + + foreach ( $_POST['images'] as $image ) { + @unlink( $config_path_image_upload . $image ); + @unlink( $config_path_image_upload . "thumbs/" . $image ); + } + $action = ""; +} + +if( $action == "quick" ) { + header( "Expires: Mon, 26 Jul 1997 05:00:00 GMT" ); + header( "Last-Modified: " . gmdate( "D, d M Y H:i:s" ) . " GMT" ); + header( "Cache-Control: no-store, no-cache, must-revalidate" ); + header( "Cache-Control: post-check=0, pre-check=0", false ); + header( "Pragma: no-cache" ); + + $sess_id = session_id(); + + if( $user_group[$member_id['user_group']]['allow_file_upload'] or $user_group[$member_id['user_group']]['allow_tor_upload'] ) { + if( ! $config['max_file_size'] ) $max_file_size = 0; + elseif( $config['max_file_size'] > $config['max_up_size'] ) $max_file_size = ( int ) $config['max_file_size']; + else $max_file_size = ( int ) $config['max_up_size']; + if( $max_file_size ) $max_file_size = $max_file_size . " KB"; + } else { + $max_file_size = $config['max_up_size'] . " KB"; + } + $config['max_file_count'] = intval( $config['max_file_count'] ); + + echo << + + + +Upload + + + + + + + + + + + + + + + + + + + + + + + + + +
    +HTML; + + echo << + + +JSCRIPT; + + echo ""; +} + +else { + echoheader( "files", $lang['images_head'] ); + + echo << + + + + + + + + + + + + + + + +
    +HTML; +} + +if( $_REQUEST['subaction'] == "deluploads" ) { + + if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) {die( "Hacking attempt! User not found" );} + + $row = $db->super_query( "SELECT images FROM " . PREFIX . "_images where author = '$author' AND news_id = '$news_id'" ); + + $listimages = explode( "|||", $row['images'] ); + + if( isset( $_POST['images'] ) ) foreach ( $_POST['images'] as $image ) { + + $i = 0; + + sort( $listimages ); + reset( $listimages ); + + foreach ( $listimages as $dataimages ) { + + if( $dataimages == $image ) { + $url_image = explode( "/", $image ); + if( count( $url_image ) == 2 ) { + $folder_prefix = $url_image[0] . "/"; + $image = $url_image[1]; + } else { + $folder_prefix = ""; + $image = $url_image[0]; + } + unset( $listimages[$i] ); + @unlink( ROOT_DIR . "/uploads/posts/" . $folder_prefix . $image ); + @unlink( ROOT_DIR . "/uploads/posts/" . $folder_prefix . "thumbs/" . $image ); + } + $i ++; + } + } + + if( count( $listimages ) ) $row['images'] = implode( "|||", $listimages ); + else $row['images'] = ""; + + $db->query( "UPDATE " . PREFIX . "_images set images='$row[images]' where author = '$author' AND news_id = '$news_id'" ); + + if( count( $_POST['static_files'] ) ) { + + foreach ( $_POST['static_files'] as $file ) { + + $file = intval( $file ); + + $row = $db->super_query( "SELECT id, name, onserver FROM " . PREFIX . "_static_files WHERE author = '$author' AND static_id = '$news_id' AND id='$file'" ); + + if( $row['id'] and $row['onserver'] ) { + + @unlink( ROOT_DIR . "/uploads/files/" . $row['onserver'] ); + $db->query( "DELETE FROM " . PREFIX . "_static_files WHERE id='{$row['id']}'" ); + + } else { + + if( $row['id'] ) { + $url_image = explode( "/", $row['name'] ); + + if( count( $url_image ) == 2 ) { + + $folder_prefix = $url_image[0] . "/"; + $image = $url_image[1]; + + } else { + + $folder_prefix = ""; + $image = $url_image[0]; + + } + @unlink( ROOT_DIR . "/uploads/posts/" . $folder_prefix . $image ); + @unlink( ROOT_DIR . "/uploads/posts/" . $folder_prefix . "thumbs/" . $image ); + $db->query( "DELETE FROM " . PREFIX . "_static_files WHERE id='{$row['id']}'" ); + } + } + } + } + + if( count( $_POST['files'] ) ) { + foreach ( $_POST['files'] as $file ) { + $file = intval( $file ); + $row = $db->super_query( "SELECT id, onserver FROM " . PREFIX . "_files where author = '$author' AND news_id = '$news_id' AND id='$file'" ); + @unlink( ROOT_DIR . "/uploads/files/" . $row['onserver'] ); + $db->query( "DELETE FROM " . PREFIX . "_files WHERE id='{$row['id']}'" ); + } + } + + if( count( $_POST['torrents'] ) ) { + foreach ( $_POST['torrents'] as $file ) { + $file = intval( $file ); + $row = $db->super_query( "SELECT id, onserver FROM " . PREFIX . "_torrents where author = '$author' AND news_id = '$news_id' AND id='$file' AND flags='0'" ); + @unlink( ROOT_DIR . "/uploads/torrents/" . $row['onserver'] ); + $db->query( "UPDATE " . PREFIX . "_torrents SET flags='1' where id='{$row['id']}'" ); + } + } +} + +if( $_REQUEST['subaction'] == "upload" ) { + $images_number = intval($_POST['images_number']); + + if( $action == "quick" ) { + + $userdir = "posts/"; + + if( ! is_dir( ROOT_DIR . "/uploads/posts/" . FOLDER_PREFIX ) ) { + @mkdir( ROOT_DIR . "/uploads/posts/" . FOLDER_PREFIX, 0777 ); + @chmod( ROOT_DIR . "/uploads/posts/" . FOLDER_PREFIX, 0777 ); + @mkdir( ROOT_DIR . "/uploads/posts/" . FOLDER_PREFIX . "/thumbs", 0777 ); + @chmod( ROOT_DIR . "/uploads/posts/" . FOLDER_PREFIX . "/thumbs", 0777 ); + } + + if( ! is_dir( ROOT_DIR . "/uploads/posts/" . FOLDER_PREFIX ) ) {msg( "error", $lang['opt_error'], $lang['upload_error_0']." /uploads/posts/" . FOLDER_PREFIX . "/" );} + if( ! is_writable( ROOT_DIR . "/uploads/posts/" . FOLDER_PREFIX ) ) {msg( "error", $lang['opt_error'], $lang['upload_error_1']." /uploads/posts/" . FOLDER_PREFIX . "/ ".$lang['upload_error_2'] );} + if( ! is_writable( ROOT_DIR . "/uploads/posts/" . FOLDER_PREFIX . "/thumbs" ) ) {msg( "error", $lang['opt_error'], $lang['upload_error_1']." /uploads/posts/" . FOLDER_PREFIX . "/thumbs/ ".$lang['upload_error_2'] );} + + $config_path_image_upload = ROOT_DIR . "/uploads/posts/" . FOLDER_PREFIX . "/"; + } + + for($image_i = 1; $image_i < ($images_number + 1); $image_i ++) { + + $file_prefix = time() + rand( 1, 100 ); + $file_prefix .= "_"; + + $current_image = 'file_' . $image_i; + $image = $_FILES[$current_image]['tmp_name']; + $image_name = $_FILES[$current_image]['name']; + $image_size = $_FILES[$current_image]['size']; + $error_code = $_FILES[$current_image]['error']; + + if ($error_code !== UPLOAD_ERR_OK) { + switch ($error_code) { + case UPLOAD_ERR_INI_SIZE: + $error_code = 'PHP Error: The uploaded file exceeds the upload_max_filesize directive in php.ini'; break; + case UPLOAD_ERR_FORM_SIZE: + $error_code = 'PHP Error: The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form'; break; + case UPLOAD_ERR_PARTIAL: + $error_code = 'PHP Error: The uploaded file was only partially uploaded'; break; + case UPLOAD_ERR_NO_FILE: + $error_code = 'PHP Error: No file was uploaded'; break; + case UPLOAD_ERR_NO_TMP_DIR: + $error_code = 'PHP Error: Missing a PHP temporary folder'; break; + case UPLOAD_ERR_CANT_WRITE: + $error_code = 'PHP Error: Failed to write file to disk'; break; + case UPLOAD_ERR_EXTENSION: + $error_code = 'PHP Error: File upload stopped by extension'; break; + default: + $error_code = 'Unknown upload error'; break; + }} + + $img_name_arr = explode( ".", $image_name ); + $type = totranslit( end( $img_name_arr ) ); + + if( $image_name != "" ) { + + $curr_key = key( $img_name_arr ); + unset( $img_name_arr[$curr_key] ); + + $image_name = totranslit( implode( ".", $img_name_arr ) ) . "." . $type; + } + + if( $config['files_allow'] == "yes" and $user_group[$member_id['user_group']]['allow_file_upload'] and $_REQUEST['action'] == "quick" and (in_array( strtolower( $type ), $allowed_files )) ) { +/* +===================================================== + Загрузка файлов, но не картинок +===================================================== +*/ + +if( ! is_dir( ROOT_DIR . "/uploads/files/" . FOLDER_PREFIX ) ){ +mkdir( ROOT_DIR . "/uploads/files/" . FOLDER_PREFIX, 0777 ); +chmod( ROOT_DIR . "/uploads/files/" . FOLDER_PREFIX, 0777 ); +} + +$file_prefix = FOLDER_PREFIX.'/'.$file_prefix; + + @move_uploaded_file( $image, ROOT_DIR . "/uploads/files/" . $file_prefix . $image_name ) or $img_result = "
    {$lang['images_uperr_3']}

    {$error_code}
    "; + + if( @file_exists( ROOT_DIR . "/uploads/files/" . $file_prefix . $image_name ) ) { + + if( intval( $config['max_file_size'] ) and @filesize( ROOT_DIR . "/uploads/files/" . $file_prefix . $image_name ) > ($config['max_file_size'] * 1024) ) { + @unlink( ROOT_DIR . "/uploads/files/" . $file_prefix . $image_name ); + $img_result .= "
    $image_name -> $lang[files_too_big]
    "; + } else { + @chmod( ROOT_DIR . "/uploads/files/" . $file_prefix . $image_name, 0666 ); + $img_result .= "
    $image_name -> $lang[files_upok]
    "; + + $added_time = time() + ($config['date_adjust'] * 60); + + if( $area == "template" ) { + $db->query( "INSERT INTO " . PREFIX . "_static_files (static_id, author, date, name, onserver) values ('$news_id', '$author', '$added_time', '$image_name', '{$file_prefix}{$image_name}')" ); + } else { + $db->query( "INSERT INTO " . PREFIX . "_files (news_id, name, onserver, author, date) values ('$news_id', '$image_name', '{$file_prefix}{$image_name}', '$author', '$added_time')" ); + } + } + } + } elseif( $image_name == "" ) { + $img_result .= "
    $current_image -> $lang[images_uperr]
    "; + } elseif( ! isset( $overwrite ) and file_exists( $config_path_image_upload . $image_name ) ) { + $img_result .= "
    $current_image -> $lang[images_uperr_1]
    "; + } elseif( ! (in_array( $type, $allowed_extensions ) or in_array( strtolower( $type ), $allowed_extensions )) ) { + $img_result .= "
    $current_image -> $lang[images_uperr_2]
    "; + } elseif( $image_size > ($config['max_up_size'] * 1024) and ! $config['max_up_side'] ) { + $img_result .= "
    $current_image -> $lang[images_big]
    "; + } else { +/* +===================================================== + Загрузка картинок, но не файлов +===================================================== +*/ + @move_uploaded_file( $image, $config_path_image_upload . $file_prefix . $image_name ) or $img_result = "
    {$lang['images_uperr_3']}

    {$error_code}
    "; + + if( @file_exists( $config_path_image_upload . $file_prefix . $image_name ) ) { + + @chmod( $config_path_image_upload . $file_prefix . $image_name, 0666 ); + + $img_result .= "
    $image_name -> $lang[images_upok]
    "; + + if( $action == "quick" and $area != "template" ) { + + $row = $db->super_query( "SELECT COUNT(*) as count FROM " . PREFIX . "_images where author = '$author' AND news_id = '$news_id'" ); + + if( ! $row['count'] ) { + + $added_time = time() + ($config['date_adjust'] * 60); + $inserts = FOLDER_PREFIX . "/" . $file_prefix . $image_name; + $db->query( "INSERT INTO " . PREFIX . "_images (images, author, news_id, date) values ('$inserts', '$author', '$news_id', '$added_time')" ); + + } else { + + $row = $db->super_query( "SELECT images FROM " . PREFIX . "_images where author = '$author' AND news_id = '$news_id'" ); + + if( $row['images'] == "" ) $listimages = array (); + else $listimages = explode( "|||", $row['images'] ); + + foreach ( $listimages as $dataimages ) { + + if( $dataimages == FOLDER_PREFIX . "/" . $file_prefix . $image_name ) $error_image = "stop"; + + } + + if( $error_image != "stop" ) { + + $listimages[] = FOLDER_PREFIX . "/" . $file_prefix . $image_name; + $row['images'] = implode( "|||", $listimages ); + + $db->query( "UPDATE " . PREFIX . "_images set images='{$row['images']}' where author = '$author' AND news_id = '$news_id'" ); + + } + } + } + + if( $area == "template" and $action == "quick" ) { + + $added_time = time() + ($config['date_adjust'] * 60); + $inserts = FOLDER_PREFIX . "/" . $file_prefix . $image_name; + $db->query( "INSERT INTO " . PREFIX . "_static_files (static_id, author, date, name) values ('$news_id', '$author', '$added_time', '$inserts')" ); + + } + + include_once SYSTEM_DIR . '/classes/thumb.class.php'; + if( $member_id['user_group'] > 3 ) { + $_POST['make_thumb'] = true; + $_POST['make_watermark'] = $config['allow_watermark']; + } + + if( isset( $_POST['make_thumb'] ) ) { + + $thumb = new thumbnail( $config_path_image_upload . $file_prefix . $image_name ); + + if( $thumb->size_auto( $config['max_image'], $_POST['t_seite'] ) ) { + + $thumb->jpeg_quality( $config['jpeg_quality'] ); + + if( $config['allow_watermark'] == "yes" and $_POST['make_watermark'] == "yes" ) $thumb->insert_watermark( $config['max_watermark'] ); + + $thumb->save( $config_path_image_upload . "thumbs/" . $file_prefix . $image_name ); + } + + if( @file_exists( $config_path_image_upload . "thumbs/" . $file_prefix . $image_name ) ) $img_result_th .= "
    $image_name -> $lang[images_thok]
    "; + + @chmod( $config_path_image_upload . "thumbs/" . $file_prefix . $image_name, 0666 ); + } + + + if( ($config['allow_watermark'] == "yes" and $_POST['make_watermark'] == "yes") or $config['max_up_side'] ) { + $thumb = new thumbnail( $config_path_image_upload . $file_prefix . $image_name ); + $thumb->jpeg_quality( $config['jpeg_quality'] ); + + if( $config['max_up_side'] ) $thumb->size_auto( $config['max_up_side'] ); + + if( $config['allow_watermark'] == "yes" and $_POST['make_watermark'] == "yes" ) $thumb->insert_watermark( $config['max_watermark'] ); + + $thumb->save( $config_path_image_upload . $file_prefix . $image_name ); + } + + } //if file is uploaded succesfully + + } + } + +/* +===================================================== + Загрузка Торрентов, но не файлов +===================================================== +*/ + + $image = $_FILES["torfile"]['tmp_name']; + $image_name = $_FILES["torfile"]['name']; + $image_size = $_FILES["torfile"]['size']; + $error_code = $_FILES["torfile"]['error']; + if (!empty ($image)) + { + $img_name_arr = explode( ".", $image_name ); + $type = totranslit( end( $img_name_arr ) ); + if( $image_name != "" ) { + $curr_key = key( $img_name_arr ); + unset( $img_name_arr[$curr_key] ); + $image_name = totranslit( implode( ".", $img_name_arr ) ) . "." . $type; + } + + $tfile_prefix = FOLDER_PREFIX.'/'.$file_prefix; + +if(substr($image_name, -8) == ".torrent") { + if( ! is_dir( ROOT_DIR . "/uploads/torrents/" . FOLDER_PREFIX ) ){ + mkdir( ROOT_DIR . "/uploads/torrents/" . FOLDER_PREFIX, 0777 ); + chmod( ROOT_DIR . "/uploads/torrents/" . FOLDER_PREFIX, 0777 ); + } + + @move_uploaded_file( $image, ROOT_DIR . "/uploads/torrents/" . $tfile_prefix . $image_name ); + if( @file_exists( ROOT_DIR . "/uploads/torrents/" . $tfile_prefix . $image_name ) ) + { + @chmod( ROOT_DIR . "/uploads/torrents/" . $tfile_prefix . $image_name, 0666 ); + $img_result .= "
    $image_name -> $lang[files_upok]
    "; + +//********* Tracker by MSW *** start *********// + require_once( ROOT_DIR."/system/classes/torrent.class.php" ); + $tr_file = ROOT_DIR."/uploads/torrents/".$tfile_prefix.$image_name; + + $torrent = new Torrent($tr_file); + if($error = $torrent->errors()){ + + }else{ + $files_size = $torrent->size(); + $hash = $torrent->hash_info(); + + $e_hash = addslashes(pack("H*", $hash)); + $tr_fild = ", info_hash, size, ctime"; + $tr_info = ", '{$e_hash}', '{$files_size}', '".time()."'"; +//********* Tracker by MSW *** stop *********// + + $db->query( "INSERT INTO " . PREFIX . "_torrents (news_id, name, onserver, author {$tr_fild}) values ('$news_id', '$image_name', '{$tfile_prefix}{$image_name}', '$author' {$tr_info})" ); + } + } + } + } +} + +echo ""; +echo << + + + + + + + + +
    +
    +HTML; + +if( $action == "quick" ) { + + echo << + +
    + +HTML; + + echofooter(); + +} else { + echo << +
    + + + +HTML; +} +?> \ No newline at end of file diff --git a/system/inc/forum.php b/system/inc/forum.php new file mode 100644 index 0000000..50526aa --- /dev/null +++ b/system/inc/forum.php @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/system/inc/forum/email.php b/system/inc/forum/email.php new file mode 100644 index 0000000..4ba91dc --- /dev/null +++ b/system/inc/forum/email.php @@ -0,0 +1,82 @@ +'",); + + $replace = array("<", ">",); + + $subscription_text = preg_replace($find,$replace, $db->safesql($_POST['subscription_text'])); + + $db->query("UPDATE " . PREFIX . "_forum_email set template='$subscription_text' where name='subscription_text'"); + + $frend_text = preg_replace($find,$replace, $db->safesql($_POST['frend_text'])); + + $db->query("UPDATE " . PREFIX . "_forum_email set template='$frend_text' where name='frend_text'"); + + + $report_text = preg_replace($find,$replace, $db->safesql($_POST['report_text'])); + + $db->query("UPDATE " . PREFIX . "_forum_email set template='$report_text' where name='report_text'"); + + $new_topic = preg_replace($find,$replace, $db->safesql($_POST['new_topic'])); + + $db->query("UPDATE " . PREFIX . "_forum_email set template='$new_topic' where name='new_topic'"); + + + msg("info",$f_lg['email_ok'], $f_lg['email_ok2'], "?mod=forum"); + } + + else + { + $db->query("SELECT name, template FROM " . PREFIX . "_forum_email"); + + while($row = $db->get_row()) + { + $$row['name'] = stripslashes($row['template']); + } + + $db->free(); + + echo_top(); + + echo "
    "; + + echo_title($f_lg['mail_subscr']); + + echo_mail("subscription_text", $subscription_text, $f_lg['mail_subscr_']); + + echo_title($f_lg['mail_new_topic']); + + echo_mail("new_topic", $new_topic, $f_lg['mail_new_topic_']); + + echo_title($f_lg['mail_frend']); + + echo_mail("frend_text", $frend_text, $f_lg['mail_frend_']); + + echo_title($f_lg['mail_report']); + + echo_mail("report_text", $report_text, $f_lg['mail_report_']); + + echo "
    "; + + echo_bottom(); + } + +?> \ No newline at end of file diff --git a/system/inc/forum/form.php b/system/inc/forum/form.php new file mode 100644 index 0000000..df16591 --- /dev/null +++ b/system/inc/forum/form.php @@ -0,0 +1,367 @@ + + + + + + + + + +
    {$f_lg['cat_name']}
     
    "; +} + +function echo_forum($type, $id = false, $sub_id = false){ + global $db, $f_lg, $user_group, $category_list, $forum_list, $sub_id; + + if ($type == "new") + { + $act = "forum_add"; + + $button = $f_lg['button_add']; + + category_list($id); + + forum_list($sub_id); + + $access_forum = access_forum($user_group, '0'); + + $f_form['postcount'] = 1; + } + + if ($type == "edit") + { + include(SYSTEM_DIR.'/classes/parse.class.php'); + + $parse = new ParseFilter(); + + $result = $db->query("SELECT * FROM " . PREFIX . "_forum_forums WHERE id = '$id'"); + + while ($row = $db->get_row($result)) + { + $f_form['name'] = stripslashes(preg_replace(array("'\"'", "'\''"), array(""", "'"),$row['name'])); + $f_form['description'] = stripslashes(preg_replace(array("'\"'", "'\''"), array(""", "'"),$row['description'])); + $f_form['password'] = stripslashes(preg_replace(array("'\"'", "'\''"), array(""", "'"),$row['password'])); + + $f_form['rules_name'] = stripslashes(preg_replace(array("'\"'", "'\''"), array(""", "'"),$row['rules_title'])); + + $f_form['rules'] = $parse->decodeBBCodes($row['rules'], false); + + $f_form['icon'] = stripslashes(preg_replace(array("'\"'", "'\''"), array(""", "'"),$row['icon'])); + + $sel_id = $row['main_id']; + + $forum_id = $row['id']; + + $parentid = $row['parentid']; + + $f_form['postcount'] = $row['postcount']; + + $f_form['fixpost'] = $row['fixpost']; + + $f_form['banner'] = stripslashes($row['banner']); + + $f_form['q_reply'] = intval($row['q_reply']); + + $f_form['i_edit'] = intval($row['i_edit']); + } + + $act = "forum_save&id=$forum_id"; + + $button = $f_lg['button_edit']; + + category_list($sel_id); + + forum_list($parentid); + + $access_forum = access_forum($user_group, $forum_id); + } + + echo "
    +
    {$f_lg['forum_mset']}
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    {$f_lg['forum_name']}
    {$f_lg['forum_descr']}
    {$f_lg['forum_icon']}[?]
    {$f_lg['password']}
    {$f_lg['forum_cat']}
    {$f_lg['forum_for']}

    + +
    {$f_lg['forum_posts_conf']}
    + + + + + + + + + + + + + + + + + +
    {$f_lg['forum_postcount']}".makeDropDown(array("1"=>$f_lg['yes'],"0"=>$f_lg['no']), "postcount", $f_form['postcount'])."
    {$f_lg['forum_fixpost']}".makeDropDown(array("1"=>$f_lg['yes'],"0"=>$f_lg['no']), "fixpost", $f_form['fixpost'])."
    {$f_lg['forum_q_reply']}".makeDropDown(array("1"=>$f_lg['yes'],"0"=>$f_lg['no']), "q_reply", $f_form['q_reply'])."
    {$f_lg['forum_i_edit']}".makeDropDown(array("1"=>$f_lg['yes'],"0"=>$f_lg['no']), "i_edit", $f_form['i_edit'])."
    +

    + +
    {$f_lg['forum_rules']}
    + + + + + + + + + +
    {$f_lg['forum_rules1']}
    {$f_lg['forum_rules2']}
    +

    + +
    {$f_lg['forum_banner']}
    + + + + + +
    {$f_lg['forum_banner2']}
    +

    + +
    {$f_lg['forum_access']}
    {$access_forum}
    + + + + + +
     
    "; +} + + +function echo_rank($type, $id = false){ + global $db, $f_lg; + + if ($type == "new") + { + $act = "rank_add"; + $button = $f_lg['button_add']; + } + + if ($type == "edit") + { + $act = "rank_save&id=$id"; + $button = $f_lg['button_edit']; + + $result = $db->super_query("SELECT * FROM " . PREFIX . "_forum_titles WHERE id = '$id'"); + + $t_name = $result['title']; + + $t_posts = $result['posts']; + + $t_pips = $result['pips']; + } + + echo "
    + + + + + + + + + + + + + + +
    {$f_lg['titles_nname']}
    {$f_lg['titles_npost']}
    {$f_lg['titles_npips']}
     
    "; +} + +if(!defined('DLE_FORUM')){ exit; } + +function echo_mail($name, $text, $description) +{ + echo " + + + + + + +
    {$description}
    "; +} + +function echo_rank_style () +{ + global $config; + $style = << +.rank { + + width: 85px; + + height: 16px; + +} + +.unit-rank { + + list-style: none; + + margin: 0px; + + padding: 0px; + + width: 85px; + + height: 16px; + + position: relative; + + background-image: url('{THEME}/forum/images/rating.gif'); + + background-position: top left; + + background-repeat: repeat-x; + +} + +.unit-rank li { + + text-indent: -90000px; + + padding: 0px; + + margin: 0px; + + float: left; + +} + +.unit-rank li a { + + display: block; + + width: 17px; + + height: 16px; + + text-decoration: none; + + text-indent: -9000px; + + z-index: 17; + + position: absolute; + + padding: 0px; + +} + +.unit-rank li a:hover { + + background-image: url('{THEME}/forum/images/rating.gif'); + + background-position: left center; + + z-index: 2; + + left: 0px; + +} + +.unit-rank a.r1-unit { left: 0px; } + +.unit-rank a.r1-unit:hover { width: 17px; } + +.unit-rank a.r2-unit { left: 17px; } + +.unit-rank a.r2-unit:hover { width: 34px; } + +.unit-rank a.r3-unit { left: 34px; } + +.unit-rank a.r3-unit:hover { width: 51px; } + +.unit-rank a.r4-unit { left: 51px; } + +.unit-rank a.r4-unit:hover { width: 68px; } + +.unit-rank a.r5-unit { left: 68px; } + +.unit-rank a.r5-unit:hover { width: 85px; } + +.unit-rank li.current-rank { + + background-image: url('{THEME}/forum/images/rating.gif'); + + background-position: left bottom; + + position: absolute; + + height: 16px; + + display: block; + + text-indent: -9000px; + + z-index: 1; + +} + +HTML; + +echo str_replace('{THEME}', $config['http_home_url'].'templates/'.$config['skin'], $style); + +} + +?> \ No newline at end of file diff --git a/system/inc/forum/forum.php b/system/inc/forum/forum.php new file mode 100644 index 0000000..c01ba98 --- /dev/null +++ b/system/inc/forum/forum.php @@ -0,0 +1,1380 @@ +init_admin(); + + $fcache = new cache($dir = ROOT_DIR . '/cache/forum'); + + $action = $_REQUEST['action']; + + switch ($action) + { +// ******************************************************************************** +// MAIN +// ******************************************************************************** + case "": + + $count_options = count($options); + + for($i=0; $i<$count_options; $i++) + { + if($member_db[1] > $options[$i]['access'] AND $options[$i]['access'] != "all") + { + unset($options[$i]); + } + } + + $forum_stats = array(); + + $row = $db->super_query("SELECT COUNT(*) as count FROM " . PREFIX . "_forum_posts"); + $forum_stats['posts'] = $row['count']; + + $row = $db->super_query("SELECT COUNT(*) as count FROM " . PREFIX . "_forum_topics"); + $forum_stats['topics'] = $row['count']; + + $forum_stats['licence'] = ($l_full) ? $f_lg['licence_trial'] : $f_lg['licence_full']; + + $sum_size = $db->super_query("SELECT SUM(file_size) AS sum FROM " . PREFIX . "_forum_files"); + + $forum_stats['sum_size'] = mksize($sum_size['sum']); + + if (!$forum_config['offline']) $forum_stats['line'] = $f_lg['forum_online']; + else $forum_stats['line'] = $f_lg['forum_offline']; + + $forum_stats['cache'] = mksize($fcache->size()); + + $forum_mysql = $db->query("SHOW TABLE STATUS FROM `".DBNAME."`"); + + while ($row = $db->get_array($forum_mysql)) + { + if (strpos($row['Name'], PREFIX."_forum_") !== false) + + $forum_db_size += $row['Data_length'] + $row['Index_length'] ; + } + + $db->free($forum_mysql); + + $forum_stats['db_size'] = mksize($forum_db_size); + + echo_top(); + echo_title($f_lg['m_forum']); + + echo ""; + + foreach($options as $option) + { + if ($i > 1) {echo ""; $i=0;} + + $i++; + + echo ""; + } + + echo "
    "; + + echo_bottom(w); + + echo "
    "; + + echo_top(w); echo_title($f_lg['check_updates']); echo "
    "; echo_bottom(w); + + echo "
    "; + + echo_top(w); + + echo_title($f_lg['m_stats']); + + echo_stats($forum_config, $forum_stats); + + echo_bottom(); + + break; + +// ******************************************************************************** +// CATEGORY +// ******************************************************************************** + case "category": + + echo_top(); + + echo_title($f_lg['cat_new']); + + echo_category('new'); + + echo_bottom(); + + break; + +// ******************************************************************************** +// CATEGORY ADD +// ******************************************************************************** + case "category_add": + + if ($name) + { + $result_posi = $db->super_query("SELECT * FROM " . PREFIX . "_forum_category ORDER BY posi DESC LIMIT 1"); + + $posi = $result_posi['posi']; + + if (!$posi) $posi = '1'; else $posi = ($posi+1); + + $name = $db->safesql($_POST['name']); + + $db->query("INSERT INTO " . PREFIX . "_forum_category (cat_name, posi) values ('$name', '$posi')"); + + $fcache->delete('start_id'); + $fcache->delete('cats_array'); + + msg("info",$f_lg['cat_ok_add1'], $f_lg['cat_ok_add2'], "?mod=forum"); + } + + else msg("error",$f_lg['error'],$f_lg['cat_err_name'], "?mod=forum&action=category"); + + break; + +// ******************************************************************************** +// CATEGORY EDIT +// ******************************************************************************** + case "category_edit": + + $row = $db->super_query("SELECT * FROM " . PREFIX . "_forum_category WHERE sid = '$sid'"); + + $name = stripslashes(preg_replace(array("'\"'", "'\''"), array(""", "'"),$row['cat_name'])); + + $sid = $row['sid']; + + echo_top(); + + echo_title($f_lg['cat_edit']); + + echo_category('edit', $name, $sid); + + echo_bottom(); + + break; + +// ******************************************************************************** +// CATEGORY SAVE +// ******************************************************************************** + case "category_save": + + $name = $db->safesql($_POST['name']); + + if (!$name) + { + msg("error",$f_lg['error'],$f_lg['cat_err_name'], "javascript:history.go(-1)"); + } + + $db->query("UPDATE " . PREFIX . "_forum_category SET cat_name = '$name' WHERE sid = '$sid'"); + + $fcache->delete('start_id'); + $fcache->delete('cats_array'); + + msg("info",$f_lg['cat_ok_edit1'], $f_lg['cat_ok_edit2'], "?mod=forum&action=content"); + + break; + +// ******************************************************************************** +// CATEGORY DEL +// ******************************************************************************** + case "category_del": + + $category_result = $db->query("SELECT * FROM " . PREFIX . "_forum_forums WHERE main_id = '$sid'"); + + while ($myrow = $db->get_row($category_result)) + { + $result = $db->query("SELECT * FROM " . PREFIX . "_forum_topics WHERE forum_id = '$myrow[id]'"); + + while ($row = $db->get_row($result)) + { + $db->query("DELETE FROM " . PREFIX . "_forum_posts WHERE topic_id = '$row[tid]'"); + } + + $db->query("DELETE FROM " . PREFIX . "_forum_topics WHERE forum_id = '$myrow[id]'"); + + $db->query("DELETE FROM " . PREFIX . "_forum_forums WHERE id = '$myrow[id]'"); + +// Удаление вложений вместе с категорией и всеми разделами категории + +$result = $db->query("SELECT * FROM " . PREFIX . "_forum_files WHERE forum_id = '" . $myrow['id'] . "'"); + +while ($row = $db->get_row($result)) { + +if ($row['file_type'] == "file") { + +unlink(UPLOAD_DIR."files/" . $row['onserver']); + +} elseif ($row['file_type'] == "thumb") { + +unlink(UPLOAD_DIR."thumbs/" . $row['onserver']); + +unlink(UPLOAD_DIR."images/" . $row['onserver']); + +} else { + +unlink(UPLOAD_DIR."images/" . $row['onserver']); + +} + +} + +$db->query("DELETE FROM " . PREFIX . "_forum_files WHERE forum_id = '" . $myrow['id'] . "'"); + +// конец удаления вложений вместе с темой + } + + $db->query("DELETE FROM " . PREFIX . "_forum_category WHERE sid = '$sid'"); + + $fcache->delete('start_id'); + $fcache->delete('cats_array'); + $fcache->delete('forums_array'); + $fcache->delete('sub_forums_array'); + $fcache->delete('sub_parentid'); + + $fcache->clear(); + + header("Location: ?mod=forum&action=content"); + + break; + +// ******************************************************************************** +// CATEGORY SORT +// ******************************************************************************** + case "category_sort": + + $result = $db->query("SELECT * FROM " . PREFIX . "_forum_category"); + + while ($row = $db->get_row($result)) + { + $db->query("UPDATE " . PREFIX . "_forum_category SET posi = '".$cat_posi[$row['sid']]."' WHERE sid = '$row[sid]'"); + } + + $fcache->delete('start_id'); + $fcache->delete('cats_array'); + + header("Location: ?mod=forum&action=content"); + + break; + +// ******************************************************************************** +// CATEGORY ACCESS for forums +// ******************************************************************************** + case "access": + + $access_forum = access_forum($user_group, '0'); + + echo_top(); + + echo_title($f_lg['access_for_f']); + + echo "
    "; + + echo $access_forum; + + echo "
    "; + + echo "
    "; + + echo_bottom(); + + break; + +// ******************************************************************************** +// CATEGORY ACCESS for forums ADD +// ******************************************************************************** + case "access_add": + + if (!count($access_read)) {$access_read = array (); $access_read[] = '0';} + $access_read_mysql = $db->safesql(implode(':', $access_read)); + + if (!count($access_write)) {$access_write = array (); $access_write[] = '0';} + $access_write_mysql = $db->safesql(implode(':', $access_write)); + + if (!count($access_mod)) {$access_mod = array (); $access_mod[] = '0';} + $access_mod_mysql = $db->safesql(implode(':', $access_mod)); + + if (!count($access_topic)) {$access_topic = array (); $access_topic[] = '0';} + $access_topic_mysql = $db->safesql(implode(':', $access_topic)); + + if (!count($access_upload)) {$access_upload = array (); $access_upload[] = '0';} + $access_upload_mysql = $db->safesql(implode(':', $access_upload)); + + if (!count($access_download)) {$access_download = array (); $access_download[] = '0';} + $access_download_mysql = $db->safesql(implode(':', $access_download)); + + $db->query("UPDATE " . PREFIX . "_forum_forums SET access_read = '$access_read_mysql', access_write = '$access_write_mysql', access_mod = '$access_mod_mysql', access_topic = '$access_topic_mysql', access_upload = '$access_upload_mysql', access_download = '$access_download_mysql' WHERE main_id = '$sid'"); + + $fcache->delete('forums_array'); + + header("Location: ?mod=forum&action=content"); + + break; + +// ******************************************************************************** +// FORUM +// ******************************************************************************** + case "forum": + + echo_top(); + + echo_title($f_lg['forum_new']); + + echo_forum('new', $sid); + + echo_bottom(); + + break; + +// ******************************************************************************** +// FORUM ADD +// ******************************************************************************** + case "forum_add": + + $main_id = $db->safesql($_POST['main_id']); + + $parentid = $db->safesql($_POST['parentid']); + + if ($parentid){ + + $result = $db->query("SELECT * FROM " . PREFIX . "_forum_forums WHERE main_id = '$main_id' and parentid = 0"); + + while ($row = $db->get_row($result)) + { + if ($row['id'] == $parentid) $test_parentid = TRUE; + } + + } + + else $test_parentid = TRUE; + + if ($_POST['name'] AND $test_parentid) + { + $result_position = $db->super_query("SELECT * FROM " . PREFIX . "_forum_forums WHERE main_id = '$main_id' ORDER BY position DESC LIMIT 1"); + + $position = $result_position['position']; + + if (!$position) $position = '1'; else $position = ($position+1); + + $name = $db->safesql($_POST['name']); + + $description = $db->safesql($_POST['description']); + + $password = $db->safesql($_POST['password']); + + $rules_name = $db->safesql($_POST['rules_name']); + + $icon = $db->safesql($_POST['icon']); + + $postcount = intval($_POST['postcount']); + + $fixpost = intval($_REQUEST['fixpost']); + + $banner = $db->safesql($_POST['banner']); + + $q_reply = intval($_POST['q_reply']); + + $i_edit = intval($_POST['i_edit']); + + include(SYSTEM_DIR.'/classes/parse.class.php'); + + $parse = new ParseFilter(Array(), Array(), 1, 1); + + $rules = $db->safesql($parse->BB_Parse($parse->process($_POST['rules']), false)); + + // ACCESS // + if (!count($access_read)) {$access_read = array (); $access_read[] = '0';} + $access_read_mysql = $db->safesql(implode(':', $access_read)); + + if (!count($access_write)) {$access_write = array (); $access_write[] = '0';} + $access_write_mysql = $db->safesql(implode(':', $access_write)); + + if (!count($access_mod)) {$access_mod = array (); $access_mod[] = '0';} + $access_mod_mysql = $db->safesql(implode(':', $access_mod)); + + if (!count($access_topic)) {$access_topic = array (); $access_topic[] = '0';} + $access_topic_mysql = $db->safesql(implode(':', $access_topic)); + + if (!count($access_upload)) {$access_upload = array (); $access_upload[] = '0';} + $access_upload_mysql = $db->safesql(implode(':', $access_upload)); + + if (!count($access_download)) {$access_download = array (); $access_download[] = '0';} + $access_download_mysql = $db->safesql(implode(':', $access_download)); + + $db->query("INSERT INTO " . PREFIX . "_forum_forums (parentid, main_id, name, description, position, access_read, access_write, access_mod, access_topic, access_upload, access_download, password, rules_title, rules, icon, postcount, fixpost, banner, q_reply, i_edit) values ('$parentid', '$main_id', '$name', '$description', '$position', '$access_read_mysql', '$access_write_mysql', '$access_mod_mysql', '$access_topic_mysql', '$access_upload_mysql', '$access_download_mysql', '$password', '$rules_name', '$rules', '$icon', '$postcount', '$fixpost', '$banner', '$q_reply', '$i_edit')"); + + $fcache->delete('forums_array'); + $fcache->delete('sub_forums_array'); + $fcache->delete('sub_parentid'); + + $fcache->clear(); + + msg("info",$f_lg['forum_ok_add1'], $f_lg['forum_ok_add2'], "?mod=forum"); + } + + else msg("error",$f_lg['error'],$f_lg['forum_err_name'], "?mod=forum&action=forum"); + + break; + +// ******************************************************************************** +// FORUM EDIT +// ******************************************************************************** + case "forum_edit": + + echo_top(); + + echo_title($f_lg['forum_edit']); + + echo_forum('edit', $id); + + echo_bottom(); + + break; + +// ******************************************************************************** +// FORUM SAVE +// ******************************************************************************** + case "forum_save": + + $main_id = $db->safesql($_POST['main_id']); + + $parentid = $db->safesql($_POST['parentid']); + + if ($parentid){ + + $result = $db->query("SELECT * FROM " . PREFIX . "_forum_forums WHERE main_id = '$main_id' and parentid = 0"); + + while ($row = $db->get_row($result)) + { + if ($row['id'] == $parentid) $test_parentid = TRUE; + } + + } + + else $test_parentid = TRUE; + + if ($_POST['name'] AND $test_parentid) + { + $name = $db->safesql($_POST['name']); + + $description = $db->safesql($_POST['description']); + + $password = $db->safesql($_POST['password']); + + $rules_name = $db->safesql($_POST['rules_name']); + + $banner = $db->safesql($_POST['banner']); + + $q_reply = intval($_POST['q_reply']); + + $i_edit = intval($_POST['i_edit']); + + include(SYSTEM_DIR.'/classes/parse.class.php'); + + $parse = new ParseFilter(Array(), Array(), 1, 1); + + $rules = $db->safesql($parse->BB_Parse($parse->process($_POST['rules']), false)); + + $icon = $db->safesql($_POST['icon']); + + $postcount = intval($_POST['postcount']); + + $fixpost = intval($_REQUEST['fixpost']); + + // ACCESS // + if (!count($access_read)) {$access_read = array (); $access_read[] = '0';} + $access_read_mysql = $db->safesql(implode(':', $access_read)); + + if (!count($access_write)) {$access_write = array (); $access_write[] = '0';} + $access_write_mysql = $db->safesql(implode(':', $access_write)); + + if (!count($access_mod)) {$access_mod = array (); $access_mod[] = '0';} + $access_mod_mysql = $db->safesql(implode(':', $access_mod)); + + if (!count($access_topic)) {$access_topic = array (); $access_topic[] = '0';} + $access_topic_mysql = $db->safesql(implode(':', $access_topic)); + + if (!count($access_upload)) {$access_upload = array (); $access_upload[] = '0';} + $access_upload_mysql = $db->safesql(implode(':', $access_upload)); + + if (!count($access_download)) {$access_download = array (); $access_download[] = '0';} + $access_download_mysql = $db->safesql(implode(':', $access_download)); + + $db->query("UPDATE " . PREFIX . "_forum_forums SET parentid = '$parentid', main_id = '$main_id', name = '$name', description = '$description', access_read = '$access_read_mysql', access_write = '$access_write_mysql', access_mod = '$access_mod_mysql', access_topic = '$access_topic_mysql', access_upload = '$access_upload_mysql', access_download = '$access_download_mysql', password = '$password', rules_title = '$rules_name', rules = '$rules', icon= '$icon', postcount = '$postcount', fixpost = '$fixpost', banner = '$banner', q_reply = '$q_reply', i_edit = '$i_edit' WHERE id = '$id'"); + + $fcache->delete('forums_array'); + $fcache->delete('sub_forums_array'); + $fcache->delete('sub_parentid'); + + $fcache->clear(); + + msg("info",$f_lg['forum_ok_edit1'], $f_lg['forum_ok_edit2'], "?mod=forum&action=content"); + } + + else msg("error",$f_lg['error'],$f_lg['forum_err_name'], "?mod=forum&action=forum"); + + break; + +// ******************************************************************************** +// FORUM DEL +// ******************************************************************************** + case "forum_del": + + $result = $db->query("SELECT * FROM " . PREFIX . "_forum_topics WHERE forum_id = '$id'"); + + while ($row = $db->get_row($result)) + { + $db->query("DELETE FROM " . PREFIX . "_forum_posts WHERE topic_id = '$row[tid]'"); + } + + $db->query("DELETE FROM " . PREFIX . "_forum_topics WHERE forum_id = '$id'"); + + $db->query("DELETE FROM " . PREFIX . "_forum_forums WHERE id = '$id'"); + +// Удаление вложений вместе с разделом + +$result = $db->query("SELECT * FROM " . PREFIX . "_forum_files WHERE forum_id = '" . $id . "'"); + +while ($row = $db->get_row($result)) { + +if ($row['file_type'] == "file") { + +unlink(UPLOAD_DIR."files/" . $row['onserver']); + +} elseif ($row['file_type'] == "thumb") { + +unlink(UPLOAD_DIR."thumbs/" . $row['onserver']); + +unlink(UPLOAD_DIR."images/" . $row['onserver']); + +} else { + +unlink(UPLOAD_DIR."images/" . $row['onserver']); + +} + +} + +$db->query("DELETE FROM " . PREFIX . "_forum_files WHERE forum_id = '" . $id . "'"); + +// конец удаления вложений вместе с темой + + $db->query("UPDATE " . PREFIX . "_forum_forums SET parentid = 0 WHERE parentid = '$id'"); + + $fcache->delete('forums_array'); + $fcache->delete('sub_forums_array'); + $fcache->delete('sub_parentid'); + + $fcache->clear(); + + header("Location: ?mod=forum&action=content"); + + break; + +// ******************************************************************************** +// FORUM SORT +// ******************************************************************************** + case "forum_sort": + + $in_cid = intval($_REQUEST['in_cid']); + + $result = $db->query("SELECT * FROM " . PREFIX . "_forum_forums WHERE main_id = $in_cid"); + + while ($row = $db->get_row($result)) + { + $db->query("UPDATE " . PREFIX . "_forum_forums SET position = '".$cat_posi[$row['id']]."' WHERE id = '$row[id]'"); + } + + $fcache->delete('forums_array'); + $fcache->delete('sub_forums_array'); + $fcache->delete('sub_parentid'); + + $fcache->clear(); + + header("Location: ?mod=forum&action=content"); + + break; + +// ******************************************************************************** +// CONTENT +// ******************************************************************************** + case "content": + + echo_top(); + + $sub_forums = $db->query("SELECT * FROM ". PREFIX ."_forum_forums WHERE parentid ORDER by position"); + + while ($row = $db->get_row($get_sub_forums)) + { + $sub_forum[$row['id']]['id'] = $row['id']; + $sub_forum[$row['id']]['parentid'] = $row['parentid']; + $sub_forum[$row['id']]['name'] = $row['name']; + } + + $mod_forums = $db->query("SELECT mid, forum_id, member_name, member_id FROM ". PREFIX ."_forum_moderators"); + + while ($row = $db->get_row($mod_forums)) + { + $moderators_array[$row['mid']]['mid'] = $row['mid']; + $moderators_array[$row['mid']]['forum_id'] = $row['forum_id']; + $moderators_array[$row['mid']]['member_name'] = $row['member_name']; + $moderators_array[$row['mid']]['member_id'] = $row['member_id']; + } + + $result_posi = $db->super_query("SELECT COUNT(*) as count FROM " . PREFIX . "_forum_category"); + $result_posi = $result_posi['count']; + + $content = $db->query("SELECT c.*, f.* FROM " . PREFIX . "_forum_category AS c LEFT OUTER JOIN ". PREFIX ."_forum_forums AS f ON f.main_id=c.sid AND f.parentid = 0 ORDER BY c.posi, f.position"); + + forum_menu(); + + echo "
    "; + + for ($i = 0; $row = $db->get_row($result_content); $i = $row['sid']) + { + if ($row['sid'] != $i) + { + $ch_close++; + + if ($ch_close != 1) echo_bottom('cat'); + + echo_top('cat'); + + $category_menu = ""; + + $category_posi = category_posi($row['posi'], $row['sid'], $result_posi); + + $row['cat_name'] = stripcslashes($row['cat_name']); + + echo " + + + + + +
    "; + } + + $row['name'] = stripcslashes($row['name']); + + if ($row['name']) + { + if ($sub_forum) + { + + foreach ($sub_forum as $value) + { + if ($row['id'] == $value['parentid']) + { + $symbol_count++; + + if ($symbol_count > 1) $symbol = ", "; + + $value['name'] = stripcslashes($value['name']); + + $subforum .= $symbol."{$value['name']}"; + } + } + } + + if ($subforum) + { + $subforum = "
     - Подфорумы: ".$subforum; + } + + if ($row['moderators'] and $moderators_array) + { + $moderators_id = explode(":",$row['moderators']); + + foreach ($moderators_id as $u_id) + { + foreach ($moderators_array as $key => $value) + { + if ($moderators_array[$key]['member_id'] == $u_id and $moderators_array[$key]['forum_id'] == $row['id']) + { + $moderators .= "{$moderators_array[$key]['member_name']} "; + } + } + } + } + + if ($moderators) + { + $moderators = "
     Модераторы: ".$moderators; + } + + $forum_menu = ""; + + if ($row['description']) + { + $row['description'] = stripcslashes($row['description']); + + $description = "
    ".$row['description'].""; + } + else + { + $description = ''; + } + + echo " + + + + + + +
    {$row[name]}{$description}{$subforum}{$moderators}{$forum_menu} 
    "; + + unset ($subforum); + + unset ($moderators); + + unset ($symbol_count); + + unset ($symbol); + } + + } + + echo_bottom('cat'); + + echo_top('action'); + + echo "
     
    "; + + echo "
    "; + + echo_bottom('action'); + echo_bottom(); + + break; + +// ******************************************************************************** +// CONTENT -> FORUMS +// ******************************************************************************** + case "content_forums": + + $sub_forums = $db->query("SELECT id, parentid, name, description FROM ". PREFIX ."_forum_forums WHERE parentid ORDER by position"); + + $sub_forum = array(); + + while ($row = $db->get_row($get_sub_forums)) + { + $sub_forum[$row['id']] = array (); + + foreach ($row as $key => $value) + { + $sub_forum[$row['id']][$key] = $value; + } + } + + $result_posi = $db->super_query("SELECT COUNT(*) as count FROM " . PREFIX . "_forum_forums WHERE main_id = '$sid' AND parentid = 0"); + + $result_posi = $result_posi['count']; + + $content = $db->query("SELECT * FROM " . PREFIX . "_forum_category LEFT JOIN ". PREFIX ."_forum_forums ON ". PREFIX ."_forum_category.sid=". PREFIX ."_forum_forums.main_id WHERE parentid = 0 AND main_id = '$sid' ORDER BY posi, position"); + + echo_top(); + + forum_menu(); + + echo "
    "; + + echo_top('content'); + + for ($i = 0; $row = $db->get_row($content); $i = $row['sid']) + { + if ($row['sid'] != $i) + { + $row['cat_name'] = stripcslashes($row['cat_name']); + + echo_title($row['cat_name']); + } + + if ($row['name']) + { + foreach ($sub_forum as $value) + { + if ($row['id'] == $value['parentid']) + { + $value['name'] = stripcslashes($value['name']); + + $subforum .= "{$value['name']}, "; + } + } + + if ($subforum) + { + $subforum = "
     - Подфорумы: ".$subforum; + } + + $forum_posi = category_posi($row['position'], $row['id'], $result_posi); + + $forum_menu = ""; + + if ($row['description']) + { + $row['description'] = stripcslashes($row['description']); + + $description = "
    ".$row['description'].""; + } + + $row['name'] = stripcslashes($row['name']); + + echo " + + + + + + +
    {$row['name']}{$description}{$subforum}{$forum_posi}{$forum_menu} 
    "; + } + } + + echo_bottom('content'); + + echo_top('action'); + + echo "
     
    "; + + echo "
    "; + + echo_bottom('action'); + + echo_bottom(); + + break; + +// ******************************************************************************** +// FORUM -> SUB FORUMS +// ******************************************************************************** + case "content_sub_forums": + + $forum_row = $db->super_query("SELECT * FROM ". PREFIX ."_forum_forums WHERE id = '$id'"); + + $sid = $forum_row['main_id']; + + $sub_forums = $db->query("SELECT * FROM ". PREFIX ."_forum_forums WHERE parentid = '$id' ORDER by position"); + + $result_posi = $db->super_query("SELECT COUNT(*) as count FROM " . PREFIX . "_forum_forums WHERE parentid = '$id'"); + + $result_posi = $result_posi['count']; + + echo_top(); + + echo_top('content'); + + forum_menu(); + + echo "
    "; + + $forum_row['name'] = stripcslashes($forum_row['name']); + + echo_title($forum_row['name']); + + while ($row = $db->get_row($sub_forums)) + { + $forum_posi = category_posi($row['position'], $row['id'], $result_posi); + + $forum_menu = ""; + + if ($row['description']) + { + $row['description'] = stripcslashes($row['description']); + + $description = "
    ".$row['description'].""; + } + + $row['name'] = stripcslashes($row['name']); + + echo " + + + + + + +
    {$row['name']}{$description}{$subforum}{$forum_posi}{$forum_menu} 
    "; + } + + echo_bottom('content'); + + echo_top('action'); + + echo "
     
    "; + + echo "
    "; + + echo_bottom('action'); + + echo_bottom(); + + break; + +// ******************************************************************************** +// TOOLS +// ******************************************************************************** + case "tools": + + echo_top(); + + echo "
    "; + + require_once SYSTEM_DIR.'/inc/forum/tools.php'; + + echo_top('tools_save'); + + echo "
    "; + + echo_bottom('tools_save'); + + echo_bottom(); + + break; + +// ******************************************************************************** +// TOOLS SAVE +// ******************************************************************************** + case "tools_save": + + if (!count($search_captcha)) {$search_captcha = array (); $search_captcha[] = '0';} + $save_con[search_captcha] = $db->safesql(implode(':', $search_captcha)); + + if (!count($topic_captcha)) {$topic_captcha = array (); $topic_captcha[] = '0';} + $save_con[topic_captcha] = $db->safesql(implode(':', $topic_captcha)); + + if (!count($post_captcha)) {$post_captcha = array (); $post_captcha[] = '0';} + $save_con[post_captcha] = $db->safesql(implode(':', $post_captcha)); + + if (!count($tools_upload)) {$tools_upload = array (); $tools_upload[] = '0';} + $save_con[tools_upload] = $db->safesql(implode(':', $tools_upload)); + + if (!count($tools_poll)) {$tools_poll = array (); $tools_poll[] = '0';} + $save_con[tools_poll] = $db->safesql(implode(':', $tools_poll)); + + $find[] = "'\r'"; + $replace[] = ""; + $find[] = "'\n'"; + $replace[] = ""; + + $save_con = $save_con + $forum_config; + + $handler = fopen(SYSTEM_DIR.'/data/forum_config.php', "w"); + + fwrite($handler, " $value) + { + $value=trim(stripslashes ($value)); + $value=htmlspecialchars ($value, ENT_QUOTES); + $value = preg_replace($find,$replace,$value); + fwrite($handler, "'{$name}' => \"{$value}\",\n\n"); + } + + fwrite($handler, ");\n\n?>"); + fclose($handler); + + msg("info", $f_lg['t_f_save'], "$f_lg[t_f_save1]

    $f_lg[db_prev]"); + + break; + +// ******************************************************************************** +// RANK +// ******************************************************************************** + case "rank": + + $result = $db->query("SELECT * FROM " . PREFIX . "_forum_titles"); + + echo_top(); + + echo_title($f_lg['titles_main']); + + echo_rank_style (); + + echo " + + + + +
    {$f_lg['titles_name']}
    {$f_lg['titles_pots']}
    {$f_lg['titles_pips']}
    {$f_lg['titles_action']}
    "; + + while ($row = $db->get_row($result)) + { + $t_action = "[{$f_lg['label_edit']}]"." [{$f_lg['label_del']}]"; + + $rating = $row['pips'] * 17; + + $rank_image = "
    +
      +
    • {$rating}
    • +
    +
    "; + + echo " + + + + + "; + } + + echo "
    {$row['title']}
    {$row['posts']}
    {$rank_image}
    {$t_action}
    "; + + echo_bottom('w'); + + echo_top('w'); + + echo_title($f_lg['titles_uadd']); + + echo "
    + + + + + + + + + + + + + + +
    {$f_lg['titles_uname']}
    {$f_lg['titles_urname']}
    {$f_lg['titles_npips']}
     
    "; + + echo_bottom('w'); + + echo_top('w'); + + echo_title($f_lg['titles_add']); + + echo_rank('new'); + + echo_bottom(); + + break; + + case "rank_add": + + if ($t_name) + { + $db->query("INSERT INTO " . PREFIX . "_forum_titles (posts, title, pips) values ('$t_posts', '$t_name', '$t_pips')"); + + $fcache->delete('rank_array'); + + header("Location: ?mod=forum&action=rank"); + } + + break; + + case "rank_edit": + + echo_top(); + + echo_title($f_lg['titles_edit']); + + echo_rank('edit', $id); + + echo_bottom(); + + break; + + case "rank_save": + + if ($t_name and $id) + { + $db->query("UPDATE " . PREFIX . "_forum_titles SET title = '$t_name', posts = '$t_posts', pips = '$t_pips' WHERE id = '$id'"); + + $fcache->delete('rank_array'); + + header("Location: ?mod=forum&action=rank"); + } + + break; + + case "rank_del": + + $db->query("DELETE FROM " . PREFIX . "_forum_titles WHERE id = '$id' LIMIT 1"); + + $fcache->delete('rank_array'); + + header("Location: ?mod=forum&action=rank"); + + break; + + case "rank_user": + + $user_pips = intval($user_pips); + + $db->query("SELECT * FROM " . USERPREFIX . "_users where name = '$user_name'"); + + if ($db->num_rows()) + { + $db->query("UPDATE " . PREFIX . "_users SET forum_rank = '$user_rank', forum_pips = '$user_pips' WHERE name = '$user_name'"); + + header("Location: ?mod=forum&action=rank"); + } else + { + msg("info",$f_lg['error'], $f_lg['titles_error_name'], "javascript:history.go(-1)"); + } + + break; + +// ******************************************************************************** +// NEW MODERATOR +// ******************************************************************************** + case "moderator_new": + + if ($user_found) + { + $user_found = $db->super_query("SELECT * FROM " . USERPREFIX . "_users WHERE name = '$user_found'"); + + $uid = $user_found['user_id']; + } + + if ($user_found['name']) + { + echo_top(); + + echo_title($f_lg['mod_config_set']); + + echo "
    "; + + echo ""; + + require_once SYSTEM_DIR.'/forum/admin/moderation.php'; + + echo "
    "; + + echo "
    "; + + echo "
    "; + + echo_bottom(); + } + + else + { + echo_top(); + + echo_title($f_lg['mod_search_user']); + + echo "
    "; + + echo " + + + + + + +
    {$f_lg['mod_search_name']}
     
    "; + + echo "
    "; + + echo_bottom(); + } + + break; + + case "moderator_add": + + $user_found = $db->super_query("SELECT * FROM " . USERPREFIX . "_users WHERE user_id = '$uid'"); + + if ($user_found['user_id'] and $fid) + { + $row = $db->super_query("SELECT * FROM " . PREFIX . "_forum_moderators WHERE member_id = '$uid' and forum_id = '$fid'"); + + $moderator_id = $row['mid']; + + if (!$moderator_id) + { + $db->query("INSERT INTO " . PREFIX . "_forum_moderators (member_id, member_name, forum_id) values ('$uid', '$user_found[name]', '$fid')"); + + $moderator_id = $db->insert_id(); + } + + $db->query("UPDATE " . PREFIX . "_forum_moderators SET edit_post = '$save[edit_post]', delete_topic = '$save[delete_topic]', edit_topic = '$save[edit_topic]', edit_post = '$save[edit_post]', delete_post = '$save[delete_post]', open_topic = '$save[open_topic]', close_topic = '$save[close_topic]', delete_post = '$save[delete_post]', move_topic = '$save[move_topic]', pin_topic = '$save[pin_topic]', delete_topic = '$save[delete_topic]', unpin_topic = '$save[unpin_topic]', mass_prune = '$save[mass_prune]', combining_post = '$save[combining_post]', move_post = '$save[move_post]' WHERE mid = '$moderator_id'"); + + $new_row = $db->query("SELECT mid, member_id FROM " . PREFIX . "_forum_moderators WHERE forum_id = '$fid'"); + + while ($row = $db->get_row($new_row)) + { + $update_uid[$row['member_id']] = $row['member_id']; + } + + $update_uid = implode(':', $update_uid); + + $db->query("UPDATE " . PREFIX . "_forum_forums SET moderators = '$update_uid' WHERE id = '$fid'"); + + $fcache->delete('forum_moderators'); + $fcache->delete('forums_array'); + + msg("info",$f_lg['mod_add'], $f_lg['mod_add2'], "?mod=forum&action=content"); + } + + break; + + case "moderator_edit": + + if (intval($id)) + { + $row = $db->super_query("SELECT * FROM " . PREFIX . "_forum_moderators WHERE mid = '$id'"); + + $moderator_edit = true; + + echo_top(); + + echo_title($f_lg['mod_config_set']); + + echo "
    "; + + echo ""; + + require_once SYSTEM_DIR.'/forum/admin/moderation.php'; + + echo "
    "; + + echo "
    "; + + echo "
    "; + + echo_bottom(); + } + + break; + + case "moderator_save": + + if ($id) + { + $db->query("UPDATE " . PREFIX . "_forum_moderators SET edit_post = '$save[edit_post]', delete_topic = '$save[delete_topic]', edit_topic = '$save[edit_topic]', edit_post = '$save[edit_post]', delete_post = '$save[delete_post]', open_topic = '$save[open_topic]', close_topic = '$save[close_topic]', delete_post = '$save[delete_post]', move_topic = '$save[move_topic]', pin_topic = '$save[pin_topic]', delete_topic = '$save[delete_topic]', unpin_topic = '$save[unpin_topic]', mass_prune = '$save[mass_prune]' WHERE mid = '$id'"); + + $fcache->delete('forum_moderators'); + + msg("info",$f_lg['mod_edit_ok'], $f_lg['mod_edit_ok2'], "?mod=forum&action=content"); + } + + break; + + case "moderator_del": + + if ($id) + { + $row = $db->super_query("SELECT * FROM " . PREFIX . "_forum_moderators WHERE mid = '$id'"); + + $fid = $row['forum_id']; + + if ($row['member_id']) + { + $db->query("DELETE FROM " . PREFIX . "_forum_moderators WHERE mid = '$id'"); + + $row_forum = $db->super_query("SELECT moderators FROM " . PREFIX . "_forum_forums WHERE id = '$fid'"); + + $new_row = $db->query("SELECT mid, member_id FROM " . PREFIX . "_forum_moderators WHERE forum_id = '$fid'"); + + while ($row = $db->get_row($new_row)) + { + $update_uid[$row['member_id']] = $row['member_id']; + } + + $update_uid = implode(':', $update_uid); + + $db->query("UPDATE " . PREFIX . "_forum_forums SET moderators = '$update_uid' WHERE id = '$fid'"); + + $fcache->delete('forum_moderators'); + $fcache->delete('forums_array'); + + header("Location: ?mod=forum&action=content"); + } + } + + break; + +// ******************************************************************************** +// HELP +// ******************************************************************************** + case "help": + + echoheader("", ""); + + echo_top('about'); + + echo_title("DLE Forum Version 2.4 Build 1"); + + $licence_file = @file_get_contents(SYSTEM_DIR.'/forum/sources/components/licence.odf'); + + echo "
    ".urldecode($licence_file)."
    "; + + echo_bottom('about'); + + echo_top('authors'); + + echo_title("Developers"); + + echo "
    "; + + echo "Author & Developer:  Vadim Shestakov [ShVad]

    "; + + echo "

    "; + + echo "
    WebMoney:   R164056126473    Z217028877385    E194208009125    U374273141801

    Copyright 2008 © DLE Files Group. All rights reserved.
    "; + + echo "
    "; + + echo_bottom('authors'); + + echofooter(); + + break; + +// ******************************************************************************** +// EMAIL +// ******************************************************************************** + case "email": + + require_once SYSTEM_DIR.'/inc/forum/email.php'; + + break; + +// ******************************************************************************** +// USER GROUP +// ******************************************************************************** + case "usergroup": + + require_once SYSTEM_DIR.'/inc/forum/usergroup.php'; + + break; + +// ******************************************************************************** +// SERVICE +// ******************************************************************************** + case "service": + + require_once SYSTEM_DIR.'/inc/forum/service.php'; + + break; + +// ******************************************************************************** +// CLEAR CACHE +// ******************************************************************************** + case "clear": + + $fcache->delete(); + + $fcache->clear(); + + header("Location: ?mod=forum"); + + break; + } + +?> \ No newline at end of file diff --git a/system/inc/forum/functions.php b/system/inc/forum/functions.php new file mode 100644 index 0000000..bff7917 --- /dev/null +++ b/system/inc/forum/functions.php @@ -0,0 +1,261 @@ + + +function access_check( id, value ) +{ + if (value == 'y'){ value = 1; } else { value = 0; } + + document.getElementById( 'access_mod' + '[' + id + ']' ).checked = value; + + document.getElementById( 'access_topic' + '[' + id + ']' ).checked = value; + + document.getElementById( 'access_write' + '[' + id + ']' ).checked = value; + + document.getElementById( 'access_read' + '[' + id + ']' ).checked = value; + + document.getElementById( 'access_upload' + '[' + id + ']' ).checked = value; + + document.getElementById( 'access_download' + '[' + id + ']' ).checked = value; +} + + +HTML; + + if ($forum_id) + { + $access_result = $db->query("SELECT * FROM " . PREFIX . "_forum_forums WHERE id = '$forum_id'"); + + while ($row = $db->get_row($access_result)) + { + $access_mod = $row['access_mod']; + + $access_topic = $row['access_topic']; + + $access_write = $row['access_write']; + + $access_read = $row['access_read']; + + $access_upload = $row['access_upload']; + + $access_download = $row['access_download']; + } + } + + $access_forum .= " + + + + + + + +
    {$f_lg['access_forum_group']}
    {$f_lg['access_forum_mod']}
    {$f_lg['access_forum_topic']}
    {$f_lg['access_forum_write']}
    {$f_lg['access_forum_read']}
    {$f_lg['access_forum_upload']}
    {$f_lg['access_forum_download']}
    +
    "; + + $access_forum .= ""; + + foreach($user_group as $id => $group_name) + { + if ($forum_id) + { + $access_mod_array = explode(":",$access_mod); + if (in_array($id, $access_mod_array)){$checked1 = "checked";}else{$checked1 = "";} + + $access_topic_array = explode(":",$access_topic); + if (in_array($id, $access_topic_array)){$checked2 = "checked";}else{$checked2 = "";} + + $access_write_array = explode(":",$access_write); + if (in_array($id, $access_write_array)){$checked3 = "checked";}else{$checked3 = "";} + + $access_read_array = explode(":",$access_read); + if (in_array($id, $access_read_array)){$checked4 = "checked";}else{$checked4 = "";} + + $access_upload_array = explode(":",$access_upload); + if (in_array($id, $access_upload_array)){$checked5 = "checked";}else{$checked5 = "";} + + $access_download_array = explode(":",$access_download); + if (in_array($id, $access_download_array)){$checked6 = "checked";}else{$checked6 = "";} + } + + $access_forum .= " + + + + + + + + "; + } + + $access_forum .= "
    + {$group_name[group_name]} [+ | + -] + +
    +
    +
    +
    +
    +
    "; + + return($access_forum); +} + +// ******************************************************************************** +// Category list +// ******************************************************************************** +function category_list($select_id){ + global $db, $category_list; + + $result = $db->query("SELECT * FROM " . PREFIX . "_forum_category"); + + while ($row = $db->get_row($result)){ + + if ($row['sid'] == $select_id){$sel = "selected";} + + else {$sel = "";} + + $row['cat_name'] = stripcslashes($row['cat_name']); + + $category_list .= ""; + } + + return($category_list); +} + +// ******************************************************************************** +// Forum list +// ******************************************************************************** +function forum_list($select_id){ + global $db, $forum_list; + + $forum_list .= ""; + + $result = $db->query("SELECT * FROM " . PREFIX . "_forum_category LEFT JOIN ". PREFIX ."_forum_forums ON ". PREFIX ."_forum_category.sid=". PREFIX ."_forum_forums.main_id ORDER BY posi, position"); + + for ($i = 0; $row = $db->get_row($result_content); $i = $row['sid']){ + + if ($row['sid'] != $i) + { + $row['cat_name'] = stripcslashes($row['cat_name']); + + $forum_list .= ""; + } + + if ($row['name']) + { + if ($row['id'] == $select_id){$sel = "selected";} + + else {$sel = "";} + + $row['name'] = stripcslashes($row['name']); + + $forum_list .= ""; + } + + } + + return($forum_list); +} + +// ******************************************************************************** +// Category and Forum POSITION +// ******************************************************************************** +function category_posi($category_posi, $category_id, $result_posi){ + global $db; + + $cat_posi = array(); + + $select_posi = ""; + + return ($select_posi); +} + +// ******************************************************************************** +// SELECT USER GROUP +// ******************************************************************************** +function warn_group($warn_group = false){ + global $db; + + if ($warn_group) + { + $warn_list = explode (':', $warn_group); + } + + $db->query("SELECT * FROM " . USERPREFIX . "_usergroups GROUP BY id"); + + $group_list .= ""; + + while($row = $db->get_row()) + { + if ($warn_group) + { + if (in_array($row['id'], $warn_list)) + { + $selected = "selected"; + } else + { + $selected = ""; + } + } + + $group_list .= ""; + } + + return ($group_list); +} + +?> \ No newline at end of file diff --git a/system/inc/forum/ico/Usergroup.png b/system/inc/forum/ico/Usergroup.png new file mode 100644 index 0000000..fd8a037 Binary files /dev/null and b/system/inc/forum/ico/Usergroup.png differ diff --git a/system/inc/forum/ico/category.png b/system/inc/forum/ico/category.png new file mode 100644 index 0000000..375a7c5 Binary files /dev/null and b/system/inc/forum/ico/category.png differ diff --git a/system/inc/forum/ico/content.png b/system/inc/forum/ico/content.png new file mode 100644 index 0000000..3961a6b Binary files /dev/null and b/system/inc/forum/ico/content.png differ diff --git a/system/inc/forum/ico/discuss.png b/system/inc/forum/ico/discuss.png new file mode 100644 index 0000000..1b4894d Binary files /dev/null and b/system/inc/forum/ico/discuss.png differ diff --git a/system/inc/forum/ico/dle_forum.png b/system/inc/forum/ico/dle_forum.png new file mode 100644 index 0000000..73e9fd0 --- /dev/null +++ b/system/inc/forum/ico/dle_forum.png @@ -0,0 +1,39 @@ +$forum_bar, + '{last_visit}'=>$dle_forum_last_visit, + '{now_time}'=>langdate($forum_config['timestamp'],$_TIME), + '{STATS}'=>$tpl->result['forum_stats'], + '[search-link]'=>"", + '[/search-link]'=> '', + '[getnew-link]'=>"", + '[/getnew-link]'=> '', + '[subscription-link]'=>"", + '[/subscription-link]'=>'', + '[textversion]'=>"", + '[/textversion]'=>'',); + $f_set="set"; + $compile="compile"; + $f_get="get"; + + if(!defined('FORUM_SUB_DOMAIN')) + { + $forum_ajax="\r\n\r\n"; + $tpl->load_template($tpl_dir.'main.tpl'); + $tpl->copy_template = "{$forum_ajax}".$tpl->copy_template; + } + $tpl->$f_set('{BOARD}',$tpl->result['dle_forum']); + $tpl->$f_set('', $forum_content); + $copyrigt=true; + + $f_file_get_contents="file_get_contents"; + + $f_clear="clear"; + $tpl->$compile("content"); + $tpl->$f_clear(); +?> \ No newline at end of file diff --git a/system/inc/forum/ico/filebrowser_action.gif b/system/inc/forum/ico/filebrowser_action.gif new file mode 100644 index 0000000..6fe91c1 Binary files /dev/null and b/system/inc/forum/ico/filebrowser_action.gif differ diff --git a/system/inc/forum/ico/filebrowser_action2.gif b/system/inc/forum/ico/filebrowser_action2.gif new file mode 100644 index 0000000..e068f6f Binary files /dev/null and b/system/inc/forum/ico/filebrowser_action2.gif differ diff --git a/system/inc/forum/ico/forum.png b/system/inc/forum/ico/forum.png new file mode 100644 index 0000000..2cba9ee Binary files /dev/null and b/system/inc/forum/ico/forum.png differ diff --git a/system/inc/forum/ico/global.png b/system/inc/forum/ico/global.png new file mode 100644 index 0000000..a5714fe Binary files /dev/null and b/system/inc/forum/ico/global.png differ diff --git a/system/inc/forum/ico/help.png b/system/inc/forum/ico/help.png new file mode 100644 index 0000000..777b3b0 Binary files /dev/null and b/system/inc/forum/ico/help.png differ diff --git a/system/inc/forum/ico/index.html b/system/inc/forum/ico/index.html new file mode 100644 index 0000000..adee325 --- /dev/null +++ b/system/inc/forum/ico/index.html @@ -0,0 +1 @@ + DLE Forum

    403: DLE Forum -> Forbidden


    You have reached this Page in error, please use your back button to return to DLE Forum.
    DleKey.cn \ No newline at end of file diff --git a/system/inc/forum/ico/licence.png b/system/inc/forum/ico/licence.png new file mode 100644 index 0000000..4d4c73f Binary files /dev/null and b/system/inc/forum/ico/licence.png differ diff --git a/system/inc/forum/ico/modules.png b/system/inc/forum/ico/modules.png new file mode 100644 index 0000000..9433e52 Binary files /dev/null and b/system/inc/forum/ico/modules.png differ diff --git a/system/inc/forum/ico/mset.png b/system/inc/forum/ico/mset.png new file mode 100644 index 0000000..3aaabf0 Binary files /dev/null and b/system/inc/forum/ico/mset.png differ diff --git a/system/inc/forum/ico/news.png b/system/inc/forum/ico/news.png new file mode 100644 index 0000000..403fb96 Binary files /dev/null and b/system/inc/forum/ico/news.png differ diff --git a/system/inc/forum/ico/preventions.png b/system/inc/forum/ico/preventions.png new file mode 100644 index 0000000..7668b93 Binary files /dev/null and b/system/inc/forum/ico/preventions.png differ diff --git a/system/inc/forum/ico/rank.png b/system/inc/forum/ico/rank.png new file mode 100644 index 0000000..13747f7 Binary files /dev/null and b/system/inc/forum/ico/rank.png differ diff --git a/system/inc/forum/ico/safety.png b/system/inc/forum/ico/safety.png new file mode 100644 index 0000000..3f0c8f3 Binary files /dev/null and b/system/inc/forum/ico/safety.png differ diff --git a/system/inc/forum/ico/service.png b/system/inc/forum/ico/service.png new file mode 100644 index 0000000..1592c71 Binary files /dev/null and b/system/inc/forum/ico/service.png differ diff --git a/system/inc/forum/ico/show.png b/system/inc/forum/ico/show.png new file mode 100644 index 0000000..37913e1 Binary files /dev/null and b/system/inc/forum/ico/show.png differ diff --git a/system/inc/forum/ico/speed.png b/system/inc/forum/ico/speed.png new file mode 100644 index 0000000..f2fb5fb Binary files /dev/null and b/system/inc/forum/ico/speed.png differ diff --git a/system/inc/forum/ico/tools.png b/system/inc/forum/ico/tools.png new file mode 100644 index 0000000..11b8deb Binary files /dev/null and b/system/inc/forum/ico/tools.png differ diff --git a/system/inc/forum/ico/uploads.png b/system/inc/forum/ico/uploads.png new file mode 100644 index 0000000..b65398d Binary files /dev/null and b/system/inc/forum/ico/uploads.png differ diff --git a/system/inc/forum/ico/usersgroup.png b/system/inc/forum/ico/usersgroup.png new file mode 100644 index 0000000..a4a5e32 Binary files /dev/null and b/system/inc/forum/ico/usersgroup.png differ diff --git a/system/inc/forum/init.class.php b/system/inc/forum/init.class.php new file mode 100644 index 0000000..bce18cb --- /dev/null +++ b/system/inc/forum/init.class.php @@ -0,0 +1,19 @@ + \ No newline at end of file diff --git a/system/inc/forum/service.php b/system/inc/forum/service.php new file mode 100644 index 0000000..7c884ea --- /dev/null +++ b/system/inc/forum/service.php @@ -0,0 +1,123 @@ + + + + + + + + + +
    {$f_lg['titles_uname']} {$f_lg['svce_full']}
     
    "; + + echo_bottom('1'); + + echo_top('1'); + + echo_top('1'); + + echo_title('Очистка журнала просмотра тем'); + + echo "
    + Будет очищен журнал просмотра тем. Все темы до данного времени будут иметь статус прочитанных. + + + + + + +
     
    "; + + echo_bottom('1'); + + echo_top('1'); + + echo_title('Очистка журнала голосований'); + + echo "
    + При очистке журнала, пользователи смогут повторно голосовать. + + + + + + +
     
    "; + + echo_bottom('1'); + + echo_bottom(); + + break; + +// ******************************************************************************** +// SUBSCRIPTION +// ******************************************************************************** + case "subscription": + + $user_name = $db->safesql($_REQUEST['user_name']); + + if ($user_name) + { + $row = $db->super_query("SELECT user_id FROM " . PREFIX . "_users WHERE name = '{$user_name}'"); + } + + if ($row['user_id']) + { + $db->query("DELETE FROM " . PREFIX . "_forum_subscription WHERE user_id = '{$row['user_id']}'"); + } + + if (!$user_name) + { + $db->query("TRUNCATE TABLE " . PREFIX . "_forum_subscription"); + } + + header("Location: ?mod=forum&action=service"); + + break; + +// ******************************************************************************** +// VIEWS LOG +// ******************************************************************************** + case "views": + + $db->query("TRUNCATE TABLE " . PREFIX . "_forum_views"); + + $db->query("UPDATE " . PREFIX . "_users SET forum_last = '".time()."', forum_time = '".time()."'"); + + $_SESSION['member_lasttime'] = time(); + + header("Location: ?mod=forum&action=service"); + + break; + +// ******************************************************************************** +// POLL LOG +// ******************************************************************************** + case "poll": + + $db->query("TRUNCATE TABLE " . PREFIX . "_forum_poll_log"); + + header("Location: ?mod=forum&action=service"); + + break; + + } + +?> \ No newline at end of file diff --git a/system/inc/forum/table.php b/system/inc/forum/table.php new file mode 100644 index 0000000..f9fa283 --- /dev/null +++ b/system/inc/forum/table.php @@ -0,0 +1,208 @@ +DLE Forum"; + echo echo_bottom (x); + } +} + +echo << + + + + + + + + + + + + + + + +
    +HTML; +} + +function echo_bottom($echofooter = false) +{ +echo << +
    + +HTML; + +if (!$echofooter) echofooter(); +} + +function echo_title($title) +{ +echo <<
    +
    +HTML; +} + +function echo_stats($forum_config, $forum_stats) +{ +global $f_lg; + +echo " + + + + + + + + + + + + + + + + + + +
    {$f_lg['forum_status']}{$forum_stats['line']}
    {$f_lg['forum_topic']}{$forum_stats['topics']}
    {$f_lg['forum_posts']}{$forum_stats['posts']}
    {$f_lg['forum_db_size']}{$forum_stats['db_size']}
    {$f_lg['forum_files']}{$forum_stats['sum_size']}
    {$f_lg['forum_cache']}{$forum_stats['cache']}
    +
    +"; +} + +if(!defined('DLE_FORUM')){ exit; } + +function forum_menu() +{ +global $f_lg; + +echo << + +function MenuCategory( m_id ){ + +var menu=new Array() +var lang_action = ""; + +menu[0]='{$f_lg['java_add_forum']}'; +menu[1]='{$f_lg['java_sort_f']}'; +menu[2]='{$f_lg['java_access']}'; +menu[3]='{$f_lg['java_edit']}'; +menu[4]='{$f_lg['java_del']}'; + +return menu; +} + +function MenuForum( m_id, sub ){ + +var menu=new Array() + +menu[1]='{$f_lg['java_moderator']}'; + +menu[2]='{$f_lg['java_edit']}'; + +if (!sub){ +menu[3]='{$f_lg['java_ssort']}'; +} + +menu[4]='{$f_lg['java_del']}'; + +return menu; +} + +function Moderators( m_id ){ + +var menu=new Array() + +menu[1]='{$f_lg['java_edit']}'; + +menu[2]='{$f_lg['java_del']}'; + +return menu; +} + + + +HTML; +} + +$options = array( + array( + 'name' => $f_lg['m_new_cat'], + 'url' => "$PHP_SELF?mod=forum&action=category", + 'descr' => $f_lg['m_new_cat2'], + 'image' => "category.png", + 'access' => "1", + ), + + array( + 'name' => $f_lg['m_new_forum'], + 'url' => "$PHP_SELF?mod=forum&action=forum", + 'descr' => $f_lg['m_new_forum2'], + 'image' => "forum.png", + 'access' => "1", + ), + + array( + 'name' => $f_lg['m_content'], + 'url' => "$PHP_SELF?mod=forum&action=content", + 'descr' => $f_lg['m_content2'], + 'image' => "content.png", + 'access' => "1", + ), + + array( + 'name' => $f_lg['m_usergroup'], + 'url' => "$PHP_SELF?mod=forum&action=usergroup", + 'descr' => $f_lg['m_usergroup2'], + 'image' => "usersgroup.png", + 'access' => "1", + ), + + array( + 'name' => $f_lg['m_rank'], + 'url' => "$PHP_SELF?mod=forum&action=rank", + 'descr' => $f_lg['m_rank2'], + 'image' => "rank.png", + 'access' => "1", + ), + + array( + 'name' => $f_lg['m_tools'], + 'url' => "$PHP_SELF?mod=forum&action=tools", + 'descr' => $f_lg['m_tools2'], + 'image' => "tools.png", + 'access' => "1", + ), + + array( + 'name' => $f_lg['m_service'], + 'url' => "$PHP_SELF?mod=forum&action=service", + 'descr' => $f_lg['m_service2'], + 'image' => "service.png", + 'access' => "1", + ), + + array( + 'name' => $f_lg['m_email'], + 'url' => "$PHP_SELF?mod=forum&action=email", + 'descr' => $f_lg['m_email2'], + 'image' => "mset.png", + 'access' => "1", + ), + + ); + +?> \ No newline at end of file diff --git a/system/inc/forum/tools.php b/system/inc/forum/tools.php new file mode 100644 index 0000000..be75bad --- /dev/null +++ b/system/inc/forum/tools.php @@ -0,0 +1,268 @@ + + + function ChangeOption(selectedOption) { + + document.getElementById('global').style.display = "none"; + document.getElementById('show').style.display = "none"; + document.getElementById('safety').style.display = "none"; + document.getElementById('modules').style.display = "none"; + document.getElementById('speed').style.display = "none"; + document.getElementById('uploads').style.display = "none"; + + if(selectedOption == 'global') {document.getElementById('global').style.display = "";} + if(selectedOption == 'show') {document.getElementById('show').style.display = "";} + if(selectedOption == 'safety') {document.getElementById('safety').style.display = "";} + if(selectedOption == 'modules') {document.getElementById('modules').style.display = "";} + if(selectedOption == 'speed') {document.getElementById('speed').style.display = "";} + if(selectedOption == 'uploads') {document.getElementById('uploads').style.display = "";} + + } + + +HTML; + + // TOOLS MENU // + + echo_top('tools_menu'); + + echo_title($f_lg['tools_menu']); + +echo << + + + + + +
    + + + + + + +
    + + + +HTML; + + echo_bottom('tools_menu'); + +// ******************************************************************************** +// TOOLS +// ******************************************************************************** + + // globals tools + + echo "
    "; + + echo_top('tools_global'); + + echo_title($f_lg['tools_global']); + + echo ""; + + showRow($f_lg['tools_name'], $f_lg['tools_name_'], ""); + + showRow($f_lg['tools_url'], $f_lg['tools_url_'], ""); + + showRow($f_lg['meta_description'], $f_lg['meta_description2'], ""); + + showRow($f_lg['meta_keywords'], $f_lg['meta_keywords2'], ""); + + showRow($f_lg['meta_topic'], $f_lg['meta_topic2'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[meta_topic]", "{$forum_config['meta_topic']}")); + + showRow($f_lg['tools_abc_last'], $f_lg['tools_abc_last1'], ""); + + showRow($f_lg['tools_mrewrite'], $f_lg['tools_mrewrite_'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[mod_rewrite]", "{$forum_config['mod_rewrite']}")); + + showRow($f_lg['tools_offline'], $f_lg['tools_offline_'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[offline]", "{$forum_config['offline']}")); + + showRow($f_lg['tools_timestamp'], $f_lg['tools_timestamp2'], ""); + + showRow($f_lg['tools_sessions'], $f_lg['tools_sessions_'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[sessions_log]", "{$forum_config['sessions_log']}")); + + showRow($f_lg['tools_ses_time'], $f_lg['tools_ses_time_'], ""); + + showRow($f_lg['tools_stats'], $f_lg['tools_stats_'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[stats]", "{$forum_config['stats']}")); + + showRow($f_lg['tools_online'], $f_lg['tools_online_'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[online]", "{$forum_config['online']}")); + + showRow($f_lg['tools_forum_bar'], $f_lg['tools_forum_bar_'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[forum_bar]", "{$forum_config['forum_bar']}")); + + echo "
    "; + + echo_bottom('tools_global'); + + echo "
    "; + + // topics, posts + + echo ""; + + // safety + + echo ""; + + // modules + + echo ""; + + // speed + + echo ""; + + // uploads + + echo ""; +?> \ No newline at end of file diff --git a/system/inc/forum/usergroup.php b/system/inc/forum/usergroup.php new file mode 100644 index 0000000..3b5b8e3 --- /dev/null +++ b/system/inc/forum/usergroup.php @@ -0,0 +1,162 @@ +query("SELECT * FROM " . USERPREFIX . "_usergroups ORDER BY id ASC"); + + while ($row = $db->get_row()) + { + $user_group[$row['id']] = array (); + + foreach ($row as $key => $value) + { + $user_group[$row['id']][$key] = $value; + } + } + + $db->free(); + + switch ($subaction) + { + case "": + + $db->query("SELECT user_group, count(*) as count FROM " . USERPREFIX . "_users GROUP BY user_group"); + + while($row = $db->get_row()) + { + $count_list[$row['user_group']] = $row['count']; + } + + $db->free(); + + foreach ($user_group as $group) + { + $count = intval ($count_list[$group['id']]); + + $entries .= " + +   {$group['id']} + {$group['group_name']} + $count + + + "; + } + + echo_top(); + +echo << + + +HTML; + + echo_title($f_lg['group_list']); + + echo " + + + + + + + "; + + echo $entries."
      ID{$f_lg['group_name']}{$f_lg['group_users']} 
    "; + + echo_bottom(); + + break; + + case "edit": + + if ($id) + { + $row = $db->super_query("SELECT * FROM " . PREFIX . "_forum_moderators WHERE group_id = '$id'"); + + echo_top(); + + echo_title ($f_lg['group_moderation']." ".$user_group[$id]['group_name']); + + echo "
    "; + + echo ""; + + showRadio($f_lg['mod_edit_topic'], $f_lg[''], "edit_topic", $row); + + showRadio($f_lg['mod_del_topic'], $f_lg[''], "delete_topic", $row); + + showRadio($f_lg['mod_edit_post'], $f_lg[''], "edit_post", $row); + + showRadio($f_lg['mod_del_post'], $f_lg[''], "delete_post", $row); + + showRadio($f_lg['mod_open_topic'], $f_lg[''], "open_topic", $row); + + showRadio($f_lg['mod_close_topic'], $f_lg[''], "close_topic", $row); + + showRadio($f_lg['mod_move_topic'], $f_lg[''], "move_topic", $row); + + showRadio($f_lg['mod_fixed_topic'], $f_lg[''], "pin_topic", $row); + + showRadio($f_lg['mod_defixed_topic'], $f_lg[''], "unpin_topic", $row); + + showRadio($f_lg['mod_multi_moderation'], $f_lg[''], "mass_prune", $row); + + showRadio($f_lg['mod_combining_post'], $f_lg[''], "combining_post", $row); + + showRadio($f_lg['mod_move_post'], $f_lg[''], "move_post", $row); + + echo "
    "; + + echo_bottom('bottom'); + + echo_top('top'); + + echo "
    "; + + echo_bottom(); + } + + break; + + case "doedit": + + if ($id) + { + $m_group = $db->super_query("SELECT group_id FROM " . PREFIX . "_forum_moderators WHERE group_id = '$id'"); + + if (!$m_group['group_id']) + { + $db->query("INSERT INTO " . PREFIX . "_forum_moderators (group_id) values ('$id')"); + } + + $db->query("UPDATE " . PREFIX . "_forum_moderators SET edit_post = '$save[edit_post]', delete_topic = '$save[delete_topic]', edit_topic = '$save[edit_topic]', edit_post = '$save[edit_post]', delete_post = '$save[delete_post]', open_topic = '$save[open_topic]', close_topic = '$save[close_topic]', delete_post = '$save[delete_post]', move_topic = '$save[move_topic]', pin_topic = '$save[pin_topic]', delete_topic = '$save[delete_topic]', unpin_topic = '$save[unpin_topic]', mass_prune = '$save[mass_prune]', combining_post = '$save[combining_post]', move_post = '$save[move_post]' WHERE group_id = '$id'"); + } + + $fcache->delete('forum_moderators.php'); + + msg("info",$f_lg['group_edit_ok'], $f_lg['group_edit_ok2'], "?mod=forum"); + + break; + } +?> \ No newline at end of file diff --git a/system/inc/googlemap.php b/system/inc/googlemap.php new file mode 100644 index 0000000..c34fb6f --- /dev/null +++ b/system/inc/googlemap.php @@ -0,0 +1,150 @@ +limit = intval($_POST['limit']); + $map->news_priority = strip_tags(stripslashes($_POST['priority'])); + $map->stat_priority = strip_tags(stripslashes($_POST['stat_priority'])); + $map->cat_priority = strip_tags(stripslashes($_POST['cat_priority'])); + + $row = $db->super_query( "SELECT COUNT(*) as count FROM " . PREFIX . "_post" ); + if ( !$map->limit ) $map->limit = $row['count']; + + if ( $map->limit > 45000 ) { + + $pages_count = @ceil( $row['count'] / 40000 ); + + $sitemap = $map->build_index( $pages_count ); + + $handler = fopen(ROOT_DIR. "/uploads/sitemap.xml", "wb+"); + fwrite($handler, $sitemap); + fclose($handler); + + @chmod(ROOT_DIR. "/uploads/sitemap.xml", 0666); + + $sitemap = $map->build_stat(); + + $handler = fopen(ROOT_DIR. "/uploads/sitemap1.xml", "wb+"); + fwrite($handler, $sitemap); + fclose($handler); + + @chmod(ROOT_DIR. "/uploads/sitemap1.xml", 0666); + + for ($i =0; $i < $pages_count; $i++) { + $t = $i+2; + $n = $n+1; + + $sitemap = $map->build_map_news( $n ); + + $handler = fopen(ROOT_DIR. "/uploads/sitemap{$t}.xml", "wb+"); + fwrite($handler, $sitemap); + fclose($handler); + + @chmod(ROOT_DIR. "/uploads/sitemap{$t}.xml", 0666); + + } + + + } else { + + $sitemap = $map->build_map(); + + $handler = fopen(ROOT_DIR. "/uploads/sitemap.xml", "wb+"); + fwrite($handler, $sitemap); + fclose($handler); + + @chmod(ROOT_DIR. "/uploads/sitemap.xml", 0666); + } +} + +echoheader("", ""); + + +echo << +
    + + + + + + + + + + + + + + + + +
    + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
     
    +HTML; + + if(!@file_exists(ROOT_DIR. "/uploads/sitemap.xml")){ + echo $lang['no_google_map']; + } else { + + $file_date = date("d.m.Y H:i", filectime(ROOT_DIR. "/uploads/sitemap.xml")); + $map_link = $config['http_home_url']."sitemap.xml"; + echo "
    ".$file_date.""; + echo "

    Google | Yahoo | Bing | Ask
    "; + } + + +echo << +
     
    {$lang['google_nnum']}[?]
    {$lang['google_stat_priority']}[?]
    {$lang['google_priority']}
    {$lang['google_cat_priority']}
     
    +
    +
    +HTML; +echofooter(); +?> \ No newline at end of file diff --git a/system/inc/include/functions.inc.php b/system/inc/include/functions.inc.php new file mode 100644 index 0000000..889bab0 --- /dev/null +++ b/system/inc/include/functions.inc.php @@ -0,0 +1,620 @@ + 0) { + $uptimeString .= $days; + $uptimeString .= (($days == 1) ? " day" : " days"); + } + if ($hours > 0) { + $uptimeString .= (($days > 0) ? ", " : "") . $hours; + $uptimeString .= (($hours == 1) ? " hour" : " hours"); + } + if ($mins > 0) { + $uptimeString .= (($days > 0 || $hours > 0) ? ", " : "") . $mins; + $uptimeString .= (($mins == 1) ? " minute" : " minutes"); + } + if ($secs > 0) { + $uptimeString .= (($days > 0 || $hours > 0 || $mins > 0) ? ", " : "") . $secs; + $uptimeString .= (($secs == 1) ? " second" : " seconds"); + } + return $uptimeString; +} + +function dirsize($directory) { + if( ! is_dir( $directory ) ) return - 1; + $size = 0; + if( $DIR = opendir( $directory ) ) { + while ( ($dirfile = readdir( $DIR )) !== false ) { + if( @is_link( $directory . '/' . $dirfile ) || $dirfile == '.' || $dirfile == '..' ) continue; + if( @is_file( $directory . '/' . $dirfile ) ) $size += filesize( $directory . '/' . $dirfile ); + else if( @is_dir( $directory . '/' . $dirfile ) ) { + $dirSize = dirsize( $directory . '/' . $dirfile ); + if( $dirSize >= 0 ) $size += $dirSize; + else return - 1; + } + } + closedir( $DIR ); + } + return $size; +} + +function check_login($username, $md5_password, $post = true) { + global $member_id, $db, $user_group, $lang, $_IP, $_TIME, $config; + + if( $username == "" OR $md5_password == "" ) return false; + $result = false; + + if( $post ) { + $username = $db->safesql( $username ); + $md5_password = md5( $md5_password ); + + if ( preg_match( "/[\||\'|\<|\>|\"|\!|\?|\$|\@|\/|\\\|\&\~\*\+]/", $username) ) return false; $where_name = "name='{$username}'"; + + $member_id = $db->super_query( "SELECT * FROM " . USERPREFIX . "_users WHERE {$where_name} AND password='{$md5_password}'" ); + + if( $member_id['user_id'] and $user_group[$member_id['user_group']]['allow_admin'] and $member_id['banned'] != 'yes' ) $result = TRUE; + else $member_id = array (); + } else { + + $username = intval( $username ); + $md5_password = md5( $md5_password ); + + $member_id = $db->super_query( "SELECT * FROM " . USERPREFIX . "_users WHERE user_id='$username'" ); + + if( $member_id['user_id'] AND $member_id['password'] AND $member_id['password'] == $md5_password AND $user_group[$member_id['user_group']]['allow_admin'] AND $member_id['banned'] != 'yes' ) $result = TRUE; + else $member_id = array (); + } + + if( $result ) { + if( !allowed_ip( $row['allowed_ip'] ) ) { + $member_id = array (); + $result = false; + set_cookie( "dle_user_id", "", 0 ); + set_cookie( "dle_name", "", 0 ); + set_cookie( "dle_password", "", 0 ); + set_cookie( "dle_hash", "", 0 ); + @session_destroy(); + @session_unset(); + set_cookie( session_name(), "", 0 ); + + msg( "info", $lang['index_msge'], $lang['ip_block'] ); + } + } + return $result; +} + +function mksize($bytes) { + if ($bytes < 1000) + return $bytes. " b"; + if ($bytes < 1000 * 1024) + return number_format($bytes / 1024, 2) . " Kb"; + if ($bytes < 1000 * 1048576) + return number_format($bytes / 1048576, 2) . " Mb"; + if ($bytes < 1000 * 1073741824) + return number_format($bytes / 1073741824, 2) . " Gb"; + if ($bytes < 1000 * 1099511627776) + return number_format($bytes / 1099511627776, 2) . " Tb"; + if ($bytes < 1000 * 1125899906842620) + return number_format($bytes / 1125899906842620, 2) . " Pb"; + if ($bytes < 1000 * 1152921504606850000) + return number_format($bytes / 1152921504606850000, 2) . " Eb"; +} + +function CheckCanGzip() { + + if( headers_sent() || connection_aborted() || ! function_exists( 'ob_gzhandler' ) || ini_get( 'zlib.output_compression' ) ) return 0; + + if( strpos( $_SERVER['HTTP_ACCEPT_ENCODING'], 'x-gzip' ) !== false ) return "x-gzip"; + if( strpos( $_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip' ) !== false ) return "gzip"; + + return 0; +} + +function GzipOut() { + global $Timer, $db; + + $ENCODING = CheckCanGzip(); + + if( $ENCODING ) { + $Contents = ob_get_contents(); + ob_end_clean(); + + header( "Content-Encoding: $ENCODING" ); + + $Contents = gzencode( $Contents, 1, FORCE_GZIP ); + echo $Contents; + + exit(); + } else { + // ob_end_flush(); + exit(); + } +} + +class microTimer { + function start() { + global $starttime; + $mtime = microtime(); + $mtime = explode( ' ', $mtime ); + $mtime = $mtime[1] + $mtime[0]; + $starttime = $mtime; + } + function stop() { + global $starttime; + $mtime = microtime(); + $mtime = explode( ' ', $mtime ); + $mtime = $mtime[1] + $mtime[0]; + $endtime = $mtime; + $totaltime = round( ($endtime - $starttime), 5 ); + return $totaltime; + } +} + +function allowed_ip($ip_array) { + $ip_array = trim( $ip_array ); + + if( $ip_array == "" ) { + return true; + } + + $ip_array = explode( "|", $ip_array ); + $db_ip_split = explode( ".", $_SERVER['REMOTE_ADDR'] ); + + foreach ( $ip_array as $ip ) { + + $ip_check_matches = 0; + $this_ip_split = explode( ".", trim( $ip ) ); + + for($i_i = 0; $i_i < 4; $i_i ++) { + if( $this_ip_split[$i_i] == $db_ip_split[$i_i] or $this_ip_split[$i_i] == '*' ) { + $ip_check_matches += 1; + } + + } + if( $ip_check_matches == 4 ) return true; + } + return FALSE; +} + +//////////////////////////////////////////////////////// +// Function: msg +// Description: Displays message to user + + +function msg($type, $title, $text, $back = FALSE) { + global $lang; + + if( $back ) { + $back = "

    $lang[func_msg]"; + } + + echoheader( $type, $title ); + + echo << + + + + + + + + + + + + + + + + +
    + + + + +
    +
    + + + + +
    {$text} {$back}
    +
    +
    +HTML; + + echofooter(); + exit(); +} + +function echoheader($image, $header_text) { + global $PHP_SELF, $skin_header, $member_id, $user_group; + + $skin_header = str_replace( "{header-text}", $header_text, $skin_header ); + $skin_header = str_replace( "{user}", $member_id['name'], $skin_header ); + $skin_header = str_replace( "{group}", $user_group[$member_id['user_group']]['group_name'], $skin_header ); + + echo $skin_header; +} + +function echofooter() { + + global $PHP_SELF, $is_loged_in, $skin_footer; + + echo $skin_footer; + +} + +function listdir($dir) { + + $current_dir = opendir( $dir ); + while ( $entryname = readdir( $current_dir ) ) { + if( is_dir( "$dir/$entryname" ) and ($entryname != "." and $entryname != "..") ) { + listdir( "${dir}/${entryname}" ); + } elseif( $entryname != "." and $entryname != ".." ) { + unlink( "${dir}/${entryname}" ); + } + } + @closedir( $current_dir ); + rmdir( ${dir} ); +} + + +function totranslit( $var, $lower = true, $punkt = true ) { + global $langtranslit; + + if ( is_array($var) ) return ""; + if (!is_array ( $langtranslit ) OR !count( $langtranslit ) ) { + $langtranslit = array('а' => 'a', 'б' => 'b', 'в' => 'v', 'г' => 'g', 'д' => 'd', 'е' => 'e', 'ё' => 'e', 'ж' => 'zh', 'з' => 'z', 'и' => 'i', 'й' => 'y', 'к' => 'k', 'л' => 'l', 'м' => 'm', 'н' => 'n', 'о' => 'o', 'п' => 'p', 'р' => 'r', 'с' => 's', 'т' => 't', 'у' => 'u', 'ф' => 'f', 'х' => 'h', 'ц' => 'c', 'ч' => 'ch', 'ш' => 'sh', 'щ' => 'sch', 'ь' => '', 'ы' => 'y', 'ъ' => '', 'э' => 'e', 'ю' => 'yu', 'я' => 'ya', "ї" => "yi", "є" => "ye", + 'А' => 'A', 'Б' => 'B', 'В' => 'V', 'Г' => 'G', 'Д' => 'D', 'Е' => 'E', 'Ё' => 'E', 'Ж' => 'Zh', 'З' => 'Z', 'И' => 'I', 'Й' => 'Y', 'К' => 'K', 'Л' => 'L', 'М' => 'M', 'Н' => 'N', 'О' => 'O', 'П' => 'P', 'Р' => 'R', 'С' => 'S', 'Т' => 'T', 'У' => 'U', 'Ф' => 'F', 'Х' => 'H', 'Ц' => 'C', 'Ч' => 'Ch', 'Ш' => 'Sh', 'Щ' => 'Sch', 'Ь' => '', 'Ы' => 'Y', 'Ъ' => '', 'Э' => 'E', 'Ю' => 'Yu', 'Я' => 'Ya', "Ї" => "yi", "Є" => "ye",); + } + + $var = trim( strip_tags( $var ) ); + $var = preg_replace( "/\s+/ms", "-", $var ); + $var = str_replace( "/", "-", $var ); + + $var = strtr($var, $langtranslit); + + if( $punkt ) {$var = preg_replace( "/[^a-z0-9\_\-.]+/mi", "", $var );}else{$var = preg_replace( "/[^a-z0-9\_\-]+/mi", "", $var );} + + $var = preg_replace( '#[\-]+#i', '-', $var ); + + if( $lower ) {$var = strtolower( $var );} + + $var = str_ireplace( ".php", "", $var ); + $var = str_ireplace( ".php", ".ppp", $var ); + + if( strlen( $var ) > 50 ) { + $var = substr( $var, 0, 50 ); + if( ($temp_max = strrpos( $var, '-' )) ) $var = substr( $var, 0, $temp_max ); + } + return $var; +} + +// ******************************************************************************** +// Show Radio +// ******************************************************************************** +function showRadio($title = "", $description = "", $allow_name = "", $row = false){ + global $f_lg; + + if ($row[$allow_name]) + { + $o_value = "checked"; + + $t_value = ""; + } + + else + { + $o_value = ""; + + $t_value = "checked"; + } + + echo" + + {$title}
    {$description} + + {$f_lg['yes']} + {$f_lg['no']} + "; + } + +// ******************************************************************************** +// showRow +// ******************************************************************************** + function showRow($title="", $description="", $field="") + { + echo" + + $title
    $description + $field + "; + $bg = ""; $i++; + } + +// ******************************************************************************** +// makeDropDown +// ******************************************************************************** + function makeDropDown($options, $name, $selected) + { + $output = "
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +HTML; +?> \ No newline at end of file diff --git a/system/inc/iptools.php b/system/inc/iptools.php new file mode 100644 index 0000000..93bc306 --- /dev/null +++ b/system/inc/iptools.php @@ -0,0 +1,354 @@ +safesql( htmlspecialchars( strip_tags( trim( $_REQUEST['ip'] ) ) ) ); else $ip = ""; +if( isset( $_REQUEST['name'] ) ) $name = $db->safesql( htmlspecialchars( strip_tags( trim( $_REQUEST['name'] ) ) ) ); else $name = ""; + +if( $_REQUEST['doaction'] == "dodelcomments" AND $_REQUEST['id']) { + + if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) { + + die( "Hacking attempt! User not found" ); + + } + + $id = intval( $_REQUEST['id'] ); + + $result = $db->query( "SELECT COUNT(*) as count, post_id FROM " . PREFIX . "_comments WHERE user_id='$id' AND is_register='1' GROUP BY post_id" ); + + while ( $row = $db->get_array( $result ) ) { + $db->query( "UPDATE " . PREFIX . "_post set comm_num=comm_num-{$row['count']} where id='{$row['post_id']}'" ); + } + $db->free( $result ); + + $db->query( "UPDATE " . USERPREFIX . "_users set comm_num='0' WHERE user_id ='$id'" ); + $db->query( "DELETE FROM " . PREFIX . "_comments WHERE user_id='$id' AND is_register='1'" ); +} + +echoheader( "", "" ); + +echo << +
    + + + + + + + + + + + + + + + + +
    + + + + +
    +
    + + + + + + + + + + +
    {$lang['opt_iptoolsc']}
       
    {$lang['opt_ipfe']}
    {$lang['opt_iptoolsname']}
       
    +
    +
    + + + +HTML; + +if( $_REQUEST['action'] == "find" and $ip != "" ) { + + echo << + +
    + + + + + + + + + + + + + + + +
    + + + + +
    +
    + + + + + + + + + + + +HTML; + + $db->query( "SELECT * FROM " . USERPREFIX . "_users WHERE logged_ip LIKE '{$ip}%'" ); + + $i = 0; + while ( $row = $db->get_array() ) { + $i ++; + + if( $row[news_num] == 0 ) { + $news_link = "$row[news_num]"; + } else { + $news_link = "[" . $row[news_num] . "]"; + } + if( $row[comm_num] == 0 ) { + $comms_link = $row['comm_num']; + } else { + $comms_link = "[" . $row[comm_num] . "]"; + } + + if( $row['banned'] == 'yes' ) $group = "" . $lang['user_ban'] . ""; + else $group = $user_group[$row['user_group']]['group_name']; + + echo " + + + + + + + + + + + "; + } + + if( $i == 0 ) { + echo " + "; + } + + echo << + + + + + + + + +
    {$lang['user_name']}IP{$lang['user_reg']}{$lang['user_last']}{$lang['user_news']}{$lang['user_coms']}{$lang['user_acc']}
    + {$row['name']} + + " . $row['logged_ip'] . " + " . langdate( "d/m/Y - H:i", $row['reg_date'] ) . " + " . langdate( 'd/m/Y - H:i', $row['lastdate'] ) . " + " . $news_link . " + " . $comms_link . " + " . $group . "
    +


    $lang[ip_empty]

    +

    + +
    + + + + + + + + + + + +HTML; + +#### IMG + +?> \ No newline at end of file diff --git a/system/inc/newsimg/doaddimg.php b/system/inc/newsimg/doaddimg.php new file mode 100644 index 0000000..2229e25 --- /dev/null +++ b/system/inc/newsimg/doaddimg.php @@ -0,0 +1,72 @@ +size_auto( $config['poster_width'], 0 ) ) { + $thumb->jpeg_quality( $config['jpeg_quality'] ); + if( $config['allow_watermark'] == "yes" ) $thumb->insert_watermark( $config['max_watermark'] ); + $thumb->save( ROOT_DIR . "/uploads/covers/thumbs/" . $file_prefix . $image_name ); + } + @chmod( ROOT_DIR . "/uploads/covers/thumbs/" . $file_prefix . $image_name, 0666 ); + if( @file_exists( ROOT_DIR . "/uploads/covers/thumbs/" . $file_prefix . $image_name ) ) { + $th = '/covers/thumbs/' . $file_prefix . $image_name; + } + if( ($config['allow_watermark'] == "yes" ) or $config['max_up_side'] ) { + $thumb = new thumbnail( ROOT_DIR . "/uploads/covers/" . $file_prefix . $image_name ); + $thumb->jpeg_quality( $config['jpeg_quality'] ); + if( $config['max_up_side'] ) $thumb->size_auto( $config['max_up_side'] ); + if( $config['allow_watermark'] == "yes" ) $thumb->insert_watermark( $config['max_watermark'] ); + $thumb->save( ROOT_DIR . "/uploads/covers/" . $file_prefix . $image_name ); + }} + if ($url != '') {$db->query("INSERT INTO ".PREFIX."_covers VALUES ('0', '$row', '$url', '$th')");} +} +?> \ No newline at end of file diff --git a/system/inc/newsimg/doeditimg.php b/system/inc/newsimg/doeditimg.php new file mode 100644 index 0000000..27667d3 --- /dev/null +++ b/system/inc/newsimg/doeditimg.php @@ -0,0 +1,73 @@ +size_auto( $config['poster_width'], 0 ) ) { + $thumb->jpeg_quality( $config['jpeg_quality'] ); + if( $config['allow_watermark'] == "yes" ) $thumb->insert_watermark( $config['max_watermark'] ); + $thumb->save( ROOT_DIR . "/uploads/covers/thumbs/" . $file_prefix . $image_name ); + } + @chmod( ROOT_DIR . "/uploads/covers/thumbs/" . $file_prefix . $image_name, 0666 ); + if( @file_exists( ROOT_DIR . "/uploads/covers/thumbs/" . $file_prefix . $image_name ) ) {$th = '/covers/thumbs/' . $file_prefix . $image_name;} + if( ($config['allow_watermark'] == "yes" ) or $config['max_up_side'] ) { + $thumb = new thumbnail( ROOT_DIR . "/uploads/covers/" . $file_prefix . $image_name ); + $thumb->jpeg_quality( $config['jpeg_quality'] ); + if( $config['max_up_side'] ) $thumb->size_auto( $config['max_up_side'] ); + if( $config['allow_watermark'] == "yes" ) $thumb->insert_watermark( $config['max_watermark'] ); + $thumb->save( ROOT_DIR . "/uploads/covers/" . $file_prefix . $image_name ); + }} + if ($url != '') { + $newsid = $_GET['id']; + $db->query("INSERT INTO ".PREFIX."_covers VALUES ('0', '$newsid', '$url', '$th')"); + } +} +?> \ No newline at end of file diff --git a/system/inc/newsimg/editimg.php b/system/inc/newsimg/editimg.php new file mode 100644 index 0000000..93a508a --- /dev/null +++ b/system/inc/newsimg/editimg.php @@ -0,0 +1,116 @@ + + +'; + +if ($_GET['img']){ + $db->query("SELECT link, thumb FROM " . PREFIX . "_covers WHERE id = '".$_GET['img']."'"); + + while($row_covers = $db->get_row()){ + + @unlink(ROOT_DIR."/uploads".$row_covers['link']); + @unlink(ROOT_DIR."/uploads".$row_covers['thumb']); + + } +$db->query("DELETE FROM ".PREFIX."_covers WHERE id='".$_GET['img']."'"); +$ms = "Удалено"; +header("Location: /control.php?mod=editnews&action=editnews&id={$_GET['id']}"); +} + + +echo ""; +echo << + + +HTML; + +#### IMG + + +?> \ No newline at end of file diff --git a/system/inc/newsletter.php b/system/inc/newsletter.php new file mode 100644 index 0000000..b6b4d91 --- /dev/null +++ b/system/inc/newsletter.php @@ -0,0 +1,509 @@ +process($_POST['title']))); + $message = stripslashes($parse->process($_POST['message'])); + $start_from = intval($_GET['start_from']); + $limit = intval($_GET['limit']); + $interval = intval($_GET['interval']) * 1000; + + if ($limit < 1) { + + $limit = 20; + + } + + $message = $parse->BB_Parse($message, false); + + $where = array(); + + if ($empfanger != "all") $where[] = "user_group = '{$empfanger}'"; + if ($a_mail) $where[] = "allow_mail = '1'"; + + if (count($where)) $where = " WHERE ".implode (" AND ", $where); + else $where = ""; + + $row = $db->super_query("SELECT COUNT(*) as count FROM " . USERPREFIX . "_users".$where); + + if ($start_from > $row['count'] OR $start_from < 0) $start_from = 0; + + if ($type == "email") + $type_send = $lang['bb_b_mail']; + else + $type_send = $lang['nl_pm']; + +echo << + + +{$lang['nl_seng']} + + + + + + +
    + + + + +
    +
    + + + + + + + + + + + +HTML; + + $db->query( "SELECT " . PREFIX . "_comments.user_id, " . PREFIX . "_comments.ip, " . USERPREFIX . "_users.comm_num, banned, user_group, reg_date, lastdate, " . USERPREFIX . "_users.name, " . USERPREFIX . "_users.news_num FROM " . PREFIX . "_comments LEFT JOIN " . USERPREFIX . "_users ON " . PREFIX . "_comments.user_id=" . USERPREFIX . "_users.user_id WHERE " . PREFIX . "_comments.ip LIKE '{$ip}%' AND " . PREFIX . "_comments.is_register = '1' AND " . USERPREFIX . "_users.name != '' GROUP BY " . PREFIX . "_comments.user_id" ); + + $i = 0; + while ( $row = $db->get_array() ) { + $i ++; + + if( $row[news_num] == 0 ) { + $news_link = "$row[news_num]"; + } else { + $news_link = "[" . $row[news_num] . "]"; + } + if( $row[comm_num] == 0 ) { + $comms_link = $row['comm_num']; + } else { + $comms_link = "[" . $row[comm_num] . "]"; + } + + if( $row['banned'] == 'yes' ) $group = "" . $lang['user_ban'] . ""; + else $group = $user_group[$row['user_group']]['group_name']; + + echo " + + + + + + + + + + + "; + } + + if( $i == 0 ) { + echo " + "; + } + + echo << + + + + + + + + +
    {$lang['user_name']}IP{$lang['user_reg']}{$lang['user_last']}{$lang['user_news']}{$lang['user_coms']}{$lang['user_acc']}
    + {$row['name']} + + " . $row['ip'] . " + " . langdate( "d/m/Y - H:i", $row['reg_date'] ) . " + " . langdate( 'd/m/Y - H:i', $row['lastdate'] ) . " + " . $news_link . " + " . $comms_link . " + " . $group . "
    +


    $lang[ip_empty]

    +

    + +HTML; + +} + +if( $name != "" ) { + + echo << + + + + + + + + + + + + + + + + +
    + + + + +
    +
    + + + + + +
    +HTML; + + $row = $db->super_query( "SELECT user_id, name, logged_ip FROM " . USERPREFIX . "_users WHERE name='" . $name . "'" ); + + if( ! $row['user_id'] ) { + + echo "
    " . $lang['user_nouser'] . "
    "; + + } else { + + echo $lang['user_name'] . " " . $row['name'] . "

    " . $lang['opt_iptoollast'] . " " . $row['logged_ip'] . "

    " . $lang['opt_iptoolcall'] . " "; + + $db->query( "SELECT ip FROM " . PREFIX . "_comments WHERE user_id = '{$row['user_id']}' GROUP BY ip" ); + + $ip_list = array (); + + while ( $row = $db->get_array() ) { + $ip_list[] = "" . $row['ip'] . ""; + } + + echo implode( ", ", $ip_list ); + } + + echo <<
    +
    + +HTML; + +} + +echofooter(); +?> \ No newline at end of file diff --git a/system/inc/main.php b/system/inc/main.php new file mode 100644 index 0000000..814feed --- /dev/null +++ b/system/inc/main.php @@ -0,0 +1,232 @@ +query("TRUNCATE TABLE " . PREFIX . "_subscribe"); +} + +if( $_GET['action'] == "clear" ) { + $cache->delete('usergroup.php' ); + $cache->delete('category.php' ); + $cache->delete('banned.php' ); + $cache->delete('cron.php' ); + $cache->clear(); +} + +$row = $db->super_query( "SELECT COUNT(*) as count FROM " . PREFIX . "_post" ); +$stats_news = $row['count']; + +$row = $db->super_query( "SELECT COUNT(*) as count FROM " . PREFIX . "_subscribe" ); +$count_subscribe = $row['count']; + +$row = $db->super_query( "SELECT COUNT(*) as count FROM " . PREFIX . "_comments" ); +$count_comments = $row['count']; + +$row = $db->super_query( "SELECT COUNT(*) as count FROM " . USERPREFIX . "_users" ); +$stats_users = $row['count']; + +$row = $db->super_query( "SELECT COUNT(*) as count FROM " . USERPREFIX . "_users where banned='yes'" ); +$stats_banned = $row['count']; +if ($stats_banned) $stats_banned = "( {$stats_banned} )"; +else $stats_banned = ""; + +$row = $db->super_query( "SELECT COUNT(*) as count FROM " . PREFIX . "_post where approve = '0'" ); +$approve = $row['count']; + +if( $approve and $user_group[$member_id['user_group']]['allow_all_edit'] ) { + $approve = "( " .$approve . " ) [ {$lang['stat_medit_link']} ]"; +} else {$approve = "";} + +$db->query( "SHOW TABLE STATUS FROM `" . DBNAME . "`" ); +$mysql_size = 0; +while ( $r = $db->get_array() ) { + if( strpos( $r['Name'], PREFIX . "_" ) !== false ) $mysql_size += $r['Data_length'] + $r['Index_length']; +} +$db->free(); + +$mysql_size = mksize( $mysql_size ); +$cache_size = mksize( $cache->size() ); + +$dts = @disk_total_space("."); +$dfs = @disk_free_space("."); +$totalspace = mksize($dts); +$freespace = mksize($dfs); + +if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { + $winstats = shell_exec("net statistics server"); + preg_match("(\d{1,2}/\d{1,2}/\d{4}\s+\d{1,2}\:\d{2}\s+\w{2})", $winstats, $matches); + $uptimeSecs = time() - strtotime($matches[0]); + $uptime = format_uptime($uptimeSecs); +} else { + /*$data = shell_exec('uptime'); + $uptime = explode(' up ', $data); + $uptime = explode(',', $uptime[1]); + $uptime = $uptime[0].', '.$uptime[1];*/ + $uptime = exec("cat /proc/uptime"); + $uptime = split(" ",$uptime); + $uptimeSecs = $uptime[0]; + $uptime = format_uptime($uptimeSecs); +} + +if( $member_id['user_group'] == 1 ) { + + echo << + + + + + + + + + + + + + + + + +
    + + + + +
    +
    + + + + + + + + + + + +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    +
    + +HTML; + +} else { + +//Информация не для админов + +} + +echo << + + + + + + + + + + + + + + + + +
    + + + + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Аптайм сервера:{$uptime}
    {$lang['stat_allnews']}{$stats_news} {$approve}
    {$lang['stat_comments']}{$count_comments} [ {$lang['last_comm']} ]
    {$lang['stat_users']}{$stats_users} {$stats_banned} [ Редактировать пользователей ]
    {$lang['stat_bd']}{$mysql_size}
    Размер кеша:{$cache_size}
    {$lang['free_size']}{$freespace} ({$totalspace})
    +HTML; + +if( ! is_writable( ROOT_DIR . "/cache/" ) or ! is_writable( ROOT_DIR . "/cache/system/" ) ) { + echo "
    + $lang[stat_cache] +
     
    "; + +} + +if( $member_id['user_group'] == 1 ) { + + echo "
    "; + + if ($count_subscribe) echo " "; + + echo "
    "; +} + +echo << +
    + +HTML; + +echofooter(); +?> \ No newline at end of file diff --git a/system/inc/mass_static_actions.php b/system/inc/mass_static_actions.php new file mode 100644 index 0000000..8753504 --- /dev/null +++ b/system/inc/mass_static_actions.php @@ -0,0 +1,225 @@ +query( "UPDATE " . PREFIX . "_static SET {$field}='{$value}' WHERE id='{$id}'" ); + } + msg( "info", $lang['db_ok'], $lang['db_ok_1'].$t1, $_SESSION['admin_referrer'] ); +} + +if( $k_mass ) { + + echoheader( "options", $lang['mass_head'] ); + + echo << +
    + + + + + + + + + + + + + + + + +
    + + + + +
    +
    + + +
    {$lang['mass_confirm']} +HTML; + + echo " (" . count( $selected_news ) . ") $lang[mass_confirm_1]

    +   + + + +"; + foreach ( $selected_news as $newsid ) { + $newsid = intval($newsid); + echo "\n"; + } + + echo << +
    +
    +
    +HTML; + + echofooter(); + exit(); + +} +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Подтвреждение удаления + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +if( $action == "mass_delete" ) { + + echoheader( "options", $lang['mass_head'] ); + + echo << +
    + + + + + + + + + + + + + + + + +
    + + + + +
    +
    + + +
    {$lang['mass_confirm']} +HTML; + + echo "(" . count( $selected_news ) . ") $lang[mass_static_confirm_3]

    +   + + +"; + foreach ( $selected_news as $newsid ) { + $newsid = intval($newsid); + echo "\n"; + } + + echo << +
    +
    +
    +HTML; + + echofooter(); + exit(); + +} +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Удаление новостей + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +elseif( $action == "do_mass_delete" ) { + + $deleted_articles = 0; + + foreach ( $selected_news as $id ) { + + $id = intval( $id ); + + $deleted_articles ++; + + $db->query( "DELETE FROM " . PREFIX . "_static WHERE id='$id'" ); + + $db->query( "SELECT name, onserver FROM " . PREFIX . "_static_files WHERE static_id = '$id'" ); + + while ( $row = $db->get_row() ) { + if( $row['onserver'] ) { + @unlink( ROOT_DIR . "/uploads/files/" . $row['onserver'] ); + } else { + $url_image = explode( "/", $row['name'] ); + if( count( $url_image ) == 2 ) { + $folder_prefix = $url_image[0] . "/"; + $dataimages = $url_image[1]; + } else { + $folder_prefix = ""; + $dataimages = $url_image[0]; + } + @unlink( ROOT_DIR . "/uploads/posts/" . $folder_prefix . $dataimages ); + @unlink( ROOT_DIR . "/uploads/posts/" . $folder_prefix . "thumbs/" . $dataimages ); + } + } + + $db->query( "DELETE FROM " . PREFIX . "_static_files WHERE static_id = '$id'" ); + + } + + if( count( $selected_news ) == $deleted_articles ) { + msg( "info", $lang['mass_static_delete'], $lang['mass_delok'], $_SESSION['admin_referrer'] ); + } else { + msg( "error", $lang['mass_notok'], "$deleted_articles $lang[mass_i] " . count( $selected_news ) . " $lang[mass_notok_1]", $_SESSION['admin_referrer'] ); + } +} +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Ничего не выбрано + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +else { + + msg( "info", $lang['mass_noact'], $lang['mass_noact_1'], $_SESSION['admin_referrer'] ); + +} +?> \ No newline at end of file diff --git a/system/inc/mass_user_actions.php b/system/inc/mass_user_actions.php new file mode 100644 index 0000000..a3293a7 --- /dev/null +++ b/system/inc/mass_user_actions.php @@ -0,0 +1,398 @@ + +
    + + + + + + + + + + + + + + + + +
    + + + + +
    +
    + + +
    {$lang['massusers_confirm']} +HTML; + + echo " (" . count( $selected_users ) . ") $lang[massusers_confirm_1]

    +   + + +"; + foreach ( $selected_users as $userid ) { + $userid = intval($userid); + echo "\n"; + } + + echo << +
    +
    +
    +HTML; + + + echofooter(); + exit(); + +} elseif ($_POST['action'] == "do_mass_delete") { + + $deleted = 0; + + foreach ( $selected_users as $id ) { + + $id = intval( $id ); + + if( $id == 1 ) { + msg( "error", $lang['mass_error'], $lang['user_undel'], "?mod=editusers&action=list" ); + } + + $row = $db->super_query( "SELECT user_id, user_group, name, foto FROM " . USERPREFIX . "_users WHERE user_id='$id'" ); + + if( ! $row['user_id'] ) msg( "error", $lang['mass_error'], $lang['user_undel'], "?mod=editusers&action=list" ); + + if ($member_id['user_group'] != 1 AND $row['user_group'] == 1 ) + msg( "error", $lang['mass_error'], $lang['user_undel'], "?mod=editusers&action=list" ); + + $db->query( "DELETE FROM " . USERPREFIX . "_pm WHERE user_from = '{$row['name']}' AND folder = 'outbox'" ); + $db->query( "delete FROM " . USERPREFIX . "_users WHERE user_id='$id'" ); + $db->query( "delete FROM " . USERPREFIX . "_banned WHERE users_id='$id'" ); + $db->query( "delete FROM " . USERPREFIX . "_pm WHERE user='$id'" ); + + @unlink( ROOT_DIR . "/uploads/fotos/" . $row['foto'] ); + + $deleted ++; + } + + $cache->clear(); + $cache->delete('banned.php' ); + + if( count( $selected_users ) == $deleted ) { + msg( "info", $lang['massusers_head'], $lang['massusers_delok'], "?mod=editusers&action=list" ); + } else { + msg( "error", $lang['mass_error'], "$deleted $lang[mass_i] " . count( $selected_users ) . " $lang[massusers_confirm_2]", "?mod=editusers&action=list" ); + } + +} elseif ($_POST['action'] == "mass_delete_comments") { + + echoheader( "options", $lang['mass_head'] ); + + + echo << +
    + + + + + + + + + + + + + + + + +
    + + + + +
    +
    + + +
    {$lang['massusers_confirm_3']} +HTML; + + echo " (" . count( $selected_users ) . ") $lang[massusers_confirm_1]

    +   + + +"; + foreach ( $selected_users as $userid ) { + $userid = intval($userid); + echo "\n"; + } + + echo << +
    +
    +
    +HTML; + + echofooter(); + exit(); + +} elseif ($_POST['action'] == "do_mass_delete_comments") { + + foreach ( $selected_users as $id ) { + + $id = intval( $id ); + + $result = $db->query( "SELECT COUNT(*) as count, post_id FROM " . PREFIX . "_comments WHERE user_id='$id' AND is_register='1' GROUP BY post_id" ); + + while ( $row = $db->get_array( $result ) ) { + + $db->query( "UPDATE " . PREFIX . "_post set comm_num=comm_num-{$row['count']} where id='{$row['post_id']}'" ); + + } + $db->free( $result ); + + $db->query( "UPDATE " . USERPREFIX . "_users set comm_num='0' WHERE user_id ='$id'" ); + $db->query( "DELETE FROM " . PREFIX . "_comments WHERE user_id='$id' AND is_register='1'" ); + + } + + $cache->clear(); + msg( "info", $lang['massusers_head_1'], $lang['massusers_comok'], "?mod=editusers&action=list" ); + +} elseif ($_POST['action'] == "mass_move_to_group") { + + + echoheader( "options", $lang['mass_head'] ); + + + echo << +
    + + + + + + + + + + + + + + + + +
    + + + + +
    +
    + + +
    {$lang['massusers_confirm_4']} +HTML; + + echo " (" . count( $selected_users ) . ") $lang[massusers_confirm_1]

    +{$lang['user_acc']} {$lang['user_gtlimit']} [?] +

    +   + + +"; + foreach ( $selected_users as $userid ) { + $userid = intval($userid); + echo "\n"; + } + + echo << +
    +
    +
    + + + + + + +HTML; + + echofooter(); + exit(); + +} elseif ($_POST['action'] == "do_mass_move_to_group") { + + $editlevel = intval( $_POST['editlevel'] ); + + if ($member_id['user_group'] != 1 AND $editlevel < 2 ) + msg( "error", $lang['mass_error'], $lang['admin_not_access'], "?mod=editusers&action=list" ); + + foreach ( $selected_users as $id ) { + + $id = intval( $id ); + + $row = $db->super_query( "SELECT user_group FROM " . USERPREFIX . "_users WHERE user_id='$id'" ); + + if ($member_id['user_group'] != 1 AND $row['user_group'] == 1 ) + msg( "error", $lang['mass_error'], $lang['edit_not_admin'], "?mod=editusers&action=list" ); + + } + + $cache->clear(); + msg( "info", $lang['massusers_head_2'], $lang['massusers_groupok']." ".$user_group[$editlevel]['group_name']."", "?mod=editusers&action=list" ); + +} elseif ($_POST['action'] == "mass_move_to_ban") { + + echoheader( "options", $lang['mass_head'] ); + + + echo << +
    + + + + + + + + + + + + + + + + +
    + + + + +
    +
    + + +
    {$lang['massusers_confirm_5']} +HTML; + + echo " (" . count( $selected_users ) . ") $lang[massusers_confirm_1]

    +
    {$lang['ban_date']} [?] +

    {$lang['ban_descr']}
    +

    +   + + +"; + foreach ( $selected_users as $userid ) { + $userid = intval($userid); + echo "\n"; + } + + echo << +
    +
    +
    +HTML; + + echofooter(); + exit(); + +} elseif ($_POST['action'] == "do_mass_move_to_ban") { + + + include_once SYSTEM_DIR . '/classes/parse.class.php'; + $parse = new ParseFilter( ); + + foreach ( $selected_users as $id ) { + + $id = intval( $id ); + + $row = $db->super_query( "SELECT user_group FROM " . USERPREFIX . "_users WHERE user_id='$id'" ); + + if ($member_id['user_group'] != 1 AND $row['user_group'] == 1 ) + msg( "error", $lang['mass_error'], $lang['edit_not_admin'], "?mod=editusers&action=list" ); + + + $banned_descr = $db->safesql( $parse->BB_Parse( $parse->process( $_POST['banned_descr'] ), false ) ); + $this_time = time() + ($config['date_adjust'] * 60); + $banned_date = intval( $_POST['banned_date'] ); + $this_time = $banned_date ? $this_time + ($banned_date * 60 * 60 * 24) : 0; + + $row = $db->super_query( "SELECT users_id, days FROM " . USERPREFIX . "_banned WHERE users_id = '$id'" ); + + if( ! $row['users_id'] ) $db->query( "INSERT INTO " . USERPREFIX . "_banned (users_id, descr, date, days) values ('$id', '$banned_descr', '$this_time', '$banned_date')" ); + else { + + if( $row['days'] != $banned_date ) $db->query( "UPDATE " . USERPREFIX . "_banned SET descr='$banned_descr', days='$banned_date', date='$this_time' WHERE users_id = '$id'" ); + else $db->query( "UPDATE " . USERPREFIX . "_banned set descr='$banned_descr' WHERE users_id = '$id'" ); + + } + + $cache->delete('banned.php' ); + + $db->query( "UPDATE " . USERPREFIX . "_users SET banned='yes' WHERE user_id ='$id'" ); + + + } + + $cache->clear(); + msg( "info", $lang['massusers_head_3'], $lang['massusers_banok'], "?mod=editusers&action=list" ); + + +} else { + + msg( "info", $lang['mass_noact'], $lang['mass_noact_1'], "?mod=editusers&action=list" ); + +} +?> \ No newline at end of file diff --git a/system/inc/massactions.php b/system/inc/massactions.php new file mode 100644 index 0000000..e9711a2 --- /dev/null +++ b/system/inc/massactions.php @@ -0,0 +1,468 @@ +query( "UPDATE " . PREFIX . "_post SET {$field}='{$value}' WHERE id='{$id}'" ); + + if( $field == "approve" ) { + + if( $value ) { + + $db->query( "DELETE FROM " . PREFIX . "_tags WHERE news_id = '{$id}'" ); + $row = $db->super_query( "SELECT tags FROM " . PREFIX . "_post where id = '{$id}'" ); + + if( $row['tags'] ) { + + $tags = array (); + + $row['tags'] = explode( ",", $row['tags'] ); + + foreach ( $row['tags'] as $tags_value ) { + + $tags[] = "('" . $id . "', '" . trim( $tags_value ) . "')"; + } + + $tags = implode( ", ", $tags ); + $db->query( "INSERT INTO " . PREFIX . "_tags (news_id, tag) VALUES " . $tags ); + + } + + } else { + + $db->query( "DELETE FROM " . PREFIX . "_tags WHERE news_id = '{$id}'" ); + + } + + } + + if ( $field == "rating" ) { + + $db->query( "DELETE FROM " . PREFIX . "_rate WHERE type_id = '{$id}' AND type=1" ); + + } + + } + + $cache->clear(); + + msg( "info", $lang['db_ok'], $lang['db_ok_1'], $_SESSION['admin_referrer'] ); +} + +if( $k_mass ) { + + echoheader( "options", $lang['mass_head'] ); + + echo << +
    + + + + + + + + + + + + + + + + +
    + + + + +
    +
    + + +
    {$lang['mass_confirm']} +HTML; + + echo " (" . count( $selected_news ) . ") $lang[mass_confirm_1]

    +   + + + +"; + foreach ( $selected_news as $newsid ) { + $newsid = intval($newsid); + echo "\n"; + } + + echo << +
    +
    +
    +HTML; + + echofooter(); + exit(); + +} +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Подтвреждение удаления + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +if( $action == "mass_delete" ) { + + echoheader( "options", $lang['mass_head'] ); + + echo << +
    + + + + + + + + + + + + + + + + +
    + + + + +
    +
    + + +
    {$lang['mass_confirm']} +HTML; + + echo "(" . count( $selected_news ) . ") $lang[mass_confirm_1]

    +   + + +"; + foreach ( $selected_news as $newsid ) { + $newsid = intval($newsid); + echo "\n"; + } + + echo << +
    +
    +
    +HTML; + + echofooter(); + exit(); + +} +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Удаление новостей + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +elseif( $action == "do_mass_delete" ) { + + $deleted_articles = 0; + + foreach ( $selected_news as $id ) { + + $id = intval( $id ); + $row = $db->super_query( "SELECT autor FROM " . PREFIX . "_post where id = '$id'" ); + + $db->query( "UPDATE " . USERPREFIX . "_users set news_num=news_num-1 where name='{$row['autor']}'" ); + + $deleted_articles ++; + + $db->query( "DELETE FROM " . PREFIX . "_post WHERE id='$id'" ); + + $db->query( "DELETE FROM " . PREFIX . "_comments WHERE post_id='$id'" ); + + $db->query( "SELECT onserver FROM " . PREFIX . "_files WHERE news_id = '$id'" ); + while ( $row = $db->get_row() ) { + @unlink( ROOT_DIR . "/uploads/files/" . $row['onserver'] ); + } + + $db->query("SELECT id, link, thumb FROM " . PREFIX . "_covers WHERE newsid = '$id'"); + + while($row_covers = $db->get_row()){ + + @unlink(ROOT_DIR."/uploads".$row_covers['link']); + @unlink(ROOT_DIR."/uploads".$row_covers['thumb']); + + } + + $db->query("DELETE FROM " . PREFIX . "_covers WHERE newsid = '$id'"); + + $db->query("SELECT id, onserver FROM " . PREFIX . "_torrents WHERE news_id = '$id'"); + + while($row_torrents = $db->get_row()){ + + @unlink(ROOT_DIR."/uploads/torrents/".$row_torrents['onserver']); + + } + + $db->query( "UPDATE " . PREFIX . "_torrents SET flags=1 where news_id='$id'" ); + $db->free(); + + $db->query( "DELETE FROM " . PREFIX . "_files WHERE news_id = '$id'" ); + $db->query( "DELETE FROM " . PREFIX . "_poll WHERE news_id = '$id'" ); + $db->query( "DELETE FROM " . PREFIX . "_poll_log WHERE news_id = '$id'" ); + $db->query( "DELETE FROM " . PREFIX . "_rate WHERE type_id = '$id' AND type=1" ); + $db->query( "DELETE FROM " . PREFIX . "_tags WHERE news_id = '$id'" ); + + $row = $db->super_query( "SELECT images FROM " . PREFIX . "_images where news_id = '$id'" ); + + $listimages = explode( "|||", $row['images'] ); + + if( $row['images'] != "" ) foreach ( $listimages as $dataimages ) { + $url_image = explode( "/", $dataimages ); + + if( count( $url_image ) == 2 ) { + + $folder_prefix = $url_image[0] . "/"; + $dataimages = $url_image[1]; + + } else { + + $folder_prefix = ""; + $dataimages = $url_image[0]; + + } + + @unlink( ROOT_DIR . "/uploads/posts/" . $folder_prefix . $dataimages ); + @unlink( ROOT_DIR . "/uploads/posts/" . $folder_prefix . "thumbs/" . $dataimages ); + } + + $db->query( "DELETE FROM " . PREFIX . "_images WHERE news_id = '$id'" ); + } + + $cache->clear(); + + if( count( $selected_news ) == $deleted_articles ) { + msg( "info", $lang['mass_head'], $lang['mass_delok'], $_SESSION['admin_referrer'] ); + } else { + msg( "error", $lang['mass_notok'], "$deleted_articles $lang[mass_i] " . count( $selected_news ) . " $lang[mass_notok_1]", $_SESSION['admin_referrer'] ); + } +} +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Подтвеждение смены категорий + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +elseif( $action == "mass_move_to_cat" ) { + + echoheader( "options", $lang['mass_cat'] ); + + $count = count( $selected_news ); + if( $config['allow_multi_category'] ) $category_multiple = "class=\"cat_select\" multiple"; + else $category_multiple = ""; + + echo << +
    + + + + + + + + + + + + + + + + +
    + + + + +
    +
    + + + + +
    {$lang['mass_cat_2']} ({$count}) {$lang['mass_cat_3']} +"; + + foreach ( $selected_news as $newsid ) { + $newsid = intval($newsid); + echo ""; + } + + echo << 
    +
    +
    +HTML; + + echofooter(); + exit(); +} +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + смена категории + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +elseif( $action == "do_mass_move_to_cat" ) { + + $moved_articles = 0; + + $move_to_category = $db->safesql( implode( ',', $_REQUEST['move_to_category'] ) ); + + foreach ( $selected_news as $id ) { + $moved_articles ++; + $id = intval( $id ); + + $db->query( "UPDATE " . PREFIX . "_post set category='$move_to_category' WHERE id='$id'" ); + } + + $cache->clear(); + + if( count( $selected_news ) == $moved_articles ) { + msg( "info", $lang['mass_cat_ok'], "$lang[mass_cat_ok] ($moved_articles)", $_SESSION['admin_referrer'] ); + } else { + msg( "error", $lang['mass_cat_notok'], $lang['mass_cat_notok_1'], $_SESSION['admin_referrer'] ); + } +} +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Ничего не выбрано + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +else { + + msg( "info", $lang['mass_noact'], $lang['mass_noact_1'], $_SESSION['admin_referrer'] ); + +} +?> \ No newline at end of file diff --git a/system/inc/newsimg/addimg.php b/system/inc/newsimg/addimg.php new file mode 100644 index 0000000..88a72cd --- /dev/null +++ b/system/inc/newsimg/addimg.php @@ -0,0 +1,79 @@ + + function ShowOrHideEx(id, show) { + var item = null; + if (document.getElementById) { + item = document.getElementById(id); + } else if (document.all) { + item = document.all[id]; + } else if (document.layers){ + item = document.layers[id]; + } + if (item && item.style) { + item.style.display = show ? \"\" : \"none\"; + } + } + + var total_allow_rows = {$config['max_file_count']}; + + function AddImages() { + var tbl = document.getElementById('tblSample'); + var lastRow = tbl.rows.length; + + if (total_allow_rows && lastRow == total_allow_rows ) return; + + // if there's no header row in the table, then iteration = lastRow + 1 + var iteration = lastRow+1; + var row = tbl.insertRow(lastRow); + + var cellRight = row.insertCell(0); + var el = document.createElement('input'); + el.setAttribute('type', 'file'); + el.setAttribute('name', 'addimg_' + iteration); + el.setAttribute('size', '41'); + el.setAttribute('value', iteration); + cellRight.appendChild(el); + + document.getElementById('images_number').value = iteration; + } + + function RemoveImages() { + var tbl = document.getElementById('tblSample'); + var lastRow = tbl.rows.length; + if (lastRow > 1){ + tbl.deleteRow(lastRow - 1); + document.getElementById('images_number').value = document.getElementById('images_number').value - 1; + } + } + "; +echo <<
    {$lang['images_uphard']} + +
    + + + + +
    + +
    + +   +
    + +
    Загруженные картинки + + +HTML; +} + +echo '
    +HTML; + +$newsimg_query = $db->query("SELECT * FROM ".PREFIX."_covers WHERE newsid='".$_GET['id']."' ORDER BY id DESC"); +while ($newsimg = $db->get_row($newsimg_query)) { +echo << +Удалить картинку
    {$lang['images_uphard']} + +
    + + + + +
    + +
    + +   +
    + +
    + + + + + + + + + + +
    +HTML; + +echo << +
    +
    + + + + + + + + + + + + +
    {$lang['nl_empf']}{$row['count']}
    {$lang['nl_type']}{$type_send}
    + + + + + + + + + + +
    {$lang['nl_sendet']} {$start_from} {$lang['mass_i']} {$row['count']} {$lang['nl_status']}

    +HTML; + +$message = stripslashes($message); + +echo << +
    + + + + + +HTML; + +} +elseif ($action=="preview") +{ +include_once SYSTEM_DIR.'/classes/parse.class.php'; + +$parse = new ParseFilter(Array(), Array(), 1, 1); + +$title = strip_tags(stripslashes($parse->process($_POST['title']))); +$message = stripslashes($parse->process($_POST['message'])); + +$message = $parse->BB_Parse($message, false); + +echo <<{$title} + + + +HTML; + +echo "
    {$title} {$message}
    "; + + +} +elseif ($action=="message") { + echoheader("newsletter", ""); + + + echo " + "; + + echo " + "; + +echo << + +
    +
    + + + + + + + + + + + + + + + + +
    + + + + +
    +
    + + + + + +HTML; + +include(SYSTEM_DIR.'/inc/include/inserttag.php'); + +echo << + + +HTML; + +$start_from = intval($_GET['start_from']); + +echo << + + + +
    {$lang['edit_title']}
    {$lang['nl_message']} + +
    {$bb_code} +

    {$lang['nl_info_1']} {$lang['nl_info_2']}
    +
      + + + + + + +
      +
    +
    +
    +HTML; + + echofooter(); +} +else { + + echoheader("newsletter", ""); + $group_list = get_groups (); + +echo << +
    + + + + + + + + + + + + + + + + +
    + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    {$lang['nl_empf']}
    {$lang['nl_type']}
    {$lang['nl_startfrom']} {$lang['nl_user']}
    {$lang['nl_n_mail']}
    {$lang['nl_interval']}
    {$lang['nl_amail']}
     
    +
    +
    +HTML; + echofooter(); +} +?> \ No newline at end of file diff --git a/system/inc/options.php b/system/inc/options.php new file mode 100644 index 0000000..5234068 --- /dev/null +++ b/system/inc/options.php @@ -0,0 +1,705 @@ + $lang['opt_all'], + 'url' => "$PHP_SELF?mod=options&action=syscon", + 'descr' => $lang['opt_allc'], + 'image' => "tools.png", + 'access' => "admin" + ), + array ( + 'name' => $lang['opt_cat'], + 'url' => "$PHP_SELF?mod=categories", + 'descr' => $lang['opt_catc'], + 'image' => "cats.png", + 'access' => $user_group[$member_id['user_group']]['admin_categories'] + ) + ); + + $options['user'] = array ( + + array ( + 'name' => $lang['opt_user'], + 'url' => "$PHP_SELF?mod=editusers&action=list", + 'descr' => $lang['opt_userc'], + 'image' => "uset.png", + 'access' => $user_group[$member_id['user_group']]['admin_editusers'] + ), + + array ( + 'name' => $lang['opt_group'], + 'url' => "$PHP_SELF?mod=usergroup", + 'descr' => $lang['opt_groupc'], + 'image' => "usersgroup.png", + 'access' => "admin" + ) + ); + + $options['filter'] = array ( + + array ( + 'name' => $lang['opt_fil'], + 'url' => "$PHP_SELF?mod=wordfilter", + 'descr' => $lang['opt_filc'], + 'image' => "fset.png", + 'access' => $user_group[$member_id['user_group']]['admin_wordfilter'] + ), + + array ( + 'name' => $lang['opt_ipban'], + 'url' => "$PHP_SELF?mod=blockip", + 'descr' => $lang['opt_ipbanc'], + 'image' => "blockip.png", + 'access' => $user_group[$member_id['user_group']]['admin_blockip'] + ) + ); + + + + $options['others'] = array ( + + array ( + 'name' => $lang['opt_email'], + 'url' => "$PHP_SELF?mod=email", + 'descr' => $lang['opt_emailc'], + 'image' => "mset.png", + 'access' => "admin" + ), + + array ( + 'name' => $lang['opt_static'], + 'url' => "$PHP_SELF?mod=static", + 'descr' => $lang['opt_staticd'], + 'image' => "spset.png", + 'access' => $user_group[$member_id['user_group']]['admin_static'] + ), + + array ( + 'name' => $lang['opt_clean'], + 'url' => "$PHP_SELF?mod=clean", + 'descr' => $lang['opt_cleanc'], + 'image' => "clean.png", + 'access' => "admin" + ), + + array ( + 'name' => $lang['main_newsl'], + 'url' => "$PHP_SELF?mod=newsletter", + 'descr' => $lang['main_newslc'], + 'image' => "nset.png", + 'access' => "admin" + ), + + array ( + 'name' => $lang['opt_img'], + 'url' => "$PHP_SELF?mod=files", + 'descr' => $lang['opt_imgc'], + 'image' => "iset.png", + 'access' => "admin" + ), + + array ( + 'name' => 'Стол заказов', + 'url' => "$PHP_SELF?mod=table", + 'descr' => 'Обслуживание стола заказов', + 'image' => "fset.png", + 'access' => $user_group[$member_id['user_group']]['admin_table'] + ), + + array ( + 'name' => $lang['opt_google'], + 'url' => "$PHP_SELF?mod=googlemap", + 'descr' => $lang['opt_googlec'], + 'image' => "googlemap.png", + 'access' => $user_group[$member_id['user_group']]['admin_googlemap'] + ), + array( + 'name' => "Mini Chat", + 'url' => "$PHP_SELF?mod=chat", + 'descr' => "Управление чатом", + 'image' => "mchat.png", + 'access' => "admin" + ), + + array( + 'name' => "Репутация", + 'url' => "$PHP_SELF?mod=repa", + 'descr' => "Репутация пользователей", + 'image' => "rep.png", + 'access' => "admin" + ), + array( + 'name' => "Forum", + 'url' => "$PHP_SELF?mod=forum", + 'descr' => "Управление форумом и его сообщениями", + 'image' => "dle_forum.PNG", + 'access' => "admin", + ) + + ); + + + + //------------------------------------------------ + // Cut the options for wich we don't have access + //------------------------------------------------ + foreach ( $options as $sub_options => $value ) { + $count_options = count( $value ); + + for($i = 0; $i < $count_options; $i ++) { + + if ($member_id['user_group'] == 1 ) continue; + + if ($member_id['user_group'] != 1 AND $value[$i]['access'] == "admin") unset( $options[$sub_options][$i] ); + + if ( !$value[$i]['access'] ) unset( $options[$sub_options][$i] ); + } + } + + $subs = 0; + + foreach ( $options as $sub_options ) { + + if( $subs == 1 ) $lang['opt_hopt'] = $lang['opt_s_acc']; + if( $subs == 2 ) $lang['opt_hopt'] = $lang['opt_s_tem']; + if( $subs == 3 ) $lang['opt_hopt'] = $lang['opt_s_fil']; + if( $subs == 4 ) $lang['opt_hopt'] = $lang['opt_s_oth']; + + $subs ++; + + if( ! count( $sub_options ) ) continue; + + echo << + + + + + + + + + +HTML; + + } + + echo <<
    + + + + +
    +
    +HTML; + + $i = 0; + + foreach ( $sub_options as $option ) { + + if( $i > 1 ) { + echo ""; + $i = 0; + } + + $i ++; + + echo << +
    + + + + +
    +
    + + + + + + + + + +
    +HTML; + + } + + echofooter(); +} + +// ******************************************************************************** +// Íàñòðîéêè ñêðèïòà +// ******************************************************************************** +elseif( $action == "syscon" ) { + + if( $member_id['user_group'] != 1 ) { + msg( "error", $lang['opt_denied'], $lang['opt_denied'] ); + } + + include_once SYSTEM_DIR . '/classes/parse.class.php'; + $parse = new ParseFilter( Array (), Array (), 1, 1 ); + + $config['offline_reason'] = str_replace( '"', '"', $config['offline_reason'] ); + + $config['offline_reason'] = $parse->decodeBBCodes( $config['offline_reason'], false ); + if( $auto_detect_config ) $config['http_home_url'] = ""; + + echoheader( "options", $lang['opt_all'] ); + + if( ! $handle = opendir( "./templates" ) ) { + die( "Íåâîçìîæíî îòêðûòü äèðåêòîðèþ ./templates" ); + } + while ( false !== ($file = readdir( $handle )) ) { + if( is_dir( ROOT_DIR . "/templates/$file" ) and ($file != "." and $file != "..") ) { + $sys_con_skins_arr[$file] = $file; + } + } + closedir( $handle ); + + if( ! $handle = opendir( "./language" ) ) { + die( "Íåâîçìîæíî îòêðûòü äèðåêòîðèþ ./data/language/" ); + } + while ( false !== ($file = readdir( $handle )) ) { + if( is_dir( ROOT_DIR . "/language/$file" ) and ($file != "." and $file != "..") ) { + $sys_con_langs_arr[$file] = $file; + } + } + closedir( $handle ); + + foreach ( $user_group as $group ) + $sys_group_arr[$group['id']] = $group['group_name']; + + echo << + + function ChangeOption(selectedOption) { + + document.getElementById('general').style.display = "none"; + document.getElementById('security').style.display = "none"; + document.getElementById('news').style.display = "none"; + document.getElementById('comments').style.display = "none"; + document.getElementById('optimisation').style.display = "none"; + document.getElementById('files').style.display = "none"; + document.getElementById('mail').style.display = "none"; + document.getElementById('users').style.display = "none"; + document.getElementById('imagesconf').style.display = "none"; + document.getElementById('rss').style.display = "none"; + document.getElementById('smartphone').style.display = "none"; + + if(selectedOption == 'general') {document.getElementById('general').style.display = "";} + if(selectedOption == 'security') {document.getElementById('security').style.display = "";} + if(selectedOption == 'news') {document.getElementById('news').style.display = "";} + if(selectedOption == 'comments') {document.getElementById('comments').style.display = "";} + if(selectedOption == 'optimisation') {document.getElementById('optimisation').style.display = "";} + if(selectedOption == 'files') {document.getElementById('files').style.display = "";} + if(selectedOption == 'mail') {document.getElementById('mail').style.display = "";} + if(selectedOption == 'users') {document.getElementById('users').style.display = "";} + if(selectedOption == 'imagesconf') {document.getElementById('imagesconf').style.display = "";} + if(selectedOption == 'smartphone') {document.getElementById('smartphone').style.display = "";} + if(selectedOption == 'rss') {document.getElementById('rss').style.display = "";} + + + } + + +
    + + + + + + + + + + + + + + + + +
    + + + + +
    +
    + + + + +
    + + + +
    + + + + + + + + + + + +
    +
    +
    +
    +HTML; + + echo << +
    + + + + + + + + + + + + + + + + +
    + +HTML; + + echo <<"; + + echo <<"; + + echo <<"; + + echo <<"; + + echo <<"; + + echo <<"; + + echo <<"; + + echo <<"; + + echo <<"; + + + echo <<"; + + + echo <<"; + + echo << + + +
    + + + + +
    +
    +HTML; + + showRow( $lang['opt_sys_ht'], $lang['opt_sys_htd'], "" ); + showRow( $lang['opt_sys_hu'], $lang['opt_sys_hud'], "" ); + + showRow( $lang['opt_sys_chars'], $lang['opt_sys_charsd'], "" ); + + showRow( $lang['opt_sys_descr'], $lang['opt_sys_descrd'], "" ); + showRow( $lang['opt_sys_key'], $lang['opt_sys_keyd'], "" ); + showRow( $lang['opt_sys_short_name'], $lang['opt_sys_short_named'], "" ); + + showRow( $lang['opt_sys_at'], $lang['opt_sys_atd']." ".date ( "d.m.Y, H:i", time () + ($config['date_adjust'] * 60) ), "" ); + + showRow( $lang['opt_sys_dc'], $lang['opt_sys_dcd'], makeDropDown( array ("yes" => $lang['opt_sys_yes'], "no" => $lang['opt_sys_no'] ), "save_con[allow_alt_url]", "{$config['allow_alt_url']}" ) ); + + showRow( $lang['opt_sys_al'], $lang['opt_sys_ald'], makeDropDown( $sys_con_langs_arr, "save_con[langs]", "{$config['langs']}" ) ); + showRow( $lang['opt_sys_as'], $lang['opt_sys_asd'], makeDropDown( $sys_con_skins_arr, "save_con[skin]", "{$config['skin']}" ) ); + + showRow( $lang['opt_sys_ag'], $lang['opt_sys_agd'], makeDropDown( array ("yes" => $lang['opt_sys_yes'], "no" => $lang['opt_sys_no'] ), "save_con[allow_gzip]", "{$config['allow_gzip']}" ) ); + showRow( $lang['opt_sys_cac'], $lang['opt_sys_cad'], makeDropDown( array ("yes" => $lang['opt_sys_yes'], "no" => $lang['opt_sys_no'] ), "save_con[allow_cache]", "{$config['allow_cache']}" ) ); + showRow( "Тип кеширования", "Files - более медленное кеширование в файлы, MemCache - Кеширование в оперативную память", makeDropDown( array ("0" => "Files", "1" => "Memcache" ), "save_con[cache_type]", "{$config['cache_type']}" ) ); + + showRow( $lang['opt_sys_offline'], $lang['opt_sys_offlined'], makeDropDown( array ("yes" => $lang['opt_sys_yes'], "no" => $lang['opt_sys_no'] ), "save_con[site_offline]", "{$config['site_offline']}" ) ); + showRow( $lang['opt_sys_reason'], $lang['opt_sys_reasond'], "" ); + + echo "
    + + + + +
    +
    +HTML; + + showRow( $lang['opt_sys_path'], $lang['opt_sys_pathd'], "" ); + + showRow( $lang['opt_sys_ip'], $lang['opt_sys_ipd'], makeDropDown( array ("0" => $lang['opt_sys_ipn'], "1" => $lang['opt_sys_ipm'], "2" => $lang['opt_sys_iph'] ), "save_con[ip_control]", "{$config['ip_control']}" ) ); + + showRow( $lang['opt_sys_loghash'], $lang['opt_sys_loghashd'], makeDropDown( array ("1" => $lang['opt_sys_yes'], "0" => $lang['opt_sys_no'] ), "save_con[log_hash]", "{$config['log_hash']}" ) ); + + echo "
    + + + + +
    +
    +HTML; + + showRow( $lang['opt_sys_newc'], $lang['opt_sys_newd'], "" ); + showRow( "Количество кратких новостей", "Количетство новостей просматриваемые кратким просмотром", "" ); + showRow( $lang['opt_sys_related_num'], $lang['opt_sys_related_numd'], "" ); + showRow( 'Количество торрентов списком', 'Отображаемое количетство информации по торрент файлам', "" ); + showRow( $lang['opt_sys_am'], $lang['opt_sys_amd'], "" ); + showRow( $lang['opt_sys_an'], "$lang[opt_sys_and]", "" ); + showRow( $lang['opt_sys_sort'], $lang['opt_sys_sortd'], makeDropDown( array ("date" => $lang['opt_sys_sdate'], "rating" => $lang['opt_sys_srate'], "news_read" => $lang['opt_sys_sview'], "title" => $lang['opt_sys_salph'] ), "save_con[news_sort]", "{$config['news_sort']}" ) ); + showRow( $lang['opt_sys_msort'], $lang['opt_sys_msortd'], makeDropDown( array ("DESC" => $lang['opt_sys_mminus'], "ASC" => $lang['opt_sys_mplus'] ), "save_con[news_msort]", "{$config['news_msort']}" ) ); + showRow( $lang['opt_sys_catsort'], $lang['opt_sys_catsortd'], makeDropDown( array ("date" => $lang['opt_sys_sdate'], "rating" => $lang['opt_sys_srate'], "news_read" => $lang['opt_sys_sview'], "title" => $lang['opt_sys_salph'] ), "save_con[catalog_sort]", "{$config['catalog_sort']}" ) ); + showRow( $lang['opt_sys_catmsort'], $lang['opt_sys_catmsortd'], makeDropDown( array ("DESC" => $lang['opt_sys_mminus'], "ASC" => $lang['opt_sys_mplus'] ), "save_con[catalog_msort]", "{$config['catalog_msort']}" ) ); + showRow( $lang['opt_sys_align'], $lang['opt_sys_alignd'], makeDropDown( array ("" => $lang['opt_sys_none'], "left" => $lang['opt_sys_left'], "center" => $lang['opt_sys_center'], "right" => $lang['opt_sys_right'] ), "save_con[image_align]", "{$config['image_align']}" ) ); + + showRow( $lang['opt_sys_adt'], $lang['opt_sys_adtd'], makeDropDown( array ("1" => $lang['opt_sys_yes'], "0" => $lang['opt_sys_no'] ), "save_con[allow_add_tags]", "{$config['allow_add_tags']}" ) ); + + echo "
    + + + + +
    +
    +HTML; + showRow( $lang['opt_sys_alc'], $lang['opt_sys_alcd'], makeDropDown( array ("yes" => $lang['opt_sys_yes'], "no" => $lang['opt_sys_no'] ), "save_con[allow_comments]", "{$config['allow_comments']}" ) ); + showRow( $lang['opt_sys_maxc'], $lang['opt_sys_maxcd'], "" ); + showRow( $lang['opt_sys_cpm'], $lang['opt_sys_cpmd'], "" ); + showRow( $lang['opt_sys_csort'], $lang['opt_sys_csortd'], makeDropDown( array ("DESC" => $lang['opt_sys_mminus'], "ASC" => $lang['opt_sys_mplus'] ), "save_con[comm_msort]", "{$config['comm_msort']}" ) ); + showRow( $lang['opt_sys_aw'], $lang['opt_sys_awd'], "" ); + showRow( $lang['opt_sys_ct'], "$lang[opt_sys_and]", "" ); + echo "
    + + + + +
    +
    +HTML; + + showRow( $lang['opt_sys_search'], $lang['opt_sys_searchd'], makeDropDown( array ("1" => $lang['opt_sys_advance'], "0" => $lang['opt_sys_simple'] ), "save_con[full_search]", "{$config['full_search']}" ) ); + showRow( $lang['opt_sys_multiple'], $lang['opt_sys_multipled'], makeDropDown( array ("1" => $lang['opt_sys_yes'], "0" => $lang['opt_sys_no'] ), "save_con[allow_multi_category]", "{$config['allow_multi_category']}" ) ); + showRow( $lang['opt_sys_nodate'], $lang['opt_sys_nodated'], makeDropDown( array ("1" => $lang['opt_sys_yes'], "0" => $lang['opt_sys_no'] ), "save_con[no_date]", "{$config['no_date']}" ) ); + showRow( $lang['opt_sys_ajax'], $lang['opt_sys_ajaxd'], makeDropDown( array ("1" => $lang['opt_sys_yes'], "0" => $lang['opt_sys_no'] ), "save_con[ajax]", "{$config['ajax']}" ) ); + + echo "
    + + + + +
    +
    +HTML; + + showRow( $lang['opt_sys_file'], $lang['opt_sys_filed'], makeDropDown( array ("yes" => $lang['opt_sys_yes'], "no" => $lang['opt_sys_no'] ), "save_con[files_allow]", "{$config['files_allow']}" ) ); + showRow( $lang['opt_sys_file1'], $lang['opt_sys_file1d'], "" ); + + showRow( $lang['opt_sys_maxfile'], $lang['opt_sys_maxfiled'], "" ); + showRow( $lang['opt_sys_maxfilec'], $lang['opt_sys_maxfilecd'], "" ); + + showRow( $lang['opt_sys_file4'], $lang['opt_sys_file4d'], makeDropDown( array ("1" => $lang['opt_sys_yes'], "0" => $lang['opt_sys_no'] ), "save_con[files_force]", "{$config['files_force']}" ) ); + showRow( $lang['opt_sys_file5'], $lang['opt_sys_file5d'], "" ); + showRow( $lang['opt_sys_file2'], $lang['opt_sys_file2d'], makeDropDown( array ("yes" => $lang['opt_sys_yes'], "no" => $lang['opt_sys_no'] ), "save_con[files_count]", "{$config['files_count']}" ) ); + + echo "
    + + + + +
    +
    +HTML; + showRow( $lang['opt_sys_amail'], $lang['opt_sys_amaild'], "" ); + + showRow( $lang['opt_sys_mm'], $lang['opt_sys_mmd'], makeDropDown( array ("php" => "PHP Mail()", "smtp" => "SMTP" ), "save_con[mail_metod]", "{$config['mail_metod']}" ) ); + + showRow( $lang['opt_sys_smtph'], $lang['opt_sys_smtphd'], "" ); + showRow( $lang['opt_sys_smtpp'], $lang['opt_sys_smtppd'], "" ); + showRow( $lang['opt_sys_smtup'], $lang['opt_sys_smtpud'], "" ); + showRow( $lang['opt_sys_smtupp'], $lang['opt_sys_smtpupd'], "" ); + + showRow( $lang['opt_sys_mbcc'], $lang['opt_sys_mbccd'], makeDropDown( array ("1" => $lang['opt_sys_yes'], "0" => $lang['opt_sys_no'] ), "save_con[mail_bcc]", "{$config['mail_bcc']}" ) ); + + echo "
    + + + + +
    +
    +HTML; + showRow( $lang['opt_sys_reggroup'], $lang['opt_sys_reggroupd'], makeDropDown( $sys_group_arr, "save_con[reg_group]", $config['reg_group'] ) ); + + showRow( $lang['opt_sys_ut'], $lang['opt_sys_utd'], makeDropDown( array ("0" => $lang['opt_sys_reg'], "1" => $lang['opt_sys_reg_1'] ), "save_con[registration_type]", "{$config['registration_type']}" ) ); + + showRow( $lang['opt_sys_code'], $lang['opt_sys_coded'], makeDropDown( array ("yes" => $lang['opt_sys_yes'], "no" => $lang['opt_sys_no'] ), "save_con[allow_sec_code]", "{$config['allow_sec_code']}" ) ); + showRow( $lang['opt_sys_sc'], $lang['opt_sys_scd'], makeDropDown( array ("yes" => $lang['opt_sys_yes'], "no" => $lang['opt_sys_no'] ), "save_con[allow_skin_change]", "{$config['allow_skin_change']}" ) ); + showRow( $lang['opt_sys_pmail'], $lang['opt_sys_pmaild'], makeDropDown( array ("1" => $lang['opt_sys_yes'], "0" => $lang['opt_sys_no'] ), "save_con[mail_pm]", "{$config['mail_pm']}" ) ); + showRow( "Онлайн на пользователя", "Количество минут которые пользователь считается онлайн", "" ); + + echo "
    + + + + +
    +
    +HTML; + + showRow( $lang['opt_sys_maxside'], $lang['opt_sys_maxsided'], "" ); + showRow( $lang['opt_sys_maxsize'], $lang['opt_sys_maxsized'], "" ); + showRow( $lang['opt_sys_dim'], $lang['opt_sys_dimd'], "" ); + showRow( $lang['opt_sys_iw'], $lang['opt_sys_iwd'], makeDropDown( array ("yes" => $lang['opt_sys_yes'], "no" => $lang['opt_sys_no'] ), "save_con[allow_watermark]", "{$config['allow_watermark']}" ) ); + showRow( $lang['opt_sys_im'], $lang['opt_sys_imd'], "" ); + showRow( $lang['opt_sys_ia'], $lang['opt_sys_iad'], "1- 2- 3-" ); + showRow( "Фотография профиля", "1 - Размер большой фотографии 2 - Уменьшенная копия", "1- 2-" ); + showRow( $lang['opt_sys_ij'], $lang['opt_sys_ijd'], "" ); + showRow( $lang['opt_sys_imw'], $lang['opt_sys_imwd'], "" ); + showRow( "Ширина обложки", "Максимальная ширина обложки, при ее достижении большое изображение будет уменьшено до текущей ширины.", "" ); + showRow( "Размер аваток", "Максимально допустимый к загрузке размер аватарок", "" ); + echo "
    + + + + +
    +
    +HTML; + + showRow( $lang['opt_sys_sm_im'], $lang['opt_sys_sm_imd'], makeDropDown( array ("1" => $lang['opt_sys_yes'], "0" => $lang['opt_sys_no'] ), "save_con[allow_smart_images]", "{$config['allow_smart_images']}" ) ); + showRow( $lang['opt_sys_sm_iv'], $lang['opt_sys_sm_ivd'], makeDropDown( array ("1" => $lang['opt_sys_yes'], "0" => $lang['opt_sys_no'] ), "save_con[allow_smart_video]", "{$config['allow_smart_video']}" ) ); + showRow( $lang['opt_sys_sm_fm'], $lang['opt_sys_sm_fmd'], makeDropDown( array ("1" => $lang['opt_sys_yes'], "0" => $lang['opt_sys_no'] ), "save_con[allow_smart_format]", "{$config['allow_smart_format']}" ) ); + + echo "
    + + + + +
    +
    +HTML; + + showRow( $lang['opt_sys_arss'], $lang['opt_sys_arssd'], makeDropDown( array ("1" => $lang['opt_sys_yes'], "0" => $lang['opt_sys_no'] ), "save_con[allow_rss]", "{$config['allow_rss']}" ) ); + showRow( $lang['opt_sys_trss'], $lang['opt_sys_trssd'], makeDropDown( array ("0" => $lang['opt_sys_rss_type_0'], "1" => $lang['opt_sys_rss_type_1'] ), "save_con[rss_mtype]", "{$config['rss_mtype']}" ) ); + showRow( $lang['opt_sys_nrss'], $lang['opt_sys_nrssd'], "" ); + showRow( $lang['opt_sys_crss'], $lang['opt_sys_crssd'], "" ); + showRow( $lang['opt_sys_frss'], $lang['opt_sys_frssd'], "" ); + + echo "
    +
    +
    +
    +HTML; + + echofooter(); +} // ******************************************************************************** +// Çàïèñü íàñòðîåê +// ******************************************************************************** +elseif( $action == "dosavesyscon" ) { + if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) {die( "Hacking attempt! User not found" ); } + + if( $member_id['user_group'] != 1 ) {msg( "error", $lang['opt_denied'], $lang['opt_denied'] );} + + $save_con = $_POST['save_con']; + + include_once SYSTEM_DIR . '/classes/parse.class.php'; + $parse = new ParseFilter( Array (), Array (), 1, 1 ); + + $save_con['offline_reason'] = $parse->process( stripslashes( trim( $save_con['offline_reason'] ) ) ); + $save_con['offline_reason'] = str_replace( '"', '"', $parse->BB_Parse( $save_con['offline_reason'], false ) ); + + $find[] = "'\r'"; + $replace[] = ""; + $find[] = "'\n'"; + $replace[] = ""; + + if( $auto_detect_config ) $config['http_home_url'] = ""; + + $save_con = $save_con + $config; + + if( $member_id['user_group'] != 1 ) { + msg( "error", $lang['opt_denied'], $lang['opt_denied'] ); + } + + $handler = fopen( SYSTEM_DIR . '/data/config.php', "w" ); + + fwrite( $handler, " $value ) { + + if( $name != "offline_reason" ) { + + $value = trim( stripslashes( $value ) ); + $value = htmlspecialchars( $value); + $value = preg_replace( $find, $replace, $value ); + + $name = trim( stripslashes( $name ) ); + $name = htmlspecialchars( $name, ENT_QUOTES ); + $name = preg_replace( $find, $replace, $name ); + } + + $value = str_replace( "$", "$", $value ); + $value = str_replace( "{", "{", $value ); + $value = str_replace( "}", "}", $value ); + + $name = str_replace( "$", "$", $name ); + $name = str_replace( "{", "{", $name ); + $name = str_replace( "}", "}", $name ); + + fwrite( $handler, "'{$name}' => \"{$value}\",\n\n" ); + + } + fwrite( $handler, ");\n\n?>" ); + fclose( $handler ); + + $cache->clear(); + msg( "info", $lang['opt_sysok'], "$lang[opt_sysok_1]

    $lang[db_prev]" ); +} + +?> \ No newline at end of file diff --git a/system/inc/preview.php b/system/inc/preview.php new file mode 100644 index 0000000..bc50f57 --- /dev/null +++ b/system/inc/preview.php @@ -0,0 +1,243 @@ +allow_php_include = false; +$dle_module = "main"; + + if ($_POST['preview_mode'] == "static" AND $_POST['skin_name']) + { + if (@is_dir(ROOT_DIR.'/templates/'.$_POST['skin_name'])) + { + $config['skin'] = $_POST['skin_name']; + } + } + +$tpl->dir = ROOT_DIR.'/templates/'.$config['skin']; +$tpl->load_template('preview.css'); + +echo <<Предварительный просмотр + + + + + +HTML; + +$tpl->clear(); + +echo << + + +HTML; + +include_once SYSTEM_DIR.'/classes/parse.class.php'; + +$parse = new ParseFilter(Array(), Array(), 1, 1); + + +if ($_POST['preview_mode'] == "static" ) { + + $allow_br = intval( $_POST['allow_br'] ); + if ($member_id['user_group'] != 1 AND $allow_br > 1 ) $allow_br = 1; + + if ($allow_br == 2) { + + if( function_exists( "get_magic_quotes_gpc" ) && get_magic_quotes_gpc() ) $_POST['template'] = stripslashes( $_POST['template'] ); + + $template = trim( addslashes( $_POST['template'] ) ); + + } else { + + $template = $parse->process( $_POST['template'] ); + + $template = $parse->BB_Parse( $template ); + + } + + $descr = trim(htmlspecialchars(stripslashes($_POST['description']))); + + $dle_module = "static"; + + $tpl->load_template('static.tpl'); + + $tpl->set('{static}', stripslashes( $template ) ); + $tpl->set('{description}', $descr); + $tpl->set('{views}', "0"); + $tpl->set('{pages}', ""); + $tpl->set('{date}', "--"); + $tpl->copy_template = preg_replace ( "#\{date=(.+?)\}#ie", "", $tpl->copy_template ); + + $tpl->copy_template = "
    {$lang['preview_static']} ".$tpl->copy_template."
    "; + $tpl->compile('template'); + $tpl->result['template'] = preg_replace( "'\[hide\](.*?)\[/hide\]'si", "\\1", $tpl->result['template']); + $tpl->result['template'] = str_replace ( '{THEME}', $config['http_home_url'] . 'templates/' . $config['skin'], $tpl->result['template'] ); + + echo $tpl->result['template']; + +} else { + +$title = stripslashes($parse->process($_POST['title'])); + +$full_story = $parse->process($_POST['full_story']); +$short_story = $parse->process($_POST['short_story']); + +$full_story = $parse->BB_Parse($full_story, false); +$short_story = $parse->BB_Parse($short_story, false); + + if (!count($category)) { $my_cat = "---"; $my_cat_link = "---";} else { + + $my_cat = array (); $my_cat_link = array (); + + foreach ($category as $element) { + if ($element) { $my_cat[] = $cat[$element]; + $my_cat_link[] = "{$cat[$element]}"; + } + } + $my_cat = stripslashes(implode (', ', $my_cat)); + $my_cat_link = stripslashes(implode (', ', $my_cat_link)); + } + + $dle_module = "main"; + $tpl->load_template('shortstory.tpl'); + + if ( $parse->not_allowed_text ) $tpl->copy_template = $lang['news_err_39']; + + $tpl->set('{title}', $title); + $tpl->set('{views}', 0); + $date = time(); + $tpl->set( '{date}', langdate( $config['timestamp_active'], $date ) ); + $tpl->copy_template = preg_replace ( "#\{date=(.+?)\}#ie", "langdate('\\1', '{$date}')", $tpl->copy_template ); + $tpl->set('[link]',""); + $tpl->set('[/link]',""); + $tpl->set('{comments-num}', 0); + $tpl->set('[full-link]', ""); + $tpl->set('[/full-link]', ""); + $tpl->set('[day-news]', ""); + $tpl->set('[/day-news]', ""); + $tpl->set('[com-link]', ""); + $tpl->set('[/com-link]', ""); + $tpl->set('{rating}', ""); + $tpl->set('{approve}', ""); + $tpl->set('{author}', "--"); + $tpl->set('{category}', $my_cat); + $tpl->set('{favorites}', ''); + $tpl->set('{link-category}', $my_cat_link); + $tpl->set_block("'\\[tags\\](.*?)\\[/tags\\]'si",""); + $tpl->set('{tags}', ""); + $tpl->copy_template = preg_replace ( "#\{date=(.+?)\}#ie", "", $tpl->copy_template ); + + $tpl->set('[mail]',""); + $tpl->set('[/mail]',""); + $tpl->set('{news-id}', "ID Unknown"); + $tpl->set('{php-self}', $PHP_SELF); + + $tpl->copy_template = preg_replace( "#\\[category=(.+?)\\](.*?)\\[/category\\]#is","\\2", $tpl->copy_template); + + $tpl->set_block("'\\[edit\\].*?\\[/edit\\]'si",""); + + $tpl->set('{short-story}', stripslashes($short_story)); + $tpl->set('{full-story}', stripslashes($full_story)); + + + $tpl->copy_template = "
    {$lang['preview_short']} ".$tpl->copy_template."
    "; + $tpl->compile('shortstory'); + + $tpl->result['shortstory'] = preg_replace( "'\[hide\](.*?)\[/hide\]'si", "\\1", $tpl->result['shortstory']); + $tpl->result['shortstory'] = str_replace ( '{THEME}', $config['http_home_url'] . 'templates/' . $config['skin'], $tpl->result['shortstory'] ); + + echo $tpl->result['shortstory']; + + $dle_module = "showfull"; + $tpl->load_template('fullstory.tpl'); + + if ( $parse->not_allowed_text ) $tpl->copy_template = $lang['news_err_39']; + + if( strlen( $full_story ) < 13 AND strpos( $tpl->copy_template, "{short-story}" ) === false ) { $full_story = $short_story; } + + $tpl->set('{title}', $title); + $tpl->set('{views}', 0); + $tpl->set( '{date}', langdate( $config['timestamp_active'], $date ) ); + $tpl->copy_template = preg_replace ( "#\{date=(.+?)\}#ie", "langdate('\\1', '{$date}')", $tpl->copy_template ); + $tpl->set('[link]',""); + $tpl->set('[/link]',""); + $tpl->set('{comments-num}', 0); + $tpl->set('[full-link]', ""); + $tpl->set('[/full-link]', ""); + $tpl->set('[com-link]', ""); + $tpl->set('[/com-link]', ""); + $tpl->set('[day-news]', ""); + $tpl->set('[/day-news]', ""); + $tpl->set('{rating}', ""); + $tpl->set('{author}', "--"); + $tpl->copy_template = preg_replace ( "#\{date=(.+?)\}#ie", "", $tpl->copy_template ); + $tpl->set('{category}', $my_cat); + $tpl->set('{link-category}', $my_cat_link); + $tpl->set('{related-news}', ""); + + $tpl->set('{pages}', ''); + $tpl->set('{favorites}', ''); + $tpl->set('[mail]',""); + $tpl->set('[/mail]',""); + $tpl->set('{poll}', ''); + $tpl->set('{news-id}', "ID Unknown"); + $tpl->set('{php-self}', $PHP_SELF); + + $tpl->copy_template = preg_replace( "#\\[category=(.+?)\\](.*?)\\[/category\\]#is","\\2", $tpl->copy_template); + + $tpl->set_block("'\\[edit\\].*?\\[/edit\\]'si",""); + $tpl->set_block("'\\[tags\\](.*?)\\[/tags\\]'si",""); + $tpl->set('{tags}', ""); + + $tpl->set('{short-story}', stripslashes($short_story)); + $tpl->set('{full-story}', stripslashes($full_story)); + +$tpl->copy_template = "
    {$lang['preview_full']} ".$tpl->copy_template."
    "; +$tpl->compile('fullstory'); +$tpl->result['fullstory'] = preg_replace( "'\[hide\](.*?)\[/hide\]'si", "\\1", $tpl->result['fullstory']); +$tpl->result['fullstory'] = str_replace ( '{THEME}', $config['http_home_url'] . 'templates/' . $config['skin'], $tpl->result['fullstory'] ); + +echo $tpl->result['fullstory']; + +} + +?> + \ No newline at end of file diff --git a/system/inc/rebuild.php b/system/inc/rebuild.php new file mode 100644 index 0000000..7439a66 --- /dev/null +++ b/system/inc/rebuild.php @@ -0,0 +1,439 @@ +super_query( "SELECT COUNT(*) as count FROM " . PREFIX . "_post" ); +echo << +
    + + + + + + + + + + + + + + + + +
    + + + + +
    +
    + + + + + + + + + + + + + +
    {$lang['stat_allnews']} {$row['count']}, {$lang['rebuild_count']} 0 
     
    +
    +
    + +HTML; + + +$row = $db->super_query( "SELECT COUNT(*) as count FROM " . PREFIX . "_static" ); +echo << +
    + + + + + + + + + + + + + + + + +
    + + + + +
    +
    + + + + + + + + + + + + +
    {$lang['stat_allstaic']} {$row['count']}, {$lang['rebuild_count']} 0 
     
    +
    +
    + +HTML; + +$row2 = $db->super_query( "SELECT COUNT(*) as count FROM " . PREFIX . "_comments" ); +echo << +
    + + + + + + + + + + + + + + + + +
    + + + + +
    +
    + + + + + + + + + + + + +
    Общее коолличество комментариев {$row2['count']}, {$lang['rebuild_count']} 0 
     
    +
    +
    + +HTML; + +$row3 = $db->super_query( "SELECT COUNT(*) as count FROM " . PREFIX . "_forum_posts" ); +echo << +
    + + + + + + + + + + + + + + + + +
    + + + + +
    +
    + + + + + + + + + + + + +
    Общее коолличество постов {$row3['count']}, {$lang['rebuild_count']} 0 
     
    +
    +
    + +HTML; + +echofooter(); +?> \ No newline at end of file diff --git a/system/inc/repa.php b/system/inc/repa.php new file mode 100644 index 0000000..7bcd1cd --- /dev/null +++ b/system/inc/repa.php @@ -0,0 +1,106 @@ + + + + + + + + + +HTML; +} + +function closetable() +{ +echo << + + + + + + + + +HTML; +} + +function tableheader($value) +{ +echo << + + + + +HTML; + unterline(); +} +function unterline() { +echo << +HTML; +} + +if($action == "options" or $action == '') +{ + include_once 'repa/repa_main.php'; +} +elseif($action == "opt") +{ + include_once 'repa/repa_options.php'; +} +elseif ($action == "edit") +{ + include_once 'repa/repa_edit.php'; +} +elseif ($action == "vminus") +{ + include_once 'repa/repa_vminus.php'; +} +elseif ($action == "vplus") +{ + include_once 'repa/repa_vplus.php'; +} +elseif ($action == "delcom") +{ + $change_com = $repa_cf['ch_com']; + $db->query("UPDATE `".USERPREFIX."_reputation` SET `text`='$change_com' WHERE `id`='$id'"); + msg("info", $lang['delcom'], "{$lang_repa['deleted']}

    ", ""); +} +elseif ($action == "delete") +{ + include_once 'repa/repa_delete.php'; +} +elseif ($action == "save") +{ + include_once 'repa/repa_save.php'; +} +elseif($action == 'control') +{ + include_once 'repa/repa_control.php'; +} +else +{ + msg("error", $lang['addnews_denied'], $lang['db_denied']); +} + +?> \ No newline at end of file diff --git a/system/inc/repa/repa_control.php b/system/inc/repa/repa_control.php new file mode 100644 index 0000000..04d0546 --- /dev/null +++ b/system/inc/repa/repa_control.php @@ -0,0 +1,183 @@ + + + + + + + + + + + + + +
    +
    + + +HTML; +echo ""; +echo << + + + +
    Главное меню
    + + + + + + + + + + +HTML; + +opentable(); +tableheader($lang_repa['repa_cntrl']); + +echo << + +HTML; + +$query_count = "SELECT COUNT(*) as count from " . USERPREFIX . "_reputation"; +$result_count = $db->super_query($query_count); +if ($result_count['count'] == 0) + echo "

    {$lang_repa['repa_nothing']}


    "; +else +{ + $all_count_results = $result_count['count']; + $N = 30; + if ( isset($_GET['page']) ) + { + $page = intval($_GET['page']); + if ( $page < 1 ) $page = 1; + } + else + { + $page = 1; + } + + $cnt_pages = ceil( $result_count['count'] / $N ); + if ( $page > $cnt_pages ) $page = $cnt_pages; + $start = ( $page - 1 ) * $N; + $query = $db->query("SELECT * FROM `" . USERPREFIX . "_reputation` ORDER BY `date` DESC LIMIT $start, $N"); + + if ( $cnt_pages > 1 ) + { + echo '
     '.$lang_repa['repa_pages']; + if ( $page > 3 ) + $startpage = '<< ... '; + else + $startpage = ''; + if ( $page < ($cnt_pages - 2) ) + $endpage = ' ... >>'; + else + $endpage = ''; + if ( $page - 2 > 0 ) + $page2left = ' '.($page - 2).''; + else + $page2left = ''; + if ( $page - 1 > 0 ) + $page1left = ' '.($page - 1).' '; + else + $page1left = ''; + if ( $page + 2 <= $cnt_pages ) + $page2right = ' '.($page + 2).' '; + else + $page2right = ''; + if ( $page + 1 <= $cnt_pages ) + $page1right = ' '.($page + 1).' '; + else + $page1right = ''; + echo $startpage.$page2left.$page1left.''.$page.''.$page1right.$page2right.$endpage."\n"; + echo '
    '; + echo '
    '.$lang_repa['r_total'].' '. $result_count['count'].'
    '; + + } + while ($row = $db->get_row()) + { + $res_id = $row['id']; + if ($row['how'] > 0) + $how = "\"{$lang_repa['repa_how_pl']}\""; + if ($row['how'] < 0) + $how = "\"{$lang_repa['repa_how_mn']}\""; + if ($row['how'] == "totalminus") + $how = "\"{$lang_repa['repa_how_tm']}\""; + if ($row['how'] == "totalplus") + $how = "\"{$lang_repa['repa_how_tm']}\""; + $results .= " + + ".$row[author]." +   ".$row[komu]." + $row[date] + $how + $row[text] + + + "; + } + $db->free(); + + echo << + + {$lang_repa['repa_who']} + {$lang_repa['repa_to']} + Дата + {$lang_repa['repa_supp']} + {$lang_repa['repa_commst']} + {$lang_repa[vote_action]} + +
    + {$results} + + + +HTML; +} + +closetable(); +echofooter(); +closetable(); + +?> \ No newline at end of file diff --git a/system/inc/repa/repa_delete.php b/system/inc/repa/repa_delete.php new file mode 100644 index 0000000..e833045 --- /dev/null +++ b/system/inc/repa/repa_delete.php @@ -0,0 +1,90 @@ +super_query("SELECT `how`, `komu`, `author`, `text` FROM `" . USERPREFIX . "_reputation` WHERE `id`='$id'" ); +$author_log = $db->super_query("SELECT `user_id`, `name`, `repa`, `repa_mod` FROM `" . USERPREFIX . "_users` WHERE `name`='$result[author]'" ); +$to_log = $db->super_query("SELECT `user_id`, `name`, `repa`, `repa_mod` FROM `" . USERPREFIX . "_users` WHERE `name`='$result[komu]'" ); + +$target = $db->safesql( $result['komu'] ); +$how_text = $db->safesql( $result['text'] ); + +$repa_mod_mas = explode ("|", $to_log['repa_mod']); +$user_repa = $to_log['repa']; +$repa_delete = false; + +if ($author_log['name'] == "") + $author_log['name'] = $repa_cf['robot']; + +if ($result['how'] < 0) +{ + $user_repa = $user_repa + 1; + $repa_mod_mas[1] = $repa_mod_mas[1] - 1; + $user_repa_mod = $repa_mod_mas[0]."|".$repa_mod_mas[1]; + $db->query("UPDATE " . USERPREFIX . "_users SET repa = '$user_repa', repa_mod = '$user_repa_mod' WHERE name = '{$target}'"); + + $db->query("DELETE FROM `".USERPREFIX."_reputation` WHERE `id`='$id' LIMIT 1"); + + $repa_delete = true; +} +elseif ($result['how'] > 0) +{ + $user_repa = $user_repa - 1; + $repa_mod_mas[0] = $repa_mod_mas[0] - 1; + $user_repa_mod = $repa_mod_mas[0]."|".$repa_mod_mas[1]; + $db->query("UPDATE " . USERPREFIX . "_users SET repa = '$user_repa', repa_mod = '$user_repa_mod' WHERE name = '{$target}'"); + + $db->query("DELETE FROM `".USERPREFIX."_reputation` WHERE `id`='$id' LIMIT 1"); + + $repa_delete = true; +} +elseif ($result['how'] == 'totalminus') +{ + $user_repa = $user_repa - $vminus_autor; + $repa_mod_mas[1] = $repa_mod_mas[1] - $vminus_autor; + $user_repa_mod = $repa_mod_mas[0]."|".$repa_mod_mas[1]; + $db->query("UPDATE `".USERPREFIX."_users` SET `repa`='$user_repa', `repa_mod`='$user_repa_mod' WHERE `name`='$target'"); + + $db->query("DELETE FROM `".USERPREFIX."_reputation` WHERE `id`='$id' LIMIT 1"); + + $repa_delete = true; +} +elseif ($result['how'] == 'totalplus') +{ + $user_repa = $user_repa - $repa_cf['adm_plus']; + $repa_mod_mas[0] = $repa_mod_mas[0] - $vplus_autor; + $user_repa_mod = $repa_mod_mas[0]."|".$repa_mod_mas[1]; + $db->query("UPDATE `".USERPREFIX."_users` SET `repa`='$user_repa', `repa_mod`='$user_repa_mod' WHERE `name`='$target'"); + + $db->query("DELETE FROM `".USERPREFIX."_reputation` WHERE `id`='$id' LIMIT 1"); + + $repa_delete = true; +} +else + msg("info", $langms['sea_info'], "Не выбрано действие.

    ", ""); + +if ($repa_cf['msgs_del_status'] == "yes" AND $repa_delete) +{ + if($config['allow_alt_url'] == "yes") + $whois = "$member_id[name]"; + else + $whois = "$member_id[name]"; + $izvestie = $repa_cf['msgs_del_template']; + $izvestie = str_replace('{%kto%}', $whois, $izvestie); + $izvestie = str_replace('{%ot_kogo%}', $author_log[name], $izvestie); + $izvestie = str_replace('{%text%}', $how_text, $izvestie); + $time = time()+($config['date_adjust']*60); + $db->query("INSERT INTO " . USERPREFIX . "_pm (subj, text, user, user_from, date, pm_read, folder) values ('$lang_repa[repa_msg_changed]', '$izvestie', '$to_log[user_id]', '$member_id[name]', '$time', 'no', 'inbox')"); + $db->query("UPDATE " . USERPREFIX . "_users set pm_all=pm_all+1, pm_unread=pm_unread+1 where user_id='$to_log[user_id]'"); +} +if ($repa_delete) +{ + msg("info", $langms['sea_info'], "{$lang_repa['repa_done_minus_1']} {$to_log[name]} {$lang_repa['repa_done_minus_2']}

    ", ""); +} + +?> \ No newline at end of file diff --git a/system/inc/repa/repa_edit.php b/system/inc/repa/repa_edit.php new file mode 100644 index 0000000..a2d6825 --- /dev/null +++ b/system/inc/repa/repa_edit.php @@ -0,0 +1,114 @@ +
    ", ""); +else +{ + include_once SYSTEM_DIR.'/classes/parse.class.php'; + $parse = new ParseFilter(); + include_once SYSTEM_DIR . '/ajax/bbcode.php'; + + if ($_POST['submit']) + { + $new = $db->safesql( $parse->BB_Parse( $parse->process( $_POST['reason'] ), false )); + $db->query("UPDATE `".USERPREFIX."_reputation` SET `text`='$new' WHERE `id`='$id'"); + msg("info", $langms['sea_info'], "{$lang_repa['repa_msg_chd']}

    ", ""); + } + else + { + echoheader("",""); + +echo << +function ins_smile ( text ){ + doInsert(' ' + text + ' ', '', false); + + document.getElementById('dle_emo').style.visibility = "hidden"; + document.getElementById('dle_emo').style.display = "none"; + ie_range_cache = null; +}; + + + + + + + + + + + + + + + + + + +
    + + + + +
    +
    + + +HTML; +echo ""; +echo << + + + +
    Главное меню
    +
    + +HTML; + + opentable(); + tableheader($lang_repa['repa_cntrl']); + + $res = $db->super_query("SELECT * FROM ".PREFIX."_reputation where id = '$id'"); + if ($res['id'] == $id) + { + + $text = $parse->decodeBBCodes( $res['text'], false ); + +echo << + + + + + + + + + +
    {$lang_repa['repa_comm_ed']}{$bb_code}
      + + +
    +HTML; + + } + else + { + @header("Location: $PHP_SELF?mod=repa&action=control"); + } + closetable(); + echofooter(); + closetable(); + } +} + +?> \ No newline at end of file diff --git a/system/inc/repa/repa_main.php b/system/inc/repa/repa_main.php new file mode 100644 index 0000000..0827d98 --- /dev/null +++ b/system/inc/repa/repa_main.php @@ -0,0 +1,217 @@ +super_query("SELECT COUNT(*) as count FROM ".PREFIX."_reputation"); +$stats['changes'] = $row['count']; +$row = $db->super_query("SELECT COUNT(*) as count FROM ".PREFIX."_reputation WHERE how > '0'"); +$stats['incr'] = $row['count']; +$row = $db->super_query("SELECT COUNT(*) as count FROM ".PREFIX."_reputation WHERE how < '0'"); +$stats['decr'] = $row['count']; +$row = $db->super_query("SELECT COUNT(*) as count FROM ".PREFIX."_reputation WHERE how = 'totalminus'"); +$stats['tot_m'] = $row['count']; +$row = $db->super_query("SELECT COUNT(*) as count FROM ".PREFIX."_reputation WHERE how = 'totalplus'"); +$stats['tot_p'] = $row['count']; +$row = $db->super_query("SELECT COUNT(*) as count FROM ".USERPREFIX."_users WHERE repa_off='1'"); +$stats['repa_off'] = $row['count']; +$row = $db->super_query("SELECT COUNT(*) as count FROM ".USERPREFIX."_users WHERE r_freeze='1'"); +$stats['r_freeze'] = $row['count']; + +function show_stats() { +global $repa_cf, $stats, $lang, $lang_repa; + +if ($repa_cf['status'] == 'yes') $repastatus = ''.$lang_repa['repa_st_on'].''; +else $repastatus = ''.$lang_repa['repa_st_off'].''; +echo " + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    {$lang_repa['repa_st_st']}{$repastatus}
    {$lang_repa['repa_st_ca']}{$stats['changes']}
    {$lang_repa['repa_st_in']}{$stats['incr']}
    {$lang_repa['repa_st_tot_p']}{$stats['tot_p']}
    {$lang_repa['repa_st_es']}{$stats['decr']}
    {$lang_repa['repa_st_tot_m']}{$stats['tot_m']}
    {$lang_repa['repa_st_repa_off']}{$stats['repa_off']}
    {$lang_repa['repa_st_freeze']}{$stats['r_freeze']}
    +
    + + +
    +"; +} + echoheader("options", $lang_repa['repa_options']); + + $options = array(); + + $options['menu'] = array( + + array( + 'name' => $lang_repa['repa_m_opts'], + 'url' => "$PHP_SELF?mod=repa&action=opt", + 'descr' => $lang_repa['repa_m_sub'], + 'image' => "repa_opt.png", + 'access' => "1", + ), + + array( + 'name' => $lang_repa['repa_control'], + 'url' => "$PHP_SELF?mod=repa&action=control", + 'descr' => $lang_repa['repa_con_sub'], + 'image' => "repa_control.png", + 'access' => "1", + ), + + + ); + +foreach($options as $sub_options => $value) +{ + $count_options = count($value); + + for($i=0; $i < $count_options; $i++){ + if($member_db[1] > $value[$i]['access'] AND $value[$i]['access'] != "all"){ + unset($options[$sub_options][$i]); + } + } +} + +$subs = 0; + +foreach($options as $sub_options) +{ + +if (!count($sub_options)) continue; + +echo << + + + + + + + + + +HTML; + +} + +echo <<
    + + + + +
    +
    +HTML; + +$i=0; + +foreach($sub_options as $option) +{ + +if ($i > 1) {echo ""; $i=0;} + +$i++; + +echo << +
    + + + + +
    +
    + + + + + + + + + + +HTML; + +} + + +if ($_REQUEST['save_moderation']) +{ + include_once SYSTEM_DIR.'/data/repa.php'; + $user = $db->query("SELECT user_id, name, repa FROM ".PREFIX."_users"); + while ($row = $db->get_row($user)) + { + $repa_plus = 0; + $repa_minus = 0; + $repa_pereschet = $db->query("SELECT * FROM " . PREFIX . "_reputation WHERE komu = '$row[name]'"); + while ($row_min = $db->get_row($repa_pereschet)) + { + if ($row_min['how'] < 0 OR $row_min['how'] == "totalminus") + { + if ($row_min['how'] == "totalminus") + $repa_minus = $repa_minus + $repa_cf['adm_minus']; + else + $repa_minus = $repa_minus + $row_min['how']; + } + else + { + if ($row_min['how'] == "totalplus") + $repa_plus = $repa_plus + $repa_cf['adm_plus']; + else + $repa_plus = $repa_plus + $row_min['how']; + } + } + $db->free($repa_pereschet); + $repa_sum = $repa_plus + $repa_minus; + $repa_mod = $repa_plus."|".$repa_minus; + + $db->query("UPDATE " . USERPREFIX . "_users set repa='$repa_sum' WHERE user_id = '$row[user_id]'"); + $db->query("UPDATE " . USERPREFIX . "_users set repa_mod='$repa_mod' WHERE user_id = '$row[user_id]'"); + } + $db->free($user); + header( "Location: {$_SERVER['REQUEST_URI']}" ); +} + +// ******************************************************************************** +// Вывод статистики модуля +// ******************************************************************************** + opentable(); + tableheader($lang_repa['repa_stats']); + show_stats(); + closetable(); + echofooter(); + +?> \ No newline at end of file diff --git a/system/inc/repa/repa_options.php b/system/inc/repa/repa_options.php new file mode 100644 index 0000000..b5aceb9 --- /dev/null +++ b/system/inc/repa/repa_options.php @@ -0,0 +1,244 @@ + + + + + + + + + + + + + +
    +
    + + +HTML; + echo ""; + echo << + + + +
    Главное меню
    + + + + + + + + + + +HTML; + +echo << + + function ChangeOption(selectedOption) { + + document.getElementById('general').style.display = "none"; + document.getElementById('controls').style.display = "none"; + document.getElementById('mail').style.display = "none"; + document.getElementById('ban').style.display = "none"; + + if(selectedOption == 'general') {document.getElementById('general').style.display = "";} + if(selectedOption == 'controls') {document.getElementById('controls').style.display = "";} + if(selectedOption == 'mail') {document.getElementById('mail').style.display = "";} + if(selectedOption == 'ban') {document.getElementById('ban').style.display = "";} + + } + + +
    + + + + + + + + + + + + + + + + +
    + + + + +
    +
    + + + + +
    + + + +
    + + + +
    +
    +
    +
    +HTML; + +echo << +
    + + + + + + + + + + + + + + + + +
    + +HTML; + +echo <<"; + +echo <<"; + +echo <<"; + + +echo <<"; + +echo << + + +
    + + + + +
    +
    +HTML; + +showRow($lang_repa['opt_gen_st'], $lang_repa['opt_gen_st_sub'], makeDropDown(array("yes"=>$lang_repa['repa_on'],"no"=>$lang_repa['repa_off']), "save_config[status]", "{$repa_cf['status']}", ""), ""); +showRow($lang_repa['bl_period'], $lang_repa['bl_per_su'], ""); +showRow($lang_repa['repa_stop_change_min'], $lang_repa['repa_stop_change_min_sub'], ""); +showRow($lang_repa['opt_gen_page'], $lang_repa['opt_gen_page_sub'], makeDropDown(array("1"=>$lang_repa['repa_yes'],"0"=>$lang_repa['repa_no']), "save_config[comm_page]", "{$repa_cf['comm_page']}", ""), ""); +showRow($lang_repa['opt_site_res'], $lang_repa['opt_site_sub'], "", ""); +showRow($lang_repa['opt_cp_res'], $lang_repa['opt_cp_sub'], "", ""); +showRow("Переводить в группу при достижении:", "Колличество очков рейтинга для перехода в группу", ""); + +$groups = get_groups(); +$groups = get_groups(explode(',', $repa_cf['move_grouplevel'])); + +showRow("Переводить в группу:", "Переводить в указанную группу при достижении N очков рейтинга", ""); + +echo "
    + + + + +
    +
    +HTML; +showRow($lang_repa['repa_adm'], $lang_repa['repa_adm_sub'], "", ""); +showRow($lang_repa['repa_adm_plus'], $lang_repa['repa_adm_plus_sub'], "", ""); +showRow($lang_repa['repa_robot'], $lang_repa['repa_robo_sub'], "", ""); +showRow($lang_repa['repa_adm_msg'], $lang_repa['repa_adm_com'], "",""); +showRow($lang_repa['repa_adm_plus_msg'], $lang_repa['repa_adm_plus_com'], "",""); +showRow($lang_repa['repa_replace'], $lang_repa['repa_adm_rpm'], ""); + + echo "
    + + + + +
    +
    +HTML; + +$repa_rules = $parse->decodeBBCodes( $repa_cf['repa_rules_tpl_tsu'], false ); + +showRow($lang_repa['repa_msgs_st'], $lang_repa['repa_msgs_su'], makeDropDown(array("yes"=>$lang_repa['repa_yes'],"no"=>$lang_repa['repa_no']), "save_config[msgs_status]", "{$repa_cf['msgs_status']}", ""), ""); +showRow($lang_repa['repa_msg_tpl'], $lang_repa['repa_msg_tsu'], "", ""); +showRow($lang_repa['repa_rules'], $lang_repa['repa_rules_su'], makeDropDown(array("1"=>$lang_repa['repa_yes'],"0"=>$lang_repa['repa_no']), "save_config[repa_rules]", "{$repa_cf['repa_rules']}", ""), ""); +showRow($lang_repa['repa_rules_tpl'], $lang_repa['repa_rules_tpl_su'], "", ""); +showRow($lang_repa['repa_msgs_del_st'], $lang_repa['repa_msgs_del_su'], makeDropDown(array("yes"=>$lang_repa['repa_yes'],"no"=>$lang_repa['repa_no']), "save_config[msgs_del_status]", "{$repa_cf['msgs_del_status']}", ""), ""); +showRow($lang_repa['repa_msg_del_tpl'], $lang_repa['repa_msg_del_tsu'], "", ""); +showRow($lang_repa['repa_msgs_adm_st'], $lang_repa['repa_msgs_adm_su'], makeDropDown(array("yes"=>$lang_repa['repa_yes'],"no"=>$lang_repa['repa_no']), "save_config[msgs_status_adm]", "{$repa_cf['msgs_status_adm']}", ""), ""); +showRow($lang_repa['repa_msg_adm_tpl'], $lang_repa['repa_msg_adm_tsu'], "", ""); + + echo "
    + + + + +
    +
    +HTML; + +$repa_ban_desc = $parse->decodeBBCodes( $repa_cf['repa_ban_desc'], false ); +showRow($lang_repa['repa_ban'], $lang_repa['repa_ban_sub'], makeDropDown(array("1"=>$lang_repa['repa_on'],"0"=>$lang_repa['repa_off']), "save_config[repa_ban]", "{$repa_cf['repa_ban']}", ""), ""); +showRow($lang_repa['repa_ban_num'], $lang_repa['repa_ban_num_sub'], ""); +showRow($lang_repa['repa_ban_days'], $lang_repa['repa_ban_days_sub'], ""); +showRow($lang_repa['repa_ban_desc'], $lang_repa['repa_ban_desc_sub'], "", ""); + echo "
    + + + +
    +
    +
    +HTML; + + echofooter(); + +?> \ No newline at end of file diff --git a/system/inc/repa/repa_save.php b/system/inc/repa/repa_save.php new file mode 100644 index 0000000..8de1534 --- /dev/null +++ b/system/inc/repa/repa_save.php @@ -0,0 +1,74 @@ + $value) + { + if ($name == "repa_rules_tpl_tsu" OR $name == "repa_ban_desc") + { + include_once SYSTEM_DIR.'/classes/parse.class.php'; + $parse = new ParseFilter(); + $value = $db->safesql( $parse->BB_Parse( $parse->process( $value ), false )); + $value = preg_split( '((>)|(<))', $value, - 1, PREG_SPLIT_DELIM_CAPTURE ); + $n = count( $value ); + for($i = 0; $i < $n; $i ++) + { + if( $value[$i] == "<" ) + { + $i ++; + continue; + } + $value[$i] = preg_replace( "#([^\s\n\r]{" . intval( 50 ) . "})#i", "\\1
    ", $value[$i] ); + } + $value = join( "", $value ); + } + elseif ($name == "bl_period" OR $name == "res_site" OR $name == "res_cp" OR $name == "sp_num") + { + $value = intval($value); + } + elseif ($name == "adm_minus" OR $name == "repa_stop_change_min") + { + $value = intval($value); + if ($value > 0 AND $value != 0) + $value = 0 - $value; + } + elseif ($name == "adm_plus") + { + $value = intval($value); + if ($value < 0 AND $value != 0) + $value = 0 - $value; + } + else + { + $value = stripslashes ($value); + $value = addslashes($value); + $value = preg_replace($find, $replace, $value); + } + fwrite($handler, "'{$name}' => \"{$value}\",\r\n"); + } + + fwrite($handler, ");\r\n?>"); + fclose($handler); + + $cache->clear(); + msg("info", $langms['sea_info'], "{$lang_repa['opt_saved']}

    ", ""); +} + +?> \ No newline at end of file diff --git a/system/inc/repa/repa_vminus.php b/system/inc/repa/repa_vminus.php new file mode 100644 index 0000000..537752a --- /dev/null +++ b/system/inc/repa/repa_vminus.php @@ -0,0 +1,59 @@ +
    ", ""); +else +{ + $result = $db->super_query("SELECT author, id FROM " . PREFIX . "_reputation WHERE id='$id' AND author <> '$repa_cf[robot]'"); + if ($result['id'] == $id) + { + $row2 = $db->super_query("SELECT name, user_id, repa, repa_mod, banned, user_group FROM " . USERPREFIX . "_users WHERE name='$result[author]'"); + $target = $result['author']; + $date = date ("Y-m-d H:i:s"); + $robot = $repa_cf['robot']; + $adm_msg = $repa_cf['adm_msg']; + $admin = 'totalminus'; + + $how = $row2['repa'] + $vminus_autor; + $repa_mod_mas = explode ("|", $row2['repa_mod']); + $repa_mod_mas[1] = $repa_mod_mas[1] + $vminus_autor; + $repa_mod = $repa_mod_mas[0]."|".$repa_mod_mas[1]; + + $db->query("INSERT INTO " . USERPREFIX . "_reputation (how, date, author, komu, text) values ('$admin', '$date', '$robot', '$target', '$adm_msg')"); + $db->query("UPDATE `".USERPREFIX."_users` SET `repa` = '$how', `repa_mod` = '$repa_mod' WHERE `name`='$target'"); + + $_TIME = time()+($config['date_adjust']*60); + if ($repa_cf['repa_ban'] AND $row2['banned'] != "yes" AND $repa_cf['group_'.$row2[user_group]] != 1) + { + if (($row2['repa'] + $vminus_autor) <= $repa_cf['repa_ban_num'] OR $row2['repa'] == $repa_cf['repa_ban_num']) + { + $this_time = $repa_cf['repa_ban_days'] ? $_TIME + ($repa_cf['repa_ban_days'] * 60 * 60 * 24) : 0; + $db->query( "UPDATE " . USERPREFIX . "_users SET banned='yes' WHERE user_id = '{$row2[user_id]}'" ); + $db->query( "INSERT INTO " . USERPREFIX . "_banned (users_id, descr, date, days, ip) values ('$row2[user_id]', '$repa_cf[repa_ban_desc]', '$this_time', '$repa_cf[repa_ban_days]', '')" ); + $cache->delete('banned.php' ); + } + } + + if($repa_cf['msgs_status_adm'] == 'yes') + { + $what = $repa_cf['adm_msg']; + $izvestie = $repa_cf['msgs_template_adm']; + $izvestie = str_replace('{%text%}', $what, $izvestie); + $db->query("INSERT INTO " . USERPREFIX . "_pm (subj, text, user, user_from, date, pm_read, folder) values ('$lang_repa[repa_adm_msg_lc]', '$izvestie', '$row2[user_id]', '$robot', '$_TIME', 'no', 'inbox')"); + $db->query("UPDATE " . USERPREFIX . "_users set pm_all=pm_all+1, pm_unread=pm_unread+1 where user_id='$row2[user_id]'"); + } + + msg("info", $langms['sea_info'], "{$lang_repa['repa_done_minus_1']} $target {$lang_repa['repa_done_minus_2']} $vminus_autor

    ", ""); + } + else + msg("info", $langms['sea_info'], "В базе данных ничего не найдено.

    ", ""); +} + +?> \ No newline at end of file diff --git a/system/inc/repa/repa_vplus.php b/system/inc/repa/repa_vplus.php new file mode 100644 index 0000000..6048e19 --- /dev/null +++ b/system/inc/repa/repa_vplus.php @@ -0,0 +1,59 @@ +
    ", ""); +else +{ + $result = $db->super_query("SELECT author, id FROM " . PREFIX . "_reputation WHERE id='$id' AND author <> '$repa_cf[robot]'"); + if ($result['id'] == $id) + { + $row2 = $db->super_query("SELECT name, user_id, repa, repa_mod, banned, user_group FROM " . USERPREFIX . "_users WHERE name='$result[author]'"); + $target = $result['author']; + $date = date ("Y-m-d H:i:s"); + $robot = $repa_cf['robot']; + $adm_msg = $repa_cf['adm_msg_plus']; + $admin = 'totalplus'; + + $how = $row2['repa'] + $vplus_autor; + $repa_mod_mas = explode ("|", $row2['repa_mod']); + $repa_mod_mas[0] = $repa_mod_mas[0] + $vplus_autor; + $repa_mod = $repa_mod_mas[0]."|".$repa_mod_mas[1]; + + $db->query("INSERT INTO " . USERPREFIX . "_reputation (how, date, author, komu, text) values ('$admin', '$date', '$robot', '$target', '$adm_msg')"); + $db->query("UPDATE `".USERPREFIX."_users` SET `repa` = '$how', `repa_mod` = '$repa_mod' WHERE `name`='$target'"); + + $_TIME = time()+($config['date_adjust']*60); + if ($repa_cf['repa_ban'] AND $row2['banned'] != "yes" AND $repa_cf['group_'.$row2[user_group]] != 1) + { + if (($row2['repa'] + $vplus_autor) <= $repa_cf['repa_ban_num'] OR $row2['repa'] == $repa_cf['repa_ban_num']) + { + $this_time = $repa_cf['repa_ban_days'] ? $_TIME + ($repa_cf['repa_ban_days'] * 60 * 60 * 24) : 0; + $db->query( "UPDATE " . USERPREFIX . "_users SET banned='yes' WHERE user_id = '{$row2[user_id]}'" ); + $db->query( "INSERT INTO " . USERPREFIX . "_banned (users_id, descr, date, days, ip) values ('$row2[user_id]', '$repa_cf[repa_ban_desc]', '$this_time', '$repa_cf[repa_ban_days]', '')" ); + $cache->delete('banned.php' ); + } + } + + if($repa_cf['msgs_status_adm'] == 'yes') + { + $what = $repa_cf['adm_msg_plus']; + $izvestie = $repa_cf['msgs_template_adm']; + $izvestie = str_replace('{%text%}', $what, $izvestie); + $db->query("INSERT INTO " . USERPREFIX . "_pm (subj, text, user, user_from, date, pm_read, folder) values ('$lang_repa[repa_adm_msg_lc]', '$izvestie', '$row2[user_id]', '$robot', '$_TIME', 'no', 'inbox')"); + $db->query("UPDATE " . USERPREFIX . "_users set pm_all=pm_all+1, pm_unread=pm_unread+1 where user_id='$row2[user_id]'"); + } + + msg("info", $langms['sea_info'], "{$lang_repa['repa_done_minus_1']} $target {$lang_repa['repa_done_minus_2']} $vplus_autor

    ", ""); + } + else + msg("info", $langms['sea_info'], "В базе данных ничего не найдено.

    ", ""); +} + +?> \ No newline at end of file diff --git a/system/inc/static.php b/system/inc/static.php new file mode 100644 index 0000000..c598701 --- /dev/null +++ b/system/inc/static.php @@ -0,0 +1,1013 @@ +allow_php = true; + +if( !$action ) $action = "list"; + +if( $action == "list" ) { + $_SESSION['admin_referrer'] = $_SERVER['REQUEST_URI']; + echoheader( "static", "static" ); + + $search_field = $db->safesql( trim( htmlspecialchars( stripslashes( urldecode( $_GET['search_field'] ) ), ENT_QUOTES ) ) ); + if ($_GET['fromnewsdate']) $fromnewsdate = strtotime( $_GET['fromnewsdate'] ); else $fromnewsdate = ""; + if ($_GET['tonewsdate']) $tonewsdate = strtotime( $_GET['tonewsdate'] ); else $tonewsdate = ""; + + if ($fromnewsdate === -1 OR !$fromnewsdate) $fromnewsdate = ""; + if ($tonewsdate === -1 OR !$tonewsdate) $tonewsdate = ""; + + $start_from = intval( $_GET['start_from'] ); + $news_per_page = intval( $_GET['news_per_page'] ); + $gopage = intval( $_REQUEST['gopage'] ); + + if( ! $news_per_page or $news_per_page < 1 ) { + $news_per_page = 50; + } + if( $gopage ) $start_from = ($gopage - 1) * $news_per_page; + + if( $start_from < 0 ) $start_from = 0; + + $where = array (); + + if( $search_field != "" ) { + + $where[] = "(template like '%$search_field%' OR descr like '%$search_field%')"; + + } + + if( $fromnewsdate != "" ) { + + $where[] = "date >= '$fromnewsdate'"; + + } + + if( $tonewsdate != "" ) { + + $where[] = "date <= '$tonewsdate'"; + + } + + if( count( $where ) ) { + + $where = implode( " AND ", $where ); + $where = " WHERE " . $where; + + } else { + $where = ""; + } + + $order_by = array (); + + if( $_REQUEST['search_order_t'] == "asc" or $_REQUEST['search_order_t'] == "desc" ) $search_order_t = $_REQUEST['search_order_t']; + else $search_order_t = ""; + if( $_REQUEST['search_order_d'] == "asc" or $_REQUEST['search_order_d'] == "desc" ) $search_order_d = $_REQUEST['search_order_d']; + else $search_order_d = ""; + + if( ! empty( $search_order_t ) ) {$order_by[] = "name $search_order_t";} + if( ! empty( $search_order_d ) ) {$order_by[] = "date $search_order_d";} + + $order_by = implode( ", ", $order_by ); + if( ! $order_by ) $order_by = "date desc"; + + $search_order_date = array ('----' => '', 'asc' => '', 'desc' => '' ); + if( isset( $_REQUEST['search_order_d'] ) ) { + $search_order_date[$search_order_d] = 'selected'; + } else { + $search_order_date['desc'] = 'selected'; + } + $search_order_title = array ('----' => '', 'asc' => '', 'desc' => '' ); + if( ! empty( $search_order_t ) ) { + $search_order_title[$search_order_t] = 'selected'; + } else { + $search_order_title['----'] = 'selected'; + } + + $db->query( "SELECT id, name, descr, template, views, date FROM " . PREFIX . "_static" . $where . " ORDER BY " . $order_by . " LIMIT $start_from,$news_per_page" ); + + // Prelist Entries + if( $start_from == "0" ) { + $start_from = ""; + } + $i = $start_from; + $entries_showed = 0; + + $entries = ""; + + while ( $row = $db->get_array() ) { + + $i ++; + + $itemdate = @date( "d.m.Y H:i", $row['date'] ); + + $title = htmlspecialchars( stripslashes( $row['name'] ), ENT_QUOTES ); + $descr = stripslashes($row['descr']); + $vlink = $config['http_home_url'] . $row['name'] . ".html"; + + $entries .= " + + + $itemdate - $title + $descr + {$row['views']} + + + "; + + $entries_showed ++; + + if( $i >= $news_per_page + $start_from ) { + break; + } + } + + // End prelisting + $result_count = $db->super_query( "SELECT COUNT(*) as count FROM " . PREFIX . "_static" . $where ); + + $all_count_news = $result_count['count']; + if ( $fromnewsdate ) $fromnewsdate = date("Y-m-d", $fromnewsdate ); + if ( $tonewsdate ) $tonewsdate = date("Y-m-d", $tonewsdate ); + + + /////////////////////////////////////////// + // Options Bar + echo << + + + +
    + + + +
    +HTML; + // End Options Bar + + + echo << + + +JSCRIPT; + + if( $entries_showed == 0 ) { + + echo << + + + + + + + + + + + + + + + + +
    + + + + + +
    {$lang['static_advanced_search']}
    +
    + + + + +


    {$lang['edit_nostatic']}
    +

       
    +
    + +HTML; + + } else { + + echo << +
    + + + + + + + + + + +HTML; + + if( $all_count_news > $news_per_page ) { + + echo << +HTML; + + } + + } + + echo << +
    + + + + + + +
    {$lang['static_advanced_search']}
    +
    + + + + + + + + + {$entries} + +
    {$lang['static_title']}{$lang['static_descr']} {$lang['st_views']} 
    +HTML; + + // pagination + + $npp_nav = "
    "; + + if( $start_from > 0 ) { + $previous = $start_from - $news_per_page; + $npp_nav .= "<< "; + } + + if( $all_count_news > $news_per_page ) { + + $enpages_count = @ceil( $all_count_news / $news_per_page ); + $enpages_start_from = 0; + $enpages = ""; + + if( $enpages_count <= 10 ) { + + for($j = 1; $j <= $enpages_count; $j ++) { + + if( $enpages_start_from != $start_from ) { + + $enpages .= "$j "; + + } else { + + $enpages .= "$j "; + } + + $enpages_start_from += $news_per_page; + } + + $npp_nav .= $enpages; + + } else { + + $start = 1; + $end = 10; + + if( $start_from > 0 ) { + + if( ($start_from / $news_per_page) > 4 ) { + + $start = @ceil( $start_from / $news_per_page ) - 3; + $end = $start + 9; + + if( $end > $enpages_count ) { + $start = $enpages_count - 10; + $end = $enpages_count - 1; + } + + $enpages_start_from = ($start - 1) * $news_per_page; + + } + + } + + if( $start > 2 ) { + + $enpages .= "1 ... "; + + } + + for($j = $start; $j <= $end; $j ++) { + + if( $enpages_start_from != $start_from ) { + + $enpages .= "$j "; + + } else { + + $enpages .= "$j "; + } + + $enpages_start_from += $news_per_page; + } + + $enpages_start_from = ($enpages_count - 1) * $news_per_page; + $enpages .= "... $enpages_count "; + + $npp_nav .= $enpages; + + } + + } + + if( $all_count_news > $i ) { + $how_next = $all_count_news - $i; + if( $how_next > $news_per_page ) { + $how_next = $news_per_page; + } + $npp_nav .= ">>"; + } + + $npp_nav .= "
    "; + + // pagination + + + if( $entries_showed != 0 ) { + echo << +
    {$npp_nav}
    + + + + +
    +{$lang['edit_go_page']} +
    +    +
    + + + + + + + + + + +
    +HTML; + + } + + echofooter(); + +} elseif( $action == "addnew" ) { + + echoheader( "static", "static" ); + + echo " + "; + + echo "
    "; + + echo << + + + + +
    + + + + + + + + + + + + + + + + +
    + + + + +
    +
    + + + + + + + + + + + + + + + +HTML; + + include (SYSTEM_DIR . '/inc/include/inserttag.php'); + + echo << + + + +HTML; + + $fix_br = " {$lang['static_br_html']}
    {$lang['static_br_html_1']}"; + + if ($member_id['user_group'] == 1 ) $fix_br .= "
    {$lang['static_br_html_2']}"; + + $groups = get_groups(); + + echo << + + + + + + + + + + + + + + + + + + + + + + + + + + +
    {$lang['static_title']}[?]
    {$lang['static_descr']}[?]
    {$lang['edit_edate']} +  {$lang['edit_jdate']} +
    {$lang['static_templ']}{$bb_code}
    {$lang['static_type']}{$fix_br}
     {$lang['add_metatags']}[?]
    {$lang['meta_title']}
    {$lang['meta_descr']} ({$lang['meta_descr_max']})
    {$lang['meta_keys']}
    +   + +
    {$lang['stat_allow']}
     

        + + + + +

    +
    +
    +HTML; + + echofooter(); +} elseif( $action == "dosavenew" ) { + + if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) { + die( "Hacking attempt! User not found" ); + } + + $allow_br = intval( $_POST['allow_br'] ); + if ($member_id['user_group'] != 1 AND $allow_br > 1 ) $allow_br = 1; + + if ($allow_br == 2) { + if( function_exists( "get_magic_quotes_gpc" ) && get_magic_quotes_gpc() ) $_POST['template'] = stripslashes( $_POST['template'] ); + $template = trim( addslashes( $_POST['template'] ) ); + } else { + $template = $parse->process( $_POST['template'] ); + $template = $parse->BB_Parse( $template, false ); + } + + $metatags = create_metatags( $template ); + $name = trim( totranslit( $_POST['name'], true, false ) ); + $descr = trim( $db->safesql( htmlspecialchars( $_POST['description'] ) ) ); + $template = $db->safesql( $template ); + $newdate = $_POST['newdate']; + if( isset( $_POST['allow_now'] ) ) $allow_now = $_POST['allow_now']; else $allow_now = ""; + + $name = str_replace( "-", "_", $name ); + + if( ! count( $_POST['grouplevel'] ) ) $_POST['grouplevel'] = array ("all" ); + $grouplevel = $db->safesql( implode( ',', $_POST['grouplevel'] ) ); + + // Обработка даты и времени + $added_time = time() + ($config['date_adjust'] * 60); + $newsdate = strtotime( $newdate ); + + if( ($allow_now == "yes") or ($newsdate === - 1) or (trim( $newdate ) == "") ) { + $thistime = $added_time; + } else { + $thistime = $newsdate; + if( ! intval( $config['no_date'] ) and $newsdate > $added_time ) $thistime = $added_time; + } + + if( $name == "" or $descr == "" or $template == "" ) msg( "error", $lang['static_err'], $lang['static_err_1'], "javascript:history.go(-1)" ); + + $static_count = $db->super_query( "SELECT COUNT(*) as count FROM " . PREFIX . "_static WHERE name='$name'" ); + + if ($static_count['count']) msg( "error", $lang['static_err'], $lang['static_err_2'], "javascript:history.go(-1)" ); + + $db->query( "INSERT INTO " . PREFIX . "_static (name, descr, template, allow_br, grouplevel, metadescr, metakeys, date, metatitle) values ('$name', '$descr', '$template', '$allow_br', '$grouplevel', '{$metatags['description']}', '{$metatags['keywords']}', '{$thistime}', '{$metatags['title']}')" ); + $row = $db->insert_id(); + $db->query( "UPDATE " . PREFIX . "_static_files SET static_id='{$row}' WHERE author = '{$member_id['name']}' AND static_id = '0'" ); + + msg( "info", $lang['static_addok'], $lang['static_addok_1'], "?mod=static" ); + +} elseif( $action == "doedit" ) { + $id = intval( $_GET['id'] ); + $row = $db->super_query( "SELECT * FROM " . PREFIX . "_static where id='$id'" ); + if ($row['allow_br'] == 2) { + if ($member_id['user_group'] != 1) msg( "error", $lang['index_denied'], $lang['static_not_allowed'] ); + $row['template'] = htmlspecialchars( stripslashes( $row['template'] ) ); + } else { + $row['template'] = $parse->decodeBBCodes( $row['template'], false ); + } + + $row['descr'] = stripslashes($row['descr']); + $row['metatitle'] = stripslashes( $row['metatitle'] ); + $itemdate = @date( "Y-m-d H:i", $row['date'] ); + + echoheader( "static", "static" ); + + echo << + + + + +HTML; + + echo " + "; + + echo "
    "; + + echo <<
    {$lang['ajax_info']}

    +
    + + + + + + + + + + + + + + + + +
    + + + + +
    +
    + +HTML; + +echo << + + + + + + + +HTML; + + echo << + + + +HTML; + + + include (SYSTEM_DIR . '/inc/include/inserttag.php'); + + echo << + + + +HTML; + + $check = array(); + + $check[$row['allow_br']] = "checked=\"checked\""; + + $fix_br = " {$lang['static_br_html']}
    {$lang['static_br_html_1']}"; + + if ($member_id['user_group'] == 1 ) $fix_br .= "
    {$lang['static_br_html_2']}"; + + $groups = get_groups( explode( ',', $row['grouplevel'] ) ); + if( $row['grouplevel'] == "all" ) $check_all = "selected"; + else $check_all = ""; + + echo << + + + + + + + + + + + + + + + + + + +HTML; + + echo << + + + +
    {$lang['static_title']}[?]
    {$lang['static_descr']}[?]
    {$lang['edit_edate']} +  {$lang['edit_ndate']}  {$lang['edit_jdate']} +
    {$lang['static_templ']}{$bb_code}
    {$lang['static_type']}{$fix_br}
     {$lang['add_metatags']}[?]
    {$lang['meta_title']}
    {$lang['meta_descr']} ({$lang['meta_descr_max']})
    {$lang['meta_keys']}
    +   + +
     
            + + + + + + +

    +
    +
    +HTML; + + echofooter(); +} elseif( $action == "dosaveedit" ) { + + if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) { + + die( "Hacking attempt! User not found" ); + + } + + $allow_br = intval( $_POST['allow_br'] ); + if ($member_id['user_group'] != 1 AND $allow_br > 1 ) $allow_br = 1; + + if ($allow_br == 2) { + + if( function_exists( "get_magic_quotes_gpc" ) && get_magic_quotes_gpc() ) $_POST['template'] = stripslashes( $_POST['template'] ); + + $template = trim( addslashes( $_POST['template'] ) ); + + } else { + + $template = $parse->process( $_POST['template'] ); + + $template = $parse->BB_Parse( $template, false ); + + } + + $metatags = create_metatags( $template ); + + $name = trim( $db->safesql( htmlspecialchars( $_POST['name'] ) ) ); + $descr = trim( $db->safesql( htmlspecialchars( $_POST['description'] ) ) ); + + if( ! count( $_POST['grouplevel'] ) ) $_POST['grouplevel'] = array ("all" ); + $grouplevel = $db->safesql( implode( ',', $_POST['grouplevel'] ) ); + + $name = str_replace( "-", "_", $name ); + + $template = $db->safesql( $template ); + $newdate = $_POST['newdate']; + if( isset( $_POST['allow_date'] ) ) $allow_date = $_POST['allow_date']; else $allow_date = ""; + if( isset( $_POST['allow_now'] ) ) $allow_now = $_POST['allow_now']; else $allow_now = ""; + + // Обработка даты и времени + $added_time = time() + ($config['date_adjust'] * 60); + $newsdate = strtotime( $newdate ); + + if( $allow_date != "yes" ) { + + if( $allow_now == "yes" ) $thistime = $added_time; + elseif( ($newsdate === - 1) or (trim( $newdate ) == "") ) { + $thistime = $added_time; + } else { + + $thistime = $newsdate; + + if( ! intval( $config['no_date'] ) and $newsdate > $added_time ) { + $thistime = $added_time; + } + + } + + } else { + $thistime = intval( $_POST['static_date'] ); + } + +$id = intval( $_GET['id'] ); + if( $name == "" or $descr == "" or $template == "" ) msg( "error", $lang['static_err'], $lang['static_err_1'], "javascript:history.go(-1)" ); + + $db->query( "UPDATE " . PREFIX . "_static set name='$name', descr='$descr', template='$template', allow_br='$allow_br', grouplevel='$grouplevel', metadescr='{$metatags['description']}', metakeys='{$metatags['keywords']}', date='{$thistime}', metatitle='{$metatags['title']}' WHERE id='$id'" ); + + msg( "info", $lang['static_addok'], $lang['static_addok_1'], "?mod=static" ); + + msg( "info", $lang['static_addok'], $lang['static_addok_1'], "?mod=static" ); + +} elseif( $action == "dodelete" ) { + + if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) { + + die( "Hacking attempt! User not found" ); + + } + + $id = intval( $_GET['id'] ); + + $db->query( "DELETE FROM " . PREFIX . "_static WHERE id='$id'" ); + + $db->query( "SELECT name, onserver FROM " . PREFIX . "_static_files WHERE static_id = '$id'" ); + + while ( $row = $db->get_row() ) { + + if( $row['onserver'] ) { + + @unlink( ROOT_DIR . "/uploads/files/" . $row['onserver'] ); + + } else { + + $url_image = explode( "/", $row['name'] ); + + if( count( $url_image ) == 2 ) { + + $folder_prefix = $url_image[0] . "/"; + $dataimages = $url_image[1]; + + } else { + + $folder_prefix = ""; + $dataimages = $url_image[0]; + + } + + @unlink( ROOT_DIR . "/uploads/posts/" . $folder_prefix . $dataimages ); + @unlink( ROOT_DIR . "/uploads/posts/" . $folder_prefix . "thumbs/" . $dataimages ); + } + + } + + $db->query( "DELETE FROM " . PREFIX . "_static_files WHERE static_id = '$id'" ); + + msg( "info", $lang['static_del'], $lang['static_del_1'], "$PHP_SELF?mod=static" ); + +} +?> \ No newline at end of file diff --git a/system/inc/table.php b/system/inc/table.php new file mode 100644 index 0000000..2025262 --- /dev/null +++ b/system/inc/table.php @@ -0,0 +1,1209 @@ +" . $lang_table['edit_status_0'] . ""; + break; + + case "1": + $status = "" . $lang_table['edit_status_1'] . ""; + break; + + case "2": + $status = "" . $lang_table['edit_status_2'] . ""; + break; + + case "3": + $status = "" . $lang_table['edit_status_3'] . ""; + break; + } + return $status; +} + +function menu() { + global $lang_table; + echo <<< HTML + + + + + + + + + + + + + + + + +
    + + + + +
    +
    + + + + +
    + +
    +
    +HTML; +} + +if( isset( $_REQUEST['author'] ) ) $author = $db->safesql( trim( htmlspecialchars( $_REQUEST['author'] ) ) ); else $author = ""; +if( isset( $_REQUEST['ifdelete'] ) ) $ifdelete = $_REQUEST['ifdelete']; else $ifdelete = ""; +if( isset( $_REQUEST['search_cat'] ) ) $search_cat = $db->safesql( trim( htmlspecialchars( $_REQUEST['search_cat'] ) ) ); else $search_cat = ""; + +if( $action == "list" ) { + + $_SESSION['admin_referrer'] = $_SERVER['REQUEST_URI']; + + echoheader( "table", $lang_table['edit_head'] ); + + $search_field = $db->safesql( trim( htmlspecialchars( stripslashes( urldecode( $_REQUEST['search_field'] ) ), ENT_QUOTES ) ) ); + $search_author = $db->safesql( trim( htmlspecialchars( stripslashes( urldecode( $_REQUEST['search_author'] ) ), ENT_QUOTES ) ) ); + $fromordersdate = $db->safesql( trim( htmlspecialchars( stripslashes( $_REQUEST['fromordersdate'] ), ENT_QUOTES ) ) ); + $toordersdate = $db->safesql( trim( htmlspecialchars( stripslashes( $_REQUEST['toordersdate'] ), ENT_QUOTES ) ) ); + + $start_from = intval( $_REQUEST['start_from'] ); + $news_per_page = intval( $_REQUEST['news_per_page'] ); + $gopage = intval( $_REQUEST['gopage'] ); + + $_REQUEST['orders_status'] = intval ($_REQUEST['orders_status']); + $orders_status_sel = array ('1'=>'','2'=>'','3'=>'','4'=>'','5'=>''); + $orders_status_sel[$_REQUEST['orders_status']] = 'selected="selected"'; + + if( ! $news_per_page or $news_per_page < 1 ) { + $news_per_page = 50; + } + if( $gopage ) $start_from = ($gopage - 1) * $news_per_page; + + if( $start_from < 0 ) $start_from = 0; + + $where = array (); + + if( $search_field != "" ) { + $where[] = "(runame like '%$search_field%' OR enname like '%$search_field%' OR link like '%$search_field%')"; + } + + if( $search_author != "" ) { + $where[] = "autor like '$search_author%'"; + } + + if( $search_cat != "" ) { + $where[] = "category regexp '[[:<:]]($search_cat)[[:>:]]'"; + } + + if( $fromordersdate != "" ) { + $fromdate = strtotime( $fromordersdate ); + $where[] = "date >= '$fromdate'"; + } + + if( $toordersdate != "" ) { + $todate = strtotime( $toordersdate ); + $where[] = "date <= '$todate'"; + } + + if ($_REQUEST['orders_status'] == 1) $where[] = "status NOT IN (5)"; + elseif ($_REQUEST['orders_status'] == 2) $where[] = "status = '0'"; + elseif ($_REQUEST['orders_status'] == 3) $where[] = "status = '1'"; + elseif ($_REQUEST['orders_status'] == 4) $where[] = "status = '2'"; + elseif ($_REQUEST['orders_status'] == 5) $where[] = "status = '3'"; + + if( count( $where ) ) { + + $where = implode( " AND ", $where ); + $where = " WHERE " . $where; + + } else { + $where = ""; + } + + $order_by = array (); + + if( $_REQUEST['search_order_m'] == "asc" or $_REQUEST['search_order_m'] == "desc" ) $search_order_m = $_REQUEST['search_order_m']; + else $search_order_m = ""; + if( $_REQUEST['search_order_d'] == "asc" or $_REQUEST['search_order_d'] == "desc" ) $search_order_d = $_REQUEST['search_order_d']; + else $search_order_d = ""; + if( $_REQUEST['search_order_t'] == "asc" or $_REQUEST['search_order_t'] == "desc" ) $search_order_t = $_REQUEST['search_order_t']; + else $search_order_t = ""; + + if( ! empty( $search_order_m ) ) { + $order_by[] = "status $search_order_m"; + } + if( ! empty( $search_order_d ) ) { + $order_by[] = "date $search_order_d"; + } + if( ! empty( $search_order_t ) ) { + $order_by[] = "runame $search_order_t"; + } + + $order_by = implode( ", ", $order_by ); + if( ! $order_by ) $order_by = "date desc"; + + $search_order_mod = array ('----' => '', 'asc' => '', 'desc' => '' ); + if( isset( $_REQUEST['search_order_m'] ) ) { + $search_order_mod[$search_order_m] = 'selected'; + } else { + $search_order_mod['----'] = 'selected'; + } + $search_order_date = array ('----' => '', 'asc' => '', 'desc' => '' ); + if( isset( $_REQUEST['search_order_d'] ) ) { + $search_order_date[$search_order_d] = 'selected'; + } else { + $search_order_date['desc'] = 'selected'; + } + $search_order_title = array ('----' => '', 'asc' => '', 'desc' => '' ); + if( ! empty( $search_order_t ) ) { + $search_order_title[$search_order_t] = 'selected'; + } else { + $search_order_title['----'] = 'selected'; + } + + $db->query( "SELECT * FROM " . PREFIX . "_table" . $where . " ORDER BY " . $order_by . " LIMIT $start_from,$news_per_page" ); + + // Prelist Entries + if( $start_from == "0" ) { + $start_from = ""; + } + $i = $start_from; + $entries_showed = 0; + + $entries = ""; + + while ( $row = $db->get_array() ) { + + $i ++; + + $itemdate = date( "d.m.Y G:i", $row['date'] ); + if(strlen($row['runame']) > 65) $runame = substr($row['runame'],0,65)." ..."; else $runame = $row['runame']; + if(strlen($row['enname']) > 65) $enname = substr($row['enname'],0,65)." ..."; else $enname = $row['enname']; + + $runame = htmlspecialchars( stripslashes( $runame ), ENT_QUOTES ); + $enname = htmlspecialchars( stripslashes( $enname ), ENT_QUOTES ); + + $runame = str_replace("&","&", $runame ); + $enname = str_replace("&","&", $enname ); + + $name = htmlspecialchars( stripslashes( $row['name'] ), ENT_QUOTES ); + $fileyear = stripslashes( $row['fileyear'] ); + + $statusd = showStatus( $row['status'] ); + + $entries .= "$itemdate - "; + + $entries .= "$runame / $enname ( $fileyear ) + "; + + $entries .= ""; + + $entries .= "$statusd"; + + if (!$row['category']) $my_cat = "---"; else { + $my_cat = htmlspecialchars( stripslashes($row['category'])); + } + + $entries .= "$my_cat" . $row['autor'] . " +"; + $entries_showed ++; + + if( $i >= $news_per_page + $start_from ) { + break; + } + } + + // End prelisting + $result_count = $db->super_query( "SELECT COUNT(*) as count FROM " . PREFIX . "_table" . $where ); + + $all_count_news = $result_count['count']; + + if( $member_id['user_group'] == 1 ) { //DLE >= 7.5 + menu(); +} + /////////////////////////////////////////// + // Options Bar + $category_s = explode(",", stripslashes($table_config['category'])); + //$category_list = " + + + +HTML; + // End Options Bar + + echo << + + +JSCRIPT; + + if( $entries_showed == 0 ) { + + echo << + + + + + + + + + + + + + + + + +
    + + + + + +
    {$lang_table['orders_advanced_search']}
    +
    + + + + +
    {$lang_table['edit_noorders']}
    +
    + +HTML; + + } else { + + echo << +
    +
    + + + + + + + + + + + + + + + + +
    + + + + + +
    {$lang_table['orders_advanced_search']}
    +
    + + + + + + + + + + +
    + + + + + {$entries} + +HTML; + + // pagination + + $npp_nav = "
    "; + + if( $start_from > 0 ) { + $previous = $start_from - $news_per_page; + $npp_nav .= "<< "; + } + + if( $all_count_news > $news_per_page ) { + + $enpages_count = @ceil( $all_count_news / $news_per_page ); + $enpages_start_from = 0; + $enpages = ""; + + if( $enpages_count <= 10 ) { + + for($j = 1; $j <= $enpages_count; $j ++) { + + if( $enpages_start_from != $start_from ) { + + $enpages .= "$j "; + + } else { + + $enpages .= "$j "; + } + + $enpages_start_from += $news_per_page; + } + + $npp_nav .= $enpages; + + } else { + + $start = 1; + $end = 10; + + if( $start_from > 0 ) { + + if( ($start_from / $news_per_page) > 4 ) { + + $start = @ceil( $start_from / $news_per_page ) - 3; + $end = $start + 9; + + if( $end > $enpages_count ) { + $start = $enpages_count - 10; + $end = $enpages_count - 1; + } + + $enpages_start_from = ($start - 1) * $news_per_page; + + } + + } + + if( $start > 2 ) { + + $enpages .= "1 ... "; + + } + + for($j = $start; $j <= $end; $j ++) { + + if( $enpages_start_from != $start_from ) { + + $enpages .= "$j "; + + } else { + + $enpages .= "$j "; + } + + $enpages_start_from += $news_per_page; + } + + $enpages_start_from = ($enpages_count - 1) * $news_per_page; + $enpages .= "... $enpages_count "; + + $npp_nav .= $enpages; + + } + + } + + if( $all_count_news > $i ) { + $how_next = $all_count_news - $i; + if( $how_next > $news_per_page ) { + $how_next = $news_per_page; + } + $npp_nav .= ">>"; + } + + $npp_nav .= "
    "; + + // pagination + if( $entries_showed != 0 ) { + echo << + +HTML; + + if( $all_count_news > $news_per_page ) { + + echo << +HTML; + } + + } + + echo << + + +
      {$lang_table['edit_date']}                      {$lang_table['edit_title']} +    +    + {$lang_table['edit_status']} + {$lang_table['edit_cat']} + {$lang_table['edit_author']} + +
    {$npp_nav}
    + + + + + +
    +{$lang['edit_go_page']} +
    +
    + +HTML; + } + + echofooter(); +} + +// ******************************************************************************** +// Показ заказа и редактирование +// ******************************************************************************** +elseif( $action == "edit" ) { + + $id = intval( $_GET['id'] ); + $row = $db->super_query( "SELECT * FROM " . PREFIX . "_table where id = '$id'" ); + $found = FALSE; + + if( ! empty($id) AND $id == $row['id'] ) $found = TRUE; + if( ! $found ) { + msg( "error", $lang['cat_error'], $lang_table['edit_noorders'], "javascript:history.go(-1)" ); + } + + $cat_list = explode( ',', $row['category'] ); + + $type_list = explode( ',', $row['type'] ); + + $row['date'] = date("d-m-Y G:i", $row['date']); + $row['runame'] = htmlspecialchars(stripslashes($row['runame'])); + $row['enname'] = htmlspecialchars(stripslashes($row['enname'])); + $row['category'] = htmlspecialchars(stripslashes($row['category'])); + $row['fileyear'] = htmlspecialchars(stripslashes($row['fileyear'])); + $row['answer'] = htmlspecialchars(stripslashes($row['answer'])); + $row['status'] = intval($row['status']); + + $doaction = "doedit"; + + echoheader( "table", $lang_table['edit_head'] ); + +echo ""; + +echo "
    "; + + $category_s = explode(",", stripslashes($table_config['category'])); + //$categories_list = " + + + + + + + + + + + + + + +
    + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    {$lang['edit_info']}ID={$row['id']}, {$lang['edit_eau']} {$author_info}
    {$lang_table['edit_runame']}
    {$lang_table['edit_enname']}
    {$lang['edit_edate']}
    {$lang_table['edit_category']} +
    {$lang_table['edit_fileyear']}
    {$lang_table['edit_answer']}
    {$lang_table['edit_status']} +HTML; + +echo makeDropDown(array("0" => $lang_table['edit_status_0'], "1" => $lang_table['edit_status_1'], "2" => $lang_table['edit_status_2'], "3" => $lang_table['edit_status_3']), "status", $row['status']); + +echo <<
    +
    +
    +  + + + + + + + +
    +HTML; + +echo << +
    +
    +HTML; + + echofooter(); +} +// ******************************************************************************** +// Сохранение или удаление +// ******************************************************************************** +elseif( $action == "doedit" ) { + if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) { + die( "Hacking attempt! User not found" ); + } + $id = intval( $_GET['id'] ); + $okdeleted = FALSE; + + if( $ifdelete != "yes" ) { + $okchanges = TRUE; + + $runame = $db->safesql( trim( htmlspecialchars( $_POST['runame'] ) ) ) ; + $enname = $db->safesql( trim( htmlspecialchars( $_POST['enname'] ) ) ) ; + $fileyear = $db->safesql( trim( htmlspecialchars( $_POST['fileyear'] ) ) ) ; + $category = $db->safesql( trim( htmlspecialchars( $_POST['category'] ) ) ) ; + + if ( trim( $runame ) != "" or $runame ){ $name = $runame; } + if ( trim( $enname ) != "" or $enname ){ $name = $enname; } + if( !$name ){msg( "error", $lang['cat_error'], $lang_table['orders_err_name'], "javascript:history.go(-1)" );} + + if( strlen( $fileyear ) > 4 ) { + msg( "error", $lang['cat_error'], $lang_table['orders_err_year'], "javascript:history.go(-1)" ); + } + if( strlen( $category ) > 20 ) { + msg( "error", $lang['cat_error'], $lang_table['addorders_err_category'], "javascript:history.go(-1)" ); + } + if (!is_numeric($fileyear)) { + msg( "error", $lang['cat_error'], $lang_table['orders_err_year_type'], "javascript:history.go(-1)" ); + } + + $answer = $db->safesql(strip_tags(trim($_POST['answer']))); + $editor = $db->safesql( trim( htmlspecialchars( $member_id['name'] ) ) ) ; //DLE > 7.5 + $status = intval($_POST['status']); + $StatusSend = showStatus(intval($_POST['status'])); + + if ( $table_config['msgs_usr'] == "yes" ) { + $result = $db->super_query("SELECT " . USERPREFIX . "_users.name, " . USERPREFIX . "_users.email, " . PREFIX . "_table.autor, " . USERPREFIX . "_users.user_id FROM " . USERPREFIX . "_users INNER JOIN " . PREFIX . "_table ON (" . USERPREFIX . "_users.name = " . PREFIX . "_table.autor) WHERE id='$id'"); + $path = $config['http_home_url']; + $subject = $lang_table['msgs_subject_usr']; + $user_from = $lang_table['msg_user_from']; + $time_send = time()+($config['date_adjust']*60); + + $editors = "" . $editor . ""; + + $table_config['msgs_type1'] = stripslashes( html_entity_decode( $table_config['msgs_type1'] ) ); + $table_config['msgs_type1'] = str_replace( "{%id%}", $id, $table_config['msgs_type1'] ); + $table_config['msgs_type1'] = str_replace( "{%username%}", $result['name'], $table_config['msgs_type1'] ); + $table_config['msgs_type1'] = str_replace( "{%username_editor%}", $editors, $table_config['msgs_type1'] ); + $table_config['msgs_type1'] = str_replace( "{%date%}", date("d.m.Y H:i:s", $time_send), $table_config['msgs_type1'] ); + $table_config['msgs_type1'] = str_replace( "{%status%}", $StatusSend, $table_config['msgs_type1'] ); + + if ( $table_config['msgs_type'] == "0" ) { + + if( ! $result['user_id'] ) { + msg( "error", $lang['cat_error'], $lang_table['not_user_id'], "javascript:history.go(-1)" ); + exit(); + } + + $db->query("INSERT INTO " . USERPREFIX . "_pm (subj, text, user, user_from, date, pm_read, folder) values ('$subject', '$table_config[msgs_type1]', '$result[user_id]', '$user_from', '$time_send', 'no', 'inbox')"); + $db->query("UPDATE " . USERPREFIX . "_users set pm_all=pm_all+1, pm_unread=pm_unread+1 WHERE user_id='$result[user_id]'"); + + } else { + include_once SYSTEM_DIR . '/classes/mail.class.php'; + $mail = new dle_mail( $config, true ); + $mail->from = $config['admin_mail']; + $mail->send( $result['email'], $subject, $table_config['msgs_type1'] ); + + if( $mail->send_error ) msg( "info", $lang['all_info'], $mail->smtp_msg ); + } + $db->free($result); + } + + $db->query("UPDATE " . PREFIX . "_table SET runame = '$runame', enname = '$enname', fileyear='$fileyear', category = '$category', answer='$answer', status='$status', editor='$editor' WHERE id='$id'"); + header("Location: http://" . $_SERVER["HTTP_HOST"] . $_SERVER["PHP_SELF"] . "?mod=table"); + } else + { + $db->query( "DELETE FROM " . PREFIX . "_table WHERE id='$id'" ); + $okdeleted = TRUE; + } + + if( ! $_SESSION['admin_referrer'] ) { + $_SESSION['admin_referrer'] = "?mod=table&action=list"; + } + + if( $okdeleted ) { + msg( "info", $lang_table['edit_delok'], $lang_table['edit_delok_1'], $_SESSION['admin_referrer'] ); + } elseif( $okchanges ) { + msg( "info", $lang['edit_alleok'], $lang['edit_alleok_1'], $_SESSION['admin_referrer'] ); + } else { + msg( "error", $lang['word_error'], $lang_table['edit_allerr'], $_SESSION['admin_referrer'] ); + } + $cache->clear(); +} + +// ******************************************************************************** +// Options +// ******************************************************************************** +elseif ($_REQUEST['action'] == 'options') { + if( $member_id['user_group'] != 1 ){ msg( "error", $lang['opt_denied'], $lang['opt_denied'] ); } //DLE >= 7.5 + include_once SYSTEM_DIR . '/classes/parse.class.php'; + $parse = new ParseFilter( Array (), Array (), 1, 1 ); + + //$table_config['msgs_type0'] = str_replace( '"', '"', $table_config['msgs_type0'] ); + //$table_config['msgs_type0'] = $parse->decodeBBCodes( $table_config['msgs_type0'], false ); + + //$table_config['msgs_type1'] = str_replace( '"', '"', $table_config['msgs_type1'] ); + //$table_config['msgs_type1'] = $parse->decodeBBCodes( $table_config['msgs_type1'], false ); + +echoheader( "options", $lang['opt_all'] ); + + if( $member_id['user_group'] == 1 ) { //DLE >= 7.5 + menu(); + } + +echo <<< HTML +
    + + + + + + + + + + + + + + + + +
    + + + + +
    +HTML; +/* Nullеd by DоtNеt */ + echo ''; + + showRow( $lang_table['opt_tab_offline'], $lang_table['opt_tab_offlined'], makeDropDown(array("no" => $lang['opt_sys_no'], "yes" => $lang['opt_sys_yes']), "save_con[table_offline]", "{$table_config['table_offline']}")); + showRow( $lang_table['opt_tab_category'], $lang_table['opt_tab_categoryd'], ""); + + showRow( $lang_table['opt_tab_an'], "$lang[opt_sys_and]", "" ); + showRow( $lang_table['opt_tab_msort'], $lang_table['opt_tab_msortd'], makeDropDown( array ("DESC" => $lang['opt_sys_mminus'], "ASC" => $lang['opt_sys_mplus'] ), "save_con[orders_msort]", "{$table_config['orders_msort']}" ) ); + showRow( $lang_table['opt_tab_orders_number'], $lang_table['opt_tab_orders_numberd'], ""); + + showRow( $lang_table['opt_tab_timeweek'], $lang_table['opt_tab_timeweekd'], ""); + showRow( $lang_table['opt_tab_auto_wrap'], $lang_table['opt_tab_auto_wrapd'], ""); + + showRow( $lang_table['opt_tab_msgs'], $lang_table['opt_tab_msgsd'], makeDropDown(array("yes" => $lang['opt_sys_yes'], "no" => $lang['opt_sys_no']), "save_con[msgs_adm]", "{$table_config['msgs_adm']}")); + showRow( $lang_table['opt_tab_msgs1'], $lang_table['opt_tab_msgsd1'], makeDropDown(array("yes" => $lang['opt_sys_yes'], "no" => $lang['opt_sys_no']), "save_con[msgs_usr]", "{$table_config['msgs_usr']}")); + showRow( $lang_table['opt_tab_msgs_type'], $lang_table['opt_tab_msgs_typed'], makeDropDown(array("0" => $lang_table['opt_tab_msgs_type1'], "1" => $lang_table['opt_tab_msgs_type2']), "save_con[msgs_type]", "{$table_config['msgs_type']}")); + + $tr_hidden = " style='display:none'"; + +echo << + function ShowOrHide(d1, d2) { + if (d1 != '') DoDiv(d1); + if (d2 != '') DoDiv(d2); + } + function DoDiv(id) { + var item = null; + if (document.getElementById) { + item = document.getElementById(id); + } else if (document.all){ + item = document.all[id]; + } else if (document.layers){ + item = document.layers[id]; + } + if (!item) { + } + else if (item.style) { + if (item.style.display == "none"){ item.style.display = ""; } + else {item.style.display = "none"; } + }else{ item.visibility = "show"; } + } + +HTML; + +echo ' + + + + + + + + '; + +echo ' + + + + + + + + '; + + $groups = get_groups(); + $groups = get_groups(explode(',', $table_config['grouplevel'])); + + echo << +HTML; + + echo <<< HTML + +
    + ' . $lang_table['opt_tab_mail_info1'] . ' +
    ' . $lang_table['opt_tab_mail_info2'] .'
    ' . $lang_table['mail_pm_info1'] . '
    + +
    + ' . $lang_table['opt_tab_mail_info1'] . ' +
    ' . $lang_table['opt_tab_mail_info3'] .'
    ' . $lang_table['mail_pm_info2'] . '
    + +
    +{$lang_table['opt_tab_grouplevel']}
    {$lang_table['opt_tab_groupleveld']} +
    + +
    +
    +HTML; + +echofooter(); + echo <<< HTML +
    +HTML; +} + +elseif( $action == "massactions" ) { + +if( ! $_SESSION['admin_referrer'] ) { + $_SESSION['admin_referrer'] = "?mod=table&action=list"; +} + + if( $member_id['user_group'] !=1 ) { //DLE >= 7.5 + msg( "error", $lang['mass_error'], $lang['mass_ddenied'], $_SESSION['admin_referrer'] ); + } + +$selected_orders = $_REQUEST['selected_orders']; + +if( ! $selected_orders ) { + msg( "error", $lang['mass_error'], $lang_table['mass_denied'], $_SESSION['admin_referrer'] ); +} + +if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) { + die( "Hacking attempt! User not found" ); +} + +$s_action = htmlspecialchars( strip_tags( stripslashes( $_POST['s_action'] ) ) ); + +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Подтвреждение удаления + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +if( $s_action == "mass_delete" ) { + echoheader( "options", $lang_table['mass_head'] ); + echo << +
    + + + + + + + + + + + + + + + + +
    + + + + +
    +
    + + +
    {$lang_table['mass_confirm']} +HTML; + /* Nulled by N2C-TEAM(DotNet) */ + echo "(" . count( $selected_orders ) . ") $lang_table[mass_confirm_1]

    +   + + + +"; + foreach ( $selected_orders as $ordersid ) { + $ordersid = intval($ordersid); + echo "\n"; + } + + echo << +
    +
    +
    +HTML; + + echofooter(); + exit(); +} +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Удаление новостей + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +elseif( $s_action == "do_mass_delete" ) { + $deleted_articles = 0; + + foreach ( $selected_orders as $id ) { + $id = intval( $id ); + $deleted_articles ++; + $db->query( "DELETE FROM " . PREFIX . "_table WHERE id='$id'" ); + } + + if( count( $selected_orders ) == $deleted_articles ) { + msg( "info", $lang_table['mass_head'], $lang_table['mass_delok'], $_SESSION['admin_referrer'] ); + } else { + msg( "error", $lang['mass_notok'], "$deleted_articles $lang[mass_i] " . count( $selected_orders ) . " $lang[mass_notok_1]", $_SESSION['admin_referrer'] ); + } +} +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Ничего не выбрано + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +else { + msg( "info", $lang['mass_noact'], $lang['mass_noact_1'], $_SESSION['admin_referrer'] ); +} +} + +// ******************************************************************************** +// Write options +// ******************************************************************************** +if( $action == "save" ) { + if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) { + die( "Hacking attempt! User not found" ); + } + + $save_con = $_POST['save_con']; + + include_once SYSTEM_DIR . '/classes/parse.class.php'; + $parse = new ParseFilter( Array (), Array (), 1, 1 ); + + $save_con['msgs_type0'] = $parse->process( stripslashes( trim( $save_con['msgs_type0'] ) ) ); + $save_con['msgs_type0'] = str_replace( '"', '"', $parse->BB_Parse( $save_con['msgs_type0'], false ) ); + + $save_con['msgs_type1'] = $parse->process( stripslashes( trim( $save_con['msgs_type1'] ) ) ); + $save_con['msgs_type1'] = str_replace( '"', '"', $parse->BB_Parse( $save_con['msgs_type1'], false ) ); + + $find[] = "'\r'"; + $replace[] = ""; + $find[] = "'\n'"; + $replace[] = ""; + + $save_con['version_id'] = "2.5"; + $save_con = $save_con + $table_config; + + if( $member_id['user_group'] != 1 ){ msg( "error", $lang['opt_denied'], $lang['opt_denied'] ); } //DLE >= 7.5 + + $handler = fopen( SYSTEM_DIR . '/data/tableconfig.php', "w" ); + + fwrite( $handler, " $value ) { + + if( $name != "msgs_type0" OR $name != "msgs_type1") { + $value = trim( stripslashes( $value ) ); + $value = htmlspecialchars( $value, ENT_QUOTES); + $value = preg_replace( $find, $replace, $value ); + + $name = trim( stripslashes( $name ) ); + $name = htmlspecialchars( $name, ENT_QUOTES ); + $name = preg_replace( $find, $replace, $name ); + } + + $value = str_replace( "$", "$", $value ); + $value = str_replace( "{", "{", $value ); + $value = str_replace( "}", "}", $value ); + + $name = str_replace( "$", "$", $name ); + $name = str_replace( "{", "{", $name ); + $name = str_replace( "}", "}", $name ); + + fwrite( $handler, "'{$name}' => \"{$value}\",\n\n" ); + + } + fwrite( $handler, ");\n\n?>" ); + fclose( $handler ); + + $cache->clear(); + msg( "info", $lang['opt_sysok'], "$lang[opt_sysok_1]

    $lang[db_prev]" ); +} + +?> \ No newline at end of file diff --git a/system/inc/usergroup.php b/system/inc/usergroup.php new file mode 100644 index 0000000..4733335 --- /dev/null +++ b/system/inc/usergroup.php @@ -0,0 +1,646 @@ +super_query( "SELECT count(*) as count FROM " . USERPREFIX . "_users WHERE user_group='$id'" ); + + if( ! $row['count'] ) { + $db->query( "DELETE FROM " . USERPREFIX . "_usergroups WHERE id = '$id'" ); + $cache->delete('usergroup.php'); + $cache->clear(); + msg( "info", $lang['all_info'], $lang['group_del'], "$PHP_SELF?mod=usergroup" ); + } else { + if( $grouplevel and $grouplevel != $id ) { + $db->query( "UPDATE " . USERPREFIX . "_users set user_group='$grouplevel' WHERE user_group='$id'" ); + $db->query( "DELETE FROM " . USERPREFIX . "_usergroups WHERE id = '$id'" ); + $cache->delete('usergroup.php' ); + $cache->clear(); + msg( "info", $lang['all_info'], $lang['group_del'], "$PHP_SELF?mod=usergroup" ); + } else + msg( "info", $lang['all_info'], "
    {$lang['group_move']}
    ", "$PHP_SELF?mod=usergroup" ); + } + +} elseif( $action == "doadd" or $action == "doedit" ) { + + if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) {die( "Hacking attempt! User not found" );} + + if( ! count( $_REQUEST['allow_cats'] ) ) $_REQUEST['allow_cats'][] = "all"; + if( ! count( $_REQUEST['cat_add'] ) ) $_REQUEST['cat_add'][] = "all"; + + $group_name = $db->safesql( strip_tags( $_REQUEST['group_name'] ) ); + $group_color = $db->safesql( strip_tags( $_REQUEST['group_color'] ) ); + + $allow_cats = $db->safesql( implode( ',', $_REQUEST['allow_cats'] ) ); + $cat_add = $db->safesql( implode( ',', $_REQUEST['cat_add'] ) ); + + $allow_admin = intval( $_REQUEST['allow_admin'] ); + $allow_offline = intval( $_REQUEST['allow_offline'] ); + $allow_main = intval( $_REQUEST['allow_main'] ); + $allow_adds = intval( $_REQUEST['allow_adds'] ); + $moderation = intval( $_REQUEST['moderation'] ); + $allow_edit = intval( $_REQUEST['allow_edit'] ); + $allow_all_edit = intval( $_REQUEST['allow_all_edit'] ); + $allow_addc = intval( $_REQUEST['allow_addc'] ); + $allow_editc = intval( $_REQUEST['allow_editc'] ); + $allow_delc = intval( $_REQUEST['allow_delc'] ); + $edit_allc = intval( $_REQUEST['edit_allc'] ); + $del_allc = intval( $_REQUEST['del_allc'] ); + $allow_hide = intval( $_REQUEST['allow_hide'] ); + $allow_pm = intval( $_REQUEST['allow_pm'] ); + $allow_files = intval( $_REQUEST['allow_files'] ); + $allow_feed = intval( $_REQUEST['allow_feed'] ); + $allow_search = intval( $_REQUEST['allow_search'] ); + $allow_rating = intval( $_REQUEST['allow_rating'] ); + $max_foto = $db->safesql( $_REQUEST['max_foto'] ); + $allow_short = intval( $_REQUEST['allow_short'] ); + $allow_fixed = intval( $_REQUEST['allow_fixed'] ); + $allow_poll = intval( $_REQUEST['allow_poll'] ); + $max_signature = intval( $_REQUEST['max_signature'] ); + $max_info = intval( $_REQUEST['max_info'] ); + + $forum_post_edit = intval( $_REQUEST['forum_post_edit']); + $forum_post_del = intval( $_REQUEST['forum_post_del']); + $forum_topic_set = intval( $_REQUEST['forum_topic_set']); + $forum_topic_edit = intval( $_REQUEST['forum_topic_edit']); + $forum_topic_del = intval( $_REQUEST['forum_topic_del']); + + $admin_addnews = intval( $_REQUEST['admin_addnews'] ); + $admin_editnews = intval( $_REQUEST['admin_editnews'] ); + $admin_categories = intval( $_REQUEST['admin_categories'] ); + $admin_editusers = intval( $_REQUEST['admin_editusers'] ); + $admin_wordfilter = intval( $_REQUEST['admin_wordfilter'] ); + $admin_static = intval( $_REQUEST['admin_static'] ); + $admin_blockip = intval( $_REQUEST['admin_blockip'] ); + $admin_iptools = intval( $_REQUEST['admin_iptools'] ); + $admin_googlemap = intval( $_REQUEST['admin_googlemap'] ); + $admin_table = intval( $_REQUEST['admin_table'] ); + + $allow_image_upload = intval( $_REQUEST['allow_image_upload'] ); + $allow_file_upload = intval( $_REQUEST['allow_file_upload'] ); + $allow_tor_upload = intval( $_REQUEST['allow_tor_upload'] ); + $allow_signature = intval( $_REQUEST['allow_signature'] ); + $allow_url = intval( $_REQUEST['allow_url'] ); + $allow_image = intval( $_REQUEST['allow_image'] ); + + if( $group_name == "" ) msg( "error", $lang['addnews_error'], $lang['group_err1'], "$PHP_SELF?mod=usergroup&action=add" ); + + $cache->delete('usergroup.php' ); + +if( $action == "doadd" ) { + $db->query( "INSERT INTO " . USERPREFIX . "_usergroups (group_name, colour, allow_cats, allow_adds, cat_add, allow_admin, allow_addc, allow_editc, allow_delc, edit_allc, del_allc, moderation, allow_all_edit, allow_edit, allow_pm, max_foto, allow_files, allow_hide, allow_short, allow_fixed, allow_feed, allow_search, allow_poll, allow_main, allow_rating, allow_offline, allow_image_upload, allow_file_upload, allow_tor_upload, allow_signature, allow_url, allow_image, max_signature, max_info, forum_post_edit, forum_post_del, forum_topic_set, forum_topic_edit, forum_topic_del, admin_addnews, admin_editnews, admin_categories, admin_editusers, admin_wordfilter, admin_static, admin_blockip, admin_iptools, admin_googlemap, admin_table) values ('$group_name', '$group_color', '$allow_cats', '$allow_adds', '$cat_add', '$allow_admin', '$allow_addc', '$allow_editc', '$allow_delc', '$edit_allc', '$del_allc', '$moderation', '$allow_all_edit', '$allow_edit', '$allow_pm', '$max_foto', '$allow_files', '$allow_hide', '$allow_short', '$allow_fixed', '$allow_feed', '$allow_search', '$allow_poll', '$allow_main', '$allow_rating', '$allow_offline', '$allow_image_upload', '$allow_file_upload', '$allow_tor_upload', '$allow_signature', '$allow_url', '$allow_image', '$max_signature', '$max_info', '$forum_post_edit', '$forum_post_del', '$forum_topic_set', '$forum_topic_edit', '$forum_topic_del', '$admin_addnews', '$admin_editnews', '$admin_categories', '$admin_editusers', '$admin_wordfilter', '$admin_static', '$admin_blockip', '$admin_iptools', '$admin_googlemap', '$admin_table')" ); + msg( "info", $lang['all_info'], $lang['group_ok1'], "$PHP_SELF?mod=usergroup" ); + } else { + $id = intval( $_REQUEST['id'] ); + $db->query( "UPDATE " . USERPREFIX . "_usergroups set group_name='$group_name', colour='$group_color', allow_cats='$allow_cats', allow_adds='$allow_adds', cat_add='$cat_add', allow_admin='$allow_admin', allow_addc='$allow_addc', allow_editc='$allow_editc', allow_delc='$allow_delc', edit_allc='$edit_allc', del_allc='$del_allc', moderation='$moderation', allow_all_edit='$allow_all_edit', allow_edit='$allow_edit', allow_pm='$allow_pm', max_foto='$max_foto', allow_files='$allow_files', allow_hide='$allow_hide', allow_short='$allow_short', allow_fixed='$allow_fixed', allow_feed='$allow_feed', allow_search='$allow_search', allow_poll='$allow_poll', allow_main='$allow_main', allow_rating='$allow_rating', allow_offline='$allow_offline', allow_image_upload='$allow_image_upload', allow_file_upload='$allow_file_upload', allow_tor_upload='$allow_tor_upload', allow_signature='$allow_signature', allow_url='$allow_url', allow_image='$allow_image', max_signature='$max_signature', max_info='$max_info', forum_post_edit='$forum_post_edit', forum_post_del='$forum_post_del', forum_topic_set='$forum_topic_set', forum_topic_edit='$forum_topic_edit', forum_topic_del='$forum_topic_del', admin_addnews='$admin_addnews', admin_editnews='$admin_editnews', admin_categories='$admin_categories', admin_editusers='$admin_editusers', admin_wordfilter='$admin_wordfilter', admin_static='$admin_static', admin_blockip='$admin_blockip', admin_iptools='$admin_iptools', admin_googlemap='$admin_googlemap', admin_table='$admin_table' WHERE id='{$id}'" ); + msg( "info", $lang['all_info'], $lang['group_ok2'], "$PHP_SELF?mod=usergroup" ); + } + $cache->clear(); +} elseif( $action == "add" or $action == "edit" ) { + echoheader( "", "" ); + + if( $action == "add" ) { + + $group_name_value = ""; + $group_color_value = ""; + + $allow_admin_no = "checked"; + $allow_offline_no = "checked"; + $allow_adds_yes = "checked"; + $allow_short_yes = "checked"; + $moderation_no = "checked"; + $allow_edit_no = "checked"; + $allow_all_edit_no = "checked"; + $allow_image_upload_yes = "checked"; + $allow_file_upload_yes = "checked"; + $allow_tor_upload_yes = "checked"; + + $allow_addc_yes = "checked"; + $allow_editc_yes = "checked"; + $allow_delc_yes = "checked"; + $edit_allc_no = "checked"; + $del_allc_no = "checked"; + $allow_hide_yes = "checked"; + $allow_pm_yes = "checked"; + $allow_files_yes = "checked"; + $allow_feed_yes = "checked"; + $allow_search_yes = "checked"; + $allow_rating_yes = "checked"; + $allow_fixed_no = "checked"; + $allow_poll_yes = "checked"; + $allow_main_yes = "checked"; + $allow_signature_yes = "checked"; + $allow_url_yes = "checked"; + $allow_image_no = "checked"; + + $forum_post_edit_no = "checked"; + $forum_post_del_no = "checked"; + $forum_topic_set_no = "checked"; + $forum_topic_edit_no = "checked"; + $forum_topic_del_no = "checked"; + + $admin_addnews_no = "checked"; + $admin_editnews_no = "checked"; + $admin_categories_no = "checked"; + $admin_editusers_no = "checked"; + $admin_wordfilter_no = "checked"; + $admin_static_no = "checked"; + $admin_blockip_no = "checked"; + $admin_iptools_no = "checked"; + $admin_googlemap_no = "checked"; + $admin_table_no = "checked"; + + $max_foto_value = "100"; + $max_signature_value = "500"; + $max_info_value = "1000"; + $submit_value = $lang['group_new']; + $form_title = $lang['group_new1']; + $form_action = "$PHP_SELF?mod=usergroup&action=doadd"; + $group_list = get_groups( 4 ); + + $cat_add_value = "selected"; + $allow_cats_value = "selected"; + $categories_list = CategoryNewsSelection( 0, 0, false ); + $cat_add_list = CategoryNewsSelection( 0, 0, false ); + + } else { + + $id = intval( $_REQUEST['id'] ); + $group_name_value = htmlspecialchars( stripslashes( $user_group[$id]['group_name'] ) ); + $group_color_value = htmlspecialchars( stripslashes( $user_group[$id]['colour'] ) ); + + if( $user_group[$id]['allow_offline'] ) $allow_offline_yes = "checked"; else $allow_offline_no = "checked"; + if( $user_group[$id]['allow_admin'] ) $allow_admin_yes = "checked"; else $allow_admin_no = "checked"; + if( $user_group[$id]['allow_adds'] ) $allow_adds_yes = "checked"; else $allow_adds_no = "checked"; + if( $user_group[$id]['moderation'] ) $moderation_yes = "checked"; else $moderation_no = "checked"; + if( $user_group[$id]['allow_edit'] ) $allow_edit_yes = "checked"; else $allow_edit_no = "checked"; + if( $user_group[$id]['allow_all_edit'] ) $allow_all_edit_yes = "checked"; else $allow_all_edit_no = "checked"; + if( $user_group[$id]['allow_addc'] ) $allow_addc_yes = "checked"; else $allow_addc_no = "checked"; + if( $user_group[$id]['allow_editc'] ) $allow_editc_yes = "checked"; else $allow_editc_no = "checked"; + if( $user_group[$id]['allow_delc'] ) $allow_delc_yes = "checked"; else $allow_delc_no = "checked"; + if( $user_group[$id]['edit_allc'] ) $edit_allc_yes = "checked"; else $edit_allc_no = "checked"; + if( $user_group[$id]['del_allc'] ) $del_allc_yes = "checked"; else $del_allc_no = "checked"; + if( $user_group[$id]['allow_hide'] ) $allow_hide_yes = "checked"; else $allow_hide_no = "checked"; + if( $user_group[$id]['allow_pm'] ) $allow_pm_yes = "checked"; else $allow_pm_no = "checked"; + if( $user_group[$id]['allow_files'] ) $allow_files_yes = "checked"; else $allow_files_no = "checked"; + if( $user_group[$id]['allow_feed'] ) $allow_feed_yes = "checked"; else $allow_feed_no = "checked"; + if( $user_group[$id]['allow_search'] ) $allow_search_yes = "checked"; else $allow_search_no = "checked"; + if( $user_group[$id]['allow_rating'] ) $allow_rating_yes = "checked"; else $allow_rating_no = "checked"; + if( $user_group[$id]['allow_short'] ) $allow_short_yes = "checked"; else $allow_short_no = "checked"; + if( $user_group[$id]['allow_fixed'] ) $allow_fixed_yes = "checked"; else $allow_fixed_no = "checked"; + if( $user_group[$id]['allow_poll'] ) $allow_poll_yes = "checked"; else $allow_poll_no = "checked"; + if( $user_group[$id]['allow_main'] ) $allow_main_yes = "checked"; else $allow_main_no = "checked"; + if( $user_group[$id]['allow_image_upload'] ) $allow_image_upload_yes = "checked"; else $allow_image_upload_no = "checked"; + if( $user_group[$id]['allow_file_upload'] ) $allow_file_upload_yes = "checked"; else $allow_file_upload_no = "checked"; + if( $user_group[$id]['allow_tor_upload'] ) $allow_tor_upload_yes = "checked"; else $allow_tor_upload_no = "checked"; + if( $user_group[$id]['allow_signature'] ) $allow_signature_yes = "checked"; else $allow_signature_no = "checked"; + if( $user_group[$id]['allow_url'] ) $allow_url_yes = "checked"; else $allow_url_no = "checked"; + if( $user_group[$id]['allow_image'] ) $allow_image_yes = "checked"; else $allow_image_no = "checked"; + + if( $user_group[$id]['forum_post_edit'] ) $forum_post_edit_yes = "checked"; else $forum_post_edit_no = "checked"; + if( $user_group[$id]['forum_post_del'] ) $forum_post_del_yes = "checked"; else $forum_post_del_no = "checked"; + if( $user_group[$id]['forum_topic_set'] ) $forum_topic_set_yes = "checked"; else $forum_topic_set_no = "checked"; + if( $user_group[$id]['forum_topic_edit'] ) $forum_topic_edit_yes = "checked"; else $forum_topic_edit_no = "checked"; + if( $user_group[$id]['forum_topic_del'] ) $forum_topic_del_yes = "checked"; else $forum_topic_del_no = "checked"; + + if( $user_group[$id]['admin_addnews'] ) $admin_addnews_yes = "checked"; else $admin_addnews_no = "checked"; + if( $user_group[$id]['admin_editnews'] ) $admin_editnews_yes = "checked"; else $admin_editnews_no = "checked"; + if( $user_group[$id]['admin_categories'] ) $admin_categories_yes = "checked"; else $admin_categories_no = "checked"; + if( $user_group[$id]['admin_editusers'] ) $admin_editusers_yes = "checked"; else $admin_editusers_no = "checked"; + if( $user_group[$id]['admin_wordfilter'] ) $admin_wordfilter_yes = "checked"; else $admin_wordfilter_no = "checked"; + if( $user_group[$id]['admin_static'] ) $admin_static_yes = "checked"; else $admin_static_no = "checked"; + if( $user_group[$id]['admin_blockip'] ) $admin_blockip_yes = "checked"; else $admin_blockip_no = "checked"; + if( $user_group[$id]['admin_iptools'] ) $admin_iptools_yes = "checked"; else $admin_iptools_no = "checked"; + if( $user_group[$id]['admin_googlemap'] ) $admin_googlemap_yes = "checked"; else $admin_googlemap_no = "checked"; + if( $user_group[$id]['admin_table'] ) $admin_table_yes = "checked"; else $admin_table_no = "checked"; + + if( $id == 1 ) $admingroup = "disabled"; + if( $id == 5 ) $gastgroup = "disabled"; + + if( $user_group[$id]['allow_cats'] == "all" ) $allow_cats_value = "selected"; + $categories_list = CategoryNewsSelection( explode( ',', $user_group[$id]['allow_cats'] ), 0, false ); + + if( $user_group[$id]['cat_add'] == "all" ) $cat_add_value = "selected"; + $cat_add_list = CategoryNewsSelection( explode( ',', $user_group[$id]['cat_add'] ), 0, false ); + + $max_foto_value = $user_group[$id]['max_foto']; + $max_signature_value = $user_group[$id]['max_signature']; + $max_info_value = $user_group[$id]['max_info']; + $submit_value = $lang['group_edit']; + $form_title = $lang['group_edit1'] . $group_name_value; + $form_action = "$PHP_SELF?mod=usergroup&action=doedit&id=" . $id; + + } + + echo << +
    + +
    + + + + + + + + + + + + + + + + +
    + + + + +
    +
    + +
    + + + + + + + + + + + + + + + + +
    + + + + + +
    + +
    +
    +
    + +HTML; + + echofooter(); +} else { + echoheader( "", "" ); + + $db->query( "SELECT user_group, count(*) as count FROM " . USERPREFIX . "_users GROUP BY user_group" ); + while ( $row = $db->get_row() ) + $count_list[$row['user_group']] = $row['count']; + $db->free(); + foreach ( $user_group as $group ) { + $count = intval( $count_list[$group['id']] ); + $entries .= " + +   {$group['id']} + {$group['group_name']} + $count + + + "; + } + + echo << + + + + + + + + + + + + + + + + + +
    + + + + +
    +
    + + + + +
    + + + + + + + + + {$entries} + + +
      ID{$lang['group_name']}{$lang['group_sel4']} 
    +
    +
    + + +HTML; + + echofooter(); +} +?> \ No newline at end of file diff --git a/system/inc/wordfilter.php b/system/inc/wordfilter.php new file mode 100644 index 0000000..d8e1937 --- /dev/null +++ b/system/inc/wordfilter.php @@ -0,0 +1,394 @@ +filter_mode = false; + +// ******************************************************************************** +// Добавление слова +// ******************************************************************************** +if( $action == "add" ) { + + if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) {die( "Hacking attempt! User not found" );} + + $word_find = trim( strip_tags( stripslashes( $_POST['word_find'] ) ) ); + + if( $word_find == "" ) { + msg( "error", $lang['word_error'], $lang['word_word'], "?mod=wordfilter" ); + } + + if( $word_replace == "($lang[word_del])" ) { + $word_replace = ""; + } + + $word_replace = stripslashes( $parse->BB_Parse( $parse->process( $_POST['word_replace'] ), false ) ); + + $word_id = time(); + + $all_items = file( SYSTEM_DIR . '/data/wordfilter.db.php' ); + foreach ( $all_items as $item_line ) { + $item_arr = explode( "|", $item_line ); + if( $item_arr[0] == $word_id ) { + $word_id ++; + } + } + + foreach ( $all_items as $word_line ) { + $word_arr = explode( "|", $word_line ); + if( $word_arr[1] == $word_find ) { + msg( "error", $lang['word_error'], $lang['word_ar'], "?mod=wordfilter" ); + } + } + + $new_words = fopen( SYSTEM_DIR . '/data/wordfilter.db.php', "a" ); + $word_find = str_replace( "|", "|", $word_find ); + $word_replace = str_replace( "|", "|", $word_replace ); + + $word_find = str_replace( "$", "$", $word_find ); + $word_find = str_replace( "{", "{", $word_find ); + $word_find = str_replace( "}", "}", $word_find ); + + $word_replace = str_replace( "$", "$", $word_replace ); + $word_replace = str_replace( "{", "{", $word_replace ); + $word_replace = str_replace( "}", "}", $word_replace ); + + fwrite( $new_words, "$word_id|$word_find|$word_replace|" . intval( $_POST['type'] ) . "|". intval( $_POST['register'] ) ."|". intval( $_POST['filter_search'] ) ."|". intval( $_POST['filter_action'] ) ."||\n" ); + fclose( $new_words ); +} +// ******************************************************************************** +// Удаление слова +// ******************************************************************************** +elseif( $action == "remove" ) { + + if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) { + + die( "Hacking attempt! User not found" ); + + } + + if( ! $word_id ) { + msg( "error", $lang['word_error'], $lang['word_nof'], "$PHP_SELF?mod=wordfilter" ); + } + + $old_words = file( SYSTEM_DIR . '/data/wordfilter.db.php' ); + $new_words = fopen( SYSTEM_DIR . '/data/wordfilter.db.php', "w" ); + + foreach ( $old_words as $old_words_line ) { + $word_arr = explode( "|", $old_words_line ); + if( $word_arr[0] != $word_id ) { + fwrite( $new_words, $old_words_line ); + } + } + fclose( $new_words ); +} +// ******************************************************************************** +// Редактирование слова +// ******************************************************************************** +elseif( $action == "edit" ) { + + // Check if Filter was specified + if( ! $word_id ) { + msg( "error", $lang['word_error'], $lang['word_nof'], "$PHP_SELF?mod=wordfilter" ); + } + + // Search & Load filter in to the Form + $all_words = file( SYSTEM_DIR . '/data/wordfilter.db.php' ); + foreach ( $all_words as $word_line ) { + $word_arr = explode( "|", $word_line ); + if( $word_arr[0] == $word_id ) { + + $word_arr[1] = $parse->decodeBBCodes( $word_arr[1], false ); + $word_arr[2] = $parse->decodeBBCodes( $word_arr[2], false ); + + if( $word_arr[3] ) $selected = "selected"; + else $selected = ""; + + if( $word_arr[4] ) $selected_1 = "selected"; + else $selected_1 = ""; + + $selected_2[$word_arr[5]] = "selected"; + $selected_3[$word_arr[6]] = "selected"; + + $msg = " +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    {$lang['word_word']}
    {$lang['word_rep']}
    {$lang['filter_type']}
    {$lang['filter_register']}
    {$lang['filter_search']}
    {$lang['filter_action']}
     
    + + + + + +
    "; + + // Messages + msg( "wordfilter", $lang['word_head'], $msg ); + + } + } +} +// ******************************************************************************** +// Сохранение слова +// ******************************************************************************** +elseif( $action == "doedit" ) { + + if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) { + + die( "Hacking attempt! User not found" ); + + } + + $word_find = trim( strip_tags( stripslashes( $_POST['word_find'] ) ) ); + + if( $word_find == "" ) { + msg( "error", $lang['word_error'], $lang['word_word'], "javascript:history.go(-1)" ); + } + + $word_replace = stripslashes( $parse->BB_Parse( $parse->process( $_POST['word_replace'] ), false ) ); + + $word_find = str_replace( "|", "|", $word_find ); + $word_replace = str_replace( "|", "|", $word_replace ); + + $word_find = str_replace( "$", "$", $word_find ); + $word_find = str_replace( "{", "{", $word_find ); + $word_find = str_replace( "}", "}", $word_find ); + + $word_replace = str_replace( "$", "$", $word_replace ); + $word_replace = str_replace( "{", "{", $word_replace ); + $word_replace = str_replace( "}", "}", $word_replace ); + + $old_words = file( SYSTEM_DIR . '/data/wordfilter.db.php' ); + $new_words = fopen( SYSTEM_DIR . '/data/wordfilter.db.php', "w" ); + + foreach ( $old_words as $word_line ) { + $word_arr = explode( "|", $word_line ); + if( $word_arr[0] == $word_id ) { + fwrite( $new_words, "$word_id|$word_find|$word_replace|" . intval( $_POST['type'] ) . "|". intval( $_POST['register'] ) ."|". intval( $_POST['filter_search'] ) ."|". intval( $_POST['filter_action'] ) ."||\n" ); + } else { + fwrite( $new_words, $word_line ); + } + } + + fclose( $new_words ); +} +// ******************************************************************************** +// Список слов +// ******************************************************************************** +echoheader( "wordfilter", $lang['word_head'] ); + +echo << +
    + + + + + + + + + + + + + + + + +
    + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    {$lang['word_word']}
    {$lang['word_rep']}
    {$lang['filter_type']}
    {$lang['filter_register']}
    {$lang['filter_search']}
    {$lang['filter_action']}
     
    +
    +
    + + + + +
    + + + + + + + + + ",""],legend:[1,"
    ","
    "],thead:[1,"
    + + + + +
    +
    + +HTML; + +$all_words = file( SYSTEM_DIR . '/data/wordfilter.db.php' ); +$count_words = 0; + +usort( $all_words, "compare_filter" ); + +foreach ( $all_words as $word_line ) { + $word_arr = explode( "|", $word_line ); + + $result .= " + + "; + $count_words ++; +} + +if( $count_words == 0 ) { + echo " + + "; +} else { + + echo " + + + "; + + echo $result; + +} + +echo " +"; + +echo << + + + + + + + + +
    + $word_arr[1] + "; + + if( $word_arr[2] == "" ) { + $result .= "$lang[word_del]"; + } else { + $result .= "$word_arr[2]"; + } + + $type = ($word_arr[3]) ? $lang['filter_type_2'] : $lang['filter_type_1']; + $register = ($word_arr[4]) ? $lang['opt_sys_yes'] : $lang['opt_sys_no']; + + + $result .= "{$register}{$type}{$lang['filter_search_'.$word_arr[5]]}{$lang['filter_action_'.$word_arr[6]]} + [ {$lang[word_ledit]} ] + + [ $lang[word_ldel] ] +
    +


    $lang[word_empty] +

    + $lang[word_worte] + + $lang[word_lred] + + $lang[filter_register] + + $lang[filter_type] + + $lang[filter_search] + + $lang[filter_action] + +   + +   +

    {$lang['word_help_2']} +
    + +HTML; + +echofooter(); +?> \ No newline at end of file diff --git a/system/init.php b/system/init.php new file mode 100644 index 0000000..7308d70 --- /dev/null +++ b/system/init.php @@ -0,0 +1,182 @@ +start (); +check_xss (); + +if (isset ( $_REQUEST['year'] )) $year = intval ( $_GET['year'] ); else $year = ''; +if (isset ( $_REQUEST['month'] )) $month = @$db->safesql ( strip_tags ( str_replace ( '/', '', $_GET['month'] ) ) ); else $month = ''; +if (isset ( $_REQUEST['day'] )) $day = @$db->safesql ( strip_tags ( str_replace ( '/', '', $_GET['day'] ) ) ); else $day = ''; +if (isset ( $_REQUEST['user'] )) $user = @$db->safesql ( strip_tags ( str_replace ( '/', '', urldecode ( $_GET['user'] ) ) ) ); else $user = ''; +if (isset ( $_REQUEST['news_name'] )) $news_name = @$db->safesql ( strip_tags ( str_replace ( '/', '', $_GET['news_name'] ) ) ); else $news_name = ''; +if (isset ( $_REQUEST['newsid'] )) $newsid = intval ( $_GET['newsid'] ); else $newsid = 0; +if (isset ( $_REQUEST['cstart'] )) $cstart = intval ( $_GET['cstart'] ); else $cstart = 0; +if (isset ( $_REQUEST['news_page'] )) $news_page = intval ( $_GET['news_page'] ); else $news_page = 0; + +if (isset ( $_REQUEST['category'] )) { + if (substr ( $_GET['category'], - 1, 1 ) == '/') $_GET['category'] = substr ( $_GET['category'], 0, - 1 ); + $category = explode ( '/', $_GET['category'] ); + $category = end ( $category ); + $category = $db->safesql ( strip_tags ( $category ) ); +} else $category = ''; + +$PHP_SELF = $config['http_home_url'] . "index.php"; +$pm_alert = ""; +$ajax = ""; +$_DOCUMENT_DATE = false; +$user_query = ""; + +$metatags = array ( + 'title' => $config['home_title'], + 'description' => $config['description'], + 'keywords' => $config['keywords'], + 'header_title' => "" ); + +$user_color = $cache->get ( "user_color" ); +if (! $user_color){ + $user_color = array (); + $db->query ( "SELECT user_id, name, user_group FROM " . USERPREFIX . "_users WHERE user_group <> '4' " ); + while ( $row = $db->get_row () ){ + $user_color[$row['name']] = array (); + foreach ( $row as $key => $value ) { + $user_color[$row['name']][$key] = $value; + }} + $cache->set ( "user_color", $user_color ); + $db->free (); +} + +$user_group = $cache->get ( "usergroup" ); +if (! $user_group) { + $user_group = array (); + $db->query ( "SELECT * FROM " . USERPREFIX . "_usergroups ORDER BY id ASC" ); + while ( $row = $db->get_row () ) { + $user_group[$row['id']] = array (); + foreach ( $row as $key => $value ) {$user_group[$row['id']][$key] = stripslashes($value);} + } + $cache->set ( "usergroup", $user_group ); + $db->free (); +} + +$cat_info = $cache->get ( "category" ); +if (! is_array ( $cat_info )) { + $cat_info = array (); + $db->query ( "SELECT * FROM " . PREFIX . "_category ORDER BY posi ASC" ); + while ( $row = $db->get_row () ) { + $cat_info[$row['id']] = array (); + foreach ( $row as $key => $value ) {$cat_info[$row['id']][$key] = stripslashes ( $value );} + } + $cache->set ( "category", $cat_info ); + $db->free (); +} + +$banned_info = $cache->get ( "banned" ); +if (! is_array ( $banned_info )) { + $banned_info = array (); + $db->query ( "SELECT * FROM " . USERPREFIX . "_banned" ); + while ( $row = $db->get_row () ) { + if ($row['users_id']) {$banned_info['users_id'][$row['users_id']] = array ('users_id' => $row['users_id'], 'descr' => stripslashes ( $row['descr'] ), 'date' => $row['date'] ); + } else {if (count ( explode ( ".", $row['ip'] ) ) == 4) $banned_info['ip'][$row['ip']] = array ('ip' => $row['ip'], 'descr' => stripslashes ( $row['descr'] ), 'date' => $row['date']); + elseif (strpos ( $row['ip'], "@" ) !== false) $banned_info['email'][$row['ip']] = array ('email' => $row['ip'], 'descr' => stripslashes ( $row['descr'] ), 'date' => $row['date'] ); + else $banned_info['name'][$row['ip']] = array ('name' => $row['ip'], 'descr' => stripslashes ( $row['descr'] ), 'date' => $row['date'] ); + }} + $cache->set ( "banned", $banned_info ); + $db->free (); +} + +if ($category != '') $category_id = get_ID ( $cat_info, $category ); +else $category_id = false; + +include_once ROOT_DIR . '/language/' . $config['langs'] . '/website.lng'; +$config['charset'] = ($lang['charset'] != '') ? $lang['charset'] : $config['charset']; + +$smartphone_detected = false; +if( isset( $_REQUEST['action'] ) and $_REQUEST['action'] == "mobiledisable" ) $_SESSION['mobile_disable'] = 1; +if( isset( $_REQUEST['action'] ) and $_REQUEST['action'] == "mobile" ) { $_SESSION['mobile_enable'] = 1; $_SESSION['mobile_disable'] = 0;} +if( !isset( $_SESSION['mobile_disable'] ) ) $_SESSION['mobile_disable'] = 0; +if( !isset( $_SESSION['mobile_enable'] ) ) $_SESSION['mobile_enable'] = 0; +if ( !$_SESSION['mobile_disable'] ) { + if ( check_smartphone() ) { + if ( @is_dir ( ROOT_DIR . '/templates/smartphone' ) ) { + $config['skin'] = "smartphone"; + $smartphone_detected = true; + $config['ajax'] = false; +}}} + +require_once SYSTEM_DIR . '/classes/templates.class.php'; + +$tpl = new dle_template ( ); +$tpl->dir = ROOT_DIR . '/templates/' . $config['skin']; +define ( 'TEMPLATE_DIR', $tpl->dir ); + +if (isset ( $_POST['set_new_sort'] )) { + $allowed_sort = array ('date', 'rating', 'news_read', 'comm_num', 'title' ); + $find_sort = str_replace ( ".", "", totranslit ( $_POST['set_new_sort'] ) ); + $direction_sort = str_replace ( ".", "", totranslit ( $_POST['set_direction_sort'] ) ); + + if (in_array ( $_POST['dlenewssortby'], $allowed_sort )) { + if ($_POST['dledirection'] == "desc" or $_POST['dledirection'] == "asc") { + $_SESSION[$find_sort] = $_POST['dlenewssortby']; + $_SESSION[$direction_sort] = $_POST['dledirection']; + $_SESSION['dle_no_cache'] = "1"; +}}} + +if ($_POST['dle_comm_sort'] == "DESC" or $_POST['dle_comm_sort'] == "ASC"){ + set_cookie("dle_comm_sort", $_POST['dle_comm_sort'], 365); + $dle_comm_sort = $_POST['dle_comm_sort']; + $_SESSION['dle_comm_sort'] = $_POST['dle_comm_sort']; + $_SESSION['dle_no_cache'] = "1"; +// }elseif ($_COOKIE['dle_comm_sort'] == "DESC" or $_COOKIE['dle_comm_sort'] == "ASC"){ + }elseif ($_SESSION['dle_comm_sort'] == "DESC" or $_SESSION['dle_comm_sort'] == "ASC"){ + //$dle_comm_sort = $_COOKIE['dle_comm_sort']; + $dle_comm_sort = $_SESSION['dle_comm_sort']; + $_SESSION['dle_no_cache'] = "1"; + }else{$dle_comm_sort = $config['comm_msort'];} + + include_once SYSTEM_DIR . '/modules/sitelogin.php'; + + //Проверяем забанен ли пользователь + if ( isset( $banned_info['ip'] ) ) $blockip = check_ip ( $banned_info['ip'] ); else $blockip = false; + if (($is_logged and $member_id['banned'] == "yes") or $blockip) include_once SYSTEM_DIR . '/modules/banned.php'; + + if ($is_logged) { + set_cookie ( "dle_newpm", $member_id['pm_unread'], 365 ); + if ($member_id['pm_unread'] > intval ( $_COOKIE['dle_newpm'] ) AND !$smartphone_detected) { + include_once SYSTEM_DIR . '/modules/pm_alert.php'; + }} + + $tpl->load_template('login.tpl'); + if ($is_logged) { + $tpl->set('{profile_name}', $member_id['name']); + $tpl->set('{profile_link}', $config['http_home_url'] . "user/" . urlencode ( $member_id['name'] ) . "/"); + $tpl->set('{addnews_link}', $config['http_home_url'] . "addnews.html"); + $tpl->set('{newsposts_link}', $config['http_home_url'] . "newposts/"); + $tpl->set('{fav_link}', $config['http_home_url'] . "favorites/"); + $tpl->set('{pm_link}', $PHP_SELF . "?do=pm"); + $tpl->set('{logout_link}', $PHP_SELF . "?action=logout"); + $tpl->set('{admin_link}', $config['http_home_url'] . $config['admin_path'] . "?mod=main"); + if ($member_id['favorites']) {$fav = count(explode("," ,$member_id['favorites']));} else $fav = '0'; + $tpl->set('{fav_count}', $fav); + $tpl->set( '{new-pm}', $member_id['pm_unread'] ); + $tpl->set( '{all-pm}', $member_id['pm_all'] ); + } + $tpl->set('{reg_link}', $PHP_SELF . "?do=register"); + $tpl->set('{lost_link}', $PHP_SELF . "?do=lostpassword"); + $tpl->compile('login_panel'); + $tpl->clear(); + +include_once SYSTEM_DIR . '/offline.php'; +require_once ROOT_DIR . '/system/engine.php'; +require_once SYSTEM_DIR.'/modules/online.php'; +include_once SYSTEM_DIR . '/modules/toptables.php'; +include_once SYSTEM_DIR . '/modules/chat/block.php'; +include_once SYSTEM_DIR . '/modules/comments-last.php'; +?> \ No newline at end of file diff --git a/system/js/highslide.js b/system/js/highslide.js new file mode 100644 index 0000000..00778d1 --- /dev/null +++ b/system/js/highslide.js @@ -0,0 +1,97 @@ +/** + * Name: Highslide JS + * Version: 4.1.12 (2011-03-28) + * Config: default -preloading -hideelements +slideshow +positioning +transitions +viewport + * Author: Torstein Hønsi + * Support: www.highslide.com/support + * License: www.highslide.com/#license + */ +if(!hs){var hs={lang:{cssDirection:"ltr",loadingText:"Loading...",loadingTitle:"Click to cancel",focusTitle:"Click to bring to front",fullExpandTitle:"Expand to actual size (f)",creditsText:"Powered by Highslide JS",creditsTitle:"Go to the Highslide JS homepage",previousText:"Previous",nextText:"Next",moveText:"Move",closeText:"Close",closeTitle:"Close (esc)",resizeTitle:"Resize",playText:"Play",playTitle:"Play slideshow (spacebar)",pauseText:"Pause",pauseTitle:"Pause slideshow (spacebar)", +previousTitle:"Previous (arrow left)",nextTitle:"Next (arrow right)",moveTitle:"Move",fullExpandText:"1:1",number:"Image %1 of %2",restoreTitle:"Click to close image, click and drag to move. Use arrow keys for next and previous."},graphicsDir:"highslide/graphics/",expandCursor:"zoomin.cur",restoreCursor:"zoomout.cur",expandDuration:250,restoreDuration:250,marginLeft:15,marginRight:15,marginTop:15,marginBottom:15,zIndexCounter:1001,loadingOpacity:0.75,allowMultipleInstances:true,outlineWhileAnimating:2, +outlineStartOffset:3,padToMinWidth:false,fullExpandPosition:"bottom right",fullExpandOpacity:1,showCredits:true,creditsHref:"http://highslide.com/",creditsTarget:"_self",enableKeyListener:true,openerTagNames:["a"],transitions:[],transitionDuration:250,dimmingOpacity:0,dimmingDuration:50,anchor:"auto",align:"auto",targetX:null,targetY:null,dragByHeading:true,minWidth:200,minHeight:200,allowSizeReduction:true,outlineType:"drop-shadow",skin:{controls:''}, +expanders:[],overrides:"allowSizeReduction,useBox,anchor,align,targetX,targetY,outlineType,outlineWhileAnimating,captionId,captionText,captionEval,captionOverlay,headingId,headingText,headingEval,headingOverlay,creditsPosition,dragByHeading,autoplay,numberPosition,transitions,dimmingOpacity,width,height,wrapperClassName,minWidth,minHeight,maxWidth,maxHeight,pageOrigin,slideshowGroup,easing,easingClose,fadeInOut,src".split(","),overlays:[],idCounter:0,oPos:{x:["leftpanel","left","center","right","rightpanel"], +y:["above","top","middle","bottom","below"]},mouse:{},headingOverlay:{},captionOverlay:{},timers:[],slideshows:[],pendingOutlines:{},clones:{},onReady:[],uaVersion:/Trident\/4\.0/.test(navigator.userAgent)?8:parseFloat((navigator.userAgent.toLowerCase().match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1]),ie:document.all&&!window.opera,safari:/Safari/.test(navigator.userAgent),geckoMac:/Macintosh.+rv:1\.[0-8].+Gecko/.test(navigator.userAgent),$:function(a){if(a)return document.getElementById(a)}, +push:function(a,b){a[a.length]=b},createElement:function(a,b,c,d,e){a=document.createElement(a);b&&hs.extend(a,b);e&&hs.setStyles(a,{padding:0,border:"none",margin:0});c&&hs.setStyles(a,c);d&&d.appendChild(a);return a},extend:function(a,b){for(var c in b)a[c]=b[c];return a},setStyles:function(a,b){for(var c in b)hs.ieLt9&&c=="opacity"?b[c]>0.99?a.style.removeAttribute("filter"):a.style.filter="alpha(opacity="+b[c]*100+")":a.style[c]=b[c]},animate:function(a,b,c){var d,e,f;if(typeof c!="object"||c=== +null)d=arguments,c={duration:d[2],easing:d[3],complete:d[4]};if(typeof c.duration!="number")c.duration=250;c.easing=Math[c.easing]||Math.easeInQuad;c.curAnim=hs.extend({},b);for(var g in b){var i=new hs.fx(a,c,g);d=parseFloat(hs.css(a,g))||0;e=parseFloat(b[g]);f=g!="opacity"?"px":"";i.custom(d,e,f)}},css:function(a,b){if(a.style[b])return a.style[b];else if(document.defaultView)return document.defaultView.getComputedStyle(a,null).getPropertyValue(b);else{b=="opacity"&&(b="filter");var c=a.currentStyle[b.replace(/\-(\w)/g, +function(a,b){return b.toUpperCase()})];b=="filter"&&(c=c.replace(/alpha\(opacity=([0-9]+)\)/,function(a,b){return b/100}));return c===""?1:c}},getPageSize:function(){var a=document,b=a.compatMode&&a.compatMode!="BackCompat"?a.documentElement:a.body;hs.page={width:hs.ieLt9?b.clientWidth:a.documentElement.clientWidth||self.innerWidth,height:hs.ieLt9?b.clientHeight:self.innerHeight,scrollLeft:hs.ieLt9?b.scrollLeft:window.pageXOffset,scrollTop:hs.ieLt9?b.scrollTop:window.pageYOffset};return hs.page}, +getPosition:function(a){for(var b={x:a.offsetLeft,y:a.offsetTop};a.offsetParent;)a=a.offsetParent,b.x+=a.offsetLeft,b.y+=a.offsetTop,a!=document.body&&a!=document.documentElement&&(b.x-=a.scrollLeft,b.y-=a.scrollTop);return b},expand:function(a,b,c){a||(a=hs.createElement("a",null,{display:"none"},hs.container));if(typeof a.getParams=="function")return b;try{return new hs.Expander(a,b,c),false}catch(d){return true}},getElementByClass:function(a,b,c){a=a.getElementsByTagName(b);for(b=0;ba)a=d,b=e;b==-1?hs.focusKey=-1:c[b].focus()},getParam:function(a,b){a.getParams=a.onclick;var c=a.getParams?a.getParams():null;a.getParams=null;return c&& +typeof c[b]!="undefined"?c[b]:typeof hs[b]!="undefined"?hs[b]:null},getSrc:function(a){var b=hs.getParam(a,"src");return b?b:a.href},getNode:function(a){var b=hs.$(a),c=hs.clones[a];return!b&&!c?null:c?c.cloneNode(true):(c=b.cloneNode(true),c.id="",hs.clones[a]=c,b)},discardElement:function(a){a&&hs.garbageBin.appendChild(a);hs.garbageBin.innerHTML=""},dim:function(a){if(!hs.dimmer)b=true,hs.dimmer=hs.createElement("div",{className:"highslide-dimming highslide-viewport-size",owner:"",onclick:function(){hs.close()}}, +{visibility:"visible",opacity:0},hs.container,true);hs.dimmer.style.display="";var b=hs.dimmer.owner=="";hs.dimmer.owner+="|"+a.key;b&&(hs.geckoMac&&hs.dimmingGeckoFix?hs.setStyles(hs.dimmer,{background:"url("+hs.graphicsDir+"geckodimmer.png)",opacity:1}):hs.animate(hs.dimmer,{opacity:a.dimmingOpacity},hs.dimmingDuration))},undim:function(a){if(hs.dimmer){if(typeof a!="undefined")hs.dimmer.owner=hs.dimmer.owner.replace("|"+a,"");if(!(typeof a!="undefined"&&hs.dimmer.owner!=""||hs.upcoming&&hs.getParam(hs.upcoming, +"dimmingOpacity")))hs.geckoMac&&hs.dimmingGeckoFix?hs.dimmer.style.display="none":hs.animate(hs.dimmer,{opacity:0},hs.dimmingDuration,null,function(){hs.dimmer.style.display="none"})}},transit:function(a,b){var c=b||hs.getExpander(),b=c;if(hs.upcoming)return false;else hs.last=c;hs.removeEventListener(document,window.opera?"keypress":"keydown",hs.keyHandler);try{hs.upcoming=a,a.onclick()}catch(d){hs.last=hs.upcoming=null}try{(!a||b.transitions[1]!="crossfade")&&b.close()}catch(e){}return false},previousOrNext:function(a, +b){var c=hs.getExpander(a);return c?hs.transit(c.getAdjacentAnchor(b),c):false},previous:function(a){return hs.previousOrNext(a,-1)},next:function(a){return hs.previousOrNext(a,1)},keyHandler:function(a){if(!a)a=window.event;if(!a.target)a.target=a.srcElement;if(typeof a.target.form!="undefined")return true;var b=hs.getExpander(),c=null;switch(a.keyCode){case 70:return b&&b.doFullExpand(),true;case 32:c=2;break;case 34:case 39:case 40:c=1;break;case 8:case 33:case 37:case 38:c=-1;break;case 27:case 13:c= +0}if(c!==null){hs.removeEventListener(document,window.opera?"keypress":"keydown",hs.keyHandler);if(!hs.enableKeyListener)return true;a.preventDefault?a.preventDefault():a.returnValue=false;if(b)return c==0?b.close():c==2?b.slideshow&&b.slideshow.hitSpace():(b.slideshow&&b.slideshow.pause(),hs.previousOrNext(b.key,c)),false}return true},registerOverlay:function(a){hs.push(hs.overlays,hs.extend(a,{hsId:"hsId"+hs.idCounter++}))},addSlideshow:function(a){var b=a.slideshowGroup;if(typeof b=="object")for(var c= +0;c1)return true; +if(!a.target)a.target=a.srcElement;for(var b=a.target;b.parentNode&&!/highslide-(image|move|html|resize)/.test(b.className);)b=b.parentNode;var c=hs.getExpander(b);if(c&&(c.isClosing||!c.isExpanded))return true;if(c&&a.type=="mousedown"){if(a.target.form)return true;if(b=b.className.match(/highslide-(image|move|resize)/))if(hs.dragArgs={exp:c,type:b[1],left:c.x.pos,width:c.x.size,top:c.y.pos,height:c.y.size,clickX:a.clientX,clickY:a.clientY},hs.addEventListener(document,"mousemove",hs.dragHandler), +a.preventDefault&&a.preventDefault(),/highslide-(image|html)-blur/.test(c.content.className))c.focus(),hs.hasFocused=true}else if(a.type=="mouseup")if(hs.removeEventListener(document,"mousemove",hs.dragHandler),hs.dragArgs){if(hs.styleRestoreCursor&&hs.dragArgs.type=="image")hs.dragArgs.exp.content.style.cursor=hs.styleRestoreCursor;!hs.dragArgs.hasDragged&&!hs.hasFocused&&!/(move|resize)/.test(hs.dragArgs.type)&&c.close();hs.hasFocused=false;hs.dragArgs=null}else if(/highslide-image-blur/.test(b.className))b.style.cursor= +hs.styleRestoreCursor;return false},dragHandler:function(a){if(!hs.dragArgs)return true;if(!a)a=window.event;var b=hs.dragArgs,c=b.exp;b.dX=a.clientX-b.clickX;b.dY=a.clientY-b.clickY;var d=Math.sqrt(Math.pow(b.dX,2)+Math.pow(b.dY,2));if(!b.hasDragged)b.hasDragged=b.type!="image"&&d>0||d>(hs.dragSensitivity||5);if(b.hasDragged&&a.clientX>5&&a.clientY>5)if(b.type=="resize")c.resize(b);else if(c.moveTo(b.left+b.dX,b.top+b.dY),b.type=="image")c.content.style.cursor="move";return false},wrapperMouseHandler:function(a){try{if(!a)a= +window.event;var b=/mouseover/i.test(a.type);if(!a.target)a.target=a.srcElement;if(!a.relatedTarget)a.relatedTarget=b?a.fromElement:a.toElement;var c=hs.getExpander(a.target);if(c.isExpanded&&c&&a.relatedTarget&&!(hs.getExpander(a.relatedTarget,true)==c||hs.dragArgs))for(a=0;a=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();var a=this.options.curAnim[this.prop]=true,c;for(c in this.options.curAnim)this.options.curAnim[c]!==true&&(a=false);a&&this.options.complete&&this.options.complete.call(this.elem);return false}else c=b-this.startTime,this.state=c/this.options.duration,this.pos=this.options.easing(c,0,1,this.options.duration),this.now=this.start+(this.end-this.start)*this.pos, +this.update();return true}};hs.extend(hs.fx,{step:{opacity:function(a){hs.setStyles(a.elem,{opacity:a.now})},_default:function(a){try{a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=a.now+a.unit:a.elem[a.prop]=a.now}catch(b){}}}});hs.Outline=function(a,b){this.onLoad=b;this.outlineType=a;var c;this.hasAlphaImageLoader=hs.ie&&hs.uaVersion<7;if(a){hs.init();this.table=hs.createElement("table",{cellSpacing:0},{visibility:"hidden",position:"absolute",borderCollapse:"collapse",width:0},hs.container, +true);var d=hs.createElement("tbody",null,null,this.table,1);this.td=[];for(var e=0;e<=8;e++)e%3==0&&(c=hs.createElement("tr",null,{height:"auto"},d,true)),this.td[e]=hs.createElement("td",null,null,c,true),hs.setStyles(this.td[e],e!=4?{lineHeight:0,fontSize:0}:{position:"relative"});this.td[4].className=a+" highslide-outline";this.preloadGraphic()}else b&&b()};hs.Outline.prototype={preloadGraphic:function(){var a=hs.graphicsDir+(hs.outlinesDir||"outlines/")+this.outlineType+".png";this.graphic=hs.createElement("img", +null,{position:"absolute",top:"-9999px"},hs.safari&&hs.uaVersion<525?hs.container:null,true);var b=this;this.graphic.onload=function(){b.onGraphicLoad()};this.graphic.src=a},onGraphicLoad:function(){for(var a=this.offset=this.graphic.width/4,b=[[0,0],[0,-4],[-2,0],[0,-8],0,[-2,-8],[0,-2],[0,-6],[-2,-2]],c={height:2*a+"px",width:2*a+"px"},d=0;d<=8;d++)if(b[d]){if(this.hasAlphaImageLoader){var e=d==1||d==7?"100%":this.graphic.width+"px",f=hs.createElement("div",null,{width:"100%",height:"100%",position:"relative", +overflow:"hidden"},this.td[d],true);hs.createElement("div",null,{filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale, src='"+this.graphic.src+"')",position:"absolute",width:e,height:this.graphic.height+"px",left:b[d][0]*a+"px",top:b[d][1]*a+"px"},f,true)}else hs.setStyles(this.td[d],{background:"url("+this.graphic.src+") "+b[d][0]*a+"px "+b[d][1]*a+"px"});window.opera&&(d==3||d==5)&&hs.createElement("div",null,c,this.td[d],true);hs.setStyles(this.td[d],c)}this.graphic=null; +hs.pendingOutlines[this.outlineType]&&hs.pendingOutlines[this.outlineType].destroy();hs.pendingOutlines[this.outlineType]=this;if(this.onLoad)this.onLoad()},setPosition:function(a,b,c){var d=this.exp,b=b||0,a=a||{x:d.x.pos+b,y:d.y.pos+b,w:d.x.get("wsize")-2*b,h:d.y.get("wsize")-2*b};if(c)this.table.style.visibility=a.h>=4*this.offset?"visible":"hidden";hs.setStyles(this.table,{left:a.x-this.offset+"px",top:a.y-this.offset+"px",width:a.w+2*this.offset+"px"});a.w-=2*this.offset;a.h-=2*this.offset;hs.setStyles(this.td[4], +{width:a.w>=0?a.w+"px":0,height:a.h>=0?a.h+"px":0});if(this.hasAlphaImageLoader)this.td[3].style.height=this.td[5].style.height=this.td[4].style.height},destroy:function(a){a?this.table.style.visibility="hidden":hs.discardElement(this.table)}};hs.Dimension=function(a,b){this.exp=a;this.dim=b;this.ucwh=b=="x"?"Width":"Height";this.wh=this.ucwh.toLowerCase();this.uclt=b=="x"?"Left":"Top";this.lt=this.uclt.toLowerCase();this.ucrb=b=="x"?"Right":"Bottom";this.rb=this.ucrb.toLowerCase();this.p1=this.p2= +0};hs.Dimension.prototype={get:function(a){switch(a){case "loadingPos":return this.tpos+this.tb+(this.t-hs.loading["offset"+this.ucwh])/2;case "loadingPosXfade":return this.pos+this.cb+this.p1+(this.size-hs.loading["offset"+this.ucwh])/2;case "wsize":return this.size+2*this.cb+this.p1+this.p2;case "fitsize":return this.clientSize-this.marginMin-this.marginMax;case "maxsize":return this.get("fitsize")-2*this.cb-this.p1-this.p2;case "opos":return this.pos-(this.exp.outline?this.exp.outline.offset:0); +case "osize":return this.get("wsize")+(this.exp.outline?2*this.exp.outline.offset:0);case "imgPad":return this.imgSize?Math.round((this.size-this.imgSize)/2):0}},calcBorders:function(){this.cb=(this.exp.content["offset"+this.ucwh]-this.t)/2;this.marginMax=hs["margin"+this.ucrb]},calcThumb:function(){this.t=this.exp.el[this.wh]?parseInt(this.exp.el[this.wh]):this.exp.el["offset"+this.ucwh];this.tpos=this.exp.tpos[this.dim];this.tb=(this.exp.el["offset"+this.ucwh]-this.t)/2;if(this.tpos==0||this.tpos== +-1)this.tpos=hs.page[this.wh]/2+hs.page["scroll"+this.uclt]},calcExpanded:function(){var a=this.exp;this.justify="auto";if(a.align=="center")this.justify="center";else if(RegExp(this.lt).test(a.anchor))this.justify=null;else if(RegExp(this.rb).test(a.anchor))this.justify="max";this.pos=this.tpos-this.cb+this.tb;if(this.maxHeight&&this.dim=="x")a.maxWidth=Math.min(a.maxWidth||this.full,a.maxHeight*this.full/a.y.full);this.size=Math.min(this.full,a["max"+this.ucwh]||this.full);this.minSize=a.allowSizeReduction? +Math.min(a["min"+this.ucwh],this.full):this.full;if(a.isImage&&a.useBox)this.size=a[this.wh],this.imgSize=this.full;if(this.dim=="x"&&hs.padToMinWidth)this.minSize=a.minWidth;this.target=a["target"+this.dim.toUpperCase()];this.marginMin=hs["margin"+this.uclt];this.scroll=hs.page["scroll"+this.uclt];this.clientSize=hs.page[this.wh]},setSize:function(a){var b=this.exp;b.isImage&&(b.useBox||hs.padToMinWidth)?(this.imgSize=a,this.size=Math.max(this.size,this.imgSize),b.content.style[this.lt]=this.get("imgPad")+ +"px"):this.size=a;b.content.style[this.wh]=a+"px";b.wrapper.style[this.wh]=this.get("wsize")+"px";b.outline&&b.outline.setPosition();this.dim=="x"&&b.overlayBox&&b.sizeOverlayBox(true);this.dim=="x"&&b.slideshow&&b.isImage&&(a==this.full?b.slideshow.disable("full-expand"):b.slideshow.enable("full-expand"))},setPos:function(a){this.pos=a;this.exp.wrapper.style[this.lt]=a+"px";this.exp.outline&&this.exp.outline.setPosition()}};hs.Expander=function(a,b,c,d){var h;if(document.readyState&&hs.ie&&!hs.isReady)hs.addEventListener(document, +"ready",function(){new hs.Expander(a,b,c,d)});else{this.a=a;this.custom=c;this.contentType=d||"image";this.isImage=!this.isHtml;this.overlays=[];this.last=hs.last;hs.last=null;hs.init();for(var e=this.key=hs.expanders.length,f=0;ff.scroll+f.clientSize-f.marginMax)f.pos=f.scroll+f.clientSize-f.size-f.marginMin-f.marginMax-f.p1-f.p2;if(f.pos(this.x.imgSize||this.x.size))this.createFullExpand(),this.overlays.length==1&&this.sizeOverlayBox()}this.show()}}catch(i){this.error(i)}},justify:function(a,b){var c,d= +a.target,e=a==this.x?"x":"y";d&&d.match(/ /)&&(c=d.split(" "),d=c[0]);if(d&&hs.$(d)){if(a.pos=hs.getPosition(hs.$(d))[e],c&&c[1]&&c[1].match(/^[-]?[0-9]+px$/)&&(a.pos+=parseInt(c[1])),a.sizea.scroll+a.clientSize-a.marginMax)if(!b&&c&&f)a.size=Math.min(a.size,a.get(e=="y"?"fitsize":"maxsize"));else if(a.get("wsize")a){e=f*a;if(ethis.minHeight&&c.size>this.minWidth&&d.get("wsize")>d.get("fitsize");){d.size-=10;if(a)c.size=d.size*a;this.sizeOverlayBox(0,1);b=true}return b},show:function(){var a=this.x,b=this.y;this.changeSize(1,{wrapper:{width:a.get("wsize"),height:b.get("wsize"),left:a.pos, +top:b.pos},content:{left:a.p1+a.get("imgPad"),top:b.p1+b.get("imgPad"),width:a.imgSize||a.size,height:b.imgSize||b.size}},hs.expandDuration)},changeSize:function(a,b,c){var d=this.transitions,e=a?this.last?this.last.a:null:hs.upcoming,d=d[1]&&e&&hs.getParam(e,"transitions")[1]==d[1]?d[1]:d[0];if(this[d]&&d!="expand")this[d](a,b);else{this.outline&&!this.outlineWhileAnimating&&(a?this.outline.setPosition():this.outline.destroy());a||this.destroyOverlays();var f=this,g=f.x,i=f.y,d=this.easing;a||(d= +this.easingClose||d);e=a?function(){if(f.outline)f.outline.table.style.visibility="visible";setTimeout(function(){f.afterExpand()},50)}:function(){f.afterClose()};a&&hs.setStyles(this.wrapper,{width:g.t+"px",height:i.t+"px"});this.fadeInOut&&(hs.setStyles(this.wrapper,{opacity:a?0:1}),hs.extend(b.wrapper,{opacity:a}));hs.animate(this.wrapper,b.wrapper,{duration:c,easing:d,step:function(b,c){if(f.outline&&f.outlineWhileAnimating&&c.prop=="top"){var d=a?c.pos:1-c.pos,d={w:g.t+(g.get("wsize")-g.t)*d, +h:i.t+(i.get("wsize")-i.t)*d,x:g.tpos+(g.pos-g.tpos)*d,y:i.tpos+(i.pos-i.tpos)*d};f.outline.setPosition(d,0,1)}}});hs.animate(this.content,b.content,c,d,e);if(a)this.wrapper.style.visibility="visible",this.content.style.visibility="visible",this.a.className+=" highslide-active-anchor"}},fade:function(a,b){this.outlineWhileAnimating=false;var c=this,d=a?hs.expandDuration:0;if(a)hs.animate(this.wrapper,b.wrapper,0),hs.setStyles(this.wrapper,{opacity:0,visibility:"visible"}),hs.animate(this.content, +b.content,0),this.content.style.visibility="visible",hs.animate(this.wrapper,{opacity:1},d,null,function(){c.afterExpand()});if(this.outline){this.outline.table.style.zIndex=this.wrapper.style.zIndex;for(var e=a||-1,f=this.outline.offset,g=a?3:f,i=a?f:3,j=g;e*j<=e*i;j+=e,d+=25)(function(){var b=a?i-j:g-j;setTimeout(function(){c.outline.setPosition(0,b,1)},d)})()}a||setTimeout(function(){c.outline&&c.outline.destroy(c.preserveContent);c.destroyOverlays();hs.animate(c.wrapper,{opacity:0},hs.restoreDuration, +null,function(){c.afterClose()})},d)},crossfade:function(a){if(a){var b=this,c=this.last,d=this.x,e=this.y,f=c.x,g=c.y,i=this.wrapper,j=this.content,l=this.overlayBox;hs.removeEventListener(document,"mousemove",hs.dragHandler);hs.setStyles(j,{width:(d.imgSize||d.size)+"px",height:(e.imgSize||e.size)+"px"});if(l)l.style.overflow="visible";if(this.outline=c.outline)this.outline.exp=b;c.outline=null;var p=hs.createElement("div",{className:"highslide-"+this.contentType},{position:"absolute",zIndex:4, +overflow:"hidden",display:"none"}),a={oldImg:c,newImg:this},m;for(m in a)this[m]=a[m].content.cloneNode(1),hs.setStyles(this[m],{position:"absolute",border:0,visibility:"visible"}),p.appendChild(this[m]);i.appendChild(p);if(l)l.className="",i.appendChild(l);p.style.display="";c.content.style.display="none";if(hs.safari&&hs.uaVersion<525)this.wrapper.style.visibility="visible";hs.animate(i,{width:d.size},{duration:hs.transitionDuration,step:function(a,m){var k=m.pos,o=1-k,n,h={},q=["pos","size","p1", +"p2"],r;for(r in q)n=q[r],h["x"+n]=Math.round(o*f[n]+k*d[n]),h["y"+n]=Math.round(o*g[n]+k*e[n]),h.ximgSize=Math.round(o*(f.imgSize||f.size)+k*(d.imgSize||d.size)),h.ximgPad=Math.round(o*f.get("imgPad")+k*d.get("imgPad")),h.yimgSize=Math.round(o*(g.imgSize||g.size)+k*(e.imgSize||e.size)),h.yimgPad=Math.round(o*g.get("imgPad")+k*e.get("imgPad"));b.outline&&b.outline.setPosition({x:h.xpos,y:h.ypos,w:h.xsize+h.xp1+h.xp2+2*d.cb,h:h.ysize+h.yp1+h.yp2+2*e.cb});c.wrapper.style.clip="rect("+(h.ypos-g.pos)+ +"px, "+(h.xsize+h.xp1+h.xp2+h.xpos+2*f.cb-f.pos)+"px, "+(h.ysize+h.yp1+h.yp2+h.ypos+2*g.cb-g.pos)+"px, "+(h.xpos-f.pos)+"px)";hs.setStyles(j,{top:h.yp1+e.get("imgPad")+"px",left:h.xp1+d.get("imgPad")+"px",marginTop:e.pos-h.ypos+"px",marginLeft:d.pos-h.xpos+"px"});hs.setStyles(i,{top:h.ypos+"px",left:h.xpos+"px",width:h.xp1+h.xp2+h.xsize+2*d.cb+"px",height:h.yp1+h.yp2+h.ysize+2*e.cb+"px"});hs.setStyles(p,{width:(h.ximgSize||h.xsize)+"px",height:(h.yimgSize||h.ysize)+"px",left:h.xp1+h.ximgPad+"px", +top:h.yp1+h.yimgPad+"px",visibility:"visible"});hs.setStyles(b.oldImg,{top:g.pos-h.ypos+g.p1-h.yp1+g.get("imgPad")-h.yimgPad+"px",left:f.pos-h.xpos+f.p1-h.xp1+f.get("imgPad")-h.ximgPad+"px"});hs.setStyles(b.newImg,{opacity:k,top:e.pos-h.ypos+e.p1-h.yp1+e.get("imgPad")-h.yimgPad+"px",left:d.pos-h.xpos+d.p1-h.xp1+d.get("imgPad")-h.ximgPad+"px"});l&&hs.setStyles(l,{width:h.xsize+"px",height:h.ysize+"px",left:h.xp1+d.cb+"px",top:h.yp1+e.cb+"px"})},complete:function(){i.style.visibility=j.style.visibility= +"visible";j.style.display="block";hs.discardElement(p);b.afterExpand();c.afterClose();b.last=null}})}},reuseOverlay:function(a){if(!this.last)return false;for(var b=0;b'+hs.lang.number.replace("%1",this.getAnchorIndex()+1).replace("%2",a.length)+""+this[this.numberPosition].innerHTML}}, +initSlideshow:function(){if(this.last)this.slideshow=this.last.slideshow;else for(var a=0;aa.parentNode.offsetWidth)a.style.width="100%"}else a.parentNode!=this.overlayBox&& +this.overlayBox.appendChild(a);if(/left$/.test(b))a.style.left=d+"px";/center$/.test(b)&&hs.setStyles(a,{left:"50%",marginLeft:d-Math.round(a.offsetWidth/2)+"px"});if(/right$/.test(b))a.style.right=-d+"px";if(/^leftpanel$/.test(b))hs.setStyles(a,{right:"100%",marginRight:this.x.cb+"px",top:-this.y.cb+"px",bottom:-this.y.cb+"px",overflow:"auto"}),this.x.p1=a.offsetWidth;else if(/^rightpanel$/.test(b))hs.setStyles(a,{left:"100%",marginLeft:this.x.cb+"px",top:-this.y.cb+"px",bottom:-this.y.cb+"px",overflow:"auto"}), +this.x.p2=a.offsetWidth;d=a.parentNode.offsetHeight;a.style.height="auto";if(c&&a.offsetHeight>d)a.style.height=hs.ieLt7?d+"px":"100%";if(/^top/.test(b))a.style.top=e+"px";/^middle/.test(b)&&hs.setStyles(a,{top:"50%",marginTop:e-Math.round(a.offsetHeight/2)+"px"});if(/^bottom/.test(b))a.style.bottom=-e+"px";if(/^above$/.test(b))hs.setStyles(a,{left:-this.x.p1-this.x.cb+"px",right:-this.x.p2-this.x.cb+"px",bottom:"100%",marginBottom:this.y.cb+"px",width:"auto"}),this.y.p1=a.offsetHeight;else if(/^below$/.test(b))hs.setStyles(a, +{position:"relative",left:-this.x.p1-this.x.cb+"px",right:-this.x.p2-this.x.cb+"px",top:"100%",marginTop:this.y.cb+"px",width:"auto"}),this.y.p2=a.offsetHeight,a.style.position="absolute"},getOverlays:function(){this.getInline(["heading","caption"],true);this.getNumber();this.heading&&this.dragByHeading&&(this.heading.className+=" highslide-move");hs.showCredits&&this.writeCredits();for(var a=0;a").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"":"")+""),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;g=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
    a",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="
    "+""+"
    ",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="
    t
    ",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="
    ",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")}; +f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&i.push({elem:this,matches:d.slice(e)});for(j=0;j0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

    ";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
    ";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/
    ","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
    ","
    "]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function() +{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
    ").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); + +/*! + * jQuery UI 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI + */ +(function(c,j){function k(a,b){var d=a.nodeName.toLowerCase();if("area"===d){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&l(a)}return(/input|select|textarea|button|object/.test(d)?!a.disabled:"a"==d?a.href||b:b)&&l(a)}function l(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.16", +keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({propAttr:c.fn.prop||c.fn.attr,_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d= +this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this, +"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart": +"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,m,n){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(m)g-=parseFloat(c.curCSS(f,"border"+this+"Width",true))||0;if(n)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight, +outerWidth:c.fn.outerWidth,outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h,d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){return k(a,!isNaN(c.attr(a,"tabindex")))},tabbable:function(a){var b=c.attr(a, +"tabindex"),d=isNaN(b);return(d||b>=0)&&k(a,!d)}});c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&& +a.element[0].parentNode)for(var e=0;e0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a=9)&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a);return a.preventDefault()}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted= +false;a.target==this._mouseDownEvent.target&&b.data(a.target,this.widgetName+".preventClickEvent",true);this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery); +; + +(function(c){c.ui=c.ui||{};var n=/left|center|right/,o=/top|center|bottom/,t=c.fn.position,u=c.fn.offset;c.fn.position=function(b){if(!b||!b.of)return t.apply(this,arguments);b=c.extend({},b);var a=c(b.of),d=a[0],g=(b.collision||"flip").split(" "),e=b.offset?b.offset.split(" "):[0,0],h,k,j;if(d.nodeType===9){h=a.width();k=a.height();j={top:0,left:0}}else if(d.setTimeout){h=a.width();k=a.height();j={top:a.scrollTop(),left:a.scrollLeft()}}else if(d.preventDefault){b.at="left top";h=k=0;j={top:b.of.pageY, +left:b.of.pageX}}else{h=a.outerWidth();k=a.outerHeight();j=a.offset()}c.each(["my","at"],function(){var f=(b[this]||"").split(" ");if(f.length===1)f=n.test(f[0])?f.concat(["center"]):o.test(f[0])?["center"].concat(f):["center","center"];f[0]=n.test(f[0])?f[0]:"center";f[1]=o.test(f[1])?f[1]:"center";b[this]=f});if(g.length===1)g[1]=g[0];e[0]=parseInt(e[0],10)||0;if(e.length===1)e[1]=e[0];e[1]=parseInt(e[1],10)||0;if(b.at[0]==="right")j.left+=h;else if(b.at[0]==="center")j.left+=h/2;if(b.at[1]==="bottom")j.top+= +k;else if(b.at[1]==="center")j.top+=k/2;j.left+=e[0];j.top+=e[1];return this.each(function(){var f=c(this),l=f.outerWidth(),m=f.outerHeight(),p=parseInt(c.curCSS(this,"marginLeft",true))||0,q=parseInt(c.curCSS(this,"marginTop",true))||0,v=l+p+(parseInt(c.curCSS(this,"marginRight",true))||0),w=m+q+(parseInt(c.curCSS(this,"marginBottom",true))||0),i=c.extend({},j),r;if(b.my[0]==="right")i.left-=l;else if(b.my[0]==="center")i.left-=l/2;if(b.my[1]==="bottom")i.top-=m;else if(b.my[1]==="center")i.top-= +m/2;i.left=Math.round(i.left);i.top=Math.round(i.top);r={left:i.left-p,top:i.top-q};c.each(["left","top"],function(s,x){c.ui.position[g[s]]&&c.ui.position[g[s]][x](i,{targetWidth:h,targetHeight:k,elemWidth:l,elemHeight:m,collisionPosition:r,collisionWidth:v,collisionHeight:w,offset:e,my:b.my,at:b.at})});c.fn.bgiframe&&f.bgiframe();f.offset(c.extend(i,{using:b.using}))})};c.ui.position={fit:{left:function(b,a){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();b.left= +d>0?b.left-d:Math.max(b.left-a.collisionPosition.left,b.left)},top:function(b,a){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();b.top=d>0?b.top-d:Math.max(b.top-a.collisionPosition.top,b.top)}},flip:{left:function(b,a){if(a.at[0]!=="center"){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();var g=a.my[0]==="left"?-a.elemWidth:a.my[0]==="right"?a.elemWidth:0,e=a.at[0]==="left"?a.targetWidth:-a.targetWidth,h=-2*a.offset[0];b.left+= +a.collisionPosition.left<0?g+e+h:d>0?g+e+h:0}},top:function(b,a){if(a.at[1]!=="center"){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();var g=a.my[1]==="top"?-a.elemHeight:a.my[1]==="bottom"?a.elemHeight:0,e=a.at[1]==="top"?a.targetHeight:-a.targetHeight,h=-2*a.offset[1];b.top+=a.collisionPosition.top<0?g+e+h:d>0?g+e+h:0}}}};if(!c.offset.setOffset){c.offset.setOffset=function(b,a){if(/static/.test(c.curCSS(b,"position")))b.style.position="relative";var d=c(b), +g=d.offset(),e=parseInt(c.curCSS(b,"top",true),10)||0,h=parseInt(c.curCSS(b,"left",true),10)||0;g={top:a.top-g.top+e,left:a.left-g.left+h};"using"in a?a.using.call(b,g):d.css(g)};c.fn.offset=function(b){var a=this[0];if(!a||!a.ownerDocument)return null;if(b)return this.each(function(){c.offset.setOffset(this,b)});return u.call(this)}}})(jQuery); +; + +(function(d){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper== +"original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(a){var b= +this.options;if(this.helper||b.disabled||d(a.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(a);if(!this.handle)return false;if(b.iframeFix)d(b.iframeFix===true?"iframe":b.iframeFix).each(function(){d('
    ').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(d(this).offset()).appendTo("body")});return true},_mouseStart:function(a){var b=this.options; +this.helper=this._createHelper(a);this._cacheHelperProportions();if(d.ui.ddmanager)d.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}); +this.originalPosition=this.position=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);b.containment&&this._setContainment();if(this._trigger("start",a)===false){this._clear();return false}this._cacheHelperProportions();d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(a,true);d.ui.ddmanager&&d.ui.ddmanager.dragStart(this,a);return true}, +_mouseDrag:function(a,b){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!b){b=this._uiHash();if(this._trigger("drag",a,b)===false){this._mouseUp({});return false}this.position=b.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);return false},_mouseStop:function(a){var b= +false;if(d.ui.ddmanager&&!this.options.dropBehaviour)b=d.ui.ddmanager.drop(this,a);if(this.dropped){b=this.dropped;this.dropped=false}if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return false;if(this.options.revert=="invalid"&&!b||this.options.revert=="valid"&&b||this.options.revert===true||d.isFunction(this.options.revert)&&this.options.revert.call(this.element,b)){var c=this;d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration, +10),function(){c._trigger("stop",a)!==false&&c._clear()})}else this._trigger("stop",a)!==false&&this._clear();return false},_mouseUp:function(a){this.options.iframeFix===true&&d("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)});d.ui.ddmanager&&d.ui.ddmanager.dragStop(this,a);return d.ui.mouse.prototype._mouseUp.call(this,a)},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(a){var b=!this.options.handle|| +!d(this.options.handle,this.element).length?true:false;d(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==a.target)b=true});return b},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a])):b.helper=="clone"?this.element.clone().removeAttr("id"):this.element;a.parents("body").length||a.appendTo(b.appendTo=="parent"?this.element[0].parentNode:b.appendTo);a[0]!=this.element[0]&&!/(fixed|absolute)/.test(a.css("position"))&& +a.css("position","absolute");return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]||0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent= +this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"), +10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"), +10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment=="parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[a.containment=="document"?0:d(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,a.containment=="document"?0:d(window).scrollTop()-this.offset.relative.top-this.offset.parent.top, +(a.containment=="document"?0:d(window).scrollLeft())+d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a.containment=="document"?0:d(window).scrollTop())+(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)&&a.containment.constructor!=Array){a=d(a.containment);var b=a[0];if(b){a.offset();var c=d(b).css("overflow")!= +"hidden";this.containment=[(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0),(parseInt(d(b).css("borderTopWidth"),10)||0)+(parseInt(d(b).css("paddingTop"),10)||0),(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"), +10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom];this.relative_container=a}}else if(a.containment.constructor==Array)this.containment=a.containment},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName);return{top:b.top+ +this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&& +!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName),e=a.pageX,h=a.pageY;if(this.originalPosition){var g;if(this.containment){if(this.relative_container){g=this.relative_container.offset();g=[this.containment[0]+g.left,this.containment[1]+g.top,this.containment[2]+g.left,this.containment[3]+g.top]}else g=this.containment;if(a.pageX-this.offset.click.leftg[2])e=g[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>g[3])h=g[3]+this.offset.click.top}if(b.grid){h=b.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/b.grid[1])*b.grid[1]:this.originalPageY;h=g?!(h-this.offset.click.topg[3])?h:!(h-this.offset.click.topg[2])?e:!(e-this.offset.click.left=0;i--){var j=c.snapElements[i].left,l=j+c.snapElements[i].width,k=c.snapElements[i].top,m=k+c.snapElements[i].height;if(j-e").addClass("ui-button-text").html(this.options.label).appendTo(a.empty()).text(),e=this.options.icons,f=e.primary&&e.secondary,d=[];if(e.primary||e.secondary){if(this.options.text)d.push("ui-button-text-icon"+(f?"s":e.primary?"-primary":"-secondary"));e.primary&&a.prepend("");e.secondary&&a.append("");if(!this.options.text){d.push(f?"ui-button-icons-only": +"ui-button-icon-only");this.hasTitle||a.attr("title",c)}}else d.push("ui-button-text-only");a.addClass(d.join(" "))}}});b.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(a,c){a==="disabled"&&this.buttons.button("option",a,c);b.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){var a=this.element.css("direction")=== +"ltr";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return b(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(a?"ui-corner-left":"ui-corner-right").end().filter(":last").addClass(a?"ui-corner-right":"ui-corner-left").end().end()},destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return b(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy"); +b.Widget.prototype.destroy.call(this)}})})(jQuery); +; + +(function(c,l){var m={buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},n={maxHeight:true,maxWidth:true,minHeight:true,minWidth:true},o=c.attrFn||{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true,click:true};c.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false, +position:{my:"center",at:"center",collision:"fit",using:function(a){var b=c(this).css(a).offset().top;b<0&&c(this).css("top",a.top-b)}},resizable:true,show:null,stack:true,title:"",width:300,zIndex:1E3},_create:function(){this.originalTitle=this.element.attr("title");if(typeof this.originalTitle!=="string")this.originalTitle="";this.options.title=this.options.title||this.originalTitle;var a=this,b=a.options,d=b.title||" ",e=c.ui.dialog.getTitleId(a.element),g=(a.uiDialog=c("
    ")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+ +b.dialogClass).css({zIndex:b.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(i){if(b.closeOnEscape&&!i.isDefaultPrevented()&&i.keyCode&&i.keyCode===c.ui.keyCode.ESCAPE){a.close(i);i.preventDefault()}}).attr({role:"dialog","aria-labelledby":e}).mousedown(function(i){a.moveToTop(false,i)});a.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g);var f=(a.uiDialogTitlebar=c("
    ")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g), +h=c('').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){h.addClass("ui-state-hover")},function(){h.removeClass("ui-state-hover")}).focus(function(){h.addClass("ui-state-focus")}).blur(function(){h.removeClass("ui-state-focus")}).click(function(i){a.close(i);return false}).appendTo(f);(a.uiDialogTitlebarCloseText=c("")).addClass("ui-icon ui-icon-closethick").text(b.closeText).appendTo(h);c("").addClass("ui-dialog-title").attr("id", +e).html(d).prependTo(f);if(c.isFunction(b.beforeclose)&&!c.isFunction(b.beforeClose))b.beforeClose=b.beforeclose;f.find("*").add(f).disableSelection();b.draggable&&c.fn.draggable&&a._makeDraggable();b.resizable&&c.fn.resizable&&a._makeResizable();a._createButtons(b.buttons);a._isOpen=false;c.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;a.overlay&&a.overlay.destroy();a.uiDialog.hide();a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"); +a.uiDialog.remove();a.originalTitle&&a.element.attr("title",a.originalTitle);return a},widget:function(){return this.uiDialog},close:function(a){var b=this,d,e;if(false!==b._trigger("beforeClose",a)){b.overlay&&b.overlay.destroy();b.uiDialog.unbind("keypress.ui-dialog");b._isOpen=false;if(b.options.hide)b.uiDialog.hide(b.options.hide,function(){b._trigger("close",a)});else{b.uiDialog.hide();b._trigger("close",a)}c.ui.dialog.overlay.resize();if(b.options.modal){d=0;c(".ui-dialog").each(function(){if(this!== +b.uiDialog[0]){e=c(this).css("z-index");isNaN(e)||(d=Math.max(d,e))}});c.ui.dialog.maxZ=d}return b}},isOpen:function(){return this._isOpen},moveToTop:function(a,b){var d=this,e=d.options;if(e.modal&&!a||!e.stack&&!e.modal)return d._trigger("focus",b);if(e.zIndex>c.ui.dialog.maxZ)c.ui.dialog.maxZ=e.zIndex;if(d.overlay){c.ui.dialog.maxZ+=1;d.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=c.ui.dialog.maxZ)}a={scrollTop:d.element.scrollTop(),scrollLeft:d.element.scrollLeft()};c.ui.dialog.maxZ+=1; +d.uiDialog.css("z-index",c.ui.dialog.maxZ);d.element.attr(a);d._trigger("focus",b);return d},open:function(){if(!this._isOpen){var a=this,b=a.options,d=a.uiDialog;a.overlay=b.modal?new c.ui.dialog.overlay(a):null;a._size();a._position(b.position);d.show(b.show);a.moveToTop(true);b.modal&&d.bind("keypress.ui-dialog",function(e){if(e.keyCode===c.ui.keyCode.TAB){var g=c(":tabbable",this),f=g.filter(":first");g=g.filter(":last");if(e.target===g[0]&&!e.shiftKey){f.focus(1);return false}else if(e.target=== +f[0]&&e.shiftKey){g.focus(1);return false}}});c(a.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus();a._isOpen=true;a._trigger("open");return a}},_createButtons:function(a){var b=this,d=false,e=c("
    ").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),g=c("
    ").addClass("ui-dialog-buttonset").appendTo(e);b.uiDialog.find(".ui-dialog-buttonpane").remove();typeof a==="object"&&a!==null&&c.each(a, +function(){return!(d=true)});if(d){c.each(a,function(f,h){h=c.isFunction(h)?{click:h,text:f}:h;var i=c('').click(function(){h.click.apply(b.element[0],arguments)}).appendTo(g);c.each(h,function(j,k){if(j!=="click")j in o?i[j](k):i.attr(j,k)});c.fn.button&&i.button()});e.appendTo(b.uiDialog)}},_makeDraggable:function(){function a(f){return{position:f.position,offset:f.offset}}var b=this,d=b.options,e=c(document),g;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close", +handle:".ui-dialog-titlebar",containment:"document",start:function(f,h){g=d.height==="auto"?"auto":c(this).height();c(this).height(c(this).height()).addClass("ui-dialog-dragging");b._trigger("dragStart",f,a(h))},drag:function(f,h){b._trigger("drag",f,a(h))},stop:function(f,h){d.position=[h.position.left-e.scrollLeft(),h.position.top-e.scrollTop()];c(this).removeClass("ui-dialog-dragging").height(g);b._trigger("dragStop",f,a(h));c.ui.dialog.overlay.resize()}})},_makeResizable:function(a){function b(f){return{originalPosition:f.originalPosition, +originalSize:f.originalSize,position:f.position,size:f.size}}a=a===l?this.options.resizable:a;var d=this,e=d.options,g=d.uiDialog.css("position");a=typeof a==="string"?a:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:a,start:function(f,h){c(this).addClass("ui-dialog-resizing");d._trigger("resizeStart",f,b(h))},resize:function(f,h){d._trigger("resize", +f,b(h))},stop:function(f,h){c(this).removeClass("ui-dialog-resizing");e.height=c(this).height();e.width=c(this).width();d._trigger("resizeStop",f,b(h));c.ui.dialog.overlay.resize()}}).css("position",g).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(a){var b=[],d=[0,0],e;if(a){if(typeof a==="string"||typeof a==="object"&&"0"in a){b=a.split?a.split(" "): +[a[0],a[1]];if(b.length===1)b[1]=b[0];c.each(["left","top"],function(g,f){if(+b[g]===b[g]){d[g]=b[g];b[g]=f}});a={my:b.join(" "),at:b.join(" "),offset:d.join(" ")}}a=c.extend({},c.ui.dialog.prototype.options.position,a)}else a=c.ui.dialog.prototype.options.position;(e=this.uiDialog.is(":visible"))||this.uiDialog.show();this.uiDialog.css({top:0,left:0}).position(c.extend({of:window},a));e||this.uiDialog.hide()},_setOptions:function(a){var b=this,d={},e=false;c.each(a,function(g,f){b._setOption(g,f); +if(g in m)e=true;if(g in n)d[g]=f});e&&this._size();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",d)},_setOption:function(a,b){var d=this,e=d.uiDialog;switch(a){case "beforeclose":a="beforeClose";break;case "buttons":d._createButtons(b);break;case "closeText":d.uiDialogTitlebarCloseText.text(""+b);break;case "dialogClass":e.removeClass(d.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+b);break;case "disabled":b?e.addClass("ui-dialog-disabled"): +e.removeClass("ui-dialog-disabled");break;case "draggable":var g=e.is(":data(draggable)");g&&!b&&e.draggable("destroy");!g&&b&&d._makeDraggable();break;case "position":d._position(b);break;case "resizable":(g=e.is(":data(resizable)"))&&!b&&e.resizable("destroy");g&&typeof b==="string"&&e.resizable("option","handles",b);!g&&b!==false&&d._makeResizable(b);break;case "title":c(".ui-dialog-title",d.uiDialogTitlebar).html(""+(b||" "));break}c.Widget.prototype._setOption.apply(d,arguments)},_size:function(){var a= +this.options,b,d,e=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0});if(a.minWidth>a.width)a.width=a.minWidth;b=this.uiDialog.css({height:"auto",width:a.width}).height();d=Math.max(0,a.minHeight-b);if(a.height==="auto")if(c.support.minHeight)this.element.css({minHeight:d,height:"auto"});else{this.uiDialog.show();a=this.element.css("height","auto").height();e||this.uiDialog.hide();this.element.height(Math.max(a,d))}else this.element.height(Math.max(a.height- +b,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}});c.extend(c.ui.dialog,{version:"1.8.16",uuid:0,maxZ:0,getTitleId:function(a){a=a.attr("id");if(!a){this.uuid+=1;a=this.uuid}return"ui-dialog-title-"+a},overlay:function(a){this.$el=c.ui.dialog.overlay.create(a)}});c.extend(c.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "), +create:function(a){if(this.instances.length===0){setTimeout(function(){c.ui.dialog.overlay.instances.length&&c(document).bind(c.ui.dialog.overlay.events,function(d){if(c(d.target).zIndex()
    ").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});c.fn.bgiframe&&b.bgiframe();this.instances.push(b);return b},destroy:function(a){var b=c.inArray(a,this.instances);b!=-1&&this.oldInstances.push(this.instances.splice(b,1)[0]);this.instances.length===0&&c([document,window]).unbind(".dialog-overlay");a.remove();var d=0;c.each(this.instances,function(){d=Math.max(d,this.css("z-index"))});this.maxZ=d},height:function(){var a,b;if(c.browser.msie&& +c.browser.version<7){a=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);b=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return a").appendTo(this.element);this.oldValue=this._value();this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"); +this.valueDiv.remove();b.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===d)return this._value();this._setOption("value",a);return this},_setOption:function(a,c){if(a==="value"){this.options.value=c;this._refreshValue();this._value()===this.options.max&&this._trigger("complete")}b.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;if(typeof a!=="number")a=0;return Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100* +this._value()/this.options.max},_refreshValue:function(){var a=this.value(),c=this._percentage();if(this.oldValue!==a){this.oldValue=a;this._trigger("change")}this.valueDiv.toggle(a>this.min).toggleClass("ui-corner-right",a===this.options.max).width(c.toFixed(0)+"%");this.element.attr("aria-valuenow",a)}});b.extend(b.ui.progressbar,{version:"1.8.16"})})(jQuery); +; + +jQuery.effects||function(f,j){function m(c){var a;if(c&&c.constructor==Array&&c.length==3)return c;if(a=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(c))return[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10)];if(a=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(c))return[parseFloat(a[1])*2.55,parseFloat(a[2])*2.55,parseFloat(a[3])*2.55];if(a=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(c))return[parseInt(a[1], +16),parseInt(a[2],16),parseInt(a[3],16)];if(a=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(c))return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)];if(/rgba\(0, 0, 0, 0\)/.exec(c))return n.transparent;return n[f.trim(c).toLowerCase()]}function s(c,a){var b;do{b=f.curCSS(c,a);if(b!=""&&b!="transparent"||f.nodeName(c,"body"))break;a="backgroundColor"}while(c=c.parentNode);return m(b)}function o(){var c=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle, +a={},b,d;if(c&&c.length&&c[0]&&c[c[0]])for(var e=c.length;e--;){b=c[e];if(typeof c[b]=="string"){d=b.replace(/\-(\w)/g,function(g,h){return h.toUpperCase()});a[d]=c[b]}}else for(b in c)if(typeof c[b]==="string")a[b]=c[b];return a}function p(c){var a,b;for(a in c){b=c[a];if(b==null||f.isFunction(b)||a in t||/scrollbar/.test(a)||!/color/i.test(a)&&isNaN(parseFloat(b)))delete c[a]}return c}function u(c,a){var b={_:0},d;for(d in a)if(c[d]!=a[d])b[d]=a[d];return b}function k(c,a,b,d){if(typeof c=="object"){d= +a;b=null;a=c;c=a.effect}if(f.isFunction(a)){d=a;b=null;a={}}if(typeof a=="number"||f.fx.speeds[a]){d=b;b=a;a={}}if(f.isFunction(b)){d=b;b=null}a=a||{};b=b||a.duration;b=f.fx.off?0:typeof b=="number"?b:b in f.fx.speeds?f.fx.speeds[b]:f.fx.speeds._default;d=d||a.complete;return[c,a,b,d]}function l(c){if(!c||typeof c==="number"||f.fx.speeds[c])return true;if(typeof c==="string"&&!f.effects[c])return true;return false}f.effects={};f.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor", +"borderTopColor","borderColor","color","outlineColor"],function(c,a){f.fx.step[a]=function(b){if(!b.colorInit){b.start=s(b.elem,a);b.end=m(b.end);b.colorInit=true}b.elem.style[a]="rgb("+Math.max(Math.min(parseInt(b.pos*(b.end[0]-b.start[0])+b.start[0],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[1]-b.start[1])+b.start[1],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[2]-b.start[2])+b.start[2],10),255),0)+")"}});var n={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0, +0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211, +211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},q=["add","remove","toggle"],t={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};f.effects.animateClass=function(c,a,b, +d){if(f.isFunction(b)){d=b;b=null}return this.queue(function(){var e=f(this),g=e.attr("style")||" ",h=p(o.call(this)),r,v=e.attr("class");f.each(q,function(w,i){c[i]&&e[i+"Class"](c[i])});r=p(o.call(this));e.attr("class",v);e.animate(u(h,r),{queue:false,duration:a,easing:b,complete:function(){f.each(q,function(w,i){c[i]&&e[i+"Class"](c[i])});if(typeof e.attr("style")=="object"){e.attr("style").cssText="";e.attr("style").cssText=g}else e.attr("style",g);d&&d.apply(this,arguments);f.dequeue(this)}})})}; +f.fn.extend({_addClass:f.fn.addClass,addClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{add:c},a,b,d]):this._addClass(c)},_removeClass:f.fn.removeClass,removeClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{remove:c},a,b,d]):this._removeClass(c)},_toggleClass:f.fn.toggleClass,toggleClass:function(c,a,b,d,e){return typeof a=="boolean"||a===j?b?f.effects.animateClass.apply(this,[a?{add:c}:{remove:c},b,d,e]):this._toggleClass(c,a):f.effects.animateClass.apply(this, +[{toggle:c},a,b,d])},switchClass:function(c,a,b,d,e){return f.effects.animateClass.apply(this,[{add:a,remove:c},b,d,e])}});f.extend(f.effects,{version:"1.8.16",save:function(c,a){for(var b=0;b").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}), +d=document.activeElement;c.wrap(b);if(c[0]===d||f.contains(c[0],d))f(d).focus();b=c.parent();if(c.css("position")=="static"){b.css({position:"relative"});c.css({position:"relative"})}else{f.extend(a,{position:c.css("position"),zIndex:c.css("z-index")});f.each(["top","left","bottom","right"],function(e,g){a[g]=c.css(g);if(isNaN(parseInt(a[g],10)))a[g]="auto"});c.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})}return b.css(a).show()},removeWrapper:function(c){var a,b=document.activeElement; +if(c.parent().is(".ui-effects-wrapper")){a=c.parent().replaceWith(c);if(c[0]===b||f.contains(c[0],b))f(b).focus();return a}return c},setTransition:function(c,a,b,d){d=d||{};f.each(a,function(e,g){unit=c.cssUnit(g);if(unit[0]>0)d[g]=unit[0]*b+unit[1]});return d}});f.fn.extend({effect:function(c){var a=k.apply(this,arguments),b={options:a[1],duration:a[2],callback:a[3]};a=b.options.mode;var d=f.effects[c];if(f.fx.off||!d)return a?this[a](b.duration,b.callback):this.each(function(){b.callback&&b.callback.call(this)}); +return d.call(this,b)},_show:f.fn.show,show:function(c){if(l(c))return this._show.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="show";return this.effect.apply(this,a)}},_hide:f.fn.hide,hide:function(c){if(l(c))return this._hide.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="hide";return this.effect.apply(this,a)}},__toggle:f.fn.toggle,toggle:function(c){if(l(c)||typeof c==="boolean"||f.isFunction(c))return this.__toggle.apply(this,arguments);else{var a=k.apply(this, +arguments);a[1].mode="toggle";return this.effect.apply(this,a)}},cssUnit:function(c){var a=this.css(c),b=[];f.each(["em","px","%","pt"],function(d,e){if(a.indexOf(e)>0)b=[parseFloat(a),e]});return b}});f.easing.jswing=f.easing.swing;f.extend(f.easing,{def:"easeOutQuad",swing:function(c,a,b,d,e){return f.easing[f.easing.def](c,a,b,d,e)},easeInQuad:function(c,a,b,d,e){return d*(a/=e)*a+b},easeOutQuad:function(c,a,b,d,e){return-d*(a/=e)*(a-2)+b},easeInOutQuad:function(c,a,b,d,e){if((a/=e/2)<1)return d/ +2*a*a+b;return-d/2*(--a*(a-2)-1)+b},easeInCubic:function(c,a,b,d,e){return d*(a/=e)*a*a+b},easeOutCubic:function(c,a,b,d,e){return d*((a=a/e-1)*a*a+1)+b},easeInOutCubic:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a+b;return d/2*((a-=2)*a*a+2)+b},easeInQuart:function(c,a,b,d,e){return d*(a/=e)*a*a*a+b},easeOutQuart:function(c,a,b,d,e){return-d*((a=a/e-1)*a*a*a-1)+b},easeInOutQuart:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a+b;return-d/2*((a-=2)*a*a*a-2)+b},easeInQuint:function(c,a,b, +d,e){return d*(a/=e)*a*a*a*a+b},easeOutQuint:function(c,a,b,d,e){return d*((a=a/e-1)*a*a*a*a+1)+b},easeInOutQuint:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a*a+b;return d/2*((a-=2)*a*a*a*a+2)+b},easeInSine:function(c,a,b,d,e){return-d*Math.cos(a/e*(Math.PI/2))+d+b},easeOutSine:function(c,a,b,d,e){return d*Math.sin(a/e*(Math.PI/2))+b},easeInOutSine:function(c,a,b,d,e){return-d/2*(Math.cos(Math.PI*a/e)-1)+b},easeInExpo:function(c,a,b,d,e){return a==0?b:d*Math.pow(2,10*(a/e-1))+b},easeOutExpo:function(c, +a,b,d,e){return a==e?b+d:d*(-Math.pow(2,-10*a/e)+1)+b},easeInOutExpo:function(c,a,b,d,e){if(a==0)return b;if(a==e)return b+d;if((a/=e/2)<1)return d/2*Math.pow(2,10*(a-1))+b;return d/2*(-Math.pow(2,-10*--a)+2)+b},easeInCirc:function(c,a,b,d,e){return-d*(Math.sqrt(1-(a/=e)*a)-1)+b},easeOutCirc:function(c,a,b,d,e){return d*Math.sqrt(1-(a=a/e-1)*a)+b},easeInOutCirc:function(c,a,b,d,e){if((a/=e/2)<1)return-d/2*(Math.sqrt(1-a*a)-1)+b;return d/2*(Math.sqrt(1-(a-=2)*a)+1)+b},easeInElastic:function(c,a,b, +d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h(.|[\r\n])*?<\/script>/ig; + + var js_str = js_reg.exec(data); + if (js_str != null) { + + var js_arr = new Array(js_str.shift()); + var jsfound = true; + + while(js_str) { + js_str = js_reg.exec(data); + if (js_str != null) js_arr.push(js_str.shift()); + } + + for(var i=0; i
    + + + +
       
    +HTML; + +$tpl->set( '{addimg}', $addim ); + +#### IMG + +?> \ No newline at end of file diff --git a/system/modules/addnews.php b/system/modules/addnews.php new file mode 100644 index 0000000..a30d084 --- /dev/null +++ b/system/modules/addnews.php @@ -0,0 +1,219 @@ +query( "UPDATE LOW_PRIORITY " . USERPREFIX . "_users SET restricted='0', restricted_days='0', restricted_date='' WHERE user_id='{$member_id['user_id']}'" ); +} + +if( $member_id['restricted'] == 1 or $member_id['restricted'] == 3 ) { + if( $member_id['restricted_days'] ) { + $lang['news_info_4'] = str_replace( '{date}', langdate( "j M Y H:i", $member_id['restricted_date'] ), $lang['news_info_4'] ); + $lang['add_err_9'] = $lang['news_info_4']; + } else {$lang['add_err_9'] = $lang['news_info_5'];} + $allow_addnews = false; +} + +if( ! $allow_addnews ) {msgbox( $lang['all_info'], $lang['add_err_9'] . "

    $lang[all_prev]" ); +} else { + if( isset( $_REQUEST['mod'] ) and $_REQUEST['mod'] == "addnews" and $is_logged and $user_group[$member_id['user_group']]['allow_adds'] ) { + $stop = ""; + $allow_comm = intval( $_POST['allow_comm'] ); + if( $user_group[$member_id['user_group']]['allow_main'] ) $allow_main = intval( $_POST['allow_main'] ); else $allow_main = 0; + $approve = intval( $_POST['approve'] ); + $allow_rating = intval( $_POST['allow_rating'] ); + if( $user_group[$member_id['user_group']]['allow_fixed'] ) $news_fixed = intval( $_POST['news_fixed'] ); else $news_fixed = 0; + if( ! count( $_REQUEST['catlist'] ) ) {$catlist = array (); $catlist[] = '0';} else $catlist = $_REQUEST['catlist']; $category_list = $db->safesql( implode( ',', $catlist ) ); + if( ! $config['allow_add_tags'] ) $_POST['tags'] = ""; elseif( @preg_match( "/[\||\'|\<|\>|\"|\!|\?|\$|\@|\/|\\\|\&\~\*\+]/", $_POST['tags'] ) ) $_POST['tags'] = ""; else $_POST['tags'] = $db->safesql( htmlspecialchars( strip_tags( stripslashes( trim( $_POST['tags'] ) ) ), ENT_QUOTES ) ); + if ( $_POST['tags'] ) { + $temp_array = array(); + $tags_array = array(); + $temp_array = explode (",", $_POST['tags']); + if (count($temp_array)) { + foreach ( $temp_array as $value ) { + if( trim($value) ) $tags_array[] = trim( $value ); + }} + if ( count($tags_array) ) $_POST['tags'] = implode(", ", $tags_array); else $_POST['tags'] = ""; + } + if( ! $user_group[$member_id['user_group']]['moderation'] ) {$approve = 0;$allow_comm = 1;$allow_main = 0;$allow_rating = 1;$news_fixed = 0;} + if( $approve ) $msg = $lang['add_ok_1']; else $msg = $lang['add_ok_2']; + $allow_list = explode( ',', $user_group[$member_id['user_group']]['cat_add'] ); + + if( $user_group[$member_id['user_group']]['moderation'] ) { + foreach ( $catlist as $selected ) { + if( $allow_list[0] != "all" and ! in_array( $selected, $allow_list ) and $member_id['user_group'] != "1" ) { + $approve = 0; + $msg = $lang['add_ok_3']; + }}} + + $full_story = $db->safesql( $parse->BB_Parse( $parse->process( $_POST['full_story'] ), false ) ); + $short_story = $db->safesql( $parse->BB_Parse( $parse->process( $_POST['short_story'] ), false ) ); + + if( $parse->not_allowed_text ) {$stop .= "
  • " . $lang['news_err_39'] . "
  • ";} + + $parse->ParseFilter(); + $title = $db->safesql( $parse->process( trim( strip_tags ($_POST['title']) ) ) ); + $alt_name = trim( $parse->process( stripslashes( $_POST['alt_name'] ) ) ); + if( $alt_name == "" or ! $alt_name ) $alt_name = totranslit( stripslashes( $title ), true, false ); else $alt_name = totranslit( $alt_name, true, false ); + if( $title == "" or ! $title ) $stop .= $lang['add_err_1']; + if( strlen( $title ) > 200 ) $stop .= $lang['add_err_2']; + if( trim( $short_story ) == "" or ! $short_story ) $stop .= $lang['add_err_5']; + if( $stop ) {$stop = "
      " . $stop . "
    $lang[all_prev]"; msgbox( $lang['add_err_6'], $stop );} + + if( ! $stop ) { + $id = (isset( $_REQUEST['id'] )) ? intval( $_REQUEST['id'] ) : 0; $found = false; + if( $id ) {$row = $db->super_query( "SELECT * FROM " . PREFIX . "_post where id = '$id' and approve = '0'" ); if( $id == $row['id'] and ($member_id['name'] == $row['autor'] or $user_group[$member_id['user_group']]['allow_all_edit']) ) $found = true; else $found = false;} + + if( $found ) { + $db->query( "UPDATE " . PREFIX . "_post set title='$title', short_story='$short_story', full_story='$full_story', category='$category_list', alt_name='$alt_name', allow_comm='$allow_comm', approve='$approve', allow_main='$allow_main', allow_rate='$allow_rating', fixed='$news_fixed', tags='" . $_POST['tags'] . "' WHERE id='$id'" ); + + // Облако тегов + if( $_POST['tags'] != $row['tags'] or $approve ) {$db->query( "DELETE FROM " . PREFIX . "_tags WHERE news_id = '{$row['id']}'" ); + if( $_POST['tags'] != "" and $approve ) { + $tags = array (); + $_POST['tags'] = explode( ",", $_POST['tags'] ); + foreach ( $_POST['tags'] as $value ) {$tags[] = "('" . $row['id'] . "', '" . trim( $value ) . "')";} + $tags = implode( ", ", $tags ); + $db->query( "INSERT INTO " . PREFIX . "_tags (news_id, tag) VALUES " . $tags ); + }}} else { + $added_time = time() + ($config['date_adjust'] * 60); + $thistime = date( "Y-m-d H:i:s", $added_time ); + $db->query( "INSERT INTO " . PREFIX . "_post (date, autor, short_story, full_story, title, keywords, category, alt_name, allow_comm, approve, allow_main, fixed, allow_rate, tags) values ('$thistime', '$member_id[name]', '$short_story', '$full_story', '$title', '', '$category_list', '$alt_name', '$allow_comm', '$approve', '$allow_main', '$news_fixed', '$allow_rating', '" . $_POST['tags'] . "')" ); + $row['id'] = $db->insert_id(); + $member_id['name'] = $db->safesql($member_id['name']); + +//Торренты +if (isset($_FILES['tor_add']) && $_FILES['tor_add']!='') {include_once SYSTEM_DIR . '/modules/torrent/upload.php';} +//!Торренты + + $db->query( "UPDATE " . PREFIX . "_images set news_id='{$row['id']}' where author = '{$member_id['name']}' AND news_id = '0'" ); + $db->query( "UPDATE " . PREFIX . "_files set news_id='{$row['id']}' where author = '{$member_id['name']}' AND news_id = '0'" ); + $db->query( "UPDATE " . PREFIX . "_torrents set news_id='{$row['id']}' where author = '{$member_id['name']}' AND news_id = '0'" ); + $db->query( "UPDATE " . USERPREFIX . "_users set news_num=news_num+1 where user_id='$member_id[user_id]'" ); + + $row = $row['id']; + include_once SYSTEM_DIR . '/inc/newsimg/doaddimg.php'; + + if( $_POST['tags'] != "" and $approve ) { + $tags = array (); + $_POST['tags'] = explode( ",", $_POST['tags'] ); + foreach ( $_POST['tags'] as $value ) {$tags[] = "('" . $row['id'] . "', '" . trim( $value ) . "')";} + $tags = implode( ", ", $tags ); + $db->query( "INSERT INTO " . PREFIX . "_tags (news_id, tag) VALUES " . $tags ); + }} + msgbox( $lang['add_ok'], "{$msg} $lang[add_noch] $lang[add_or] $lang[all_prev]" ); + if( $approve ) $cache->clear(); + } + } elseif( $is_logged and $user_group[$member_id['user_group']]['allow_adds'] ) { + $tpl->load_template( 'addnews.tpl' ); + $addtype = "addnews"; + include_once SYSTEM_DIR . '/modules/bbcode.php'; + + $tpl->set( '{shortarea}', '' ); + $tpl->set( '{fullarea}', '' ); + + $id = (isset( $_REQUEST['id'] )) ? intval( $_REQUEST['id'] ) : 0; + $found = false; + + if( $id ) {$row = $db->super_query( "SELECT * FROM " . PREFIX . "_post where id = '$id' and approve = '0'" ); if( $id == $row['id'] and ($member_id['name'] == $row['autor'] or $user_group[$member_id['user_group']]['allow_all_edit']) ) $found = true; else $found = false;} + + if( $found ) { + + $cat_list = explode( ',', $row['category'] ); + $categories_list = CategoryNewsSelection( $cat_list, 0 ); + $tpl->set( '{title}', $parse->decodeBBCodes( $row['title'], false ) ); + $tpl->set( '{alt-name}', $row['alt_name'] ); + + $row['short_story'] = $parse->decodeBBCodes( $row['short_story'], false ); + $row['full_story'] = $parse->decodeBBCodes( $row['full_story'], false ); + + $tpl->set( '{short-story}', $row['short_story'] ); + $tpl->set( '{full-story}', $row['full_story'] ); + $tpl->set( '{tags}', $row['tags'] ); + + } else { +// добавлено от 27.02.2011 + $categories_list = CategoryNewsSelectioh(); +// добавлено от 27.02.2011 +// $categories_list = CategoryNewsSelection( 0, 0 ); + $tpl->set( '{title}', '' ); + $tpl->set( '{alt-name}', '' ); + $tpl->set( '{short-story}', '' ); + $tpl->set( '{full-story}', '' ); + $tpl->set( '{tags}', '' ); + + } + + +// $cats = " + +HTML; +// добавлено от 27.02.2011 + $cats .= $categories_list; + $cats .= ""; + + $tpl->set( '{bbcode}', $bb_code ); + $tpl->set( '{category}', $cats ); + + include_once SYSTEM_DIR . '/modules/addimg.php'; + if( $user_group[$member_id['user_group']]['moderation'] ) { + $admintag = ""; + if( $user_group[$member_id['user_group']]['allow_main'] ) $admintag .= "    "; + $admintag .= "

    "; + if( $user_group[$member_id['user_group']]['allow_fixed'] ) $admintag .= "
    "; + $tpl->set( '{admintag}', $admintag );} else $tpl->set( '{admintag}', '' ); + $torpole = "Загрузить Торрент:"; + $tpl->set('{toradd}', $torpole); + + if( $is_logged and $member_id['user_group'] < 3 ) { + $tpl->set( '[urltag]', '' ); + $tpl->set( '[/urltag]', '' );} else $tpl->set_block( "'\\[urltag\\].*?\\[/urltag\\]'si", "" ); + + $script = " + +HTML; + + $script .= "
    "; + $tpl->copy_template = $categoryfilter . $script . $tpl->copy_template . "
    "; + + $tpl->compile( 'content' ); + $tpl->clear(); + + } else + msgbox( $lang['all_info'], "$lang[add_err_8]
    $lang[all_prev]" ); +} +?> \ No newline at end of file diff --git a/system/modules/antibot.php b/system/modules/antibot.php new file mode 100644 index 0000000..a1f518f --- /dev/null +++ b/system/modules/antibot.php @@ -0,0 +1,235 @@ +length_min, $this->length_max ); + $this->length = $length; + $this->keystring = ''; + for ($i = 0; $i < $length ; $i++) { + // в цикле добавляем к строке по 1 случайному символу + $this->keystring .= $this->allowed_symbols{ mt_rand( 0, strlen( $this->allowed_symbols ) -1 ) }; + }} + + function genimage() { + $foreground_color = array( 100, 130, 200 ); + $background_color = array( 255, 255, 255 ); + $fonts = array(); + $fontsdir_absolute = dirname( __FILE__ ).'/'.$this->fontsdir; // путь к папке с шрифтами + if ($handle = opendir( $fontsdir_absolute )) { // создаем массив с полными путями к изображениям с шрифтами + while (false !== ($file = readdir( $handle ))) { + if (preg_match( '/\.png$/i', $file )) { + $fonts[] = $fontsdir_absolute.'/'.$file; + }} + closedir( $handle ); + } + + $alphabet_length = strlen( $this->alphabet ); + + while (true) { + $font_file = $fonts[mt_rand( 0, count( $fonts ) - 1 )]; + $font = imagecreatefrompng( $font_file ); + $black = imagecolorallocate( $font, 0, 0, 0 ); + $fontfile_width = imagesx( $font ); + $fontfile_height = imagesy( $font ) - 1; + $font_metrics = array(); + $symbol = 0; + $reading_symbol = false; + + // загрузка шрифта + for ($i = 0; $i < $fontfile_width && $symbol < $alphabet_length; $i++) { + $transparent = (imagecolorat( $font, $i, 0 ) >> 24) == 127; + + if (!$reading_symbol && !$transparent) { + $font_metrics[$this->alphabet{$symbol}] = array( 'start' => $i ); + $reading_symbol = true; + continue; + } + + if ($reading_symbol && $transparent) { + $font_metrics[$this->alphabet{$symbol}]['end'] = $i; + $reading_symbol = false; + $symbol++; + continue; + } + } + + $img = imagecreatetruecolor( $this->width, $this->height ); + + $white = imagecolorallocate( $img, 100, 130, 200 ); + $black = imagecolorallocate( $img, 100, 130, 200 ); + + imagefilledrectangle( $img, 0, 0, $this->width - 1, $this->height - 1, $white ); + + // нанесение текста + $x = 1; + $shift = 0; + + for ($i = 0; $i < $this->length; $i++) { + $m = $font_metrics[$this->keystring{$i}]; + $y = mt_rand( -$this->fluctuation_amplitude, $this->fluctuation_amplitude ) + ($this->height - $fontfile_height) / 2 + 2; + + if ($this->no_spaces) { + $shift = 0; + if ($i > 0) { + $shift = 1000; + for ($sy = 1; $sy < $fontfile_height - 15; $sy += 2) { + for ($sx = $m['start'] - 1; $sx < $m['end']; $sx++) { + $rgb = imagecolorat( $font, $sx, $sy ); + $opacity = $rgb >> 24; + if ($opacity < 127) { + $left = $sx - $m['start'] + $x; + $py = $sy + $y; + for ($px = min( $left, $this->width - 1 ); $px > $left - 20 && $px >= 0; $px--) { + $color = imagecolorat( $img, $px, $py ) & 0xff; + if ($color + $opacity < 190) { + if ($shift > $left-$px) { + $shift = $left - $px; + } + break; + } + } + break; + } + } + } + } + } else {$shift = 1;} + imagecopy( $img, $font, $x - $shift, $y, $m['start'], 1, $m['end'] - $m['start'], $fontfile_height ); + $x += $m['end'] - $m['start'] - $shift; + } + if ($x < $this->width - 10) break; // fit in canvas + } + $center = $x/2; + + $img2=imagecreatetruecolor($this->width, $this->height); + $foreground=imagecolorallocate($img2, $foreground_color[0], $foreground_color[1], $foreground_color[2]); + $background=imagecolorallocate($img2, $background_color[0], $background_color[1], $background_color[2]); + imagefilledrectangle($img2, 0, $this->height, $this->width, $this->height+12, $foreground); + + // периоды + $rand1 = 0; + $rand2 = 0; + $rand3 = 0; + $rand4 = 0; + // фазы + $rand5 = 0; + $rand6 = 0; + $rand7 = 0; + $rand8 = 0; + // амплитуды + $rand9 = 0; + $rand10 = 0; + + //волновое искажение + for ($x = 0; $x < $this->width; $x++) { + for ($y = 0; $y < $this->height; $y++) { + $sx = $x + (sin( $x * $rand1 + $rand5 ) + sin( $y * $rand3 + $rand6 )) * $rand9 - $this->width / 2 + $center + 1; + $sy = $y + (sin( $x * $rand2 + $rand7 ) + sin( $y * $rand4 + $rand8 )) * $rand10; + + if ($sx < 0 || $sy < 0 || $sx >= $this->width - 1 || $sy >= $this->height - 1) { + $color = 200; + $color_x = 200; + $color_y = 200; + $color_xy = 200; + } else { + $color = imagecolorat( $img, $sx, $sy ) & 0xFF; + $color_x = imagecolorat( $img, $sx + 1, $sy ) & 0xFF; + $color_y = imagecolorat( $img, $sx, $sy + 1 ) & 0xFF; + $color_xy = imagecolorat( $img, $sx + 1, $sy + 1 ) & 0xFF; + } + + if ($color == 0 && $color_x == 0 && $color_y == 0 && $color_xy == 0) { + $newred = $foreground_color[0]; + $newgreen = $foreground_color[1]; + $newblue = $foreground_color[2]; + } else if ($color == 255 && $color_x == 255 && $color_y == 255 && $color_xy == 255) { + $newred = $background_color[0]; + $newgreen = $background_color[1]; + $newblue = $background_color[2]; + } else { + $frsx = $sx - floor( $sx ); + $frsy = $sy - floor( $sy ); + $frsx1 = 1 - $frsx; + $frsy1 = 1 - $frsy; + $newcolor = ( + $color * $frsx1 * $frsy1 + + $color_x * $frsx * $frsy1 + + $color_y * $frsx1 * $frsy + + $color_xy * $frsx * $frsy); + + if ($newcolor > 255) $newcolor = 255; + $newcolor = $newcolor / 255; + $newcolor0 = 1 - $newcolor; + + $newred = $newcolor0 * $foreground_color[0] + $newcolor * $background_color[0]; + $newgreen = $newcolor0 * $foreground_color[1] + $newcolor * $background_color[1]; + $newblue = $newcolor0 * $foreground_color[2] + $newcolor * $background_color[2]; + } + imagesetpixel( $img2, $x, $y, imagecolorallocate( $img2, $newred, $newgreen, $newblue ) ); + }} + + # Рамка + imageline( $img2, 0, 0, $this->width, 0, $foreground ); + imageline( $img2, 0, 0, 0, $this->height, $foreground ); + + imageline( $img2, 0, $this->height-1, $this->width, $this->height-1, $foreground ); + imageline( $img2, $this->width-1, 0, $this->width-1, $this->height, $foreground); + + header( "Expires: Tue, 11 Jun 1985 05:00:00 GMT" ); + header( "Last-Modified: " . gmdate( "D, d M Y H:i:s" ) . " GMT" ); + header( "Cache-Control: no-store, no-cache, must-revalidate" ); + header( "Cache-Control: post-check=0, pre-check=0", false ); + header( "Pragma: no-cache" ); + + if (function_exists ('imagepng')) { + header ('Content-type: image/png'); + imagepng ($img2, null); + } elseif (function_exists ('imagegif')) { + header ('Content-type: image/gif'); + imagegif ($img2, null); + } elseif (function_exists('imagejpeg')) { + header( "Content-Type: image/jpeg" ); + imagejpeg($img2, null, $this->jpeg_quality); + } + + imagedestroy($img2); + + } +} + +session_start(); +$im = new genrandomimage(); +$im->genstring(); +$_SESSION['sec_code_session'] = $im->keystring; +$im->genimage(); +?> \ No newline at end of file diff --git a/system/modules/banned.php b/system/modules/banned.php new file mode 100644 index 0000000..99183f9 --- /dev/null +++ b/system/modules/banned.php @@ -0,0 +1,56 @@ +query( "SELECT users_id FROM " . USERPREFIX . "_banned WHERE days != '0' AND date < '$this_time'" ); + +$del = false; +$blocked = false; + +while ( $row = $db->get_row( $sel_banned ) ) { + $del = true; + + if( $row['users_id'] ){ + if ($repa_cf['repa_ban']){ + $db->query( "UPDATE " . USERPREFIX . "_users SET banned='', repa='0' WHERE user_id = '{$row['users_id']}'" ); + $row2 = $db->super_query("SELECT user_id, name, repa FROM " . USERPREFIX . "_users where user_id = '{$row['users_id']}'"); + $db->query( "DELETE FROM " . USERPREFIX . "_reputation WHERE komu = '$row2[name]'" ); + } else + $db->query( "UPDATE " . USERPREFIX . "_users SET banned='' WHERE user_id = '{$row['users_id']}'" ); + } +} +$db->free( $sel_banned ); + +if( $del ) { + $db->query( "DELETE FROM " . USERPREFIX . "_banned WHERE days != '0' AND date < '$this_time'" ); + $cache->delete('banned.php' ); +} + +if( $blockip ) { + $blocked = true; + if( $banned_info['ip'][$blockip]['date'] ) { + if( $banned_info['ip'][$blockip]['date'] > $this_time ) $endban = langdate( "j M Y H:i", $banned_info['ip'][$blockip]['date'] ); + else $blocked = false; + } else $endban = $lang['banned_info']; + $descr = $lang['ip_block'] . "

    " . $banned_info['ip'][$blockip]['descr']; +} elseif( $banned_info['users_id'][$member_id['user_id']]['users_id'] ) { + $blocked = true; + if( $banned_info['users_id'][$member_id['user_id']]['date'] ) { + if( $banned_info['users_id'][$member_id['user_id']]['date'] > $this_time ) $endban = langdate( "j M Y H:i", $banned_info['users_id'][$member_id['user_id']]['date'] ); + else $blocked = false; + } else $endban = $lang['banned_info']; + $descr = $banned_info['users_id'][$member_id['user_id']]['descr']; +} + +if( $blocked ) { + $tpl->dir = ROOT_DIR . '/templates'; + + $tpl->load_template( 'banned.tpl' ); + $tpl->set('{title}', $config['short_title']); + $tpl->set( '{description}', $descr ); + $tpl->set( '{end}', $endban ); + $tpl->compile( 'content' ); + echo $tpl->result['content']; + die(); +} +?> \ No newline at end of file diff --git a/system/modules/bbcode.php b/system/modules/bbcode.php new file mode 100644 index 0000000..6cbfdb4 --- /dev/null +++ b/system/modules/bbcode.php @@ -0,0 +1,94 @@ +\"\"
    "; + }else {$image_upload = "";} + + $add_id = (isset($_REQUEST['id'])) ? intval($_REQUEST['id']) : ''; + +$code = << +
    +
    +
    +
    +
    +
    +{$image_upload} +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
      
    +
    +
    + + +HTML; + +} +else { + $startform = "comments"; + $addform = "document.getElementById( 'dle-comments-form' )"; + $add_id = false; + +$code = <<{text} +HTML; +} + +$bb_code = << + + +{$code} +HTML; +?> \ No newline at end of file diff --git a/system/modules/chat/addmess.php b/system/modules/chat/addmess.php new file mode 100644 index 0000000..f8cd744 --- /dev/null +++ b/system/modules/chat/addmess.php @@ -0,0 +1,45 @@ +safe_mode = true; +$_TIME = time()+($config['date_adjust']*60); + + if ($is_logged) {$name = $db->safesql($member_id['name']);} else {$CN_HALT = TRUE;} + + $_IP = $db->safesql($_SERVER['REMOTE_ADDR']); + $time = date ("Y-m-d H:i:s", $_TIME); + + $message = $db->safesql($parse->BB_Parse($parse->process($mcadd['message'])), false); + + if( strlen($message) > 3000) $CN_HALT = TRUE; + if ($message =='' OR $member_id['banned'] == "yes") $CN_HALT = TRUE; + + $message = preg_replace("#(^|\s|>)((http|https|ftp)://\w+[^\s\[\]\<]+)#i", '\\1URL', $message); + +//* Автоперенос длинных слов + if(intval($chatconfig['auto_wrap'])){ + $message = preg_split('((>)|(<))', $message, -1, PREG_SPLIT_DELIM_CAPTURE); + $n = count($message); + + for ($i = 0; $i < $n; $i++) { + if ($message[$i] == "<") { + $i++; continue; + } + $message[$i] = preg_replace("#([^\s<>'\"/\.\\-\?&\n\r\%]{".intval($chatconfig['auto_wrap'])."})#i", "\\1
    ", $message[$i]); + } + $message = join("", $message); + } + $data['skin'] = strtolower($_REQUEST['skin']); +// Добавление + if ($CN_HALT) { + } else { + $db->query("INSERT INTO ".PREFIX."_chat (name, message, date, ip, `mgroup`, user_id) VALUES ('$name', '$message', '$time', '$_IP', '$member_id[user_group]', '$member_id[user_id]')"); + $cache->del('minichat'); +} +?> diff --git a/system/modules/chat/ajax.js b/system/modules/chat/ajax.js new file mode 100644 index 0000000..83a1878 --- /dev/null +++ b/system/modules/chat/ajax.js @@ -0,0 +1,280 @@ +var DMC_selField = "message"; +var DMC_fombj = document.getElementById( 'chat-form' ); + +function Chat_UserMenu(a, b, c, d, e, f) { + var g = new Array(); + g[0] = 'Ответить'; + g[1] = '' + menu_profile + ''; + g[2] = '' + menu_send + ''; + if (c == '1' || c == '2') { + g[3] = 'Удалить' + } + return g +} +function Chat_GastMenu(a, b, c, d, e) { + var f = new Array(); + f[0] = 'Ответить'; + f[1] = '' + menu_send + ''; + if (b == '1' || b == '2') { + f[2] = 'Удалить' + } + return f +} + +function Chat_MessDel(b) { + $.post(dle_root + "system/ajax/chat.php", { mdelete: b, refresh: 1, skin: dle_skin}, function(data){ + $("#chat").html(data); + }); +} +function Chat_Refresh() { + $.post(dle_root + "system/ajax/chat.php", { skin: dle_skin}, function(data){ + $("#chat").html(data); + }); +} +function Chat_QuoteName(a) { + document.getElementById('message').value += "[b]" + a + "[/b]:"; + $("#message").focus() +} +function Chat_AddSmile(a, b, c) { + document.getElementById(b).value += ":" + a + ":"; + $("#" + c).fadeOut("slow"); + $("#" + b).focus() +} +function Chat_Display(a, b) { + if ($("#" + a).css("display") === "none") { + $("#" + a).show(b) + } else { + $("#" + a).hide(b) + } +} +function AWclear(a, b) { + var c = a.value; + if (c == b) { + a.value = "" + } + $(a).attr('onblur', "if(this.value=='')this.value='" + b + "';") +} + +function SendMessage(){ + if($.trim(document.chat_form.message.value) == ''){ + alert('Введите сообщение!'); + return false; + }; + + var message = document.getElementById('message').value; + + $.post(dle_root + "system/ajax/chat.php", { message: message, skin: dle_skin}, function(data){ + $("#chat").html(data); + $('#message').attr('value', ''); + }); + return false; +}; + +//BBCOdes + +var uagent = navigator.userAgent.toLowerCase(); +var is_safari = ( (uagent.indexOf('safari') != -1) || (navigator.vendor == "Apple Computer, Inc.") ); +var is_ie = ( (uagent.indexOf('msie') != -1) && (!is_opera) && (!is_safari) && (!is_webtv) ); +var is_ie4 = ( (is_ie) && (uagent.indexOf("msie 4.") != -1) ); +var is_moz = (navigator.product == 'Gecko'); +var is_ns = ( (uagent.indexOf('compatible') == -1) && (uagent.indexOf('mozilla') != -1) && (!is_opera) && (!is_webtv) && (!is_safari) ); +var is_ns4 = ( (is_ns) && (parseInt(navigator.appVersion) == 4) ); +var is_opera = (uagent.indexOf('opera') != -1); +var is_kon = (uagent.indexOf('konqueror') != -1); +var is_webtv = (uagent.indexOf('webtv') != -1); + +var is_win = ( (uagent.indexOf("win") != -1) || (uagent.indexOf("16bit") !=- 1) ); +var is_mac = ( (uagent.indexOf("mac") != -1) || (navigator.vendor == "Apple Computer, Inc.") ); +var ua_vers = parseInt(navigator.appVersion); + +var b_open = 0; +var i_open = 0; +var u_open = 0; +var s_open = 0; +var quote_open = 0; +var code_open = 0; +var sql_open = 0; +var html_open = 0; +var left_open = 0; +var center_open = 0; +var right_open = 0; +var hide_open = 0; +var color_open = 0; +var ie_range_cache = ''; +var DMC_bbtags = new Array(); + +function DMC_stacksize(thearray) +{ + for (i = 0; i < thearray.length; i++ ) + { + if ( (thearray[i] == "") || (thearray[i] == null) || (thearray == 'undefined') ) + { + return i; + } + } + + return thearray.length; +}; + +function cstat() +{ + var c = DMC_stacksize(DMC_bbtags); + + if ( (c < 1) || (c == null) ) { + c = 0; + } + + if ( ! DMC_bbtags[0] ) { + c = 0; + } + + +}; + +function DMC_simpletag(thetag) +{ + var tagOpen = eval(thetag + "_open"); + + + if (tagOpen == 0) + { + if(DMC_doInsert("[" + thetag + "]", "[/" + thetag + "]", true)) + { + eval(thetag + "_open = 1"); + document.getElementById( 'b_' + thetag ).className = 'editor_buttoncl'; + + pushstack(DMC_bbtags, thetag); + cstat(); + + } + } + else + { + lastindex = 0; + + for (i = 0 ; i < DMC_bbtags.length; i++ ) + { + if ( DMC_bbtags[i] == thetag ) + { + lastindex = i; + } + } + + while (DMC_bbtags[lastindex]) + { + tagRemove = popstack(DMC_bbtags); + DMC_doInsert("[/" + tagRemove + "]", "", false); + + + if ( (tagRemove != 'font') && (tagRemove != 'size') ) + { + eval(tagRemove + "_open = 0"); + document.getElementById( 'b_' + tagRemove ).className = 'editor_button'; + } + } + + cstat(); + } + +}; + + + +function DMC_doInsert(ibTag, ibClsTag, isSingle) +{ + var isClose = false; + var obj_ta = eval('DMC_fombj.'+ DMC_selField); + + if ( (ua_vers >= 4) && is_ie && is_win) + { + if (obj_ta.isTextEdit) + { + obj_ta.focus(); + var sel = document.selection; + var rng = ie_range_cache ? ie_range_cache : sel.createRange(); + rng.colapse; + if((sel.type == "Text" || sel.type == "None") && rng != null) + { + if(ibClsTag != "" && rng.text.length > 0) + ibTag += rng.text + ibClsTag; + else if(isSingle) + ibTag += rng.text + ibClsTag; + + rng.text = ibTag; + } + } + else + { + obj_ta.value += ibTag + ibClsTag; + + } + rng.select(); + ie_range_cache = null; + + } + else if ( obj_ta.selectionEnd ) + { + var ss = obj_ta.selectionStart; + var st = obj_ta.scrollTop; + var es = obj_ta.selectionEnd; + + if (es <= 2) + { + es = obj_ta.textLength; + } + + var start = (obj_ta.value).substring(0, ss); + var middle = (obj_ta.value).substring(ss, es); + var end = (obj_ta.value).substring(es, obj_ta.textLength); + + if (obj_ta.selectionEnd - obj_ta.selectionStart > 0) + { + middle = ibTag + middle + ibClsTag; + } + else + { + middle = ibTag + middle + ibClsTag; + } + + obj_ta.value = start + middle + end; + + var cpos = ss + (middle.length); + + obj_ta.selectionStart = cpos; + obj_ta.selectionEnd = cpos; + obj_ta.scrollTop = st; + + + } + else + { + obj_ta.value += ibTag + ibClsTag; + } + + obj_ta.focus(); + return isClose; +}; + +function getOffsetTop(obj) +{ + var top = obj.offsetTop; + + while( (obj = obj.offsetParent) != null ) + { + top += obj.offsetTop; + } + + return top; +}; + +function getOffsetLeft(obj) +{ + var top = obj.offsetLeft; + + while( (obj = obj.offsetParent) != null ) + { + top += obj.offsetLeft; + } + + return top; +}; diff --git a/system/modules/chat/block.php b/system/modules/chat/block.php new file mode 100644 index 0000000..45994ee --- /dev/null +++ b/system/modules/chat/block.php @@ -0,0 +1,38 @@ +load_template('chat/block.tpl'); +$tpl->copy_template .= ' + +'; + + if ($is_logged){ + $tpl->set('[isloged]',""); + $tpl->set('[/isloged]',""); + $tpl->set_block("'\\[notloged\\].*?\\[/notloged\\]'si",""); + } else { + $tpl->set_block("'\\[isloged\\].*?\\[/isloged\\]'si",""); + $tpl->set('[notloged]',""); + $tpl->set('[/notloged]',""); + } + + $tpl->set('[historylink]',""); + $tpl->set('[/historylink]',""); + +$tpl->set('{chatmsg}', $chat->GetContent($chatconfig, $member_id, $config)); + +$tpl->copy_template = "
    ".$tpl->copy_template." +
    "; + +$tpl->compile('minichat'); +$tpl->clear(); + +return $tpl->result['minichat']; +?> \ No newline at end of file diff --git a/system/modules/chat/chat.class.php b/system/modules/chat/chat.class.php new file mode 100644 index 0000000..0266b92 --- /dev/null +++ b/system/modules/chat/chat.class.php @@ -0,0 +1,65 @@ +open('minichat')) $flag = true; + elseif(!$moder) $flag = false; + + if ($flag){ + $html = ""; + require_once SYSTEM_DIR.'/classes/parse.class.php'; + $parse = new ParseFilter(); + $parse->safe_mode = true; + + $result = $this->query("SELECT id, name as gast_name, message, date, ip, user_id, mgroup FROM ".PREFIX."_chat m ORDER BY date DESC LIMIT 0,".$chatconfig['limit'].""); + + if (!$moder){$m_group = 4;} + + $PHP_SELF = $config['http_home_url']; + while ($row = $this->get_row($result)){ + + $lang['mchat_mess'] = "Сообщение"; + $row['date'] = strtotime($row['date']); + $row['name'] = stripslashes($row['gast_name']); + + $go_page = "href=\"".$config['http_home_url']."user/".urlencode($row['name'])."/\""; + + $go_page .= "onClick=\"return dropdownmenu(this, event, Chat_UserMenu('".htmlspecialchars($go_page)."', '".$row['user_id']."', ".$m_group.", '".$row['id']."', '".$row['name']."', '".$lang['mchat_mess']."'), '170px')\""; + + $color = $user_group[$row['mgroup']]['colour']; + + $author = "".$row['name'].""; + + $date = mcdate($chatconfig['timestamp'],$row['date']); + + $message = stripslashes($row['message']); + + $html .= "
    ".$author."
    ".$date."

    ".$message."
    "; + } + + $this->free(); + if (!$moder) $cache->save('minichat', $html); + } + else $html = $cache->open('minichat'); + return $html; + } + } +?> diff --git a/system/modules/chat/modules.php b/system/modules/chat/modules.php new file mode 100644 index 0000000..8a6a7ed --- /dev/null +++ b/system/modules/chat/modules.php @@ -0,0 +1,77 @@ +safe_mode = true; + +include(SYSTEM_DIR.'/data/chat.config.php'); +if ($action == "mess_del") { +$db->query("DELETE FROM " . PREFIX . "_chat WHERE id = '$id'"); +msgbox ($lang['all_info'], "Выбранное сообщение было успешно удалено. Вернуться назад..."); +} else { + +$tpl->load_template('chat/message.tpl'); +$limit = intval($chatconfig['messlimit']); +$sql_count = $db->super_query("SELECT COUNT(*) as count FROM " . PREFIX . "_chat"); +$count_all = $sql_count['count']; + + $page = intval( $_REQUEST['cstart'] ); + $total = intval( ( ( $count_all - 1 ) / $limit ) + 1 ); + if( $page <= 0 ) $page = 1; + if( $page > $total ) $page = $total; + $start = $page * $limit - $limit; + $i = $start; $s = 0; + +$result = $db->query("SELECT id, name as gast_name, message, date, ip, user_id, mgroup FROM " . PREFIX . "_chat ORDER BY date DESC LIMIT $start,".$limit); + +while($row = $db->get_array($result)){ $i++;$s++; +$row['date'] = strtotime($row['date']); + +$row['name'] = stripslashes($row['gast_name']); + + $tpl->set('{author}', "".$row['name'].""); + + if ($is_logged AND $member_id['user_group'] == '1') + $tpl->set('{ip}', "IP: {$row['ip']} ::"); + else + $tpl->set('{ip}', ''); + if ($config['comm_msort'] == "ASC") + $tpl->set('{mess-id}', $cstart+$i); + else + $tpl->set('{mess-id}', $comments_num-$cstart-$i+1); + +if (($is_logged AND ($member_id['user_id'] == $row['userid'] AND ($row['is_reg'] == 1) AND $user_group[$member_id['user_group']]['allow_editc'])) OR $user_group[$member_id['user_group']]['edit_allc']){ + $tpl->set('[mes-edit]',""); + $tpl->set('[/mes-edit]',""); + } else $tpl->set_block("'\\[mes-edit\\](.*?)\\[/mes-edit\\]'si",""); + +if ($is_logged AND (($member_id['user_id'] == $row['userid'] AND ($row['is_reg'] == 1) AND $user_group[$member_id['user_group']]['allow_delc'] AND ($row['date'] == $date_max['MAX(date)'])) OR $member_id['user_group'] == '1' OR $user_group[$member_id['user_group']]['del_allc'])){ + $tpl->set('[mes-del]',""); + $tpl->set('[/mes-del]',""); + } else $tpl->set_block("'\\[mes-del\\](.*?)\\[/mes-del\\]'si",""); + + $message = stripslashes($row['message']); + + if (date(Ymd, $row['date']) == date(Ymd, $_TIME)) { + + $tpl->set('{date}', $lang['time_heute'].langdate(", H:i", $row['date'])); + + } elseif (date(Ymd, $row['date']) == date(Ymd, ($_TIME - 86400))) { + + $tpl->set('{date}', $lang['time_gestern'].langdate(", H:i", $row['date'])); + + } else { + + $tpl->set('{date}', langdate($config['timestamp_comment'], $row['date'])); + + } +$tpl->set('{message}', $message); +$tpl->compile('content'); +} + +$nav = "/chat/history/page/{page}/"; +CreateNavigation( $nav, $page, $total ); +}; + +?> diff --git a/system/modules/comments-last.php b/system/modules/comments-last.php new file mode 100644 index 0000000..34973f2 --- /dev/null +++ b/system/modules/comments-last.php @@ -0,0 +1,37 @@ +open( "comments-last", $config['skin'] ); +if( ! $commentslast ) { + + $sql = $db->query( "SELECT + comments.id AS comment_id, comments.post_id, comments.autor, post.title, post.alt_name, post.comm_num, comments.date + FROM " . PREFIX . "_post AS post + RIGHT JOIN + (SELECT * + FROM " . PREFIX . "_comments AS c + WHERE 1=1 + ORDER BY c.date DESC) AS comments + ON post.id = comments.post_id AND post.approve=1 + GROUP BY post.id ORDER BY comments.date DESC LIMIT 0, 15"); + + while( $row = $db->get_row() ) { + if( strlen( $row['autor']) > 10 ) + $user = substr( $row['autor'], 0, 10 ); + else $user = $row['autor']; + if( strlen( $row['title']) > 15 ) + $title = substr( $row['title'], 0, 15 ) . "..."; + else $title = $row['title']; + + $autor = "" . $user . ""; + $full_link = $config['http_home_url'] . $row['post_id'] . "-" . $row['alt_name'] . ".html"; + $post = "" . stripslashes( $title ) . "" ; + + $lcomm .= "
  • {$row['comm_num']}{$autor} - {$post}
  • "; + } + $commentslast= "
      ".$lcomm."
    "; + + $db->free(); + $cache->save( "comments-last", $commentslast, $config['skin'] ); +} +?> \ No newline at end of file diff --git a/system/modules/favorites.php b/system/modules/favorites.php new file mode 100644 index 0000000..3b0e93b --- /dev/null +++ b/system/modules/favorites.php @@ -0,0 +1,75 @@ +:]]' AND "; + } else {$stop_list = "category IN ('" . implode( "','", $allow_list ) . "') AND ";} + } else + $stop_list = ""; +if( $user_group[$member_id['user_group']]['allow_short'] ) $stop_list = ""; + +if (isset ( $_SESSION['dle_sort_favorites'] )) $news_sort_by = $_SESSION['dle_sort_favorites']; else $news_sort_by = $config['news_sort']; +if (isset ( $_SESSION['dle_direction_favorites'] )) $news_direction_by = $_SESSION['dle_direction_favorites']; else $news_direction_by = $config['news_msort']; + +$sql_count = "SELECT COUNT(*) as count FROM " . PREFIX . "_post where {$stop_list}id in {$favorites}"; +$temp = $db->super_query($sql_count); +$posts = $temp['count']; + +if($posts){ + $page = intval( $cstart ); + $total = intval( ( ( $posts - 1 ) / $limit ) + 1 ); + if( $page <= 0 ) $page = 1; + if( $page > $total ) $page = $total; + $start = $page * $limit - $limit; + $i = $start; + + $sql_select = "SELECT id, autor, date, title, category, alt_name, comm_num, rating, news_read FROM " . PREFIX . "_post where {$stop_list}id in $favorites ORDER BY " . $news_sort_by . " " . $news_direction_by . " LIMIT " . $start . "," . $limit; + $result = $db->query($sql_select); + $tpl->load_template('fav/news.tpl'); + + while($row = $db->get_row($result)){ + $i++; + if (strlen($row['title']) > $word) $title = stripcslashes(substr ($row['title'], 0, $word))." ..."; else $title = stripcslashes($row['title']); + $fav_arr = explode( ',', $member_id['favorites'] ); + if( ! in_array( $row['id'], $fav_arr ) or $config['allow_cache'] == "yes" ) $tpl->set( '{favorites}', "\"\"" ); + else $tpl->set( '{favorites}', "\"\"" ); + + $set = array( + '{category}' => "".$cat_info[$row['category']]['name']."", + '{date}' => date("d.m.Y",strtotime($row['date'])), + '{title}' => $title, + '{link}' => $config['http_home_url'].$row['id']."-".$row['alt_name'].".html", + '{id}' => $row['id'], + ); + + $tpl->set('', $set); + $tpl->compile('fileslist'); + } + $list = $tpl->result['fileslist']; + $tpl->load_template('fav/favorites.tpl'); + + $tpl->set('{list}', $list); + $tpl->set ( '{sort}', news_sort ( $do ) ); + + $tpl->compile('content'); + $tpl->clear(); + + $nav = "/favorites/page/{page}/"; + CreateNavigation( $nav, $page, $total ); +} else { + $tpl->load_template('info.tpl'); + $tpl->set('{error}', "К сожалению вами не было добавлено ни одного материала в закладки."); + $tpl->set('{title}', "Закладки"); + $tpl->compile('content'); + $tpl->clear(); +} +?> \ No newline at end of file diff --git a/system/modules/feedback.php b/system/modules/feedback.php new file mode 100644 index 0000000..f19fadb --- /dev/null +++ b/system/modules/feedback.php @@ -0,0 +1,124 @@ +safesql( strip_tags( $_POST['name'] ) ); + $not_allow_symbol = array ("\x22", "\x60", "\t", '\n', '\r', "\n", "\r", '\\', ",", "/", "¬", "#", ";", ":", "~", "[", "]", "{", "}", ")", "(", "*", "^", "%", "$", "<", ">", "?", "!", '"', "'" ); + $email = $db->safesql(trim( str_replace( $not_allow_symbol, '', strip_tags( stripslashes( $_POST['email'] ) ) ) ) ); + + $db->query( "SELECT name from " . USERPREFIX . "_users where LOWER(name) = '" . strtolower( $name ) . "' OR LOWER(email) = '" . strtolower( $email ) . "'" ); + + if( $db->num_rows() > 0 ) {$stop = $lang['news_err_7'];} + + $name = strip_tags( stripslashes( $_POST['name'] ) ); + } + + $subject = strip_tags( stripslashes( $_POST['subject'] ) ); + $message = stripslashes( $_POST['message'] ); + $recip = intval( $_POST['recip'] ); + + if( !$user_group[$member_id['user_group']]['allow_feed'] ) {$recipient = $db->super_query( "SELECT name, email, fullname FROM " . USERPREFIX . "_users WHERE user_id='" . $recip . "' AND user_group = '1'" ); + } else {$recipient = $db->super_query( "SELECT name, email, fullname FROM " . USERPREFIX . "_users WHERE user_id='" . $recip . "' AND allow_mail = '1'" );} + + if( empty( $recipient['fullname'] ) ) $recipient['fullname'] = $recipient['name']; + if (!$recipient['name']) $stop .= $lang['feed_err_8']; + + if( empty( $name ) OR strlen( $name ) > 100 ) {$stop .= $lang['feed_err_1'];} + if( empty( $email ) OR strlen($email) > 50 OR @count(explode("@", $email)) != 2) {$stop .= $lang['feed_err_2'];} + if( empty( $subject ) OR strlen($subject) > 200 ) {$stop .= $lang['feed_err_4'];} + if( empty( $message ) OR strlen($message) > 20000 ) {$stop .= $lang['feed_err_5'];} + + if( $_POST['sec_code'] != $_SESSION['sec_code_session'] OR ! $_SESSION['sec_code_session'] ) {$stop .= $lang['reg_err_19'];} + $_SESSION['sec_code_session'] = false; + + if( $stop ) {msgbox( $lang['all_err_1'], "$stop

    $lang[all_prev]" ); + } else { + include_once SYSTEM_DIR . '/classes/mail.class.php'; + $mail = new dle_mail( $config ); + + $row = $db->super_query( "SELECT template FROM " . PREFIX . "_email where name='feed_mail' LIMIT 0,1" ); + + $row['template'] = stripslashes( $row['template'] ); + $row['template'] = str_replace( "{%username_to%}", $recipient['fullname'], $row['template'] ); + $row['template'] = str_replace( "{%username_from%}", $name, $row['template'] ); + $row['template'] = str_replace( "{%text%}", $message, $row['template'] ); + $row['template'] = str_replace( "{%ip%}", $_SERVER['REMOTE_ADDR'], $row['template'] ); + + $mail->from = $email; + $mail->send( $recipient['email'], $subject, $row['template'] ); + + if( $mail->send_error ) msgbox( $lang['all_info'], $mail->smtp_msg ); + else msgbox( $lang['feed_ok_1'], "$lang[feed_ok_2] " . $recipient['name'] . " $lang[feed_ok_3] $lang[feed_ok_4]" ); + }} else { + if( ! $user_group[$member_id['user_group']]['allow_feed'] ) { + $group = 2; + $user = false; + if ($_GET['user']) { + $lang['feed_error'] = str_replace( '{group}', $user_group[$member_id['user_group']]['group_name'], $lang['feed_error'] ); + msgbox( $lang['all_info'], $lang['feed_error'] ); + }} else { + $user = intval( $_GET['user'] ); + $group = 3; + } + if( ! $user ) $db->query( "SELECT name, user_group, user_id FROM " . USERPREFIX . "_users WHERE user_group < '$group' AND allow_mail = '1' ORDER BY user_group" ); + else $db->query( "SELECT name, user_group, user_id FROM " . USERPREFIX . "_users WHERE user_id = '$user' AND allow_mail = '1'" ); + if( $db->num_rows() ) { + $empf = ""; + + $db->free(); + + $tpl->load_template( 'feedback.tpl' ); + + $path = parse_url( $config['http_home_url'] ); + $tpl->set( '{recipient}', $empf ); + $tpl->set( '{code}', "\"{$lang['sec_image']}\"" ); + + if( ! $is_logged ) { + $tpl->set( '[not-logged]', "" ); + $tpl->set( '[/not-logged]', "" ); + } else + $tpl->set_block( "'\\[not-logged\\](.*?)\\[/not-logged\\]'si", "" ); + + $tpl->copy_template = "
    \n" . $tpl->copy_template . " + +
    "; + + $tpl->copy_template .= << + + +HTML; + + $tpl->compile( 'content' ); + $tpl->clear(); + + } else { + msgbox( $lang['all_err_1'], $lang['feed_err_7'] ); + } + } + +?> \ No newline at end of file diff --git a/system/modules/fonts/eva.png b/system/modules/fonts/eva.png new file mode 100644 index 0000000..87bc9f5 Binary files /dev/null and b/system/modules/fonts/eva.png differ diff --git a/system/modules/forum/show.last.php b/system/modules/forum/show.last.php new file mode 100644 index 0000000..c1abdc2 --- /dev/null +++ b/system/modules/forum/show.last.php @@ -0,0 +1,61 @@ +open('forum_show_last_' . $member_id['user_group']); + if (!$forum_table) + { + if ($forum_config['hide_forum']){$access_hide = "WHERE ". PREFIX ."_forum_forums.access_read regexp '[[:<:]](".$member_id['user_group'].")[[:>:]]'";} + else { $access_hide = ""; } + + $result = $db->query("SELECT topics.tid, topics.forum_id, topics.title, topics.author_topic, topics.last_poster_name, topics.post, topics.last_date, users.foto + FROM " . PREFIX . "_forum_topics as topics + LEFT JOIN ". PREFIX ."_users as users ON users.name = topics.last_poster_name + LEFT JOIN ". PREFIX ."_forum_forums ON topics.forum_id = ". PREFIX ."_forum_forums.id {$access_hide} + GROUP BY topics.last_date DESC LIMIT ".$forum_config['site_inpage'].""); + + while ($row = $db->get_row ($result)) + { + $author_topic = urlencode ($row['author_topic']); + $last_poster_name = urlencode ($row['last_poster_name']); + $row['last_date'] = strtotime($row['last_date']); + + if (date(Ymd, $row['last_date']) == date(Ymd, $_TIME)){ + $show_date = $lang['time_heute'].langdate(", H:i", $row['last_date']); + }elseif (date(Ymd, $row['last_date']) == date(Ymd, ($_TIME - 86400))){ + $show_date = $lang['time_gestern'].langdate(", H:i", $row['last_date']); + }else{$show_date = langdate($forum_config['timestamp'], $row['last_date']); + } + + if( $row['foto'] and (file_exists( ROOT_DIR . "/uploads/fotos/" . $row['foto'] )) ) $fotos = $config['http_home_url'] . "uploads/fotos/" . $row['foto']; + else $fotos = $config['http_home_url'] . "{THEME}/images/noavatar.png"; + $tpl->set('{foto}', $fotos); + + $tpl->load_template('forum_last_list.tpl'); + $tpl->set('{fl_forum}', "{$row['name']}"); + $tpl->set('{fl_topic}', "{$row['title']}"); + $tpl->set('{fl_post}', $row['post']); + //$tpl->set('{fl_views}', $row['views']); + //$tpl->set('{fl_author}', "{$row['author_topic']}"); + $tpl->set('{fl_last_date}', $show_date); + $tpl->set('{fl_last_poster}', "{$row['last_poster_name']}"); + + $tpl->compile('forum_last_list'); + $tpl->clear(); + } + + $tpl->load_template('forum_last.tpl'); + $tpl->set('{last_list}', $tpl->result["forum_last_list"]); + $tpl->compile('forum_table'); + $tpl->clear(); + $cache->save('forum_show_last_' . $member_id['user_group'], $tpl->result['forum_table']); + }else{ + $tpl->result['forum_table'] = $forum_table; + } +} + +?> \ No newline at end of file diff --git a/system/modules/functions.php b/system/modules/functions.php new file mode 100644 index 0000000..9e9b145 --- /dev/null +++ b/system/modules/functions.php @@ -0,0 +1,708 @@ + 'a', 'б' => 'b', 'в' => 'v', 'г' => 'g', 'д' => 'd', 'е' => 'e', 'ё' => 'e', 'ж' => 'zh', 'з' => 'z', 'и' => 'i', 'й' => 'y', 'к' => 'k', 'л' => 'l', 'м' => 'm', 'н' => 'n', 'о' => 'o', 'п' => 'p', 'р' => 'r', 'с' => 's', 'т' => 't', 'у' => 'u', 'ф' => 'f', 'х' => 'h', 'ц' => 'c', 'ч' => 'ch', 'ш' => 'sh', 'щ' => 'sch', 'ь' => '', 'ы' => 'y', 'ъ' => '', 'э' => 'e', 'ю' => 'yu', 'я' => 'ya', "ї" => "yi", "є" => "ye", + 'А' => 'A', 'Б' => 'B', 'В' => 'V', 'Г' => 'G', 'Д' => 'D', 'Е' => 'E', 'Ё' => 'E', 'Ж' => 'Zh', 'З' => 'Z', 'И' => 'I', 'Й' => 'Y', 'К' => 'K', 'Л' => 'L', 'М' => 'M', 'Н' => 'N', 'О' => 'O', 'П' => 'P', 'Р' => 'R', 'С' => 'S', 'Т' => 'T', 'У' => 'U', 'Ф' => 'F', 'Х' => 'H', 'Ц' => 'C', 'Ч' => 'Ch', 'Ш' => 'Sh', 'Щ' => 'Sch', 'Ь' => '', 'Ы' => 'Y', 'Ъ' => '', 'Э' => 'E', 'Ю' => 'Yu', 'Я' => 'Ya', "Ї" => "yi", "Є" => "ye",); + } + + $var = trim( strip_tags( $var ) ); + $var = preg_replace( "/\s+/ms", "-", $var ); + $var = str_replace( "/", "-", $var ); + + $var = strtr($var, $langtranslit); + + if( $punkt ) {$var = preg_replace( "/[^a-z0-9\_\-.]+/mi", "", $var );}else{$var = preg_replace( "/[^a-z0-9\_\-]+/mi", "", $var );} + + $var = preg_replace( '#[\-]+#i', '-', $var ); + + if( $lower ) {$var = strtolower( $var );} + + $var = str_ireplace( ".php", "", $var ); + $var = str_ireplace( ".php", ".ppp", $var ); + + if( strlen( $var ) > 50 ) { + $var = substr( $var, 0, 50 ); + if( ($temp_max = strrpos( $var, '-' )) ) $var = substr( $var, 0, $temp_max ); + } + return $var; +} + +function langdate($format, $stamp) { + global $langdate; + return strtr( @date( $format, $stamp ), $langdate ); +} + +function mcdate($format, $stamp) { + global $langdate, $config; + $today = strtotime(date("Y-m-d.", time()+ ($config['date_adjust']*60))); + if ($stamp > $today) return "" . date ("H:i:s", $stamp); + elseif ($stamp > ($today - 86400)) return "". date ("H:i:s", $stamp); + else return strtr(date($format, $stamp), $langdate); +} + +function msgbox($title, $text) { + global $tpl; + $tpl_2 = new dle_template( ); + $tpl_2->dir = TEMPLATE_DIR; + $tpl_2->load_template( 'info.tpl' ); + $tpl_2->set( '{error}', $text ); + $tpl_2->set( '{title}', $title ); + $tpl_2->compile( 'info' ); + $tpl_2->clear(); + $tpl->result['info'] .= $tpl_2->result['info']; +} + +function ShortRating($id, $rating, $allow = true) { + global $config, $lang; + + if ($rating) $rating = round($rating, 0); else $rating = 0; +if ($rating > 0) $rating = "".$rating.""; elseif ($rating == 0) $rating="".$rating.""; else $rating = "".$rating.""; + + if (!$allow) { + $rated = << + Не нравится(-) + {$rating} + Нравится(+) + +HTML; + return $rated; +} + +$rated = ""; +$rated .= << + + Не нравится(-) + + {$rating} + + Нравится(+) + + +HTML; + +$rated .= ""; + return $rated; +} + +function CommRating ($id, $commrating, $allow = true){ +global $is_logged, $member_id, $config, $lang, $db; + +if ($commrating) $commrating = round($commrating, 0); else $commrating = 0; + +switch($commrating) { +case ($commrating >= 0): +$commrating = '+'.$commrating.''; +break; +case ($commrating <= 0): +$commrating = ''.$commrating.''; +break; +case($commrating == 0): +$commrating = ''.$commrating.''; +break; +} +if (!$allow) { + +$commrated = << + +{$commrating} + + +HTML; + +return $commrated; +} + +$commrated .= << + +{$commrating} + + +HTML; + +return $commrated; +} + +function CategoryNewsSelection($categoryid = 0, $parentid = 0, $nocat = TRUE, $sublevelmarker = '', $returnstring = '') { + global $cat_info, $user_group, $member_id; + + $allow_list = explode( ',', $user_group[$member_id['user_group']]['allow_cats'] ); + $spec_list = explode( ',', $user_group[$member_id['user_group']]['cat_add'] ); + + $root_category = array (); + + if( $parentid == 0 ) {if( $nocat ) $returnstring .= ''; + } else {$sublevelmarker .= '   ';} + + if( count( $cat_info ) ) { + + foreach ( $cat_info as $cats ) {if( $cats['parentid'] == $parentid ) $root_category[] = $cats['id'];} + + if( count( $root_category ) ) { + foreach ( $root_category as $id ) { + + if( $allow_list[0] == "all" or in_array( $id, $allow_list ) ) { + + if( $spec_list[0] == "all" or in_array( $id, $spec_list ) ) $color = "black"; else $color = "red"; + + $returnstring .= "