From ecd8d71e80c36b28219f60d51bdcaab89a345830 Mon Sep 17 00:00:00 2001 From: Exile Date: Wed, 30 Jul 2014 16:26:18 +0400 Subject: [PATCH] r592 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit В связи с необходимостью срочного исправления уязвимости, внедрение чата и некоторые другие вещи отложены до ревизии 593. Новая система нумерации версия движка. Ревизия 600 согласно новой терминологии будет версией 2.1. Изменения в данной ревизии: - добавлена единая функция для вывода ошибок - bb_die, переделаны все вхождения данной функции; - добавлена функция для вывода визуального изображения пола пользователя + изображение для не указавшего; - добавлена поддержка CloudFlare; - исправление критической уязвимости с доступом к системны файлам движка; - исправлена работа функции bb_date, переделаны все вхождения данной функции; - исправлена структура папок для полной поддержки git; - исправлена структура папок с локализованными изображениями шаблона; - исправления в локализации - перевод сообщения об отключении форума и некоторые другие вещи; - удаление уязвимых копонентов текущего аттач-мода (загрузка по ftp; прикрепление swf); - удаление php-дебаггера кода, из-за несовместимости с актуальной версией php; - удаление файла donate.php и соответствующего шаблона; - удаление большей части костылей для поддержки устаревших браузеров; - удаление части неиспользуемого кода, мусора из папок, некоторы� неиспользуемых изображений; - другие множественные исправления. --- install/php-fpm+nginx/nginx.conf | 2 +- install/sql/mysql.sql | 19 +- other/converter/TBDevYSE_pre6/ReadMe.txt | 2 +- .../TBDevYSE_pre6/for_tbdev/pass.php | 2 +- upload/.htaccess | 7 +- upload/admin/.htaccess | 8 - upload/admin/admin_attach_cp.php | 93 ++- upload/admin/admin_attachments.php | 409 +++-------- upload/admin/admin_board.php | 13 +- upload/admin/admin_bt_forum_cfg.php | 5 +- upload/admin/admin_bt_tracker_cfg.php | 4 +- upload/admin/admin_cron.php | 8 +- upload/admin/admin_disallow.php | 23 +- upload/admin/admin_extensions.php | 122 ++-- upload/admin/admin_forum_prune.php | 13 +- upload/admin/admin_forumauth.php | 27 +- upload/admin/admin_forumauth_list.php | 43 +- upload/admin/admin_forums.php | 126 ++-- upload/admin/admin_phpinfo.php | 2 +- upload/admin/admin_ranks.php | 34 +- upload/admin/admin_rebuild_search.php | 12 +- upload/admin/admin_reports.php | 34 +- upload/admin/admin_smilies.php | 241 +++---- upload/admin/admin_ug_auth.php | 4 +- upload/admin/admin_user_ban.php | 168 ++--- upload/admin/admin_user_search.php | 661 ++++++------------ upload/admin/admin_words.php | 93 ++- upload/admin/index.php | 26 +- upload/admin/pagestart.php | 2 +- upload/ajax.php | 11 +- upload/ajax/.htaccess | 2 + upload/ajax/change_tor_status.php | 4 +- upload/ajax/change_torrent.php | 38 +- upload/ajax/chat.php | 5 + upload/ajax/edit_user_profile.php | 2 +- upload/ajax/posts.php | 2 +- upload/ajax/view_torrent.php | 2 +- upload/attach_mod/attachment_mod.php | 15 +- upload/attach_mod/displaying.php | 120 +--- upload/attach_mod/displaying_torrent.php | 2 +- .../attach_mod/includes/functions_admin.php | 81 +-- .../attach_mod/includes/functions_attach.php | 216 +----- .../attach_mod/includes/functions_delete.php | 41 +- .../includes/functions_filetypes.php | 109 --- .../includes/functions_includes.php | 31 +- .../attach_mod/includes/functions_selects.php | 31 +- .../attach_mod/includes/functions_thumbs.php | 42 +- upload/attach_mod/posting_attachments.php | 127 ++-- upload/bt/includes/.htaccess | 5 +- upload/bt/includes/init_tr.php | 9 +- upload/bt/robots.txt | 3 + upload/cache/.htaccess | 2 + upload/cache/filecache/.htaccess | 2 + upload/callseed.php | 2 +- upload/common.php | 4 +- upload/config.php | 186 ++--- upload/develop/benchmark/timer.php | 357 ---------- upload/develop/dbg_config.php | 6 - upload/develop/dbg_header.php | 81 --- upload/develop/error_handler.php | 106 --- upload/develop/error_report.php | 234 ------- upload/develop/functions_debug.php | 102 --- upload/develop/init_debug.php | 41 -- upload/develop/memcached_stub.php | 154 ---- upload/develop/open_editor.php | 15 - upload/develop/profiler/example.txt | 9 - upload/develop/profiler/profiler.css | 119 ---- upload/develop/profiler/profiler.php | 35 - upload/develop/profiler/profiler_dbg.php | 373 ---------- upload/develop/show_source.php | 18 - upload/dl_list.php | 20 +- upload/donate.php | 15 - upload/download.php | 154 +--- upload/favicon.ico | Bin 7718 -> 1342 bytes upload/files/.htaccess | 4 +- upload/groupcp.php | 89 ++- upload/images/{index.html => captcha/.keep} | 0 upload/images/icon_disk.gif | Bin 906 -> 0 bytes upload/images/icon_disk_gray.gif | Bin 313 -> 0 bytes upload/images/icon_external.png | Bin 0 -> 1379 bytes upload/images/logo/logo.png | Bin 53852 -> 25699 bytes upload/images/logo/logo_big.png | Bin 106841 -> 0 bytes upload/images/logo/logo_me.png | Bin 25699 -> 0 bytes upload/images/smiles/smileys.pak | 56 -- upload/includes/captcha/.htaccess | 2 + upload/includes/cron/cron_run.php | 2 +- upload/includes/datastore/build_stats.php | 4 +- upload/includes/db/mysql.php | 9 +- upload/includes/emailer.class.php | 8 +- upload/includes/functions.php | 192 ++--- upload/includes/functions_admin_cron.php | 14 +- upload/includes/functions_admin_torrent.php | 4 +- upload/includes/functions_dev.php | 5 +- upload/includes/functions_post.php | 22 +- upload/includes/functions_report.php | 52 +- upload/includes/functions_report_admin.php | 42 +- upload/includes/functions_torrent.php | 52 +- upload/includes/init_bb.php | 35 +- upload/includes/page_footer.php | 10 +- upload/includes/page_footer_dev.php | 66 +- upload/includes/page_header.php | 25 +- upload/includes/report_hack/report_post.php | 22 +- .../includes/report_hack/report_privmsg.php | 20 +- upload/includes/report_hack/report_topic.php | 22 +- upload/includes/report_hack/report_user.php | 2 +- upload/includes/report_module.php | 2 +- upload/includes/sessions.php | 2 +- upload/includes/smtp.php | 10 +- upload/includes/template.php | 2 +- upload/includes/torrent_announce_urls.php | 10 +- upload/includes/ucp/activate.php | 20 +- upload/includes/ucp/register.php | 4 +- upload/includes/ucp/sendpasswd.php | 6 +- upload/includes/ucp/topic_watch.php | 71 +- upload/includes/ucp/viewprofile.php | 6 +- upload/index.php | 26 +- upload/language/en/main.php | 166 ++--- upload/language/ru/main.php | 74 +- upload/language/ua/main.php | 74 +- upload/memberlist.php | 16 +- upload/misc.php | 18 +- upload/misc/.htaccess | 3 - upload/misc/js/bbcode.js | 170 ++--- upload/misc/js/main.js | 101 +-- upload/modcp.php | 144 ++-- upload/posting.php | 24 +- upload/privmsg.php | 223 +++--- upload/report.php | 121 ++-- upload/search.php | 10 +- upload/templates/admin/admin_attachments.tpl | 43 -- upload/templates/admin/admin_ug_auth.tpl | 6 - upload/templates/admin/admin_user_search.tpl | 93 +-- upload/templates/admin/index.tpl | 7 + upload/templates/board_disabled_exit.php | 2 +- upload/templates/default/common.tpl | 6 +- upload/templates/default/css/main.css | 29 +- upload/templates/default/donate.tpl | 53 -- upload/templates/default/groupcp.tpl | 1 - upload/templates/default/images/en/index.html | 0 .../templates/default/images/icon_female.gif | Bin 141 -> 526 bytes upload/templates/default/images/icon_male.gif | Bin 143 -> 632 bytes .../default/images/icon_nogender.gif | Bin 0 -> 591 bytes upload/templates/default/images/index.html | 0 .../images/{ => lang}/en/icon_edit.gif | Bin .../images/{ => lang}/en/icon_email.gif | Bin .../images/{ => lang}/en/icon_icq_add.gif | Bin .../default/images/{ => lang}/en/icon_ip.gif | Bin .../default/images/{ => lang}/en/icon_mc.gif | Bin .../default/images/{ => lang}/en/icon_pm.gif | Bin .../images/{ => lang}/en/icon_poll.gif | Bin .../images/{ => lang}/en/icon_profile.gif | Bin .../images/{ => lang}/en/icon_quote.gif | Bin .../images/{ => lang}/en/icon_search.gif | Bin .../default/images/{ => lang}/en/icon_www.gif | Bin .../images/{ => lang}/en/msg_newpost.gif | Bin .../default/images/{ => lang}/en/post.gif | Bin .../default/images/{ => lang}/en/release.gif | Bin .../images/{ => lang}/en/reply-locked.gif | Bin .../default/images/{ => lang}/en/reply.gif | Bin .../images/{ => lang}/ru/icon_edit.gif | Bin .../images/{ => lang}/ru/icon_email.gif | Bin .../images/{ => lang}/ru/icon_icq_add.gif | Bin .../default/images/{ => lang}/ru/icon_ip.gif | Bin .../default/images/{ => lang}/ru/icon_mc.gif | Bin .../default/images/{ => lang}/ru/icon_pm.gif | Bin .../images/{ => lang}/ru/icon_poll.gif | Bin .../images/{ => lang}/ru/icon_profile.gif | Bin .../images/{ => lang}/ru/icon_quote.gif | Bin .../images/{ => lang}/ru/icon_search.gif | Bin .../default/images/{ => lang}/ru/icon_www.gif | Bin .../images/{ => lang}/ru/msg_newpost.gif | Bin .../default/images/{ => lang}/ru/post.gif | Bin .../default/images/{ => lang}/ru/release.gif | Bin .../images/{ => lang}/ru/reply-locked.gif | Bin .../default/images/{ => lang}/ru/reply.gif | Bin .../images/{ => lang}/ua/icon_edit.gif | Bin .../images/{ => lang}/ua/icon_email.gif | Bin .../images/{ => lang}/ua/icon_icq_add.gif | Bin .../default/images/{ => lang}/ua/icon_ip.gif | Bin .../default/images/{ => lang}/ua/icon_mc.gif | Bin .../default/images/{ => lang}/ua/icon_pm.gif | Bin .../images/{ => lang}/ua/icon_poll.gif | Bin .../images/{ => lang}/ua/icon_profile.gif | Bin .../images/{ => lang}/ua/icon_quote.gif | Bin .../images/{ => lang}/ua/icon_search.gif | Bin .../default/images/{ => lang}/ua/icon_www.gif | Bin .../images/{ => lang}/ua/msg_newpost.gif | Bin .../default/images/{ => lang}/ua/post.gif | Bin .../default/images/{ => lang}/ua/release.gif | Bin .../images/{ => lang}/ua/reply-locked.gif | Bin .../default/images/{ => lang}/ua/reply.gif | Bin upload/templates/default/images/ru/index.html | 0 upload/templates/default/images/ua/index.html | 0 upload/templates/default/index.tpl | 3 +- upload/templates/default/memberlist.tpl | 1 - upload/templates/default/modcp.tpl | 1 - upload/templates/default/page_header.tpl | 30 +- upload/templates/default/posting.tpl | 4 +- upload/templates/default/posting_editor.tpl | 2 +- upload/templates/default/posting_tpl.tpl | 7 +- upload/templates/default/privmsgs.tpl | 1 - upload/templates/default/search.tpl | 1 - upload/templates/default/search_results.tpl | 1 - upload/templates/default/tpl_config.php | 3 +- upload/templates/default/tracker.tpl | 27 +- upload/templates/default/usercp_attachcp.tpl | 1 - upload/templates/default/usercp_bonus.tpl | 1 - upload/templates/default/usercp_email.tpl | 1 - .../templates/default/usercp_viewprofile.tpl | 2 +- upload/templates/default/viewforum.tpl | 1 - upload/templates/default/viewonline.tpl | 1 - upload/templates/default/viewtopic.tpl | 3 +- upload/templates/default/viewtopic_attach.tpl | 85 --- .../templates/topic_tpl_overall_header.html | 51 -- upload/templates/topic_tpl_rules_video.html | 99 --- upload/tracker.php | 10 +- upload/viewonline.php | 4 +- upload/viewtopic.php | 32 +- 218 files changed, 1943 insertions(+), 5867 deletions(-) delete mode 100644 upload/admin/.htaccess create mode 100644 upload/ajax/.htaccess create mode 100644 upload/ajax/chat.php create mode 100644 upload/cache/.htaccess create mode 100644 upload/cache/filecache/.htaccess delete mode 100644 upload/develop/benchmark/timer.php delete mode 100644 upload/develop/dbg_config.php delete mode 100644 upload/develop/dbg_header.php delete mode 100644 upload/develop/error_handler.php delete mode 100644 upload/develop/error_report.php delete mode 100644 upload/develop/functions_debug.php delete mode 100644 upload/develop/init_debug.php delete mode 100644 upload/develop/memcached_stub.php delete mode 100644 upload/develop/open_editor.php delete mode 100644 upload/develop/profiler/example.txt delete mode 100644 upload/develop/profiler/profiler.css delete mode 100644 upload/develop/profiler/profiler.php delete mode 100644 upload/develop/profiler/profiler_dbg.php delete mode 100644 upload/develop/show_source.php delete mode 100644 upload/donate.php rename upload/images/{index.html => captcha/.keep} (100%) delete mode 100644 upload/images/icon_disk.gif delete mode 100644 upload/images/icon_disk_gray.gif create mode 100644 upload/images/icon_external.png delete mode 100644 upload/images/logo/logo_big.png delete mode 100644 upload/images/logo/logo_me.png delete mode 100644 upload/images/smiles/smileys.pak create mode 100644 upload/includes/captcha/.htaccess delete mode 100644 upload/misc/.htaccess delete mode 100644 upload/templates/default/donate.tpl delete mode 100644 upload/templates/default/images/en/index.html create mode 100644 upload/templates/default/images/icon_nogender.gif delete mode 100644 upload/templates/default/images/index.html rename upload/templates/default/images/{ => lang}/en/icon_edit.gif (100%) rename upload/templates/default/images/{ => lang}/en/icon_email.gif (100%) rename upload/templates/default/images/{ => lang}/en/icon_icq_add.gif (100%) rename upload/templates/default/images/{ => lang}/en/icon_ip.gif (100%) rename upload/templates/default/images/{ => lang}/en/icon_mc.gif (100%) rename upload/templates/default/images/{ => lang}/en/icon_pm.gif (100%) rename upload/templates/default/images/{ => lang}/en/icon_poll.gif (100%) rename upload/templates/default/images/{ => lang}/en/icon_profile.gif (100%) rename upload/templates/default/images/{ => lang}/en/icon_quote.gif (100%) rename upload/templates/default/images/{ => lang}/en/icon_search.gif (100%) rename upload/templates/default/images/{ => lang}/en/icon_www.gif (100%) rename upload/templates/default/images/{ => lang}/en/msg_newpost.gif (100%) rename upload/templates/default/images/{ => lang}/en/post.gif (100%) rename upload/templates/default/images/{ => lang}/en/release.gif (100%) rename upload/templates/default/images/{ => lang}/en/reply-locked.gif (100%) rename upload/templates/default/images/{ => lang}/en/reply.gif (100%) rename upload/templates/default/images/{ => lang}/ru/icon_edit.gif (100%) rename upload/templates/default/images/{ => lang}/ru/icon_email.gif (100%) rename upload/templates/default/images/{ => lang}/ru/icon_icq_add.gif (100%) rename upload/templates/default/images/{ => lang}/ru/icon_ip.gif (100%) rename upload/templates/default/images/{ => lang}/ru/icon_mc.gif (100%) rename upload/templates/default/images/{ => lang}/ru/icon_pm.gif (100%) rename upload/templates/default/images/{ => lang}/ru/icon_poll.gif (100%) rename upload/templates/default/images/{ => lang}/ru/icon_profile.gif (100%) rename upload/templates/default/images/{ => lang}/ru/icon_quote.gif (100%) rename upload/templates/default/images/{ => lang}/ru/icon_search.gif (100%) rename upload/templates/default/images/{ => lang}/ru/icon_www.gif (100%) rename upload/templates/default/images/{ => lang}/ru/msg_newpost.gif (100%) rename upload/templates/default/images/{ => lang}/ru/post.gif (100%) rename upload/templates/default/images/{ => lang}/ru/release.gif (100%) rename upload/templates/default/images/{ => lang}/ru/reply-locked.gif (100%) rename upload/templates/default/images/{ => lang}/ru/reply.gif (100%) rename upload/templates/default/images/{ => lang}/ua/icon_edit.gif (100%) rename upload/templates/default/images/{ => lang}/ua/icon_email.gif (100%) rename upload/templates/default/images/{ => lang}/ua/icon_icq_add.gif (100%) rename upload/templates/default/images/{ => lang}/ua/icon_ip.gif (100%) rename upload/templates/default/images/{ => lang}/ua/icon_mc.gif (100%) rename upload/templates/default/images/{ => lang}/ua/icon_pm.gif (100%) rename upload/templates/default/images/{ => lang}/ua/icon_poll.gif (100%) rename upload/templates/default/images/{ => lang}/ua/icon_profile.gif (100%) rename upload/templates/default/images/{ => lang}/ua/icon_quote.gif (100%) rename upload/templates/default/images/{ => lang}/ua/icon_search.gif (100%) rename upload/templates/default/images/{ => lang}/ua/icon_www.gif (100%) rename upload/templates/default/images/{ => lang}/ua/msg_newpost.gif (100%) rename upload/templates/default/images/{ => lang}/ua/post.gif (100%) rename upload/templates/default/images/{ => lang}/ua/release.gif (100%) rename upload/templates/default/images/{ => lang}/ua/reply-locked.gif (100%) rename upload/templates/default/images/{ => lang}/ua/reply.gif (100%) delete mode 100644 upload/templates/default/images/ru/index.html delete mode 100644 upload/templates/default/images/ua/index.html delete mode 100644 upload/templates/topic_tpl_overall_header.html delete mode 100644 upload/templates/topic_tpl_rules_video.html diff --git a/install/php-fpm+nginx/nginx.conf b/install/php-fpm+nginx/nginx.conf index d108b89ce..3be984daa 100644 --- a/install/php-fpm+nginx/nginx.conf +++ b/install/php-fpm+nginx/nginx.conf @@ -128,7 +128,7 @@ http { # allow YOUR_IP; } # Deny folder (Sec. lvl1) - location ~ \/(cache|log|attach_mod|cache|config|includes|language|triggers)\/ { + location ~ \/(cache|log|attach_mod|config|includes|language|triggers)\/ { deny all; } diff --git a/install/sql/mysql.sql b/install/sql/mysql.sql index e8c21e81a..fe0a74fb6 100644 --- a/install/sql/mysql.sql +++ b/install/sql/mysql.sql @@ -125,16 +125,9 @@ INSERT INTO `bb_attachments_config` VALUES ('max_attachments', '1'); INSERT INTO `bb_attachments_config` VALUES ('max_attachments_pm', '1'); INSERT INTO `bb_attachments_config` VALUES ('disable_mod', '0'); INSERT INTO `bb_attachments_config` VALUES ('allow_pm_attach', '1'); -INSERT INTO `bb_attachments_config` VALUES ('allow_ftp_upload', '0'); INSERT INTO `bb_attachments_config` VALUES ('attach_version', '2.3.14'); INSERT INTO `bb_attachments_config` VALUES ('default_upload_quota', '0'); INSERT INTO `bb_attachments_config` VALUES ('default_pm_quota', '0'); -INSERT INTO `bb_attachments_config` VALUES ('ftp_server', ''); -INSERT INTO `bb_attachments_config` VALUES ('ftp_path', ''); -INSERT INTO `bb_attachments_config` VALUES ('download_path', ''); -INSERT INTO `bb_attachments_config` VALUES ('ftp_user', ''); -INSERT INTO `bb_attachments_config` VALUES ('ftp_pass', ''); -INSERT INTO `bb_attachments_config` VALUES ('ftp_pasv_mode', '1'); INSERT INTO `bb_attachments_config` VALUES ('img_display_inlined', '1'); INSERT INTO `bb_attachments_config` VALUES ('img_max_width', '200'); INSERT INTO `bb_attachments_config` VALUES ('img_max_height', '200'); @@ -706,9 +699,7 @@ INSERT INTO `bb_extensions` VALUES (23, 4, 'ai', ''); INSERT INTO `bb_extensions` VALUES (24, 4, 'ps', ''); INSERT INTO `bb_extensions` VALUES (25, 4, 'ppt', ''); INSERT INTO `bb_extensions` VALUES (26, 5, 'rm', ''); -INSERT INTO `bb_extensions` VALUES (27, 6, 'wma', ''); -INSERT INTO `bb_extensions` VALUES (28, 7, 'swf', ''); -INSERT INTO `bb_extensions` VALUES (29, 8, 'torrent', ''); +INSERT INTO `bb_extensions` VALUES (29, 6, 'torrent', ''); -- -------------------------------------------------------- @@ -734,12 +725,10 @@ CREATE TABLE IF NOT EXISTS `bb_extension_groups` ( INSERT INTO `bb_extension_groups` VALUES (1, 'Images', 1, 1, 1, '', 262144, ''); INSERT INTO `bb_extension_groups` VALUES (2, 'Archives', 0, 1, 1, '', 262144, ''); -INSERT INTO `bb_extension_groups` VALUES (3, 'Plain Text', 0, 0, 1, '', 262144, ''); +INSERT INTO `bb_extension_groups` VALUES (3, 'Plain text', 0, 0, 1, '', 262144, ''); INSERT INTO `bb_extension_groups` VALUES (4, 'Documents', 0, 0, 1, '', 262144, ''); -INSERT INTO `bb_extension_groups` VALUES (5, 'Real Media', 0, 0, 2, '', 262144, ''); -INSERT INTO `bb_extension_groups` VALUES (6, 'Streams', 2, 0, 1, '', 262144, ''); -INSERT INTO `bb_extension_groups` VALUES (7, 'Flash Files', 3, 0, 1, '', 262144, ''); -INSERT INTO `bb_extension_groups` VALUES (8, 'Torrent', 0, 1, 1, '', 122880, ''); +INSERT INTO `bb_extension_groups` VALUES (5, 'Real media', 0, 0, 2, '', 262144, ''); +INSERT INTO `bb_extension_groups` VALUES (6, 'Torrent', 0, 1, 1, '', 122880, ''); -- -------------------------------------------------------- diff --git a/other/converter/TBDevYSE_pre6/ReadMe.txt b/other/converter/TBDevYSE_pre6/ReadMe.txt index e83df7cb7..2ffa0d7a1 100644 --- a/other/converter/TBDevYSE_pre6/ReadMe.txt +++ b/other/converter/TBDevYSE_pre6/ReadMe.txt @@ -18,4 +18,4 @@ Quick guide: 'for_tbdev/announce.php' Cheers, RoadTrain. -http://torrentpier.info/ \ No newline at end of file +http://torrentpier.me/ \ No newline at end of file diff --git a/other/converter/TBDevYSE_pre6/for_tbdev/pass.php b/other/converter/TBDevYSE_pre6/for_tbdev/pass.php index 67c6ffed3..2e9794d83 100644 --- a/other/converter/TBDevYSE_pre6/for_tbdev/pass.php +++ b/other/converter/TBDevYSE_pre6/for_tbdev/pass.php @@ -1,5 +1,5 @@ deny from all - -php_value allow_call_time_pass_reference On \ No newline at end of file + \ No newline at end of file diff --git a/upload/admin/.htaccess b/upload/admin/.htaccess deleted file mode 100644 index c2c2cc412..000000000 --- a/upload/admin/.htaccess +++ /dev/null @@ -1,8 +0,0 @@ -AddDefaultCharset UTF-8 -#order allow deny -#deny from all -#allow from 127.0.0.1 - - -allow from all - \ No newline at end of file diff --git a/upload/admin/admin_attach_cp.php b/upload/admin/admin_attach_cp.php index 0ec125ef0..06da6f604 100644 --- a/upload/admin/admin_attach_cp.php +++ b/upload/admin/admin_attach_cp.php @@ -11,20 +11,13 @@ require('./pagestart.php'); $total_attachments = 0; -if (!intval($attach_config['allow_ftp_upload'])) +if ( ($attach_config['upload_dir'][0] == '/') || ( ($attach_config['upload_dir'][0] != '/') && ($attach_config['upload_dir'][1] == ':') ) ) { - if ( ($attach_config['upload_dir'][0] == '/') || ( ($attach_config['upload_dir'][0] != '/') && ($attach_config['upload_dir'][1] == ':') ) ) - { - $upload_dir = $attach_config['upload_dir']; - } - else - { - $upload_dir = '../' . $attach_config['upload_dir']; - } + $upload_dir = $attach_config['upload_dir']; } else { - $upload_dir = $attach_config['download_path']; + $upload_dir = '../' . $attach_config['upload_dir']; } include(BB_ROOT .'attach_mod/includes/functions_selects.php'); @@ -211,8 +204,8 @@ else if ($delete && sizeof($delete_id_list) > 0) // Assign Default Template Vars $template->assign_vars(array( 'S_VIEW_SELECT' => $select_view, - 'S_MODE_ACTION' => 'admin_attach_cp.php') -); + 'S_MODE_ACTION' => 'admin_attach_cp.php', +)); if ($submit_change && $view == 'attachments') { @@ -233,9 +226,9 @@ if ($submit_change && $view == 'attachments') FROM ' . BB_ATTACHMENTS_DESC . ' ORDER BY attach_id'; - if ( !($result = DB()->sql_query($sql)) ) + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Couldn\'t get Attachment informations', '', __LINE__, __FILE__, $sql); + bb_die('Could not get attachment informations'); } while ( $attachrow = DB()->sql_fetchrow($result) ) @@ -250,7 +243,7 @@ if ($submit_change && $view == 'attachments') if (!DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Couldn\'t update Attachments Informations', '', __LINE__, __FILE__, $sql); + bb_die('Could not update attachments informations'); } } } @@ -287,15 +280,14 @@ if ($view == 'stats') $template->assign_vars(array( 'TPL_ATTACH_STATISTICS' => true, - 'TOTAL_FILESIZE' => $upload_dir_size, 'ATTACH_QUOTA' => $attachment_quota, 'NUMBER_OF_ATTACHMENTS' => $number_of_attachments, 'NUMBER_OF_POSTS' => $number_of_posts, 'NUMBER_OF_PMS' => $number_of_pms, 'NUMBER_OF_TOPICS' => $number_of_topics, - 'NUMBER_OF_USERS' => $number_of_users) - ); + 'NUMBER_OF_USERS' => $number_of_users, + )); } @@ -309,9 +301,9 @@ if ($view == 'search') WHERE f.cat_id = c.cat_id ORDER BY c.cat_id, f.forum_order"; - if ( !($result = DB()->sql_query($sql)) ) + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not obtain forum_name/forum_id', '', __LINE__, __FILE__, $sql); + bb_die('Could not obtain forum_name / forum_id'); } $s_forums = ''; @@ -339,17 +331,16 @@ if ($view == 'search') } else { - message_die(GENERAL_MESSAGE, $lang['NO_SEARCHABLE_FORUMS']); + bb_die($lang['NO_SEARCHABLE_FORUMS']); } $template->assign_vars(array( 'TPL_ATTACH_SEARCH' => true, - 'S_FORUM_OPTIONS' => $s_forums, 'S_CATEGORY_OPTIONS' => $s_categories, 'S_SORT_OPTIONS' => $select_sort_mode, - 'S_SORT_ORDER' => $select_sort_order) - ); + 'S_SORT_ORDER' => $select_sort_order, + )); } // Username @@ -357,10 +348,9 @@ if ($view == 'username') { $template->assign_vars(array( 'TPL_ATTACH_USER' => true, - 'S_MODE_SELECT' => $select_sort_mode, - 'S_ORDER_SELECT' => $select_sort_order) - ); + 'S_ORDER_SELECT' => $select_sort_order, + )); $total_rows = 0; bb_die('removed'); } @@ -375,23 +365,20 @@ if ($view == 'attachments') $template->assign_vars(array( 'TPL_ATTACH_ATTACHMENTS' => true, - 'S_MODE_SELECT' => $select_sort_mode, - 'S_ORDER_SELECT' => $select_sort_order) - ); + 'S_ORDER_SELECT' => $select_sort_order, + )); $total_rows = 0; // Are we called from Username ? if ($user_based) { - $sql = "SELECT username - FROM " . BB_USERS . " - WHERE user_id = " . intval($uid); + $sql = "SELECT username FROM " . BB_USERS . " WHERE user_id = " . intval($uid); - if ( !($result = DB()->sql_query($sql)) ) + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Error getting username', '', __LINE__, __FILE__, $sql); + bb_die('Error getting username'); } $row = DB()->sql_fetchrow($result); @@ -404,17 +391,17 @@ if ($view == 'attachments') $template->assign_vars(array( 'S_USER_HIDDEN' => $s_hidden, - 'L_STATISTICS_FOR_USER' => sprintf($lang['STATISTICS_FOR_USER'], $username)) - ); + 'L_STATISTICS_FOR_USER' => sprintf($lang['STATISTICS_FOR_USER'], $username), + )); $sql = "SELECT attach_id FROM " . BB_ATTACHMENTS . " WHERE user_id_1 = " . intval($uid) . " GROUP BY attach_id"; - if ( !($result = DB()->sql_query($sql)) ) + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Couldn\'t query attachments', '', __LINE__, __FILE__, $sql); + bb_die('Could not query attachments #1'); } $attach_ids = DB()->sql_fetchrowset($result); @@ -423,7 +410,7 @@ if ($view == 'attachments') if ($num_attach_ids == 0) { - message_die(GENERAL_MESSAGE, 'For some reason no Attachments are assigned to the User "' . $username . '".'); + bb_die('For some reason no attachments are assigned to the user ' . $username); } $total_rows = $num_attach_ids; @@ -440,9 +427,9 @@ if ($view == 'attachments') WHERE a.attach_id IN (" . implode(', ', $attach_id) . ") " . $order_by; - if ( !($result = DB()->sql_query($sql)) ) + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Couldn\'t query attachments', '', __LINE__, __FILE__, $sql); + bb_die('Could not query attachments #2'); } $attachments = DB()->sql_fetchrowset($result); @@ -480,9 +467,9 @@ if ($view == 'attachments') FROM " . BB_ATTACHMENTS . " WHERE attach_id = " . intval($attachments[$i]['attach_id']); - if ( !($result = DB()->sql_query($sql)) ) + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Couldn\'t query attachments', '', __LINE__, __FILE__, $sql); + bb_die('Could not query attachments #3'); } $ids = DB()->sql_fetchrowset($result); @@ -498,9 +485,9 @@ if ($view == 'attachments') WHERE p.post_id = " . intval($ids[$j]['post_id']) . " AND p.topic_id = t.topic_id GROUP BY t.topic_id, t.topic_title"; - if ( !($result = DB()->sql_query($sql)) ) + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Couldn\'t query topic', '', __LINE__, __FILE__, $sql); + bb_die('Could not query topic'); } $row = DB()->sql_fetchrow($result); @@ -530,18 +517,18 @@ if ($view == 'attachments') 'ROW_NUMBER' => $i + ( @$_GET['start'] + 1 ), 'ROW_CLASS' => $row_class, - 'FILENAME' => htmlspecialchars($attachments[$i]['real_filename']), - 'COMMENT' => htmlspecialchars($attachments[$i]['comment']), + 'FILENAME' => htmlspecialchars($attachments[$i]['real_filename']), + 'COMMENT' => htmlspecialchars($attachments[$i]['comment']), 'EXTENSION' => $attachments[$i]['extension'], - 'SIZE' => round(($attachments[$i]['filesize'] / MEGABYTE), 2), + 'SIZE' => round(($attachments[$i]['filesize'] / 1024), 2), 'DOWNLOAD_COUNT' => $attachments[$i]['download_count'], 'POST_TIME' => bb_date($attachments[$i]['filetime']), 'POST_TITLE' => $post_titles, 'S_DELETE_BOX' => $delete_box, 'S_HIDDEN' => $hidden_field, - 'U_VIEW_ATTACHMENT' => BB_ROOT . 'download.php?id=' . $attachments[$i]['attach_id']) - ); + 'U_VIEW_ATTACHMENT' => BB_ROOT . 'download.php?id=' . $attachments[$i]['attach_id'], + )); } } @@ -552,9 +539,9 @@ if ($view == 'attachments') { $sql = "SELECT attach_id FROM " . BB_ATTACHMENTS_DESC; - if ( !($result = DB()->sql_query($sql)) ) + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not query Attachment Description Table', '', __LINE__, __FILE__, $sql); + bb_die('Could not query attachment description table'); } $total_rows = DB()->num_rows($result); diff --git a/upload/admin/admin_attachments.php b/upload/admin/admin_attachments.php index 516ecdd8b..5cd8fb47d 100644 --- a/upload/admin/admin_attachments.php +++ b/upload/admin/admin_attachments.php @@ -14,20 +14,13 @@ require('./pagestart.php'); $error = false; -if (!intval($attach_config['allow_ftp_upload'])) +if ( ($attach_config['upload_dir'][0] == '/') || ( ($attach_config['upload_dir'][0] != '/') && ($attach_config['upload_dir'][1] == ':') ) ) { - if ( ($attach_config['upload_dir'][0] == '/') || ( ($attach_config['upload_dir'][0] != '/') && ($attach_config['upload_dir'][1] == ':') ) ) - { - $upload_dir = $attach_config['upload_dir']; - } - else - { - $upload_dir = '../' . $attach_config['upload_dir']; - } + $upload_dir = $attach_config['upload_dir']; } else { - $upload_dir = $attach_config['download_path']; + $upload_dir = '../' . $attach_config['upload_dir']; } include(BB_ROOT .'attach_mod/includes/functions_selects.php'); @@ -52,12 +45,11 @@ $check_image_cat = (isset($_POST['cat_settings'])) ? TRUE : FALSE; $search_imagick = (isset($_POST['search_imagick'])) ? TRUE : FALSE; // Re-evaluate the Attachment Configuration -$sql = 'SELECT * -FROM ' . BB_ATTACH_CONFIG; +$sql = 'SELECT * FROM ' . BB_ATTACH_CONFIG; -if(!$result = DB()->sql_query($sql)) +if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not find Attachment Config Table', '', __LINE__, __FILE__, $sql); + bb_die('Could not find attachment config table #1'); } while ($row = DB()->sql_fetchrow($result)) @@ -114,20 +106,6 @@ while ($row = DB()->sql_fetchrow($result)) $new_attach[$config_name] = ( $pm_size == 'kb' ) ? round($new_attach[$config_name] * 1024) : ( ($pm_size == 'mb') ? round($new_attach[$config_name] * 1048576) : $new_attach[$config_name] ); } - if ($config_name == 'ftp_server' || $config_name == 'ftp_path' || $config_name == 'download_path') - { - $value = trim($new_attach[$config_name]); - - if (strlen($value) && substr($value, -1) == '/') - { - if(strlen($value)) $value = substr($value, 0, strlen($value)-1); - else $value = ''; - } - - $new_attach[$config_name] = trim($value); - - } - if ($config_name == 'max_filesize') { $old_size = $attach_config[$config_name]; @@ -140,9 +118,9 @@ while ($row = DB()->sql_fetchrow($result)) SET max_filesize = ' . (int) $new_size . ' WHERE max_filesize = ' . (int) $old_size; - if ( !($result_2 = DB()->sql_query($sql)) ) + if (!($result_2 = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not update Extension Group informations', '', __LINE__, __FILE__, $sql); + bb_die('Could not update extension group information'); } } @@ -158,9 +136,9 @@ while ($row = DB()->sql_fetchrow($result)) WHERE config_name = '" . attach_mod_sql_escape($config_name) . "'"; } - if( !DB()->sql_query($sql) ) + if (!DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Failed to update attachment configuration for ' . $config_name, '', __LINE__, __FILE__, $sql); + bb_die('Failed to update attachment configuration for ' . $config_name); } if ($config_name == 'max_filesize' || $config_name == 'attachment_quota' || $config_name == 'max_filesize_pm') @@ -234,12 +212,11 @@ if ($check_upload) // Some tests... $attach_config = array(); - $sql = 'SELECT * - FROM ' . BB_ATTACH_CONFIG; + $sql = 'SELECT * FROM ' . BB_ATTACH_CONFIG; - if ( !($result = DB()->sql_query($sql)) ) + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not find Attachment Config Table', '', __LINE__, __FILE__, $sql); + bb_die('Could not find attachment config table #2'); } $row = DB()->sql_fetchrowset($result); @@ -262,112 +239,36 @@ if ($check_upload) $error = false; - // Does the target directory exist, is it a directory and writeable. (only test if ftp upload is disabled) - if (intval($attach_config['allow_ftp_upload']) == 0) + // Does the target directory exist, is it a directory and writeable + if ( !@file_exists(@amod_realpath($upload_dir)) ) { - if ( !@file_exists(@amod_realpath($upload_dir)) ) - { - $error = true; - $error_msg = sprintf($lang['DIRECTORY_DOES_NOT_EXIST'], $attach_config['upload_dir']) . '
'; - } - - if (!$error && !is_dir($upload_dir)) - { - $error = TRUE; - $error_msg = sprintf($lang['DIRECTORY_IS_NOT_A_DIR'], $attach_config['upload_dir']) . '
'; - } - - if (!$error) - { - if ( !($fp = @fopen($upload_dir . '/0_000000.000', 'w')) ) - { - $error = TRUE; - $error_msg = sprintf($lang['DIRECTORY_NOT_WRITEABLE'], $attach_config['upload_dir']) . '
'; - } - else - { - @fclose($fp); - unlink_attach($upload_dir . '/0_000000.000'); - } - } + $error = true; + $error_msg = sprintf($lang['DIRECTORY_DOES_NOT_EXIST'], $attach_config['upload_dir']) . '
'; } - else + + if (!$error && !is_dir($upload_dir)) { - // Check FTP Settings - $server = ( empty($attach_config['ftp_server']) ) ? 'localhost' : $attach_config['ftp_server']; + $error = TRUE; + $error_msg = sprintf($lang['DIRECTORY_IS_NOT_A_DIR'], $attach_config['upload_dir']) . '
'; + } - $conn_id = @ftp_connect($server); - - if (!$conn_id) + if (!$error) + { + if ( !($fp = @fopen($upload_dir . '/0_000000.000', 'w')) ) { $error = TRUE; - $error_msg = sprintf($lang['FTP_ERROR_CONNECT'], $server) . '
'; + $error_msg = sprintf($lang['DIRECTORY_NOT_WRITEABLE'], $attach_config['upload_dir']) . '
'; } - - $login_result = @ftp_login($conn_id, $attach_config['ftp_user'], $attach_config['ftp_pass']); - - if ( (!$login_result) && (!$error) ) + else { - $error = TRUE; - $error_msg = sprintf($lang['FTP_ERROR_LOGIN'], $attach_config['ftp_user']) . '
'; - } - - if (!@ftp_pasv($conn_id, intval($attach_config['ftp_pasv_mode']))) - { - $error = TRUE; - $error_msg = $lang['FTP_ERROR_PASV_MODE']; - } - - if (!$error) - { - // Check Upload - $tmpfname = @tempnam('/tmp', 't0000'); - - @unlink($tmpfname); // unlink for safety on php4.0.3+ - - $fp = @fopen($tmpfname, 'w'); - - @fwrite($fp, 'test'); - @fclose($fp); - - $result = @ftp_chdir($conn_id, $attach_config['ftp_path']); - - if (!$result) - { - $error = TRUE; - $error_msg = sprintf($lang['FTP_ERROR_PATH'], $attach_config['ftp_path']) . '
'; - } - else - { - $res = @ftp_put($conn_id, 't0000', $tmpfname, FTP_ASCII); - - if (!$res) - { - $error = TRUE; - $error_msg = sprintf($lang['FTP_ERROR_UPLOAD'], $attach_config['ftp_path']) . '
'; - } - else - { - $res = @ftp_delete($conn_id, 't0000'); - - if (!$res) - { - $error = TRUE; - $error_msg = sprintf($lang['FTP_ERROR_DELETE'], $attach_config['ftp_path']) . '
'; - } - } - } - - @ftp_quit($conn_id); - - @unlink($tmpfname); + unlink_attach($upload_dir . '/0_000000.000'); } } if (!$error) { - message_die(GENERAL_MESSAGE, $lang['TEST_SETTINGS_SUCCESSFUL'] . '

' . sprintf($lang['CLICK_RETURN_ATTACH_CONFIG'], '', '') . '

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', '')); + bb_die($lang['TEST_SETTINGS_SUCCESSFUL'] . '

' . sprintf($lang['CLICK_RETURN_ATTACH_CONFIG'], '', '') . '

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', '')); } } @@ -376,13 +277,13 @@ if ($submit && $mode == 'manage') { if (!$error) { - message_die(GENERAL_MESSAGE, $lang['ATTACH_CONFIG_UPDATED'] . '

' . sprintf($lang['CLICK_RETURN_ATTACH_CONFIG'], '', '') . '

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', '')); + bb_die($lang['ATTACH_CONFIG_UPDATED'] . '

' . sprintf($lang['CLICK_RETURN_ATTACH_CONFIG'], '', '') . '

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', '')); } } if ($mode == 'manage') { - $yes_no_switches = array('disable_mod', 'allow_pm_attach', 'allow_ftp_upload', 'display_order', 'ftp_pasv_mode'); + $yes_no_switches = array('disable_mod', 'allow_pm_attach', 'display_order'); for ($i = 0; $i < sizeof($yes_no_switches); $i++) { @@ -390,15 +291,6 @@ if ($mode == 'manage') eval("\$" . $yes_no_switches[$i] . "_no = ( \$new_attach['" . $yes_no_switches[$i] . "'] == '0' ) ? 'checked=\"checked\"' : '';"); } - if (!function_exists('ftp_connect')) - { - $template->assign_block_vars('switch_no_ftp', array()); - } - else - { - $template->assign_block_vars('switch_ftp', array()); - } - $template->assign_vars(array( 'TPL_ATTACH_MANAGE' => true, 'S_ATTACH_ACTION' => 'admin_attachments.php?mode=manage', @@ -416,19 +308,10 @@ if ($mode == 'manage') 'MAX_FILESIZE_PM' => $new_attach['max_filesize_pm'], 'MAX_ATTACHMENTS' => $new_attach['max_attachments'], 'MAX_ATTACHMENTS_PM' => $new_attach['max_attachments_pm'], - 'FTP_SERVER' => $new_attach['ftp_server'], - 'FTP_PATH' => $new_attach['ftp_path'], - 'FTP_USER' => $new_attach['ftp_user'], - 'FTP_PASS' => $new_attach['ftp_pass'], - 'DOWNLOAD_PATH' => $new_attach['download_path'], 'DISABLE_MOD_YES' => $disable_mod_yes, 'DISABLE_MOD_NO' => $disable_mod_no, 'PM_ATTACH_YES' => $allow_pm_attach_yes, 'PM_ATTACH_NO' => $allow_pm_attach_no, - 'FTP_UPLOAD_YES' => $allow_ftp_upload_yes, - 'FTP_UPLOAD_NO' => $allow_ftp_upload_no, - 'FTP_PASV_MODE_YES' => $ftp_pasv_mode_yes, - 'FTP_PASV_MODE_NO' => $ftp_pasv_mode_no, 'DISPLAY_ORDER_ASC' => $display_order_yes, 'DISPLAY_ORDER_DESC' => $display_order_no, )); @@ -438,28 +321,21 @@ if ($submit && $mode == 'cats') { if (!$error) { - message_die(GENERAL_MESSAGE, $lang['ATTACH_CONFIG_UPDATED'] . '

' . sprintf($lang['CLICK_RETURN_ATTACH_CONFIG'], '', '') . '

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', '')); + bb_die($lang['ATTACH_CONFIG_UPDATED'] . '

' . sprintf($lang['CLICK_RETURN_ATTACH_CONFIG'], '', '') . '

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', '')); } } if ($mode == 'cats') { $s_assigned_group_images = $lang['NONE']; - $s_assigned_group_streams = $lang['NONE']; - $s_assigned_group_flash = $lang['NONE']; - $sql = 'SELECT group_name, cat_id - FROM ' . BB_EXTENSION_GROUPS . ' - WHERE cat_id > 0 - ORDER BY cat_id'; + $sql = 'SELECT group_name, cat_id FROM ' . BB_EXTENSION_GROUPS . ' WHERE cat_id > 0 ORDER BY cat_id'; $s_assigned_group_images = array(); - $s_assigned_group_streams = array(); - $s_assigned_group_flash = array(); - if ( !($result = DB()->sql_query($sql)) ) + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not get Group Names from ' . BB_EXTENSION_GROUPS, '', __LINE__, __FILE__, $sql); + bb_die('Could not get group names from ' . BB_EXTENSION_GROUPS); } $row = DB()->sql_fetchrowset($result); @@ -471,14 +347,6 @@ if ($mode == 'cats') { $s_assigned_group_images[] = $row[$i]['group_name']; } - else if ($row[$i]['cat_id'] == STREAM_CAT) - { - $s_assigned_group_streams[] = $row[$i]['group_name']; - } - else if ($row[$i]['cat_id'] == SWF_CAT) - { - $s_assigned_group_flash[] = $row[$i]['group_name']; - } } $display_inlined_yes = ( $new_attach['img_display_inlined'] != '0' ) ? 'checked="checked"' : ''; @@ -515,8 +383,8 @@ if ($mode == 'cats') 'USE_GD2_YES' => $use_gd2_yes, 'USE_GD2_NO' => $use_gd2_no, 'S_ASSIGNED_GROUP_IMAGES' => implode(', ', $s_assigned_group_images), - 'S_ATTACH_ACTION' => 'admin_attachments.php?mode=cats') - ); + 'S_ATTACH_ACTION' => 'admin_attachments.php?mode=cats', + )); } // Check Cat Settings @@ -525,12 +393,11 @@ if ($check_image_cat) // Some tests... $attach_config = array(); - $sql = 'SELECT * - FROM ' . BB_ATTACH_CONFIG; + $sql = 'SELECT * FROM ' . BB_ATTACH_CONFIG; - if ( !($result = DB()->sql_query($sql)) ) + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not find Attachment Config Table', '', __LINE__, __FILE__, $sql); + bb_die('Could not find attachment config table #3'); } $row = DB()->sql_fetchrowset($result); @@ -555,127 +422,42 @@ if ($check_image_cat) $error = false; - // Does the target directory exist, is it a directory and writeable. (only test if ftp upload is disabled) - if (intval($attach_config['allow_ftp_upload']) == 0 && intval($attach_config['img_create_thumbnail']) == 1) + // Does the target directory exist, is it a directory and writeable + if ( !@file_exists(@amod_realpath($upload_dir)) ) { + @mkdir($upload_dir, 0755); + @chmod($upload_dir, 0777); + if ( !@file_exists(@amod_realpath($upload_dir)) ) - { - @mkdir($upload_dir, 0755); - @chmod($upload_dir, 0777); - - if ( !@file_exists(@amod_realpath($upload_dir)) ) - { - $error = TRUE; - $error_msg = sprintf($lang['DIRECTORY_DOES_NOT_EXIST'], $upload_dir) . '
'; - } - - } - - if (!$error && !is_dir($upload_dir)) { $error = TRUE; - $error_msg = sprintf($lang['DIRECTORY_IS_NOT_A_DIR'], $upload_dir) . '
'; - } - - if (!$error) - { - if ( !($fp = @fopen($upload_dir . '/0_000000.000', 'w')) ) - { - $error = TRUE; - $error_msg = sprintf($lang['DIRECTORY_NOT_WRITEABLE'], $upload_dir) . '
'; - } - else - { - @fclose($fp); - @unlink($upload_dir . '/0_000000.000'); - } + $error_msg = sprintf($lang['DIRECTORY_DOES_NOT_EXIST'], $upload_dir) . '
'; } } - else if (intval($attach_config['allow_ftp_upload']) && intval($attach_config['img_create_thumbnail'])) + + if (!$error && !is_dir($upload_dir)) { - // Check FTP Settings - $server = ( empty($attach_config['ftp_server']) ) ? 'localhost' : $attach_config['ftp_server']; + $error = TRUE; + $error_msg = sprintf($lang['DIRECTORY_IS_NOT_A_DIR'], $upload_dir) . '
'; + } - $conn_id = @ftp_connect($server); - - if (!$conn_id) + if (!$error) + { + if ( !($fp = @fopen($upload_dir . '/0_000000.000', 'w')) ) { $error = TRUE; - $error_msg = sprintf($lang['FTP_ERROR_CONNECT'], $server) . '
'; + $error_msg = sprintf($lang['DIRECTORY_NOT_WRITEABLE'], $upload_dir) . '
'; } - - $login_result = @ftp_login($conn_id, $attach_config['ftp_user'], $attach_config['ftp_pass']); - - if (!$login_result && !$error) + else { - $error = TRUE; - $error_msg = sprintf($lang['FTP_ERROR_LOGIN'], $attach_config['ftp_user']) . '
'; - } - - if (!@ftp_pasv($conn_id, intval($attach_config['ftp_pasv_mode']))) - { - $error = TRUE; - $error_msg = $lang['FTP_ERROR_PASV_MODE']; - } - - if (!$error) - { - // Check Upload - $tmpfname = @tempnam('/tmp', 't0000'); - - @unlink($tmpfname); // unlink for safety on php4.0.3+ - - $fp = @fopen($tmpfname, 'w'); - - @fwrite($fp, 'test'); - @fclose($fp); - - $result = @ftp_chdir($conn_id, $attach_config['ftp_path'] . '/' . THUMB_DIR); - - if (!$result) - { - @ftp_mkdir($conn_id, $attach_config['ftp_path'] . '/' . THUMB_DIR); - } - - $result = @ftp_chdir($conn_id, $attach_config['ftp_path'] . '/' . THUMB_DIR); - - if (!$result) - { - - $error = TRUE; - $error_msg = sprintf($lang['FTP_ERROR_PATH'], $attach_config['ftp_path'] . '/' . THUMB_DIR) . '
'; - } - else - { - $res = @ftp_put($conn_id, 't0000', $tmpfname, FTP_ASCII); - - if (!$res) - { - $error = TRUE; - $error_msg = sprintf($lang['FTP_ERROR_UPLOAD'], $attach_config['ftp_path'] . '/' . THUMB_DIR) . '
'; - } - else - { - $res = @ftp_delete($conn_id, 't0000'); - - if (!$res) - { - $error = TRUE; - $error_msg = sprintf($lang['FTP_ERROR_DELETE'], $attach_config['ftp_path'] . '/' . THUMB_DIR) . '
'; - } - } - } - - @ftp_quit($conn_id); - - @unlink($tmpfname); + @unlink($upload_dir . '/0_000000.000'); } } if (!$error) { - message_die(GENERAL_MESSAGE, $lang['TEST_SETTINGS_SUCCESSFUL'] . '

' . sprintf($lang['CLICK_RETURN_ATTACH_CONFIG'], '', '') . '

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', '')); + bb_die($lang['TEST_SETTINGS_SUCCESSFUL'] . '

' . sprintf($lang['CLICK_RETURN_ATTACH_CONFIG'], '', '') . '

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', '')); } } @@ -698,9 +480,9 @@ if ($submit && $mode == 'quota') SET quota_desc = '" . attach_mod_sql_escape($quota_desc_list[$i]) . "', quota_limit = " . (int) $filesize_list[$i] . " WHERE quota_limit_id = " . (int) $quota_change_list[$i]; - if ( !(DB()->sql_query($sql)) ) + if (!(DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Couldn\'t update Quota Limits', '', __LINE__, __FILE__, $sql); + bb_die('Could not update quota limits'); } } @@ -711,23 +493,19 @@ if ($submit && $mode == 'quota') if ($quota_id_sql != '') { - $sql = 'DELETE - FROM ' . BB_QUOTA_LIMITS . ' - WHERE quota_limit_id IN (' . $quota_id_sql . ')'; + $sql = 'DELETE FROM ' . BB_QUOTA_LIMITS . ' WHERE quota_limit_id IN (' . $quota_id_sql . ')'; - if ( !($result = DB()->sql_query($sql)) ) + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not delete Quota Limits', '', __LINE__, __FILE__, $sql); + bb_die('Could not delete quota limits'); } // Delete Quotas linked to this setting - $sql = 'DELETE - FROM ' . BB_QUOTA . ' - WHERE quota_limit_id IN (' . $quota_id_sql . ')'; + $sql = 'DELETE FROM ' . BB_QUOTA . ' WHERE quota_limit_id IN (' . $quota_id_sql . ')'; - if ( !($result = DB()->sql_query($sql)) ) + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not delete Quotas', '', __LINE__, __FILE__, $sql); + bb_die('Could not delete quotas'); } } @@ -740,12 +518,11 @@ if ($submit && $mode == 'quota') if ($quota_desc != '' && $add) { // check Quota Description - $sql = 'SELECT quota_desc - FROM ' . BB_QUOTA_LIMITS; + $sql = 'SELECT quota_desc FROM ' . BB_QUOTA_LIMITS; if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not query Quota Limits Table', '', __LINE__, __FILE__, $sql); + bb_die('Could not query quota limits table'); } $row = DB()->sql_fetchrowset($result); @@ -775,9 +552,9 @@ if ($submit && $mode == 'quota') $sql = "INSERT INTO " . BB_QUOTA_LIMITS . " (quota_desc, quota_limit) VALUES ('" . attach_mod_sql_escape($quota_desc) . "', " . (int) $filesize . ")"; - if ( !(DB()->sql_query($sql)) ) + if (!(DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not add Quota Limit', '', __LINE__, __FILE__, $sql); + bb_die('Could not add quota limit'); } } @@ -785,9 +562,7 @@ if ($submit && $mode == 'quota') if (!$error) { - $message = $lang['ATTACH_CONFIG_UPDATED'] . '

' . sprintf($lang['CLICK_RETURN_ATTACH_CONFIG'], '', '') . '

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', ''); - - message_die(GENERAL_MESSAGE, $message); + bb_die($lang['ATTACH_CONFIG_UPDATED'] . '

' . sprintf($lang['CLICK_RETURN_ATTACH_CONFIG'], '', '') . '

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', '')); } } @@ -810,14 +585,14 @@ if ($mode == 'quota') 'TPL_ATTACH_QUOTA' => true, 'MAX_FILESIZE' => $max_add_filesize, 'S_FILESIZE' => size_select('add_size_select', $size), - 'S_ATTACH_ACTION' => 'admin_attachments.php?mode=quota') - ); + 'S_ATTACH_ACTION' => 'admin_attachments.php?mode=quota', + )); $sql = "SELECT * FROM " . BB_QUOTA_LIMITS . " ORDER BY quota_limit DESC"; - if ( !($result = DB()->sql_query($sql)) ) + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not get quota limits', '', __LINE__, __FILE__, $sql); + bb_die('Could not get quota limits #1'); } $rows = DB()->sql_fetchrowset($result); @@ -841,8 +616,8 @@ if ($mode == 'quota') 'QUOTA_ID' => $rows[$i]['quota_limit_id'], 'S_FILESIZE' => size_select('size_select_list[]', $size_format), 'U_VIEW' => "admin_attachments.php?mode=$mode&e_mode=view_quota&quota_id=" . $rows[$i]['quota_limit_id'], - 'MAX_FILESIZE' => $rows[$i]['quota_limit']) - ); + 'MAX_FILESIZE' => $rows[$i]['quota_limit'], + )); } } @@ -852,16 +627,16 @@ if ($mode == 'quota' && $e_mode == 'view_quota') if (!$quota_id) { - message_die(GENERAL_MESSAGE, 'Invalid Call'); + bb_die('Invalid call'); } $template->assign_block_vars('switch_quota_limit_desc', array()); $sql = "SELECT * FROM " . BB_QUOTA_LIMITS . " WHERE quota_limit_id = " . (int) $quota_id . " LIMIT 1"; - if ( !($result = DB()->sql_query($sql)) ) + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not get quota limits', '', __LINE__, __FILE__, $sql); + bb_die('Could not get quota limits #2'); } $row = DB()->sql_fetchrow($result); @@ -877,9 +652,9 @@ if ($mode == 'quota' && $e_mode == 'view_quota') AND q.user_id <> 0 AND q.user_id = u.user_id'; - if ( !($result = DB()->sql_query($sql)) ) + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not get quota limits', '', __LINE__, __FILE__, $sql); + bb_die('Could not get quota limits #3'); } $rows = DB()->sql_fetchrowset($result); @@ -892,15 +667,15 @@ if ($mode == 'quota' && $e_mode == 'view_quota') { $template->assign_block_vars('users_upload_row', array( 'USER_ID' => $rows[$i]['user_id'], - 'USERNAME' => $rows[$i]['username']) - ); + 'USERNAME' => $rows[$i]['username'], + )); } else if ($rows[$i]['quota_type'] == QUOTA_PM_LIMIT) { $template->assign_block_vars('users_pm_row', array( 'USER_ID' => $rows[$i]['user_id'], - 'USERNAME' => $rows[$i]['username']) - ); + 'USERNAME' => $rows[$i]['username'], + )); } } @@ -910,9 +685,9 @@ if ($mode == 'quota' && $e_mode == 'view_quota') AND q.group_id <> 0 AND q.group_id = g.group_id'; - if ( !($result = DB()->sql_query($sql)) ) + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not get quota limits', '', __LINE__, __FILE__, $sql); + bb_die('Could not get quota limits #4'); } $rows = DB()->sql_fetchrowset($result); @@ -925,15 +700,15 @@ if ($mode == 'quota' && $e_mode == 'view_quota') { $template->assign_block_vars('groups_upload_row', array( 'GROUP_ID' => $rows[$i]['group_id'], - 'GROUPNAME' => $rows[$i]['group_name']) - ); + 'GROUPNAME' => $rows[$i]['group_name'], + )); } else if ($rows[$i]['quota_type'] == QUOTA_PM_LIMIT) { $template->assign_block_vars('groups_pm_row', array( 'GROUP_ID' => $rows[$i]['group_id'], - 'GROUPNAME' => $rows[$i]['group_name']) - ); + 'GROUPNAME' => $rows[$i]['group_name'], + )); } } } diff --git a/upload/admin/admin_board.php b/upload/admin/admin_board.php index dfc417156..2115dcc4e 100644 --- a/upload/admin/admin_board.php +++ b/upload/admin/admin_board.php @@ -26,7 +26,7 @@ $return_links = array( $sql = "SELECT * FROM " . BB_CONFIG; if(!$result = DB()->sql_query($sql)) { - message_die(CRITICAL_ERROR, "Could not query config information in admin_board", "", __LINE__, __FILE__, $sql); + bb_die('Could not query config information in admin_board'); } else { @@ -47,16 +47,9 @@ else } } - if( isset($_POST['submit']) ) + if (isset($_POST['submit'])) { - if ($mode == 'config') - { - message_die(GENERAL_MESSAGE, $lang['CONFIG_UPDATED'] . $return_links['config'] . $return_links['index']); - } - elseif ($mode == 'config_mods') - { - message_die(GENERAL_MESSAGE, $lang['CONFIG_UPDATED'] . $return_links['config_mods'] . $return_links['index']); - } + bb_die($lang['CONFIG_UPDATED'] . $return_links[$mode] . $return_links['index']); } } diff --git a/upload/admin/admin_bt_forum_cfg.php b/upload/admin/admin_bt_forum_cfg.php index b6b7da94b..f87a0c09b 100644 --- a/upload/admin/admin_bt_forum_cfg.php +++ b/upload/admin/admin_bt_forum_cfg.php @@ -79,8 +79,7 @@ if ($submit && $confirm) $datastore->update('cat_forums'); - $message = $lang['CONFIG_UPD'] .'

'. sprintf($lang['RETURN_CONFIG'], '', '') .'

'. sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', ''); - message_die(GENERAL_MESSAGE, $message); + bb_die($lang['CONFIG_UPD'] .'

'. sprintf($lang['RETURN_CONFIG'], '', '') .'

'. sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', '')); } // Set template vars @@ -103,7 +102,7 @@ $sql = "SELECT f.* if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not obtain forum names', '', __LINE__, __FILE__, $sql); + bb_die('Could not obtain forum names'); } $rowset = DB()->sql_fetchrowset($result); diff --git a/upload/admin/admin_bt_tracker_cfg.php b/upload/admin/admin_bt_tracker_cfg.php index 8760f5dc5..ec8034372 100644 --- a/upload/admin/admin_bt_tracker_cfg.php +++ b/upload/admin/admin_bt_tracker_cfg.php @@ -20,7 +20,7 @@ $confirmed = isset($_POST['confirm']); // All config names with default values $default_cfg_str = array( 'off_reason' => 'Tracker is disabled', - 'browser_redirect_url' => 'http://yourdomain.com/', + 'browser_redirect_url' => 'http://demo.torrentpier.me/', ); $default_cfg_bool = array( @@ -60,7 +60,7 @@ $template->assign_vars(array( 'DISABLE_SUBMIT' => true, 'S_HIDDEN_FIELDS' => '', - 'S_CONFIG_ACTION' => "admin_bt_tracker_cfg.php", + 'S_CONFIG_ACTION' => 'admin_bt_tracker_cfg.php', )); print_page('admin_bt_tracker_cfg.tpl', 'admin'); \ No newline at end of file diff --git a/upload/admin/admin_cron.php b/upload/admin/admin_cron.php index 246eb6e3a..0bed68c94 100644 --- a/upload/admin/admin_cron.php +++ b/upload/admin/admin_cron.php @@ -188,8 +188,7 @@ switch($mode) case 'delete': delete_jobs($job_id); - $message = $lang['JOB_REMOVED'] . '

' . sprintf($lang['CLICK_RETURN_JOBS'], '', '') . '

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', ''); - message_die(GENERAL_MESSAGE, $message); + bb_die($lang['JOB_REMOVED'] . '

' . sprintf($lang['CLICK_RETURN_JOBS'], '', '') . '

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', '')); break; } @@ -221,14 +220,13 @@ if ($submit) { insert_cron_job($_POST); } - else bb_die(); + else bb_die('Mode error'); redirect('admin/'.basename(__FILE__) . '?mode=list'); } else { - $message = validate_cron_post($_POST); - message_die(GENERAL_MESSAGE, $message); + bb_die(validate_cron_post($_POST)); } } diff --git a/upload/admin/admin_disallow.php b/upload/admin/admin_disallow.php index 6ec4dfc3b..a025ca965 100644 --- a/upload/admin/admin_disallow.php +++ b/upload/admin/admin_disallow.php @@ -19,7 +19,7 @@ if( isset($_POST['add_name']) ) if ($disallowed_user == '') { - message_die(GENERAL_MESSAGE, $lang['FIELDS_EMPTY']); + bb_die($lang['FIELDS_EMPTY']); } if( !validate_username($disallowed_user) ) { @@ -27,19 +27,18 @@ if( isset($_POST['add_name']) ) } else { - $sql = "INSERT INTO " . BB_DISALLOW . " (disallow_username) - VALUES('" . DB()->escape($disallowed_user) . "')"; + $sql = "INSERT INTO " . BB_DISALLOW . " (disallow_username) VALUES('" . DB()->escape($disallowed_user) . "')"; $result = DB()->sql_query( $sql ); - if ( !$result ) + if (!$result) { - message_die(GENERAL_ERROR, "Could not add disallowed user.", '',__LINE__, __FILE__, $sql); + bb_die('Could not add disallowed user'); } $message = $lang['DISALLOW_SUCCESSFUL']; } $message .= '

'. sprintf($lang['CLICK_RETURN_DISALLOWADMIN'], '', '') . '

'. sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', ''); - message_die(GENERAL_MESSAGE, $message); + bb_die($message); } elseif (isset($_POST['delete_name'])) { @@ -47,14 +46,14 @@ elseif (isset($_POST['delete_name'])) $sql = "DELETE FROM " . BB_DISALLOW . " WHERE disallow_id = $disallowed_id"; $result = DB()->sql_query($sql); - if( !$result ) + if (!$result) { - message_die(GENERAL_ERROR, "Couldn't removed disallowed user.", '',__LINE__, __FILE__, $sql); + bb_die('Could not removed disallowed user'); } $message .= $lang['DISALLOWED_DELETED'] .'

'. sprintf($lang['CLICK_RETURN_DISALLOWADMIN'], '', '') .'

'. sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', ''); - message_die(GENERAL_MESSAGE, $message); + bb_die($message); } @@ -63,9 +62,9 @@ elseif (isset($_POST['delete_name'])) // $sql = "SELECT * FROM " . BB_DISALLOW; $result = DB()->sql_query($sql); -if( !$result ) +if (!$result) { - message_die(GENERAL_ERROR, "Couldn't get disallowed users.", '', __LINE__, __FILE__, $sql ); + bb_die('Could not get disallowed users'); } $disallowed = DB()->sql_fetchrowset($result); @@ -92,7 +91,7 @@ $disallow_select .= ''; $template->assign_vars(array( 'S_DISALLOW_SELECT' => $disallow_select, - 'S_FORM_ACTION' => "admin_disallow.php", + 'S_FORM_ACTION' => 'admin_disallow.php', )); print_page('admin_disallow.tpl', 'admin'); \ No newline at end of file diff --git a/upload/admin/admin_extensions.php b/upload/admin/admin_extensions.php index 479ea1316..a9c1524d4 100644 --- a/upload/admin/admin_extensions.php +++ b/upload/admin/admin_extensions.php @@ -17,20 +17,13 @@ register_shutdown_function('update_attach_extensions'); require('./pagestart.php'); // ACP Header - END -if (!intval($attach_config['allow_ftp_upload'])) +if ( ($attach_config['upload_dir'][0] == '/') || ( ($attach_config['upload_dir'][0] != '/') && ($attach_config['upload_dir'][1] == ':') ) ) { - if ( ($attach_config['upload_dir'][0] == '/') || ( ($attach_config['upload_dir'][0] != '/') && ($attach_config['upload_dir'][1] == ':') ) ) - { - $upload_dir = $attach_config['upload_dir']; - } - else - { - $upload_dir = BB_ROOT . $attach_config['upload_dir']; - } + $upload_dir = $attach_config['upload_dir']; } else { - $upload_dir = $attach_config['download_path']; + $upload_dir = BB_ROOT . $attach_config['upload_dir']; } include(BB_ROOT .'attach_mod/includes/functions_selects.php'); @@ -46,8 +39,8 @@ if (!isset($lang['TEST_SETTINGS_SUCCESSFUL'])) $types_download = array(INLINE_LINK, PHYSICAL_LINK); $modes_download = array('inline', 'physical'); -$types_category = array(IMAGE_CAT, STREAM_CAT, SWF_CAT); -$modes_category = array($lang['CATEGORY_IMAGES'], $lang['CATEGORY_STREAM_FILES'], $lang['CATEGORY_SWF_FILES']); +$types_category = array(IMAGE_CAT); +$modes_category = array($lang['CATEGORY_IMAGES']); $size = get_var('size', ''); $mode = get_var('mode', ''); @@ -60,9 +53,9 @@ $attach_config = array(); $sql = 'SELECT * FROM '. BB_ATTACH_CONFIG; -if ( !($result = DB()->sql_query($sql)) ) +if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not query attachment information', '', __LINE__, __FILE__, $sql); + bb_die('Could not query attachment information'); } while ($row = DB()->sql_fetchrow($result)) @@ -89,9 +82,9 @@ if ($submit && $mode == 'extensions') } $sql = 'SELECT * FROM ' . BB_EXTENSIONS . ' ORDER BY ext_id'; - if ( !($result = DB()->sql_query($sql)) ) + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Couldn\'t get Extension Informations.', '', __LINE__, __FILE__, $sql); + bb_die('Could not get extension informations #1'); } $num_rows = DB()->num_rows($result); @@ -114,7 +107,7 @@ if ($submit && $mode == 'extensions') if (!DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Couldn\'t update Extension Informations', '', __LINE__, __FILE__, $sql); + bb_die('Could not update extension informations'); } } } @@ -127,13 +120,11 @@ if ($submit && $mode == 'extensions') if ($extension_id_sql != '') { - $sql = 'DELETE - FROM ' . BB_EXTENSIONS . ' - WHERE ext_id IN (' . $extension_id_sql . ')'; + $sql = 'DELETE FROM ' . BB_EXTENSIONS . ' WHERE ext_id IN (' . $extension_id_sql . ')'; if( !$result = DB()->sql_query($sql) ) { - message_die(GENERAL_ERROR, 'Could not delete Extensions', '', __LINE__, __FILE__, $sql); + bb_die('Could not delete extensions'); } } @@ -146,19 +137,18 @@ if ($submit && $mode == 'extensions') if ($extension != '' && $add) { $template->assign_vars(array( - 'ADD_EXTENSION' => $extension, - 'ADD_EXTENSION_EXPLAIN' => $extension_explain) - ); + 'ADD_EXTENSION' => $extension, + 'ADD_EXTENSION_EXPLAIN' => $extension_explain, + )); if (!@$error) { // check extension - $sql = 'SELECT extension - FROM ' . BB_EXTENSIONS; + $sql = 'SELECT extension FROM ' . BB_EXTENSIONS; if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not query Extensions', '', __LINE__, __FILE__, $sql); + bb_die('Could not query extensions'); } $row = DB()->sql_fetchrowset($result); @@ -193,7 +183,7 @@ if ($submit && $mode == 'extensions') if (!DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not add Extension', '', __LINE__, __FILE__, $sql); + bb_die('Could not add extension'); } } @@ -202,9 +192,7 @@ if ($submit && $mode == 'extensions') if (!@$error) { - $message = $lang['ATTACH_CONFIG_UPDATED'] . '

' . sprintf($lang['CLICK_RETURN_ATTACH_CONFIG'], '', '') . '

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', ''); - - message_die(GENERAL_MESSAGE, $message); + bb_die($lang['ATTACH_CONFIG_UPDATED'] . '

' . sprintf($lang['CLICK_RETURN_ATTACH_CONFIG'], '', '') . '

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', '')); } } @@ -213,9 +201,9 @@ if ($mode == 'extensions') // Extensions $template->assign_vars(array( 'TPL_ATTACH_EXTENSIONS' => true, - 'S_CANCEL_ACTION' => "admin_extensions.php?mode=extensions", - 'S_ATTACH_ACTION' => "admin_extensions.php?mode=extensions") - ); + 'S_CANCEL_ACTION' => 'admin_extensions.php?mode=extensions', + 'S_ATTACH_ACTION' => 'admin_extensions.php?mode=extensions', + )); if ($submit) { @@ -230,13 +218,11 @@ if ($mode == 'extensions') ); } - $sql = 'SELECT * - FROM ' . BB_EXTENSIONS . ' - ORDER BY group_id'; + $sql = 'SELECT * FROM ' . BB_EXTENSIONS . ' ORDER BY group_id'; if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Couldn\'t get Extension informations', '', __LINE__, __FILE__, $sql); + bb_die('Could not get extension informations #2'); } $extension_row = DB()->sql_fetchrowset($result); @@ -318,7 +304,7 @@ if ($submit && $mode == 'groups') if (!(DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Couldn\'t update Extension Groups Informations', '', __LINE__, __FILE__, $sql); + bb_die('Could not update extension groups informations'); } } @@ -335,7 +321,7 @@ if ($submit && $mode == 'groups') if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not delete Extension Groups', '', __LINE__, __FILE__, $sql); + bb_die('Could not delete extension groups'); } // Set corresponding Extensions to a pending Group @@ -345,7 +331,7 @@ if ($submit && $mode == 'groups') if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not assign Extensions to Pending Group.', '', __LINE__, __FILE__, $sql); + bb_die('Could not assign extensions to pending group'); } } @@ -363,12 +349,11 @@ if ($submit && $mode == 'groups') if ($extension_group != '' && $add) { // check Extension Group - $sql = 'SELECT group_name - FROM ' . BB_EXTENSION_GROUPS; + $sql = 'SELECT group_name FROM ' . BB_EXTENSION_GROUPS; if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not query Extension Groups Table', '', __LINE__, __FILE__, $sql); + bb_die('Could not query extension groups table'); } $row = DB()->sql_fetchrowset($result); @@ -409,7 +394,7 @@ if ($submit && $mode == 'groups') if (!(DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not add Extension Group', '', __LINE__, __FILE__, $sql); + bb_die('Could not add extension group'); } } @@ -417,9 +402,7 @@ if ($submit && $mode == 'groups') if (!@$error) { - $message = $lang['ATTACH_CONFIG_UPDATED'] . '

' . sprintf($lang['CLICK_RETURN_ATTACH_CONFIG'], '', '') . '

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', ''); - - message_die(GENERAL_MESSAGE, $message); + bb_die($lang['ATTACH_CONFIG_UPDATED'] . '

' . sprintf($lang['CLICK_RETURN_ATTACH_CONFIG'], '', '') . '

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', '')); } } @@ -455,12 +438,11 @@ if ($mode == 'groups') 'S_ATTACH_ACTION' => "admin_extensions.php?mode=groups") ); - $sql = 'SELECT * - FROM ' . BB_EXTENSION_GROUPS; + $sql = 'SELECT * FROM ' . BB_EXTENSION_GROUPS; if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Couldn\'t get Extension Group informations', '', __LINE__, __FILE__, $sql); + bb_die('Could not get extension group informations'); } $extension_group = DB()->sql_fetchrowset($result); @@ -506,13 +488,11 @@ if ($mode == 'groups') if ($viewgroup && $viewgroup == $extension_group[$i]['group_id']) { - $sql = 'SELECT comment, extension - FROM ' . BB_EXTENSIONS . ' - WHERE group_id = ' . (int) $viewgroup; + $sql = 'SELECT comment, extension FROM ' . BB_EXTENSIONS . ' WHERE group_id = ' . (int) $viewgroup; if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Couldn\'t get Extension informations', '', __LINE__, __FILE__, $sql); + bb_die('Could not get extension informations #3'); } $extension = DB()->sql_fetchrowset($result); @@ -551,7 +531,7 @@ if (@$add_forum && $e_mode == 'perm' && $group) for ($i = 0; $i < sizeof($add_forums_list); $i++) { - if ($add_forums_list[$i] == GPERM_ALL) + if ($add_forums_list[$i] == 0) { $add_all_forums = TRUE; } @@ -563,7 +543,7 @@ if (@$add_forum && $e_mode == 'perm' && $group) $sql = 'UPDATE ' . BB_EXTENSION_GROUPS . " SET forum_permissions = '' WHERE group_id = " . (int) $group; if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not update Permissions', '', __LINE__, __FILE__, $sql); + bb_die('Could not update permissions #1'); } } @@ -577,7 +557,7 @@ if (@$add_forum && $e_mode == 'perm' && $group) if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not get Group Permissions from ' . BB_EXTENSION_GROUPS, '', __LINE__, __FILE__, $sql); + bb_die('Could not get group permissions from ' . BB_EXTENSION_GROUPS); } $row = DB()->sql_fetchrow($result); @@ -607,7 +587,7 @@ if (@$add_forum && $e_mode == 'perm' && $group) if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not update Permissions', '', __LINE__, __FILE__, $sql); + bb_die('Could not update permissions #2'); } } @@ -626,7 +606,7 @@ if (@$delete_forum && $e_mode == 'perm' && $group) if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not get Group Permissions from ' . BB_EXTENSION_GROUPS, '', __LINE__, __FILE__, $sql); + bb_die('Could not get group permissions from ' . BB_EXTENSION_GROUPS); } $row = DB()->sql_fetchrow($result); @@ -650,7 +630,7 @@ if (@$delete_forum && $e_mode == 'perm' && $group) if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not update Permissions', '', __LINE__, __FILE__, $sql); + bb_die('Could not update permissions #3'); } } @@ -664,7 +644,7 @@ if ($e_mode == 'perm' && $group) if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not get Group Name from ' . BB_EXTENSION_GROUPS, '', __LINE__, __FILE__, $sql); + bb_die('Could not get group name from ' . BB_EXTENSION_GROUPS); } $row = DB()->sql_fetchrow($result); @@ -686,9 +666,9 @@ if ($e_mode == 'perm' && $group) $act_id = 0; $forum_p = auth_unpack($allowed_forums); $sql = "SELECT forum_id, forum_name FROM " . BB_FORUMS . " WHERE forum_id IN (" . implode(', ', $forum_p) . ")"; - if ( !($result = DB()->sql_query($sql)) ) + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not get Forum Names', '', __LINE__, __FILE__, $sql); + bb_die('Could not get forum names'); } while ($row = DB()->sql_fetchrow($result)) @@ -713,13 +693,13 @@ if ($e_mode == 'perm' && $group) 'A_PERM_ACTION' => "admin_extensions.php?mode=groups&e_mode=perm&e_group=$group") ); - $forum_option_values = array(GPERM_ALL => $lang['PERM_ALL_FORUMS']); + $forum_option_values = array(0 => $lang['PERM_ALL_FORUMS']); $sql = "SELECT forum_id, forum_name FROM " . BB_FORUMS; - if ( !($result = DB()->sql_query($sql)) ) + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not get Forums', '', __LINE__, __FILE__, $sql); + bb_die('Could not get forums #1'); } while ($row = DB()->sql_fetchrow($result)) @@ -740,9 +720,9 @@ if ($e_mode == 'perm' && $group) $sql = "SELECT forum_id, forum_name FROM " . BB_FORUMS . " WHERE auth_attachments < " . AUTH_ADMIN; - if ( !($f_result = DB()->sql_query($sql)) ) + if (!($f_result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not get Forums.', '', __LINE__, __FILE__, $sql); + bb_die('Could not get forums #2'); } while ($row = DB()->sql_fetchrow($f_result)) @@ -754,9 +734,9 @@ if ($e_mode == 'perm' && $group) WHERE allow_group = 1 ORDER BY group_name ASC"; - if ( !($result = DB()->sql_query($sql)) ) + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not query Extension Groups.', '', __LINE__, __FILE__, $sql); + bb_die('Could not query extension groups'); } $rows = DB()->sql_fetchrowset($result); diff --git a/upload/admin/admin_forum_prune.php b/upload/admin/admin_forum_prune.php index d4d4c70c1..f6d85a94b 100644 --- a/upload/admin/admin_forum_prune.php +++ b/upload/admin/admin_forum_prune.php @@ -14,20 +14,15 @@ $all_forums = -1; $pruned_total = 0; $prune_performed = false; -function return_msg_prune ($status_msg) -{ - return $status_msg; -} - if (isset($_REQUEST['submit'])) { if (!$var =& $_REQUEST['f'] OR !$f_selected = get_id_ary($var)) { - message_die(GENERAL_MESSAGE, return_msg_prune('Forum not selected')); + bb_die('Forum not selected'); } if (!$var =& $_REQUEST['prunedays'] OR !$prunedays = abs(intval($var))) { - message_die(GENERAL_MESSAGE, return_msg_prune($lang['NOT_DAYS'])); + bb_die($lang['NOT_DAYS']); } $prunetime = TIMENOW - 86400*$prunedays; @@ -51,11 +46,11 @@ if (isset($_REQUEST['submit'])) } if (!$prune_performed) { - message_die(GENERAL_MESSAGE, return_msg_prune($lang['NONE_SELECTED'])); + bb_die($lang['NONE_SELECTED']); } if (!$pruned_total) { - message_die(GENERAL_MESSAGE, return_msg_prune($lang['NO_SEARCH_MATCH'])); + bb_die($lang['NO_SEARCH_MATCH']); } } diff --git a/upload/admin/admin_forumauth.php b/upload/admin/admin_forumauth.php index 401b5c0ed..04b685659 100644 --- a/upload/admin/admin_forumauth.php +++ b/upload/admin/admin_forumauth.php @@ -99,13 +99,13 @@ if( isset($_POST['submit']) ) } else { - for($i = 0; $i < count($forum_auth_fields); $i++) + for ($i = 0; $i < count($forum_auth_fields); $i++) { $value = intval($_POST[$forum_auth_fields[$i]]); - if ( $forum_auth_fields[$i] == 'auth_vote' ) + if ($forum_auth_fields[$i] == 'auth_vote') { - if ( $_POST['auth_vote'] == AUTH_ALL ) + if ($_POST['auth_vote'] == AUTH_ALL) { $value = AUTH_REG; } @@ -117,11 +117,11 @@ if( isset($_POST['submit']) ) $sql = "UPDATE " . BB_FORUMS . " SET $sql WHERE forum_id = $forum_id"; } - if ( $sql != '' ) + if ($sql != '') { - if ( !DB()->sql_query($sql) ) + if (!DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not update auth table', '', __LINE__, __FILE__, $sql); + bb_die('Could not update auth table'); } } @@ -130,8 +130,7 @@ if( isset($_POST['submit']) ) } $datastore->update('cat_forums'); - $message = $lang['FORUM_AUTH_UPDATED'] . '

' . sprintf($lang['CLICK_RETURN_FORUMAUTH'], '', ""); - message_die(GENERAL_MESSAGE, $message); + bb_die($lang['FORUM_AUTH_UPDATED'] . '

' . sprintf($lang['CLICK_RETURN_FORUMAUTH'], '', "")); } // End of submit @@ -158,14 +157,14 @@ else $forum_name = $forum_rows[0]['forum_name']; @reset($simple_auth_ary); - while( list($key, $auth_levels) = each($simple_auth_ary)) + while (list($key, $auth_levels) = each($simple_auth_ary)) { $matched = 1; - for($k = 0; $k < count($auth_levels); $k++) + for ($k = 0; $k < count($auth_levels); $k++) { $matched_type = $key; - if ( $forum_rows[0][$forum_auth_fields[$k]] != $auth_levels[$k] ) + if ($forum_rows[0][$forum_auth_fields[$k]] != $auth_levels[$k]) { $matched = 0; } @@ -188,7 +187,7 @@ else $s_column_span = 0; - if ( empty($adv) ) + if (empty($adv)) { $simple_auth = ''; - for($k = 0; $k < count($forum_auth_levels); $k++) + for ($k = 0; $k < count($forum_auth_levels); $k++) { $selected = ( $forum_rows[0][$forum_auth_fields[$j]] == $forum_auth_const[$k] ) ? ' selected="selected"' : ''; $custom_auth[$j] .= ''; diff --git a/upload/admin/admin_forumauth_list.php b/upload/admin/admin_forumauth_list.php index 29d394d69..54ffe4478 100644 --- a/upload/admin/admin_forumauth_list.php +++ b/upload/admin/admin_forumauth_list.php @@ -129,11 +129,11 @@ if( isset($_POST['submit']) ) $sql = "UPDATE " . BB_FORUMS . " SET $sql WHERE forum_id = $forum_id"; } - if ( $sql != '' ) + if ($sql != '') { - if ( !DB()->sql_query($sql) ) + if (!DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not update auth table', '', __LINE__, __FILE__, $sql); + bb_die('Could not update auth table #1'); } } @@ -142,11 +142,11 @@ if( isset($_POST['submit']) ) } elseif (!empty($cat_id)) { - for($i = 0; $i < count($forum_auth_fields); $i++) + for ($i = 0; $i < count($forum_auth_fields); $i++) { $value = intval($_POST[$forum_auth_fields[$i]]); - if ( $forum_auth_fields[$i] == 'auth_vote' ) + if ($forum_auth_fields[$i] == 'auth_vote') { if ( $_POST['auth_vote'] == AUTH_ALL ) { @@ -159,11 +159,11 @@ if( isset($_POST['submit']) ) $sql = "UPDATE " . BB_FORUMS . " SET $sql WHERE cat_id = $cat_id"; - if ( $sql != '' ) + if ($sql != '') { - if ( !DB()->sql_query($sql) ) + if (!DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not update auth table', '', __LINE__, __FILE__, $sql); + bb_die('Could not update auth table #2'); } } @@ -171,8 +171,7 @@ if( isset($_POST['submit']) ) } $datastore->update('cat_forums'); - $message = $lang['FORUM_AUTH_UPDATED'] . '

' . sprintf($lang['CLICK_RETURN_FORUMAUTH'], '', ""); - message_die(GENERAL_MESSAGE, $message); + bb_die($lang['FORUM_AUTH_UPDATED'] . '

' . sprintf($lang['CLICK_RETURN_FORUMAUTH'], '', "")); } // End of submit @@ -186,9 +185,9 @@ $sql = "SELECT f.* WHERE c.cat_id = f.cat_id $forum_sql $cat_sql ORDER BY c.cat_order ASC, f.forum_order ASC"; -if ( !($result = DB()->sql_query($sql)) ) +if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, "Couldn't obtain forum list", "", __LINE__, __FILE__, $sql); + bb_die('Could not obtain forum list'); } $forum_rows = DB()->sql_fetchrowset($result); @@ -205,20 +204,20 @@ if( empty($forum_id) && empty($cat_id) ) 'S_COLUMN_SPAN' => count($forum_auth_fields)+1, )); - for ($i=0; $iassign_block_vars('forum_auth_titles', array( - 'CELL_TITLE' => $field_names[$forum_auth_fields[$i]]) - ); + 'CELL_TITLE' => $field_names[$forum_auth_fields[$i]], + )); } // Obtain the category list $sql = "SELECT c.cat_id, c.cat_title, c.cat_order FROM " . BB_CATEGORIES . " c ORDER BY c.cat_order"; - if( !($result = DB()->sql_query($sql)) ) + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not query categories list', '', __LINE__, __FILE__, $sql); + bb_die('Could not query categories list #1'); } $category_rows = DB()->sql_fetchrowset($result); @@ -274,11 +273,11 @@ else // first display the current details for all forums // in the category // - for ($i=0; $iassign_block_vars('forum_auth_titles', array( - 'CELL_TITLE' => $field_names[$forum_auth_fields[$i]]) - ); + 'CELL_TITLE' => $field_names[$forum_auth_fields[$i]], + )); } // obtain the category list @@ -286,9 +285,9 @@ else FROM " . BB_CATEGORIES . " c WHERE c.cat_id = $cat_id ORDER BY c.cat_order"; - if( !($result = DB()->sql_query($sql)) ) + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not query categories list', '', __LINE__, __FILE__, $sql); + bb_die('Could not query categories list #2'); } $category_rows = DB()->sql_fetchrowset($result); diff --git a/upload/admin/admin_forums.php b/upload/admin/admin_forums.php index fe819c431..4ff8e6b2c 100644 --- a/upload/admin/admin_forums.php +++ b/upload/admin/admin_forums.php @@ -192,14 +192,14 @@ if ($mode) if (!$forum_name) { - message_die(GENERAL_ERROR, "Can't create a forum without a name"); + bb_die('Can not create a forum without a name'); } if ($forum_parent) { if (!$parent = get_forum_data($forum_parent)) { - message_die(GENERAL_ERROR, "Parent forum with id=$forum_parent not found"); + bb_die('Parent forum with id '. $forum_parent .' not found'); } $cat_id = $parent['cat_id']; @@ -233,8 +233,7 @@ if ($mode) $datastore->update('cat_forums'); CACHE('bb_cache')->rm(); - $message = $lang['FORUMS_UPDATED'] . '

' . sprintf($lang['CLICK_RETURN_FORUMADMIN'], '', '') . '

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', ''); - message_die(GENERAL_MESSAGE, $message); + bb_die($lang['FORUMS_UPDATED'] . '

' . sprintf($lang['CLICK_RETURN_FORUMADMIN'], '', '') . '

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', '')); break; @@ -265,14 +264,14 @@ if ($mode) if (!$forum_name) { - message_die(GENERAL_ERROR, "Can't modify a forum without a name"); + bb_die('Can not modify a forum without a name'); } if ($forum_parent) { if (!$parent = get_forum_data($forum_parent)) { - message_die(GENERAL_ERROR, "Parent forum with id=$forum_parent not found"); + bb_die('Parent forum with id '. $forum_parent .' not found'); } $cat_id = $parent['cat_id']; @@ -281,7 +280,7 @@ if ($mode) if ($forum_id == $forum_parent) { - message_die(GENERAL_ERROR, "Ambiguous forum ID's. Please select other parent forum", '', __LINE__, __FILE__); + bb_die('Ambiguous forum ID. Please select other parent forum'); } } else if ($cat_id != $old_cat_id) @@ -333,7 +332,7 @@ if ($mode) $message = $lang['FORUMS_UPDATED'] . '

'; $message .= ($fix) ? "$fix

" : ''; $message .= sprintf($lang['CLICK_RETURN_FORUMADMIN'], '', '') . '

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', ''); - message_die(GENERAL_MESSAGE, $message); + bb_die($message); break; @@ -360,8 +359,7 @@ if ($mode) $datastore->update('cat_forums'); CACHE('bb_cache')->rm(); - $message = $lang['FORUMS_UPDATED'] . '

' . sprintf($lang['CLICK_RETURN_FORUMADMIN'], '', '') . '

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', ''); - message_die(GENERAL_MESSAGE, $message); + bb_die($lang['FORUMS_UPDATED'] . '

' . sprintf($lang['CLICK_RETURN_FORUMADMIN'], '', '') . '

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', '')); break; @@ -417,8 +415,7 @@ if ($mode) $datastore->update('cat_forums'); CACHE('bb_cache')->rm(); - $message = $lang['FORUMS_UPDATED'] . '

' . sprintf($lang['CLICK_RETURN_FORUMADMIN'], '', '') . '

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', ''); - message_die(GENERAL_MESSAGE, $message); + bb_die($lang['FORUMS_UPDATED'] . '

' . sprintf($lang['CLICK_RETURN_FORUMADMIN'], '', '') . '

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', '')); break; @@ -473,7 +470,7 @@ if ($mode) if (DB()->num_rows($result) != 2) { - message_die(GENERAL_ERROR, "Ambiguous forum ID's", "", __LINE__, __FILE__); + bb_die('Ambiguous forum ID'); } DB()->query("UPDATE ". BB_TOPICS ." SET forum_id = $to_id WHERE forum_id = $from_id"); @@ -510,15 +507,12 @@ if ($mode) $datastore->update('cat_forums'); CACHE('bb_cache')->rm(); - $message = $lang['FORUMS_UPDATED'] . '

' . sprintf($lang['CLICK_RETURN_FORUMADMIN'], '', '') . '

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', ''); - message_die(GENERAL_MESSAGE, $message); + bb_die($lang['FORUMS_UPDATED'] . '

' . sprintf($lang['CLICK_RETURN_FORUMADMIN'], '', '') . '

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', '')); break; case 'deletecat': - // // Show form to delete a category - // $cat_id = (int) $_GET['c']; $catinfo = get_info('category', $cat_id); $categories_count = $catinfo['number']; @@ -529,7 +523,7 @@ if ($mode) if ($row['forums_count'] > 0) { - message_die(GENERAL_ERROR, $lang['MUST_DELETE_FORUMS']); + bb_die($lang['MUST_DELETE_FORUMS']); } else { @@ -558,9 +552,7 @@ if ($mode) break; case 'movedelcat': - // // Move or delete a category in the DB - // $from_id = (int) $_POST['from_id']; $to_id = (int) $_POST['to_id']; @@ -589,14 +581,12 @@ if ($mode) $message = $lang['FORUMS_UPDATED'] . '

'; $message .= ($fix) ? "$fix

" : ''; $message .= sprintf($lang['CLICK_RETURN_FORUMADMIN'], '', '') . '

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', ''); - message_die(GENERAL_MESSAGE, $message); + bb_die($message); break; case 'forum_order': - // // Change order of forums - // $move = intval($_GET['move']); $forum_id = intval($_GET[POST_FORUM_URL]); @@ -706,7 +696,7 @@ if ($mode) break; default: - message_die(GENERAL_MESSAGE, $lang['NO_MODE']); + bb_die($lang['NO_MODE']); break; } @@ -717,19 +707,17 @@ if (!$mode || $show_main_page) $template->assign_vars(array( 'TPL_FORUMS_LIST' => true, - 'S_FORUM_ACTION' => "admin_forums.php", - 'L_FORUM_TITLE' => $lang['FORUM_ADMIN_MAIN'] + 'S_FORUM_ACTION' => 'admin_forums.php', + 'L_FORUM_TITLE' => $lang['FORUM_ADMIN_MAIN'], )); - $sql = "SELECT cat_id, cat_title, cat_order - FROM " . BB_CATEGORIES . " - ORDER BY cat_order"; - if( !$q_categories = DB()->sql_query($sql) ) + $sql = "SELECT cat_id, cat_title, cat_order FROM " . BB_CATEGORIES . " ORDER BY cat_order"; + if (!$q_categories = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, "Could not query categories list", "", __LINE__, __FILE__, $sql); + bb_die('Could not query categories list'); } - if( $total_categories = DB()->num_rows($q_categories) ) + if ($total_categories = DB()->num_rows($q_categories)) { $category_rows = DB()->sql_fetchrowset($q_categories); @@ -752,23 +740,18 @@ if (!$mode || $show_main_page) $where_cat_sql = "WHERE cat_id = '-1'"; } - $sql = "SELECT * - FROM ". BB_FORUMS ." - $where_cat_sql - ORDER BY cat_id, forum_order"; - if(!$q_forums = DB()->sql_query($sql)) + $sql = "SELECT * FROM ". BB_FORUMS ." $where_cat_sql ORDER BY cat_id, forum_order"; + if (!$q_forums = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, "Could not query forums information", '', __LINE__, __FILE__, $sql); + bb_die('Could not query forums information'); } - if( $total_forums = DB()->num_rows($q_forums) ) + if ($total_forums = DB()->num_rows($q_forums)) { $forum_rows = DB()->sql_fetchrowset($q_forums); } - // // Okay, let's build the index - // $gen_cat = array(); $bgr_class_1 = 'prow1'; @@ -776,11 +759,11 @@ if (!$mode || $show_main_page) $bgr_class_over = 'prow3'; $template->assign_vars(array( - 'U_ALL_FORUMS' => "admin_forums.php?c=all", + 'U_ALL_FORUMS' => 'admin_forums.php?c=all', 'FORUMS_COUNT' => $total_forums, )); - for($i = 0; $i < $total_categories; $i++) + for ($i = 0; $i < $total_categories; $i++) { $cat_id = $category_rows[$i]['cat_id']; @@ -799,7 +782,7 @@ if (!$mode || $show_main_page) 'U_CREATE_FORUM' => "admin_forums.php?mode=addforum&c=$cat_id", )); - for($j = 0; $j < $total_forums; $j++) + for ($j = 0; $j < $total_forums; $j++) { $forum_id = $forum_rows[$j]['forum_id']; @@ -842,10 +825,8 @@ if (!$mode || $show_main_page) print_page('admin_forums.tpl', 'admin'); -// // Functions -// -function get_info($mode, $id) +function get_info ($mode, $id) { switch($mode) { @@ -862,27 +843,27 @@ function get_info($mode, $id) break; default: - message_die(GENERAL_ERROR, "Wrong mode for generating select list", '', __LINE__, __FILE__); + bb_die('Wrong mode for generating select list #1'); break; } $sql = "SELECT count(*) as total FROM $table"; if( !$result = DB()->sql_query($sql) ) { - message_die(GENERAL_ERROR, "Couldn't get Forum/Category information", '', __LINE__, __FILE__, $sql); + bb_die('Could not get forum / category information #1'); } $count = DB()->sql_fetchrow($result); $count = $count['total']; $sql = "SELECT * FROM $table WHERE $idfield = $id"; - if( !$result = DB()->sql_query($sql) ) + if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, "Couldn't get Forum/Category information", '', __LINE__, __FILE__, $sql); + bb_die('Could not get forum / category information #2'); } - if( DB()->num_rows($result) != 1 ) + if (DB()->num_rows($result) != 1) { - message_die(GENERAL_ERROR, "Forum/Category doesn't exist or multiple forums/categories with ID $id", '', __LINE__, __FILE__); + bb_die('Forum / category does not exist or multiple forums / categories with ID '. $id); } $return = DB()->sql_fetchrow($result); @@ -890,7 +871,7 @@ function get_info($mode, $id) return $return; } -function get_list($mode, $id, $select) +function get_list ($mode, $id, $select) { switch($mode) { @@ -909,7 +890,7 @@ function get_list($mode, $id, $select) break; default: - message_die(GENERAL_ERROR, "Wrong mode for generating select list", '', __LINE__, __FILE__); + bb_die('Wrong mode for generating select list #2'); break; } @@ -922,7 +903,7 @@ function get_list($mode, $id, $select) if( !$result = DB()->sql_query($sql) ) { - message_die(GENERAL_ERROR, "Couldn't get list of Categories/Forums", '', __LINE__, __FILE__, $sql); + bb_die('Could not get list of categories / forums #1'); } $catlist = ''; @@ -940,7 +921,7 @@ function get_list($mode, $id, $select) return($catlist); } -function renumber_order($mode, $cat = 0) +function renumber_order ($mode, $cat = 0) { switch($mode) { @@ -959,7 +940,7 @@ function renumber_order($mode, $cat = 0) break; default: - message_die(GENERAL_ERROR, "Wrong mode for generating select list", '', __LINE__, __FILE__); + bb_die('Wrong mode for generating select list #3'); break; } @@ -971,26 +952,26 @@ function renumber_order($mode, $cat = 0) $sql .= " ORDER BY $orderfield ASC"; - if( !$result = DB()->sql_query($sql) ) + if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, "Couldn't get list of Categories", '', __LINE__, __FILE__, $sql); + bb_die('Could not get list of categories / forums #2'); } $i = 10; - while( $row = DB()->sql_fetchrow($result) ) + while ($row = DB()->sql_fetchrow($result)) { $sql = "UPDATE $table SET $orderfield = $i WHERE $idfield = " . $row[$idfield]; - if( !DB()->sql_query($sql) ) + if (!DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, "Couldn't update order fields", '', __LINE__, __FILE__, $sql); + bb_die('Could not update order fields'); } $i += 10; } if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, "Couldn't get list of Categories", '', __LINE__, __FILE__, $sql); + bb_die('Could not get list of categories / forums #3'); } } @@ -1013,7 +994,7 @@ function get_cat_forums ($cat_id = FALSE) if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, "Couldn't get list of Categories", '', __LINE__, __FILE__, $sql); + bb_die('Could not get list of categories / forums #4'); } if ($rowset = DB()->sql_fetchrowset($result)) @@ -1123,14 +1104,11 @@ function fix_orphan_sf ($orphan_sf_sql = '', $show_mess = FALSE) if ($orphan_sf_sql) { - $sql = "UPDATE ". BB_FORUMS ." SET - forum_parent = 0, - show_on_index = 1 - WHERE forum_id IN($orphan_sf_sql)"; + $sql = "UPDATE ". BB_FORUMS ." SET forum_parent = 0, show_on_index = 1 WHERE forum_id IN($orphan_sf_sql)"; if (!DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, "Couldn't change subforums data", '', __LINE__, __FILE__, $sql); + bb_die('Could not change subforums data'); } if ($affectedrows = DB()->affected_rows()) @@ -1143,7 +1121,7 @@ function fix_orphan_sf ($orphan_sf_sql = '', $show_mess = FALSE) $message = $done_mess .'

'; $message .= sprintf($lang['CLICK_RETURN_FORUMADMIN'], '', '') .'

'; $message .= sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', ''); - message_die(GENERAL_MESSAGE, $message); + bb_die($message); } } @@ -1212,12 +1190,12 @@ function check_name_dup ($mode, $name, $die_on_error = true) if ($mode == 'cat') { - $what_checked = 'Category'; + $what_checked = 'category'; $sql = "SELECT cat_id FROM ". BB_CATEGORIES ." WHERE cat_title = '$name_sql'"; } else { - $what_checked = 'Forum'; + $what_checked = 'forum'; $sql = "SELECT forum_id FROM ". BB_FORUMS ." WHERE forum_name = '$name_sql'"; } @@ -1225,7 +1203,7 @@ function check_name_dup ($mode, $name, $die_on_error = true) if ($name_is_dup && $die_on_error) { - bb_die("This $what_checked name taken, please choose something else"); + bb_die('This '. $what_checked .' name taken, please choose something else'); } return $name_is_dup; diff --git a/upload/admin/admin_phpinfo.php b/upload/admin/admin_phpinfo.php index 954ae38a4..75578c2e7 100644 --- a/upload/admin/admin_phpinfo.php +++ b/upload/admin/admin_phpinfo.php @@ -3,7 +3,7 @@ // ACP Header - START if (!empty($setmodules)) { - $module['General']['PHP Info'] = basename(__FILE__); + $module['General']['Php_info'] = basename(__FILE__); return; } require('./pagestart.php'); diff --git a/upload/admin/admin_ranks.php b/upload/admin/admin_ranks.php index 0984cb0cf..3d2b062a9 100644 --- a/upload/admin/admin_ranks.php +++ b/upload/admin/admin_ranks.php @@ -50,15 +50,15 @@ if ($mode != '') if ($mode == 'edit') { - if(empty($rank_id)) + if (empty($rank_id)) { - message_die(GENERAL_MESSAGE, $lang['MUST_SELECT_RANK']); + bb_die($lang['MUST_SELECT_RANK']); } $sql = "SELECT * FROM " . BB_RANKS . " WHERE rank_id = $rank_id"; - if(!$result = DB()->sql_query($sql)) + if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, "Couldn't obtain rank data", '', __LINE__, __FILE__, $sql); + bb_die('Could not obtain ranks data #1'); } $rank_info = DB()->sql_fetchrow($result); @@ -104,7 +104,7 @@ if ($mode != '') if ($rank_title == '') { - message_die(GENERAL_MESSAGE, $lang['MUST_SELECT_RANK']); + bb_die($lang['MUST_SELECT_RANK']); } if ($special_rank == 1) @@ -131,7 +131,7 @@ if ($mode != '') $sql = "UPDATE " . BB_USERS . " SET user_rank = 0 WHERE user_rank = $rank_id"; if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, $lang['NO_UPDATE_RANKS'], '', __LINE__, __FILE__, $sql); + bb_die($lang['NO_UPDATE_RANKS']); } } $sql = "UPDATE " . BB_RANKS . " @@ -154,15 +154,14 @@ if ($mode != '') if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, "Couldn't update/insert into ranks table", '', __LINE__, __FILE__, $sql); + bb_die('Could not update / insert into ranks table'); } $message .= '

' . sprintf($lang['CLICK_RETURN_RANKADMIN'], '', '') . '

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', ''); $datastore->update('ranks'); - message_die(GENERAL_MESSAGE, $message); - + bb_die($message); } elseif ($mode == 'delete') { @@ -185,29 +184,27 @@ if ($mode != '') if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, "Couldn't delete rank data", '', __LINE__, __FILE__, $sql); + bb_die('Could not delete rank data'); } $sql = "UPDATE " . BB_USERS . " SET user_rank = 0 WHERE user_rank = $rank_id"; if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, $lang['NO_UPDATE_RANKS'], '', __LINE__, __FILE__, $sql); + bb_die($lang['NO_UPDATE_RANKS']); } - $message = $lang['RANK_REMOVED'] . '

' . sprintf($lang['CLICK_RETURN_RANKADMIN'], '', '') . '

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', ''); - $datastore->update('ranks'); - message_die(GENERAL_MESSAGE, $message); + bb_die($lang['RANK_REMOVED'] . '

' . sprintf($lang['CLICK_RETURN_RANKADMIN'], '', '') . '

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', '')); } else { - message_die(GENERAL_MESSAGE, $lang['MUST_SELECT_RANK']); + bb_die($lang['MUST_SELECT_RANK']); } } else { - message_die(GENERAL_MESSAGE, 'Invalid mode'); + bb_die('Invalid mode'); } } else @@ -216,12 +213,11 @@ else // Show the default page // $sql = "SELECT * FROM " . BB_RANKS . " ORDER BY rank_min, rank_title"; - if(!$result = DB()->sql_query($sql)) + if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, "Couldn't obtain ranks data", '', __LINE__, __FILE__, $sql); + bb_die('Could not obtain ranks data #2'); } $rank_count = DB()->num_rows($result); - $rank_rows = DB()->sql_fetchrowset($result); $template->assign_vars(array( diff --git a/upload/admin/admin_rebuild_search.php b/upload/admin/admin_rebuild_search.php index 953f316d2..0899627e7 100644 --- a/upload/admin/admin_rebuild_search.php +++ b/upload/admin/admin_rebuild_search.php @@ -45,8 +45,7 @@ if (isset($_REQUEST['cancel_button'])) "); } - $message = sprintf($lang['REBUILD_SEARCH_ABORTED'], $last_session_data['end_post_id']) .'

'. sprintf($lang['CLICK_RETURN_REBUILD_SEARCH'], '', ''); - message_die(GENERAL_MESSAGE, $message); + bb_die(sprintf($lang['REBUILD_SEARCH_ABORTED'], $last_session_data['end_post_id']) .'

'. sprintf($lang['CLICK_RETURN_REBUILD_SEARCH'], '', '')); } // from which post to start processing @@ -137,17 +136,12 @@ $refresh_rate = isset($_REQUEST['refresh_rate']) ? (int) $_REQUEST['refresh_rate // check if the user gave wrong input if ($mode == 'submit') { - if ($session_posts_processing <= 0 || $post_limit <= 0 || $refresh_rate <= 0 || $time_limit <=0) + if (($session_posts_processing || $post_limit || $refresh_rate || $time_limit) <= 0) { - $message = $lang['WRONG_INPUT'] .'

'. sprintf($lang['CLICK_RETURN_REBUILD_SEARCH'], '', ''); - message_die(GENERAL_MESSAGE, $message); + bb_die($lang['WRONG_INPUT'] .'

'. sprintf($lang['CLICK_RETURN_REBUILD_SEARCH'], '', '')); } } -//--------------------------------------------------------------------- -// Main code starts from here -// - // Increase maximum execution time in case of a lot of posts, but don't complain about it if it isn't allowed. @set_time_limit($time_limit + 20); diff --git a/upload/admin/admin_reports.php b/upload/admin/admin_reports.php index 2fac48c03..d59e295b9 100644 --- a/upload/admin/admin_reports.php +++ b/upload/admin/admin_reports.php @@ -57,7 +57,7 @@ if ($mode == 'config') bb_update_config($config_update); report_modules_cache_clean(); - message_die(GENERAL_MESSAGE, $lang['REPORT_CONFIG_UPDATED'] . $return_links['config'] . $return_links['index']); + bb_die($lang['REPORT_CONFIG_UPDATED'] . $return_links['config'] . $return_links['index']); } else { @@ -86,7 +86,7 @@ else if (isset($_POST[POST_CAT_URL]) || isset($_GET[POST_CAT_URL])) if (!$report_module = report_modules('id', $module_id)) { - message_die(GENERAL_MESSAGE, $lang['REPORT_MODULE_NOT_EXISTS'] . $return_links['admin'] . $return_links['index']); + bb_die($lang['REPORT_MODULE_NOT_EXISTS'] . $return_links['admin'] . $return_links['index']); } switch ($mode) @@ -107,7 +107,7 @@ else if (isset($_POST[POST_CAT_URL]) || isset($_GET[POST_CAT_URL])) report_module_edit($module_id, $module_notify, $module_prune, $auth_write, $auth_view, $auth_notify, $auth_delete); - message_die(GENERAL_MESSAGE, $lang['REPORT_MODULE_EDITED'] . $return_links['admin'] . $return_links['index']); + bb_die($lang['REPORT_MODULE_EDITED'] . $return_links['admin'] . $return_links['index']); } else if (isset($_POST['cancel'])) { @@ -179,7 +179,7 @@ else if (isset($_POST[POST_CAT_URL]) || isset($_GET[POST_CAT_URL])) report_reason_edit($reason_id, $module_id, $reason_desc); - message_die(GENERAL_MESSAGE, $lang['REPORT_REASON_EDITED'] . $return_links['reasons'] . $return_links['admin'] . $return_links['index']); + bb_die($lang['REPORT_REASON_EDITED'] . $return_links['reasons'] . $return_links['admin'] . $return_links['index']); } } else if (isset($_POST['cancel'])) @@ -203,7 +203,7 @@ else if (isset($_POST[POST_CAT_URL]) || isset($_GET[POST_CAT_URL])) if (!$report_reason = report_reason_obtain($reason_id)) { - message_die(GENERAL_MESSAGE, $lang['REPORT_REASON_NOT_EXISTS'] . $return_links['reasons'] . $return_links['admin'] . $return_links['index']); + bb_die($lang['REPORT_REASON_NOT_EXISTS'] . $return_links['reasons'] . $return_links['admin'] . $return_links['index']); } if (isset($reason_desc)) @@ -240,7 +240,7 @@ else if (isset($_POST[POST_CAT_URL]) || isset($_GET[POST_CAT_URL])) { report_reason_delete($reason_id); - message_die(GENERAL_MESSAGE, $lang['REPORT_REASON_DELETED'] . $return_links['reasons'] . $return_links['admin'] . $return_links['index']); + bb_die($lang['REPORT_REASON_DELETED'] . $return_links['reasons'] . $return_links['admin'] . $return_links['index']); } else if (isset($_POST['cancel'])) { @@ -259,7 +259,7 @@ else if (isset($_POST[POST_CAT_URL]) || isset($_GET[POST_CAT_URL])) break; default: - message_die(GENERAL_MESSAGE, $lang['REPORT_NOT_SUPPORTED'] . $return_links['reasons'] . $return_links['admin'] . $return_links['index']); + bb_die($lang['REPORT_NOT_SUPPORTED'] . $return_links['reasons'] . $return_links['admin'] . $return_links['index']); break; } } @@ -291,7 +291,7 @@ else if (isset($_POST[POST_CAT_URL]) || isset($_GET[POST_CAT_URL])) report_reason_insert($module_id, $reason_desc); - message_die(GENERAL_MESSAGE, $lang['REPORT_REASON_ADDED'] . $return_links['reasons'] . $return_links['admin'] . $return_links['index']); + bb_die($lang['REPORT_REASON_ADDED'] . $return_links['reasons'] . $return_links['admin'] . $return_links['index']); } } else if (isset($_POST['cancel'])) @@ -354,7 +354,7 @@ else if (isset($_POST[POST_CAT_URL]) || isset($_GET[POST_CAT_URL])) break; default: - message_die(GENERAL_MESSAGE, $lang['REPORT_NOT_SUPPORTED'] . $return_links['reasons'] . $return_links['admin'] . $return_links['index']); + bb_die($lang['REPORT_NOT_SUPPORTED'] . $return_links['reasons'] . $return_links['admin'] . $return_links['index']); break; } } @@ -376,12 +376,12 @@ else if (isset($_POST[POST_CAT_URL]) || isset($_GET[POST_CAT_URL])) case 'sync': if (!method_exists($report_module, 'sync')) { - message_die(GENERAL_MESSAGE, $lang['REPORT_NOT_SUPPORTED'] . $return_links['admin'] . $return_links['index']); + bb_die($lang['REPORT_NOT_SUPPORTED'] . $return_links['admin'] . $return_links['index']); } $report_module->sync(); - message_die(GENERAL_MESSAGE, $lang['REPORT_MODULE_SYNCED'] . $return_links['admin'] . $return_links['index']); + bb_die($lang['REPORT_MODULE_SYNCED'] . $return_links['admin'] . $return_links['index']); break; // @@ -392,7 +392,7 @@ else if (isset($_POST[POST_CAT_URL]) || isset($_GET[POST_CAT_URL])) { report_module_uninstall($module_id); - message_die(GENERAL_MESSAGE, $lang['REPORT_MODULE_UNINSTALLED'] . $return_links['admin'] . $return_links['index']); + bb_die($lang['REPORT_MODULE_UNINSTALLED'] . $return_links['admin'] . $return_links['index']); } else if (isset($_POST['cancel'])) { @@ -410,7 +410,7 @@ else if (isset($_POST[POST_CAT_URL]) || isset($_GET[POST_CAT_URL])) break; default: - message_die(GENERAL_MESSAGE, $lang['REPORT_NOT_SUPPORTED'] . $return_links['admin'] . $return_links['index']); + bb_die($lang['REPORT_NOT_SUPPORTED'] . $return_links['admin'] . $return_links['index']); break; } } @@ -420,7 +420,7 @@ else if (isset($_POST['module']) || isset($_GET['module'])) if (!$report_module = report_modules_inactive('name', $module_name)) { - message_die(GENERAL_MESSAGE, $lang['REPORT_MODULE_NOT_EXISTS'] . $return_links['admin'] . $return_links['index']); + bb_die($lang['REPORT_MODULE_NOT_EXISTS'] . $return_links['admin'] . $return_links['index']); } switch ($mode) @@ -441,7 +441,7 @@ else if (isset($_POST['module']) || isset($_GET['module'])) report_module_install($module_notify, $module_prune, $module_name, $auth_write, $auth_view, $auth_notify, $auth_delete, false); - message_die(GENERAL_MESSAGE, $lang['REPORT_MODULE_INSTALLED'] . $return_links['admin'] . $return_links['index']); + bb_die($lang['REPORT_MODULE_INSTALLED'] . $return_links['admin'] . $return_links['index']); } else if (isset($_POST['cancel'])) { @@ -474,7 +474,7 @@ else if (isset($_POST['module']) || isset($_GET['module'])) break; default: - message_die(GENERAL_MESSAGE, $lang['REPORT_NOT_SUPPORTED'] . $return_links['admin'] . $return_links['index']); + bb_die($lang['REPORT_NOT_SUPPORTED'] . $return_links['admin'] . $return_links['index']); break; } } @@ -554,7 +554,7 @@ else break; default: - message_die(GENERAL_MESSAGE, $lang['REPORT_NOT_SUPPORTED'] . $return_links['admin'] . $return_links['index']); + bb_die($lang['REPORT_NOT_SUPPORTED'] . $return_links['admin'] . $return_links['index']); break; } } \ No newline at end of file diff --git a/upload/admin/admin_smilies.php b/upload/admin/admin_smilies.php index 2a78d5c7a..01cbf65fb 100644 --- a/upload/admin/admin_smilies.php +++ b/upload/admin/admin_smilies.php @@ -10,9 +10,7 @@ if (!empty($setmodules)) require('./pagestart.php'); // ACP Header - END -// -// Check to see what mode we should operate in. -// +// Check to see what mode we should operate in if( isset($_POST['mode']) || isset($_GET['mode']) ) { $mode = ( isset($_POST['mode']) ) ? $_POST['mode'] : $_GET['mode']; @@ -25,22 +23,20 @@ else $delimeter = '=+:'; -// -// Read a listing of uploaded smilies for use in the add or edit smliey code... -// +// Read a listing of uploaded smilies for use in the add or edit smliey code $dir = @opendir(BB_ROOT . $bb_cfg['smilies_path']); -while($file = @readdir($dir)) +while ($file = @readdir($dir)) { - if( !@is_dir(bb_realpath(BB_ROOT . $bb_cfg['smilies_path'] . '/' . $file)) ) + if (!@is_dir(bb_realpath(BB_ROOT . $bb_cfg['smilies_path'] . '/' . $file))) { $img_size = @getimagesize(BB_ROOT . $bb_cfg['smilies_path'] . '/' . $file); - if( $img_size[0] && $img_size[1] ) + if ($img_size[0] && $img_size[1]) { $smiley_images[] = $file; } - else if( preg_match('/.pak$/i', $file) ) + else if (preg_match('/.pak$/i', $file)) { $smiley_paks[] = $file; } @@ -49,45 +45,36 @@ while($file = @readdir($dir)) @closedir($dir); -// // Select main mode -// -if( isset($_GET['import_pack']) || isset($_POST['import_pack']) ) +if (isset($_GET['import_pack']) || isset($_POST['import_pack'])) { - // - // Import a list a "Smiley Pack" - // $smile_pak = (string) request_var('smile_pak', ''); $clear_current = (int) request_var('clear_current', ''); $replace_existing = (int) request_var('replace', ''); - if ( !empty($smile_pak) ) + if (!empty($smile_pak)) { - // - // The user has already selected a smile_pak file.. Import it. - // - if( !empty($clear_current) ) + // The user has already selected a smile_pak file.. Import it + if (!empty($clear_current)) { - $sql = "DELETE - FROM " . BB_SMILIES; - if( !$result = DB()->sql_query($sql) ) + $sql = "DELETE FROM " . BB_SMILIES; + if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, "Couldn't delete current smilies", '', __LINE__, __FILE__, $sql); + bb_die('Could not delete current smilies'); } $datastore->update('smile_replacements'); } else { - $sql = "SELECT code - FROM ". BB_SMILIES; - if( !$result = DB()->sql_query($sql) ) + $sql = "SELECT code FROM ". BB_SMILIES; + if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, "Couldn't get current smilies", '', __LINE__, __FILE__, $sql); + bb_die('Could not get current smilies'); } $cur_smilies = DB()->sql_fetchrowset($result); - for( $i = 0; $i < count($cur_smilies); $i++ ) + for ($i = 0; $i < count($cur_smilies); $i++) { $k = $cur_smilies[$i]['code']; $smiles[$k] = 1; @@ -96,25 +83,23 @@ if( isset($_GET['import_pack']) || isset($_POST['import_pack']) ) $fcontents = @file(BB_ROOT . $bb_cfg['smilies_path'] . '/'. $smile_pak); - if( empty($fcontents) ) + if (empty($fcontents)) { - message_die(GENERAL_ERROR, "Couldn't read smiley pak file", '', __LINE__, __FILE__, $sql); + bb_die('Could not read smiley pak file'); } - for( $i = 0; $i < count($fcontents); $i++ ) + for ($i = 0; $i < count($fcontents); $i++) { $smile_data = explode($delimeter, trim(addslashes($fcontents[$i]))); - for( $j = 2; $j < count($smile_data); $j++) + for ($j = 2; $j < count($smile_data); $j++) { - // - // Replace > and < with the proper html_entities for matching. - // + // Replace > and < with the proper html_entities for matching $smile_data[$j] = str_replace('<', '<', $smile_data[$j]); $smile_data[$j] = str_replace('>', '>', $smile_data[$j]); $k = $smile_data[$j]; - if( isset($smiles[$k]) ) + if (isset($smiles[$k])) { if( !empty($replace_existing) ) { @@ -133,31 +118,27 @@ if( isset($_GET['import_pack']) || isset($_POST['import_pack']) ) VALUES('" . DB()->escape($smile_data[$j]) . "', '" . DB()->escape($smile_data[0]) . "', '" . DB()->escape($smile_data[1]) . "')"; } - if( $sql != '' ) + if ($sql != '') { $result = DB()->sql_query($sql); - if( !$result ) + if (!$result) { - message_die(GENERAL_ERROR, "Couldn't update smilies!", '', __LINE__, __FILE__, $sql); + bb_die('Could not update smilies #1'); } $datastore->update('smile_replacements'); } } } - $message = $lang['SMILEY_IMPORT_SUCCESS'] . '

' . sprintf($lang['CLICK_RETURN_SMILEADMIN'], '', '') . '

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', ''); - - message_die(GENERAL_MESSAGE, $message); + bb_die($lang['SMILEY_IMPORT_SUCCESS'] . '

' . sprintf($lang['CLICK_RETURN_SMILEADMIN'], '', '') . '

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', '')); } else { - // - // Display the script to get the smile_pak cfg file... - // + // Display the script to get the smile_pak cfg file $smile_paks_select = ''; $template->assign_vars(array( - 'TPL_SMILE_EDIT' => true, - 'SMILEY_IMG' => BB_ROOT . $bb_cfg['smilies_path'] . '/' . $smiley_images[0], - 'S_SMILEY_ACTION' => "admin_smilies.php", - 'S_HIDDEN_FIELDS' => $s_hidden_fields, + 'TPL_SMILE_EDIT' => true, + 'SMILEY_IMG' => BB_ROOT . $bb_cfg['smilies_path'] . '/' . $smiley_images[0], + 'S_SMILEY_ACTION' => "admin_smilies.php", + 'S_HIDDEN_FIELDS' => $s_hidden_fields, 'S_FILENAME_OPTIONS' => $filename_list, - 'S_SMILEY_BASEDIR' => BB_ROOT . $bb_cfg['smilies_path'] + 'S_SMILEY_BASEDIR' => BB_ROOT . $bb_cfg['smilies_path'] )); } else if ( $mode != '' ) @@ -241,49 +212,36 @@ else if ( $mode != '' ) switch( $mode ) { case 'delete': - // - // Admin has selected to delete a smiley. - // - $smiley_id = ( !empty($_POST['id']) ) ? $_POST['id'] : $_GET['id']; $smiley_id = intval($smiley_id); - $sql = "DELETE FROM " . BB_SMILIES . " - WHERE smilies_id = " . $smiley_id; + $sql = "DELETE FROM " . BB_SMILIES . " WHERE smilies_id = " . $smiley_id; $result = DB()->sql_query($sql); - if( !$result ) + if (!$result) { - message_die(GENERAL_ERROR, "Couldn't delete smiley", '', __LINE__, __FILE__, $sql); + bb_die('Could not delete smiley'); } - $datastore->update('smile_replacements'); + $datastore->update('smile_replacements'); - $message = $lang['SMILEY_DEL_SUCCESS'] . '

' . sprintf($lang['CLICK_RETURN_SMILEADMIN'], '', '') . '

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', ''); - - message_die(GENERAL_MESSAGE, $message); + bb_die($lang['SMILEY_DEL_SUCCESS'] . '

' . sprintf($lang['CLICK_RETURN_SMILEADMIN'], '', '') . '

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', '')); break; case 'edit': - // - // Admin has selected to edit a smiley. - // - $smiley_id = ( !empty($_POST['id']) ) ? $_POST['id'] : $_GET['id']; $smiley_id = intval($smiley_id); - $sql = "SELECT * - FROM " . BB_SMILIES . " - WHERE smilies_id = " . $smiley_id; + $sql = "SELECT * FROM " . BB_SMILIES . " WHERE smilies_id = " . $smiley_id; $result = DB()->sql_query($sql); - if( !$result ) + if (!$result) { - message_die(GENERAL_ERROR, 'Could not obtain emoticon information', '', __LINE__, __FILE__, $sql); + bb_die('Could not obtain emoticon information'); } $smile_data = DB()->sql_fetchrow($result); $filename_list = ''; - for( $i = 0; $i < count($smiley_images); $i++ ) + for ($i = 0; $i < count($smiley_images); $i++) { - if( $smiley_images[$i] == $smile_data['smile_url'] ) + if ($smiley_images[$i] == $smile_data['smile_url']) { $smiley_selected = 'selected="selected"'; $smiley_edit_img = $smiley_images[$i]; @@ -292,7 +250,6 @@ else if ( $mode != '' ) { $smiley_selected = ''; } - $filename_list .= ''; } @@ -312,58 +269,36 @@ else if ( $mode != '' ) break; case 'save': - // - // Admin has submitted changes while editing a smiley. - // - - // - // Get the submitted data, being careful to ensure that we only - // accept the data we are looking for. - // $smile_code = ( isset($_POST['smile_code']) ) ? trim($_POST['smile_code']) : trim($_GET['smile_code']); $smile_url = ( isset($_POST['smile_url']) ) ? trim($_POST['smile_url']) : trim($_GET['smile_url']); $smile_url = bb_ltrim(basename($smile_url), "'"); $smile_emotion = ( isset($_POST['smile_emotion']) ) ? trim($_POST['smile_emotion']) : trim($_GET['smile_emotion']); $smile_id = ( isset($_POST['smile_id']) ) ? intval($_POST['smile_id']) : intval($_GET['smile_id']); - // If no code was entered complain ... + // If no code was entered complain if ($smile_code == '' || $smile_url == '') { - message_die(GENERAL_MESSAGE, $lang['FIELDS_EMPTY']); + bb_die($lang['FIELDS_EMPTY']); } - // - // Convert < and > to proper htmlentities for parsing. - // + // Convert < and > to proper htmlentities for parsing $smile_code = str_replace('<', '<', $smile_code); $smile_code = str_replace('>', '>', $smile_code); - // - // Proceed with updating the smiley table. - // + // Proceed with updating the smiley table $sql = "UPDATE " . BB_SMILIES . " SET code = '" . DB()->escape($smile_code) . "', smile_url = '" . DB()->escape($smile_url) . "', emoticon = '" . DB()->escape($smile_emotion) . "' WHERE smilies_id = $smile_id"; - if( !($result = DB()->sql_query($sql)) ) + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, "Couldn't update smilies info", '', __LINE__, __FILE__, $sql); + bb_die('Could not update smilies #2'); } - $datastore->update('smile_replacements'); + $datastore->update('smile_replacements'); - $message = $lang['SMILEY_EDIT_SUCCESS'] . '

' . sprintf($lang['CLICK_RETURN_SMILEADMIN'], '', '') . '

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', ''); - - message_die(GENERAL_MESSAGE, $message); + bb_die($lang['SMILEY_EDIT_SUCCESS'] . '

' . sprintf($lang['CLICK_RETURN_SMILEADMIN'], '', '') . '

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', '')); break; case 'savenew': - // - // Admin has submitted changes while adding a new smiley. - // - - // - // Get the submitted data being careful to ensure the the data - // we recieve and process is only the data we are looking for. - // $smile_code = ( isset($_POST['smile_code']) ) ? $_POST['smile_code'] : $_GET['smile_code']; $smile_url = ( isset($_POST['smile_url']) ) ? $_POST['smile_url'] : $_GET['smile_url']; $smile_url = bb_ltrim(basename($smile_url), "'"); @@ -372,49 +307,37 @@ else if ( $mode != '' ) $smile_url = trim($smile_url); $smile_emotion = trim($smile_emotion); - // If no code was entered complain ... + // If no code was entered complain if ($smile_code == '' || $smile_url == '') { - message_die(GENERAL_MESSAGE, $lang['FIELDS_EMPTY']); + bb_die($lang['FIELDS_EMPTY']); } - // - // Convert < and > to proper htmlentities for parsing. - // + // Convert < and > to proper htmlentities for parsing $smile_code = str_replace('<', '<', $smile_code); $smile_code = str_replace('>', '>', $smile_code); - // - // Save the data to the smiley table. - // + // Save the data to the smiley table $sql = "INSERT INTO " . BB_SMILIES . " (code, smile_url, emoticon) VALUES ('" . DB()->escape($smile_code) . "', '" . DB()->escape($smile_url) . "', '" . DB()->escape($smile_emotion) . "')"; $result = DB()->sql_query($sql); - if( !$result ) + if (!$result) { - message_die(GENERAL_ERROR, "Couldn't insert new smiley", '', __LINE__, __FILE__, $sql); + bb_die('Could not insert new smiley'); } - $datastore->update('smile_replacements'); + $datastore->update('smile_replacements'); - $message = $lang['SMILEY_ADD_SUCCESS'] . '

' . sprintf($lang['CLICK_RETURN_SMILEADMIN'], '', '') . '

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', ''); - - message_die(GENERAL_MESSAGE, $message); + bb_die($lang['SMILEY_ADD_SUCCESS'] . '

' . sprintf($lang['CLICK_RETURN_SMILEADMIN'], '', '') . '

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', '')); break; } } else { - - // - // This is the main display of the page before the admin has selected - // any options. - // - $sql = "SELECT * - FROM " . BB_SMILIES; + $sql = "SELECT * FROM " . BB_SMILIES; $result = DB()->sql_query($sql); - if( !$result ) + if (!$result) { - message_die(GENERAL_ERROR, "Couldn't obtain smileys from database", '', __LINE__, __FILE__, $sql); + bb_die('Could not obtain smileys from database'); } $smilies = DB()->sql_fetchrowset($result); @@ -422,17 +345,13 @@ else $template->assign_vars(array( 'TPL_SMILE_MAIN' => true, 'S_HIDDEN_FIELDS' => @$s_hidden_fields, - 'S_SMILEY_ACTION' => "admin_smilies.php", + 'S_SMILEY_ACTION' => 'admin_smilies.php', )); - // - // Loop throuh the rows of smilies setting block vars for the template. - // - for($i = 0; $i < count($smilies); $i++) + // Loop throuh the rows of smilies setting block vars for the template + for ($i = 0; $i < count($smilies); $i++) { - // - // Replace htmlentites for < and > with actual character. - // + // Replace htmlentites for < and > with actual character $smilies[$i]['code'] = str_replace('<', '<', $smilies[$i]['code']); $smilies[$i]['code'] = str_replace('>', '>', $smilies[$i]['code']); diff --git a/upload/admin/admin_ug_auth.php b/upload/admin/admin_ug_auth.php index 0612f257d..e7786cab1 100644 --- a/upload/admin/admin_ug_auth.php +++ b/upload/admin/admin_ug_auth.php @@ -77,7 +77,7 @@ if ($submit && $mode == 'user') { if ($userdata['user_id'] == $user_id || $user_id == GUEST_UID || $user_id == BOT_UID) { - bb_die("Couldn't update admin status"); + bb_die("Could not update admin status"); } DB()->query("UPDATE ". BB_USERS ." SET user_level = ". ADMIN ." WHERE user_id = $user_id LIMIT 1"); @@ -97,7 +97,7 @@ if ($submit && $mode == 'user') // ignore if you're trying to change yourself from an admin to user! if ($userdata['user_id'] == $user_id) { - bb_die("Couldn't update admin status

Couldn't change yourself from an admin to user"); + bb_die("Could not update admin status

Could not change yourself from an admin to user"); } // Update users level, reset to USER DB()->query("UPDATE ". BB_USERS ." SET user_level = ". USER ." WHERE user_id = $user_id LIMIT 1"); diff --git a/upload/admin/admin_user_ban.php b/upload/admin/admin_user_ban.php index 026fee727..795fdffd0 100644 --- a/upload/admin/admin_user_ban.php +++ b/upload/admin/admin_user_ban.php @@ -9,9 +9,6 @@ if (!empty($setmodules)) require('./pagestart.php'); // ACP Header - END -// -// Start program -// if ( isset($_POST['submit']) ) { $user_bansql = ''; @@ -19,29 +16,26 @@ if ( isset($_POST['submit']) ) $ip_bansql = ''; $user_list = array(); - if ( !empty($_POST['username']) ) + if (!empty($_POST['username'])) { $this_userdata = get_userdata($_POST['username'], true); - if( !$this_userdata ) + if (!$this_userdata) { - message_die(GENERAL_MESSAGE, $lang['NO_USER_ID_SPECIFIED'] ); + bb_die($lang['NO_USER_ID_SPECIFIED']); } $user_list[] = $this_userdata['user_id']; } $ip_list = array(); - if ( isset($_POST['ban_ip']) ) + if (isset($_POST['ban_ip'])) { $ip_list_temp = explode(',', $_POST['ban_ip']); - for($i = 0; $i < count($ip_list_temp); $i++) + for ($i = 0; $i < count($ip_list_temp); $i++) { - if ( preg_match('/^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})[ ]*\-[ ]*([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/', trim($ip_list_temp[$i]), $ip_range_explode) ) + if (preg_match('/^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})[ ]*\-[ ]*([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/', trim($ip_list_temp[$i]), $ip_range_explode)) { - // - // Don't ask about all this, just don't ask ... ! - // $ip_1_counter = $ip_range_explode[1]; $ip_1_end = $ip_range_explode[5]; @@ -96,19 +90,19 @@ if ( isset($_POST['submit']) ) $ip_1_counter++; } } - else if ( preg_match('/^([\w\-_]\.?){2,}$/is', trim($ip_list_temp[$i])) ) + else if (preg_match('/^([\w\-_]\.?){2,}$/is', trim($ip_list_temp[$i]))) { $ip = gethostbynamel(trim($ip_list_temp[$i])); - for($j = 0; $j < count($ip); $j++) + for ($j = 0; $j < count($ip); $j++) { - if ( !empty($ip[$j]) ) + if (!empty($ip[$j])) { $ip_list[] = encode_ip($ip[$j]); } } } - else if ( preg_match('/^([0-9]{1,3})\.([0-9\*]{1,3})\.([0-9\*]{1,3})\.([0-9\*]{1,3})$/', trim($ip_list_temp[$i])) ) + else if (preg_match('/^([0-9]{1,3})\.([0-9\*]{1,3})\.([0-9\*]{1,3})\.([0-9\*]{1,3})$/', trim($ip_list_temp[$i]))) { $ip_list[] = encode_ip(str_replace('*', '255', trim($ip_list_temp[$i]))); } @@ -116,17 +110,12 @@ if ( isset($_POST['submit']) ) } $email_list = array(); - if ( isset($_POST['ban_email']) ) + if (isset($_POST['ban_email'])) { $email_list_temp = explode(',', $_POST['ban_email']); - for($i = 0; $i < count($email_list_temp); $i++) + for ($i = 0; $i < count($email_list_temp); $i++) { - // - // This ereg match is based on one by php@unreelpro.com - // contained in the annotated php manual at php.com (ereg - // section) - // if (preg_match('/^(([a-z0-9&\'\.\-_\+])|(\*))+@(([a-z0-9\-])|(\*))+\.([a-z0-9\-]+\.)*?[a-z]+$/is', trim($email_list_temp[$i]))) { $email_list[] = trim($email_list_temp[$i]); @@ -134,55 +123,53 @@ if ( isset($_POST['submit']) ) } } - $sql = "SELECT * - FROM " . BB_BANLIST; - if ( !($result = DB()->sql_query($sql)) ) + $sql = "SELECT * FROM " . BB_BANLIST; + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, "Couldn't obtain banlist information", "", __LINE__, __FILE__, $sql); + bb_die('Could not obtain banlist information'); } $current_banlist = DB()->sql_fetchrowset($result); DB()->sql_freeresult($result); $kill_session_sql = ''; - for($i = 0; $i < count($user_list); $i++) + for ($i = 0; $i < count($user_list); $i++) { $in_banlist = false; - for($j = 0; $j < count($current_banlist); $j++) + for ($j = 0; $j < count($current_banlist); $j++) { - if ( $user_list[$i] == $current_banlist[$j]['ban_userid'] ) + if ($user_list[$i] == $current_banlist[$j]['ban_userid']) { $in_banlist = true; } } - if ( !$in_banlist ) + if (!$in_banlist) { $kill_session_sql .= ( ( $kill_session_sql != '' ) ? ' OR ' : '' ) . "session_user_id = " . $user_list[$i]; - $sql = "INSERT INTO " . BB_BANLIST . " (ban_userid) - VALUES (" . $user_list[$i] . ")"; - if ( !DB()->sql_query($sql) ) + $sql = "INSERT INTO " . BB_BANLIST . " (ban_userid) VALUES (" . $user_list[$i] . ")"; + if (!DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, "Couldn't insert ban_userid info into database", "", __LINE__, __FILE__, $sql); + bb_die('Could not insert ban_userid info into database'); } } } - for($i = 0; $i < count($ip_list); $i++) + for ($i = 0; $i < count($ip_list); $i++) { $in_banlist = false; - for($j = 0; $j < count($current_banlist); $j++) + for ($j = 0; $j < count($current_banlist); $j++) { - if ( $ip_list[$i] == $current_banlist[$j]['ban_ip'] ) + if ($ip_list[$i] == $current_banlist[$j]['ban_ip']) { $in_banlist = true; } } - if ( !$in_banlist ) + if (!$in_banlist) { - if ( preg_match('/(ff\.)|(\.ff)/is', chunk_split($ip_list[$i], 2, '.')) ) + if (preg_match('/(ff\.)|(\.ff)/is', chunk_split($ip_list[$i], 2, '.'))) { $kill_ip_sql = "session_ip LIKE '" . str_replace('.', '', preg_replace('/(ff\.)|(\.ff)/is', '%', chunk_split($ip_list[$i], 2, "."))) . "'"; } @@ -193,112 +180,101 @@ if ( isset($_POST['submit']) ) $kill_session_sql .= ( ( $kill_session_sql != '' ) ? ' OR ' : '' ) . $kill_ip_sql; - $sql = "INSERT INTO " . BB_BANLIST . " (ban_ip) - VALUES ('" . $ip_list[$i] . "')"; + $sql = "INSERT INTO " . BB_BANLIST . " (ban_ip) VALUES ('" . $ip_list[$i] . "')"; if ( !DB()->sql_query($sql) ) { - message_die(GENERAL_ERROR, "Couldn't insert ban_ip info into database", '', __LINE__, __FILE__, $sql); + bb_die('Could not insert ban_ip info into database'); } } } - // - // Now we'll delete all entries from the session table with any of the banned - // user or IP info just entered into the ban table ... this will force a session - // initialisation resulting in an instant ban - // - if ( $kill_session_sql != '' ) + // Now we'll delete all entries from the session table + if ($kill_session_sql != '') { - $sql = "DELETE FROM " . BB_SESSIONS . " - WHERE $kill_session_sql"; - if ( !DB()->sql_query($sql) ) + $sql = "DELETE FROM " . BB_SESSIONS . " WHERE $kill_session_sql"; + if (!DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, "Couldn't delete banned sessions from database", '', __LINE__, __FILE__, $sql); + bb_die('Could not delete banned sessions from database'); } } - for($i = 0; $i < count($email_list); $i++) + for ($i = 0; $i < count($email_list); $i++) { $in_banlist = false; - for($j = 0; $j < count($current_banlist); $j++) + for ($j = 0; $j < count($current_banlist); $j++) { - if ( $email_list[$i] == $current_banlist[$j]['ban_email'] ) + if ($email_list[$i] == $current_banlist[$j]['ban_email']) { $in_banlist = true; } } - if ( !$in_banlist ) + if (!$in_banlist) { - $sql = "INSERT INTO " . BB_BANLIST . " (ban_email) - VALUES ('" . DB()->escape($email_list[$i]) . "')"; - if ( !DB()->sql_query($sql) ) + $sql = "INSERT INTO " . BB_BANLIST . " (ban_email) VALUES ('" . DB()->escape($email_list[$i]) . "')"; + if (!DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, "Couldn't insert ban_email info into database", '', __LINE__, __FILE__, $sql); + bb_die('Could not insert ban_email info into database'); } } } $where_sql = ''; - if ( isset($_POST['unban_user']) ) + if (isset($_POST['unban_user'])) { $user_list = $_POST['unban_user']; - for($i = 0; $i < count($user_list); $i++) + for ($i = 0; $i < count($user_list); $i++) { - if ( $user_list[$i] != -1 ) + if ($user_list[$i] != -1) { $where_sql .= ( ( $where_sql != '' ) ? ', ' : '' ) . intval($user_list[$i]); } } } - if ( isset($_POST['unban_ip']) ) + if (isset($_POST['unban_ip'])) { $ip_list = $_POST['unban_ip']; - for($i = 0; $i < count($ip_list); $i++) + for ($i = 0; $i < count($ip_list); $i++) { - if ( $ip_list[$i] != -1 ) + if ($ip_list[$i] != -1) { $where_sql .= ( ( $where_sql != '' ) ? ', ' : '' ) . DB()->escape($ip_list[$i]); } } } - if ( isset($_POST['unban_email']) ) + if (isset($_POST['unban_email'])) { $email_list = $_POST['unban_email']; - for($i = 0; $i < count($email_list); $i++) + for ($i = 0; $i < count($email_list); $i++) { - if ( $email_list[$i] != -1 ) + if ($email_list[$i] != -1) { $where_sql .= ( ( $where_sql != '' ) ? ', ' : '' ) . DB()->escape($email_list[$i]); } } } - if ( $where_sql != '' ) + if ($where_sql != '') { - $sql = "DELETE FROM " . BB_BANLIST . " - WHERE ban_id IN ($where_sql)"; - if ( !DB()->sql_query($sql) ) + $sql = "DELETE FROM " . BB_BANLIST . " WHERE ban_id IN ($where_sql)"; + if (!DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, "Couldn't delete ban info from database", '', __LINE__, __FILE__, $sql); + bb_die('Could not delete ban info from database'); } } - $message = $lang['BAN_UPDATE_SUCESSFUL'] . '

' . sprintf($lang['CLICK_RETURN_BANADMIN'], '', '') . '

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', ''); - - message_die(GENERAL_MESSAGE, $message); - + bb_die($lang['BAN_UPDATE_SUCESSFUL'] . '

' . sprintf($lang['CLICK_RETURN_BANADMIN'], '', '') . '

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', '')); } else { $template->assign_vars(array( - 'S_BANLIST_ACTION' => "admin_user_ban.php", + 'S_BANLIST_ACTION' => 'admin_user_ban.php', )); $userban_count = 0; @@ -311,36 +287,32 @@ else AND b.ban_userid <> 0 AND u.user_id <> " . GUEST_UID . " ORDER BY u.username ASC"; - if ( !($result = DB()->sql_query($sql)) ) + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not select current user_id ban list', '', __LINE__, __FILE__, $sql); + bb_die('Could not select current user_id ban list'); } $user_list = DB()->sql_fetchrowset($result); DB()->sql_freeresult($result); $select_userlist = ''; - for($i = 0; $i < count($user_list); $i++) + for ($i = 0; $i < count($user_list); $i++) { $select_userlist .= ''; $userban_count++; } - if( $select_userlist == '' ) + if ($select_userlist == '') { $select_userlist = ''; } $select_userlist = ''; - $sql = " - SELECT ban_id, ban_ip, ban_email - FROM ". BB_BANLIST ." - ORDER BY ban_ip - "; - if ( !($result = DB()->sql_query($sql)) ) + $sql = "SELECT ban_id, ban_ip, ban_email FROM ". BB_BANLIST ." ORDER BY ban_ip"; + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not select current ip ban list', '', __LINE__, __FILE__, $sql); + bb_die('Could not select current ip ban list'); } $banlist = DB()->sql_fetchrowset($result); @@ -349,17 +321,17 @@ else $select_iplist = ''; $select_emaillist = ''; - for($i = 0; $i < count($banlist); $i++) + for ($i = 0; $i < count($banlist); $i++) { $ban_id = $banlist[$i]['ban_id']; - if ( !empty($banlist[$i]['ban_ip']) ) + if (!empty($banlist[$i]['ban_ip'])) { $ban_ip = str_replace('255', '*', decode_ip($banlist[$i]['ban_ip'])); $select_iplist .= ''; $ipban_count++; } - else if ( !empty($banlist[$i]['ban_email']) ) + else if (!empty($banlist[$i]['ban_email'])) { $ban_email = $banlist[$i]['ban_email']; $select_emaillist .= ''; @@ -367,12 +339,12 @@ else } } - if ( $select_iplist == '' ) + if ($select_iplist == '') { $select_iplist = ''; } - if ( $select_emaillist == '' ) + if ($select_emaillist == '') { $select_emaillist = ''; } @@ -381,11 +353,11 @@ else $select_emaillist = ''; $template->assign_vars(array( - 'U_SEARCH_USER' => "./../search.php?mode=searchuser", + 'U_SEARCH_USER' => './../search.php?mode=searchuser', 'S_UNBAN_USERLIST_SELECT' => $select_userlist, 'S_UNBAN_IPLIST_SELECT' => $select_iplist, 'S_UNBAN_EMAILLIST_SELECT' => $select_emaillist, - 'S_BAN_ACTION' => "admin_user_ban.php", + 'S_BAN_ACTION' => 'admin_user_ban.php', )); } diff --git a/upload/admin/admin_user_search.php b/upload/admin/admin_user_search.php index c97dd2031..66e68ea6f 100644 --- a/upload/admin/admin_user_search.php +++ b/upload/admin/admin_user_search.php @@ -9,44 +9,43 @@ if (!empty($setmodules)) require('./pagestart.php'); // ACP Header - END +array_deep($_POST, 'trim'); + require(INC_DIR .'functions_selects.php'); $total_sql = ''; -if(!isset($_POST['dosearch'])&&!isset($_GET['dosearch'])) +if (!isset($_REQUEST['dosearch'])) { $sql = "SELECT group_id, group_name FROM ".BB_GROUPS." WHERE group_single_user = 0 ORDER BY group_name ASC"; - if(!$result = DB()->sql_query($sql)) + if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not select group data', '', __LINE__, __FILE__, $sql); + bb_die('Could not select group data #1'); } $group_list = ''; - if(DB()->num_rows($result) != 0) + if (DB()->num_rows($result) != 0) { $template->assign_block_vars('groups_exist', array()); - while($row = DB()->sql_fetchrow($result)) + while ($row = DB()->sql_fetchrow($result)) { $group_list .= ''; } } - - $sql = "SELECT * FROM " . BB_RANKS . " - WHERE rank_special = 1 - ORDER BY rank_title"; - if ( !($result = DB()->sql_query($sql)) ) + $sql = "SELECT * FROM " . BB_RANKS . " WHERE rank_special = 1 ORDER BY rank_title"; + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not obtain ranks data', '', __LINE__, __FILE__, $sql); + bb_die('Could not obtain ranks data'); } $rank_select_box = ''; - if(DB()->num_rows($result) != 0) + if (DB()->num_rows($result) != 0) { $template->assign_block_vars('ranks_exist', array()); while( $row = DB()->sql_fetchrow($result) ) @@ -57,7 +56,6 @@ if(!isset($_POST['dosearch'])&&!isset($_GET['dosearch'])) } } - $language_list = language_select('', 'language_type'); $timezone_list = tz_select('', 'timezone_type'); @@ -65,24 +63,23 @@ if(!isset($_POST['dosearch'])&&!isset($_GET['dosearch'])) FROM ( ". BB_FORUMS ." AS f INNER JOIN ". BB_CATEGORIES ." AS c ON c.cat_id = f.cat_id ) ORDER BY c.cat_order, f.forum_order ASC"; - if(!$result = DB()->sql_query($sql)) + if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not select forum data', '', __LINE__, __FILE__, $sql); + bb_die('Could not select forum data'); } $forums = array(); - if(DB()->num_rows($result) != 0) + if (DB()->num_rows($result) != 0) { $template->assign_block_vars('forums_exist', array()); $last_cat_id = -1; - $forums_list = ''; - while($row = DB()->sql_fetchrow($result)) + while ($row = DB()->sql_fetchrow($result)) { - if($row['cat_id'] != $last_cat_id) + if ($row['cat_id'] != $last_cat_id) { $forums_list .= ''; $last_cat_id = $row['cat_id']; @@ -92,12 +89,10 @@ if(!isset($_POST['dosearch'])&&!isset($_GET['dosearch'])) } } - $styles_list = $bb_cfg['tpl_name']; - $lastvisited = array(1, 7, 14, 30, 60, 120, 365, 500, 730, 1000); $lastvisited_list = ''; - foreach($lastvisited as $days) + foreach ($lastvisited as $days) { $lastvisited_list .= ''; } @@ -113,7 +108,6 @@ if(!isset($_POST['dosearch'])&&!isset($_GET['dosearch'])) 'LANGUAGE_LIST' => $language_list, 'TIMEZONE_LIST' => $timezone_list, 'FORUMS_LIST' => $forums_list, - 'STYLE_LIST' => $styles_list, 'LASTVISITED_LIST' => $lastvisited_list, 'S_SEARCH_ACTION' => 'admin_user_search.php', @@ -124,222 +118,143 @@ else $mode = ''; // validate mode - if(isset($_POST['search_username'])||isset($_GET['search_username'])) + if (isset($_REQUEST['search_username'])) { $mode = 'search_username'; } - elseif(isset($_POST['search_email'])||isset($_GET['search_email'])) + elseif (isset($_REQUEST['search_email'])) { $mode = 'search_email'; } - elseif(isset($_POST['search_ip'])||isset($_GET['search_ip'])) + elseif (isset($_REQUEST['search_ip'])) { $mode = 'search_ip'; } - elseif(isset($_POST['search_joindate'])||isset($_GET['search_joindate'])) + elseif (isset($_REQUEST['search_joindate'])) { $mode = 'search_joindate'; } - elseif(isset($_POST['search_group'])||isset($_GET['search_group'])) + elseif (isset($_REQUEST['search_group'])) { $mode = 'search_group'; } - elseif(isset($_POST['search_rank'])||isset($_GET['search_rank'])) + elseif (isset($_REQUEST['search_rank'])) { $mode = 'search_rank'; } - elseif(isset($_POST['search_postcount'])||isset($_GET['search_postcount'])) + elseif (isset($_REQUEST['search_postcount'])) { $mode = 'search_postcount'; } - elseif(isset($_POST['search_userfield'])||isset($_GET['search_userfield'])) + elseif (isset($_REQUEST['search_userfield'])) { $mode = 'search_userfield'; } - elseif(isset($_POST['search_lastvisited'])||isset($_GET['search_lastvisited'])) + elseif (isset($_REQUEST['search_lastvisited'])) { $mode = 'search_lastvisited'; } - elseif(isset($_POST['search_language'])||isset($_GET['search_language'])) + elseif (isset($_REQUEST['search_language'])) { $mode = 'search_language'; } - elseif(isset($_POST['search_timezone'])||isset($_GET['search_timezone'])) + elseif (isset($_REQUEST['search_timezone'])) { $mode = 'search_timezone'; } - elseif(isset($_POST['search_style'])||isset($_GET['search_style'])) - { - $mode = 'search_style'; - } - elseif(isset($_POST['search_moderators'])||isset($_GET['search_moderators'])) + elseif (isset($_REQUEST['search_moderators'])) { $mode = 'search_moderators'; } - elseif(isset($_POST['search_misc'])||isset($_GET['search_misc'])) + elseif (isset($_REQUEST['search_misc'])) { $mode = 'search_misc'; } // validate fields (that they exist) - switch($mode) + switch ($mode) { case 'search_username': - $username = ( isset($_GET['username']) ) ? $_GET['username'] : $_POST['username']; - $regex = ( @$_POST['search_username_regex'] ) ? true : ( @$_GET['regex'] ) ? true : false; - - if(!$username) - { - message_die(GENERAL_MESSAGE, $lang['SEARCH_INVALID_USERNAME']); - } - + $username = $_REQUEST['username']; + if (!$username) bb_die($lang['SEARCH_INVALID_USERNAME']); break; + case 'search_email': - $email = ( isset($_GET['email']) ) ? $_GET['email'] : $_POST['email']; - $regex = ( @$_POST['search_email_regex'] ) ? true : ( @$_GET['regex'] ) ? true : false; - - if(!$email) - { - message_die(GENERAL_MESSAGE, $lang['SEARCH_INVALID_EMAIL']); - } - + $email = $_REQUEST['email']; + if (!$email) bb_die($lang['SEARCH_INVALID_EMAIL']); break; + case 'search_ip': - $ip_address = ( isset($_POST['ip_address'] ) ) ? $_POST['ip_address'] : $_GET['ip_address']; - - if(!$ip_address) - { - message_die(GENERAL_MESSAGE, $lang['SEARCH_INVALID_IP']); - } + $ip_address = $_REQUEST['ip_address']; + if (!$ip_address) bb_die($lang['SEARCH_INVALID_IP']); break; + case 'search_joindate': - $date_type = ( isset($_POST['date_type'] ) ) ? $_POST['date_type'] : $_GET['date_type']; - $date_day = ( isset($_POST['date_day'] ) ) ? $_POST['date_day'] : $_GET['date_day']; - $date_month = ( isset($_POST['date_month'] ) ) ? $_POST['date_month'] : $_GET['date_month']; - $date_year = ( isset($_POST['date_year'] ) ) ? $_POST['date_year'] : $_GET['date_year']; - - if(!$date_type || !$date_day || !$date_month || !$date_year) - { - message_die(GENERAL_MESSAGE, $lang['SEARCH_INVALID_DATE']); - } + $date_type = $_REQUEST['date_type']; + $date_day = $_REQUEST['date_day']; + $date_month = $_REQUEST['date_month']; + $date_year = $_REQUEST['date_year']; + if (!($date_type || $date_day || $date_month || $date_year)) bb_die($lang['SEARCH_INVALID_DATE']); break; + case 'search_group': - $group_id = ( isset($_POST['group_id'] ) ) ? $_POST['group_id'] : $_GET['group_id']; - if(!$group_id) - { - message_die(GENERAL_MESSAGE, $lang['SEARCH_INVALID_GROUP']); - } + $group_id = $_REQUEST['group_id']; + if (!$group_id) bb_die($lang['SEARCH_INVALID_GROUP']); break; + case 'search_rank': - $rank_id = ( isset($_POST['rank_id'] ) ) ? $_POST['rank_id'] : $_GET['rank_id']; - if(!$rank_id) - { - message_die(GENERAL_MESSAGE, $lang['SEARCH_INVALID_RANK']); - } + $rank_id = $_REQUEST['rank_id']; + if (!$rank_id) bb_die($lang['SEARCH_INVALID_RANK']); break; + case 'search_postcount': - $postcount_type = ( isset($_POST['postcount_type'] ) ) ? $_POST['postcount_type'] : $_GET['postcount_type']; - $postcount_value = ( isset($_POST['postcount_value'] ) ) ? $_POST['postcount_value'] : $_GET['postcount_value']; - - if(!$postcount_type || ( !$postcount_value && $postcount_value != 0)) - { - message_die(GENERAL_MESSAGE, $lang['SEARCH_INVALID_POSTCOUNT']); - } + $postcount_type = $_REQUEST['postcount_type']; + $postcount_value = $_REQUEST['postcount_value']; + if (!$postcount_type || (!$postcount_value && $postcount_value != 0)) bb_die($lang['SEARCH_INVALID_POSTCOUNT']); break; + case 'search_userfield': - $userfield_type = ( isset($_POST['userfield_type'] ) ) ? $_POST['userfield_type'] : $_GET['userfield_type']; - $userfield_value = ( isset($_POST['userfield_value'] ) ) ? $_POST['userfield_value'] : $_GET['userfield_value']; - $regex = ( @$_POST['search_userfield_regex'] ) ? true : ( @$_GET['regex'] ) ? true : false; - - if(!$userfield_type || !$userfield_value) - { - message_die(GENERAL_MESSAGE, $lang['SEARCH_INVALID_USERFIELD']); - } - + $userfield_type = $_REQUEST['userfield_type']; + $userfield_value = $_REQUEST['userfield_value']; + if (!$userfield_type || !$userfield_value) bb_die($lang['SEARCH_INVALID_USERFIELD']); break; + case 'search_lastvisited': - $lastvisited_days = ( isset($_POST['lastvisited_days'] ) ) ? $_POST['lastvisited_days'] : $_GET['lastvisited_days']; - $lastvisited_type = ( isset($_POST['lastvisited_type'] ) ) ? $_POST['lastvisited_type'] : $_GET['lastvisited_type']; - - if(!$lastvisited_days || !$lastvisited_type) - { - message_die(GENERAL_MESSAGE, $lang['SEARCH_INVALID_LASTVISITED']); - } - + $lastvisited_days = $_REQUEST['lastvisited_days']; + $lastvisited_type = $_REQUEST['lastvisited_type']; + if (!$lastvisited_days || !$lastvisited_type) bb_die($lang['SEARCH_INVALID_LASTVISITED']); break; + case 'search_language': - $language_type = ( isset($_POST['language_type'] ) ) ? $_POST['language_type'] : $_GET['language_type']; - - if(!$language_type) - { - message_die(GENERAL_MESSAGE, $lang['SEARCH_INVALID_LANGUAGE']); - } - + $language_type = $_REQUEST['language_type']; + if (!$language_type) bb_die($lang['SEARCH_INVALID_LANGUAGE']); break; + case 'search_timezone': - $timezone_type = ( isset($_POST['timezone_type'] ) ) ? $_POST['timezone_type'] : $_GET['timezone_type']; - - if(!$timezone_type && $timezone_type != 0) - { - message_die(GENERAL_MESSAGE, $lang['SEARCH_INVALID_TIMEZONE']); - } - + $timezone_type = $_REQUEST['timezone_type']; + if (!$timezone_type && $timezone_type != 0) bb_die($lang['SEARCH_INVALID_TIMEZONE']); break; - case 'search_style': - $style_type = ( isset($_POST['style_type'] ) ) ? $_POST['style_type'] : $_GET['style_type']; - if(!$style_type) - { - message_die(GENERAL_MESSAGE, $lang['SEARCH_INVALID_STYLE']); - } - - break; case 'search_moderators': - $moderators_forum = ( isset($_POST['moderators_forum'] ) ) ? $_POST['moderators_forum'] : $_GET['moderators_forum']; - - if(!$moderators_forum) - { - message_die(GENERAL_MESSAGE, $lang['SEARCH_INVALID_MODERATORS']); - } - + $moderators_forum = $_REQUEST['moderators_forum']; + if (!$moderators_forum) bb_die($lang['SEARCH_INVALID_MODERATORS']); break; + case 'search_misc': + $misc = $_REQUEST['misc']; + if (!$misc) bb_die($lang['SEARCH_INVALID']); + break; + default: - $misc = ( isset($_POST['misc'] ) ) ? $_POST['misc'] : $_GET['misc']; - if(!$misc) - { - message_die(GENERAL_MESSAGE, $lang['SEARCH_INVALID']); - } + bb_die('Invalid mode'); } $base_url = 'admin_user_search.php?dosearch=true'; - $select_sql = "SELECT u.user_id, u.username, u.user_rank, u.user_email, u.user_posts, u.user_regdate, u.user_level, u.user_active, u.user_lastvisit - FROM ". BB_USERS ." AS u"; + $select_sql = "SELECT u.user_id, u.username, u.user_rank, u.user_email, u.user_posts, u.user_regdate, u.user_level, u.user_active, u.user_lastvisit FROM ". BB_USERS ." AS u"; $lower_b = 'LOWER('; $lower_e = ')'; - if(@$regex) - { - switch(SQL_LAYER) - { - case 'postgres': - $op = '~'; - break; - case 'oracle': - // Oracle uses a different syntax, we'll handle that a little later - break; - case 'mysql': - case 'mysql4': - $op = 'REGEXP'; - break; - default: - message_die(GENERAL_MESSAGE, $lang['SEARCH_NO_REGEXP']); - } - - $lower_b = ''; - $lower_e = ''; - } // validate data & prepare sql switch($mode) @@ -349,103 +264,48 @@ else $text = sprintf($lang['SEARCH_FOR_USERNAME'], strip_tags(htmlspecialchars(stripslashes($username)))); - if(!$regex) - { - $username = preg_replace('/\*/', '%', trim(strip_tags(strtolower($username)))); + $username = preg_replace('/\*/', '%', trim(strip_tags(strtolower($username)))); - if(strstr($username, '%')) - { - $op = 'LIKE'; - } - else - { - $op = '='; - } + if (strstr($username, '%')) + { + $op = 'LIKE'; } else { - $username = preg_replace('/\\\\\\\(?escape($username)."') - AND user_id <> ".GUEST_UID; - - $select_sql .= " WHERE REGEXP_LIKE(u.username, '".DB()->escape($username)."') - AND u.user_id <> ".GUEST_UID; - } - else - { - $total_sql .= "SELECT COUNT(user_id) AS total - FROM ".BB_USERS." - WHERE {$lower_b}username{$lower_e} $op '".DB()->escape($username)."' - AND user_id <> ".GUEST_UID; - - $select_sql .= " WHERE {$lower_b}u.username{$lower_e} $op '".DB()->escape($username)."' - AND u.user_id <> ".GUEST_UID; - } + $total_sql .= "SELECT COUNT(user_id) AS total FROM ".BB_USERS." WHERE {$lower_b}username{$lower_e} $op '".DB()->escape($username)."' AND user_id <> ".GUEST_UID; + $select_sql .= " WHERE {$lower_b}u.username{$lower_e} $op '".DB()->escape($username)."' AND u.user_id <> ".GUEST_UID; break; + case 'search_email': $base_url .= '&search_email=true&email='.rawurlencode(stripslashes($email)); $text = sprintf($lang['SEARCH_FOR_EMAIL'], strip_tags(htmlspecialchars(stripslashes($email)))); - if(!$regex) - { - $email = preg_replace('/\*/', '%', trim(strip_tags(strtolower($email)))); + $email = preg_replace('/\*/', '%', trim(strip_tags(strtolower($email)))); - if(strstr($email, '%')) - { - $op = 'LIKE'; - } - else - { - $op = '='; - } + if (strstr($email, '%')) + { + $op = 'LIKE'; } else { - $email = preg_replace('/\\\\\\\(?escape($email)."') - AND user_id <> ".GUEST_UID; - - $select_sql .= " WHERE REGEXP_LIKE(u.user_email, '".DB()->escape($email)."') - AND u.user_id <> ".GUEST_UID; - } - else - { - $total_sql .= "SELECT COUNT(user_id) AS total - FROM ".BB_USERS." - WHERE {$lower_b}user_email{$lower_e} $op '".DB()->escape($email)."' - AND user_id <> ".GUEST_UID; - - $select_sql .= " WHERE {$lower_b}u.user_email{$lower_e} $op '".DB()->escape($email)."' - AND u.user_id <> ".GUEST_UID; - } + $total_sql .= "SELECT COUNT(user_id) AS total FROM ".BB_USERS." WHERE {$lower_b}user_email{$lower_e} $op '".DB()->escape($email)."' AND user_id <> ".GUEST_UID; + $select_sql .= " WHERE {$lower_b}u.user_email{$lower_e} $op '".DB()->escape($email)."' AND u.user_id <> ".GUEST_UID; break; + case 'search_ip': $base_url .= '&search_ip=true&ip_address='.rawurlencode(stripslashes($ip_address)); - // Remove any whitespace $ip_address = trim($ip_address); $text = sprintf($lang['SEARCH_FOR_IP'], strip_tags(htmlspecialchars(stripslashes($ip_address)))); @@ -454,99 +314,61 @@ else $users = array(); // Let's see if they entered a full valid IPv4 address - if( preg_match('/^([0-9]{1,2}|[0-2][0-9]{0,2})(\.([0-9]{1,2}|[0-2][0-9]{0,2})){3}$/', $ip_address) ) + if (preg_match('/^([0-9]{1,2}|[0-2][0-9]{0,2})(\.([0-9]{1,2}|[0-2][0-9]{0,2})){3}$/', $ip_address)) { - // Encode the ip into hexademicals $ip = encode_ip($ip_address); - - // Because we will be deleting based on IP's, we will store the encoded IP alone $users[] = $ip; } - // We will also support wildcards, is this an xxx.xxx.* address? - elseif( preg_match('/^([0-9]{1,2}|[0-2][0-9]{0,2})(\.([0-9]{1,2}|[0-2][0-9]{0,2})){0,2}\.\*/', $ip_address) ) + elseif (preg_match('/^([0-9]{1,2}|[0-2][0-9]{0,2})(\.([0-9]{1,2}|[0-2][0-9]{0,2})){0,2}\.\*/', $ip_address)) { - // Alright, now we do the ugly part, converting them to encoded ips - // We need to deal with the three ways it can be done - // xxx.* - // xxx.xxx.* - // xxx.xxx.xxx.* - - // First we will split the IP into its quads $ip_split = explode('.', $ip_address); - - // Now we'll work with which type of wildcard we have - switch( count($ip_split) ) + switch (count($ip_split)) { - // xxx.xxx.xxx.* case 4: - // We will encode the ip into hexademical quads $users[] = encode_ip($ip_split[0].".".$ip_split[1].".".$ip_split[2].".255"); break; - // xxx.xxx.* case 3: - // We will encode the ip into hexademical quads again.. $users[] = encode_ip($ip_split[0].".".$ip_split[1].".255.255"); break; - // xxx.* case 2: - // We will encode the ip into hexademical quads again again.... $users[] = encode_ip($ip_split[0].".255.255.255"); break; } } - // Lastly, let's see if they have a range in the last quad, like xxx.xxx.xxx.xxx - xxx.xxx.xxx.yyy - elseif( preg_match('/^([0-9]{1,2}|[0-2][0-9]{0,2})(\.([0-9]{1,2}|[0-2][0-9]{0,2})){3}(\s)*-(\s)*([0-9]{1,2}|[0-2][0-9]{0,2})(\.([0-9]{1,2}|[0-2][0-9]{0,2})){3}$/', $ip_address) ) + elseif (preg_match('/^([0-9]{1,2}|[0-2][0-9]{0,2})(\.([0-9]{1,2}|[0-2][0-9]{0,2})){3}(\s)*-(\s)*([0-9]{1,2}|[0-2][0-9]{0,2})(\.([0-9]{1,2}|[0-2][0-9]{0,2})){3}$/', $ip_address)) { - // We will split the two ranges $range = preg_split('/[-\s]+/', $ip_address); - - // This is where break the start and end ips into quads $start_range = explode('.', $range[0]); $end_range = explode('.', $range[1]); - - // Confirm if we are in the same subnet or the last quad in the beginning range is greater than the last in the ending range - if( ($start_range[0].$start_range[1].$start_range[2] != $end_range[0].$end_range[1].$end_range[2]) || ($start_range[3] > $end_range[3]) ) + if (($start_range[0].$start_range[1].$start_range[2] != $end_range[0].$end_range[1].$end_range[2]) || ($start_range[3] > $end_range[3])) bb_die($lang['SEARCH_INVALID_IP']); + for ($i = $start_range[3]; $i <= $end_range[3]; $i++) { - message_die(GENERAL_MESSAGE, $lang['SEARCH_INVALID_IP']); - } - - // Ok, we need to store each IP in the range.. - for( $i = $start_range[3]; $i <= $end_range[3]; $i++ ) - { - // let's put it in the big array.. $users[] = encode_ip($start_range[0].".".$start_range[1 ].".".$start_range[2].".".$i); } } - // This is not a valid IP based on what we want.. else { - message_die(GENERAL_MESSAGE, $lang['SEARCH_INVALID_IP']); + bb_die($lang['SEARCH_INVALID_IP']); } $ip_in_sql = $ip_like_sql = $ip_like_sql_flylast = $ip_like_sql_flyreg = ''; - foreach($users as $address) + foreach ($users as $address) { - // Is this IP a range? - if( preg_match('/(ff){1,3}$/i', $address) ) + if (preg_match('/(ff){1,3}$/i', $address)) { - // num.xxx.xxx.xxx - if( preg_match('/[0-9a-f]{2}ffffff/i', $address) ) + if (preg_match('/[0-9a-f]{2}ffffff/i', $address)) { $ip_start = substr($address, 0, 2); } - // num.num.xxx.xxx - elseif( preg_match('/[0-9a-f]{4}ffff/i', $address) ) + elseif (preg_match('/[0-9a-f]{4}ffff/i', $address)) { $ip_start = substr($address, 0, 4); - } - // num.num.num.xxx - elseif( preg_match('/[0-9a-f]{6}ff/i', $address) ) + elseif (preg_match('/[0-9a-f]{6}ff/i', $address)) { $ip_start = substr($address, 0, 6); } - $ip_like_sql_flylast = $ip_like_sql . ( $ip_like_sql != '' ) ? " OR user_last_ip LIKE '".$ip_start."%'" : "user_last_ip LIKE '".$ip_start."%'"; $ip_like_sql_flyreg = $ip_like_sql . ( $ip_like_sql != '' ) ? " OR user_reg_ip LIKE '".$ip_start."%'" : "user_reg_ip LIKE '".$ip_start."%'"; $ip_like_sql .= ( $ip_like_sql != '' ) ? " OR poster_ip LIKE '".$ip_start."%'" : "poster_ip LIKE '".$ip_start."%'"; @@ -566,128 +388,107 @@ else // start search $no_result_search = false; $ip_users_sql = ''; - $sql = "SELECT poster_id - FROM ".BB_POSTS." - WHERE poster_id <> ".GUEST_UID." - AND ($where_sql) - GROUP BY poster_id"; + $sql = "SELECT poster_id FROM ".BB_POSTS." WHERE poster_id <> ".GUEST_UID." AND ($where_sql) GROUP BY poster_id"; - if(!$result = DB()->sql_query($sql)) + if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, "Could not count users", '', __LINE__, __FILE__, $sql); + bb_die('Could not count users #1'); } - if(DB()->num_rows($result)==0) + if (DB()->num_rows($result) == 0) { $no_result_search = true; - // message_die(GENERAL_MESSAGE, $lang['SEARCH_NO_RESULTS']); } else { $total_pages['total'] = DB()->num_rows($result); - $total_sql = NULL; - $ip_users_sql = ''; - while($row = DB()->sql_fetchrow($result)) { $ip_users_sql .= ( $ip_users_sql == '' ) ? $row['poster_id'] : ', '.$row['poster_id']; } } - - // fly_indiz addon [START] - // user last ip $where_sql = ''; $where_sql .= ( $ip_in_sql != '' ) ? "user_last_ip IN ($ip_in_sql)": ""; $where_sql .= ( $ip_like_sql_flylast != '' ) ? ( $where_sql != "" ) ? " OR $ip_like_sql_flylast" : "$ip_like_sql_flylast": ""; - $sql = "SELECT user_id - FROM ".BB_USERS." - WHERE user_id <> ".GUEST_UID." - AND ($where_sql) - GROUP BY user_id"; - if(!$result = DB()->sql_query($sql)) + $sql = "SELECT user_id FROM ".BB_USERS." WHERE user_id <> ".GUEST_UID." AND ($where_sql) GROUP BY user_id"; + if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, "Could not count users", '', __LINE__, __FILE__, $sql); + bb_die('Could not count users #2'); } - if(DB()->num_rows($result)!=0) + if (DB()->num_rows($result) != 0) { if ($no_result_search == true) $no_result_search = false; $total_pages['total'] = DB()->num_rows($result); $total_sql = NULL; - while($row = DB()->sql_fetchrow($result)) + while ($row = DB()->sql_fetchrow($result)) { $ip_users_sql .= ( $ip_users_sql == '' ) ? $row['user_id'] : ', '.$row['user_id']; } } - // user reg ip $where_sql = ''; $where_sql .= ( $ip_in_sql != '' ) ? "user_reg_ip IN ($ip_in_sql)": ""; $where_sql .= ( $ip_like_sql_flyreg != '' ) ? ( $where_sql != "" ) ? " OR $ip_like_sql_flyreg" : "$ip_like_sql_flyreg": ""; - $sql = "SELECT user_id - FROM ".BB_USERS." - WHERE user_id <> ".GUEST_UID." - AND ($where_sql) - GROUP BY user_id"; - if(!$result = DB()->sql_query($sql)) + $sql = "SELECT user_id FROM ".BB_USERS." WHERE user_id <> ".GUEST_UID." AND ($where_sql) GROUP BY user_id"; + if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, "Could not count users", '', __LINE__, __FILE__, $sql); + bb_die('Could not count users #3'); } - if(DB()->num_rows($result)!=0) + if (DB()->num_rows($result) != 0) { if ($no_result_search == true) $no_result_search = false; $total_pages['total'] = DB()->num_rows($result); $total_sql = NULL; - while($row = DB()->sql_fetchrow($result)) + while ($row = DB()->sql_fetchrow($result)) { $ip_users_sql .= ( $ip_users_sql == '' ) ? $row['user_id'] : ', '.$row['user_id']; } } if ($no_result_search == true) { - message_die(GENERAL_MESSAGE, $lang['SEARCH_NO_RESULTS']); + bb_die($lang['SEARCH_NO_RESULTS']); } - // fly_indiz addon [END] $select_sql .= " WHERE u.user_id IN ($ip_users_sql)"; - break; + case 'search_joindate': $base_url .= '&search_joindate=true&date_type='. rawurlencode($date_type) .'&date_day='. rawurlencode($date_day) .'&date_month='. rawurlencode($date_month) .'&date_year='. rawurlencode(stripslashes($date_year)); $date_type = trim(strtolower($date_type)); - if($date_type != 'before' && $date_type != 'after') + if ($date_type != 'before' && $date_type != 'after') { - message_die(GENERAL_MESSAGE, $lang['SEARCH_INVALID_DATE']); + bb_die($lang['SEARCH_INVALID_DATE']); } $date_day = intval($date_day); - if( !preg_match('/^([1-9]|[0-2][0-9]|3[0-1])$/', $date_day) ) + if (!preg_match('/^([1-9]|[0-2][0-9]|3[0-1])$/', $date_day)) { - message_die(GENERAL_MESSAGE, $lang['SEARCH_INVALID_DAY']); + bb_die($lang['SEARCH_INVALID_DAY']); } $date_month = intval($date_month); - if( !preg_match('/^(0?[1-9]|1[0-2])$/', $date_month) ) + if (!preg_match('/^(0?[1-9]|1[0-2])$/', $date_month)) { - message_die(GENERAL_MESSAGE, $lang['SEARCH_INVALID_MONTH']); + bb_die($lang['SEARCH_INVALID_MONTH']); } $date_year = intval($date_year); - if( !preg_match('/^(20[0-9]{2}|19[0-9]{2})$/', $date_year) ) + if (!preg_match('/^(20[0-9]{2}|19[0-9]{2})$/', $date_year)) { - message_die(GENERAL_MESSAGE, $lang['SEARCH_INVALID_YEAR']); + bb_die($lang['SEARCH_INVALID_YEAR']); } $text = sprintf($lang['SEARCH_FOR_DATE'], strip_tags(htmlspecialchars(stripslashes($date_type))), $date_year, $date_month, $date_day); $time = mktime(0,0,0,$date_month, $date_day, $date_year); - if($date_type == 'before') + if ($date_type == 'before') { $arg = '<'; } @@ -696,38 +497,30 @@ else $arg = '>'; } - $total_sql .= "SELECT COUNT(user_id) AS total - FROM ".BB_USERS." - WHERE user_regdate $arg $time - AND user_id <> ".GUEST_UID; - - $select_sql .= " WHERE u.user_regdate $arg $time - AND u.user_id <> ".GUEST_UID; - + $total_sql .= "SELECT COUNT(user_id) AS total FROM ".BB_USERS." WHERE user_regdate $arg $time AND user_id <> ".GUEST_UID; + $select_sql .= " WHERE u.user_regdate $arg $time AND u.user_id <> ".GUEST_UID; break; + case 'search_group': $group_id = intval($group_id); $base_url .= '&search_group=true&group_id='. rawurlencode($group_id); - if(!$group_id) + if (!$group_id) { - message_die(GENERAL_MESSAGE, $lang['SEARCH_INVALID_GROUP']); + bb_die($lang['SEARCH_INVALID_GROUP']); } - $sql = "SELECT group_name - FROM ".BB_GROUPS." - WHERE group_id = $group_id - AND group_single_user = 0"; + $sql = "SELECT group_name FROM ".BB_GROUPS." WHERE group_id = $group_id AND group_single_user = 0"; - if(!$result = DB()->sql_query($sql)) + if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not select group data', '', __LINE__, __FILE__, $sql); + bb_die('Could not select group data #2'); } - if(DB()->num_rows($result)==0) + if (DB()->num_rows($result)==0) { - message_die(GENERAL_MESSAGE, $lang['SEARCH_INVALID_GROUP']); + bb_die($lang['SEARCH_INVALID_GROUP']); } $group_name = DB()->sql_fetchrow($result); @@ -744,31 +537,28 @@ else WHERE u.user_id = ug.user_id AND ug.group_id = $group_id AND u.user_id <> ".GUEST_UID; - break; + case 'search_rank': $rank_id = intval($rank_id); $base_url .= '&search_rank=true&rank_id='. rawurlencode($rank_id); - if(!$rank_id) + if (!$rank_id) { - message_die(GENERAL_MESSAGE, $lang['SEARCH_INVALID_RANK']); + bb_die($lang['SEARCH_INVALID_RANK']); } - $sql = "SELECT rank_title - FROM ".BB_RANKS." - WHERE rank_id = $rank_id - AND rank_special = 1"; + $sql = "SELECT rank_title FROM ".BB_RANKS." WHERE rank_id = $rank_id AND rank_special = 1"; - if(!$result = DB()->sql_query($sql)) + if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not select rank data', '', __LINE__, __FILE__, $sql); + bb_die('Could not select rank data'); } - if(DB()->num_rows($result)==0) + if (DB()->num_rows($result)==0) { - message_die(GENERAL_MESSAGE, $lang['SEARCH_INVALID_RANK']); + bb_die($lang['SEARCH_INVALID_RANK']); } $rank_title = DB()->sql_fetchrow($result); @@ -782,8 +572,8 @@ else $select_sql .= " WHERE u.user_rank = $rank_id AND u.user_id <> ".GUEST_UID; - break; + case 'search_postcount': $postcount_type = trim(strtolower($postcount_type)); $postcount_value = trim(strtolower($postcount_value)); @@ -820,16 +610,16 @@ else break; case 'equals': // looking for a - - if(strstr($postcount_value, '-')) + if (strstr($postcount_value, '-')) { $range = preg_split('/[-\s]+/', $postcount_value); $range_begin = intval($range[0]); $range_end = intval($range[1]); - if($range_begin > $range_end) + if ($range_begin > $range_end) { - message_die(GENERAL_MESSAGE, $lang['SEARCH_INVALID_POSTCOUNT']); + bb_die($lang['SEARCH_INVALID_POSTCOUNT']); } $text = sprintf($lang['SEARCH_FOR_POSTCOUNT_RANGE'], $range_begin, $range_end); @@ -860,41 +650,31 @@ else } break; default: - message_die(GENERAL_MESSAGE, $lang['SEARCH_INVALID']); + bb_die($lang['SEARCH_INVALID']); } - break; + case 'search_userfield': $base_url .= '&search_userfield=true&userfield_type='. rawurlencode($userfield_type) .'&userfield_value='. rawurlencode(stripslashes($userfield_value)); $text = strip_tags(htmlspecialchars(stripslashes($userfield_value))); - if(!$regex) - { - $userfield_value = preg_replace('/\*/', '%', trim(strip_tags(strtolower($userfield_value)))); + $userfield_value = preg_replace('/\*/', '%', trim(strip_tags(strtolower($userfield_value)))); - if(strstr($userfield_value, '%')) - { - $op = 'LIKE'; - } - else - { - $op = '='; - } + if (strstr($userfield_value, '%')) + { + $op = 'LIKE'; } else { - $userfield_value = preg_replace('/\\\\\\\(?escape($userfield_value)."') - AND user_id <> ".GUEST_UID; - - $select_sql .= " WHERE REGEXP_LIKE(u.$field, '".DB()->escape($userfield_value)."') - AND u.user_id <> ".GUEST_UID; - } - else - { - $total_sql .= "SELECT COUNT(user_id) AS total - FROM ".BB_USERS." - WHERE {$lower_b}$field{$lower_e} $op '".DB()->escape($userfield_value)."' - AND user_id <> ".GUEST_UID; - - $select_sql .= " WHERE {$lower_b}u.$field{$lower_e} $op '".DB()->escape($userfield_value)."' - AND u.user_id <> ".GUEST_UID; - } + $total_sql .= "SELECT COUNT(user_id) AS total + FROM ".BB_USERS." + WHERE {$lower_b}$field{$lower_e} $op '".DB()->escape($userfield_value)."' + AND user_id <> ".GUEST_UID; + $select_sql .= " WHERE {$lower_b}u.$field{$lower_e} $op '".DB()->escape($userfield_value)."' + AND u.user_id <> ".GUEST_UID; break; + case 'search_lastvisited': $lastvisited_type = trim(strtolower($lastvisited_type)); $lastvisited_days = intval($lastvisited_days); @@ -984,18 +751,18 @@ else break; default: - message_die(GENERAL_MESSAGE, $lang['SEARCH_INVALID_LASTVISITED']); + bb_die($lang['SEARCH_INVALID_LASTVISITED']); } - break; + case 'search_language': $base_url .= '&search_language=true&language_type='. rawurlencode(stripslashes($language_type)); $language_type = trim(strtolower(stripslashes($language_type))); - if($language_type == '') + if ($language_type == '') { - message_die(GENERAL_MESSAGE, $lang['SEARCH_INVALID_LANGUAGE']); + bb_die($lang['SEARCH_INVALID_LANGUAGE']); } $text = sprintf($lang['SEARCH_FOR_LANGUAGE'], strip_tags(htmlspecialchars($language_type))); @@ -1007,8 +774,8 @@ else $select_sql .= " WHERE u.user_lang = '".DB()->escape($language_type)."' AND u.user_id <> ".GUEST_UID; - break; + case 'search_timezone': $base_url .= '&search_timezone=true&timezone_type='. rawurlencode(stripslashes($timezone_type)); $text = sprintf($lang['SEARCH_FOR_TIMEZONE'], strip_tags(htmlspecialchars(stripslashes($timezone_type)))); @@ -1022,11 +789,8 @@ else $select_sql .= " WHERE u.user_timezone = $timezone_type AND u.user_id <> ".GUEST_UID; + break; - break; - case 'search_style': - message_die(GENERAL_MESSAGE, 'Disabled'); - break; case 'search_moderators': $base_url .= '&search_moderators=true&moderators_forum='. rawurlencode(stripslashes($moderators_forum)); $moderators_forum = intval($moderators_forum); @@ -1036,14 +800,14 @@ else WHERE forum_id = ".$moderators_forum; - if(!$result = DB()->sql_query($sql)) + if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not select forum data', '', __LINE__, __FILE__, $sql); + bb_die('Could not select forum data'); } - if(DB()->num_rows($result)==0) + if (DB()->num_rows($result)==0) { - message_die(GENERAL_MESSAGE, $lang['SEARCH_INVALID_MODERATORS']); + bb_die($lang['SEARCH_INVALID_MODERATORS']); } $forum_name = DB()->sql_fetchrow($result); @@ -1068,13 +832,14 @@ else AND u.user_id <> ".GUEST_UID." GROUP BY u.user_id, u.username, u.user_email, u.user_posts, u.user_regdate, u.user_level, u.user_active, u.user_lastvisit"; break; + case 'search_misc': default: $misc = trim(strtolower($misc)); $base_url .= '&search_misc=true&misc='. rawurlencode(stripslashes($misc)); - switch($misc) + switch ($misc) { case 'admins': $text = $lang['SEARCH_FOR_ADMINS']; @@ -1124,52 +889,47 @@ else break; default: - message_die(GENERAL_MESSAGE, $lang['SEARCH_INVALID']); + bb_die($lang['SEARCH_INVALID']); } } - if(@$regex) - { - $base_url .= '®ex=1'; - } - $select_sql .= " ORDER BY "; - switch(strtolower(@$_GET['sort'])) + switch (strtolower(@$_GET['sort'])) { case 'regdate': $sort = 'regdate'; - $select_sql .= 'u.user_regdate'; break; + case 'posts': $sort = 'posts'; - $select_sql .= 'u.user_posts'; break; + case 'user_email': $sort = 'user_email'; - $select_sql .= 'u.user_email'; break; + case 'lastvisit': $sort = 'lastvisit'; - $select_sql .= 'u.user_lastvisit'; break; + case 'username': default: $sort = 'username'; - $select_sql .= 'u.username'; } - switch(@$_GET['order']) + switch (@$_GET['order']) { case 'DESC': $order = 'DESC'; $o_order = 'ASC'; break; + default: $o_order = 'DESC'; $order = 'ASC'; @@ -1179,12 +939,12 @@ else $page = ( isset($_GET['page']) ) ? intval($_GET['page']) : intval(trim(@$_POST['page'])); - if($page < 1) + if ($page < 1) { $page = 1; } - if($page == 1) + if ($page == 1) { $offset = 0; } @@ -1197,30 +957,29 @@ else $select_sql .= " $limit"; - if(!is_null($total_sql)) + if (!is_null($total_sql)) { - if(!$result = DB()->sql_query($total_sql)) + if (!$result = DB()->sql_query($total_sql)) { - message_die(GENERAL_ERROR, "Could not count users", '', __LINE__, __FILE__, $total_sql); + bb_die('Could not count users'); } $total_pages = DB()->sql_fetchrow($result); - if($total_pages['total'] == 0) + if ($total_pages['total'] == 0) { - message_die(GENERAL_MESSAGE, $lang['SEARCH_NO_RESULTS']); + bb_die($lang['SEARCH_NO_RESULTS']); } } $num_pages = ceil( ( $total_pages['total'] / $bb_cfg['topics_per_page'] ) ); $pagination = ''; - if($page > 1) + if ($page > 1) { $pagination .= ''. $lang['PREVIOUS'] .''; } - - if($page < $num_pages) + if ($page < $num_pages) { $pagination .= ( $pagination == '' ) ? ''.$lang['NEXT'].'' : ' | '.$lang['NEXT'].''; } @@ -1244,39 +1003,37 @@ else 'S_POST_ACTION' => "$base_url&sort=$sort&order=$order" )); - if(!$result = DB()->sql_query($select_sql)) + if (!$result = DB()->sql_query($select_sql)) { - message_die(GENERAL_ERROR, "Could not select user data", '', __LINE__, __FILE__, $select_sql); + bb_die('Could not select user data'); } $rowset = DB()->sql_fetchrowset($result); $users_sql = ''; - foreach($rowset as $array) + foreach ($rowset as $array) { $users_sql .= ( $users_sql == '' ) ? $array['user_id'] : ', '.$array['user_id']; } - $sql = "SELECT ban_userid AS user_id - FROM ". BB_BANLIST ." - WHERE ban_userid IN ($users_sql)"; + $sql = "SELECT ban_userid AS user_id FROM ". BB_BANLIST ." WHERE ban_userid IN ($users_sql)"; - if(!$result = DB()->sql_query($sql)) + if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, "Could not select banned data", '', __LINE__, __FILE__, $sql); + bb_die('Could not select banned data'); } unset($banned); $banned = array(); - while($row = DB()->sql_fetchrow($result)) + while ($row = DB()->sql_fetchrow($result)) { $banned[$row['user_id']] = true; } - for($i = 0; $i < count($rowset); $i++) + for ($i = 0; $i < count($rowset); $i++) { $row_class = !($i % 2) ? 'row1' : 'row2'; diff --git a/upload/admin/admin_words.php b/upload/admin/admin_words.php index 391a20823..407542292 100644 --- a/upload/admin/admin_words.php +++ b/upload/admin/admin_words.php @@ -11,41 +11,37 @@ require('./pagestart.php'); if (!$bb_cfg['use_word_censor']) { - bb_die('Word Censor disabled

($bb_cfg[\'use_word_censor\'] in config.php)'); + bb_die('Word censor disabled

($bb_cfg[\'use_word_censor\'] in config.php)'); } $mode = request_var('mode', ''); $mode = htmlspecialchars($mode); -// -// These could be entered via a form button -// -if( isset($_POST['add']) ) + +if (isset($_POST['add'])) { $mode = 'add'; } -else if( isset($_POST['save']) ) +else if (isset($_POST['save'])) { $mode = 'save'; } -if( $mode != '' ) +if ($mode != '') { - if( $mode == 'edit' || $mode == 'add' ) + if ($mode == 'edit' || $mode == 'add') { $word_id = intval(request_var('id', 0)); $s_hidden_fields = $word = $replacement = ''; - if( $mode == 'edit' ) + if ($mode == 'edit') { - if( $word_id ) + if ($word_id) { - $sql = "SELECT * - FROM " . BB_WORDS . " - WHERE word_id = $word_id"; - if(!$result = DB()->sql_query($sql)) + $sql = "SELECT * FROM " . BB_WORDS . " WHERE word_id = $word_id"; + if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, "Could not query words table", $lang['ERROR'], __LINE__, __FILE__, $sql); + bb_die('Could not query words table #1'); } $word_info = DB()->sql_fetchrow($result); @@ -55,32 +51,30 @@ if( $mode != '' ) } else { - message_die(GENERAL_MESSAGE, $lang['NO_WORD_SELECTED']); + bb_die($lang['NO_WORD_SELECTED']); } } $template->assign_vars(array( 'TPL_ADMIN_WORDS_EDIT' => true, - - 'WORD' => $word, - 'REPLACEMENT' => $replacement, - - 'S_WORDS_ACTION' => "admin_words.php", - 'S_HIDDEN_FIELDS' => $s_hidden_fields, + 'WORD' => $word, + 'REPLACEMENT' => $replacement, + 'S_WORDS_ACTION' => 'admin_words.php', + 'S_HIDDEN_FIELDS' => $s_hidden_fields, )); } - else if( $mode == 'save' ) + else if ($mode == 'save') { $word_id = intval(request_var('id', 0)); $word = trim(request_var('word', '')); $replacement = trim(request_var('replacement', '')); - if($word == '' || $replacement == '') + if ($word == '' || $replacement == '') { - message_die(GENERAL_MESSAGE, $lang['MUST_ENTER_WORD']); + bb_die($lang['MUST_ENTER_WORD']); } - if( $word_id ) + if ($word_id) { $sql = "UPDATE " . BB_WORDS . " SET word = '" . DB()->escape($word) . "', replacement = '" . DB()->escape($replacement) . "' @@ -94,50 +88,45 @@ if( $mode != '' ) $message = $lang['WORD_ADDED']; } - if(!$result = DB()->sql_query($sql)) + if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, "Could not insert data into words table", $lang['ERROR'], __LINE__, __FILE__, $sql); + bb_die('Could not insert data into words table'); } CACHE('bb_cache')->rm('censored'); $message .= '

' . sprintf($lang['CLICK_RETURN_WORDADMIN'], '', '') . '

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', ''); - message_die(GENERAL_MESSAGE, $message); + bb_die($message); } - else if( $mode == 'delete' ) + else if ($mode == 'delete') { $word_id = intval(request_var('id', 0)); - if( $word_id ) + if ($word_id) { - $sql = "DELETE FROM " . BB_WORDS . " - WHERE word_id = $word_id"; + $sql = "DELETE FROM " . BB_WORDS . " WHERE word_id = $word_id"; - if(!$result = DB()->sql_query($sql)) + if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, "Could not remove data from words table", $lang['ERROR'], __LINE__, __FILE__, $sql); + bb_die('Could not remove data from words table'); } CACHE('bb_cache')->rm('censored'); - - $message = $lang['WORD_REMOVED'] . '

' . sprintf($lang['CLICK_RETURN_WORDADMIN'], '', '') . '

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', ''); - message_die(GENERAL_MESSAGE, $message); + bb_die($lang['WORD_REMOVED'] . '

' . sprintf($lang['CLICK_RETURN_WORDADMIN'], '', '') . '

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', '')); } else { - message_die(GENERAL_MESSAGE, $lang['NO_WORD_SELECTED']); + bb_die($lang['NO_WORD_SELECTED']); } } } else { - $sql = "SELECT * - FROM " . BB_WORDS . " - ORDER BY word"; - if( !$result = DB()->sql_query($sql) ) + $sql = "SELECT * FROM " . BB_WORDS . " ORDER BY word"; + if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, "Could not query words table", $lang['ERROR'], __LINE__, __FILE__, $sql); + bb_die('Could not query words table #2'); } $word_rows = DB()->sql_fetchrowset($result); @@ -145,12 +134,11 @@ else $template->assign_vars(array( 'TPL_ADMIN_WORDS_LIST' => true, - - 'S_WORDS_ACTION' => "admin_words.php", - 'S_HIDDEN_FIELDS' => '', + 'S_WORDS_ACTION' => 'admin_words.php', + 'S_HIDDEN_FIELDS' => '', )); - for($i = 0; $i < $word_count; $i++) + for ($i = 0; $i < $word_count; $i++) { $word = $word_rows[$i]['word']; $replacement = $word_rows[$i]['replacement']; @@ -159,11 +147,10 @@ else $row_class = !($i % 2) ? 'row1' : 'row2'; $template->assign_block_vars('words', array( - 'ROW_CLASS' => $row_class, - 'WORD' => $word, - 'REPLACEMENT' => $replacement, - - 'U_WORD_EDIT' => "admin_words.php?mode=edit&id=$word_id", + 'ROW_CLASS' => $row_class, + 'WORD' => $word, + 'REPLACEMENT' => $replacement, + 'U_WORD_EDIT' => "admin_words.php?mode=edit&id=$word_id", 'U_WORD_DELETE' => "admin_words.php?mode=delete&id=$word_id", )); } diff --git a/upload/admin/index.php b/upload/admin/index.php index 6b8555cf4..7e96e51b9 100644 --- a/upload/admin/index.php +++ b/upload/admin/index.php @@ -173,9 +173,9 @@ elseif (isset($_GET['pane']) && $_GET['pane'] == 'right') AND u.user_id <> " . GUEST_UID . " AND s.session_time >= " . ( TIMENOW - 300 ) . " ORDER BY s.session_ip ASC, s.session_time DESC"; - if(!$result = DB()->sql_query($sql)) + if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, "Couldn't obtain regd user/online information.", '', __LINE__, __FILE__, $sql); + bb_die('Could not obtain reged user / online information'); } $onlinerow_reg = DB()->sql_fetchrowset($result); @@ -184,19 +184,19 @@ elseif (isset($_GET['pane']) && $_GET['pane'] == 'right') WHERE session_logged_in = 0 AND session_time >= " . ( TIMENOW - 300 ) . " ORDER BY session_ip ASC, session_time DESC"; - if(!$result = DB()->sql_query($sql)) + if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, "Couldn't obtain guest user/online information.", '', __LINE__, __FILE__, $sql); + bb_die('Could not obtain guest user / online information'); } $onlinerow_guest = DB()->sql_fetchrowset($result); $reg_userid_ary = array(); - if( count($onlinerow_reg) ) + if (count($onlinerow_reg)) { $registered_users = $hidden_users = 0; - for($i=0, $cnt=count($onlinerow_reg); $i < $cnt; $i++) + for ($i=0, $cnt=count($onlinerow_reg); $i < $cnt; $i++) { if (!in_array($onlinerow_reg[$i]['user_id'], $reg_userid_ary)) { @@ -222,8 +222,8 @@ elseif (isset($_GET['pane']) && $_GET['pane'] == 'right') $template->assign_block_vars('reg_user_row', array( 'ROW_CLASS' => $row_class, 'USER' => profile_url($onlinerow_reg[$i]), - 'STARTED' => bb_date($onlinerow_reg[$i]['session_start'], 'H:i', 'false'), - 'LASTUPDATE' => bb_date($onlinerow_reg[$i]['user_session_time'], 'H:i', 'false'), + 'STARTED' => bb_date($onlinerow_reg[$i]['session_start'], 'H:i', false), + 'LASTUPDATE' => bb_date($onlinerow_reg[$i]['user_session_time'], 'H:i', false), 'IP_ADDRESS' => $reg_ip, 'U_WHOIS_IP' => $bb_cfg['whois_info'] . $reg_ip, )); @@ -247,8 +247,8 @@ elseif (isset($_GET['pane']) && $_GET['pane'] == 'right') $template->assign_block_vars('guest_user_row', array( 'ROW_CLASS' => $row_class, - 'STARTED' => bb_date($onlinerow_guest[$i]['session_start'], 'H:i', 'false'), - 'LASTUPDATE' => bb_date($onlinerow_guest[$i]['session_time'], 'H:i' , 'false'), + 'STARTED' => bb_date($onlinerow_guest[$i]['session_start'], 'H:i', false), + 'LASTUPDATE' => bb_date($onlinerow_guest[$i]['session_time'], 'H:i' , false), 'IP_ADDRESS' => $guest_ip, 'U_WHOIS_IP' => $bb_cfg['whois_info'] . $guest_ip, )); @@ -275,11 +275,11 @@ else print_page('index.tpl', 'admin'); // Functions -function inarray($needle, $haystack) +function inarray ($needle, $haystack) { - for($i = 0; $i < sizeof($haystack); $i++ ) + for ($i = 0; $i < sizeof($haystack); $i++) { - if( $haystack[$i] == $needle ) + if ($haystack[$i] == $needle) { return true; } diff --git a/upload/admin/pagestart.php b/upload/admin/pagestart.php index 8f4f04180..735740990 100644 --- a/upload/admin/pagestart.php +++ b/upload/admin/pagestart.php @@ -18,7 +18,7 @@ if (IS_GUEST) if (!IS_ADMIN) { - message_die(GENERAL_MESSAGE, $lang['NOT_ADMIN']); + bb_die($lang['NOT_ADMIN']); } if (!$userdata['session_admin']) diff --git a/upload/ajax.php b/upload/ajax.php index afc893ef0..27fad90d5 100644 --- a/upload/ajax.php +++ b/upload/ajax.php @@ -12,7 +12,7 @@ $ajax->init(); // Handle "board disabled via ON/OFF trigger" if (file_exists(BB_DISABLED) || $bb_cfg['board_disable']) { - $ajax->ajax_die($bb_cfg['board_disabled_msg']); + $ajax->ajax_die($lang['BOARD_DISABLE']); } // Load actions required modules @@ -22,6 +22,7 @@ switch ($ajax->action) require(INC_DIR . 'bbcode.php'); break; + case 'chat': case 'posts': case 'post_mod_comment': require(INC_DIR . 'bbcode.php'); @@ -71,7 +72,7 @@ class ajax_common var $response = array(); var $valid_actions = array( - // ACTION NAME AJAX_AUTH + // ACTION NAME AJAX_AUTH 'edit_user_profile' => array('admin'), 'change_user_rank' => array('admin'), 'change_user_opt' => array('admin'), @@ -84,6 +85,7 @@ class ajax_common 'post_mod_comment' => array('mod'), 'avatar' => array('user'), + 'chat' => array('user'), 'gen_passkey' => array('user'), 'change_torrent' => array('user'), 'change_tor_status' => array('user'), @@ -399,4 +401,9 @@ class ajax_common { require(AJAX_DIR . 'avatar.php'); } + + function chat() + { + require(AJAX_DIR . 'chat.php'); + } } \ No newline at end of file diff --git a/upload/ajax/.htaccess b/upload/ajax/.htaccess new file mode 100644 index 000000000..baa56e5a3 --- /dev/null +++ b/upload/ajax/.htaccess @@ -0,0 +1,2 @@ +order allow,deny +deny from all \ No newline at end of file diff --git a/upload/ajax/change_tor_status.php b/upload/ajax/change_tor_status.php index e978a8049..eb0acca15 100644 --- a/upload/ajax/change_tor_status.php +++ b/upload/ajax/change_tor_status.php @@ -26,7 +26,7 @@ $tor = DB()->fetch_row(" if (!$tor) $this->ajax_die($lang['TORRENT_FAILED']); -switch($mode) +switch ($mode) { case 'status': $new_status = (int) $this->request['status']; @@ -96,7 +96,7 @@ switch($mode) $subject = sprintf($lang['TOR_AUTH_TITLE'], $tor['topic_title']); $message = sprintf($lang['TOR_AUTH_MSG'], get_username($tor['checked_user_id']), make_url(TOPIC_URL . $tor['topic_id']), $tor['topic_title']); - if($comment && $comment != $lang['COMMENT']) $message .= "\n\n[b]". $lang['COMMENT'] .'[/b]: '. $comment; + if ($comment && $comment != $lang['COMMENT']) $message .= "\n\n[b]". $lang['COMMENT'] .'[/b]: '. $comment; send_pm($tor['checked_user_id'], $subject, $message, $userdata['user_id']); cache_rm_user_sessions($tor['checked_user_id']); diff --git a/upload/ajax/change_torrent.php b/upload/ajax/change_torrent.php index e6abf891b..e9277796d 100644 --- a/upload/ajax/change_torrent.php +++ b/upload/ajax/change_torrent.php @@ -38,19 +38,26 @@ $torrent = DB()->fetch_row(" if (!$torrent) $this->ajax_die($lang['INVALID_ATTACH_ID']); -if($torrent['poster_id'] == $userdata['user_id'] && !IS_AM) +if ($torrent['poster_id'] == $userdata['user_id'] && !IS_AM) { - if($type == 'del_torrent' || $type == 'reg' || $type == 'unreg') - { true; } - else + if ($type == 'del_torrent' || $type == 'reg' || $type == 'unreg') { - $this->ajax_die($lang['ONLY_FOR_MOD']); } } -elseif(!IS_AM) -{ $this->ajax_die($lang['ONLY_FOR_MOD']); } + true; + } + else + { + $this->ajax_die($lang['ONLY_FOR_MOD']); + } +} +elseif (!IS_AM) +{ + $this->ajax_die($lang['ONLY_FOR_MOD']); +} $title = $url = ''; -switch($type) -{ case 'set_gold'; +switch ($type) +{ + case 'set_gold'; case 'set_silver'; case 'unset_silver_gold'; if ($type == 'set_silver') @@ -76,21 +83,22 @@ switch($type) break; case 'unreg'; - tracker_unregister($attach_id); - $url = (TOPIC_URL . $torrent['topic_id']); + tracker_unregister($attach_id); + $url = (TOPIC_URL . $torrent['topic_id']); break; case 'del_torrent'; if (empty($this->request['confirmed'])) $this->prompt_for_confirm($lang['DEL_TORRENT']); - delete_torrent($attach_id); - $url = make_url(TOPIC_URL . $torrent['topic_id']); + delete_torrent($attach_id); + $url = make_url(TOPIC_URL . $torrent['topic_id']); break; case 'del_torrent_move_topic'; if (empty($this->request['confirmed'])) $this->prompt_for_confirm($lang['DEL_MOVE_TORRENT']); - delete_torrent($attach_id); + delete_torrent($attach_id); $url = make_url("modcp.php?t={$torrent['topic_id']}&mode=move&sid={$userdata['session_id']}"); - break; } + break; +} $this->response['url'] = $url; $this->response['title'] = $title; \ No newline at end of file diff --git a/upload/ajax/chat.php b/upload/ajax/chat.php new file mode 100644 index 000000000..17cdec17a --- /dev/null +++ b/upload/ajax/chat.php @@ -0,0 +1,5 @@ +ajax_die($lang['INVALID_DATE'] . $this->request['value']); } - $this->response['new_value'] = bb_date($value, 'Y-m-d H:i', 'false'); + $this->response['new_value'] = bb_date($value, 'Y-m-d H:i', false); break; case 'u_up_total': diff --git a/upload/ajax/posts.php b/upload/ajax/posts.php index 169671b82..86ad38dbe 100644 --- a/upload/ajax/posts.php +++ b/upload/ajax/posts.php @@ -190,7 +190,7 @@ switch($this->request['type'])   -   +  
diff --git a/upload/ajax/view_torrent.php b/upload/ajax/view_torrent.php index 1b1b58954..33609147d 100644 --- a/upload/ajax/view_torrent.php +++ b/upload/ajax/view_torrent.php @@ -16,7 +16,7 @@ $filename = get_attachments_dir() .'/'. $torrent['physical_filename']; if (($file_contents = @file_get_contents($filename)) === false) { - if(IS_AM) + if (IS_AM) { $this->ajax_die($lang['ERROR_NO_ATTACHMENT'] ."\n\n". htmlCHR($filename)); } diff --git a/upload/attach_mod/attachment_mod.php b/upload/attach_mod/attachment_mod.php index 75530b4b7..0e01672a6 100644 --- a/upload/attach_mod/attachment_mod.php +++ b/upload/attach_mod/attachment_mod.php @@ -27,7 +27,7 @@ function attach_mod_get_lang($language_file) if (!file_exists(LANG_ROOT_DIR ."$language/$language_file.php")) { - message_die(GENERAL_MESSAGE, 'Attachment Mod language file does not exist: language/' . $language . '/' . $language_file . '.php'); + bb_die('Attachment mod language file does not exist: language/' . $language . '/' . $language_file . '.php'); } else { @@ -51,9 +51,9 @@ function get_config() $sql = 'SELECT * FROM ' . BB_ATTACH_CONFIG; - if ( !($result = DB()->sql_query($sql)) ) + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not query attachment information', '', __LINE__, __FILE__, $sql); + bb_die('Could not query attachment information'); } while ($row = DB()->sql_fetchrow($result)) @@ -79,11 +79,4 @@ if (!($attach_config = CACHE('bb_cache')->get('attach_config'))) include(BB_ROOT .'attach_mod/displaying.php'); include(BB_ROOT .'attach_mod/posting_attachments.php'); -if (!intval($attach_config['allow_ftp_upload'])) -{ - $upload_dir = $attach_config['upload_dir']; -} -else -{ - $upload_dir = $attach_config['download_path']; -} \ No newline at end of file +$upload_dir = $attach_config['upload_dir']; \ No newline at end of file diff --git a/upload/attach_mod/displaying.php b/upload/attach_mod/displaying.php index 2bafe6486..4c544a2a6 100644 --- a/upload/attach_mod/displaying.php +++ b/upload/attach_mod/displaying.php @@ -157,7 +157,7 @@ function init_display_post_attachments($switch_attachment) { if (defined('TORRENT_POST')) { - message_die(GENERAL_ERROR, 'Multiple registered torrents in one topic

first torrent found in post_id = '. TORRENT_POST .'
current post_id = '. $rows[$i]['post_id'] .'

attachments info:
'. print_r($rows, TRUE) .'
'); + bb_die('Multiple registered torrents in one topic

first torrent found in post_id = '. TORRENT_POST .'
current post_id = '. $rows[$i]['post_id'] .'

attachments info:
'. print_r($rows, TRUE) .'
'); } define('TORRENT_POST', $rows[$i]['post_id']); } @@ -167,11 +167,6 @@ function init_display_post_attachments($switch_attachment) init_display_template('body', '{postrow.ATTACHMENTS}'); init_complete_extensions_data(); - - $template->assign_vars(array( - 'L_POSTED_ATTACHMENTS' => $lang['POSTED_ATTACHMENTS'], - 'L_KILOBYTE' => $lang['KB']) - ); } /** @@ -235,20 +230,10 @@ function display_attachments($post_id) { // define category $image = FALSE; - $stream = FALSE; - $swf = FALSE; $thumbnail = FALSE; $link = FALSE; - if (@intval($display_categories[$attachments['_' . $post_id][$i]['extension']]) == STREAM_CAT) - { - $stream = TRUE; - } - else if (@intval($display_categories[$attachments['_' . $post_id][$i]['extension']]) == SWF_CAT) - { - $swf = TRUE; - } - else if (@intval($display_categories[$attachments['_' . $post_id][$i]['extension']]) == IMAGE_CAT && intval($attach_config['img_display_inlined'])) + if (@intval($display_categories[$attachments['_' . $post_id][$i]['extension']]) == IMAGE_CAT && intval($attach_config['img_display_inlined'])) { if (intval($attach_config['img_link_width']) != 0 || intval($attach_config['img_link_height']) != 0) { @@ -278,7 +263,7 @@ function display_attachments($post_id) $image = FALSE; } - if (!$image && !$stream && !$swf && !$thumbnail) + if (!$image && !$thumbnail) { $link = TRUE; } @@ -290,28 +275,18 @@ function display_attachments($post_id) // Section between BEGIN and END with (Without the // of course): // $img_source = BB_ROOT . 'download.php?id=' . $attachments['_' . $post_id][$i]['attach_id']; // $download_link = TRUE; - // - // - if (intval($attach_config['allow_ftp_upload']) && trim($attach_config['download_path']) == '') + // Check if we can reach the file or if it is stored outside of the webroot + if ($attach_config['upload_dir'][0] == '/' || ( $attach_config['upload_dir'][0] != '/' && $attach_config['upload_dir'][1] == ':')) { $img_source = BB_ROOT . 'download.php?id=' . $attachments['_' . $post_id][$i]['attach_id']; $download_link = TRUE; } else { - // Check if we can reach the file or if it is stored outside of the webroot - if ($attach_config['upload_dir'][0] == '/' || ( $attach_config['upload_dir'][0] != '/' && $attach_config['upload_dir'][1] == ':')) - { - $img_source = BB_ROOT . 'download.php?id=' . $attachments['_' . $post_id][$i]['attach_id']; - $download_link = TRUE; - } - else - { - // BEGIN - $img_source = $filename; - $download_link = FALSE; - // END - } + // BEGIN + $img_source = $filename; + $download_link = FALSE; + // END } $template->assign_block_vars('postrow.attach.cat_images', array( @@ -330,9 +305,9 @@ function display_attachments($post_id) SET download_count = download_count + 1 WHERE attach_id = ' . (int) $attachments['_' . $post_id][$i]['attach_id']; - if ( !(DB()->sql_query($sql)) ) + if (!(DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Couldn\'t update attachment download count.', '', __LINE__, __FILE__, $sql); + bb_die('Could not update attachment download count'); } } } @@ -343,24 +318,16 @@ function display_attachments($post_id) // NOTE: If you want to use the download.php everytime an thumnmail is displayed inlined, replace the // Section between BEGIN and END with (Without the // of course): // $thumb_source = BB_ROOT . 'download.php?id=' . $attachments['_' . $post_id][$i]['attach_id'] . '&thumb=1'; - // - if (intval($attach_config['allow_ftp_upload']) && trim($attach_config['download_path']) == '') + // Check if we can reach the file or if it is stored outside of the webroot + if ($attach_config['upload_dir'][0] == '/' || ( $attach_config['upload_dir'][0] != '/' && $attach_config['upload_dir'][1] == ':')) { $thumb_source = BB_ROOT . 'download.php?id=' . $attachments['_' . $post_id][$i]['attach_id'] . '&thumb=1'; } else { - // Check if we can reach the file or if it is stored outside of the webroot - if ($attach_config['upload_dir'][0] == '/' || ( $attach_config['upload_dir'][0] != '/' && $attach_config['upload_dir'][1] == ':')) - { - $thumb_source = BB_ROOT . 'download.php?id=' . $attachments['_' . $post_id][$i]['attach_id'] . '&thumb=1'; - } - else - { - // BEGIN - $thumb_source = $thumbnail_filename; - // END - } + // BEGIN + $thumb_source = $thumbnail_filename; + // END } $template->assign_block_vars('postrow.attach.cat_thumb_images', array( @@ -374,65 +341,12 @@ function display_attachments($post_id) )); } - if ($stream) - { - // Streams - $template->assign_block_vars('postrow.attach.cat_stream', array( - 'U_DOWNLOAD_LINK' => $filename, - 'S_UPLOAD_IMAGE' => $upload_image, - - 'DOWNLOAD_NAME' => $display_name, - 'FILESIZE' => $filesize, - 'COMMENT' => $comment, - 'DOWNLOAD_COUNT' => sprintf($lang['DOWNLOAD_NUMBER'], $attachments['_' . $post_id][$i]['download_count'])) - ); - - // Viewed/Heared File ... update the download count (download.php is not called here) - $sql = 'UPDATE ' . BB_ATTACHMENTS_DESC . ' - SET download_count = download_count + 1 - WHERE attach_id = ' . (int) $attachments['_' . $post_id][$i]['attach_id']; - - if ( !(DB()->sql_query($sql)) ) - { - message_die(GENERAL_ERROR, 'Couldn\'t update attachment download count', '', __LINE__, __FILE__, $sql); - } - } - - if ($swf) - { - // Macromedia Flash Files - list($width, $height) = swf_getdimension($filename); - - $template->assign_block_vars('postrow.attach.cat_swf', array( - 'U_DOWNLOAD_LINK' => $filename, - 'S_UPLOAD_IMAGE' => $upload_image, - - 'DOWNLOAD_NAME' => $display_name, - 'FILESIZE' => $filesize, - 'COMMENT' => $comment, - 'DOWNLOAD_COUNT' => sprintf($lang['DOWNLOAD_NUMBER'], $attachments['_' . $post_id][$i]['download_count']), - 'WIDTH' => $width, - 'HEIGHT' => $height) - ); - - // Viewed/Heared File ... update the download count (download.php is not called here) - $sql = 'UPDATE ' . BB_ATTACHMENTS_DESC . ' - SET download_count = download_count + 1 - WHERE attach_id = ' . (int) $attachments['_' . $post_id][$i]['attach_id']; - - if ( !(DB()->sql_query($sql)) ) - { - message_die(GENERAL_ERROR, 'Couldn\'t update attachment download count', '', __LINE__, __FILE__, $sql); - } - } - - //bt + // bt if ($link && ($attachments['_'. $post_id][$i]['extension'] === TORRENT_EXT)) { include(BB_ROOT .'attach_mod/displaying_torrent.php'); } else if ($link) - //bt end { $target_blank = ( (@intval($display_categories[$attachments['_' . $post_id][$i]['extension']]) == IMAGE_CAT) ) ? 'target="_blank"' : ''; diff --git a/upload/attach_mod/displaying_torrent.php b/upload/attach_mod/displaying_torrent.php index ff8a8b627..0c8d478ce 100644 --- a/upload/attach_mod/displaying_torrent.php +++ b/upload/attach_mod/displaying_torrent.php @@ -120,7 +120,7 @@ else if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not obtain torrent information', '', __LINE__, __FILE__, $sql); + bb_die('Could not obtain torrent information'); } $tor_info = DB()->sql_fetchrow($result); DB()->sql_freeresult($result); diff --git a/upload/attach_mod/includes/functions_admin.php b/upload/attach_mod/includes/functions_admin.php index 3922ccc67..2f0b0a4c3 100644 --- a/upload/attach_mod/includes/functions_admin.php +++ b/upload/attach_mod/includes/functions_admin.php @@ -31,7 +31,7 @@ function process_quota_settings($mode, $id, $quota_type, $quota_limit_id = 0) if( !($result = DB()->sql_query($sql)) ) { - message_die(GENERAL_ERROR, 'Could not get Entry', '', __LINE__, __FILE__, $sql); + bb_die('Could not get entry #1'); } if (DB()->num_rows($result) == 0) @@ -57,7 +57,7 @@ function process_quota_settings($mode, $id, $quota_type, $quota_limit_id = 0) if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Unable to update quota Settings', '', __LINE__, __FILE__, $sql); + bb_die('Unable to update quota settings'); } } @@ -69,9 +69,9 @@ function process_quota_settings($mode, $id, $quota_type, $quota_limit_id = 0) WHERE group_id = $id AND quota_type = $quota_type"; - if( !($result = DB()->sql_query($sql)) ) + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Unable to delete quota Settings', '', __LINE__, __FILE__, $sql); + bb_die('Unable to delete quota settings'); } } else @@ -82,9 +82,9 @@ function process_quota_settings($mode, $id, $quota_type, $quota_limit_id = 0) WHERE group_id = $id AND quota_type = $quota_type"; - if( !($result = DB()->sql_query($sql)) ) + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not get Entry', '', __LINE__, __FILE__, $sql); + bb_die('Could not get entry #2'); } if (DB()->num_rows($result) == 0) @@ -100,7 +100,7 @@ function process_quota_settings($mode, $id, $quota_type, $quota_limit_id = 0) if (!DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Unable to update quota Settings', '', __LINE__, __FILE__, $sql); + bb_die('Unable to update quota settings'); } } } @@ -168,60 +168,21 @@ function get_formatted_dirsize() $upload_dir_size = 0; - if (!intval($attach_config['allow_ftp_upload'])) + if ($dirname = @opendir($upload_dir)) { - if ($dirname = @opendir($upload_dir)) + while ($file = @readdir($dirname)) { - while ($file = @readdir($dirname)) + if ($file != 'index.php' && $file != '.htaccess' && !is_dir($upload_dir . '/' . $file) && !is_link($upload_dir . '/' . $file)) { - if ($file != 'index.php' && $file != '.htaccess' && !is_dir($upload_dir . '/' . $file) && !is_link($upload_dir . '/' . $file)) - { - $upload_dir_size += @filesize($upload_dir . '/' . $file); - } + $upload_dir_size += @filesize($upload_dir . '/' . $file); } - @closedir($dirname); - } - else - { - $upload_dir_size = $lang['NOT_AVAILABLE']; - return $upload_dir_size; } + @closedir($dirname); } else { - $conn_id = attach_init_ftp(); - - $file_listing = array(); - - $file_listing = @ftp_rawlist($conn_id, ''); - - if (!$file_listing) - { - $upload_dir_size = $lang['NOT_AVAILABLE']; - return $upload_dir_size; - } - - for ($i = 0; $i < count($file_listing); $i++) - { - if (preg_match("/([-d])[rwxst-]{9}.* ([0-9]*) ([a-zA-Z]+[0-9: ]*[0-9]) ([0-9]{2}:[0-9]{2}) (.+)/", $file_listing[$i], $regs)) - { - if ($regs[1] == 'd') - { - $dirinfo[0] = 1; // Directory == 1 - } - $dirinfo[1] = $regs[2]; // Size - $dirinfo[2] = $regs[3]; // Date - $dirinfo[3] = $regs[4]; // Filename - $dirinfo[4] = $regs[5]; // Time - } - - if ($dirinfo[0] != 1 && $dirinfo[4] != 'index.php' && $dirinfo[4] != '.htaccess') - { - $upload_dir_size += $dirinfo[1]; - } - } - - @ftp_quit($conn_id); + $upload_dir_size = $lang['NOT_AVAILABLE']; + return $upload_dir_size; } return humn_size($upload_dir_size); @@ -255,13 +216,11 @@ function search_attachments($order_by, &$total_rows) $search_author = str_replace('*', '%', attach_mod_sql_escape($search_author)); // We need the post_id's, because we want to query the Attachment Table - $sql = 'SELECT user_id - FROM ' . BB_USERS . " - WHERE username LIKE '$search_author'"; + $sql = 'SELECT user_id FROM ' . BB_USERS . " WHERE username LIKE '$search_author'"; if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Couldn\'t obtain list of matching users (searching for: ' . $search_author . ')', '', __LINE__, __FILE__, $sql); + bb_die('Could not obtain list of matching users (searching for: ' . $search_author . ')'); } $matching_userids = ''; @@ -277,7 +236,7 @@ function search_attachments($order_by, &$total_rows) } else { - message_die(GENERAL_MESSAGE, $lang['NO_ATTACH_SEARCH_MATCH']); + bb_die($lang['NO_ATTACH_SEARCH_MATCH']); } $where_sql[] = ' (t.user_id_1 IN (' . $matching_userids . ')) '; @@ -352,7 +311,7 @@ function search_attachments($order_by, &$total_rows) if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Couldn\'t query attachments', '', __LINE__, __FILE__, $sql); + bb_die('Could not query attachments #1'); } $attachments = DB()->sql_fetchrowset($result); @@ -361,12 +320,12 @@ function search_attachments($order_by, &$total_rows) if ($num_attach == 0) { - message_die(GENERAL_MESSAGE, $lang['NO_ATTACH_SEARCH_MATCH']); + bb_die($lang['NO_ATTACH_SEARCH_MATCH']); } if (!($result = DB()->sql_query($total_rows_sql))) { - message_die(GENERAL_ERROR, 'Could not query attachments', '', __LINE__, __FILE__, $sql); + bb_die('Could not query attachments #2'); } $total_rows = DB()->num_rows($result); diff --git a/upload/attach_mod/includes/functions_attach.php b/upload/attach_mod/includes/functions_attach.php index f677278be..cab4f37ca 100644 --- a/upload/attach_mod/includes/functions_attach.php +++ b/upload/attach_mod/includes/functions_attach.php @@ -179,46 +179,6 @@ function is_forum_authed($auth_cache, $check_forum_id) return false; } -/** -* Init FTP Session -*/ -function attach_init_ftp($mode = false) -{ - global $lang, $attach_config; - - $server = (trim($attach_config['ftp_server']) == '') ? 'localhost' : trim($attach_config['ftp_server']); - - $ftp_path = ($mode == MODE_THUMBNAIL) ? trim($attach_config['ftp_path']) . '/' . THUMB_DIR : trim($attach_config['ftp_path']); - - $conn_id = @ftp_connect($server); - - if (!$conn_id) - { - message_die(GENERAL_ERROR, sprintf($lang['FTP_ERROR_CONNECT'], $server)); - } - - $login_result = @ftp_login($conn_id, $attach_config['ftp_user'], $attach_config['ftp_pass']); - - if (!$login_result) - { - message_die(GENERAL_ERROR, sprintf($lang['FTP_ERROR_LOGIN'], $attach_config['ftp_user'])); - } - - if (!@ftp_pasv($conn_id, intval($attach_config['ftp_pasv_mode']))) - { - message_die(GENERAL_ERROR, $lang['FTP_ERROR_PASV_MODE']); - } - - $result = @ftp_chdir($conn_id, $ftp_path); - - if (!$result) - { - message_die(GENERAL_ERROR, sprintf($lang['FTP_ERROR_PATH'], $ftp_path)); - } - - return $conn_id; -} - /** * Deletes an Attachment */ @@ -228,83 +188,20 @@ function unlink_attach($filename, $mode = false) $filename = basename($filename); - if (!intval($attach_config['allow_ftp_upload'])) + if ($mode == MODE_THUMBNAIL) { - if ($mode == MODE_THUMBNAIL) - { - $filename = $upload_dir . '/' . THUMB_DIR . '/t_' . $filename; - } - else - { - $filename = $upload_dir . '/' . $filename; - } - - $deleted = @unlink($filename); - + $filename = $upload_dir . '/' . THUMB_DIR . '/t_' . $filename; } else { - $conn_id = attach_init_ftp($mode); - - if ($mode == MODE_THUMBNAIL) - { - $filename = 't_' . $filename; - } - - $res = @ftp_delete($conn_id, $filename); - if (!$res) - { - return $deleted; - } - - @ftp_quit($conn_id); - - $deleted = true; + $filename = $upload_dir . '/' . $filename; } + $deleted = @unlink($filename); + return $deleted; } -/** -* FTP File to Location -*/ -function ftp_file($source_file, $dest_file, $mimetype, $disable_error_mode = false) -{ - global $attach_config, $lang, $error, $error_msg; - - $conn_id = attach_init_ftp(); - - // Binary or Ascii ? - $mode = FTP_BINARY; - if (preg_match("/text/i", $mimetype) || preg_match("/html/i", $mimetype)) - { - $mode = FTP_ASCII; - } - - $res = @ftp_put($conn_id, $dest_file, $source_file, $mode); - - if (!$res && !$disable_error_mode) - { - $error = true; - if (!empty($error_msg)) - { - $error_msg .= '
'; - } - $error_msg = sprintf($lang['FTP_ERROR_UPLOAD'], $attach_config['ftp_path']) . '
'; - @ftp_quit($conn_id); - return false; - } - - if (!$res) - { - return false; - } - - @ftp_site($conn_id, 'CHMOD 0644 ' . $dest_file); - @ftp_quit($conn_id); - return true; -} - /** * Check if Attachment exist */ @@ -314,50 +211,13 @@ function attachment_exists($filename) $filename = basename($filename); - if (!intval($attach_config['allow_ftp_upload'])) + if (!@file_exists(@amod_realpath($upload_dir . '/' . $filename))) { - if (!@file_exists(@amod_realpath($upload_dir . '/' . $filename))) - { - return false; - } - else - { - return true; - } + return false; } else { - $found = false; - - $conn_id = attach_init_ftp(); - - $file_listing = array(); - - $file_listing = @ftp_rawlist($conn_id, $filename); - - for ($i = 0, $size = sizeof($file_listing); $i < $size; $i++) - { - if (preg_match("/([-d])[rwxst-]{9}.* ([0-9]*) ([a-zA-Z]+[0-9: ]*[0-9]) ([0-9]{2}:[0-9]{2}) (.+)/", $file_listing[$i], $regs)) - { - if ($regs[1] == 'd') - { - $dirinfo[0] = 1; // Directory == 1 - } - $dirinfo[1] = $regs[2]; // Size - $dirinfo[2] = $regs[3]; // Date - $dirinfo[3] = $regs[4]; // Filename - $dirinfo[4] = $regs[5]; // Time - } - - if ($dirinfo[0] != 1 && $dirinfo[4] == $filename) - { - $found = true; - } - } - - @ftp_quit($conn_id); - - return $found; + return true; } } @@ -370,51 +230,13 @@ function thumbnail_exists($filename) $filename = basename($filename); - if (!intval($attach_config['allow_ftp_upload'])) + if (!@file_exists(@amod_realpath($upload_dir . '/' . THUMB_DIR . '/t_' . $filename))) { - if (!@file_exists(@amod_realpath($upload_dir . '/' . THUMB_DIR . '/t_' . $filename))) - { - return false; - } - else - { - return true; - } + return false; } else { - $found = false; - - $conn_id = attach_init_ftp(MODE_THUMBNAIL); - - $file_listing = array(); - - $filename = 't_' . $filename; - $file_listing = @ftp_rawlist($conn_id, $filename); - - for ($i = 0, $size = sizeof($file_listing); $i < $size; $i++) - { - if (preg_match("/([-d])[rwxst-]{9}.* ([0-9]*) ([a-zA-Z]+[0-9: ]*[0-9]) ([0-9]{2}:[0-9]{2}) (.+)/", $file_listing[$i], $regs)) - { - if ($regs[1] == 'd') - { - $dirinfo[0] = 1; // Directory == 1 - } - $dirinfo[1] = $regs[2]; // Size - $dirinfo[2] = $regs[3]; // Date - $dirinfo[3] = $regs[4]; // Filename - $dirinfo[4] = $regs[5]; // Time - } - - if ($dirinfo[0] != 1 && $dirinfo[4] == $filename) - { - $found = true; - } - } - - @ftp_quit($conn_id); - - return $found; + return true; } } @@ -437,7 +259,7 @@ function physical_filename_already_stored($filename) if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not get attachment information for filename: ' . htmlspecialchars($filename), '', __LINE__, __FILE__, $sql); + bb_die('Could not get attachment information for filename: ' . htmlspecialchars($filename)); } $num_rows = DB()->num_rows($result); DB()->sql_freeresult($result); @@ -482,9 +304,9 @@ function get_attachments_from_post($post_id_array) AND a.attach_id = d.attach_id ORDER BY d.filetime $display_order"; - if ( !($result = DB()->sql_query($sql)) ) + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not get Attachment Informations for post number ' . $post_id_array, '', __LINE__, __FILE__, $sql); + bb_die('Could not get attachment informations for post number ' . $post_id_array); } $num_rows = DB()->num_rows($result); @@ -516,13 +338,11 @@ function get_total_attach_filesize($attach_ids) return 0; } - $sql = 'SELECT filesize - FROM ' . BB_ATTACHMENTS_DESC . " - WHERE attach_id IN ($attach_ids)"; + $sql = 'SELECT filesize FROM ' . BB_ATTACHMENTS_DESC . " WHERE attach_id IN ($attach_ids)"; - if ( !($result = DB()->sql_query($sql)) ) + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not query Total Filesize', '', __LINE__, __FILE__, $sql); + bb_die('Could not query total filesize'); } $total_filesize = 0; @@ -659,7 +479,7 @@ function user_in_group($user_id, $group_id) if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not get User Group', '', __LINE__, __FILE__, $sql); + bb_die('Could not get user group'); } $num_rows = DB()->num_rows($result); diff --git a/upload/attach_mod/includes/functions_delete.php b/upload/attach_mod/includes/functions_delete.php index dd8f9468e..8cf7f7598 100644 --- a/upload/attach_mod/includes/functions_delete.php +++ b/upload/attach_mod/includes/functions_delete.php @@ -47,9 +47,9 @@ function delete_attachment($post_id_array = 0, $attach_id_array = 0, $page = 0, WHERE attach_id IN (' . implode(', ', $attach_id_array) . ") GROUP BY $p_id"; - if ( !($result = DB()->sql_query($sql)) ) + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not select ids', '', __LINE__, __FILE__, $sql); + bb_die('Could not select ids'); } $num_post_list = DB()->num_rows($result); @@ -108,9 +108,9 @@ function delete_attachment($post_id_array = 0, $attach_id_array = 0, $page = 0, FROM ' . BB_ATTACHMENTS . " $whereclause GROUP BY attach_id"; - if ( !($result = DB()->sql_query($sql)) ) + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not select Attachment Ids', '', __LINE__, __FILE__, $sql); + bb_die('Could not select attachment id #1'); } $num_attach_list = DB()->num_rows($result); @@ -160,21 +160,19 @@ function delete_attachment($post_id_array = 0, $attach_id_array = 0, $page = 0, WHERE attach_id IN (' . implode(', ', $attach_id_array) . ") AND $sql_id IN (" . implode(', ', $post_id_array) . ')'; - if ( !(DB()->sql_query($sql)) ) + if (!(DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, $lang['ERROR_DELETED_ATTACHMENTS'], '', __LINE__, __FILE__, $sql); + bb_die($lang['ERROR_DELETED_ATTACHMENTS']); } //bt if ($sql_id == 'post_id') { - $sql = "SELECT topic_id - FROM ". BB_BT_TORRENTS ." - WHERE attach_id IN(". implode(',', $attach_id_array) .")"; + $sql = "SELECT topic_id FROM ". BB_BT_TORRENTS ." WHERE attach_id IN(". implode(',', $attach_id_array) .")"; if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, $lang['ERROR_DELETED_ATTACHMENTS'], '', __LINE__, __FILE__, $sql); + bb_die($lang['ERROR_DELETED_ATTACHMENTS']); } $torrents_sql = array(); @@ -192,7 +190,7 @@ function delete_attachment($post_id_array = 0, $attach_id_array = 0, $page = 0, if (!DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not delete peers', '', __LINE__, __FILE__, $sql); + bb_die('Could not delete peers'); } } // Delete torrents @@ -201,7 +199,7 @@ function delete_attachment($post_id_array = 0, $attach_id_array = 0, $page = 0, if (!DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, $lang['ERROR_DELETED_ATTACHMENTS'], '', __LINE__, __FILE__, $sql); + bb_die($lang['ERROR_DELETED_ATTACHMENTS']); } } //bt end @@ -212,9 +210,9 @@ function delete_attachment($post_id_array = 0, $attach_id_array = 0, $page = 0, FROM ' . BB_ATTACHMENTS . ' WHERE attach_id = ' . (int) $attach_id_array[$i]; - if ( !($result = DB()->sql_query($sql)) ) + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not select Attachment Ids', '', __LINE__, __FILE__, $sql); + bb_die('Could not select Attachment id #2'); } $num_rows = DB()->num_rows($result); @@ -226,9 +224,9 @@ function delete_attachment($post_id_array = 0, $attach_id_array = 0, $page = 0, FROM ' . BB_ATTACHMENTS_DESC . ' WHERE attach_id = ' . (int) $attach_id_array[$i]; - if ( !($result = DB()->sql_query($sql)) ) + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Couldn\'t query attach description table', '', __LINE__, __FILE__, $sql); + bb_die('Could not query attach description table'); } $num_rows = DB()->num_rows($result); @@ -248,12 +246,11 @@ function delete_attachment($post_id_array = 0, $attach_id_array = 0, $page = 0, unlink_attach($attachments[$j]['physical_filename'], MODE_THUMBNAIL); } - $sql = 'DELETE FROM ' . BB_ATTACHMENTS_DESC . ' - WHERE attach_id = ' . (int) $attachments[$j]['attach_id']; + $sql = 'DELETE FROM ' . BB_ATTACHMENTS_DESC . ' WHERE attach_id = ' . (int) $attachments[$j]['attach_id']; - if ( !(DB()->sql_query($sql)) ) + if (!(DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, $lang['ERROR_DELETED_ATTACHMENTS'], '', __LINE__, __FILE__, $sql); + bb_die($lang['ERROR_DELETED_ATTACHMENTS']); } } } @@ -273,9 +270,9 @@ function delete_attachment($post_id_array = 0, $attach_id_array = 0, $page = 0, WHERE post_id IN (' . implode(', ', $post_id_array) . ') GROUP BY topic_id'; - if ( !($result = DB()->sql_query($sql)) ) + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Couldn\'t select Topic ID', '', __LINE__, __FILE__, $sql); + bb_die('Could not select topic id'); } while ($row = DB()->sql_fetchrow($result)) diff --git a/upload/attach_mod/includes/functions_filetypes.php b/upload/attach_mod/includes/functions_filetypes.php index c81a9208c..928f05b4c 100644 --- a/upload/attach_mod/includes/functions_filetypes.php +++ b/upload/attach_mod/includes/functions_filetypes.php @@ -289,114 +289,5 @@ function image_getdimension($file) fclose($fp); - return $size; -} - -/** -* Flash MX Support -* Routines and Methods are from PhpAdsNew (www.sourceforge.net/projects/phpadsnew) -*/ - -/** -*/ -define('swf_tag_compressed', chr(0x43).chr(0x57).chr(0x53)); -define('swf_tag_identify', chr(0x46).chr(0x57).chr(0x53)); - -/** -* Get flash bits -*/ -function swf_bits($buffer, $pos, $count) -{ - $result = 0; - - for ($loop = $pos; $loop < $pos + $count; $loop++) - { - $result = $result + ((((ord($buffer[(int)($loop / 8)])) >> (7 - ($loop % 8))) & 0x01) << ($count - ($loop - $pos) - 1)); - } - - return $result; -} - -/** -* decompress flash contents -*/ -function swf_decompress($buffer) -{ - if ((function_exists('gzuncompress')) && (substr($buffer, 0, 3) == swf_tag_compressed) && (ord(substr($buffer, 3, 1)) >= 6) ) - { - // Only decompress relevant Informations - $output = 'F'; - $output .= substr ($buffer, 1, 7); - $output .= gzuncompress (substr ($buffer, 8)); - - return $output; - } - else - { - return $buffer; - } -} - -/** -* Get flash dimension -*/ -function swf_getdimension($file) -{ - $size = @getimagesize($file); - - if ($size[0] != 0 || $size[1] != 0) - { - return $size; - } - - // Try to get the Dimension manually - $fp = @fopen($file, 'rb'); - if (!$fp) - { - return $size; - } - - $error = false; - - // SWF - FLASH FILE - $fp = @fopen($file, 'rb'); - - // Decompress if file is a Flash MX compressed file - $buffer = fread($fp, 1024); - - if (substr($buffer, 0, 3) == swf_tag_identify || substr($buffer, 0, 3) == swf_tag_compressed) - { - if (substr($buffer, 0, 3) == swf_tag_compressed) - { - fclose($fp); - $fp = @fopen($file, 'rb'); - $buffer = fread($fp, filesize($file)); - $buffer = swf_decompress($buffer); - } - - // Get size of rect structure - $bits = swf_bits ($buffer, 64, 5); - - // Get rect - $width = (int)(swf_bits ($buffer, 69 + $bits, $bits) - swf_bits ($buffer, 69, $bits)) / 20; - $height = (int)(swf_bits ($buffer, 69 + (3 * $bits), $bits) - swf_bits ($buffer, 69 + (2 * $bits), $bits)) / 20; - } - else - { - $error = true; - } - - if (!$error) - { - fclose($fp); - return array( - $width, - $height, - 2 - ); - } - - fclose($fp); - return $size; } \ No newline at end of file diff --git a/upload/attach_mod/includes/functions_includes.php b/upload/attach_mod/includes/functions_includes.php index d722b3a39..e15a1cfb1 100644 --- a/upload/attach_mod/includes/functions_includes.php +++ b/upload/attach_mod/includes/functions_includes.php @@ -40,20 +40,13 @@ function attachment_quota_settings($admin_mode, $submit = false, $mode) { global $template, $lang, $attach_config; - if (!intval($attach_config['allow_ftp_upload'])) + if ($attach_config['upload_dir'][0] == '/' || ($attach_config['upload_dir'][0] != '/' && $attach_config['upload_dir'][1] == ':')) { - if ($attach_config['upload_dir'][0] == '/' || ($attach_config['upload_dir'][0] != '/' && $attach_config['upload_dir'][1] == ':')) - { - $upload_dir = $attach_config['upload_dir']; - } - else - { - $upload_dir = BB_ROOT . $attach_config['upload_dir']; - } + $upload_dir = $attach_config['upload_dir']; } else { - $upload_dir = $attach_config['download_path']; + $upload_dir = BB_ROOT . $attach_config['upload_dir']; } include(BB_ROOT .'attach_mod/includes/functions_selects.php'); @@ -74,7 +67,7 @@ function attachment_quota_settings($admin_mode, $submit = false, $mode) if (!$user_id && !$u_name) { - message_die(GENERAL_MESSAGE, $lang['NO_USER_ID_SPECIFIED'] ); + bb_die($lang['NO_USER_ID_SPECIFIED'] ); } if ($user_id) @@ -95,7 +88,7 @@ function attachment_quota_settings($admin_mode, $submit = false, $mode) if (!$user_id) { - message_die(GENERAL_MESSAGE, $lang['NO_USER_ID_SPECIFIED'] ); + bb_die($lang['NO_USER_ID_SPECIFIED'] ); } } } @@ -103,12 +96,11 @@ function attachment_quota_settings($admin_mode, $submit = false, $mode) if ($admin_mode == 'user' && !$submit && $mode != 'save') { // Show the contents - $sql = 'SELECT quota_limit_id, quota_type FROM ' . BB_QUOTA . ' - WHERE user_id = ' . (int) $user_id; + $sql = 'SELECT quota_limit_id, quota_type FROM ' . BB_QUOTA . ' WHERE user_id = ' . (int) $user_id; - if( !($result = DB()->sql_query($sql)) ) + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Unable to get Quota Settings', '', __LINE__, __FILE__, $sql); + bb_die('Unable to get quota settings #1'); } $pm_quota = $upload_quota = 0; @@ -169,12 +161,11 @@ function attachment_quota_settings($admin_mode, $submit = false, $mode) $group_id = get_var(POST_GROUPS_URL, 0); // Show the contents - $sql = 'SELECT quota_limit_id, quota_type FROM ' . BB_QUOTA . ' - WHERE group_id = ' . (int) $group_id; + $sql = 'SELECT quota_limit_id, quota_type FROM ' . BB_QUOTA . ' WHERE group_id = ' . (int) $group_id; - if( !($result = DB()->sql_query($sql)) ) + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Unable to get Quota Settings', '', __LINE__, __FILE__, $sql); + bb_die('Unable to get quota settings #2'); } $pm_quota = $upload_quota = 0; diff --git a/upload/attach_mod/includes/functions_selects.php b/upload/attach_mod/includes/functions_selects.php index 9f4b8962d..be709e94c 100644 --- a/upload/attach_mod/includes/functions_selects.php +++ b/upload/attach_mod/includes/functions_selects.php @@ -11,13 +11,11 @@ function group_select($select_name, $default_group = 0) { global $lang; - $sql = 'SELECT group_id, group_name - FROM ' . BB_EXTENSION_GROUPS . ' - ORDER BY group_name'; + $sql = 'SELECT group_id, group_name FROM ' . BB_EXTENSION_GROUPS . ' ORDER BY group_name'; if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, "Couldn't query Extension Groups Table", "", __LINE__, __FILE__, $sql); + bb_die('Could not query extension groups table #1'); } $group_select = ''; @@ -228,13 +223,11 @@ function default_quota_limit_select($select_name, $default_quota = 0) { global $lang; - $sql = 'SELECT quota_limit_id, quota_desc - FROM ' . BB_QUOTA_LIMITS . ' - ORDER BY quota_limit ASC'; + $sql = 'SELECT quota_limit_id, quota_desc FROM ' . BB_QUOTA_LIMITS . ' ORDER BY quota_limit ASC'; - if ( !($result = DB()->sql_query($sql)) ) + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, "Couldn't query Quota Limits Table", "", __LINE__, __FILE__, $sql); + bb_die('Could not query quota limits table #2'); } $quota_select = ' - - - - '; -} -if (DEBUG) { - echo ' -
- Debug - -
- '; -} echo '
'; - + if ($sql_log) { -echo '
-'. ($sql_log ? $sql_log : '') .' -'. (UA_IE ? '
' : '') .' -
- -
-'; + echo '
'. ($sql_log ? $sql_log : '') .'

'; } - -if (PROFILER && !empty($_COOKIE['prof_enabled'])) -{ - require(DEV_DIR .'profiler/profiler.php'); - $profiler = profiler::init(PROFILER); - - $min_time = !empty($_COOKIE['prof_min_time']) ? $_COOKIE['prof_min_time'] : '0.1%'; - $profiler->print_profile_data($min_time); -} - ?> \ No newline at end of file diff --git a/upload/includes/page_header.php b/upload/includes/page_header.php index 999c5b409..080ffda67 100644 --- a/upload/includes/page_header.php +++ b/upload/includes/page_header.php @@ -190,8 +190,7 @@ $template->assign_vars(array( 'FORUM_PATH' => FORUM_PATH, 'FULL_URL' => FULL_URL, - 'LAST_VISIT_DATE' => ($logged_in) ? sprintf($lang['YOU_LAST_VISIT'], bb_date($userdata['user_lastvisit'], $bb_cfg['last_visit_date_format'])) : '', - 'CURRENT_TIME' => sprintf($lang['CURRENT_TIME'], bb_date(TIMENOW, $bb_cfg['last_visit_date_format'])), + 'CURRENT_TIME' => sprintf($lang['CURRENT_TIME'], bb_date(TIMENOW, $bb_cfg['last_visit_date_format'], false)), 'S_TIMEZONE' => sprintf($lang['ALL_TIMES'], $lang[''.str_replace(',', '.', floatval($bb_cfg['board_timezone'])).'']), 'PM_INFO' => $pm_info, @@ -256,7 +255,6 @@ $template->assign_vars(array( 'ONLY_NEW_TOPICS' => ONLY_NEW_TOPICS, // Misc - 'DEBUG' => DEBUG, 'BOT_UID' => BOT_UID, 'COOKIE_MARK' => COOKIE_MARK, 'SID' => $userdata['session_id'], @@ -301,15 +299,6 @@ if (!empty($page_cfg['show_torhelp'][BB_SCRIPT]) && !empty($userdata['torhelp']) } } -if (DBG_USER) -{ - $template->assign_vars(array( - 'INCLUDE_DEVELOP_JS' => true, - 'EDITOR_PATH' => @addslashes($bb_cfg['dbg']['editor_path']), - 'EDITOR_ARGS' => @addslashes($bb_cfg['dbg']['editor_args']), - )); -} - // Ads if ($user->show_ads) { @@ -328,18 +317,12 @@ if ($user->show_ads) $in_out = ($logged_in) ? 'in' : 'out'; $template->assign_block_vars("switch_user_logged_{$in_out}", array()); -// Work around for "current" Apache 2 + PHP module which seems to not -// cope with private cache control setting -if (!empty($_SERVER['SERVER_SOFTWARE']) && strstr($_SERVER['SERVER_SOFTWARE'], 'Apache/2')) -{ - header('Cache-Control: no-cache, pre-check=0, post-check=0'); -} -else +if (!IS_GUEST) { header('Cache-Control: private, pre-check=0, post-check=0, max-age=0'); + header('Expires: 0'); + header('Pragma: no-cache'); } -header('Expires: 0'); -header('Pragma: no-cache'); $template->set_filenames(array('page_header' => 'page_header.tpl')); $template->pparse('page_header'); diff --git a/upload/includes/report_hack/report_post.php b/upload/includes/report_hack/report_post.php index 0d3cee6a7..4a4fed1b6 100644 --- a/upload/includes/report_hack/report_post.php +++ b/upload/includes/report_hack/report_post.php @@ -24,7 +24,7 @@ class report_post extends report_module $sql = 'UPDATE ' . BB_POSTS . ' SET post_reported = 0'; if (!DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not reset post reported flag', '', __LINE__, __FILE__, $sql); + bb_die('Could not reset post reported flag'); } if (!$uninstall) { @@ -34,7 +34,7 @@ class report_post extends report_module AND report_status NOT IN(' . REPORT_CLEARED . ', ' . REPORT_DELETE . ') GROUP BY report_subject'; if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not obtain open reports', '', __LINE__, __FILE__, $sql); + bb_die('Could not obtain open reports'); } $open_ids = array(); @@ -48,7 +48,7 @@ class report_post extends report_module SET post_reported = 1 WHERE post_id IN(' . implode(', ', $open_ids) . ')'; if (!DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not sync post reported flag', '', __LINE__, __FILE__, $sql); + bb_die('Could not sync post reported flag'); } } } @@ -63,7 +63,7 @@ class report_post extends report_module SET post_reported = 1 WHERE post_id = ' . (int)$report_subject; if (!DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not update post reported flag', '', __LINE__, __FILE__, $sql); + bb_die('Could not update post reported flag #1'); } } @@ -85,7 +85,7 @@ class report_post extends report_module SET post_reported = 1 WHERE post_id IN(' . implode(', ', $report_subjects) . ')'; if (!DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not update post reported flag', '', __LINE__, __FILE__, $sql); + bb_die('Could not update post reported flag #2'); } break; } @@ -106,7 +106,7 @@ class report_post extends report_module AND report_status NOT IN(' . REPORT_CLEARED . ', ' . REPORT_DELETE . ') GROUP BY report_subject'; if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not get open reports', '', __LINE__, __FILE__, $sql); + bb_die('Could not get open reports'); } $open_ids = array(); @@ -120,7 +120,7 @@ class report_post extends report_module SET post_reported = 1 WHERE post_id IN(' . implode(', ', $open_ids) . ')'; if (!DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not update post reported flag', '', __LINE__, __FILE__, $sql); + bb_die('Could not update post reported flag #3'); } } @@ -136,7 +136,7 @@ class report_post extends report_module SET post_reported = 0 WHERE post_id IN(' . implode(', ', $clear_ids) . ')'; if (!DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not update post reported flag', '', __LINE__, __FILE__, $sql); + bb_die('Could not update post reported flag #4'); } } } @@ -163,7 +163,7 @@ class report_post extends report_module ON t.topic_id = p.topic_id WHERE p.post_id = ' . (int)$report_subject; if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not obtain report subject', '', __LINE__, __FILE__, $sql); + bb_die('Could not obtain report subject'); } $row = DB()->sql_fetchrow($result); @@ -192,7 +192,7 @@ class report_post extends report_module FROM ' . BB_POSTS . ' WHERE post_id = ' . (int)$report_subject; if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not obtain report subject data', '', __LINE__, __FILE__, $sql); + bb_die('Could not obtain report subject data'); } $row = DB()->sql_fetchrow($result); @@ -231,7 +231,7 @@ class report_post extends report_module FROM ' . BB_POSTS . ' WHERE post_id IN(' . implode(', ', $check_posts) . ')'; if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not obtain current forum ids', '', __LINE__, __FILE__, $sql); + bb_die('Could not obtain current forum ids'); } while ($row = DB()->sql_fetchrow($result)) { diff --git a/upload/includes/report_hack/report_privmsg.php b/upload/includes/report_hack/report_privmsg.php index 8d7bc44ef..5892cf7fc 100644 --- a/upload/includes/report_hack/report_privmsg.php +++ b/upload/includes/report_hack/report_privmsg.php @@ -23,7 +23,7 @@ class report_privmsg extends report_module $sql = 'UPDATE ' . BB_PRIVMSGS . ' SET privmsgs_reported = 0'; if (!DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not reset privmsgs reported flag', '', __LINE__, __FILE__, $sql); + bb_die('Could not reset privmsgs reported flag'); } if (!$uninstall) { @@ -33,7 +33,7 @@ class report_privmsg extends report_module AND report_status NOT IN(' . REPORT_CLEARED . ', ' . REPORT_DELETE . ') GROUP BY report_subject'; if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not obtain open reports', '', __LINE__, __FILE__, $sql); + bb_die('Could not obtain open reports'); } $open_ids = array(); @@ -47,7 +47,7 @@ class report_privmsg extends report_module SET privmsgs_reported = 1 WHERE privmsgs_id IN(' . implode(', ', $open_ids) . ')'; if (!DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not sync privmsgs reported flag', '', __LINE__, __FILE__, $sql); + bb_die('Could not sync privmsgs reported flag'); } } } @@ -62,7 +62,7 @@ class report_privmsg extends report_module SET privmsgs_reported = 1 WHERE privmsgs_id = ' . (int)$report_subject; if (!DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not update privmsgs reported flag', '', __LINE__, __FILE__, $sql); + bb_die('Could not update privmsgs reported flag #1'); } } @@ -84,7 +84,7 @@ class report_privmsg extends report_module SET privmsgs_reported = 1 WHERE privmsgs_id IN(' . implode(', ', $report_subjects) . ')'; if (!DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not update privmsgs reported flag', '', __LINE__, __FILE__, $sql); + bb_die('Could not update privmsgs reported flag #2'); } break; } @@ -105,7 +105,7 @@ class report_privmsg extends report_module AND report_status NOT IN(' . REPORT_CLEARED . ', ' . REPORT_DELETE . ') GROUP BY report_subject'; if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not get open reports', '', __LINE__, __FILE__, $sql); + bb_die('Could not get open reports'); } $open_ids = array(); @@ -119,7 +119,7 @@ class report_privmsg extends report_module SET privmsgs_reported = 1 WHERE privmsgs_id IN(' . implode(', ', $open_ids) . ')'; if (!DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not update topic reported flag', '', __LINE__, __FILE__, $sql); + bb_die('Could not update privmsgs reported flag #3'); } } @@ -135,7 +135,7 @@ class report_privmsg extends report_module SET privmsgs_reported = 0 WHERE privmsgs_id IN(' . implode(', ', $clear_ids) . ')'; if (!DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not update topic reported flag', '', __LINE__, __FILE__, $sql); + bb_die('Could not update privmsgs reported flag #4'); } } } @@ -161,7 +161,7 @@ class report_privmsg extends report_module WHERE privmsgs_to_userid = ' . $userdata['user_id'] . ' AND privmsgs_id = ' . (int)$report_subject; if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not obtain report subject', '', __LINE__, __FILE__, $sql); + bb_die('Could not obtain report subject'); } $row = DB()->sql_fetchrow($result); @@ -183,7 +183,7 @@ class report_privmsg extends report_module ON u.user_id = p.privmsgs_from_userid WHERE privmsgs_id = ' . (int)$report_subject; if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, "Could not obtain report subject details", '', __LINE__, __FILE__, $sql); + bb_die('Could not obtain report subject details'); } $row = DB()->sql_fetchrow($result); diff --git a/upload/includes/report_hack/report_topic.php b/upload/includes/report_hack/report_topic.php index c82a513eb..dba6bbf60 100644 --- a/upload/includes/report_hack/report_topic.php +++ b/upload/includes/report_hack/report_topic.php @@ -24,7 +24,7 @@ class report_topic extends report_module $sql = 'UPDATE ' . BB_TOPICS . ' SET topic_reported = 0'; if (!DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not reset topic reported flag', '', __LINE__, __FILE__, $sql); + bb_die('Could not reset topic reported flag'); } if (!$uninstall) { @@ -34,7 +34,7 @@ class report_topic extends report_module AND report_status NOT IN(' . REPORT_CLEARED . ', ' . REPORT_DELETE . ') GROUP BY report_subject'; if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not obtain open reports', '', __LINE__, __FILE__, $sql); + bb_die('Could not obtain open reports'); } $open_ids = array(); @@ -48,7 +48,7 @@ class report_topic extends report_module SET topic_reported = 1 WHERE topic_id IN(' . implode(', ', $open_ids) . ')'; if (!DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not sync topic reported flag', '', __LINE__, __FILE__, $sql); + bb_die('Could not sync topic reported flag'); } } } @@ -63,7 +63,7 @@ class report_topic extends report_module SET topic_reported = 1 WHERE topic_id = ' . (int)$report_subject; if (!DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not update topic reported flag', '', __LINE__, __FILE__, $sql); + bb_die('Could not update topic reported flag #1'); } } @@ -85,7 +85,7 @@ class report_topic extends report_module SET topic_reported = 1 WHERE topic_id IN(' . implode(', ', $report_subjects) . ')'; if (!DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not update topic reported flag', '', __LINE__, __FILE__, $sql); + bb_die('Could not update topic reported flag #2'); } break; } @@ -106,7 +106,7 @@ class report_topic extends report_module AND report_status NOT IN(' . REPORT_CLEARED . ', ' . REPORT_DELETE . ') GROUP BY report_subject'; if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not obtain open reports', '', __LINE__, __FILE__, $sql); + bb_die('Could not obtain open reports'); } $open_ids = array(); @@ -120,7 +120,7 @@ class report_topic extends report_module SET topic_reported = 1 WHERE topic_id IN(' . implode(', ', $open_ids) . ')'; if (!DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not update topic reported flag', '', __LINE__, __FILE__, $sql); + bb_die('Could not update topic reported flag #3'); } } @@ -136,7 +136,7 @@ class report_topic extends report_module SET topic_reported = 0 WHERE topic_id IN(' . implode(', ', $clear_ids) . ')'; if (!DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not update topic reported flag', '', __LINE__, __FILE__, $sql); + bb_die('Could not update topic reported flag #4'); } } } @@ -158,7 +158,7 @@ class report_topic extends report_module FROM ' . BB_TOPICS . ' WHERE topic_id = ' . (int)$report_subject; if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not obtain report subject', '', __LINE__, __FILE__, $sql); + bb_die('Could not obtain report subject'); } $row = DB()->sql_fetchrow($result); @@ -176,7 +176,7 @@ class report_topic extends report_module FROM ' . BB_TOPICS . ' WHERE topic_id = ' . (int)$report_subject; if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not obtain report subject data', '', __LINE__, __FILE__, $sql); + bb_die('Could not obtain report subject data'); } $row = DB()->sql_fetchrow($result); @@ -215,7 +215,7 @@ class report_topic extends report_module FROM ' . BB_TOPICS . ' WHERE topic_id IN(' . implode(', ', $check_topics) . ')'; if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not obtain current forum ids', '', __LINE__, __FILE__, $sql); + bb_die('Could not obtain current forum ids'); } while ($row = DB()->sql_fetchrow($result)) { diff --git a/upload/includes/report_hack/report_user.php b/upload/includes/report_hack/report_user.php index 23f76756b..3737379ae 100644 --- a/upload/includes/report_hack/report_user.php +++ b/upload/includes/report_hack/report_user.php @@ -33,7 +33,7 @@ class report_user extends report_module FROM ' . BB_USERS . ' WHERE user_id = ' . (int)$report_subject; if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not obtain report subject', '', __LINE__, __FILE__, $sql); + bb_die('Could not obtain report subject'); } $row = DB()->sql_fetchrow($result); diff --git a/upload/includes/report_module.php b/upload/includes/report_module.php index b83182d0f..4cfd47d72 100644 --- a/upload/includes/report_module.php +++ b/upload/includes/report_module.php @@ -46,7 +46,7 @@ class report_module ORDER BY report_reason_order'; if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not obtain report reasons', '', __LINE__, __FILE__, $sql); + bb_die('Could not obtain report reasons'); } $rows = array(); diff --git a/upload/includes/sessions.php b/upload/includes/sessions.php index 105985b3a..5e52c32ec 100644 --- a/upload/includes/sessions.php +++ b/upload/includes/sessions.php @@ -448,7 +448,7 @@ class user_common } else { - trigger_error("Couldn't start session : login", E_USER_ERROR); + trigger_error("Could not start session : login", E_USER_ERROR); } } } diff --git a/upload/includes/smtp.php b/upload/includes/smtp.php index c4be8eef7..23afafdbc 100644 --- a/upload/includes/smtp.php +++ b/upload/includes/smtp.php @@ -11,13 +11,13 @@ function server_parse($socket, $response, $line = __LINE__) { if (!($server_response = fgets($socket, 256))) { - message_die(GENERAL_ERROR, "Couldn't get mail server response codes", "", $line, __FILE__); + bb_die('Could not get mail server response codes'); } } if (!(substr($server_response, 0, 3) == $response)) { - message_die(GENERAL_ERROR, "Ran into problems sending Mail. Response: $server_response", "", $line, __FILE__); + bb_die('Ran into problems sending mail. Response: '. $server_response); } } @@ -75,19 +75,19 @@ function smtpmail($mail_to, $subject, $message, $headers = '') if (trim($subject) == '') { - message_die(GENERAL_ERROR, "No email Subject specified", "", __LINE__, __FILE__); + bb_die('No email subject specified'); } if (trim($message) == '') { - message_die(GENERAL_ERROR, "Email message was blank", "", __LINE__, __FILE__); + bb_die('Email message was blank'); } // Ok we have error checked as much as we can to this point let's get on // it already. if( !$socket = @fsockopen($bb_cfg['smtp_host'], 25, $errno, $errstr, 20) ) { - message_die(GENERAL_ERROR, "Could not connect to smtp host : $errno : $errstr", "", __LINE__, __FILE__); + bb_die('Could not connect to smtp host : '. $errno .' : '. $errstr); } // Wait for reply diff --git a/upload/includes/template.php b/upload/includes/template.php index de4fcbd50..6597e49a7 100644 --- a/upload/includes/template.php +++ b/upload/includes/template.php @@ -302,7 +302,7 @@ class Template } if (!$this->loadfile($handle)) { - die("Template->pparse(): Couldn't load template file for handle $handle"); + die("Template->pparse(): Could not load template file for handle $handle"); } // actually compile the template now. if (empty($this->compiled_code[$handle])) diff --git a/upload/includes/torrent_announce_urls.php b/upload/includes/torrent_announce_urls.php index 89efdf5ac..dd8dfeca0 100644 --- a/upload/includes/torrent_announce_urls.php +++ b/upload/includes/torrent_announce_urls.php @@ -4,12 +4,8 @@ if (!defined('BB_ROOT')) die(basename(__FILE__)); $announce_urls = array(); -// // Here you can define additional allowed announce urls -// -// For example, if you want to add http://site.com/announce.php -// add this line: -// $announce_urls[] = 'http://site.com/announce.php'; -// +// For example, if you want to add http://demo.torrentpier.me +// add this line: $announce_urls[] = 'http://demo.torrentpier.me/bt/announce.php'; -// $announce_urls[] = 'http://somesite.com/announce'; \ No newline at end of file +// $announce_urls[] = 'http://demo.torrentpier.me/bt/announce.php'; \ No newline at end of file diff --git a/upload/includes/ucp/activate.php b/upload/includes/ucp/activate.php index 00f3c2231..7cfdc91d2 100644 --- a/upload/includes/ucp/activate.php +++ b/upload/includes/ucp/activate.php @@ -10,16 +10,16 @@ if (empty($_GET['u']) || empty($_GET['act_key'])) $sql = "SELECT user_active, user_id, username, user_email, user_newpasswd, user_lang, user_actkey FROM " . BB_USERS . " WHERE user_id = " . intval($_GET[POST_USERS_URL]); -if ( !($result = DB()->sql_query($sql)) ) +if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not obtain user information', '', __LINE__, __FILE__, $sql); + bb_die('Could not obtain user information'); } -if ( $row = DB()->sql_fetchrow($result) ) +if ($row = DB()->sql_fetchrow($result)) { - if ( $row['user_active'] && trim($row['user_actkey']) == '' ) + if ($row['user_active'] && trim($row['user_actkey']) == '') { - message_die(GENERAL_MESSAGE, $lang['ALREADY_ACTIVATED']); + bb_die($lang['ALREADY_ACTIVATED']); } else if ((trim($row['user_actkey']) == trim($_GET['act_key'])) && (trim($row['user_actkey']) != '')) { @@ -28,20 +28,20 @@ if ( $row = DB()->sql_fetchrow($result) ) $sql = "UPDATE " . BB_USERS . " SET user_active = 1, user_actkey = ''" . $sql_update_pass . " WHERE user_id = " . $row['user_id']; - if ( !($result = DB()->sql_query($sql)) ) + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not update users table', '', __LINE__, __FILE__, $sql_update); + bb_die('Could not update users table'); } $message = ( $sql_update_pass == '' ) ? $lang['ACCOUNT_ACTIVE'] : $lang['PASSWORD_ACTIVATED']; - message_die(GENERAL_MESSAGE, $message); + bb_die($message); } else { - message_die(GENERAL_MESSAGE, $lang['WRONG_ACTIVATION']); + bb_die($lang['WRONG_ACTIVATION']); } } else { - message_die(GENERAL_MESSAGE, $lang['NO_SUCH_USER']); + bb_die($lang['NO_SUCH_USER']); } \ No newline at end of file diff --git a/upload/includes/ucp/register.php b/upload/includes/ucp/register.php index 8f8b47ea7..4084a248c 100644 --- a/upload/includes/ucp/register.php +++ b/upload/includes/ucp/register.php @@ -346,11 +346,11 @@ foreach ($profile_fields as $field => $can_edit) { $errors[] = $lang['WRONG_BIRTHDAY_FORMAT']; } - elseif (bb_date(TIMENOW, 'Y', 'false') - $birthday_date['year'] > $bb_cfg['birthday_max_age']) + elseif (bb_date(TIMENOW, 'Y', false) - $birthday_date['year'] > $bb_cfg['birthday_max_age']) { $errors[] = sprintf($lang['BIRTHDAY_TO_HIGH'], $bb_cfg['birthday_max_age']); } - elseif (bb_date(TIMENOW, 'Y', 'false') - $birthday_date['year'] < $bb_cfg['birthday_min_age']) + elseif (bb_date(TIMENOW, 'Y', false) - $birthday_date['year'] < $bb_cfg['birthday_min_age']) { $errors[] = sprintf($lang['BIRTHDAY_TO_LOW'], $bb_cfg['birthday_min_age']); } diff --git a/upload/includes/ucp/sendpasswd.php b/upload/includes/ucp/sendpasswd.php index 8666d354b..155ce5230 100644 --- a/upload/includes/ucp/sendpasswd.php +++ b/upload/includes/ucp/sendpasswd.php @@ -37,9 +37,9 @@ if ( isset($_POST['submit']) ) $sql = "UPDATE " . BB_USERS . " SET user_newpasswd = '$user_password', user_actkey = '$user_actkey' WHERE user_id = " . $row['user_id']; - if ( !DB()->sql_query($sql) ) + if (!DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not update new password information', '', __LINE__, __FILE__, $sql); + bb_die('Could not update new password information'); } require(INC_DIR .'emailer.class.php'); @@ -68,7 +68,7 @@ if ( isset($_POST['submit']) ) } else { - message_die(GENERAL_ERROR, 'Could not obtain user information for sendpassword', '', __LINE__, __FILE__, $sql); + bb_die('Could not obtain user information for sendpassword'); } } else diff --git a/upload/includes/ucp/topic_watch.php b/upload/includes/ucp/topic_watch.php index 0df654665..bf468a3fe 100644 --- a/upload/includes/ucp/topic_watch.php +++ b/upload/includes/ucp/topic_watch.php @@ -13,28 +13,25 @@ $user_id = $userdata['user_id']; $start = isset($_GET['start']) ? abs(intval($_GET['start'])) : 0; $per_page = $bb_cfg['topics_per_page']; -if ( isset($_POST['topic_id_list']) ) +if (isset($_POST['topic_id_list'])) { - $topic_ids = implode(",", $_POST['topic_id_list']); - - $sql = "DELETE FROM ". BB_TOPICS_WATCH ." - WHERE topic_id IN(". $topic_ids .") - AND user_id = $user_id"; - if ( !($result = DB() ->sql_query($sql)) ) - { - message_die(GENERAL_ERROR, "Could not delete topic watch information", '', __LINE__, __FILE__, $sql); - } + $topic_ids = implode(",", $_POST['topic_id_list']); + $sql = "DELETE FROM ". BB_TOPICS_WATCH ." WHERE topic_id IN(". $topic_ids .") AND user_id = $user_id"; + if (!($result = DB() ->sql_query($sql))) + { + bb_die('Could not delete topic watch information #1'); + } } $template->assign_vars(array( - 'PAGE_TITLE' => $lang['WATCHED_TOPICS'], - 'S_FORM_ACTION' => BB_ROOT .'profile.php?mode=watch', + 'PAGE_TITLE' => $lang['WATCHED_TOPICS'], + 'S_FORM_ACTION' => BB_ROOT .'profile.php?mode=watch', )); $sql = "SELECT COUNT(topic_id) as watch_count FROM ". BB_TOPICS_WATCH ." WHERE user_id = $user_id"; if ( !($result = DB() ->sql_query($sql)) ) { - message_die(GENERAL_ERROR, 'Could not obtain watch topic information', '', __LINE__, __FILE__, $sql); + bb_die('Could not obtain watch topic information #2'); } $row = DB() ->sql_fetchrow($result); $watch_count = ( $row['watch_count'] ) ? $row['watch_count'] : 0; @@ -42,7 +39,7 @@ DB() ->sql_freeresult($result); if ($watch_count > 0) { - $sql = "SELECT w.*, t.*, f.*, u.*, u2.username as last_username, u2.user_id as last_user_id, + $sql = "SELECT w.*, t.*, f.*, u.*, u2.username as last_username, u2.user_id as last_user_id, u2.user_level as last_user_level, u2.user_rank as last_user_rank FROM ". BB_TOPICS_WATCH ." w, ". BB_TOPICS ." t, ". BB_USERS ." u, ". BB_FORUMS ." f, ". BB_POSTS ." p, " . BB_USERS . " u2 WHERE w.topic_id = t.topic_id @@ -50,25 +47,25 @@ if ($watch_count > 0) AND p.post_id = t.topic_last_post_id AND p.poster_id = u2.user_id AND t.topic_poster = u.user_id - AND w.user_id = $user_id + AND w.user_id = $user_id GROUP BY t.topic_last_post_time DESC LIMIT $start, $per_page"; - if ( !($result = DB() ->sql_query($sql)) ) - { - message_die(GENERAL_ERROR, 'Could not obtain watch topic information', '', __LINE__, __FILE__, $sql); - } - $watch = DB() ->sql_fetchrowset($result); + if (!($result = DB() ->sql_query($sql))) + { + bb_die('Could not obtain watch topic information #3'); + } + $watch = DB() ->sql_fetchrowset($result); - if ($watch) - { - for ( $i = 0; $i < count($watch); $i++ ) - { - $is_unread = is_unread($watch[$i]['topic_last_post_time'], $watch[$i]['topic_id'], $watch[$i]['forum_id']); + if ($watch) + { + for ( $i = 0; $i < count($watch); $i++ ) + { + $is_unread = is_unread($watch[$i]['topic_last_post_time'], $watch[$i]['topic_id'], $watch[$i]['forum_id']); $template->assign_block_vars('watch', array( 'ROW_CLASS' => ( !($i % 2) ) ? 'row1' : 'row2', - 'POST_ID' => $watch[$i]['topic_first_post_id'], - 'TOPIC_ID' => $watch[$i]['topic_id'], + 'POST_ID' => $watch[$i]['topic_first_post_id'], + 'TOPIC_ID' => $watch[$i]['topic_id'], 'TOPIC_TITLE' => wbr(str_short($watch[$i]['topic_title'], 70)), 'FULL_TOPIC_TITLE' => wbr($watch[$i]['topic_title']), 'U_TOPIC' => TOPIC_URL . $watch[$i]['topic_id'], @@ -77,22 +74,22 @@ if ($watch_count > 0) 'REPLIES' => $watch[$i]['topic_replies'], 'AUTHOR' => profile_url($watch[$i]), 'LAST_POST' => bb_date($watch[$i]['topic_last_post_time']) .'
'. profile_url(array('user_id' => $watch[$i]['last_user_id'], 'username' => $watch[$i]['last_username'], 'user_rank' => $watch[$i]['last_user_rank'])), - 'LAST_POST_ID' => $watch[$i]['topic_last_post_id'], - 'IS_UNREAD' => $is_unread, - 'TOPIC_ICON' => get_topic_icon($watch[$i], $is_unread), - 'PAGINATION' => ($watch[$i]['topic_status'] == TOPIC_MOVED) ? '' : build_topic_pagination(TOPIC_URL . $watch[$i]['topic_id'], $watch[$i]['topic_replies'], $bb_cfg['posts_per_page']), + 'LAST_POST_ID' => $watch[$i]['topic_last_post_id'], + 'IS_UNREAD' => $is_unread, + 'TOPIC_ICON' => get_topic_icon($watch[$i], $is_unread), + 'PAGINATION' => ($watch[$i]['topic_status'] == TOPIC_MOVED) ? '' : build_topic_pagination(TOPIC_URL . $watch[$i]['topic_id'], $watch[$i]['topic_replies'], $bb_cfg['posts_per_page']), )); - } + } $template->assign_vars(array( - 'MATCHES' => (count($watch) == 1) ? sprintf($lang['FOUND_SEARCH_MATCH'], count($watch)) : sprintf($lang['FOUND_SEARCH_MATCHES'], count($watch)), + 'MATCHES' => (count($watch) == 1) ? sprintf($lang['FOUND_SEARCH_MATCH'], count($watch)) : sprintf($lang['FOUND_SEARCH_MATCHES'], count($watch)), 'PAGINATION' => generate_pagination(BB_ROOT .'profile.php?mode=watch', $watch_count, $per_page, $start), 'PAGE_NUMBER' => sprintf($lang['PAGE_OF'], ( floor( $start / $per_page ) + 1 ), ceil( $watch_count / $per_page )), - 'U_PER_PAGE' => BB_ROOT .'profile.php?mode=watch', - 'PER_PAGE' => $per_page, + 'U_PER_PAGE' => BB_ROOT .'profile.php?mode=watch', + 'PER_PAGE' => $per_page, )); - } - DB() ->sql_freeresult($result); + } + DB() ->sql_freeresult($result); } else { diff --git a/upload/includes/ucp/viewprofile.php b/upload/includes/ucp/viewprofile.php index 9a65ce805..b4b8cb095 100644 --- a/upload/includes/ucp/viewprofile.php +++ b/upload/includes/ucp/viewprofile.php @@ -101,7 +101,7 @@ $template->assign_vars(array( 'USERNAME' => $profiledata['username'], 'PROFILE_USER_ID' => $profiledata['user_id'], 'PROFILE_USER' => $profile_user_id, - 'USER_REGDATE' => bb_date($profiledata['user_regdate'], 'Y-m-d H:i', 'false'), + 'USER_REGDATE' => bb_date($profiledata['user_regdate'], 'Y-m-d H:i', false), 'POSTER_RANK' => ($poster_rank) ? "". $poster_rank ."" : $lang['USER'], 'RANK_IMAGE' => $rank_image, 'RANK_SELECT' => $rank_select, @@ -110,8 +110,8 @@ $template->assign_vars(array( 'EMAIL' => $email, 'WWW' => $profiledata['user_website'], 'ICQ' => $profiledata['user_icq'], - 'LAST_VISIT_TIME' => ($profiledata['user_lastvisit']) ? (bf($profiledata['user_opt'], 'user_opt', 'user_viewonline') && !IS_ADMIN) ? $lang['HIDDEN_USER'] : bb_date($profiledata['user_lastvisit'], 'Y-m-d H:i', 'false') : $lang['NEVER'], - 'LAST_ACTIVITY_TIME' => ($profiledata['user_session_time']) ? (bf($profiledata['user_opt'], 'user_opt', 'user_viewonline') && !IS_ADMIN) ? $lang['HIDDEN_USER'] : bb_date($profiledata['user_session_time'], 'Y-m-d H:i', 'false') : $lang['NEVER'], + 'LAST_VISIT_TIME' => ($profiledata['user_lastvisit']) ? (bf($profiledata['user_opt'], 'user_opt', 'user_viewonline') && !IS_ADMIN) ? $lang['HIDDEN_USER'] : bb_date($profiledata['user_lastvisit'], 'Y-m-d H:i', false) : $lang['NEVER'], + 'LAST_ACTIVITY_TIME' => ($profiledata['user_session_time']) ? (bf($profiledata['user_opt'], 'user_opt', 'user_viewonline') && !IS_ADMIN) ? $lang['HIDDEN_USER'] : bb_date($profiledata['user_session_time'], 'Y-m-d H:i', false) : $lang['NEVER'], 'USER_ACTIVE' => $profiledata['user_active'], 'LOCATION' => $profiledata['user_from'], diff --git a/upload/index.php b/upload/index.php index 96f43fa46..5267759c7 100644 --- a/upload/index.php +++ b/upload/index.php @@ -212,7 +212,7 @@ foreach ($cat_forums as $cid => $c) )); $template->assign_vars(array( - 'H_C_AL_MESS' => ($hide_cat_opt && !$showhide) ? true : false + 'H_C_AL_MESS' => ($hide_cat_opt && !$showhide) ? true : false, )); if (!$showhide && isset($hide_cat_user[$cid]) && !$viewcat) @@ -253,17 +253,16 @@ foreach ($cat_forums as $cid => $c) continue; } - $template->assign_block_vars('c.f', array( + $template->assign_block_vars('c.f', array( 'FORUM_FOLDER_IMG' => $folder_image, - - 'FORUM_ID' => $fid, - 'FORUM_NAME' => $fname_html, - 'FORUM_DESC' => $f['forum_desc'], - 'POSTS' => commify($f['forum_posts']), - 'TOPICS' => commify($f['forum_topics']), - 'LAST_SF_ID' => isset($f['last_sf_id']) ? $f['last_sf_id'] : null, - 'MODERATORS' => isset($moderators[$fid]) ? join(', ', $moderators[$fid]) : '', - 'FORUM_FOLDER_ALT' => ($new) ? $lang['NEW'] : $lang['OLD'], + 'FORUM_ID' => $fid, + 'FORUM_NAME' => $fname_html, + 'FORUM_DESC' => $f['forum_desc'], + 'POSTS' => commify($f['forum_posts']), + 'TOPICS' => commify($f['forum_topics']), + 'LAST_SF_ID' => isset($f['last_sf_id']) ? $f['last_sf_id'] : null, + 'MODERATORS' => isset($moderators[$fid]) ? join(', ', $moderators[$fid]) : '', + 'FORUM_FOLDER_ALT' => ($new) ? $lang['NEW'] : $lang['OLD'], )); if ($f['last_post_id']) @@ -272,7 +271,6 @@ foreach ($cat_forums as $cid => $c) 'LAST_TOPIC_ID' => $f['last_topic_id'], 'LAST_TOPIC_TIP' => $f['last_topic_title'], 'LAST_TOPIC_TITLE' => wbr(str_short($f['last_topic_title'], $last_topic_max_len)), - 'LAST_POST_TIME' => bb_date($f['last_post_time'], $bb_cfg['last_post_date_format']), 'LAST_POST_USER' => profile_url(array('username' => str_short($f['last_post_username'], 15), 'user_id' => $f['last_post_user_id'], 'user_rank' => $f['last_post_user_rank'])), )); @@ -336,7 +334,7 @@ if ($bb_cfg['show_latest_news']) $template->assign_block_vars('news', array( 'NEWS_TOPIC_ID' => $news['topic_id'], 'NEWS_TITLE' => str_short($news['topic_title'], $bb_cfg['max_news_title']), - 'NEWS_TIME' => bb_date($news['topic_time'], 'd-M', 'false'), + 'NEWS_TIME' => bb_date($news['topic_time'], 'd-M', false), 'NEWS_IS_NEW' => is_unread($news['topic_time'], $news['topic_id'], $news['forum_id']), )); } @@ -360,7 +358,7 @@ if ($bb_cfg['show_network_news']) $template->assign_block_vars('net', array( 'NEWS_TOPIC_ID' => $net['topic_id'], 'NEWS_TITLE' => str_short($net['topic_title'], $bb_cfg['max_net_title']), - 'NEWS_TIME' => bb_date($net['topic_time'], 'd-M', 'false'), + 'NEWS_TIME' => bb_date($net['topic_time'], 'd-M', false), 'NEWS_IS_NEW' => is_unread($net['topic_time'], $net['topic_id'], $net['forum_id']), )); } diff --git a/upload/language/en/main.php b/upload/language/en/main.php index 02a62896f..b57d84c6c 100644 --- a/upload/language/en/main.php +++ b/upload/language/en/main.php @@ -7,7 +7,7 @@ $lang['CONTENT_ENCODING'] = 'UTF-8'; // Common, these terms are used // extensively on several pages // -$lang['ADMIN'] = 'Administration'; +$lang['ADMIN'] = 'Administrating'; $lang['FORUM'] = 'Forum'; $lang['CATEGORY'] = 'Category'; $lang['HIDE_CAT'] = 'Hide categories'; @@ -44,7 +44,7 @@ $lang['3_MONTHS'] = '3 Months'; $lang['6_MONTHS'] = '6 Months'; $lang['1_YEAR'] = '1 Year'; -$lang['GO'] = 'Jump to'; +$lang['GO'] = 'Go to'; $lang['SUBMIT'] = 'Submit'; $lang['RESET'] = 'Reset'; $lang['CANCEL'] = 'Cancel'; @@ -60,14 +60,14 @@ $lang['SELECT_ACTION'] = 'Select action'; $lang['NEXT_PAGE'] = 'Next'; $lang['PREVIOUS_PAGE'] = 'Previous'; -$lang['GOTO_PAGE'] = 'Goto page'; +$lang['GOTO_PAGE'] = 'Go to page'; $lang['GOTO_SHORT'] = 'Page'; $lang['JOINED'] = 'Joined'; $lang['LONGEVITY'] = 'Longevity'; $lang['IP_ADDRESS'] = 'IP Address'; $lang['POSTED_AFTER'] = 'after'; -$lang['SELECT_FORUM'] = 'Select a forum'; +$lang['SELECT_FORUM'] = 'Select forum'; $lang['VIEW_LATEST_POST'] = 'View latest post'; $lang['VIEW_NEWEST_POST'] = 'View newest post'; $lang['PAGE_OF'] = 'Page %d of %s'; @@ -91,8 +91,8 @@ $lang['REPLY_WITH_QUOTE'] = 'Reply with quote'; $lang['CLICK_RETURN_TOPIC'] = 'Click %sHere%s to return to the topic'; // %s's here are for uris, do not remove! $lang['CLICK_RETURN_LOGIN'] = 'Click %sHere%s to try again'; $lang['CLICK_RETURN_FORUM'] = 'Click %sHere%s to return to the forum'; -$lang['CLICK_VIEW_MESSAGE'] = 'Click %sHere%s to view your message'; -$lang['CLICK_RETURN_MODCP'] = 'Click %sHere%s to return to the Moderator Control Panel'; +$lang['CLICK_VIEW_MESSAGE'] = 'Click %sHere%s to return to your message'; +$lang['CLICK_RETURN_MODCP'] = 'Click %sHere%s to return to Moderator Control Panel'; $lang['CLICK_RETURN_GROUP'] = 'Click %sHere%s to return to group information'; $lang['ADMIN_PANEL'] = 'Go to Administration Panel'; @@ -101,7 +101,7 @@ $lang['ALL_CACHE_CLEARED'] = 'Cache has been cleared'; $lang['ALL_TEMPLATE_CLEARED'] = 'Template cache has been cleared'; $lang['DATASTORE'] = 'Datastore'; $lang['DATASTORE_CLEARED'] = 'Datastore has been cleared'; -$lang['BOARD_DISABLE'] = 'Sorry, but this board is currently unavailable. Please try again later.'; +$lang['BOARD_DISABLE'] = 'Sorry, this board is currently not available. Please try again later.'; $lang['LOADING'] = 'Loading...'; $lang['JUMPBOX_TITLE'] = 'Select forum'; @@ -119,8 +119,7 @@ $lang['ONLINE_ADMIN'] = 'Administrator'; $lang['ONLINE_MOD'] = 'Moderator'; $lang['ONLINE_GROUP_MEMBER'] = 'Group member'; -$lang['YOU_LAST_VISIT'] = 'Your last visit was on: %s'; -$lang['CURRENT_TIME'] = 'The time now is: %s'; +$lang['CURRENT_TIME'] = 'Current time is: %s'; $lang['SEARCH_NEW'] = 'View newest posts'; $lang['SEARCH_SELF'] = 'My posts'; @@ -170,14 +169,14 @@ $lang['FORUM_LOCKED_MAIN'] = 'Forum is locked'; // // Login // -$lang['ENTER_PASSWORD'] = 'Please enter your username and password to log in.'; +$lang['ENTER_PASSWORD'] = 'Please enter username and password to log in.'; $lang['LOGIN'] = 'Log in'; $lang['LOGOUT'] = 'Log out'; $lang['CONFIRM_LOGOUT'] = 'Are you sure you want to log out?'; -$lang['FORGOTTEN_PASSWORD'] = 'Forgot password?'; -$lang['AUTO_LOGIN'] = 'Log me on automatically each visit'; -$lang['ERROR_LOGIN'] = 'You have specified an incorrect or inactive username, or an invalid password.'; +$lang['FORGOTTEN_PASSWORD'] = 'Password forgotten?'; +$lang['AUTO_LOGIN'] = 'Log me on automatically'; +$lang['ERROR_LOGIN'] = 'The username you submitted is incorrect or invalid, or the password is invalid.'; $lang['REMEMBER'] = 'Remember'; $lang['USER_WELCOME'] = 'Welcome,'; @@ -192,8 +191,8 @@ $lang['PRIVATE_MESSAGE'] = 'Private Message'; $lang['PRIVATE_MESSAGES'] = 'Private Messages'; $lang['WHOSONLINE'] = 'Who is online'; -$lang['MARK_ALL_FORUMS_READ'] = 'Mark all forums read'; -$lang['FORUMS_MARKED_READ'] = 'All forums have been marked read'; +$lang['MARK_ALL_FORUMS_READ'] = 'Flag all forums as read'; +$lang['FORUMS_MARKED_READ'] = 'All forums flagged as read'; $lang['LATEST_NEWS'] = 'Latest news'; $lang['NETWORK_NEWS'] = 'Network news'; @@ -208,7 +207,7 @@ $lang['FORUM_NOT_EXIST'] = 'The forum you selected does not exist.'; $lang['REACHED_ON_ERROR'] = 'You have reached this page in error.'; $lang['ERROR_PORNO_FORUM'] = 'This type of forums (18+) was hidden in your profile by you'; -$lang['DISPLAY_TOPICS'] = 'Display topics from previous'; +$lang['DISPLAY_TOPICS'] = 'Display topics'; $lang['ALL_TOPICS'] = 'All Topics'; $lang['MODERATE_FORUM'] = 'Moderate this forum'; $lang['TITLE_SEARCH_HINT'] = 'search title...'; @@ -249,9 +248,9 @@ $lang['VIEW_RESULTS'] = 'View Results'; $lang['NO_NEWER_TOPICS'] = 'There are no newer topics in this forum'; $lang['NO_OLDER_TOPICS'] = 'There are no older topics in this forum'; $lang['TOPIC_POST_NOT_EXIST'] = 'The topic or post you requested does not exist'; -$lang['NO_POSTS_TOPIC'] = 'No posts exist for this topic'; +$lang['NO_POSTS_TOPIC'] = 'There are no posts in this topic'; -$lang['DISPLAY_POSTS'] = 'Display posts from previous'; +$lang['DISPLAY_POSTS'] = 'Display posts'; $lang['ALL_POSTS'] = 'All Posts'; $lang['NEWEST_FIRST'] = 'Newest First'; $lang['OLDEST_FIRST'] = 'Oldest First'; @@ -260,32 +259,30 @@ $lang['BACK_TO_TOP'] = 'Back to top'; $lang['READ_PROFILE'] = 'View user\'s profile'; $lang['VISIT_WEBSITE'] = 'Visit poster\'s website'; -$lang['VIEW_IP'] = 'View IP address of poster'; +$lang['VIEW_IP'] = 'View poster IP address'; $lang['MODERATE_POST'] = 'Moderate posts'; $lang['DELETE_POST'] = 'Delete this post'; $lang['WROTE'] = 'wrote'; // proceeds the username and is followed by the quoted text -$lang['QUOTE'] = 'Quote'; // comes before bbcode quote output. -$lang['CODE'] = 'Code'; // comes before bbcode code output. -$lang['CODE_COPIED'] = 'Code copied to clipboard'; -$lang['CODE_COPY'] = 'copy to clipboard'; +$lang['QUOTE'] = 'Quote'; // comes before bbcode quote output +$lang['CODE'] = 'Code'; // comes before bbcode code output $lang['SPOILER_HEAD'] = 'hidden text'; $lang['SPOILER_CLOSE'] = 'turn'; -$lang['PLAY_ON_CURPAGE'] = 'Start playing on the current page'; +$lang['PLAY_ON_CURPAGE'] = 'Start playing on current page'; $lang['EDITED_TIME_TOTAL'] = 'Last edited by %s on %s; edited %d time in total'; // Last edited by me on 12 Oct 2001; edited 1 time in total $lang['EDITED_TIMES_TOTAL'] = 'Last edited by %s on %s; edited %d times in total'; // Last edited by me on 12 Oct 2001; edited 2 times in total -$lang['LOCK_TOPIC'] = 'Lock this topic'; -$lang['UNLOCK_TOPIC'] = 'Unlock this topic'; -$lang['MOVE_TOPIC'] = 'Move this topic'; -$lang['DELETE_TOPIC'] = 'Delete this topic'; -$lang['SPLIT_TOPIC'] = 'Split this topic'; +$lang['LOCK_TOPIC'] = 'Lock the topic'; +$lang['UNLOCK_TOPIC'] = 'Unlock the topic'; +$lang['MOVE_TOPIC'] = 'Move the topic'; +$lang['DELETE_TOPIC'] = 'Delete the topic'; +$lang['SPLIT_TOPIC'] = 'Split the topic'; -$lang['STOP_WATCHING_TOPIC'] = 'Stop watching this topic'; -$lang['START_WATCHING_TOPIC'] = 'Watch this topic for replies'; -$lang['NO_LONGER_WATCHING'] = 'You are no longer watching this topic'; -$lang['YOU_ARE_WATCHING'] = 'You are watching this topic now'; +$lang['STOP_WATCHING_TOPIC'] = 'Stop following the topic'; +$lang['START_WATCHING_TOPIC'] = 'Follow the topic for replies'; +$lang['NO_LONGER_WATCHING'] = 'You are no longer following this topic'; +$lang['YOU_ARE_WATCHING'] = 'You are following this topic now'; $lang['TOTAL_VOTES'] = 'Total Votes'; $lang['SEARCH_IN_TOPIC'] = 'search in topic...'; @@ -308,24 +305,24 @@ $lang['SELECT_POSTS_PER_PAGE'] = 'posts per page'; // $lang['TOPIC_REVIEW'] = 'Topic review'; -$lang['NO_POST_MODE'] = 'No post mode specified'; // If posting.php is called without a mode (newtopic/reply/delete/etc, shouldn't be shown normaly) +$lang['NO_POST_MODE'] = 'No post mode selected'; // If posting.php is called without a mode (newtopic/reply/delete/etc, shouldn't be shown normaly) -$lang['POST_A_NEW_TOPIC'] = 'Post a new topic'; -$lang['POST_A_REPLY'] = 'Post a reply'; +$lang['POST_A_NEW_TOPIC'] = 'Post new topic'; +$lang['POST_A_REPLY'] = 'Post new reply'; $lang['POST_TOPIC_AS'] = 'Post topic as'; $lang['EDIT_POST'] = 'Edit post'; $lang['EDIT_TOPIC_TITLE'] = 'Edit topic title'; $lang['EDIT_POST_NOT_1'] = 'You are not allowed '; $lang['EDIT_POST_NOT_2'] = 'You can not '; -$lang['EDIT_POST_AJAX'] = 'You can not edit the message with the status '; +$lang['EDIT_POST_AJAX'] = 'You can not edit post with the status '; $lang['AFTER_THE_LAPSE'] = 'after the lapse of '; -$lang['DONT_MESSAGE_TITLE'] = 'You have not specified the message header'; +$lang['DONT_MESSAGE_TITLE'] = 'You should specify message title'; $lang['INVALID_TOPIC_ID'] = 'Topic Absent!'; $lang['INVALID_TOPIC_ID_DB'] = 'Topic does not exist in the database!'; $lang['NOT_POST'] = 'Absent Message'; -$lang['NOT_EDIT_TOR_STATUS'] = 'You may not edit your distributions with the status'; +$lang['NOT_EDIT_TOR_STATUS'] = 'You can not edit release with the status'; $lang['TOR_STATUS_DAYS'] = 'days'; $lang['OPTIONS'] = 'Options'; @@ -371,10 +368,10 @@ $lang['DAYS'] = 'Days'; $lang['POLL_FOR_EXPLAIN'] = '[ Enter 0 or leave blank for a never-ending poll ]'; $lang['DELETE_POLL'] = 'Delete Poll'; -$lang['MAX_SMILIES_PER_POST'] = 'Limit of %s emoticons in a message exceeded.'; +$lang['MAX_SMILIES_PER_POST'] = 'Emoticons limit of %s emoticons exceeded.'; $lang['ATTACH_SIGNATURE'] = 'Attach signature (signatures can be changed in profile)'; -$lang['NOTIFY'] = 'Notify me when a reply is posted'; +$lang['NOTIFY'] = 'Notify me when on replies'; $lang['STORED'] = 'Your message has been entered successfully.'; $lang['EDITED'] = 'The message has been changed'; @@ -454,10 +451,10 @@ $lang['SAVE_MARKED'] = 'Save Marked'; $lang['SAVE_MESSAGE'] = 'Save Message'; $lang['DELETE_MESSAGE'] = 'Delete Message'; -$lang['DISPLAY_MESSAGES'] = 'Display messages from previous'; // Followed by number of days/weeks/months +$lang['DISPLAY_MESSAGES'] = 'Display messages'; // Followed by number of days/weeks/months $lang['ALL_MESSAGES'] = 'All Messages'; -$lang['NO_MESSAGES_FOLDER'] = 'You have no messages in this folder'; +$lang['NO_MESSAGES_FOLDER'] = 'There are no messages in this folder'; $lang['PM_DISABLED'] = 'Private messaging has been disabled on this board.'; $lang['CANNOT_SEND_PRIVMSG'] = 'Sorry, but the administrator has prevented you from sending private messages.'; @@ -486,9 +483,9 @@ $lang['SELECT_USERNAME'] = 'Select a Username'; $lang['FIND'] = 'Find'; $lang['NO_MATCH'] = 'No matches found.'; -$lang['NO_PM_ID'] = 'No post ID was specified'; -$lang['NO_SUCH_FOLDER'] = 'No such folder exists'; -$lang['NO_FOLDER'] = 'No folder was specified'; +$lang['NO_PM_ID'] = 'Please specify post ID'; +$lang['NO_SUCH_FOLDER'] = 'Folder is not found'; +$lang['NO_FOLDER'] = 'Please specify the folder'; $lang['MARK_ALL'] = 'Mark all'; $lang['UNMARK_ALL'] = 'Unmark all'; @@ -517,14 +514,14 @@ $lang['PREFERENCES'] = 'Preferences'; $lang['ITEMS_REQUIRED'] = 'Items marked with a * are required unless stated otherwise.'; $lang['REGISTRATION_INFO'] = 'Registration Information'; $lang['PROFILE_INFO'] = 'Profile Information'; -$lang['PROFILE_INFO_WARN'] = 'This information will be publicly viewable'; +$lang['PROFILE_INFO_WARN'] = 'Publicly available information'; $lang['AVATAR_PANEL'] = 'Avatar control panel'; $lang['WEBSITE'] = 'Website'; $lang['LOCATION'] = 'Location'; $lang['CONTACT'] = 'Contact'; $lang['EMAIL_ADDRESS'] = 'E-mail address'; -$lang['SEND_PRIVATE_MESSAGE'] = 'Send pm'; +$lang['SEND_PRIVATE_MESSAGE'] = 'Send private message'; $lang['HIDDEN_EMAIL'] = '[ Hidden ]'; $lang['INTERESTS'] = 'Interests'; $lang['OCCUPATION'] = 'Occupation'; @@ -1015,19 +1012,10 @@ $lang['DATETIME']['NOV'] = 'Nov'; $lang['DATETIME']['DEC'] = 'Dec'; // -// Errors (not related to a -// specific failure on a page) +// Errors // $lang['INFORMATION'] = 'Information'; -$lang['CRITICAL_INFORMATION'] = 'Critical Information'; - -$lang['GENERAL_ERROR'] = 'Error'; -$lang['CRITICAL_ERROR'] = 'Critical Error'; -$lang['AN_ERROR_OCCURED'] = 'An Error Occurred'; -$lang['A_CRITICAL_ERROR'] = 'A Critical Error Occurred'; - $lang['ADMIN_REAUTHENTICATE'] = 'To administer/moderate the board you must re-authenticate yourself.'; -$lang['LOGIN_ATTEMPTS_EXCEEDED'] = 'The maximum number of %s login attempts has been exceeded. You are not allowed to login for the next %s minutes.'; // // Attachment Mod Main Language Variables @@ -1068,7 +1056,7 @@ $lang['UPLOAD_NEW_VERSION'] = 'Upload New Version'; // Errors -> Posting Attachments $lang['INVALID_FILENAME'] = '%s is an invalid filename'; // replace %s with given filename -$lang['ATTACHMENT_PHP_SIZE_NA'] = 'The Attachment is too big.
Couldn\'t get the maximum Size defined in PHP.
The Attachment Mod is unable to determine the maximum Upload Size defined in the php.ini.'; +$lang['ATTACHMENT_PHP_SIZE_NA'] = 'The Attachment is too big.
Could not get the maximum Size defined in PHP.
The Attachment Mod is unable to determine the maximum Upload Size defined in the php.ini.'; $lang['ATTACHMENT_PHP_SIZE_OVERRUN'] = 'The Attachment is too big.
Maximum Upload Size: %d MB.
Please note that this Size is defined in php.ini, this means it\'s set by PHP and the Attachment Mod can not override this value.'; // replace %d with ini_get('upload_max_filesize') $lang['DISALLOWED_EXTENSION'] = 'The Extension %s is not allowed'; // replace %s with extension (e.g. .php) $lang['DISALLOWED_EXTENSION_WITHIN_FORUM'] = 'You are not allowed to post Files with the Extension %s within this Forum'; // replace %s with the Extension @@ -1098,16 +1086,9 @@ $lang['CONFIRM_DELETE_PM_ATTACHMENTS'] = 'Are you sure you want to delete all At // General Error Messages $lang['ATTACHMENT_FEATURE_DISABLED'] = 'The Attachment Feature is disabled.'; -$lang['DIRECTORY_DOES_NOT_EXIST'] = 'The Directory \'%s\' does not exist or couldn\'t be found.'; // replace %s with directory +$lang['DIRECTORY_DOES_NOT_EXIST'] = 'The Directory \'%s\' does not exist or Could not be found.'; // replace %s with directory $lang['DIRECTORY_IS_NOT_A_DIR'] = 'Please check if \'%s\' is a directory.'; // replace %s with directory -$lang['DIRECTORY_NOT_WRITEABLE'] = 'Directory \'%s\' is not writeable. You\'ll have to create the upload path and chmod it to 777 (or change the owner to you httpd-servers owner) to upload files.
If you have only plain ftp-access change the \'Attribute\' of the directory to rwxrwxrwx.'; // replace %s with directory - -$lang['FTP_ERROR_CONNECT'] = 'Could not connect to FTP Server: \'%s\'. Please check your FTP-Settings.'; -$lang['FTP_ERROR_LOGIN'] = 'Could not login to FTP Server. The Username \'%s\' or the Password is wrong. Please check your FTP-Settings.'; -$lang['FTP_ERROR_PATH'] = 'Could not access ftp directory: \'%s\'. Please check your FTP Settings.'; -$lang['FTP_ERROR_UPLOAD'] = 'Could not upload files to ftp directory: \'%s\'. Please check your FTP Settings.'; -$lang['FTP_ERROR_DELETE'] = 'Could not delete files in ftp directory: \'%s\'. Please check your FTP Settings.
Another reason for this error could be the non-existence of the Attachment, please check this first in Shadow Attachments.'; -$lang['FTP_ERROR_PASV_MODE'] = 'Unable to enable/disable FTP Passive Mode'; +$lang['DIRECTORY_NOT_WRITEABLE'] = 'Directory \'%s\' is not writeable. You\'ll have to create the upload path and chmod it to 777 (or change the owner to you httpd-servers owner) to upload files.
If you have only plain FTP-access change the \'Attribute\' of the directory to rwxrwxrwx.'; // replace %s with directory // Attach Rules Window $lang['RULES_PAGE'] = 'Attachment Rules'; @@ -1351,8 +1332,8 @@ $lang['OPEN_IN_SAME_WINDOW'] = 'open in same window'; $lang['SHOW_TIME_TOPICS'] = 'show time of the creation topics'; $lang['SHOW_CURSOR'] = 'highlight the row under the cursor'; -$lang['BT_LOW_RATIO_FUNC'] = "You can't use this option (ratio is too low)"; -$lang['BT_LOW_RATIO_FOR_DL'] = "With ratio %s you can't download torrents"; +$lang['BT_LOW_RATIO_FUNC'] = "You can not use this option (ratio is too low)"; +$lang['BT_LOW_RATIO_FOR_DL'] = "With ratio %s you can not download torrents"; $lang['BT_RATIO_WARNING_MSG'] = 'If your ratio falls below %s, you will not be able to download Torrents! More about the rating.'; $lang['SEEDER_LAST_SEEN'] = 'Seeder not seen: %s'; @@ -1734,8 +1715,6 @@ $lang['FORUM_STYLE'] = 'Forum style'; $lang['LINKS_ARE_FORBIDDEN'] = 'Links are forbidden'; -$lang['DONATION'] = 'Donation'; - $lang['GENERAL'] = 'General Admin'; $lang['USERS'] = 'User Admin'; $lang['GROUPS'] = 'Group Admin'; @@ -1789,6 +1768,7 @@ $lang['CREATE_PROFILE'] = 'Create profile'; $lang['TP_VERSION'] = 'TorrentPier version'; $lang['TP_RELEASE_DATE'] = 'Release date'; +$lang['PHP_INFO'] = 'Information about PHP'; $lang['CLICK_RETURN_ADMIN_INDEX'] = 'Click %sHere%s to return to the Admin Index'; @@ -2074,7 +2054,7 @@ $lang['USER_ADMIN_EXPLAIN'] = 'Here you can change your users\' information and $lang['LOOK_UP_USER'] = 'Look up user'; -$lang['ADMIN_USER_FAIL'] = 'Couldn\'t update the user\'s profile.'; +$lang['ADMIN_USER_FAIL'] = 'Could not update the user\'s profile.'; $lang['ADMIN_USER_UPDATED'] = 'The user\'s profile has been updated successfully.'; $lang['CLICK_RETURN_USERADMIN'] = 'Click %sHere%s to return to User Administration'; @@ -2205,20 +2185,6 @@ $lang['DISALLOWED_ALREADY'] = 'The name you entered could not be disallowed. It $lang['CLICK_RETURN_DISALLOWADMIN'] = 'Click %sHere%s to return to Disallow Username Administration'; -// FTP -$lang['ATTACHMENT_FTP_SETTINGS'] = 'Setting up an FTP upload for attachments'; -$lang['FTP_CHOOSE'] = 'Choose Download Method'; -$lang['FTP_OPTION'] = '
Since FTP extensions are enabled in this version of PHP you may also be given the option of first trying to automatically FTP the config file into place.'; -$lang['FTP_INSTRUCTS'] = 'You have chosen to FTP the file to the account containing phpBB 2 automatically. Please enter the information below to facilitate this process. Note that the FTP path should be the exact path via FTP to your phpBB2 installation as if you were FTPing to it using any normal client.'; -$lang['FTP_INFO'] = 'Enter Your FTP Information'; -$lang['ATTEMPT_FTP'] = 'Attempt to FTP config file into place'; -$lang['SEND_FILE'] = 'Just send the file to me and I\'ll FTP it manually'; -$lang['FTP_PATH'] = 'FTP path to phpBB 2'; -$lang['FTP_USERNAME'] = 'Your FTP Username'; -$lang['FTP_PASSWORD'] = 'Your FTP Password'; -$lang['TRANSFER_CONFIG'] = 'Start Transfer'; -$lang['NOFTP_CONFIG'] = 'The attempt to FTP the config file into place failed. Please download the config file and FTP it into place manually.'; - // // Version Check // @@ -2403,23 +2369,9 @@ $lang['DISABLE_MOD'] = 'Disable Attachment Mod'; $lang['DISABLE_MOD_EXPLAIN'] = 'This option is mainly for testing new templates or themes, it disables all Attachment Functions except the Admin Panel.'; $lang['PM_ATTACHMENTS'] = 'Allow Attachments in Private Messages'; $lang['PM_ATTACHMENTS_EXPLAIN'] = 'Allow/Disallow attaching files to Private Messages.'; -$lang['FTP_UPLOAD'] = 'Enable FTP Upload'; -$lang['FTP_UPLOAD_EXPLAIN'] = 'Enable/Disable the FTP Upload option. If you set it to yes, you have to define the Attachment FTP Settings and the Upload Directory is no longer used.'; $lang['ATTACHMENT_TOPIC_REVIEW'] = 'Show applications in the review of communications topics when writing an answer?'; $lang['ATTACHMENT_TOPIC_REVIEW_EXPLAIN'] = 'If you put a "yes", all applications will be displayed in the review of communications topics.'; -$lang['FTP_SERVER'] = 'FTP Upload Server'; -$lang['FTP_SERVER_EXPLAIN'] = 'Here you can enter the IP-Address or FTP-Hostname of the Server used for your uploaded files. If you leave this field empty, the Server on which your phpBB2 Board is installed will be used. Please note that it is not allowed to add ftp:// or something else to the address, just plain ftp.foo.com or, which is a lot faster, the plain IP Address.'; - -$lang['ATTACH_FTP_PATH'] = 'FTP Path to your upload directory'; -$lang['ATTACH_FTP_PATH_EXPLAIN'] = 'The Directory where your Attachments will be stored. This Directory doesn\'t have to be chmodded. Please don\'t enter your IP or FTP-Address here, this input field is only for the FTP Path.
For example: /home/web/uploads'; -$lang['FTP_DOWNLOAD_PATH'] = 'Download Link to FTP Path'; -$lang['FTP_DOWNLOAD_PATH_EXPLAIN'] = 'Enter the URL to your FTP Path, where your Attachments are stored.
If you are using a Remote FTP Server, please enter the complete url, for example http://www.mystorage.com/phpBB2/upload.
If you are using your Local Host to store your Files, you are able to enter the url path relative to your phpBB2 Directory, for example \'upload\'.
A trailing slash will be removed. Leave this field empty, if the FTP Path is not accessible from the Internet. With this field empty you are unable to use the physical download method.'; -$lang['FTP_PASSIVE_MODE'] = 'Enable FTP Passive Mode'; -$lang['FTP_PASSIVE_MODE_EXPLAIN'] = 'The PASV command requests that the remote server open a port for the data connection and return the address of that port. The remote server listens on that port and the client connects to it.'; - -$lang['NO_FTP_EXTENSIONS_INSTALLED'] = 'You are not able to use the FTP Upload Methods, because FTP Extensions are not compiled into your PHP Installation.'; - // Attachments -> Shadow Attachments $lang['SHADOW_ATTACHMENTS_EXPLAIN'] = 'Here you can delete attachment data from postings when the files are missing from your filesystem, and delete files that are no longer attached to any postings. You can download or view a file if you click on it; if no link is present, the file does not exist.'; $lang['SHADOW_ATTACHMENTS_FILE_EXPLAIN'] = 'Delete all attachments files that exist on your filesystem and are not assigned to an existing post.'; @@ -2447,8 +2399,6 @@ $lang['MANAGE_EXTENSION_GROUPS'] = 'Manage Extension Groups'; $lang['MANAGE_EXTENSION_GROUPS_EXPLAIN'] = 'Here you can add, delete and modify your Extension Groups, you can disable Extension Groups, assign a special Category to them, change the download mechanism and you can define a Upload Icon which will be displayed in front of an Attachment belonging to the Group.'; $lang['SPECIAL_CATEGORY'] = 'Special Category'; $lang['CATEGORY_IMAGES'] = 'Images'; -$lang['CATEGORY_STREAM_FILES'] = 'Stream Files'; -$lang['CATEGORY_SWF_FILES'] = 'Flash Files'; $lang['ALLOWED'] = 'Allowed'; $lang['ALLOWED_FORUMS'] = 'Allowed Forums'; $lang['EXT_GROUP_PERMISSIONS'] = 'Group Permissions'; @@ -2461,7 +2411,6 @@ $lang['EXTENSION_GROUP_EXIST'] = 'The Extension Group %s already exist'; // repl $lang['MANAGE_CATEGORIES'] = 'Manage Special Categories'; $lang['MANAGE_CATEGORIES_EXPLAIN'] = 'Here you can configure the Special Categories. You can set up Special Parameters and Conditions for the Special Categorys assigned to an Extension Group.'; $lang['SETTINGS_CAT_IMAGES'] = 'Settings for Special Category: Images'; -$lang['SETTINGS_CAT_STREAMS'] = 'Settings for Special Category: Stream Files'; $lang['SETTINGS_CAT_FLASH'] = 'Settings for Special Category: Flash Files'; $lang['DISPLAY_INLINED'] = 'Display Images Inlined'; $lang['DISPLAY_INLINED_EXPLAIN'] = 'Choose whether to display images directly within the post (yes) or to display images as a link ?'; @@ -2928,14 +2877,12 @@ $lang['SEARCH_INVALID_POSTCOUNT'] = 'Invalid Post Count entered to Search'; $lang['SEARCH_INVALID_USERFIELD'] = 'Invalid Userfield data entered'; $lang['SEARCH_INVALID_LASTVISITED'] = 'Invalid data entered for Last Visited search'; $lang['SEARCH_INVALID_LANGUAGE'] = 'Invalid Language Selected'; -$lang['SEARCH_INVALID_STYLE'] = 'Invalid Style Selected'; $lang['SEARCH_INVALID_TIMEZONE'] = 'Invalid Timezone Selected'; $lang['SEARCH_INVALID_MODERATORS'] = 'Invalid Forum Selected'; $lang['SEARCH_INVALID'] = 'Invalid Search'; $lang['SEARCH_INVALID_DAY'] = 'The day you entered was invalid'; $lang['SEARCH_INVALID_MONTH'] = 'The month you entered was invalid'; $lang['SEARCH_INVALID_YEAR'] = 'The year you entered was invalid'; -$lang['SEARCH_NO_REGEXP'] = 'Your database does not support Regular Expression searching.'; $lang['SEARCH_FOR_USERNAME'] = 'Searching usernames matching %s'; $lang['SEARCH_FOR_EMAIL'] = 'Searching email addresses matching %s'; $lang['SEARCH_FOR_IP'] = 'Searching IP addresses matching %s'; @@ -2965,8 +2912,8 @@ $lang['SEARCH_FOR_STYLE'] = 'Searching for users who have set %s as their style' $lang['SEARCH_FOR_MODERATORS'] = 'Search for moderators of the Forum -> %s'; $lang['SEARCH_USERS_ADVANCED'] = 'Advanced User Search'; $lang['SEARCH_USERS_EXPLAIN'] = 'This Module allows you to perform advanced searches for users on a wide range of criteria. Please read the descriptions under each field to understand each search option completely.'; -$lang['SEARCH_USERNAME_EXPLAIN'] = 'Here you can perform a case insensitive search for usernames. If you would like to match part of the username, use * (an asterix) as a wildcard. Checking the Regular Expressions box will allow you to search based on your regex pattern.'; -$lang['SEARCH_EMAIL_EXPLAIN'] = 'Enter an expression to match a user\'s email address. This is case insensitive. If you want to do a partial match, use * (an asterix) as a wildcard. Checking the Regular Expressions box will allow you to search based on your regex pattern.'; +$lang['SEARCH_USERNAME_EXPLAIN'] = 'Here you can perform a case insensitive search for usernames. If you would like to match part of the username, use * (an asterix) as a wildcard.'; +$lang['SEARCH_EMAIL_EXPLAIN'] = 'Enter an expression to match a user\'s email address. This is case insensitive. If you want to do a partial match, use * (an asterix) as a wildcard.'; $lang['SEARCH_IP_EXPLAIN'] = 'Search for users by a specific IP address (xxx.xxx.xxx.xxx), wildcard (xxx.xxx.xxx.*) or range (xxx.xxx.xxx.xxx-yyy.yyy.yyy.yyy). Note: the last quad .255 is considered the range of all the IPs in that quad. If you enter 10.0.0.255, it is just like entering 10.0.0.* (No IP is assigned .255 for that matter, it is reserved). Where you may encounter this is in ranges, 10.0.0.5-10.0.0.255 is the same as "10.0.0.*" . You should really enter 10.0.0.5-10.0.0.254 .'; $lang['SEARCH_USERS_JOINED'] = 'Users that joined'; $lang['SEARCH_USERS_LASTVISITED'] = 'Users whom have visited'; @@ -2986,14 +2933,13 @@ $lang['GREATER_THAN'] = 'Greater than'; $lang['LESS_THAN'] = 'Less than'; $lang['SEARCH_USERS_POSTCOUNT_EXPLAIN'] = 'You can search for users based on the Postcount value. You can either search by a specific value, greater than or lesser than a value or between two values. To do the range search, select "Equals" then put the beginning and ending values of the range separated by a dash (-), e.g. 10-15'; $lang['USERFIELD'] = 'Userfield'; -$lang['SEARCH_USERS_USERFIELD_EXPLAIN'] = 'Search for users based on various profile fields. Wildcards are supported using an asterix (*). Checking the Regular Expressions box will allow you to search based on your regex pattern.'; +$lang['SEARCH_USERS_USERFIELD_EXPLAIN'] = 'Search for users based on various profile fields. Wildcards are supported using an asterix (*).'; $lang['SEARCH_USERS_LASTVISITED_EXPLAIN'] = 'You can search for users based on their last login date using this search option'; $lang['SEARCH_USERS_LANGUAGE_EXPLAIN'] = 'This will display users whom have selected a specific language in their Profile'; $lang['SEARCH_USERS_TIMEZONE_EXPLAIN'] = 'Users who have selected a specific timezone in their profile'; $lang['SEARCH_USERS_STYLE_EXPLAIN'] = 'Display users who have selected a specific style.'; $lang['MODERATORS_OF'] = 'Moderators of'; $lang['SEARCH_USERS_MODERATORS_EXPLAIN'] = 'Search for users with Moderating permissions to a specific forum. Moderating permissions are recoginised either by User Permissions or by being in a Group with the right Group Permssions.'; -$lang['REGULAR_EXPRESSION'] = 'Regular Expression?'; $lang['SEARCH_USERS_NEW'] = '%s yielded %d result(s). Perform another search.'; $lang['BANNED'] = 'Banned'; diff --git a/upload/language/ru/main.php b/upload/language/ru/main.php index 534cc66b0..7fe1209b0 100644 --- a/upload/language/ru/main.php +++ b/upload/language/ru/main.php @@ -119,7 +119,6 @@ $lang['ONLINE_ADMIN'] = 'Администратор'; $lang['ONLINE_MOD'] = 'Модератор'; $lang['ONLINE_GROUP_MEMBER'] = 'Участник групп'; -$lang['YOU_LAST_VISIT'] = 'Ваш последний визит: %s'; $lang['CURRENT_TIME'] = 'Текущее время: %s'; $lang['SEARCH_NEW'] = 'Новые сообщения'; @@ -265,10 +264,8 @@ $lang['MODERATE_POST'] = 'Модерировать сообщения'; $lang['DELETE_POST'] = 'Удалить это сообщение'; $lang['WROTE'] = 'писал(а)'; // proceeds the username and is followed by the quoted text -$lang['QUOTE'] = 'Цитата'; // comes before bbcode quote output. -$lang['CODE'] = 'Код'; // comes before bbcode code output. -$lang['CODE_COPIED'] = 'Код скопирован в буфер обмена'; -$lang['CODE_COPY'] = 'скопировать в буфер обмена'; +$lang['QUOTE'] = 'Цитата'; // comes before bbcode quote output +$lang['CODE'] = 'Код'; // comes before bbcode code output $lang['SPOILER_HEAD'] = 'Скрытый текст'; $lang['SPOILER_CLOSE'] = 'Свернуть'; $lang['PLAY_ON_CURPAGE'] = 'Начать проигрывание на текущей странице'; @@ -1015,19 +1012,10 @@ $lang['DATETIME']['NOV'] = 'Ноя'; $lang['DATETIME']['DEC'] = 'Дек'; // -// Errors (not related to a -// specific failure on a page) +// Errors // $lang['INFORMATION'] = 'Информация'; -$lang['CRITICAL_INFORMATION'] = 'Критическая информация'; - -$lang['GENERAL_ERROR'] = 'Ошибка'; -$lang['CRITICAL_ERROR'] = 'Критическая ошибка'; -$lang['AN_ERROR_OCCURED'] = 'Произошла ошибка'; -$lang['A_CRITICAL_ERROR'] = 'Произошла критическая ошибка'; - $lang['ADMIN_REAUTHENTICATE'] = 'Чтобы получить доступ к админ/мод панели, вам необходимо еще раз ввести пароль.'; -$lang['LOGIN_ATTEMPTS_EXCEEDED'] = 'Было превышено максимальное число в %s попыток входа. Вы можете попытаться войти через %s минут.'; // // Attachment Mod Main Language Variables @@ -1102,13 +1090,6 @@ $lang['DIRECTORY_DOES_NOT_EXIST'] = 'Директория \'%s\' не сущес $lang['DIRECTORY_IS_NOT_A_DIR'] = 'Пожалуйста, проверьте является ли \'%s\' директорией.'; // replace %s with directory $lang['DIRECTORY_NOT_WRITEABLE'] = 'Директория \'%s\' недоступна для записи. Вам нужно создать директорию для закачек и выполнить chmod 777 (или изменить владельца httpd-servers) для закачки фалов на сервер.
Если у вас только FTP доступ к серверу измените \'Атрибуты\' директории на rwxrwxrwx.'; // replace %s with directory -$lang['FTP_ERROR_CONNECT'] = 'Невозможно соединиться с FTP сервером: \'%s\'. Пожалуйста, проверьте ваши настройки FTP.'; -$lang['FTP_ERROR_LOGIN'] = 'Невозможно зайти на FTP сервер. Имя пользователя \'%s\' иои пароль неверны. Пожалуйста, проверьте ваши настройки FTP.'; -$lang['FTP_ERROR_PATH'] = 'Нет доступа к директории: \'%s\'. Пожалуйста, проверьте ваши настройки FTP.'; -$lang['FTP_ERROR_UPLOAD'] = 'Невозможно записать файлы в директорию: \'%s\'. Пожалуйста, проверьте ваши настройки FTP.'; -$lang['FTP_ERROR_DELETE'] = 'Невозможно удалить файлы в директории: \'%s\'. Пожалуйста, проверьте ваши настройки FTP.
Другой причиной этой ошибки может быть отсутствие файла, проверьте сначала скрытые вложения.'; -$lang['FTP_ERROR_PASV_MODE'] = 'Невозможно включить/отключить пассивный режим'; - // Attach Rules Window $lang['RULES_PAGE'] = 'Правила вложений'; $lang['ATTACH_RULES_TITLE'] = 'Разрешенные группы расширений и их размер'; @@ -1734,8 +1715,6 @@ $lang['FORUM_STYLE'] = 'Стиль форума'; $lang['LINKS_ARE_FORBIDDEN'] = 'Ссылки запрещены'; -$lang['DONATION'] = 'Помощь трекеру'; - $lang['GENERAL'] = 'Общие настройки'; $lang['USERS'] = 'Пользователи'; $lang['GROUPS'] = 'Группы'; @@ -1783,12 +1762,13 @@ $lang['IDX_SYNCHRONIZE_POSTCOUNT'] = 'Количество сообщений'; // Index // $lang['MAIN_INDEX'] = 'Список форумов'; -$lang['FORUM_STATS'] = 'Статистика Форумов'; +$lang['FORUM_STATS'] = 'Статистика форумов'; $lang['ADMIN_INDEX'] = 'Главная страница'; $lang['CREATE_PROFILE'] = 'Создать аккаунт'; -$lang['TP_VERSION'] = 'Версия TorrentPier II'; +$lang['TP_VERSION'] = 'Версия TorrentPier II'; $lang['TP_RELEASE_DATE'] = 'Дата выпуска'; +$lang['PHP_INFO'] = 'Информация о PHP'; $lang['CLICK_RETURN_ADMIN_INDEX'] = '%sВернуться на главную страницу администраторского раздела%s'; @@ -2205,20 +2185,6 @@ $lang['DISALLOWED_ALREADY'] = 'Имя, которое вы пытаетесь з $lang['CLICK_RETURN_DISALLOWADMIN'] = '%sВернуться к управлению запрещенными именами%s'; -// FTP -$lang['ATTACHMENT_FTP_SETTINGS'] = 'Настройка закачки вложений на FTP'; -$lang['FTP_CHOOSE'] = 'Выберите метод скачивания'; -$lang['FTP_OPTION'] = '
В этой версии PHP включены возможности FTP, вы можете попробовать сначала автоматически закачать файл настроек по FTP в нужный каталог.'; -$lang['FTP_INSTRUCTS'] = 'Вы решили закачать файл настроек по FTP в каталог, содержащий phpBB 2. Пожалуйста, укажите информацию, требуемую для осуществления этого процесса. Учтите, что путь FTP должен быть полным путем к вашей установке phpBB 2, как если бы вы пользовались обычным клиентом FTP.'; -$lang['FTP_INFO'] = 'Укажите настройки FTP'; -$lang['ATTEMPT_FTP'] = 'Попробовать закачать файл настроек по FTP'; -$lang['SEND_FILE'] = 'Просто прислать файл, я закачаю его вручную'; -$lang['FTP_PATH'] = 'Путь FTP к каталогу phpBB 2'; -$lang['FTP_USERNAME'] = 'Имя пользователя для FTP'; -$lang['FTP_PASSWORD'] = 'Пароль для FTP'; -$lang['TRANSFER_CONFIG'] = 'Начать закачку'; -$lang['NOFTP_CONFIG'] = 'Попытка закачать файл настроек по FTP завершилась неудачей. Пожалуйста, скачайте файл настроек и поместите его в нужный каталог вручную.'; - // // Version Check // @@ -2232,7 +2198,7 @@ $lang['MAX_LOGIN_ATTEMPTS_EXPLAIN'] = 'Количество разрешенны $lang['LOGIN_RESET_TIME'] = 'Время блокировки имени пользователя.'; $lang['LOGIN_RESET_TIME_EXPLAIN'] = 'Время, через которое пользователь сможет войти на трекер, после превышения количества разрешенных попыток входа (в минутах).'; -// TODO: Translate PLST to RUS +// // Permissions List // $lang['PERMISSIONS_LIST'] = 'Список прав доступа'; @@ -2403,23 +2369,9 @@ $lang['DISABLE_MOD'] = 'Выключить мод приложений'; $lang['DISABLE_MOD_EXPLAIN'] = 'Эта настройка используется главным образом для проверки новых скинов, она выключает все функции Мода Приложений, кроме административной панели.'; $lang['PM_ATTACHMENTS'] = 'Разрешить приложения в личных сообщениях'; $lang['PM_ATTACHMENTS_EXPLAIN'] = 'Разрешить/Запретить добавлять приложения к личным сообщениям.'; -$lang['FTP_UPLOAD'] = 'Включить FTP закачивание'; -$lang['FTP_UPLOAD_EXPLAIN'] = 'Включить закачивание через FTP. Если поставите на "да", Вам нужно будет сконфигурировать настройки для FTP и папка для приложений не будет использоваться.'; $lang['ATTACHMENT_TOPIC_REVIEW'] = 'Показывать приложения в окне обзора сообщений темы при написании ответа?'; $lang['ATTACHMENT_TOPIC_REVIEW_EXPLAIN'] = 'Если поставите "да", все приложения будут показываться в окне обзора сообщений темы.'; -$lang['FTP_SERVER'] = 'FTP сервер для загрузки'; -$lang['FTP_SERVER_EXPLAIN'] = 'Здесь Вы можете задать IP адрес или домен FTP сервера, который будет использоваться для загрузки файлов. Если оставите это поле пустым, будет использоваться сервер, на котором установлен Ваш форум. Заметьте, что нельзя добавлять ftp:// или что то еще к адресу, только ftp.foo.com или просто IP адрес.'; - -$lang['ATTACH_FTP_PATH'] = 'FTP путь к папке для закаченных файлов'; -$lang['ATTACH_FTP_PATH_EXPLAIN'] = 'Папка для приложений. CMOD не нужен. Пожалуйста не вставляйте Ваш IP или FTP адрес, только относительный или абсолютный путь к папке на самом сервере.
Например: /home/web/uploads'; -$lang['FTP_DOWNLOAD_PATH'] = 'Ссылка для скачивания файлов c FTP'; -$lang['FTP_DOWNLOAD_PATH_EXPLAIN'] = 'Задайте ссылку к FTP, где лежат приложения.
Если Вы используете удаленный FTP сервер, задайте полный адрес, например: http://www.mystorage.com/phpBB2/upload.
Если Вы используете локальный сервер для приложений, задайте относительный адрес к папке форума "upload".
Слеш будет удален. Оставьте поле пустым, если FTP недоступен из интернета. Если поле будет пустым, физический метод скачивания будет недоступен.'; -$lang['FTP_PASSIVE_MODE'] = 'Задействовать пассивный FTP режим'; -$lang['FTP_PASSIVE_MODE_EXPLAIN'] = 'Команда PASV просит удаленный сервер открыть порт для связи и сообщить номер данного порта. Удаленный сервер открывает порт и клиент подключается к нему.'; - -$lang['NO_FTP_EXTENSIONS_INSTALLED'] = 'Вы не можете использовать FTP для закачивания файлов, потому что Ваш PHP этого не поддерживает данную возможность.'; - // Attachments -> Shadow Attachments $lang['SHADOW_ATTACHMENTS_EXPLAIN'] = 'Здесь Вы можете удалить приложения, если сами файлы исчезли с сервера, или удалить файлы, которые не прикреплены ни к каким сообщениям. Вы можете скачать или посмотреть файл кликнув по нему. Если ссылки нет, то файл не существует.'; $lang['SHADOW_ATTACHMENTS_FILE_EXPLAIN'] = 'Удалить все приложения, которые существуют на сервере и не прикреплены ни к какому сообщению.'; @@ -2447,8 +2399,6 @@ $lang['MANAGE_EXTENSION_GROUPS'] = 'Контроль Групп Расширен $lang['MANAGE_EXTENSION_GROUPS_EXPLAIN'] = 'Здесь Вы можете добавить, убрать или изменить группы расширений, Вы можете выключить группы расширений, добавить их в определенные категории, изменить механизм скачивания и выбрать иконку, которая будет отображаться приложением, которое относится к определенной группе.'; $lang['SPECIAL_CATEGORY'] = 'Специальная категория'; $lang['CATEGORY_IMAGES'] = 'Картинки'; -$lang['CATEGORY_STREAM_FILES'] = 'Потоковые файлы'; -$lang['CATEGORY_SWF_FILES'] = 'Flash файлы'; $lang['ALLOWED'] = 'Разрешено'; $lang['ALLOWED_FORUMS'] = 'Разрешенные форумы'; $lang['EXT_GROUP_PERMISSIONS'] = 'Права Групп'; @@ -2461,7 +2411,6 @@ $lang['EXTENSION_GROUP_EXIST'] = 'Группа расширений %s уже с $lang['MANAGE_CATEGORIES'] = 'Контроль специальных категорий'; $lang['MANAGE_CATEGORIES_EXPLAIN'] = 'Здесь Вы можете настраивать специальные категории. Вы можете задать специальные параметры для специальных категорий прикрепленных к группам расширений.'; $lang['SETTINGS_CAT_IMAGES'] = 'Настройки для специальной категории: Изображения'; -$lang['SETTINGS_CAT_STREAMS'] = 'Настройки для специальной категории: Потоковые файлы'; $lang['SETTINGS_CAT_FLASH'] = 'Настройки для специальной категории: Flash файлы'; $lang['DISPLAY_INLINED'] = 'Отображать изображения в сообщениях'; $lang['DISPLAY_INLINED_EXPLAIN'] = 'Выберите отображать ли изображения прямо в сообщениях (да) или отображать изображения в виде ссылок на них?'; @@ -2928,14 +2877,12 @@ $lang['SEARCH_INVALID_POSTCOUNT'] = 'Введено неправильное к $lang['SEARCH_INVALID_USERFIELD'] = 'Введены неправильные пользовательские данные для поиска'; $lang['SEARCH_INVALID_LASTVISITED'] = 'Введены неправильные данные для поиска по последним посещениям'; $lang['SEARCH_INVALID_LANGUAGE'] = 'Выбран неправильный язык'; -$lang['SEARCH_INVALID_STYLE'] = 'Выбран неправильный стиль'; $lang['SEARCH_INVALID_TIMEZONE'] = 'Выбран неправильный часовой пояс'; $lang['SEARCH_INVALID_MODERATORS'] = 'Выбран неправильный форум'; $lang['SEARCH_INVALID'] = 'Неверный поиск'; $lang['SEARCH_INVALID_DAY'] = 'Введенный день неверен'; $lang['SEARCH_INVALID_MONTH'] = 'Введенный месяц неверен'; $lang['SEARCH_INVALID_YEAR'] = 'Введенный год неверен'; -$lang['SEARCH_NO_REGEXP'] = 'База данных не поддерживает поиск по регулярным выражениям.'; $lang['SEARCH_FOR_USERNAME'] = 'Поиск имени пользователя %s'; $lang['SEARCH_FOR_EMAIL'] = 'Поиск адреса email %s'; $lang['SEARCH_FOR_IP'] = 'Поиск IP адреса %s'; @@ -2965,8 +2912,8 @@ $lang['SEARCH_FOR_STYLE'] = 'Поиск пользователей, исполь $lang['SEARCH_FOR_MODERATORS'] = 'Поиск модареторов форума -> %s'; $lang['SEARCH_USERS_ADVANCED'] = 'Расширенный поиск пользователя'; $lang['SEARCH_USERS_EXPLAIN'] = 'Позволяет осуществлять расширенный поиск пользователей по большому диапазону критериев. Пожалуйста, читайте описания полей поиска, чтобы полностью понять каждую из поисковых возможностей.'; -$lang['SEARCH_USERNAME_EXPLAIN'] = 'Здесь можно произвести регистронезависимый поиск имени пользователя. Если вы хотите задать только часть имени, используйте * (звездочка) как маску. Выбор регулярных выражений позволит искать по образцу.'; -$lang['SEARCH_EMAIL_EXPLAIN'] = ' Введите выражение, соответствующее адресам email пользователей. Регистр не имеет значения. Для осуществления поиска по частичному соответствию, используйте * (звездочка) как маску. Выбор регулярных выражений позволит искать по образцу.'; +$lang['SEARCH_USERNAME_EXPLAIN'] = 'Здесь можно произвести регистронезависимый поиск имени пользователя. Если вы хотите задать только часть имени, используйте * (звездочка) как маску.'; +$lang['SEARCH_EMAIL_EXPLAIN'] = ' Введите выражение, соответствующее адресам email пользователей. Регистр не имеет значения. Для осуществления поиска по частичному соответствию, используйте * (звездочка) как маску.'; $lang['SEARCH_IP_EXPLAIN'] = 'Поиск пользователей по IP-адресу (xxx.xxx.xxx.xxx), по маске (xxx.xxx.xxx.*) или диапазону (xxx.xxx.xxx.xxx-yyy.yyy.yyy.yyy). Примечание: последняя четверть .255 означает весь диапазон IP адресов этой четверти. Если задано 10.0.0.255, это равнозначно запросу 10.0.0.* (IP-адрес .255 не присваивается, а является зарезервированным). Это можно встретить при поиске по диапазону, 10.0.0.5-10.0.0.255 равнозначно "10.0.0.*" . На самом деле необходимо задать 10.0.0.5-10.0.0.254 .'; $lang['SEARCH_USERS_JOINED'] = 'Пользователи, зарегистрированные'; $lang['SEARCH_USERS_LASTVISITED'] = 'Пользователи, посетившие трекер'; @@ -2986,14 +2933,13 @@ $lang['GREATER_THAN'] = 'Больше чем'; $lang['LESS_THAN'] = 'Меньше чем'; $lang['SEARCH_USERS_POSTCOUNT_EXPLAIN'] = 'Вы можете искать пользователей по количеству оставленных сообщений. Поиск можно произвести либо по конкретному значению, либо большему или меньшему заданного, либо находящемуся в заданном диапазоне значений. Для поиска в диапазоне, выберите "Равно", и задайте начало и конец диапазона через дефис (-), напр. 10-15'; $lang['USERFIELD'] = 'Поле профиля'; -$lang['SEARCH_USERS_USERFIELD_EXPLAIN'] = 'Поиск пользователей по различным полям профиля. В качестве маски разрешены звездочки (*). Выбор регулярных выражений позволит искать по образцу.'; +$lang['SEARCH_USERS_USERFIELD_EXPLAIN'] = 'Поиск пользователей по различным полям профиля. В качестве маски разрешены звездочки (*).'; $lang['SEARCH_USERS_LASTVISITED_EXPLAIN'] = 'Вы можете искать пользователей по дате их последнего входа на трекер, используя эту поисковую возможность.'; $lang['SEARCH_USERS_LANGUAGE_EXPLAIN'] = 'Поиск пользователей, выбравших заданный язык в своем профиле'; $lang['SEARCH_USERS_TIMEZONE_EXPLAIN'] = 'Поиск пользователей, выбравших заданный часовой пояс в своем профиле'; $lang['SEARCH_USERS_STYLE_EXPLAIN'] = 'Поиск пользователей, выбравших заданный стиль в своем профиле'; $lang['MODERATORS_OF'] = 'Модераторы'; $lang['SEARCH_USERS_MODERATORS_EXPLAIN'] = 'Поиск пользователей с правами модератора на заданном форуме. Права модератора определяются в соответствии с правами пользователя, или в соответствии с правами группы, челоном которой он является.'; -$lang['REGULAR_EXPRESSION'] = 'Регулярное выражение?'; $lang['SEARCH_USERS_NEW'] = '%s дал %d результат(ов). Новый поиск.'; $lang['BANNED'] = 'Забаненные'; diff --git a/upload/language/ua/main.php b/upload/language/ua/main.php index 8fadc0902..54e5f1347 100644 --- a/upload/language/ua/main.php +++ b/upload/language/ua/main.php @@ -119,7 +119,6 @@ $lang['ONLINE_ADMIN'] = 'Адміністратор'; $lang['ONLINE_MOD'] = 'Модератор'; $lang['ONLINE_GROUP_MEMBER'] = 'Учасник груп'; -$lang['YOU_LAST_VISIT'] = 'Ваш останній візит: %s'; $lang['CURRENT_TIME'] = 'Поточний час: %s'; $lang['SEARCH_NEW'] = 'Нові повідомлення'; @@ -265,10 +264,8 @@ $lang['MODERATE_POST'] = 'Модерувати повідомлення'; $lang['DELETE_POST'] = 'Видалити це повідомлення'; $lang['WROTE'] = 'писав(ла)'; // proceeds the username and is followed by the quoted text -$lang['QUOTE'] = 'Цитата'; // comes before bbcode quote output. -$lang['CODE'] = 'Код'; // comes before bbcode code output. -$lang['CODE_COPIED'] = 'Код скопійований в буфер обміну'; -$lang['CODE_COPY'] = 'скопіювати в буфер обміну'; +$lang['QUOTE'] = 'Цитата'; // comes before bbcode quote output +$lang['CODE'] = 'Код'; // comes before bbcode code output $lang['SPOILER_HEAD'] = 'Прихований текст'; $lang['SPOILER_CLOSE'] = 'Згорнути'; $lang['PLAY_ON_CURPAGE'] = 'Почати програвання на поточній сторінці'; @@ -1015,19 +1012,10 @@ $lang['DATETIME']['NOV'] = 'Лис'; $lang['DATETIME']['DEC'] = 'Грудень'; // -// Errors (not related to a -// specific failure on a page) +// Errors // $lang['INFORMATION'] = 'Інформація'; -$lang['CRITICAL_INFORMATION'] = 'Критична інформація'; - -$lang['GENERAL_ERROR'] = 'Помилка'; -$lang['CRITICAL_ERROR'] = 'Критична помилка'; -$lang['AN_ERROR_OCCURED'] = 'Сталась помилка'; -$lang['A_CRITICAL_ERROR'] = 'Сталась критична помилка'; - $lang['ADMIN_REAUTHENTICATE'] = 'Щоб отримати доступ до адмін/мод панелі, вам необхідно ще раз ввести пароль.'; -$lang['LOGIN_ATTEMPTS_EXCEEDED'] = 'Було перевищено максимальну кількість в %s спроб входу. Ви можете увійти через %s хвилин.'; // // Attachment Mod Main Language Variables @@ -1102,13 +1090,6 @@ $lang['DIRECTORY_DOES_NOT_EXIST'] = 'Директорія \'%s\' не існує $lang['DIRECTORY_IS_NOT_A_DIR'] = 'будь Ласка, перевірте чи є \'%s\' директорією.'; // replace %s with directory $lang['DIRECTORY_NOT_WRITEABLE'] = 'Директорія \'%s\' недоступна для запису. Вам потрібно створити директорію для закачувань і виконати chmod 777 (або змінити власника httpd-servers) для закачування файлів на сервер.
Якщо у вас тільки FTP доступ до сервера змініть \'Атрибути\' директорії на rwxrwxrwx.'; // replace %s with directory -$lang['FTP_ERROR_CONNECT'] = "Неможливо з'єднатися з сервером FTP: \'%s\'. Будь ласка, перевірте ваші налаштування FTP."; -$lang['FTP_ERROR_LOGIN'] = "Неможливо зайти на FTP сервер. Ім'я користувача \'%s\' ісі пароль неправильні. Будь ласка, перевірте ваші налаштування FTP."; -$lang['FTP_ERROR_PATH'] = 'Немає доступу до директорії: \'%s\'. Будь ласка, перевірте ваші налаштування FTP.'; -$lang['FTP_ERROR_UPLOAD'] = 'Неможливо записати файли в директорію: \'%s\'. Будь ласка, перевірте ваші налаштування FTP.'; -$lang['FTP_ERROR_DELETE'] = 'Неможливо видалити файли в директорії: \'%s\'. Будь ласка, перевірте ваші настройки FTP.
Іншою причиною цієї помилки може бути відсутність файлу, перевірте спочатку приховані вкладення.'; -$lang['FTP_ERROR_PASV_MODE'] = 'Неможливо включити/відключити пасивний режим'; - // Attach Rules Window $lang['RULES_PAGE'] = 'Правила вкладень'; $lang['ATTACH_RULES_TITLE'] = 'Дозволені групи розширень та їх розмір'; @@ -1734,8 +1715,6 @@ $lang['FORUM_STYLE'] = 'Стиль форуму'; $lang['LINKS_ARE_FORBIDDEN'] = 'Посилання заборонені'; -$lang['DONATION'] = 'Допомога трекеру'; - $lang['GENERAL'] = 'Загальні налаштування'; $lang['USERS'] = 'Користувачі'; $lang['GROUPS'] = 'Групи'; @@ -1783,12 +1762,13 @@ $lang['IDX_SYNCHRONIZE_POSTCOUNT'] = 'Кількість повідомлень' // Index // $lang['MAIN_INDEX'] = 'Список форумів'; -$lang['FORUM_STATS'] = 'Статистика Форумів'; +$lang['FORUM_STATS'] = 'Статистика форумів'; $lang['ADMIN_INDEX'] = 'Головна сторінка'; $lang['CREATE_PROFILE'] = 'Створити акаунт'; -$lang['TP_VERSION'] = 'Версія TorrentPier II'; +$lang['TP_VERSION'] = 'Версія TorrentPier II'; $lang['TP_RELEASE_DATE'] = 'Дата випуску'; +$lang['PHP_INFO'] = 'Інформація про PHP'; $lang['CLICK_RETURN_ADMIN_INDEX'] = '%sВернуться на головну сторінку адміністраторського розділу%s'; @@ -2205,20 +2185,6 @@ $lang['DISALLOWED_ALREADY'] = "Ім'я, яке ви намагаєтеся за $lang['CLICK_RETURN_DISALLOWADMIN'] = '%sПовернутися до управління забороненими іменами%s'; -// FTP -$lang['ATTACHMENT_FTP_SETTINGS'] = 'Параметри завантажування вкладень на FTP'; -$lang['FTP_CHOOSE'] = 'Виберіть метод скачування'; -$lang['FTP_OPTION'] = '
У цій версії PHP включені можливості FTP, ви можете спробувати спочатку автоматично закачати файл налаштувань по FTP в потрібний каталог.'; -$lang['FTP_INSTRUCTS'] = 'Ви вирішили закачати файл налаштувань по FTP в каталог, що містить phpBB 2. Будь ласка, виберіть інформацію, необхідну для здійснення цього процесу. Врахуйте, що шлях FTP повинен бути повним шляхом до вашої установці phpBB 2, як якщо б ви користувалися звичайним клієнтом FTP.'; -$lang['FTP_INFO'] = 'Вкажіть налаштування FTP'; -$lang['ATTEMPT_FTP'] = 'Спробувати закачати файл налаштувань по FTP'; -$lang['SEND_FILE'] = 'надіслати файл, я завантажу його вручну'; -$lang['FTP_PATH'] = 'Шлях до каталогу FTP phpBB 2'; -$lang['FTP_USERNAME'] = "Ім'я користувача FTP"; -$lang['FTP_PASSWORD'] = 'Пароль для FTP'; -$lang['TRANSFER_CONFIG'] = 'Почати закачування'; -$lang['NOFTP_CONFIG'] = 'Спроба закачати файл налаштувань по FTP завершилася невдачею. Будь ласка, скачайте файл налаштувань і помістіть його в потрібний каталог вручну.'; - // // Version Check // @@ -2232,7 +2198,7 @@ $lang['MAX_LOGIN_ATTEMPTS_EXPLAIN'] = 'Кількість дозволених $lang['LOGIN_RESET_TIME'] = 'Час блокування імені користувача.'; $lang['LOGIN_RESET_TIME_EXPLAIN'] = 'Час, через який користувач зможе увійти на трекер, після перевищення кількості дозволених спроб входу (в хвилинах).'; -// TODO: Translate PLST to RUS +// // Permissions List // $lang['PERMISSIONS_LIST'] = 'Список прав доступу'; @@ -2403,23 +2369,9 @@ $lang['DISABLE_MOD'] = 'Вимкнути мод додатків'; $lang['DISABLE_MOD_EXPLAIN'] = 'Ця настройка використовується головним чином для перевірки нових скінів, вона вимикає всі функції Мода Додатків, крім адміністративної панелі.'; $lang['PM_ATTACHMENTS'] = 'Дозволити додатки в особистих повідомленнях'; $lang['PM_ATTACHMENTS_EXPLAIN'] = 'Дозволити/Заборонити додавати додатки до особистих повідомлень.'; -$lang['FTP_UPLOAD'] = 'Включити FTP завантаження'; -$lang['FTP_UPLOAD_EXPLAIN'] = 'Включити закачування через FTP. Якщо поставите на "так", Вам потрібно буде настроїти параметри для FTP і папка для додатків не буде використовуватися.'; $lang['ATTACHMENT_TOPIC_REVIEW'] = 'Показувати додатки у вікні огляду повідомлень теми при написанні відповіді?'; $lang['ATTACHMENT_TOPIC_REVIEW_EXPLAIN'] = 'Якщо поставите "так", всі додатки будуть відображатися у вікні огляду повідомлень теми.'; -$lang['FTP_SERVER'] = 'FTP сервер для завантаження'; -$lang['FTP_SERVER_EXPLAIN'] = 'Тут Ви можете задати IP адресу або домен FTP сервера, який використовуватиметься для завантаження файлів. Якщо залишите це поле порожнім, буде використовуватися сервер, на якому встановлений Ваш форум. Зауважте, що не можна додавати ftp:// або будь що до адреси, тільки ftp.foo.com або просто IP адресу.'; - -$lang['ATTACH_FTP_PATH'] = 'FTP шлях до папки закаченных файлів'; -$lang['ATTACH_FTP_PATH_EXPLAIN'] = 'Папка для додатків. CMOD не потрібен. Будь ласка, не вставляйте Ваш IP або FTP адресу, тільки відносний або абсолютний шлях до папки на сервері.
Наприклад: /home/web/uploads'; -$lang['FTP_DOWNLOAD_PATH'] = 'Посилання для скачування файлів з FTP'; -$lang['FTP_DOWNLOAD_PATH_EXPLAIN'] = 'Вкажіть посилання до FTP, де лежать програми.
Якщо Ви використовуєте віддалений FTP сервер, вкажіть повну адресу, наприклад: http://www.mystorage.com/phpBB2/upload.
Якщо Ви використовуєте локальний сервер для програм, задайте відносний адресу до папки форуму "upload".
Слеш буде видалено. Залиште поле порожнім, якщо FTP недоступний з інтернету. Якщо поле буде порожнім, фізичний метод скачування буде недоступний.'; -$lang['FTP_PASSIVE_MODE'] = 'Задіяти пасивний режим FTP'; -$lang['FTP_PASSIVE_MODE_EXPLAIN'] = "Команда PASV просить віддалений сервер відкрити порт для зв'язку і повідомити номер даного порту. Віддалений сервер відкриває порт і клієнт підключається до нього."; - -$lang['NO_FTP_EXTENSIONS_INSTALLED'] = 'Ви не можете використовувати FTP для завантаження файлів, тому що Ваш PHP не підтримує цю можливість.'; - // Attachments -> Shadow Attachments $lang['SHADOW_ATTACHMENTS_EXPLAIN'] = 'Тут Ви можете видалити додатки, якщо самі файли зникли з сервера, або видалити файли, які не прикріплені не до яких повідомлень. Ви можете скачати або подивитися файл якшо клікните по ньому. Якщо посилання немає, то файл не існує.'; $lang['SHADOW_ATTACHMENTS_FILE_EXPLAIN'] = 'Видалити всі програми, які існують на сервері та не прикріплені не до якого повідомленням.'; @@ -2447,8 +2399,6 @@ $lang['MANAGE_EXTENSION_GROUPS'] = 'Контроль Груп Розширень $lang['MANAGE_EXTENSION_GROUPS_EXPLAIN'] = 'Тут Ви можете додати, видалити або змінити групи розширень, Ви можете вимкнути групи розширень, додати їх в певні категорії, змінити механізм скачування і вибрати іконку, яка буде відображатися додатком, яке відноситься до певної групи.'; $lang['SPECIAL_CATEGORY'] = 'Спеціальна категорія'; $lang['CATEGORY_IMAGES'] = 'Картинки'; -$lang['CATEGORY_STREAM_FILES'] = 'Потокові файли'; -$lang['CATEGORY_SWF_FILES'] = 'Flash файли'; $lang['ALLOWED'] = 'Дозволено'; $lang['ALLOWED_FORUMS'] = 'Дозволені форуми'; $lang['EXT_GROUP_PERMISSIONS'] = 'Права Груп'; @@ -2461,7 +2411,6 @@ $lang['EXTENSION_GROUP_EXIST'] = 'Група розширень %s вже існ $lang['MANAGE_CATEGORIES'] = 'Контроль спеціальних категорій'; $lang['MANAGE_CATEGORIES_EXPLAIN'] = 'Тут Ви можете налаштовувати спеціальні категорії. Ви можете задати спеціальні параметри для спеціальних категорій прикріплених до груп розширень.'; $lang['SETTINGS_CAT_IMAGES'] = 'Налаштування для спеціальної категорії: Зображення'; -$lang['SETTINGS_CAT_STREAMS'] = 'Налаштування для спеціальної категорії: Потокові файли'; $lang['SETTINGS_CAT_FLASH'] = 'Налаштування для спеціальної категорії: Flash файли'; $lang['DISPLAY_INLINED'] = 'Показувати зображення в повідомленнях'; $lang['DISPLAY_INLINED_EXPLAIN'] = 'Виберіть відображати зображення прямо в повідомленнях (так) або відображати зображення у вигляді посилань на них?'; @@ -2928,14 +2877,12 @@ $lang['SEARCH_INVALID_POSTCOUNT'] = 'Введене неправильна кі $lang['SEARCH_INVALID_USERFIELD'] = 'Введені неправильні користувальницькі дані для пошуку'; $lang['SEARCH_INVALID_LASTVISITED'] = 'Введені неправильні дані для пошуку останніх відвідин'; $lang['SEARCH_INVALID_LANGUAGE'] = 'Обрана неправильна мова'; -$lang['SEARCH_INVALID_STYLE'] = 'Обран неправильний стиль'; $lang['SEARCH_INVALID_TIMEZONE'] = 'Обран неправильний часовий пояс'; $lang['SEARCH_INVALID_MODERATORS'] = 'Обран неправильний форум'; $lang['SEARCH_INVALID'] = 'Невірний пошук'; $lang['SEARCH_INVALID_DAY'] = 'Введений день неправильний'; $lang['SEARCH_INVALID_MONTH'] = 'Введений місяць неправильний'; $lang['SEARCH_INVALID_YEAR'] = 'Введений рік неправильний'; -$lang['SEARCH_NO_REGEXP'] = 'База даних не підтримує пошук за регулярними виразами.'; $lang['SEARCH_FOR_USERNAME'] = 'Пошук імені користувача %s'; $lang['SEARCH_FOR_EMAIL'] = 'Пошук адреси email %s'; $lang['SEARCH_FOR_IP'] = 'Пошук IP адреси %s'; @@ -2965,8 +2912,8 @@ $lang['SEARCH_FOR_STYLE'] = 'Пошук користувачів, які вик $lang['SEARCH_FOR_MODERATORS'] = 'Пошук модераторів форуму -> %s'; $lang['SEARCH_USERS_ADVANCED'] = 'Розширений пошук користувача'; $lang['SEARCH_USERS_EXPLAIN'] = 'Дозволяє здійснювати розширений пошук користувачів по великому діапазону критеріїв. Будь ласка, читайте опис полей пошуку, щоб повністю зрозуміти кожну з пошукових можливостей.'; -$lang['SEARCH_USERNAME_EXPLAIN'] = 'Тут можна зробити регістронезавісімий пошук імені користувача. Якщо ви хочете задати тільки частину імені, використовуйте * (зірочку) як маску. Вибір регулярних виразів дозволить шукати за зразком.'; -$lang['SEARCH_EMAIL_EXPLAIN'] = ' Введіть вираз, відповідний до адресу email користувачів. Регістр не має значення. Для здійснення пошуку по частковому збігу, використовуйте * (зірочку) як маску. Вибір регулярних виразів дозволить шукати за зразком.'; +$lang['SEARCH_USERNAME_EXPLAIN'] = 'Тут можна зробити регістронезавісімий пошук імені користувача. Якщо ви хочете задати тільки частину імені, використовуйте * (зірочку) як маску.'; +$lang['SEARCH_EMAIL_EXPLAIN'] = ' Введіть вираз, відповідний до адресу email користувачів. Регістр не має значення. Для здійснення пошуку по частковому збігу, використовуйте * (зірочку) як маску.'; $lang['SEARCH_IP_EXPLAIN'] = 'Пошук користувачів з IP-адресою (xxx.xxx.xxx.xxx), по масці (xxx.xxx.xxx.*) або діапазону (xxx.xxx.xxx.xxx-yyy.yyy.yyy.yyy). Примітка: остання чверть .255 означає весь діапазон IP адрес цій чверті. Якщо задано 10.0.0.255, це рівнозначно запитом 10.0.0.* (IP-адреса .255 не присвоюється, а є зарезервованим). Це можна зустріти при пошуку по діапазону, 10.0.0.5-10.0.0.255 рівнозначно "10.0.0.*" . Насправді необхідно задати 10.0.0.5-10.0.0.254 .'; $lang['SEARCH_USERS_JOINED'] = 'Користувачі, зареєстровані'; $lang['SEARCH_USERS_LASTVISITED'] = 'Користувачі, які відвідали трекер'; @@ -2986,14 +2933,13 @@ $lang['GREATER_THAN'] = 'Більше ніж'; $lang['LESS_THAN'] = 'Менше ніж'; $lang['SEARCH_USERS_POSTCOUNT_EXPLAIN'] = 'Ви можете шукати користувачів за кількістю надісланих повідомлень. Пошук можна здійснити або за конкретним значенням, або більшому або меншому заданого, або знаходиться в заданому діапазоні значень. Для пошуку в діапазоні, виберіть "Одно", і задайте початок і кінець діапазону через дефіс (-), напр. 10-15'; $lang['USERFIELD'] = 'Поле профілю'; -$lang['SEARCH_USERS_USERFIELD_EXPLAIN'] = 'Пошук користувачів з різних полів профілю. В якості маски можна зірочки (*). Вибір регулярних виразів дозволить шукати за зразком.'; +$lang['SEARCH_USERS_USERFIELD_EXPLAIN'] = 'Пошук користувачів з різних полів профілю. В якості маски можна зірочки (*).'; $lang['SEARCH_USERS_LASTVISITED_EXPLAIN'] = 'Ви можете шукати користувачів за датою їх останнього входу на трекер, використовуючи цю пошукову можливість.'; $lang['SEARCH_USERS_LANGUAGE_EXPLAIN'] = 'Пошук користувачів, які обрали задану мову в своєму профілі'; $lang['SEARCH_USERS_TIMEZONE_EXPLAIN'] = 'Пошук користувачів, які обрали заданий часовий пояс у своєму профілі'; $lang['SEARCH_USERS_STYLE_EXPLAIN'] = 'Пошук користувачів, що обрали визначений стиль в своєму профілі'; $lang['MODERATORS_OF'] = 'Модератори'; $lang['SEARCH_USERS_MODERATORS_EXPLAIN'] = 'Пошук користувачів з правами модератора на заданому форумі. Права модератора визначаються у відповідності з правами користувача, або у відповідності з правами групи, челоном якої він є.'; -$lang['REGULAR_EXPRESSION'] = 'Регулярний вираз?'; $lang['SEARCH_USERS_NEW'] = '%s дав %d результат(ів). Новий пошук.'; $lang['BANNED'] = 'Забанені'; diff --git a/upload/memberlist.php b/upload/memberlist.php index 542623b35..91cd53ca7 100644 --- a/upload/memberlist.php +++ b/upload/memberlist.php @@ -65,10 +65,10 @@ $select_sort_order .= ''; // Generate page // $template->assign_vars(array( - 'S_MODE_SELECT' => $select_sort_mode, + 'S_MODE_SELECT' => $select_sort_mode, 'S_ORDER_SELECT' => $select_sort_order, - 'S_MODE_ACTION' => "memberlist.php", - 'S_USERNAME' => $paginationusername, + 'S_MODE_ACTION' => "memberlist.php", + 'S_USERNAME' => $paginationusername, )); switch( $mode ) @@ -147,8 +147,8 @@ $select_letter .= ': '; $select_letter .= ($by_letter == 'all') ? ''. $lang['ALL'] .'' : ''. $lang['ALL'] .''; $template->assign_vars(array( - 'S_LETTER_SELECT' => $select_letter, - 'S_LETTER_HIDDEN' => '', + 'S_LETTER_SELECT' => $select_letter, + 'S_LETTER_HIDDEN' => '', )); // per-letter selection end @@ -202,8 +202,8 @@ if ($result = DB()->fetch_rowset($sql)) 'PM' => $pm, 'EMAIL' => $email, 'WWW' => $www, - 'U_VIEWPROFILE' => "profile.php?mode=viewprofile&". POST_USERS_URL ."=$user_id") - ); + 'U_VIEWPROFILE' => "profile.php?mode=viewprofile&". POST_USERS_URL ."=$user_id", + )); } } else @@ -221,7 +221,7 @@ if ( $mode != 'topten' || $bb_cfg['topics_per_page'] < 10 ) $sql .= ($letter_sql) ? " WHERE $letter_sql" : ''; if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Error getting total users', '', __LINE__, __FILE__, $sql); + bb_die('Error getting total users'); } if ($total = DB()->sql_fetchrow($result)) { diff --git a/upload/misc.php b/upload/misc.php index 29a053c2b..f644aad9e 100644 --- a/upload/misc.php +++ b/upload/misc.php @@ -33,7 +33,7 @@ if ($do == 'attach_rules') if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not query Extension Groups.', '', __LINE__, __FILE__, $sql); + bb_die('Could not query extension groups'); } $allowed_filesize = array(); @@ -59,8 +59,8 @@ if ($do == 'attach_rules') $max_filesize = (!$det_filesize) ? $lang['UNLIMITED'] : humn_size($det_filesize); $template->assign_block_vars('group_row', array( - 'GROUP_RULE_HEADER' => sprintf($lang['GROUP_RULE_HEADER'], $group_name, $max_filesize)) - ); + 'GROUP_RULE_HEADER' => sprintf($lang['GROUP_RULE_HEADER'], $group_name, $max_filesize), + )); $sql = 'SELECT extension FROM ' . BB_EXTENSIONS . " @@ -69,7 +69,7 @@ if ($do == 'attach_rules') if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not query Extensions.', '', __LINE__, __FILE__, $sql); + bb_die('Could not query extensions'); } $e_rows = DB()->sql_fetchrowset($result); @@ -79,15 +79,15 @@ if ($do == 'attach_rules') for ($j = 0; $j < $e_num_rows; $j++) { $template->assign_block_vars('group_row.extension_row', array( - 'EXTENSION' => $e_rows[$j]['extension']) - ); + 'EXTENSION' => $e_rows[$j]['extension'], + )); } } } $template->assign_vars(array( - 'PAGE_TITLE' => $lang['ATTACH_RULES_TITLE']) - ); + 'PAGE_TITLE' => $lang['ATTACH_RULES_TITLE'], + )); if ($nothing) { @@ -140,5 +140,5 @@ elseif ($do == 'info') } else { - message_die(GENERAL_ERROR, 'Invalid mode
'.mb_convert_case($lang['BACK'], MB_CASE_TITLE).''); + bb_die('Invalid mode'); } \ No newline at end of file diff --git a/upload/misc/.htaccess b/upload/misc/.htaccess deleted file mode 100644 index 81049dad0..000000000 --- a/upload/misc/.htaccess +++ /dev/null @@ -1,3 +0,0 @@ - -Deny from all - \ No newline at end of file diff --git a/upload/misc/js/bbcode.js b/upload/misc/js/bbcode.js index b4afe9d46..044fd45c6 100644 --- a/upload/misc/js/bbcode.js +++ b/upload/misc/js/bbcode.js @@ -74,43 +74,22 @@ BBCode.prototype = { return false; }, - // For stupid Opera - save selection before mouseover the button - refreshSelection: function(get) { - if (get) this.stext = this.getSelection()[0]; - else this.stext = ''; - }, - - // Return current selection and range (if exists). - // In Opera, this function must be called periodically (on mouse over, - // for example), because on click stupid Opera breaks up the selection. + // Return current selection and range (if exists) getSelection: function() { var w = window; var text='', range; - if (w.getSelection) { - // Opera & Mozilla? - text = w.getSelection(); - } else if (w.document.getSelection) { - // the Navigator 4.0x code - text = w.document.getSelection(); - } else if (w.document.selection && w.document.selection.createRange) { - // the Internet Explorer 4.0x code - range = w.document.selection.createRange(); - text = range.text; - } else { - return [null, null]; - } if (text == '') text = this.stext; text = ""+text; text = text.replace("/^\s+|\s+$/g", ""); return [text, range]; }, - // Insert string at cursor position of textarea. + // Insert string at cursor position of textarea insertAtCursor: function(text) { - // Focus is placed to textarea. + // Focus is placed to textarea var t = this.textarea; t.focus(); - // Insert the string. + // Insert the string if (document.selection && document.selection.createRange) { var r = document.selection.createRange(); if (!this.replaceOnInsert) r.collapse(); @@ -125,11 +104,11 @@ BBCode.prototype = { } else{ t.value += text; } - // For IE. + // For IE setTimeout(function() { t.focus() }, 100); }, - // Surround piece of textarea text with tags. + // Surround piece of textarea text with tags surround: function(open, close, fTrans) { var t = this.textarea; t.focus(); @@ -142,42 +121,42 @@ BBCode.prototype = { var notEmpty = text != null && text != ''; - // Surround. + // Surround if (range) { - var notEmpty = text != null && text != ''; - var newText = open + fTrans(text) + (close? close : ''); - range.text = newText; - range.collapse(); - if (text != '') { - // Correction for stupid IE: \r for moveStart is 0 character. - var delta = 0; - for (var i=0; ifetch_row($sql)) { - message_die(GENERAL_MESSAGE, 'Topic_post_not_exist'); + bb_die('Topic post not exist'); } $forum_id = $topic_row['forum_id']; @@ -128,7 +128,7 @@ elseif ($forum_id) if (!$topic_row = DB()->fetch_row($sql)) { - message_die(GENERAL_MESSAGE, 'Forum_not_exist'); + bb_die('Forum not exist'); } $forum_name = $topic_row['forum_name']; @@ -136,7 +136,7 @@ elseif ($forum_id) } else { - message_die(GENERAL_MESSAGE, 'Invalid request'); + bb_die('Invalid request'); } // Start session management @@ -179,7 +179,7 @@ elseif ($mode == 'move' && !$is_auth['auth_mod']) // Exit if user not authorized if (!$is_auth['auth_mod']) { - message_die(GENERAL_MESSAGE, $lang['NOT_MODERATOR'], $lang['NOT_AUTHORISED']); + bb_die($lang['NOT_MODERATOR']); } // Redirect to login page if not admin session @@ -207,7 +207,7 @@ switch ($mode) if (empty($_POST['topic_id_list']) && empty($topic_id)) { - message_die(GENERAL_MESSAGE, $lang['NONE_SELECTED']); + bb_die($lang['NONE_SELECTED']); } $req_topics = isset($_POST['topic_id_list']) ? $_POST['topic_id_list'] : $topic_id; @@ -215,7 +215,7 @@ switch ($mode) if (!$req_topics OR !$topic_csv = get_id_csv($req_topics)) { - message_die(GENERAL_MESSAGE, $lang['NONE_SELECTED']); + bb_die($lang['NONE_SELECTED']); } $hidden_fields = array( @@ -241,20 +241,20 @@ switch ($mode) if (!$is_auth['auth_delete']) { - message_die(GENERAL_MESSAGE, sprintf($lang['SORRY_AUTH_DELETE'], $is_auth['auth_delete_type'])); + bb_die(sprintf($lang['SORRY_AUTH_DELETE'], $is_auth['auth_delete_type'])); } if ($confirmed) { $result = topic_delete($req_topics, $forum_id); - //Обновление кеша новостей на главной + //Обновление кеша новостей на главной $news_forums = array_flip(explode(',', $bb_cfg['latest_news_forum_id'])); - if(isset($news_forums[$forum_id]) && $bb_cfg['show_latest_news'] && $result) - { - $datastore->enqueue('latest_news'); - $datastore->update('latest_news'); - } + if(isset($news_forums[$forum_id]) && $bb_cfg['show_latest_news'] && $result) + { + $datastore->enqueue('latest_news'); + $datastore->update('latest_news'); + } $net_forums = array_flip(explode(',', $bb_cfg['network_news_forum_id'])); if(isset($net_forums[$forum_id]) && $bb_cfg['show_network_news'] && $result) @@ -264,7 +264,7 @@ switch ($mode) } $msg = ($result) ? $lang['TOPICS_REMOVED'] : $lang['NO_TOPICS_REMOVED']; - message_die(GENERAL_MESSAGE, return_msg_mcp($msg)); + bb_die(return_msg_mcp($msg)); } else { @@ -284,7 +284,7 @@ switch ($mode) $new_forum_id = (int) $_POST['new_forum']; $result = topic_move($req_topics, $new_forum_id, $forum_id, isset($_POST['move_leave_shadow']), isset($_POST['insert_bot_msg'])); - //Обновление кеша новостей на главной + //Обновление кеша новостей на главной $news_forums = array_flip(explode(',', $bb_cfg['latest_news_forum_id'])); if((isset($news_forums[$forum_id]) || isset($news_forums[$new_forum_id])) && $bb_cfg['show_latest_news'] && $result) { @@ -300,7 +300,7 @@ switch ($mode) } $msg = ($result) ? $lang['TOPICS_MOVED'] : $lang['NO_TOPICS_MOVED']; - message_die(GENERAL_MESSAGE, return_msg_mcp($msg)); + bb_die(return_msg_mcp($msg)); } else { @@ -358,7 +358,7 @@ switch ($mode) if (!$topic_csv = get_id_csv($topic_csv)) { - message_die(GENERAL_MESSAGE, $lang['NONE_SELECTED']); + bb_die($lang['NONE_SELECTED']); } DB()->query(" @@ -380,7 +380,7 @@ switch ($mode) } $msg = ($lock) ? $lang['TOPICS_LOCKED'] : $lang['TOPICS_UNLOCKED']; - message_die(GENERAL_MESSAGE, return_msg_mcp($msg)); + bb_die(return_msg_mcp($msg)); break; @@ -404,7 +404,7 @@ switch ($mode) } $msg = ($set_download) ? $lang['TOPICS_DOWN_SETS'] : $lang['TOPICS_DOWN_UNSETS']; - message_die(GENERAL_MESSAGE, return_msg_mcp($msg)); + bb_die(return_msg_mcp($msg)); break; @@ -438,7 +438,7 @@ switch ($mode) if (!$result = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not get post id information', '', __LINE__, __FILE__, $sql); + bb_die('Could not get post id information'); } if ($rowset = DB()->sql_fetchrowset($result)) { @@ -460,7 +460,7 @@ switch ($mode) ORDER BY post_time ASC"; if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not get post information', '', __LINE__, __FILE__, $sql); + bb_die('Could not get post information'); } if ($row = DB()->sql_fetchrow($result)) @@ -481,22 +481,21 @@ switch ($mode) $post_subject = clean_title($_POST['subject']); if (empty($post_subject)) { - message_die(GENERAL_MESSAGE, $lang['EMPTY_SUBJECT']); + bb_die($lang['EMPTY_SUBJECT']); } $new_forum_id = intval($_POST['new_forum_id']); $topic_time = TIMENOW; - $sql = 'SELECT forum_id FROM ' . BB_FORUMS . ' - WHERE forum_id = ' . $new_forum_id; + $sql = 'SELECT forum_id FROM ' . BB_FORUMS . ' WHERE forum_id = ' . $new_forum_id; if ( !($result = DB()->sql_query($sql)) ) { - message_die(GENERAL_ERROR, 'Could not select from forums table', '', __LINE__, __FILE__, $sql); + bb_die('Could not select from forums table'); } if (!DB()->sql_fetchrow($result)) { - message_die(GENERAL_MESSAGE, 'New forum does not exist'); + bb_die('New forum does not exist'); } DB()->sql_freeresult($result); @@ -507,7 +506,7 @@ switch ($mode) VALUES ('" . DB()->escape($post_subject) . "', $first_poster, " . $topic_time . ", $new_forum_id, " . TOPIC_UNLOCKED . ", " . POST_NORMAL . ", $first_post_id)"; if (!(DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not insert new topic', '', __LINE__, __FILE__, $sql); + bb_die('Could not insert new topic'); } $new_topic_id = DB()->sql_nextid(); @@ -520,17 +519,15 @@ switch ($mode) AND user_id IN ($user_id_sql)"; if (!DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not update topics watch table', '', __LINE__, __FILE__, $sql); + bb_die('Could not update topics watch table'); } $sql_where = (!empty($_POST['split_type_beyond'])) ? " post_time >= $post_time AND topic_id = $topic_id" : "post_id IN ($post_id_sql)"; - $sql = "UPDATE " . BB_POSTS . " - SET topic_id = $new_topic_id, forum_id = $new_forum_id - WHERE $sql_where"; + $sql = "UPDATE " . BB_POSTS . " SET topic_id = $new_topic_id, forum_id = $new_forum_id WHERE $sql_where"; if (!DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not update posts table', '', __LINE__, __FILE__, $sql); + bb_die('Could not update posts table'); } //bot @@ -542,7 +539,6 @@ switch ($mode) { insert_post('after_split_to_new', $new_topic_id, $new_forum_id, $forum_id, $new_topic_id, '', $topic_id); } - //bot end sync('topic', array($topic_id, $new_topic_id)); sync('forum', array($forum_id, $new_forum_id)); @@ -550,7 +546,6 @@ switch ($mode) //bot $message = $lang['TOPIC_SPLIT'] .'

'. $lang['TOPIC_SPLIT_OLD'] .''; $message .= '  ::  '. $lang['TOPIC_SPLIT_NEW'] .''; - //bot end // Log action $log_action->mod('mod_topic_split', array( @@ -562,24 +557,22 @@ switch ($mode) 'topic_title_new' => htmlCHR($_POST['subject']), )); - message_die(GENERAL_MESSAGE, $message); + bb_die($message); } } - //mpd elseif ($post_id_sql && $delete_posts) { if (!$is_auth['auth_delete']) { - message_die(GENERAL_MESSAGE, sprintf($lang['SORRY_AUTH_DELETE'], $is_auth['auth_delete_type'])); + bb_die(sprintf($lang['SORRY_AUTH_DELETE'], $is_auth['auth_delete_type'])); } // Delete posts $result = post_delete(explode(',', $post_id_sql)); $msg = ($result) ? $lang['DELETE_POSTS_SUCCESFULLY'] : 'No posts were removed'; - message_die(GENERAL_MESSAGE, return_msg_mcp($msg)); + bb_die(return_msg_mcp($msg)); } - //mpd end else { $sql = "SELECT u.username, p.*, pt.post_text, p.post_username @@ -590,7 +583,7 @@ switch ($mode) ORDER BY p.post_time ASC"; if ( !($result = DB()->sql_query($sql)) ) { - message_die(GENERAL_ERROR, 'Could not get topic/post information', '', __LINE__, __FILE__, $sql); + bb_die('Could not get topic / post information'); } $s_hidden_fields = ''; @@ -600,11 +593,11 @@ switch ($mode) $postrow = DB()->sql_fetchrowset($result); $template->assign_vars(array( - 'FORUM_NAME' => htmlCHR($forum_name), - 'U_VIEW_FORUM' => FORUM_URL . $forum_id, - 'S_SPLIT_ACTION' => "modcp.php", + 'FORUM_NAME' => htmlCHR($forum_name), + 'U_VIEW_FORUM' => FORUM_URL . $forum_id, + 'S_SPLIT_ACTION' => 'modcp.php', 'S_HIDDEN_FIELDS' => $s_hidden_fields, - 'S_FORUM_SELECT' => get_forum_select('admin', 'new_forum_id', $forum_id), + 'S_FORUM_SELECT' => get_forum_select('admin', 'new_forum_id', $forum_id), )); for($i = 0; $i < $total_posts; $i++) @@ -626,15 +619,14 @@ switch ($mode) $row_class = !($i % 2) ? 'row1' : 'row2'; $template->assign_block_vars('postrow', array( - 'ROW_CLASS' => $row_class, + 'ROW_CLASS' => $row_class, 'POSTER_NAME' => wbr($poster), - 'POST_DATE' => $post_date, - 'MESSAGE' => $message, - - 'CHECKBOX' => (defined('BEGIN_CHECKBOX')) ? TRUE : FALSE, - 'POST_ID' => $post_id, - 'ROW_ID' => $i, - 'CB_ID' => 'cb_'. $i + 'POST_DATE' => $post_date, + 'MESSAGE' => $message, + 'CHECKBOX' => (defined('BEGIN_CHECKBOX')) ? TRUE : FALSE, + 'POST_ID' => $post_id, + 'ROW_ID' => $i, + 'CB_ID' => 'cb_'. $i, )); if ($post_id == $topic_first_post_id) @@ -652,51 +644,43 @@ switch ($mode) $rdns_ip_num = ( isset($_GET['rdns']) ) ? $_GET['rdns'] : ""; - if ( !$post_id ) + if (!$post_id) { - message_die(GENERAL_MESSAGE, $lang['NO_SUCH_POST']); + bb_die($lang['NO_SUCH_POST']); } - // Look up relevent data for this post - $sql = "SELECT * - FROM " . BB_POSTS . " - WHERE post_id = $post_id - AND forum_id = $forum_id"; - if ( !($result = DB()->sql_query($sql)) ) + // Look up relevant data for this post + $sql = "SELECT * FROM " . BB_POSTS . " WHERE post_id = $post_id AND forum_id = $forum_id"; + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not get poster IP information', '', __LINE__, __FILE__, $sql); + bb_die('Could not get poster IP information'); } - if ( !($post_row = DB()->sql_fetchrow($result)) ) + if (!($post_row = DB()->sql_fetchrow($result))) { - message_die(GENERAL_MESSAGE, $lang['NO_SUCH_POST']); + bb_die($lang['NO_SUCH_POST']); } $ip_this_post = decode_ip($post_row['poster_ip']); - $ip_this_post = ( $rdns_ip_num == $ip_this_post ) ? gethostbyaddr($ip_this_post) : $ip_this_post; + $ip_this_post = ($rdns_ip_num == $ip_this_post) ? gethostbyaddr($ip_this_post) : $ip_this_post; $poster_id = $post_row['poster_id']; $template->assign_vars(array( - 'TPL_MODCP_IP' => true, - 'IP' => $ip_this_post, - 'U_LOOKUP_IP' => "modcp.php?mode=ip&" . POST_POST_URL . "=$post_id&" . POST_TOPIC_URL . "=$topic_id&rdns=$ip_this_post&sid=" . $userdata['session_id']) - ); + 'TPL_MODCP_IP' => true, + 'IP' => $ip_this_post, + 'U_LOOKUP_IP' => "modcp.php?mode=ip&" . POST_POST_URL . "=$post_id&" . POST_TOPIC_URL . "=$topic_id&rdns=$ip_this_post&sid=" . $userdata['session_id'], + )); // // Get other IP's this user has posted under // $where_sql = ($poster_id == $anon) ? "post_username = '{$post_row['post_username']}'" : "poster_id = $poster_id"; - $sql = "SELECT poster_ip, COUNT(*) AS postings - FROM " . BB_POSTS . " - WHERE $where_sql - GROUP BY poster_ip - ORDER BY postings DESC - LIMIT 100"; + $sql = "SELECT poster_ip, COUNT(*) AS postings FROM " . BB_POSTS . " WHERE $where_sql GROUP BY poster_ip ORDER BY postings DESC LIMIT 100"; if ( !($result = DB()->sql_query($sql)) ) { - message_die(GENERAL_ERROR, 'Could not get IP information for this user', '', __LINE__, __FILE__, $sql); + bb_die('Could not get IP information for this user'); } if ( $row = DB()->sql_fetchrow($result) ) @@ -742,7 +726,7 @@ switch ($mode) LIMIT 100"; if ( !($result = DB()->sql_query($sql)) ) { - message_die(GENERAL_ERROR, 'Could not get posters information based on IP', '', __LINE__, __FILE__, $sql); + bb_die('Could not get posters information based on IP'); } if ( $row = DB()->sql_fetchrow($result) ) @@ -795,7 +779,7 @@ switch ($mode) if (!$topic_csv = get_id_csv($topic_csv)) { - message_die(GENERAL_MESSAGE, $lang['NONE_SELECTED']); + bb_die($lang['NONE_SELECTED']); } DB()->query(" @@ -805,7 +789,7 @@ switch ($mode) "); $msg = ($pin) ? $lang['POST_PINNED'] : $lang['POST_UNPINNED']; - message_die(GENERAL_MESSAGE, return_msg_mcp($msg)); + bb_die(return_msg_mcp($msg)); } elseif ($topic_id) { @@ -829,7 +813,7 @@ switch ($mode) if (!$topic_csv = get_id_csv($topic_csv)) { - message_die(GENERAL_MESSAGE, $lang['NONE_SELECTED']); + bb_die($lang['NONE_SELECTED']); } DB()->query(" @@ -839,7 +823,7 @@ switch ($mode) "); $msg = ($pin) ? $lang['POST_PINNED'] : $lang['POST_UNPINNED']; - message_die(GENERAL_MESSAGE, return_msg_mcp($msg)); + bb_die(return_msg_mcp($msg)); } break; diff --git a/upload/posting.php b/upload/posting.php index a045cfd4e..82b42e45c 100644 --- a/upload/posting.php +++ b/upload/posting.php @@ -89,7 +89,7 @@ switch ($mode) break; default: - message_die(GENERAL_MESSAGE, $lang['NO_POST_MODE']); + bb_die($lang['NO_POST_MODE']); break; } @@ -103,7 +103,7 @@ switch ($mode) case 'new_rel': if (!$forum_id) { - message_die(GENERAL_MESSAGE, $lang['FORUM_NOT_EXIST']); + bb_die($lang['FORUM_NOT_EXIST']); } $sql = "SELECT * FROM ". BB_FORUMS ." WHERE forum_id = $forum_id LIMIT 1"; break; @@ -111,7 +111,7 @@ switch ($mode) case 'reply': if (!$topic_id) { - message_die(GENERAL_MESSAGE, $lang['NO_TOPIC_ID']); + bb_die($lang['NO_TOPIC_ID']); } $sql = "SELECT f.*, t.* FROM ". BB_FORUMS ." f, ". BB_TOPICS ." t @@ -125,7 +125,7 @@ switch ($mode) case 'delete': if (!$post_id) { - message_die(GENERAL_MESSAGE, $lang['NO_POST_ID']); + bb_die($lang['NO_POST_ID']); } $select_sql = 'SELECT f.*, t.*, p.*'; @@ -148,7 +148,7 @@ switch ($mode) break; default: - message_die(GENERAL_MESSAGE, $lang['NO_VALID_MODE']); + bb_die($lang['NO_VALID_MODE']); } if ($post_info = DB()->fetch_row($sql)) @@ -160,11 +160,11 @@ if ($post_info = DB()->fetch_row($sql)) if ($post_info['forum_status'] == FORUM_LOCKED && !$is_auth['auth_mod']) { - message_die(GENERAL_MESSAGE, $lang['FORUM_LOCKED']); + bb_die($lang['FORUM_LOCKED']); } elseif ($mode != 'newtopic' && $mode != 'new_rel' && $post_info['topic_status'] == TOPIC_LOCKED && !$is_auth['auth_mod']) { - message_die(GENERAL_MESSAGE, $lang['TOPIC_LOCKED']); + bb_die($lang['TOPIC_LOCKED']); } if ($mode == 'editpost' || $mode == 'delete') @@ -207,7 +207,7 @@ if ($post_info = DB()->fetch_row($sql)) } else { - message_die(GENERAL_MESSAGE, $lang['NO_SUCH_POST']); + bb_die($lang['NO_SUCH_POST']); } // The user is not authed, if they're not logged in then redirect @@ -216,7 +216,7 @@ if (!$is_auth[$is_auth_type]) { if (!IS_GUEST) { - message_die(GENERAL_MESSAGE, sprintf($lang['SORRY_'. strtoupper($is_auth_type)], $is_auth[$is_auth_type .'_type'])); + bb_die(sprintf($lang['SORRY_'. strtoupper($is_auth_type)], $is_auth[$is_auth_type .'_type'])); } switch ($mode) @@ -455,7 +455,7 @@ elseif ( ($submit || $confirm) && !$topic_has_new_posts ) $return_message = $locked_warn . $return_message; } - message_die(GENERAL_MESSAGE, $return_message); + bb_die($return_message); } } @@ -677,8 +677,8 @@ $template->assign_vars(array( 'S_TYPE_TOGGLE' => $topic_type_toggle, 'S_TOPIC_ID' => $topic_id, 'S_POST_ACTION' => POSTING_URL, - 'S_HIDDEN_FORM_FIELDS' => $hidden_form_fields) -); + 'S_HIDDEN_FORM_FIELDS' => $hidden_form_fields, +)); if ($mode == 'newtopic' || $post_data['first_post']) { diff --git a/upload/privmsg.php b/upload/privmsg.php index f140b4f34..2834d1cac 100644 --- a/upload/privmsg.php +++ b/upload/privmsg.php @@ -110,22 +110,18 @@ $savebox_url = ( $folder != 'savebox' || $mode != '' ) ? 'sql_query($sql)) ) { - message_die(GENERAL_ERROR, 'Could not query private message post information', '', __LINE__, __FILE__, $sql); + bb_die('Could not query private message post information'); } // @@ -202,12 +198,10 @@ if ( $mode == 'read' ) break; } - $sql = "UPDATE " . BB_USERS . " - SET $sql - WHERE user_id = " . $userdata['user_id']; + $sql = "UPDATE " . BB_USERS . " SET $sql WHERE user_id = " . $userdata['user_id']; if ( !DB()->sql_query($sql) ) { - message_die(GENERAL_ERROR, 'Could not update private message read status for user', '', __LINE__, __FILE__, $sql); + bb_die('Could not update private message read status for user'); } if (DB()->affected_rows()) { @@ -219,7 +213,7 @@ if ( $mode == 'read' ) WHERE privmsgs_id = " . $privmsg['privmsgs_id']; if ( !DB()->sql_query($sql) ) { - message_die(GENERAL_ERROR, 'Could not update private message read status', '', __LINE__, __FILE__, $sql); + bb_die('Could not update private message read status'); } // Check to see if the poster has a 'full' sent box @@ -227,9 +221,9 @@ if ( $mode == 'read' ) FROM " . BB_PRIVMSGS . " WHERE privmsgs_type = " . PRIVMSGS_SENT_MAIL . " AND privmsgs_from_userid = " . $privmsg['privmsgs_from_userid']; - if ( !($result = DB()->sql_query($sql)) ) + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not obtain sent message info for sendee', '', __LINE__, __FILE__, $sql); + bb_die('Could not obtain sent message info for sender'); } if ( $sent_info = DB()->sql_fetchrow($result) ) @@ -242,23 +236,21 @@ if ( $mode == 'read' ) AND privmsgs_from_userid = " . $privmsg['privmsgs_from_userid']; if ( !$result = DB()->sql_query($sql) ) { - message_die(GENERAL_ERROR, 'Could not find oldest privmsgs', '', __LINE__, __FILE__, $sql); + bb_die('Could not find oldest privmsgs'); } $old_privmsgs_id = DB()->sql_fetchrow($result); $old_privmsgs_id = (int) $old_privmsgs_id['privmsgs_id']; - $sql = "DELETE FROM " . BB_PRIVMSGS . " - WHERE privmsgs_id = $old_privmsgs_id"; - if ( !DB()->sql_query($sql) ) + $sql = "DELETE FROM " . BB_PRIVMSGS . " WHERE privmsgs_id = $old_privmsgs_id"; + if (!DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not delete oldest privmsgs (sent)', '', __LINE__, __FILE__, $sql); + bb_die('Could not delete oldest privmsgs (sent)'); } - $sql = "DELETE FROM " . BB_PRIVMSGS_TEXT . " - WHERE privmsgs_text_id = $old_privmsgs_id"; - if ( !DB()->sql_query($sql) ) + $sql = "DELETE FROM " . BB_PRIVMSGS_TEXT . " WHERE privmsgs_text_id = $old_privmsgs_id"; + if (!DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not delete oldest privmsgs text (sent)', '', __LINE__, __FILE__, $sql); + bb_die('Could not delete oldest privmsgs text (sent)'); } } } @@ -270,18 +262,18 @@ if ( $mode == 'read' ) // $sql = "INSERT INTO " . BB_PRIVMSGS . " (privmsgs_type, privmsgs_subject, privmsgs_from_userid, privmsgs_to_userid, privmsgs_date, privmsgs_ip) VALUES (" . PRIVMSGS_SENT_MAIL . ", '" . DB()->escape($privmsg['privmsgs_subject']) . "', " . $privmsg['privmsgs_from_userid'] . ", " . $privmsg['privmsgs_to_userid'] . ", " . $privmsg['privmsgs_date'] . ", '" . $privmsg['privmsgs_ip'] . "')"; - if ( !DB()->sql_query($sql) ) + if (!DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not insert private message sent info', '', __LINE__, __FILE__, $sql); + bb_die('Could not insert private message sent info'); } $privmsg_sent_id = DB()->sql_nextid(); $sql = "INSERT INTO " . BB_PRIVMSGS_TEXT . " (privmsgs_text_id, privmsgs_text) VALUES ($privmsg_sent_id, '" . DB()->escape($privmsg['privmsgs_text']) . "')"; - if ( !DB()->sql_query($sql) ) + if (!DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not insert private message sent text', '', __LINE__, __FILE__, $sql); + bb_die('Could not insert private message sent text'); } } @@ -393,8 +385,8 @@ if ( $mode == 'read' ) $template->assign_vars(array( 'REPORT_PM_IMG' => $report_img, - 'REPORT_PM' => $report) - ); + 'REPORT_PM' => $report, + )); } } // Report [END] @@ -428,8 +420,8 @@ if ( $mode == 'read' ) 'BOX_NAME' => $l_box_name, 'S_PRIVMSGS_ACTION' => PM_URL . "?folder=$folder", - 'S_HIDDEN_FIELDS' => $s_hidden_fields) - ); + 'S_HIDDEN_FIELDS' => $s_hidden_fields, + )); $username_from = $privmsg['username']; $user_id_from = $privmsg['user_id']; @@ -556,12 +548,10 @@ else if ( ( $delete && $mark_list ) || $delete_all ) break; } - $sql = "SELECT privmsgs_id - FROM " . BB_PRIVMSGS . " - WHERE $delete_type $delete_sql_id"; - if ( !($result = DB()->sql_query($sql)) ) + $sql = "SELECT privmsgs_id FROM " . BB_PRIVMSGS . " WHERE $delete_type $delete_sql_id"; + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not obtain id list to delete messages', '', __LINE__, __FILE__, $sql); + bb_die('Could not obtain id list to delete messages'); } $mark_list = array(); @@ -601,7 +591,7 @@ else if ( ( $delete && $mark_list ) || $delete_all ) AND privmsgs_type IN (" . PRIVMSGS_NEW_MAIL . ", " . PRIVMSGS_UNREAD_MAIL . ")"; if ( !($result = DB()->sql_query($sql)) ) { - message_die(GENERAL_ERROR, 'Could not obtain user id list for outbox messages', '', __LINE__, __FILE__, $sql); + bb_die('Could not obtain user id list for outbox messages'); } if ( $row = DB()->sql_fetchrow($result)) @@ -656,7 +646,7 @@ else if ( ( $delete && $mark_list ) || $delete_all ) WHERE user_id IN ($user_ids)"; if ( !DB()->sql_query($sql) ) { - message_die(GENERAL_ERROR, 'Could not update user pm counters', '', __LINE__, __FILE__, $sql); + bb_die('Could not update user pm counters'); } } } @@ -699,19 +689,19 @@ else if ( ( $delete && $mark_list ) || $delete_all ) if ( !DB()->sql_query($delete_sql) ) { - message_die(GENERAL_ERROR, 'Could not delete private message info', '', __LINE__, __FILE__, $delete_sql); + bb_die('Could not delete private message info'); } if ( !DB()->sql_query($delete_text_sql) ) { - message_die(GENERAL_ERROR, 'Could not delete private message text', '', __LINE__, __FILE__, $delete_text_sql); + bb_die('Could not delete private message text'); } - pm_message_die($lang['DELETE_POSTS_SUCCESFULLY']); + pm_die($lang['DELETE_POSTS_SUCCESFULLY']); } else { - pm_message_die($lang['NONE_SELECTED']); + pm_die($lang['NONE_SELECTED']); } } } @@ -728,7 +718,7 @@ else if ( $save && $mark_list && $folder != 'savebox' && $folder != 'outbox' ) AND privmsgs_type = " . PRIVMSGS_SAVED_OUT_MAIL . ") )"; if ( !($result = DB()->sql_query($sql)) ) { - message_die(GENERAL_ERROR, 'Could not obtain sent message info for sendee', '', __LINE__, __FILE__, $sql); + bb_die('Could not obtain sent message info for sender'); } if ( $saved_info = DB()->sql_fetchrow($result) ) @@ -743,23 +733,21 @@ else if ( $save && $mark_list && $folder != 'savebox' && $folder != 'outbox' ) AND privmsgs_date = " . $saved_info['oldest_post_time']; if ( !$result = DB()->sql_query($sql) ) { - message_die(GENERAL_ERROR, 'Could not find oldest privmsgs (save)', '', __LINE__, __FILE__, $sql); + bb_die('Could not find oldest privmsgs (save)'); } $old_privmsgs_id = DB()->sql_fetchrow($result); $old_privmsgs_id = (int) $old_privmsgs_id['privmsgs_id']; - $sql = "DELETE FROM " . BB_PRIVMSGS . " - WHERE privmsgs_id = $old_privmsgs_id"; - if ( !DB()->sql_query($sql) ) + $sql = "DELETE FROM " . BB_PRIVMSGS . " WHERE privmsgs_id = $old_privmsgs_id"; + if (!DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not delete oldest privmsgs (save)', '', __LINE__, __FILE__, $sql); + bb_die('Could not delete oldest privmsgs (save)'); } - $sql = "DELETE FROM " . BB_PRIVMSGS_TEXT . " - WHERE privmsgs_text_id = $old_privmsgs_id"; - if ( !DB()->sql_query($sql) ) + $sql = "DELETE FROM " . BB_PRIVMSGS_TEXT . " WHERE privmsgs_text_id = $old_privmsgs_id"; + if (!DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not delete oldest privmsgs text (save)', '', __LINE__, __FILE__, $sql); + bb_die('Could not delete oldest privmsgs text (save)'); } } } @@ -793,9 +781,9 @@ else if ( $save && $mark_list && $folder != 'savebox' && $folder != 'outbox' ) WHERE privmsgs_id IN ($saved_sql_id) AND $sql AND privmsgs_type IN (" . PRIVMSGS_NEW_MAIL . ", " . PRIVMSGS_UNREAD_MAIL . ")"; - if ( !($result = DB()->sql_query($sql)) ) + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not obtain user id list for outbox messages', '', __LINE__, __FILE__, $sql); + bb_die('Could not obtain user id list for outbox messages'); } if ( $row = DB()->sql_fetchrow($result)) @@ -845,12 +833,10 @@ else if ( $save && $mark_list && $folder != 'savebox' && $folder != 'outbox' ) { $user_ids = join(', ', $user_ary); - $sql = "UPDATE " . BB_USERS . " - SET $type = $type - $dec - WHERE user_id IN ($user_ids)"; - if ( !DB()->sql_query($sql) ) + $sql = "UPDATE " . BB_USERS . " SET $type = $type - $dec WHERE user_id IN ($user_ids)"; + if (!DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not update user pm counters', '', __LINE__, __FILE__, $sql); + bb_die('Could not update user pm counters'); } } } @@ -886,9 +872,9 @@ else if ( $save && $mark_list && $folder != 'savebox' && $folder != 'outbox' ) $saved_sql .= " AND privmsgs_id IN ($saved_sql_id)"; - if ( !DB()->sql_query($saved_sql) ) + if (!DB()->sql_query($saved_sql)) { - message_die(GENERAL_ERROR, 'Could not save private messages', '', __LINE__, __FILE__, $saved_sql); + bb_die('Could not save private messages'); } redirect(PM_URL . "?folder=savebox"); @@ -898,12 +884,8 @@ else if ( $submit || $refresh || $mode != '' ) { if (IS_USER && $submit && $mode != 'edit') { - // // Flood control - // - $sql = "SELECT MAX(privmsgs_date) AS last_post_time - FROM " . BB_PRIVMSGS . " - WHERE privmsgs_from_userid = " . $userdata['user_id']; + $sql = "SELECT MAX(privmsgs_date) AS last_post_time FROM " . BB_PRIVMSGS . " WHERE privmsgs_from_userid = " . $userdata['user_id']; if ( $result = DB()->sql_query($sql) ) { $db_row = DB()->sql_fetchrow($result); @@ -911,14 +893,11 @@ else if ( $submit || $refresh || $mode != '' ) $last_post_time = $db_row['last_post_time']; $current_time = TIMENOW; - if ( ( $current_time - $last_post_time ) < $bb_cfg['flood_interval']) + if (($current_time - $last_post_time) < $bb_cfg['flood_interval']) { - message_die(GENERAL_MESSAGE, $lang['FLOOD_ERROR']); + bb_die($lang['FLOOD_ERROR']); } } - // - // End Flood control - // } if ($submit && $mode == 'edit') @@ -930,12 +909,12 @@ else if ( $submit || $refresh || $mode != '' ) if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, "Could not obtain message details", "", __LINE__, __FILE__, $sql); + bb_die('Could not obtain message details'); } if (!($row = DB()->sql_fetchrow($result))) { - message_die(GENERAL_MESSAGE, $lang['NO_SUCH_POST']); + bb_die($lang['NO_SUCH_POST']); } DB()->sql_freeresult($result); @@ -947,9 +926,7 @@ else if ( $submit || $refresh || $mode != '' ) if ( !empty($_POST['username']) ) { $to_username = clean_username($_POST['username']); - // DelUsrKeepPM $to_username_sql = DB()->escape($to_username); - $to_userdata = get_userdata ($to_username_sql); if (!$to_userdata || $to_userdata['user_id'] == GUEST_UID) @@ -957,7 +934,6 @@ else if ( $submit || $refresh || $mode != '' ) $error = TRUE; $error_msg = $lang['NO_SUCH_USER']; } - // DelUsrKeepPM end } else { @@ -1000,18 +976,16 @@ else if ( $submit || $refresh || $mode != '' ) if ( $mode != 'edit' ) { - // // See if recipient is at their inbox limit - // $sql = "SELECT COUNT(privmsgs_id) AS inbox_items, MIN(privmsgs_date) AS oldest_post_time FROM " . BB_PRIVMSGS . " WHERE ( privmsgs_type = " . PRIVMSGS_NEW_MAIL . " OR privmsgs_type = " . PRIVMSGS_READ_MAIL . " OR privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . " ) AND privmsgs_to_userid = " . $to_userdata['user_id']; - if ( !($result = DB()->sql_query($sql)) ) + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_MESSAGE, $lang['NO_SUCH_USER']); + bb_die($lang['NO_SUCH_USER']); } if ( $inbox_info = DB()->sql_fetchrow($result) ) @@ -1026,23 +1000,21 @@ else if ( $submit || $refresh || $mode != '' ) AND privmsgs_to_userid = " . $to_userdata['user_id']; if ( !$result = DB()->sql_query($sql) ) { - message_die(GENERAL_ERROR, 'Could not find oldest privmsgs (inbox)', '', __LINE__, __FILE__, $sql); + bb_die('Could not find oldest privmsgs (inbox)'); } $old_privmsgs_id = DB()->sql_fetchrow($result); $old_privmsgs_id = (int) $old_privmsgs_id['privmsgs_id']; - $sql = "DELETE FROM " . BB_PRIVMSGS . " - WHERE privmsgs_id = $old_privmsgs_id"; - if ( !DB()->sql_query($sql) ) + $sql = "DELETE FROM " . BB_PRIVMSGS . " WHERE privmsgs_id = $old_privmsgs_id"; + if (!DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not delete oldest privmsgs (inbox)'.$sql, '', __LINE__, __FILE__, $sql); + bb_die('Could not delete oldest privmsgs (inbox)'); } - $sql = "DELETE FROM " . BB_PRIVMSGS_TEXT . " - WHERE privmsgs_text_id = $old_privmsgs_id"; - if ( !DB()->sql_query($sql) ) + $sql = "DELETE FROM " . BB_PRIVMSGS_TEXT . " WHERE privmsgs_text_id = $old_privmsgs_id"; + if (!DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not delete oldest privmsgs text (inbox)', '', __LINE__, __FILE__, $sql); + bb_die('Could not delete oldest privmsgs text (inbox)'); } } } @@ -1057,9 +1029,9 @@ else if ( $submit || $refresh || $mode != '' ) WHERE privmsgs_id = $privmsg_id"; } - if ( !($result = DB()->sql_query($sql_info)) ) + if (!($result = DB()->sql_query($sql_info))) { - message_die(GENERAL_ERROR, "Could not insert/update private message sent info.", "", __LINE__, __FILE__, $sql_info); + bb_die('Could not insert / update private message sent info'); } if ( $mode != 'edit' ) @@ -1076,17 +1048,15 @@ else if ( $submit || $refresh || $mode != '' ) WHERE privmsgs_text_id = $privmsg_id"; } - if ( !DB()->sql_query($sql) ) + if (!DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, "Could not insert/update private message sent text.", "", __LINE__, __FILE__, $sql_info); + bb_die('Could not insert / update private message sent text'); } if ( $mode != 'edit' ) { $timenow = TIMENOW; - // // Add to the users new pm counter - // $sql = "UPDATE ". BB_USERS ." SET user_new_privmsg = user_new_privmsg + 1, user_last_privmsg = $timenow, @@ -1094,9 +1064,9 @@ else if ( $submit || $refresh || $mode != '' ) WHERE user_id = {$to_userdata['user_id']} LIMIT 1"; - if ( !$status = DB()->sql_query($sql) ) + if (!$status = DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, 'Could not update private message new/read status for user', '', __LINE__, __FILE__, $sql); + bb_die('Could not update private message new / read status for user'); } cache_rm_user_sessions ($to_userdata['user_id']); @@ -1124,7 +1094,7 @@ else if ( $submit || $refresh || $mode != '' ) } } - pm_message_die($lang['MESSAGE_SENT']); + pm_die($lang['MESSAGE_SENT']); } else if ( $preview || $refresh || $error ) { @@ -1157,42 +1127,39 @@ else if ( $submit || $refresh || $mode != '' ) FROM " . BB_PRIVMSGS . " pm, " . BB_USERS . " u WHERE pm.privmsgs_id = $privmsg_id AND u.user_id = pm.privmsgs_from_userid"; - if ( !($result = DB()->sql_query($sql)) ) + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, "Could not obtain post and post text", "", __LINE__, __FILE__, $sql); + bb_die('Could not obtain post and post text'); } - if ( $postrow = DB()->sql_fetchrow($result) ) + if ($postrow = DB()->sql_fetchrow($result)) { - if ( $userdata['user_id'] != $postrow['user_id'] ) + if ($userdata['user_id'] != $postrow['user_id']) { - message_die(GENERAL_MESSAGE, $lang['EDIT_OWN_POSTS']); + bb_die($lang['EDIT_OWN_POSTS']); } } } } else { - if ( !$privmsg_id && ( $mode == 'reply' || $mode == 'edit' || $mode == 'quote' ) ) + if (!$privmsg_id && ($mode == 'reply' || $mode == 'edit' || $mode == 'quote')) { - message_die(GENERAL_ERROR, $lang['NO_POST_ID']); + bb_die($lang['NO_POST_ID']); } - if ( !empty($_GET[POST_USERS_URL]) ) + if (!empty($_GET[POST_USERS_URL])) { $user_id = intval($_GET[POST_USERS_URL]); - $sql = "SELECT username - FROM " . BB_USERS . " - WHERE user_id = $user_id - AND user_id <> " . GUEST_UID; - if ( !($result = DB()->sql_query($sql)) ) + $sql = "SELECT username FROM " . BB_USERS . " WHERE user_id = $user_id AND user_id <> " . GUEST_UID; + if (!($result = DB()->sql_query($sql))) { $error = TRUE; $error_msg = $lang['NO_SUCH_USER']; } - if ( $row = DB()->sql_fetchrow($result) ) + if ($row = DB()->sql_fetchrow($result)) { $to_username = $row['username']; } @@ -1210,7 +1177,7 @@ else if ( $submit || $refresh || $mode != '' ) AND u.user_id = pm.privmsgs_to_userid"; if ( !($result = DB()->sql_query($sql)) ) { - message_die(GENERAL_ERROR, 'Could not obtain private message for editing', '', __LINE__, __FILE__, $sql); + bb_die('Could not obtain private message for editing #1'); } if ( !($privmsg = DB()->sql_fetchrow($result)) ) @@ -1234,12 +1201,12 @@ else if ( $submit || $refresh || $mode != '' ) AND pmt.privmsgs_text_id = pm.privmsgs_id AND pm.privmsgs_to_userid = " . $userdata['user_id'] . " AND u.user_id = pm.privmsgs_from_userid"; - if ( !($result = DB()->sql_query($sql)) ) + if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not obtain private message for editing', '', __LINE__, __FILE__, $sql); + bb_die('Could not obtain private message for editing #2'); } - if ( !($privmsg = DB()->sql_fetchrow($result)) ) + if (!($privmsg = DB()->sql_fetchrow($result))) { redirect(PM_URL . "?folder=$folder"); } @@ -1414,7 +1381,7 @@ else AND privmsgs_to_userid = " . $userdata['user_id']; if ( !DB()->sql_query($sql) ) { - message_die(GENERAL_ERROR, 'Could not update private message new/read status (2) for user', '', __LINE__, __FILE__, $sql); + bb_die('Could not update private message new / read status (2) for user'); } // @@ -1493,7 +1460,7 @@ else break; default: - message_die(GENERAL_MESSAGE, $lang['NO_SUCH_FOLDER']); + bb_die($lang['NO_SUCH_FOLDER']); break; } @@ -1528,14 +1495,14 @@ else // if ( !($result = DB()->sql_query($sql_tot)) ) { - message_die(GENERAL_ERROR, 'Could not query private message information', '', __LINE__, __FILE__, $sql_tot); + bb_die('Could not query private message information #1'); } $pm_total = ( $row = DB()->sql_fetchrow($result) ) ? $row['total'] : 0; if ( !($result = DB()->sql_query($sql_all_tot)) ) { - message_die(GENERAL_ERROR, 'Could not query private message information', '', __LINE__, __FILE__, $sql_tot); + bb_die('Could not query private message information #2'); } $pm_all_total = ( $row = DB()->sql_fetchrow($result) ) ? $row['total'] : 0; @@ -1632,15 +1599,15 @@ else 'S_POST_NEW_MSG' => $post_new_mesg_url, 'S_SELECT_MSG_DAYS' => $select_msg_days, - 'U_POST_NEW_TOPIC' => PM_URL . "?mode=post") - ); + 'U_POST_NEW_TOPIC' => PM_URL . "?mode=post", + )); // // Okay, let's build the correct folder // if ( !($result = DB()->sql_query($sql)) ) { - message_die(GENERAL_ERROR, 'Could not query private messages', '', __LINE__, __FILE__, $sql); + bb_die('Could not query private messages'); } if ( $row = DB()->sql_fetchrow($result) ) @@ -1715,7 +1682,7 @@ require(PAGE_FOOTER); // // Functions // -function pm_message_die ($msg) +function pm_die ($msg) { global $lang; @@ -1727,5 +1694,5 @@ function pm_message_die ($msg) $msg .= '

'; $msg .= sprintf($lang['CLICK_RETURN_INDEX'], '
', ''); - message_die(GENERAL_MESSAGE, $msg); + bb_die($msg); } \ No newline at end of file diff --git a/upload/report.php b/upload/report.php index 324bd0857..2252092b2 100644 --- a/upload/report.php +++ b/upload/report.php @@ -67,11 +67,11 @@ if (isset($report_module)) // if (!$report_module->auth_check('auth_write')) { - message_die(GENERAL_MESSAGE, $report_module->lang['AUTH_WRITE_ERROR'] . $report_module->return_link($report_subject_id) . $return_links['index']); + bb_die($report_module->lang['AUTH_WRITE_ERROR'] . $report_module->return_link($report_subject_id) . $return_links['index']); } else if (!$report_module->duplicates && report_duplicate_check($report_module->id, $report_subject_id)) { - message_die(GENERAL_MESSAGE, $report_module->lang['DUPLICATE_ERROR'] . $report_module->return_link($report_subject_id) . $return_links['index']); + bb_die($report_module->lang['DUPLICATE_ERROR'] . $report_module->return_link($report_subject_id) . $return_links['index']); } if (isset($_POST['submit'])) @@ -115,7 +115,7 @@ if (isset($report_module)) report_insert($report_module->id, $report_subject_id, $report_reason, $report_title, $report_desc, false); - message_die(GENERAL_MESSAGE, $lang['REPORT_INSERTED'] . $report_module->return_link($report_subject_id) . $return_links['index']); + bb_die($lang['REPORT_INSERTED'] . $report_module->return_link($report_subject_id) . $return_links['index']); } } else if (isset($_POST['cancel'])) @@ -139,8 +139,8 @@ if (isset($report_module)) foreach ($errors as $error) { $template->assign_block_vars('switch_report_errors.report_errors', array( - 'MESSAGE' => $error) - ); + 'MESSAGE' => $error, + )); } } @@ -156,8 +156,8 @@ if (isset($report_module)) $template->assign_block_vars('switch_report_reasons.report_reasons', array( 'ID' => $reason_id, 'DESC' => $reason_desc, - 'CHECKED' => (isset($report_reason) && $report_reason == $reason_id) ? ' selected="selected"' : '') - ); + 'CHECKED' => (isset($report_reason) && $report_reason == $reason_id) ? ' selected="selected"' : '', + )); } } @@ -179,7 +179,7 @@ if (isset($report_module)) } else { - message_die(GENERAL_MESSAGE, $report_module->lang['WRITE_REPORT_ERROR'] . $return_links['index']); + bb_die($report_module->lang['WRITE_REPORT_ERROR'] . $return_links['index']); } } // @@ -199,8 +199,8 @@ if (isset($report_module)) 'L_WRITE_REPORT' => $report_module->lang['WRITE_REPORT'], 'L_WRITE_REPORT_EXPLAIN' => $report_module->lang['WRITE_REPORT_EXPLAIN'], 'REPORT_TITLE' => (!method_exists($report_module, 'subject_obtain') && isset($report_title)) ? stripslashes($report_title) : '', - 'REPORT_DESC' => (isset($report_desc)) ? stripslashes($report_desc) : '') - ); + 'REPORT_DESC' => (isset($report_desc)) ? stripslashes($report_desc) : '', + )); $template->pparse('body'); include(PAGE_FOOTER); @@ -260,7 +260,7 @@ else if (empty($reports)) { meta_refresh('report.php', 3); - message_die(GENERAL_MESSAGE, $lang['NO_REPORTS_SELECTED'] . $return_links['list'] . $return_links['index']); + bb_die($lang['NO_REPORTS_SELECTED'] . $return_links['list'] . $return_links['index']); } // @@ -290,8 +290,8 @@ else $template->assign_vars(array( 'S_CONFIRM_ACTION' => "report.php", - 'S_HIDDEN_FIELDS' => $hidden_fields) - ); + 'S_HIDDEN_FIELDS' => $hidden_fields, + )); // // Change reports status @@ -325,20 +325,20 @@ else $return_link = ($single_report) ? '

' . sprintf($lang['CLICK_RETURN_REPORT'], '', '') : ''; $message = ($single_report) ? 'REPORT_CHANGED' : 'REPORTS_CHANGED'; - message_die(GENERAL_MESSAGE, $lang[$message] . $return_link . $return_links['list'] . $return_links['index']); + bb_die($lang[$message] . $return_link . $return_links['list'] . $return_links['index']); } $page_title = ($single_report) ? $lang['CHANGE_REPORT'] : $lang['CHANGE_REPORTS']; include(PAGE_HEADER); $template->set_filenames(array( - 'body' => 'report_change_body.tpl') - ); + 'body' => 'report_change_body.tpl', + )); $template->assign_vars(array( 'MESSAGE_TITLE' => $page_title, - 'MESSAGE_TEXT' => ($single_report) ? $lang['CHANGE_REPORT_EXPLAIN'] : $lang['CHANGE_REPORTS_EXPLAIN']) - ); + 'MESSAGE_TEXT' => ($single_report) ? $lang['CHANGE_REPORT_EXPLAIN'] : $lang['CHANGE_REPORTS_EXPLAIN'], + )); $template->pparse('body'); include(PAGE_FOOTER); @@ -351,14 +351,12 @@ else if (isset($_POST['confirm'])) { reports_delete($reports); - - meta_refresh('report.php', 3); - + meta_refresh('report.php', 3); $message = ($single_report) ? 'REPORT_DELETED' : 'REPORTS_DELETED'; - message_die(GENERAL_MESSAGE, $lang[$message] . $return_links['list'] . $return_links['index']); + bb_die($lang[$message] . $return_links['list'] . $return_links['index']); } - print_confirmation(array( + print_confirmation(array( 'CONFIRM_TITLE' => ($single_report) ? $lang['DELETE_REPORT'] : $lang['DELETE_REPORTS'], 'QUESTION' => ($single_report) ? $lang['DELETE_REPORT_EXPLAIN'] : $lang['DELETE_REPORTS_EXPLAIN'], 'FORM_ACTION' => "report.php", @@ -373,7 +371,7 @@ else if (empty($cat) || empty($report_subject_id) || !isset($report_modules[$cat])) { - message_die(GENERAL_MESSAGE, $lang['REPORT_NOT_SUPPORTED'] . $return_links['index']); + bb_die($lang['REPORT_NOT_SUPPORTED'] . $return_links['index']); } $report_module =& $report_modules[$cat]; @@ -389,7 +387,7 @@ else $report_module->sync(); } - message_die(GENERAL_MESSAGE, $lang['NO_REPORTS_FOUND'] . $report_module->return_link($report_subject_id) . $return_links['index']); + bb_die($lang['NO_REPORTS_FOUND'] . $report_module->return_link($report_subject_id) . $return_links['index']); } // // Redirect to the open report @@ -403,16 +401,16 @@ else $page_title = $lang['OPEN_REPORTS']; include(PAGE_HEADER); $template->set_filenames(array( - 'body' => 'report_open_body.tpl') - ); + 'body' => 'report_open_body.tpl', + )); $template->assign_vars(array( 'S_REPORT_ACTION', "report.php", 'L_STATUS_CLEARED' => $lang['REPORT_STATUS'][REPORT_CLEARED], 'L_STATUS_IN_PROCESS' => $lang['REPORT_STATUS'][REPORT_IN_PROCESS], - 'L_STATUS_OPEN' => $lang['REPORT_STATUS'][REPORT_OPEN]) - ); + 'L_STATUS_OPEN' => $lang['REPORT_STATUS'][REPORT_OPEN], + )); // // Show list with open reports @@ -425,8 +423,8 @@ else 'ID' => $report['report_id'], 'TITLE' => $report['report_title'], 'AUTHOR' => profile_url($report), - 'TIME' => bb_date($report['report_time'])) - ); + 'TIME' => bb_date($report['report_time']), + )); } $template->pparse('body'); @@ -447,8 +445,8 @@ else 'L_STATUS_CLEARED' => $lang['REPORT_STATUS'][REPORT_CLEARED], 'L_STATUS_IN_PROCESS' => $lang['REPORT_STATUS'][REPORT_IN_PROCESS], - 'L_STATUS_OPEN' => $lang['REPORT_STATUS'][REPORT_OPEN]) - ); + 'L_STATUS_OPEN' => $lang['REPORT_STATUS'][REPORT_OPEN], + )); $cat = (isset($_GET[POST_CAT_URL])) ? (int) $_GET[POST_CAT_URL] : null; $cat_url = (!empty($cat)) ? '&' . POST_CAT_URL . "=$cat" : ''; @@ -473,9 +471,8 @@ else $template->assign_block_vars('report_modules', array( 'U_SHOW' => "report.php?" . POST_CAT_URL . '=' . $report_module->id, - - 'TITLE' => $report_module->lang['REPORT_LIST_TITLE']) - ); + 'TITLE' => $report_module->lang['REPORT_LIST_TITLE'], + )); // // No reports in this category, display no reports message @@ -505,14 +502,13 @@ else { $template->assign_block_vars('report_modules.reports', array( 'U_SHOW' => "report.php?" . POST_REPORT_URL . '=' . $report['report_id'] . $cat_url, - 'ROW_CLASS' => $report_status_classes[$report['report_status']], 'ID' => $report['report_id'], 'TITLE' => (strlen($report['report_title'] > 53)) ? substr($report['report_title'], 0, 50) . '...' : $report['report_title'], 'AUTHOR' => profile_url($report), 'TIME' => bb_date($report['report_time']), - 'STATUS' => $lang['REPORT_STATUS'][$report['report_status']]) - ); + 'STATUS' => $lang['REPORT_STATUS'][$report['report_status']], + )); if (isset($_GET[POST_REPORT_URL]) && $_GET[POST_REPORT_URL] == $report['report_id']) { @@ -537,7 +533,7 @@ else if (!$report = report_obtain((int) $_GET[POST_REPORT_URL])) { - message_die(GENERAL_MESSAGE, $lang['REPORT_NOT_EXISTS'] . $return_links['list'] . $return_links['index']); + bb_die($lang['REPORT_NOT_EXISTS'] . $return_links['list'] . $return_links['index']); } if ($report['report_status'] == REPORT_NEW) @@ -572,8 +568,8 @@ else $template->assign_block_vars('report_subject.switch_subject.switch_url', array()); $template->assign_vars(array( 'S_REPORT_SUBJECT_TARGET' => ($bb_cfg['report_new_window']) ? ' target="_blank"' : '', - 'U_REPORT_SUBJECT' => $report_module->subject_url($report['report_subject'])) - ); + 'U_REPORT_SUBJECT' => $report_module->subject_url($report['report_subject']), + )); } } @@ -586,8 +582,8 @@ else { $template->assign_block_vars('report_subject.details', array( 'TITLE' => $report_module->lang[strtoupper($detail_title)], - 'VALUE' => $detail_value) - ); + 'VALUE' => $detail_value, + )); } } } @@ -613,8 +609,8 @@ else $template->assign_block_vars('report_subject.switch_subject.switch_url', array()); $template->assign_vars(array( 'S_REPORT_SUBJECT_TARGET' => ($bb_cfg['report_new_window']) ? ' target="_blank"' : '', - 'U_REPORT_SUBJECT' => $report_module->subject_url($report['report_subject'])) - ); + 'U_REPORT_SUBJECT' => $report_module->subject_url($report['report_subject']), + )); } } else @@ -669,9 +665,8 @@ else 'STATUS' => $report_change_status, 'USER' => $report_change_user, 'TIME' => $report_change_time, - - 'TEXT' => $report_change_text) - ); + 'TEXT' => $report_change_text, + )); } // @@ -679,8 +674,8 @@ else // $template->assign_vars(array( 'REPORT_LAST_CHANGE_TIME' => $report_change_time, - 'REPORT_LAST_CHANGE_USER' => profile_url($report_change)) - ); + 'REPORT_LAST_CHANGE_USER' => profile_url($report_change), + )); } // @@ -693,17 +688,15 @@ else $template->assign_vars(array( 'S_HIDDEN_FIELDS' => '', - 'U_REPORT_AUTHOR_PRIVMSG' => PM_URL . "?mode=post&" . POST_USERS_URL . '=' . $report['user_id'], - 'REPORT_TYPE' => $report_module->lang['REPORT_TYPE'], 'REPORT_TITLE' => $report['report_title'], 'REPORT_AUTHOR' => profile_url($report), 'REPORT_TIME' => bb_date($report['report_time']), 'REPORT_DESC' => bbcode2html($report['report_desc']), 'REPORT_STATUS' => $lang['REPORT_STATUS'][$report['report_status']], - 'REPORT_STATUS_CLASS' => $report_status_classes[$report['report_status']]) - ); + 'REPORT_STATUS_CLASS' => $report_status_classes[$report['report_status']], + )); } // // Show report index page @@ -722,14 +715,10 @@ else { $template->assign_block_vars('report_statistics', array( 'STATISTIC' => $lang[strtoupper($stat_lang)], - 'VALUE' => report_statistics($stat_mode)) - ); + 'VALUE' => report_statistics($stat_mode), + )); } - /* - if ($userdata['user_level'] == ADMIN) - { - */ $deleted_reports = reports_deleted_obtain(); if (!empty($deleted_reports)) { @@ -740,19 +729,15 @@ else $template->assign_block_vars('switch_deleted_reports.deleted_reports', array( 'U_SHOW' => "report.php?" . POST_REPORT_URL . '=' . $report['report_id'] . $cat_url, - 'ID' => $report['report_id'], 'TITLE' => $report['report_title'], 'TYPE' => $report_module->lang['REPORT_TYPE'], 'AUTHOR' => profile_url($report), 'TIME' => bb_date($report['report_time']), - 'STATUS' => $lang['REPORT_STATUS'][REPORT_DELETE]) - ); + 'STATUS' => $lang['REPORT_STATUS'][REPORT_DELETE], + )); } } - /* - } - */ } $template->assign_var_from_handle('REPORT_VIEW', 'report_view'); @@ -762,7 +747,7 @@ else break; default: - message_die(GENERAL_MESSAGE, $lang['REPORT_NOT_SUPPORTED'] . $return_links['index']); + bb_die($lang['REPORT_NOT_SUPPORTED'] . $return_links['index']); break; } } \ No newline at end of file diff --git a/upload/search.php b/upload/search.php index 6b789e84e..003a2074e 100644 --- a/upload/search.php +++ b/upload/search.php @@ -851,7 +851,7 @@ redirect(basename(__FILE__)); // ----------------------------------------------------------- // // Functions // -function fetch_search_ids ($sql, $search_type = SEARCH_TYPE_POST, $redirect_to_result = UA_IE) +function fetch_search_ids ($sql, $search_type = SEARCH_TYPE_POST) { global $lang, $search_id, $session_id, $items_found, $per_page; @@ -867,9 +867,8 @@ function fetch_search_ids ($sql, $search_type = SEARCH_TYPE_POST, $redirect_to_r // Save results in DB $search_id = make_rand_str(SEARCH_ID_LENGTH); - $redirect = ($redirect_to_result && isset($_POST['submit'])); - if ($items_count > $per_page || $redirect) + if ($items_count > $per_page) { $search_array = join(',', $items_found); @@ -897,11 +896,6 @@ function fetch_search_ids ($sql, $search_type = SEARCH_TYPE_POST, $redirect_to_r DB()->query("REPLACE INTO ". BB_SEARCH ." ($columns) VALUES ($values)"); } - if ($redirect) - { - redirect("search.php?id=$search_id"); - } - return array_slice($items_found, 0, $per_page); } diff --git a/upload/templates/admin/admin_attachments.tpl b/upload/templates/admin/admin_attachments.tpl index 1c847cc00..7fd29f5b5 100644 --- a/upload/templates/admin/admin_attachments.tpl +++ b/upload/templates/admin/admin_attachments.tpl @@ -1,4 +1,3 @@ - @@ -140,48 +139,6 @@ {L_PM_ATTACHMENTS}
{L_PM_ATTACHMENTS_EXPLAIN} {L_YES}   {L_NO} - - - {L_FTP_UPLOAD}
{L_FTP_UPLOAD_EXPLAIN} - {L_YES}   {L_NO} - - - {L_FTP_INFO} - - - {L_FTP_SERVER}
{L_FTP_SERVER_EXPLAIN} - - - - {L_ATTACH_FTP_PATH}
{L_ATTACH_FTP_PATH_EXPLAIN} - - - - {L_FTP_DOWNLOAD_PATH}
{L_FTP_DOWNLOAD_PATH_EXPLAIN} - - - - {L_FTP_PASSIVE_MODE}
{L_FTP_PASSIVE_MODE_EXPLAIN} - {L_YES}   {L_NO} - - - {L_FTP_USERNAME} - - - - {L_FTP_PASSWORD} - - - - - - - {L_FTP_INFO} - - - {L_NO_FTP_EXTENSIONS_INSTALLED} - - {S_HIDDEN_FIELDS}     diff --git a/upload/templates/admin/admin_ug_auth.tpl b/upload/templates/admin/admin_ug_auth.tpl index be7d66323..f11d88afe 100644 --- a/upload/templates/admin/admin_ug_auth.tpl +++ b/upload/templates/admin/admin_ug_auth.tpl @@ -1,4 +1,3 @@ - @@ -6,9 +5,6 @@ #page_content { padding: 0; } -/* "Fixed table header CSS" based on http://web.tampabay.rr.com/bmerkey/examples/nonscroll-table-header.html by bmerkey@tampabay.rr.com */ - -/* Fix Table header START */ div.tScrollContainer { margin-top: -1px; overflow: auto; @@ -23,8 +19,6 @@ thead tr { position: relative; top: expression($p("tScrollCont").scrollTop); /* IE5+ only */ } -/* Fix Table header END */ - .tPerm { background-color: #B4BBC8; margin-top: -2px; } diff --git a/upload/templates/admin/admin_user_search.tpl b/upload/templates/admin/admin_user_search.tpl index 8b2e7c479..0ef04d088 100644 --- a/upload/templates/admin/admin_user_search.tpl +++ b/upload/templates/admin/admin_user_search.tpl @@ -10,130 +10,91 @@ - + - + - + - + - + - + - + - + - - - - - - - - - - - - - + - + - - - - + - + - - - - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - + - + - - - - + - + - - - - +
 {L_SEARCH_USERS_ADVANCED}
{L_USERNAME}:   {L_REGULAR_EXPRESSION} {L_USERNAME}:  
{L_SEARCH_USERNAME_EXPLAIN}
{L_SEARCH_USERNAME_EXPLAIN} 
.{L_EMAIL_ADDRESS}:  
{L_SEARCH_EMAIL_EXPLAIN}
{L_EMAIL_ADDRESS}:   {L_REGULAR_EXPRESSION}  
{L_SEARCH_EMAIL_EXPLAIN}{L_IP_ADDRESS}:  
{L_SEARCH_IP_EXPLAIN}
. 
{L_IP_ADDRESS}:  {L_SEARCH_USERS_JOINED}  // 
{L_SEARCH_USERS_JOINED_EXPLAIN}
{L_SEARCH_IP_EXPLAIN}
.
{L_SEARCH_USERS_JOINED}  // 
{L_SEARCH_USERS_JOINED_EXPLAIN}
. 
{L_GROUP_MEMBERS}:  {L_GROUP_MEMBERS}:  
{L_SEARCH_USERS_GROUPS_EXPLAIN}
{L_SEARCH_USERS_GROUPS_EXPLAIN}
. 
{L_POSTER_RANK}:  {L_POSTER_RANK}:  
{L_SEARCH_USERS_RANKS_EXPLAIN}
{L_SEARCH_USERS_RANKS_EXPLAIN}
. 
{L_POSTCOUNT}   {L_POSTCOUNT}   
{L_SEARCH_USERS_POSTCOUNT_EXPLAIN}
{L_SEARCH_USERS_POSTCOUNT_EXPLAIN} 
.{L_USERFIELD}:   
{L_SEARCH_USERS_USERFIELD_EXPLAIN}
{L_USERFIELD}:    {L_REGULAR_EXPRESSION}  
{L_SEARCH_USERS_USERFIELD_EXPLAIN}{L_SEARCH_USERS_LASTVISITED}   
{L_SEARCH_USERS_LASTVISITED_EXPLAIN}
. 
{L_SEARCH_USERS_LASTVISITED}   {L_BOARD_LANG}: {LANGUAGE_LIST} 
{L_SEARCH_USERS_LANGUAGE_EXPLAIN}
{L_SEARCH_USERS_LASTVISITED_EXPLAIN} 
.{L_TIMEZONE}: {TIMEZONE_LIST} 
{L_SEARCH_USERS_TIMEZONE_EXPLAIN}
{L_BOARD_LANG}: {LANGUAGE_LIST} 
{L_SEARCH_USERS_LANGUAGE_EXPLAIN}
.
{L_TIMEZONE}: {TIMEZONE_LIST} 
{L_SEARCH_USERS_TIMEZONE_EXPLAIN}
. 
{L_MODERATORS_OF}:  {L_MODERATORS_OF}:  
{L_SEARCH_USERS_MODERATORS_EXPLAIN}
{L_SEARCH_USERS_MODERATORS_EXPLAIN}
. 
  
{L_SEARCH_USERS_MISC_EXPLAIN}
{L_SEARCH_USERS_MISC_EXPLAIN}
. 
diff --git a/upload/templates/admin/index.tpl b/upload/templates/admin/index.tpl index 230eba6e4..bf07ee500 100644 --- a/upload/templates/admin/index.tpl +++ b/upload/templates/admin/index.tpl @@ -97,6 +97,13 @@ ajax.callback.manage_admin = function(data) { {L_USER_POSTS_COUNT} + + {L_STATISTICS}: + + tr_stats.php,  + tracker.php + + {L_ADMIN}: diff --git a/upload/templates/board_disabled_exit.php b/upload/templates/board_disabled_exit.php index 73de87cae..1697b0ccd 100644 --- a/upload/templates/board_disabled_exit.php +++ b/upload/templates/board_disabled_exit.php @@ -32,7 +32,7 @@ if (!empty($_POST['message']))

-

+


diff --git a/upload/templates/default/common.tpl b/upload/templates/default/common.tpl index b0494ce57..9aa36744c 100644 --- a/upload/templates/default/common.tpl +++ b/upload/templates/default/common.tpl @@ -1,10 +1,10 @@ - +

- +
{MESSAGE_TITLE}
{L_INFORMATION}
{MESSAGE_TEXT}
{BB_DIE_APPEND_MSG}
@@ -14,7 +14,7 @@

- + diff --git a/upload/templates/default/css/main.css b/upload/templates/default/css/main.css index ac1162e6b..ad0fe71af 100644 --- a/upload/templates/default/css/main.css +++ b/upload/templates/default/css/main.css @@ -587,7 +587,7 @@ table.smilies td { padding: 3px; text-align: center; } margin-top: -8px; width: 210px; padding: 0 6px 0 3px; vertical-align: top; } #sidebar2 h3 { - padding: 0 0 4px 0; margin: 8px 0 2px 0; + padding: 0 0 4px 0; margin: 0 0 2px 0; color: #333333; text-indent: 0.5em; background: transparent url(../images/hr200_ltr_gradient.jpg) no-repeat left bottom; } @@ -954,22 +954,23 @@ var.ajax-params { display: none; } position: fixed; top:0 !important; z-index: 2000; padding: 4px; font-size: 11px; max-width: 400px; max-height: 200px; white-space: nowrap; display: none; } -#ajax-loading { - background: rgba(0,0,0, 0.5) url(../images/loading_1.gif) no-repeat center center; - float: right; - width: 85px; +#ajax-loading { + display: none; + background: rgba(0,0,0, 0.5) url(../images/loading_1.gif) no-repeat center center; + float: right; + width: 85px; height: 30px; - border-bottom-left-radius: 10px; - -webkit-border-bottom-left-radius: 10px; - -khtml-border-bottom-left-radius: 10px; + border-bottom-left-radius: 10px; + -webkit-border-bottom-left-radius: 10px; + -khtml-border-bottom-left-radius: 10px; } -#ajax-error { - background: #d32031 url(../images/loading_1.gif) no-repeat center center; - float: right; - min-width: 200px; +#ajax-error { + background: #d32031 url(../images/loading_1.gif) no-repeat center center; + float: right; + min-width: 200px; height: 30px; - border-bottom-left-radius: 10px; - -webkit-border-bottom-left-radius: 10px; + border-bottom-left-radius: 10px; + -webkit-border-bottom-left-radius: 10px; -khtml-border-bottom-left-radius: 10px; } .editable-container { cursor: pointer; } diff --git a/upload/templates/default/donate.tpl b/upload/templates/default/donate.tpl deleted file mode 100644 index 8900cf4b0..000000000 --- a/upload/templates/default/donate.tpl +++ /dev/null @@ -1,53 +0,0 @@ -

{PAGE_TITLE}

- - - - - - - - - - - - - -
{PAGE_TITLE}
-

Финансовая помощь

- Вся денежная помощь идет на обновление нашего сервера и оборудования, поэтому мы рады любым вашим пожертвованиям... -
- Если Вы желаете материально помочь в развитии проекту - ниже указаны возможные способы перевода денежных средств. -

-
- WMID: ************* -

- - - - - - - - - - - - - - - - - - - - - - - -
ВалютаКошелек
Евро E*************
Доллар Z*************
Гривны U*************
Рубли R*************
-
- Как перевести WebMoney деньги можно посмотреть здесь -
-
 
- -
\ No newline at end of file diff --git a/upload/templates/default/groupcp.tpl b/upload/templates/default/groupcp.tpl index 9b4746fcb..e8fffad45 100644 --- a/upload/templates/default/groupcp.tpl +++ b/upload/templates/default/groupcp.tpl @@ -245,7 +245,6 @@
-

{LAST_VISIT_DATE}

{CURRENT_TIME}

{S_TIMEZONE}

diff --git a/upload/templates/default/images/en/index.html b/upload/templates/default/images/en/index.html deleted file mode 100644 index e69de29bb..000000000 diff --git a/upload/templates/default/images/icon_female.gif b/upload/templates/default/images/icon_female.gif index 321f2c96daf28cc561dcbbb03bb51bff4cccc996..a48bc34e51c462bcd800d64ae6bd74b0a300f5fa 100644 GIT binary patch literal 526 zcmV+p0`dKcP)cK zA73#1VYm-d19!&nAHSY|yz^nk`^#_M|NsAw;ls7J55K+qww{rN@f%DH01B+|rsC_` QGXMYp07*qoM6N<$g5+)pY5)KL literal 141 zcmZ?wbhEHbUoeb3B;Z^q<8p$-b(2C< qm0qu43s;i?n?Xyb@Im$v9f|qQ6B`XUnATo+8Og-Py3&V*!5RRUh&AQ_ diff --git a/upload/templates/default/images/icon_male.gif b/upload/templates/default/images/icon_male.gif index bc98e06893a714f37cb9021b4af727d1484a88ea..6bc85edbd1757ed2e187927bf633fd888b811fdb 100644 GIT binary patch literal 632 zcmV-;0*C#HP)|NrFW=K$;N?-T-v5oF%a@821|ef!M7#PEATpo>BL(vABc zF){u7d_zX)-@iAnpI3TVtHyWDSi^Yl{u6n|xaM69jDNl@`u+R2+2bcKd>I)TZ!-V^ zKmY)K0D=DjgQ@2L`}z0)0001Y3kUvr_V)Dw0ssI20Qvg*0PynetS%xA4@W#G4g?Yk z{>(}?Av5mq^8n7%-r5om>m~v^E*LYFr^aF6+bLXCLa%<92*z^ z^YQV}`uzR?1Nss=xA5`tL&V6=sq*sma{c}N00Io`k^leygI)0J_b(v(AH%zn}uc;ZxTbPhEQG`1|Kid0R8J1v*;F3_pH;)Bo}P=XDkq=7#_O z{xdKpwe2%il;l}ype?5;BrMMG?=J(xlPC8X_8z`){?@(cp^OZScNrKNzyJVUO8|iO SMBpU=00000# xi$I=@Q7yz05LHoZWg;L=0T6?MAY%w9PK5w*;OQwRjKPfnID8hufHe~V06QkPHWmN? diff --git a/upload/templates/default/images/icon_nogender.gif b/upload/templates/default/images/icon_nogender.gif new file mode 100644 index 0000000000000000000000000000000000000000..6fa7050f780008cf2f6d726c58bfe9db6aa81dca GIT binary patch literal 591 zcmeAS@N?(olHy`uVBq!ia0vp^+#t-s#=yXMZ?*ddAcwQSBeEDMCJe%i4727)00kA2 zJ%W507^+km7#f-x7=Hc-(k~bof;bo$MI#s(tfn(Ci05CAlAi!H=c=cRV@SoVq+kF4 z+aLb_|G(r62_Vpm+3`UJXwv`xUp;|Mz!yf7b+ynVd2dWH4Z0 z+GzjkzJ!=W79)E}*0UGKb5DHpHDcImJBgtJNox};_m}T)ZykGvief__h&F$^SHQCtMI*#lrea%x@Q88!9(xrd!WyRBy5)u+3b`&gp_v`EH<#TMSzrA~Wy#N26y1&2v16}b?&c5!? zze%dz&wS=s1d6{)WMyr&R8v!vJap)g7r&g1Md^(|deap;hd z__`k#7rX1sx35q8@$awo;qUM7*Z%>AtuoMM*zxbr&(ANPo}M0F_veS<+{VU6MgxWqhQDpQxi11EpMk;C L)z4*}Q$iB}*>Vt! literal 0 HcmV?d00001 diff --git a/upload/templates/default/images/index.html b/upload/templates/default/images/index.html deleted file mode 100644 index e69de29bb..000000000 diff --git a/upload/templates/default/images/en/icon_edit.gif b/upload/templates/default/images/lang/en/icon_edit.gif similarity index 100% rename from upload/templates/default/images/en/icon_edit.gif rename to upload/templates/default/images/lang/en/icon_edit.gif diff --git a/upload/templates/default/images/en/icon_email.gif b/upload/templates/default/images/lang/en/icon_email.gif similarity index 100% rename from upload/templates/default/images/en/icon_email.gif rename to upload/templates/default/images/lang/en/icon_email.gif diff --git a/upload/templates/default/images/en/icon_icq_add.gif b/upload/templates/default/images/lang/en/icon_icq_add.gif similarity index 100% rename from upload/templates/default/images/en/icon_icq_add.gif rename to upload/templates/default/images/lang/en/icon_icq_add.gif diff --git a/upload/templates/default/images/en/icon_ip.gif b/upload/templates/default/images/lang/en/icon_ip.gif similarity index 100% rename from upload/templates/default/images/en/icon_ip.gif rename to upload/templates/default/images/lang/en/icon_ip.gif diff --git a/upload/templates/default/images/en/icon_mc.gif b/upload/templates/default/images/lang/en/icon_mc.gif similarity index 100% rename from upload/templates/default/images/en/icon_mc.gif rename to upload/templates/default/images/lang/en/icon_mc.gif diff --git a/upload/templates/default/images/en/icon_pm.gif b/upload/templates/default/images/lang/en/icon_pm.gif similarity index 100% rename from upload/templates/default/images/en/icon_pm.gif rename to upload/templates/default/images/lang/en/icon_pm.gif diff --git a/upload/templates/default/images/en/icon_poll.gif b/upload/templates/default/images/lang/en/icon_poll.gif similarity index 100% rename from upload/templates/default/images/en/icon_poll.gif rename to upload/templates/default/images/lang/en/icon_poll.gif diff --git a/upload/templates/default/images/en/icon_profile.gif b/upload/templates/default/images/lang/en/icon_profile.gif similarity index 100% rename from upload/templates/default/images/en/icon_profile.gif rename to upload/templates/default/images/lang/en/icon_profile.gif diff --git a/upload/templates/default/images/en/icon_quote.gif b/upload/templates/default/images/lang/en/icon_quote.gif similarity index 100% rename from upload/templates/default/images/en/icon_quote.gif rename to upload/templates/default/images/lang/en/icon_quote.gif diff --git a/upload/templates/default/images/en/icon_search.gif b/upload/templates/default/images/lang/en/icon_search.gif similarity index 100% rename from upload/templates/default/images/en/icon_search.gif rename to upload/templates/default/images/lang/en/icon_search.gif diff --git a/upload/templates/default/images/en/icon_www.gif b/upload/templates/default/images/lang/en/icon_www.gif similarity index 100% rename from upload/templates/default/images/en/icon_www.gif rename to upload/templates/default/images/lang/en/icon_www.gif diff --git a/upload/templates/default/images/en/msg_newpost.gif b/upload/templates/default/images/lang/en/msg_newpost.gif similarity index 100% rename from upload/templates/default/images/en/msg_newpost.gif rename to upload/templates/default/images/lang/en/msg_newpost.gif diff --git a/upload/templates/default/images/en/post.gif b/upload/templates/default/images/lang/en/post.gif similarity index 100% rename from upload/templates/default/images/en/post.gif rename to upload/templates/default/images/lang/en/post.gif diff --git a/upload/templates/default/images/en/release.gif b/upload/templates/default/images/lang/en/release.gif similarity index 100% rename from upload/templates/default/images/en/release.gif rename to upload/templates/default/images/lang/en/release.gif diff --git a/upload/templates/default/images/en/reply-locked.gif b/upload/templates/default/images/lang/en/reply-locked.gif similarity index 100% rename from upload/templates/default/images/en/reply-locked.gif rename to upload/templates/default/images/lang/en/reply-locked.gif diff --git a/upload/templates/default/images/en/reply.gif b/upload/templates/default/images/lang/en/reply.gif similarity index 100% rename from upload/templates/default/images/en/reply.gif rename to upload/templates/default/images/lang/en/reply.gif diff --git a/upload/templates/default/images/ru/icon_edit.gif b/upload/templates/default/images/lang/ru/icon_edit.gif similarity index 100% rename from upload/templates/default/images/ru/icon_edit.gif rename to upload/templates/default/images/lang/ru/icon_edit.gif diff --git a/upload/templates/default/images/ru/icon_email.gif b/upload/templates/default/images/lang/ru/icon_email.gif similarity index 100% rename from upload/templates/default/images/ru/icon_email.gif rename to upload/templates/default/images/lang/ru/icon_email.gif diff --git a/upload/templates/default/images/ru/icon_icq_add.gif b/upload/templates/default/images/lang/ru/icon_icq_add.gif similarity index 100% rename from upload/templates/default/images/ru/icon_icq_add.gif rename to upload/templates/default/images/lang/ru/icon_icq_add.gif diff --git a/upload/templates/default/images/ru/icon_ip.gif b/upload/templates/default/images/lang/ru/icon_ip.gif similarity index 100% rename from upload/templates/default/images/ru/icon_ip.gif rename to upload/templates/default/images/lang/ru/icon_ip.gif diff --git a/upload/templates/default/images/ru/icon_mc.gif b/upload/templates/default/images/lang/ru/icon_mc.gif similarity index 100% rename from upload/templates/default/images/ru/icon_mc.gif rename to upload/templates/default/images/lang/ru/icon_mc.gif diff --git a/upload/templates/default/images/ru/icon_pm.gif b/upload/templates/default/images/lang/ru/icon_pm.gif similarity index 100% rename from upload/templates/default/images/ru/icon_pm.gif rename to upload/templates/default/images/lang/ru/icon_pm.gif diff --git a/upload/templates/default/images/ru/icon_poll.gif b/upload/templates/default/images/lang/ru/icon_poll.gif similarity index 100% rename from upload/templates/default/images/ru/icon_poll.gif rename to upload/templates/default/images/lang/ru/icon_poll.gif diff --git a/upload/templates/default/images/ru/icon_profile.gif b/upload/templates/default/images/lang/ru/icon_profile.gif similarity index 100% rename from upload/templates/default/images/ru/icon_profile.gif rename to upload/templates/default/images/lang/ru/icon_profile.gif diff --git a/upload/templates/default/images/ru/icon_quote.gif b/upload/templates/default/images/lang/ru/icon_quote.gif similarity index 100% rename from upload/templates/default/images/ru/icon_quote.gif rename to upload/templates/default/images/lang/ru/icon_quote.gif diff --git a/upload/templates/default/images/ru/icon_search.gif b/upload/templates/default/images/lang/ru/icon_search.gif similarity index 100% rename from upload/templates/default/images/ru/icon_search.gif rename to upload/templates/default/images/lang/ru/icon_search.gif diff --git a/upload/templates/default/images/ru/icon_www.gif b/upload/templates/default/images/lang/ru/icon_www.gif similarity index 100% rename from upload/templates/default/images/ru/icon_www.gif rename to upload/templates/default/images/lang/ru/icon_www.gif diff --git a/upload/templates/default/images/ru/msg_newpost.gif b/upload/templates/default/images/lang/ru/msg_newpost.gif similarity index 100% rename from upload/templates/default/images/ru/msg_newpost.gif rename to upload/templates/default/images/lang/ru/msg_newpost.gif diff --git a/upload/templates/default/images/ru/post.gif b/upload/templates/default/images/lang/ru/post.gif similarity index 100% rename from upload/templates/default/images/ru/post.gif rename to upload/templates/default/images/lang/ru/post.gif diff --git a/upload/templates/default/images/ru/release.gif b/upload/templates/default/images/lang/ru/release.gif similarity index 100% rename from upload/templates/default/images/ru/release.gif rename to upload/templates/default/images/lang/ru/release.gif diff --git a/upload/templates/default/images/ru/reply-locked.gif b/upload/templates/default/images/lang/ru/reply-locked.gif similarity index 100% rename from upload/templates/default/images/ru/reply-locked.gif rename to upload/templates/default/images/lang/ru/reply-locked.gif diff --git a/upload/templates/default/images/ru/reply.gif b/upload/templates/default/images/lang/ru/reply.gif similarity index 100% rename from upload/templates/default/images/ru/reply.gif rename to upload/templates/default/images/lang/ru/reply.gif diff --git a/upload/templates/default/images/ua/icon_edit.gif b/upload/templates/default/images/lang/ua/icon_edit.gif similarity index 100% rename from upload/templates/default/images/ua/icon_edit.gif rename to upload/templates/default/images/lang/ua/icon_edit.gif diff --git a/upload/templates/default/images/ua/icon_email.gif b/upload/templates/default/images/lang/ua/icon_email.gif similarity index 100% rename from upload/templates/default/images/ua/icon_email.gif rename to upload/templates/default/images/lang/ua/icon_email.gif diff --git a/upload/templates/default/images/ua/icon_icq_add.gif b/upload/templates/default/images/lang/ua/icon_icq_add.gif similarity index 100% rename from upload/templates/default/images/ua/icon_icq_add.gif rename to upload/templates/default/images/lang/ua/icon_icq_add.gif diff --git a/upload/templates/default/images/ua/icon_ip.gif b/upload/templates/default/images/lang/ua/icon_ip.gif similarity index 100% rename from upload/templates/default/images/ua/icon_ip.gif rename to upload/templates/default/images/lang/ua/icon_ip.gif diff --git a/upload/templates/default/images/ua/icon_mc.gif b/upload/templates/default/images/lang/ua/icon_mc.gif similarity index 100% rename from upload/templates/default/images/ua/icon_mc.gif rename to upload/templates/default/images/lang/ua/icon_mc.gif diff --git a/upload/templates/default/images/ua/icon_pm.gif b/upload/templates/default/images/lang/ua/icon_pm.gif similarity index 100% rename from upload/templates/default/images/ua/icon_pm.gif rename to upload/templates/default/images/lang/ua/icon_pm.gif diff --git a/upload/templates/default/images/ua/icon_poll.gif b/upload/templates/default/images/lang/ua/icon_poll.gif similarity index 100% rename from upload/templates/default/images/ua/icon_poll.gif rename to upload/templates/default/images/lang/ua/icon_poll.gif diff --git a/upload/templates/default/images/ua/icon_profile.gif b/upload/templates/default/images/lang/ua/icon_profile.gif similarity index 100% rename from upload/templates/default/images/ua/icon_profile.gif rename to upload/templates/default/images/lang/ua/icon_profile.gif diff --git a/upload/templates/default/images/ua/icon_quote.gif b/upload/templates/default/images/lang/ua/icon_quote.gif similarity index 100% rename from upload/templates/default/images/ua/icon_quote.gif rename to upload/templates/default/images/lang/ua/icon_quote.gif diff --git a/upload/templates/default/images/ua/icon_search.gif b/upload/templates/default/images/lang/ua/icon_search.gif similarity index 100% rename from upload/templates/default/images/ua/icon_search.gif rename to upload/templates/default/images/lang/ua/icon_search.gif diff --git a/upload/templates/default/images/ua/icon_www.gif b/upload/templates/default/images/lang/ua/icon_www.gif similarity index 100% rename from upload/templates/default/images/ua/icon_www.gif rename to upload/templates/default/images/lang/ua/icon_www.gif diff --git a/upload/templates/default/images/ua/msg_newpost.gif b/upload/templates/default/images/lang/ua/msg_newpost.gif similarity index 100% rename from upload/templates/default/images/ua/msg_newpost.gif rename to upload/templates/default/images/lang/ua/msg_newpost.gif diff --git a/upload/templates/default/images/ua/post.gif b/upload/templates/default/images/lang/ua/post.gif similarity index 100% rename from upload/templates/default/images/ua/post.gif rename to upload/templates/default/images/lang/ua/post.gif diff --git a/upload/templates/default/images/ua/release.gif b/upload/templates/default/images/lang/ua/release.gif similarity index 100% rename from upload/templates/default/images/ua/release.gif rename to upload/templates/default/images/lang/ua/release.gif diff --git a/upload/templates/default/images/ua/reply-locked.gif b/upload/templates/default/images/lang/ua/reply-locked.gif similarity index 100% rename from upload/templates/default/images/ua/reply-locked.gif rename to upload/templates/default/images/lang/ua/reply-locked.gif diff --git a/upload/templates/default/images/ua/reply.gif b/upload/templates/default/images/lang/ua/reply.gif similarity index 100% rename from upload/templates/default/images/ua/reply.gif rename to upload/templates/default/images/lang/ua/reply.gif diff --git a/upload/templates/default/images/ru/index.html b/upload/templates/default/images/ru/index.html deleted file mode 100644 index e69de29bb..000000000 diff --git a/upload/templates/default/images/ua/index.html b/upload/templates/default/images/ua/index.html deleted file mode 100644 index e69de29bb..000000000 diff --git a/upload/templates/default/index.tpl b/upload/templates/default/index.tpl index 08294e66e..ccb1c7466 100644 --- a/upload/templates/default/index.tpl +++ b/upload/templates/default/index.tpl @@ -1,7 +1,7 @@
- +
@@ -221,7 +221,6 @@
-

{LAST_VISIT_DATE}

{CURRENT_TIME}

{S_TIMEZONE}

diff --git a/upload/templates/default/memberlist.tpl b/upload/templates/default/memberlist.tpl index 23b9c8a1b..e786eda10 100644 --- a/upload/templates/default/memberlist.tpl +++ b/upload/templates/default/memberlist.tpl @@ -69,7 +69,6 @@
-

{LAST_VISIT_DATE}

{CURRENT_TIME}

{S_TIMEZONE}

diff --git a/upload/templates/default/modcp.tpl b/upload/templates/default/modcp.tpl index a6b7b3efa..065acfb53 100644 --- a/upload/templates/default/modcp.tpl +++ b/upload/templates/default/modcp.tpl @@ -121,7 +121,6 @@
-

{LAST_VISIT_DATE}

{CURRENT_TIME}

{S_TIMEZONE}

diff --git a/upload/templates/default/page_header.tpl b/upload/templates/default/page_header.tpl index 1f4ae18c6..693ebee98 100644 --- a/upload/templates/default/page_header.tpl +++ b/upload/templates/default/page_header.tpl @@ -4,9 +4,9 @@ <!-- IF PAGE_TITLE -->{PAGE_TITLE} :: {SITENAME}<!-- ELSE -->{SITENAME}<!-- ENDIF --> + {META} - @@ -29,12 +29,6 @@ var postImgAligned_MaxWidth = Math.round(screen.width/3); var attachImg_MaxWidth = screen.width - {ATTACH_IMG_WIDTH_DECR_JS}; var ExternalLinks_InNewWindow = '{EXT_LINK_NEW_WIN}'; var hidePostImg = false; - -function copyText_writeLink(node) -{ - if (!is_ie) return; - document.write('

{L_CODE_COPY}

'); -} @@ -128,21 +122,6 @@ input[type="checkbox"] { margin-bottom: -1px; } .fieldsets div > p { margin-bottom: 0; } - - - @@ -255,7 +234,7 @@ function go_to_page () Вы используете устаревший браузер. Сайт может отображаться некорректно.
@@ -297,7 +276,7 @@ if ( (typeof(window.opera) != "undefined" && window.opera.version() < 12) || (wi @@ -347,8 +326,7 @@ $(document).ready(function() { {L_WRITE_REPORT} · {L_OPTIONS} · - {L_PROFILE} · - {L_SEARCH_SELF} + {L_PROFILE}
diff --git a/upload/templates/default/posting.tpl b/upload/templates/default/posting.tpl index 6b54ed19c..6a3b85c92 100644 --- a/upload/templates/default/posting.tpl +++ b/upload/templates/default/posting.tpl @@ -14,7 +14,7 @@ -

+

{new_posts.POSTER}

@@ -167,7 +167,7 @@ -

+

{review.POSTER}

diff --git a/upload/templates/default/posting_editor.tpl b/upload/templates/default/posting_editor.tpl index 07a875baf..2b2eeabef 100644 --- a/upload/templates/default/posting_editor.tpl +++ b/upload/templates/default/posting_editor.tpl @@ -91,7 +91,7 @@ ajax.callback.posts = function(data){   -   +   ? diff --git a/upload/templates/default/posting_tpl.tpl b/upload/templates/default/posting_tpl.tpl index e03bfcca3..b01727fdf 100644 --- a/upload/templates/default/posting_tpl.tpl +++ b/upload/templates/default/posting_tpl.tpl @@ -1,4 +1,3 @@ - - - - - - - - -
Общие правила и положения
- -
- -

Правила оформления раздач на трекере

- -
-
    -
  • - Все создающие раздачу (выкладывающие файл для общедоступного скачивания) обязаны контролировать содержимое этой раздачи по качеству (к примеру, отсутствие звука в фильмах, неснятая защита в программах, неработоспособность программы и т.п.). -
  • -
  • - Данная конференция ведется на русском языке. Для не имеющих возможности писать кириллицей в форум встроена виртуальная русская клавиатура и транслит, кроме того в интернете существует целый ряд подобных сервисов. Модераторы и администрация оставляют за собой право редактировать или удалять сообщения, написанные латиницей, без предупреждения. -
  • -
  • - Перед тем, как создавать раздачу, воспользуйтесь поиском - возможно такая раздача уже существует. -
  • -
-
- -

Всем участникам раздач на данном трекере запрещается:

- -
-
    -
  • Создавать раздачу, дублирующую то, что уже существует на трекере. Дублирующей считается не отличающаяся ни по содержанию, ни по качеству информация.
  • -
  • Создавать раздачу, содержание которой нарушает общественные нормы морали, различные Базы Данных, отсутствующие в свободном законном доступе и т.п.
  • -
  • Выкладывать для общедоступного скачивания более двадцати раздач одновременно или по совокупности (исключение делается для пользователей с очень широким каналом, по личному разрешению Администрации). Пользователи, раздающие больше 20 раздач, будут предупреждаться. Если предупреждения не приведут к должному результату, то часть Ваших раздач будет приостановлена (а возможно, и удалена).
  • -
-
- -
Решение по соответствию раздачи данным требованиям принимает Модератор или Администратор. В их полномочиях редактировать, перемещать, закрывать или удалять раздачу.
- -
- -
- -
\ No newline at end of file diff --git a/upload/templates/topic_tpl_rules_video.html b/upload/templates/topic_tpl_rules_video.html deleted file mode 100644 index 55ec8b81a..000000000 --- a/upload/templates/topic_tpl_rules_video.html +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - -
Правила оформления
- -
- -

Перед тем, как начинать оформление раздачи, вы должны обязательно ознакомиться со следующими темами:

- - -
- - Является ли ваш релиз повтором - -
- - Как получить информацию по видео файлу - -
- - Как сделать скриншот с фильма - -
- - Как залить скриншот на бесплатный хост - -
- - Обозначение качества видео - -
- - Как подписывать торрент файлы - -
- - Как правильно писать на форуме - -
- -

Правила оформления раздач в этом разделе:

- -
    - -
  • -Если при оформлении раздачи фильма вы указываете русское название, оно должно соответствовать названию под которым фильм выходил на территории Российской Федерации. Буквальный перевод оригинального названия не приветствуется. В названии темы должно быть название фильма на русском языке / на английском или на языке оригинала. -
  • -
  • -В раздаче должен обязательно присутствовать постер. -
  • -
  • -Также вы должны заполнить все графы в бланке по оформлению раздачи - продолжительность, перевод, страна, год создания фильма, режиссер, актеры (в ролях), для чего вы можете воспользоваться авторитетными сайтами о кинематографии, такими как - IMdB либо VideoGuide. -
  • -
  • -Обязательно должно присутствовать хотя бы краткое описание сюжета фильма. -
  • -
  • -В описании обязательно должно присутствовать обозначение качества раздающегося материала, формат, а также параметры аудио и видео потоков. -
  • -
  • -При сознательном введении в заблуждение пользователей форума относительно качества раздаваемого материала, раздающему будет сделано предупреждение с запретом на дальнейшее оформление раздач. -
  • -
  • -Сриншоты при качестве фильма ниже DVDRip выкладывать обязательно. На качество DVDRip раздающий обязан выложить скриншоты по первому требованию пользователей ресурса. Скриншот должен быть сделан непосредственно с того видео файла, который раздается! -
  • -
  • -В имени торрент-файла должно присутствовать русское название фильма, написанное на латинице. Далее, в скобках, должно быть указано имя трекера. Например: Imja_Faila_[].torrent (если оригинальное название торрент-файла было Имя Файла.torrent). В названии торрент-файла и его содержимого, не должно присутствовать ссылок на другие ресурсы. -
  • -
  • -Если вы имеете принадлежность к одной из релиз-групп, то разрешается указывать в теме название вашей релиз-группы, но только в виде текста либо графического файла, не содержащих прямых ссылок на другой ресурс, иначе это будет расцениваться как реклама и данная ссылка будет удалена. При желании вы можете указать название релиз-группы раздаваемого фильма, не принадлежа к ней, но также без ссылок на другой ресурс. -
  • -
  • -Если по различного рода объективным причинам, в какое-то время суток вы будете отсутствовать на раздаче длительное время, являясь единственным сидом на ней, вы должны указать это. -
  • -
  • -При несоблюдении вышеперечисленных правил, либо в случае отсутствия сида на раздаче по истечении 2 часов после оформления, раздача будет перенесена в Тестовый форум, а раздающему будет сделано предупреждение. При наличии трех предупреждений, аккаунт пользователя будет удален без объяснения причины. Для проб используйте Тестовый форум. -
  • -
  • -При скорости отдачи (Upload) менее 12 кб/с не разрешается сидировать более 1-ого файла одновременно (другие раздачи и закачки на этот момент должны быть завершены). При нарушении данного условия все ваши последующие одновременные раздачи будут закрываться. Начав раздачу, вы должны довести ее до конца, пока не появится минимум 3-5 скачавших. -
  • -
  • -Если вы по каким-либо причинам не смогли сделать что-либо из вышеперечисленного - оформлять раздачу напрямую в данном разделе запрещено, для этого существует Тестовый форум. -
  • - -
- -
- -
- -
- -
diff --git a/upload/tracker.php b/upload/tracker.php index 4f31d25e8..f41b402dc 100644 --- a/upload/tracker.php +++ b/upload/tracker.php @@ -21,12 +21,12 @@ $user->session_start(array('req_login' => $bb_cfg['bt_tor_browse_only_reg'])); set_die_append_msg(); $tor_search_limit = (IS_AM) ? 2000 : 500; -$forum_select_size = (UA_OPERA) ? 21 : 24; // forum select box max rows -$max_forum_name_len = 60; // inside forum select box +$forum_select_size = 24; // forum select box max rows +$max_forum_name_len = 60; // inside forum select box $max_forums_selected = 50; $title_match_max_len = 60; $poster_name_max_len = 25; -$tor_colspan = 13; // torrents table colspan with all columns +$tor_colspan = 13; // torrents table colspan with all columns $per_page = $bb_cfg['topics_per_page']; $tracker_url = basename(__FILE__); @@ -791,7 +791,7 @@ if ($allowed_forums) 'VIEWS' => $tor['topic_views'], 'ADDED_RAW' => $tor['reg_time'], 'ADDED_TIME' => bb_date($tor['reg_time'], $time_format), - 'ADDED_DATE' => bb_date($tor['reg_time'], $date_format, 'false'), + 'ADDED_DATE' => bb_date($tor['reg_time'], $date_format, false), )); } } @@ -821,7 +821,7 @@ if ($tor_count) if(empty($cat_forum)) { - message_die(GENERAL_MESSAGE, $lang['BT_NO_SEARCHABLE_FORUMS']); + bb_die($lang['BT_NO_SEARCHABLE_FORUMS']); } // Forum select diff --git a/upload/viewonline.php b/upload/viewonline.php index bc73ca7ad..518e811dc 100644 --- a/upload/viewonline.php +++ b/upload/viewonline.php @@ -30,9 +30,9 @@ $sql = "SELECT u.user_id, u.username, u.user_opt, u.user_rank, s.session_logged_ WHERE u.user_id = s.session_user_id AND s.session_time >= ".( TIMENOW - 300 ) . " ORDER BY u.username ASC, s.session_ip ASC"; -if ( !($result = DB()->sql_query($sql)) ) +if (!($result = DB()->sql_query($sql))) { - message_die(GENERAL_ERROR, 'Could not obtain regd user/online information', '', __LINE__, __FILE__, $sql); + bb_die('Could not obtain regd user / online information'); } $guest_users = 0; diff --git a/upload/viewtopic.php b/upload/viewtopic.php index 214d93344..f456168ec 100644 --- a/upload/viewtopic.php +++ b/upload/viewtopic.php @@ -639,15 +639,10 @@ if ($t_data['topic_attachment']) // // Update the topic view counter // -$sql = "INSERT INTO ". BUF_TOPIC_VIEW ." - (topic_id, topic_views) VALUES - ($topic_id, 1) - ON DUPLICATE KEY UPDATE - topic_views = topic_views + 1"; - -if ( !DB()->sql_query($sql) ) +$sql = "INSERT INTO ". BUF_TOPIC_VIEW ." (topic_id, topic_views) VALUES ($topic_id, 1) ON DUPLICATE KEY UPDATE topic_views = topic_views + 1"; +if (!DB()->sql_query($sql)) { - message_die(GENERAL_ERROR, "Could not update topic views.", '', __LINE__, __FILE__, $sql); + bb_die('Could not update topic views'); } // @@ -678,7 +673,7 @@ $prev_post_time = $max_post_time = 0; require_once(INC_DIR ."functions_report.php"); $report_post = report_modules('name', 'report_post'); -$this_date = bb_date(TIMENOW ,'md', 'false'); +$this_date = bb_date(TIMENOW ,'md', false); for($i = 0; $i < $total_posts; $i++) { @@ -692,7 +687,6 @@ for($i = 0; $i < $total_posts; $i++) $poster_joined = ($poster_id != GUEST_UID) ? $lang['JOINED'] . ': ' . bb_date($postrow[$i]['user_regdate'], $bb_cfg['date_format']) : ''; $poster_longevity = ($poster_id != GUEST_UID) ? delta_time($postrow[$i]['user_regdate']) : ''; $post_id = $postrow[$i]['post_id']; - $mc_type = $postrow[$i]['mc_type']; $mc_comment = $postrow[$i]['mc_comment']; $mc_user_id = profile_url(array('username' => $postrow[$i]['mc_username'], 'user_id' => $postrow[$i]['mc_user_id'], 'user_rank' => $postrow[$i]['mc_user_rank'])); @@ -810,21 +804,7 @@ for($i = 0; $i < $total_posts; $i++) $report_img = $report = ''; } - // Gender - switch($postrow[$i]['user_gender']) - { - case MALE: - $gender = ''; - break; - case FEMALE: - $gender = ''; - break; - default: - $gender = ''; - break; - } - - // mod comment + // Mod comment switch($mc_type) { case 1: // Комментарий @@ -865,7 +845,7 @@ for($i = 0; $i < $total_posts; $i++) 'POSTER_BOT' => ($poster_id == BOT_UID), 'POSTER_ID' => $poster_id, 'POSTER_AUTHOR' => ($poster_id == $t_data['topic_poster']), - 'POSTER_GENDER' => ($bb_cfg['gender'] && $gender) ? $gender : '', + 'POSTER_GENDER' => ($bb_cfg['gender']) ? gender_image($postrow[$i]['user_gender']) : '', 'POSTED_AFTER' => ($prev_post_time) ? delta_time($postrow[$i]['post_time'], $prev_post_time) : '', 'IS_UNREAD' => is_unread($postrow[$i]['post_time'], $topic_id, $forum_id), 'IS_FIRST_POST' => (!$start && ($post_id == $t_data['topic_first_post_id'])),