From 399ac5a1b026934c4dbd591704a0793f12bb3c85 Mon Sep 17 00:00:00 2001 From: "glix08@gmail.com" Date: Sun, 19 Jan 2014 19:04:25 +0000 Subject: [PATCH] r562 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Удаление мода виртуальной клавиатуры из основного дистрибутива; фикс главной страницы админ-панели; фикс панели управления шаблонами в админ-панели; частичная замена else if на elseif, для возможности отхода от использования фигурных скобок в дальнейшем. Дальнейшая поддержка и распространение мода виртуальной клавиатуры осуществляется на форуме: http://torrentpier.me/resources/84/ git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@562 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293 --- mods/Virtual Keyboard/install.txt | 148 ----------------------- mods/Virtual Keyboard/kb.tpl | 136 --------------------- upload/admin/admin_disallow.php | 7 +- upload/admin/admin_ranks.php | 62 +++++----- upload/admin/admin_topic_templates.php | 4 +- upload/admin/admin_user_search.php | 34 +++--- upload/admin/index.php | 23 ++-- upload/ajax.php | 6 +- upload/ajax/edit_user_profile.php | 2 +- upload/ajax/manage_user.php | 1 + upload/ajax/posts.php | 2 +- upload/ajax/user_register.php | 4 +- upload/ajax/view_post.php | 2 +- upload/ajax/view_profile.php | 2 +- upload/bt/announce.php | 8 +- upload/bt/includes/init_tr.php | 4 +- upload/config.php | 2 +- upload/develop/profiler/profiler_dbg.php | 4 +- upload/dl_list.php | 8 +- upload/download.php | 14 +-- upload/includes/cron/cron_init.php | 6 +- upload/login.php | 4 +- upload/modcp.php | 18 +-- upload/posting.php | 69 ++++++----- upload/viewforum.php | 12 +- upload/viewtopic.php | 8 +- 26 files changed, 152 insertions(+), 438 deletions(-) delete mode 100644 mods/Virtual Keyboard/install.txt delete mode 100644 mods/Virtual Keyboard/kb.tpl diff --git a/mods/Virtual Keyboard/install.txt b/mods/Virtual Keyboard/install.txt deleted file mode 100644 index 3cdba121d..000000000 --- a/mods/Virtual Keyboard/install.txt +++ /dev/null @@ -1,148 +0,0 @@ -# Инструкция от dimka3210 -# Данный мод позволяет использовать виртуальную клавиатуру. -# Сам мод был вырезан из-за неактивности, но будет поставляться вместе с движком. -# Получить поддержку по движку можно на форуме http://torrentpier.me - -Скопировать файл kb.tpl в /templates/default/ - -# -#-----[ OPEN / Открыть ]----------------------------------------- -# - config_mods.php -# -#-----[ ADD / Добавить ]----------------------------------------- -# - -$bb_cfg['show_virtual_keyboard'] = true; - -# -#-----[ OPEN / Открыть ]----------------------------------------- -# - posting.php - -# -#-----[ FIND / Найти ]------------------------------------------- -# - -'S_HIDDEN_FORM_FIELDS' => $hidden_form_fields) -); - -# -#-----[ AFTER ADD / После добавить]------------------------------ -# - -$template->assign_vars(array( - 'SHOW_VIRTUAL_KEYBOARD' => $bb_cfg['show_virtual_keyboard'], - 'S_VISIBILITY_RULES' => 'position:absolute;visibility:hidden;', - 'S_VISIBILITY_KEYB' => 'position:absolute;visibility:hidden;', - 'S_VISIBILITY_OFF' => '') -); - -# -#-----[ OPEN / Открыть ]----------------------------------------- -# - privmsg.php - -# -#-----[ FIND / Найти ]------------------------------------------- -# - -'U_VIEW_FORUM' => append_sid("privmsg.php")) - ); - -# -#-----[ AFTER ADD / После добавить]------------------------------ -# - - $template->assign_vars(array( - 'SHOW_VIRTUAL_KEYBOARD' => $bb_cfg['show_virtual_keyboard'], - 'S_VISIBILITY_RULES' => 'position:absolute;visibility:hidden;', - 'S_VISIBILITY_KEYB' => 'position:absolute;visibility:hidden;', - 'S_VISIBILITY_OFF' => '') - ); - -# -#-----[ OPEN / Открыть ]----------------------------------------- -# - lang_english/lang_main.php - -# -#-----[ ADD / Добавить в конец]------------------------------ -# - -// MAIL.RU KEYBOARD -$lang['KB_TITLE'] = 'Russian keyboard'; -$lang['KB_RUS_KEYLAYOUT'] = 'Layout: '; -$lang['KB_NONE'] = 'None'; -$lang['KB_TRANSLIT'] = 'Translit'; -$lang['KB_TRADITIONAL'] = 'Traditional'; -$lang['KB_RULES'] = 'Using translit'; -$lang['KB_SHOW'] = 'Show keyboard (Make sure you\'re using Cyrillic codepage!)'; -$lang['KB_ABOUT'] = 'About'; -$lang['KB_CLOSE'] = 'Close'; -$lang['KB_TRANSLIT_MOZILLA'] = 'Select text you wish to translit and click \'Translit\'.'; -$lang['KB_TRANSLIT_OPERA7'] = 'Click here to translit your message.'; - -# -#-----[ OPEN / Открыть ]----------------------------------------- -# - lang_russian/lang_main.php - -# -#-----[ ADD / Добавить в конец]------------------------------ -# - -// MAIL.RU KEYBOARD -$lang['KB_TITLE'] = 'Русская клавиатура'; -$lang['KB_RUS_KEYLAYOUT'] = 'Раскладка: '; -$lang['KB_NONE'] = 'Отсутствует'; -$lang['KB_TRANSLIT'] = 'Транслит'; -$lang['KB_TRADITIONAL'] = 'Традиционная'; -$lang['KB_RULES'] = 'Правила набора'; -$lang['KB_SHOW'] = 'Показать клавиатуру'; -$lang['KB_ABOUT'] = 'О клавиатуре'; -$lang['KB_CLOSE'] = 'Закрыть'; -$lang['KB_TRANSLIT_MOZILLA'] = 'Выберите текст, который вы хотите для перевода в транслит, и нажмите кнопку \'Транслит\'.'; -$lang['KB_TRANSLIT_OPERA7'] = 'Нажмите здесь для перевода вашего сообщения в транслит.'; - - -# -#-----[ OPEN / Открыть ]----------------------------------------- -# - templates/default/posting.tpl - -# -#-----[ FIND / Найти ]------------------------------------------- -# - - - - -# -#-----[ BEFORE ADD / Перед добавить]------------------------------ -# - - - -# -#-----[ OPEN / Открыть ]----------------------------------------- -# - templates/default/posting_editor.tpl - -# -#-----[ FIND / Найти ]------------------------------------------- -# - -class="editor mrg_4" name="message" id="message" rows="18" cols="92" - -# -#-----[ ADD / Добавить]------------------------------ -# - - - onkeypress = "if(use_kb) return decode(event);" - - -# -#-----[ SAVE/CLOSE ALL FILES / Сохранить/Закрыть все файлы]------------------------------------------ -# \ No newline at end of file diff --git a/mods/Virtual Keyboard/kb.tpl b/mods/Virtual Keyboard/kb.tpl deleted file mode 100644 index 935fa6c3f..000000000 --- a/mods/Virtual Keyboard/kb.tpl +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - - - - - {L_KB_TITLE} -
- - {L_KB_TRANSLIT}
- {L_KB_RULES}
- {L_HIDE} -
- - - -
{L_KB_SHOW}
- -
- - - - - - - - - - - - - - - - - - - - - - - - -
{L_KB_RULES}{L_KB_CLOSE}
а
б
в
г
д
е
- a
- b
- v
- g
- d
- e
ë
ж
з
и
й
к
- 'o
- 'z ('g)
- z
- i
- j
- k
л
м
н
о
п
р
- l
- m
- n
- o
- p
- r
с
т
у
ф
х
ц
- s
- t
- u
- f
- h
- c
ч
ш
щ
ъ
ы
ь
- 'c
- 's
- w ('h)
- ]
- y
- [
э
ю
я
'
- 'e
- q ('u)
- 'a
- ''
-
- -
- - - - -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - -
- - -
- -
-
- - - - - \ No newline at end of file diff --git a/upload/admin/admin_disallow.php b/upload/admin/admin_disallow.php index 3be9c0222..6ec4dfc3b 100644 --- a/upload/admin/admin_disallow.php +++ b/upload/admin/admin_disallow.php @@ -41,12 +41,11 @@ if( isset($_POST['add_name']) ) message_die(GENERAL_MESSAGE, $message); } -else if( isset($_POST['delete_name']) ) +elseif (isset($_POST['delete_name'])) { - $disallowed_id = ( isset($_POST['disallowed_id']) ) ? intval( $_POST['disallowed_id'] ) : intval( $_GET['disallowed_id'] ); + $disallowed_id = (isset($_POST['disallowed_id']) ) ? intval( $_POST['disallowed_id'] ) : intval( $_GET['disallowed_id']); - $sql = "DELETE FROM " . BB_DISALLOW . " - WHERE disallow_id = $disallowed_id"; + $sql = "DELETE FROM " . BB_DISALLOW . " WHERE disallow_id = $disallowed_id"; $result = DB()->sql_query($sql); if( !$result ) { diff --git a/upload/admin/admin_ranks.php b/upload/admin/admin_ranks.php index c5bbb3aa5..0984cb0cf 100644 --- a/upload/admin/admin_ranks.php +++ b/upload/admin/admin_ranks.php @@ -22,11 +22,11 @@ else // // These could be entered via a form button // - if(isset($_POST['add'])) + if (isset($_POST['add'])) { $mode = 'add'; } - else if(isset($_POST['save'])) + elseif (isset($_POST['save'])) { $mode = 'save'; } @@ -37,9 +37,9 @@ else } -if($mode != '') +if ($mode != '') { - if($mode == 'edit' || $mode == 'add') + if ($mode == 'edit' || $mode == 'add') { // // They want to add a new rank, show the form. @@ -48,15 +48,14 @@ if($mode != '') $s_hidden_fields = ''; - if($mode == 'edit') + if ($mode == 'edit') { if(empty($rank_id)) { message_die(GENERAL_MESSAGE, $lang['MUST_SELECT_RANK']); } - $sql = "SELECT * FROM " . BB_RANKS . " - WHERE rank_id = $rank_id"; + $sql = "SELECT * FROM " . BB_RANKS . " WHERE rank_id = $rank_id"; if(!$result = DB()->sql_query($sql)) { message_die(GENERAL_ERROR, "Couldn't obtain rank data", '', __LINE__, __FILE__, $sql); @@ -64,7 +63,6 @@ if($mode != '') $rank_info = DB()->sql_fetchrow($result); $s_hidden_fields .= ''; - } else { @@ -90,9 +88,8 @@ if($mode != '') 'S_RANK_ACTION' => "admin_ranks.php", 'S_HIDDEN_FIELDS' => $s_hidden_fields, )); - } - else if($mode == 'save') + elseif ($mode == 'save') { // // Ok, they sent us our info, let's update it. @@ -105,12 +102,12 @@ if($mode != '') $min_posts = (isset($_POST['min_posts'])) ? intval($_POST['min_posts']) : -1; $rank_image = ((isset($_POST['rank_image']))) ? trim($_POST['rank_image']) : ''; - if($rank_title == '') + if ($rank_title == '') { message_die(GENERAL_MESSAGE, $lang['MUST_SELECT_RANK']); } - if($special_rank == 1) + if ($special_rank == 1) { $max_posts = -1; $min_posts = -1; @@ -119,7 +116,7 @@ if($mode != '') // // The rank image has to be a jpg, gif or png // - if($rank_image != '') + if ($rank_image != '') { if (!preg_match('/(\.gif|\.png|\.jpg)$/is', $rank_image)) { @@ -131,17 +128,18 @@ if($mode != '') { if (!$special_rank) { - $sql = "UPDATE " . BB_USERS . " - SET user_rank = 0 - WHERE user_rank = $rank_id"; - - if(!$result = DB()->sql_query($sql)) + $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); } } $sql = "UPDATE " . BB_RANKS . " - SET rank_title = '". DB()->escape($rank_title) ."', rank_special = $special_rank, rank_min = $min_posts, rank_image = '". DB()->escape($rank_image) . "', rank_style = '". DB()->escape($rank_style) ."' + SET rank_title = '". DB()->escape($rank_title) ."', + rank_special = $special_rank, + rank_min = $min_posts, + rank_image = '". DB()->escape($rank_image) . "', + rank_style = '". DB()->escape($rank_style) ."' WHERE rank_id = $rank_id"; $message = $lang['RANK_UPDATED']; @@ -154,25 +152,25 @@ if($mode != '') $message = $lang['RANK_ADDED']; } - if(!$result = DB()->sql_query($sql)) + if (!$result = DB()->sql_query($sql)) { message_die(GENERAL_ERROR, "Couldn't update/insert into ranks table", '', __LINE__, __FILE__, $sql); } $message .= '

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

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', ''); - $datastore->update('ranks'); + $datastore->update('ranks'); message_die(GENERAL_MESSAGE, $message); } - else if($mode == 'delete') + elseif ($mode == 'delete') { // // Ok, they want to delete their rank // - if(isset($_POST['id']) || isset($_GET['id'])) + if (isset($_POST['id']) || isset($_GET['id'])) { $rank_id = (isset($_POST['id'])) ? intval($_POST['id']) : intval($_GET['id']); } @@ -181,30 +179,26 @@ if($mode != '') $rank_id = 0; } - if($rank_id) + if ($rank_id) { $sql = "DELETE 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 delete rank data", '', __LINE__, __FILE__, $sql); } - $sql = "UPDATE " . BB_USERS . " - SET user_rank = 0 - WHERE user_rank = $rank_id"; - - if(!$result = DB()->sql_query($sql)) + $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); } $message = $lang['RANK_REMOVED'] . '

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

' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', ''); - $datastore->update('ranks'); + $datastore->update('ranks'); message_die(GENERAL_MESSAGE, $message); - } else { @@ -235,14 +229,14 @@ else 'S_RANKS_ACTION' => "admin_ranks.php", )); - for($i = 0; $i < $rank_count; $i++) + for ($i = 0; $i < $rank_count; $i++) { $rank = $rank_rows[$i]['rank_title']; $special_rank = $rank_rows[$i]['rank_special']; $rank_id = $rank_rows[$i]['rank_id']; $rank_min = $rank_rows[$i]['rank_min']; - if($special_rank == 1) + if ($special_rank == 1) { $rank_min = $rank_max = '-'; } diff --git a/upload/admin/admin_topic_templates.php b/upload/admin/admin_topic_templates.php index ffafafb67..0960bb7ed 100644 --- a/upload/admin/admin_topic_templates.php +++ b/upload/admin/admin_topic_templates.php @@ -31,7 +31,7 @@ if ($mode == 'templates') 'S_ACTION' => "admin_topic_templates.php?mode=delete", )); } -else if ($mode == 'add' || $mode == 'edit') +elseif ($mode == 'add' || $mode == 'edit') { $template->assign_vars(array( 'TPL' => true, @@ -111,7 +111,7 @@ elseif ($mode == 'delete') print_confirmation(array( 'QUESTION' => $lang['QUESTION'], - 'ITEMS_LIST' => join('\n\n
  • \n', $names), + 'ITEMS_LIST' => join("\n
  • \n
  • \n", $names), 'FORM_ACTION' => "admin_topic_templates.php?mode=delete", 'HIDDEN_FIELDS' => build_hidden_fields($hidden_fields), )); diff --git a/upload/admin/admin_user_search.php b/upload/admin/admin_user_search.php index 84d6a795c..ccb2ff2a6 100644 --- a/upload/admin/admin_user_search.php +++ b/upload/admin/admin_user_search.php @@ -130,55 +130,55 @@ else { $mode = 'search_username'; } - else if(isset($_POST['search_email'])||isset($_GET['search_email'])) + elseif(isset($_POST['search_email'])||isset($_GET['search_email'])) { $mode = 'search_email'; } - else if(isset($_POST['search_ip'])||isset($_GET['search_ip'])) + elseif(isset($_POST['search_ip'])||isset($_GET['search_ip'])) { $mode = 'search_ip'; } - else if(isset($_POST['search_joindate'])||isset($_GET['search_joindate'])) + elseif(isset($_POST['search_joindate'])||isset($_GET['search_joindate'])) { $mode = 'search_joindate'; } - else if(isset($_POST['search_group'])||isset($_GET['search_group'])) + elseif(isset($_POST['search_group'])||isset($_GET['search_group'])) { $mode = 'search_group'; } - else if(isset($_POST['search_rank'])||isset($_GET['search_rank'])) + elseif(isset($_POST['search_rank'])||isset($_GET['search_rank'])) { $mode = 'search_rank'; } - else if(isset($_POST['search_postcount'])||isset($_GET['search_postcount'])) + elseif(isset($_POST['search_postcount'])||isset($_GET['search_postcount'])) { $mode = 'search_postcount'; } - else if(isset($_POST['search_userfield'])||isset($_GET['search_userfield'])) + elseif(isset($_POST['search_userfield'])||isset($_GET['search_userfield'])) { $mode = 'search_userfield'; } - else if(isset($_POST['search_lastvisited'])||isset($_GET['search_lastvisited'])) + elseif(isset($_POST['search_lastvisited'])||isset($_GET['search_lastvisited'])) { $mode = 'search_lastvisited'; } - else if(isset($_POST['search_language'])||isset($_GET['search_language'])) + elseif(isset($_POST['search_language'])||isset($_GET['search_language'])) { $mode = 'search_language'; } - else if(isset($_POST['search_timezone'])||isset($_GET['search_timezone'])) + elseif(isset($_POST['search_timezone'])||isset($_GET['search_timezone'])) { $mode = 'search_timezone'; } - else if(isset($_POST['search_style'])||isset($_GET['search_style'])) + elseif(isset($_POST['search_style'])||isset($_GET['search_style'])) { $mode = 'search_style'; } - else if(isset($_POST['search_moderators'])||isset($_GET['search_moderators'])) + elseif(isset($_POST['search_moderators'])||isset($_GET['search_moderators'])) { $mode = 'search_moderators'; } - else if(isset($_POST['search_misc'])||isset($_GET['search_misc'])) + elseif(isset($_POST['search_misc'])||isset($_GET['search_misc'])) { $mode = 'search_misc'; } @@ -465,7 +465,7 @@ else $users[] = $ip; } // We will also support wildcards, is this an xxx.xxx.* address? - else if( 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 @@ -497,7 +497,7 @@ else } } // Lastly, let's see if they have a range in the last quad, like xxx.xxx.xxx.xxx - xxx.xxx.xxx.yyy - else if( 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); @@ -538,13 +538,13 @@ else $ip_start = substr($address, 0, 2); } // num.num.xxx.xxx - else if( 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 - else if( 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); } diff --git a/upload/admin/index.php b/upload/admin/index.php index e49aae6d4..03e5532e8 100644 --- a/upload/admin/index.php +++ b/upload/admin/index.php @@ -56,7 +56,7 @@ if( isset($_GET['pane']) && $_GET['pane'] == 'left' ) } } } -else if( isset($_GET['pane']) && $_GET['pane'] == 'right' ) +elseif( isset($_GET['pane']) && $_GET['pane'] == 'right' ) { $template->assign_vars(array( 'TPL_ADMIN_MAIN' => true, @@ -122,26 +122,25 @@ else if( isset($_GET['pane']) && $_GET['pane'] == 'right' ) // $sql = "SELECT VERSION() AS mysql_version"; - if($result = DB()->sql_query($sql)) + if ($result = DB()->sql_query($sql)) { $row = DB()->sql_fetchrow($result); $version = $row['mysql_version']; - if( preg_match('/^(3\.23|4\.|5\.|10\.)/', $version) ) + if (preg_match('/^(3\.23|4\.|5\.|10\.)/', $version)) { $dblist = array(); - foreach($bb_cfg['db'] as $name => $row) + foreach ($bb_cfg['db'] as $name => $row) { - $sql = "SHOW TABLE STATUS - FROM {$row[1]}"; - if($result = DB()->sql_query($sql)) + $sql = "SHOW TABLE STATUS FROM {$row[1]}"; + if ($result = DB()->sql_query($sql)) { $tabledata_ary = DB()->sql_fetchrowset($result); $dbsize = 0; - for($i = 0; $i < count($tabledata_ary); $i++) + for ($i = 0; $i < count($tabledata_ary); $i++) { - if( @$tabledata_ary[$i]['Type'] != 'MRG_MyISAM' ) + if( @$tabledata_ary[$i]['Type'] != 'MRG_MYISAM' ) { $dbsize += $tabledata_ary[$i]['Data_length'] + $tabledata_ary[$i]['Index_length']; } @@ -289,19 +288,19 @@ else if( isset($_GET['pane']) && $_GET['pane'] == 'right' ) 'U_SYNC_USER_POSTS' => "index.php?sync_user_posts=1", )); } -else if (isset($_REQUEST['update_user_level'])) +elseif (isset($_REQUEST['update_user_level'])) { require(INC_DIR .'functions_group.php'); update_user_level('all'); bb_die($lang['USER_LEVELS_UPDATED']); } -else if (isset($_REQUEST['sync_topics'])) +elseif (isset($_REQUEST['sync_topics'])) { sync('topic', 'all'); sync('forum', 'all'); bb_die($lang['TOPICS_DATA_SYNCHRONIZED']); } -else if (isset($_REQUEST['sync_user_posts'])) +elseif (isset($_REQUEST['sync_user_posts'])) { sync('user_posts', 'all'); bb_die($lang['USER POSTS COUNT SYNCHRONIZED']); diff --git a/upload/ajax.php b/upload/ajax.php index fa55b5a9d..41a3f1698 100644 --- a/upload/ajax.php +++ b/upload/ajax.php @@ -122,7 +122,7 @@ class ajax_common { $this->ajax_die('no action specified'); } - else if (!$action_params =& $this->valid_actions[$action]) + elseif (!$action_params =& $this->valid_actions[$action]) { $this->ajax_die('invalid action: '. $action); } @@ -479,8 +479,8 @@ class ajax_common $this->response['type'] = $type; $this->response['post_id'] = $post_id; if ($type == 0) $this->response['html'] = ''; - else if ($type == 1) $this->response['html'] = '
    K'. profile_url($userdata) .' '. $lang['WROTE'] .':

    '. bbcode2html($text) .'
    '; - else if ($type == 2) $this->response['html'] = '
    !'. profile_url($userdata) .' '. $lang['WROTE'] .':

    '. bbcode2html($text) .'
    '; + elseif ($type == 1) $this->response['html'] = '
    K'. profile_url($userdata) .' '. $lang['WROTE'] .':

    '. bbcode2html($text) .'
    '; + elseif ($type == 2) $this->response['html'] = '
    !'. profile_url($userdata) .' '. $lang['WROTE'] .':

    '. bbcode2html($text) .'
    '; } function view_post () diff --git a/upload/ajax/edit_user_profile.php b/upload/ajax/edit_user_profile.php index 80cb28020..6c49c0f1e 100644 --- a/upload/ajax/edit_user_profile.php +++ b/upload/ajax/edit_user_profile.php @@ -68,7 +68,7 @@ switch ($field) { $this->ajax_die(sprintf($lang['BIRTHDAY_TO_HIGH'], $bb_cfg['birthday_max_age'])); } - else if ((bb_date(TIMENOW, 'Y', 'false') - $b_year) < $bb_cfg['birthday_min_age']) + elseif ((bb_date(TIMENOW, 'Y', 'false') - $b_year) < $bb_cfg['birthday_min_age']) { $this->ajax_die(sprintf($lang['BIRTHDAY_TO_LOW'], $bb_cfg['birthday_min_age'])); } diff --git a/upload/ajax/manage_user.php b/upload/ajax/manage_user.php index f74f170a0..ecfe0552d 100644 --- a/upload/ajax/manage_user.php +++ b/upload/ajax/manage_user.php @@ -18,6 +18,7 @@ switch ($mode) 'bb_cap_sid', ); + // foreach ($bb_cfg['cache']['engines'] as $cache_name => $cache_val) foreach ($gc_cache as $cache_name) { CACHE($cache_name)->rm(); diff --git a/upload/ajax/posts.php b/upload/ajax/posts.php index 615226225..449d358ce 100644 --- a/upload/ajax/posts.php +++ b/upload/ajax/posts.php @@ -71,7 +71,7 @@ switch($this->request['type']) { $this->ajax_die($lang['RULES_REPLY_CANNOT']); } - else if(!$is_auth['auth_reply']) + elseif(!$is_auth['auth_reply']) { $this->ajax_die(sprintf($lang['SORRY_AUTH_REPLY'], strip_tags($is_auth['auth_reply_type']))); } diff --git a/upload/ajax/user_register.php b/upload/ajax/user_register.php index 3120da2bd..b11d7eb5c 100644 --- a/upload/ajax/user_register.php +++ b/upload/ajax/user_register.php @@ -16,7 +16,7 @@ switch($mode) { $html = ' '. $lang['CHOOSE_A_NAME'] .''; } - else if($err = validate_username($username)) + elseif($err = validate_username($username)) { $html = ' '. $err .''; } @@ -29,7 +29,7 @@ switch($mode) { $html = ' '. $lang['CHOOSE_E_MAIL'] .''; } - else if($err = validate_email($email)) + elseif($err = validate_email($email)) { $html = ' '. $err .''; } diff --git a/upload/ajax/view_post.php b/upload/ajax/view_post.php index 0b738f153..c8317b012 100644 --- a/upload/ajax/view_post.php +++ b/upload/ajax/view_post.php @@ -39,7 +39,7 @@ if ($post_data['auth_read'] == AUTH_REG) $this->ajax_die($lang['NEED_TO_LOGIN_FIRST']); } } -else if ($post_data['auth_read'] != AUTH_ALL) +elseif ($post_data['auth_read'] != AUTH_ALL) { $is_auth = auth(AUTH_READ, $post_data['forum_id'], $user->data, $post_data); if (!$is_auth['auth_read']) diff --git a/upload/ajax/view_profile.php b/upload/ajax/view_profile.php index 5fbfe40fb..ef757dc89 100644 --- a/upload/ajax/view_profile.php +++ b/upload/ajax/view_profile.php @@ -89,7 +89,7 @@ switch ($mode) $type = $type = ''. $lang['RELEASER'] .''; $releasing_count++; } - else if ($rowset[$i]['seeder']) + elseif ($rowset[$i]['seeder']) { $s = $s + $rowset[$i]['size']; $type = $type = ''. $lang['SEEDER'] .''; diff --git a/upload/bt/announce.php b/upload/bt/announce.php index 42be6f92b..15bc122a4 100644 --- a/upload/bt/announce.php +++ b/upload/bt/announce.php @@ -112,7 +112,7 @@ if (!$bb_cfg['ignore_reported_ip'] && isset($_GET['ip']) && $ip !== $_GET['ip']) { $ip = $_GET['ip']; } - else if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && preg_match_all('#\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}#', $_SERVER['HTTP_X_FORWARDED_FOR'], $matches)) + elseif (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && preg_match_all('#\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}#', $_SERVER['HTTP_X_FORWARDED_FOR'], $matches)) { foreach ($matches[0] as $x_ip) { @@ -292,7 +292,7 @@ else { msg_die('Only '. $tr_cfg['limit_seed_count'] .' torrent(s) allowed for seeding'); } - else if (!$seeder && $tr_cfg['limit_leech_count'] && $row['active_torrents'] >= $tr_cfg['limit_leech_count']) + elseif (!$seeder && $tr_cfg['limit_leech_count'] && $row['active_torrents'] >= $tr_cfg['limit_leech_count']) { msg_die('Only '. $tr_cfg['limit_leech_count'] .' torrent(s) allowed for leeching'. $rating_msg); } @@ -321,7 +321,7 @@ else { msg_die('You can seed only from '. $tr_cfg['limit_seed_ips'] ." IP's"); } - else if (!$seeder && $tr_cfg['limit_leech_ips'] && $row['ips'] >= $tr_cfg['limit_leech_ips']) + elseif (!$seeder && $tr_cfg['limit_leech_ips'] && $row['ips'] >= $tr_cfg['limit_leech_ips']) { msg_die('You can leech only from '. $tr_cfg['limit_leech_ips'] ." IP's"); } @@ -357,7 +357,7 @@ if ($tr_cfg['gold_silver_enabled'] && $down_add) $down_add = 0; } // Silver releases - else if ($tor_type == TOR_TYPE_SILVER) + elseif ($tor_type == TOR_TYPE_SILVER) { $down_add = ceil($down_add/2); } diff --git a/upload/bt/includes/init_tr.php b/upload/bt/includes/init_tr.php index 5c4276809..6117daf37 100644 --- a/upload/bt/includes/init_tr.php +++ b/upload/bt/includes/init_tr.php @@ -375,7 +375,7 @@ class sql_db { $info[] = "$ext"; } - else if (!$num && ($aff = $this->affected_rows($this->result) AND $aff != -1)) + elseif (!$num && ($aff = $this->affected_rows($this->result) AND $aff != -1)) { $info[] = "$aff rows"; } @@ -398,7 +398,7 @@ class sql_db $this->sql_last_time = 0; } } - else if ($mode == 'end') + elseif ($mode == 'end') { if (SQL_CALC_QUERY_TIME || DBG_LOG || SQL_LOG_SLOW_QUERIES) { diff --git a/upload/config.php b/upload/config.php index 9ce68bfdf..2eeae03b2 100644 --- a/upload/config.php +++ b/upload/config.php @@ -56,7 +56,7 @@ $domain_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : $do // Increase number of revision after update $bb_cfg['tp_version'] = '2.5 (unstable)'; $bb_cfg['tp_release_date'] = '19-01-2014'; -$bb_cfg['tp_release_state'] = 'R561'; +$bb_cfg['tp_release_state'] = 'R562'; // Database $charset = 'utf8'; diff --git a/upload/develop/profiler/profiler_dbg.php b/upload/develop/profiler/profiler_dbg.php index 1db4f508e..7485bccee 100644 --- a/upload/develop/profiler/profiler_dbg.php +++ b/upload/develop/profiler/profiler_dbg.php @@ -321,8 +321,8 @@ class profiler_dbg extends profiler $perc_class = 'perc'; if ($line_perc > 5) $perc_class .= ' high5'; - else if ($line_perc > 3) $perc_class .= ' high3'; - else if ($line_perc > 1) $perc_class .= ' high1'; + elseif ($line_perc > 3) $perc_class .= ' high3'; + elseif ($line_perc > 1) $perc_class .= ' high1'; if ($line_src =& $module_src[$line_no-1]) { diff --git a/upload/dl_list.php b/upload/dl_list.php index 8a0ad03b7..cf9c3619c 100644 --- a/upload/dl_list.php +++ b/upload/dl_list.php @@ -19,17 +19,17 @@ if ($mode == 'set_dl_status' || $mode == 'set_topics_dl_status') $new_dl_status = DL_STATUS_WILL; $dl_key = 'dlw'; } - else if (isset($_POST['dl_set_down'])) + elseif (isset($_POST['dl_set_down'])) { $new_dl_status = DL_STATUS_DOWN; $dl_key = 'dld'; } - else if (isset($_POST['dl_set_complete'])) + elseif (isset($_POST['dl_set_complete'])) { $new_dl_status = DL_STATUS_COMPLETE; $dl_key = 'dlc'; } - else if (isset($_POST['dl_set_cancel'])) + elseif (isset($_POST['dl_set_cancel'])) { $new_dl_status = DL_STATUS_CANCEL; $dl_key = 'dla'; @@ -139,7 +139,7 @@ if ($mode == 'set_topics_dl_status') $req_topics_ary[] = (int) $topic_id; } } -else if ($mode == 'set_dl_status') +elseif ($mode == 'set_dl_status') { $req_topics_ary[] = (int) $topic_id; } diff --git a/upload/download.php b/upload/download.php index d4a1a691e..85e72ad48 100644 --- a/upload/download.php +++ b/upload/download.php @@ -44,7 +44,7 @@ function send_file_to_browser($attachment, $upload_dir) { $HTTP_USER_AGENT = $_SERVER['HTTP_USER_AGENT']; } - else if (!isset($HTTP_USER_AGENT)) + elseif (!isset($HTTP_USER_AGENT)) { $HTTP_USER_AGENT = ''; } @@ -54,27 +54,27 @@ function send_file_to_browser($attachment, $upload_dir) $browser_version = $log_version[2]; $browser_agent = 'opera'; } - else if (preg_match('/MSIE ([0-9].[0-9]{1,2})/', $HTTP_USER_AGENT, $log_version)) + elseif (preg_match('/MSIE ([0-9].[0-9]{1,2})/', $HTTP_USER_AGENT, $log_version)) { $browser_version = $log_version[1]; $browser_agent = 'ie'; } - else if (preg_match('/OmniWeb\/([0-9].[0-9]{1,2})/', $HTTP_USER_AGENT, $log_version)) + elseif (preg_match('/OmniWeb\/([0-9].[0-9]{1,2})/', $HTTP_USER_AGENT, $log_version)) { $browser_version = $log_version[1]; $browser_agent = 'omniweb'; } - else if (preg_match('/Netscape([0-9]{1})/', $HTTP_USER_AGENT, $log_version)) + elseif (preg_match('/Netscape([0-9]{1})/', $HTTP_USER_AGENT, $log_version)) { $browser_version = $log_version[1]; $browser_agent = 'netscape'; } - else if (preg_match('/Mozilla\/([0-9].[0-9]{1,2})/', $HTTP_USER_AGENT, $log_version)) + elseif (preg_match('/Mozilla\/([0-9].[0-9]{1,2})/', $HTTP_USER_AGENT, $log_version)) { $browser_version = $log_version[1]; $browser_agent = 'mozilla'; } - else if (preg_match('/Konqueror\/([0-9].[0-9]{1,2})/', $HTTP_USER_AGENT, $log_version)) + elseif (preg_match('/Konqueror\/([0-9].[0-9]{1,2})/', $HTTP_USER_AGENT, $log_version)) { $browser_version = $log_version[1]; $browser_agent = 'konqueror'; @@ -120,7 +120,7 @@ function send_file_to_browser($attachment, $upload_dir) } readfile($filename); } - else if (!$gotit && intval($attach_config['allow_ftp_upload'])) + elseif (!$gotit && intval($attach_config['allow_ftp_upload'])) { $conn_id = attach_init_ftp(); diff --git a/upload/includes/cron/cron_init.php b/upload/includes/cron/cron_init.php index 6fcc664b0..f70edd590 100644 --- a/upload/includes/cron/cron_init.php +++ b/upload/includes/cron/cron_init.php @@ -15,11 +15,11 @@ function cron_get_file_lock () $lock_obtained = @rename(CRON_ALLOWED, CRON_RUNNING); } - else if (file_exists(CRON_RUNNING)) + elseif (file_exists(CRON_RUNNING)) { cron_release_deadlock(); } - else if (!file_exists(CRON_ALLOWED) && !file_exists(CRON_RUNNING)) + elseif (!file_exists(CRON_ALLOWED) && !file_exists(CRON_RUNNING)) { file_write('', CRON_ALLOWED); $lock_obtained = @rename(CRON_ALLOWED, CRON_RUNNING); @@ -37,7 +37,7 @@ function cron_track_running ($mode) cron_touch_lock_file(CRON_RUNNING); file_write('', CRON_STARTMARK); } - else if ($mode == 'end') + elseif ($mode == 'end') { @unlink(CRON_STARTMARK); } diff --git a/upload/login.php b/upload/login.php index e23b8725f..331b41b5a 100644 --- a/upload/login.php +++ b/upload/login.php @@ -33,11 +33,11 @@ if (preg_match('/^redirect=([a-z0-9\.#\/\?&=\+\-_]+)/si', $_SERVER['QUERY_STRING $redirect_url[$first_amp] = '?'; } } -else if (!empty($_POST['redirect'])) +elseif (!empty($_POST['redirect'])) { $redirect_url = str_replace('&', '&', htmlspecialchars($_POST['redirect'])); } -else if (!empty($_SERVER['HTTP_REFERER']) && ($parts = @parse_url($_SERVER['HTTP_REFERER']))) +elseif (!empty($_SERVER['HTTP_REFERER']) && ($parts = @parse_url($_SERVER['HTTP_REFERER']))) { $redirect_url = (isset($parts['path']) ? $parts['path'] : "index.php") . (isset($parts['query']) ? '?'. $parts['query'] : ''); } diff --git a/upload/modcp.php b/upload/modcp.php index a232e6d22..a25182f5d 100644 --- a/upload/modcp.php +++ b/upload/modcp.php @@ -28,7 +28,7 @@ function return_msg_mcp ($status_msg) $message .= sprintf($lang['CLICK_RETURN_TOPIC'], '', ''); $message .= '

    '; } - else if (count($req_topics) != 1) + elseif (count($req_topics) != 1) { $message .= sprintf($lang['CLICK_RETURN_MODCP'], '', ''); $message .= '

    '; @@ -78,23 +78,23 @@ else { $mode = 'delete'; } - else if (isset($_REQUEST['move']) || @$_POST['mod_action'] === 'topic_move') + elseif (isset($_REQUEST['move']) || @$_POST['mod_action'] === 'topic_move') { $mode = 'move'; } - else if (isset($_REQUEST['lock']) || @$_POST['mod_action'] === 'topic_lock') + elseif (isset($_REQUEST['lock']) || @$_POST['mod_action'] === 'topic_lock') { $mode = 'lock'; } - else if (isset($_REQUEST['unlock']) || @$_POST['mod_action'] === 'topic_unlock') + elseif (isset($_REQUEST['unlock']) || @$_POST['mod_action'] === 'topic_unlock') { $mode = 'unlock'; } - else if (isset($_REQUEST['post_pin']) || @$_POST['mod_action'] === 'post_pin') + elseif (isset($_REQUEST['post_pin']) || @$_POST['mod_action'] === 'post_pin') { $mode = 'post_pin'; } - else if (isset($_REQUEST['post_unpin']) || @$_POST['mod_action'] === 'post_unpin') + elseif (isset($_REQUEST['post_unpin']) || @$_POST['mod_action'] === 'post_unpin') { $mode = 'post_unpin'; } @@ -122,7 +122,7 @@ if ($topic_id) $forum_name = $topic_row['forum_name']; $forum_topics = (!$topic_row['forum_topics']) ? 1 : $topic_row['forum_topics']; } -else if ($forum_id) +elseif ($forum_id) { $sql = "SELECT forum_name, forum_topics FROM ". BB_FORUMS ." WHERE forum_id = $forum_id LIMIT 1"; @@ -163,7 +163,7 @@ if ($mode == 'ip') // Moderator can view IP in all forums $is_auth['auth_mod'] = $is_moderator; } -else if ($mode == 'move' && !$is_auth['auth_mod']) +elseif ($mode == 'move' && !$is_auth['auth_mod']) { // User can move his own topic if this forum is "self_moderated" if ($topic_id && $topic_row['self_moderated'] && $topic_row['topic_poster'] == $userdata['user_id']) @@ -564,7 +564,7 @@ switch ($mode) } } //mpd - else if ($post_id_sql && $delete_posts) + elseif ($post_id_sql && $delete_posts) { if (!$is_auth['auth_delete']) { diff --git a/upload/posting.php b/upload/posting.php index 71cd99388..10327aeed 100644 --- a/upload/posting.php +++ b/upload/posting.php @@ -61,15 +61,15 @@ $is_auth = array(); switch ($mode) { case 'newtopic': - if(bf($userdata['user_opt'], 'user_opt', 'allow_topic')) - { - bb_die($lang['RULES_POST_CANNOT']); - } + if (bf($userdata['user_opt'], 'user_opt', 'allow_topic')) + { + bb_die($lang['RULES_POST_CANNOT']); + } if ($topic_type == POST_ANNOUNCE) { $is_auth_type = 'auth_announce'; } - else if ($topic_type == POST_STICKY) + elseif ($topic_type == POST_STICKY) { $is_auth_type = 'auth_sticky'; } @@ -77,32 +77,37 @@ switch ($mode) { $is_auth_type = 'auth_post'; } - break; + break; + case 'reply': case 'quote': - if(bf($userdata['user_opt'], 'user_opt', 'allow_post')) - { - bb_die($lang['RULES_REPLY_CANNOT']); - } + if (bf($userdata['user_opt'], 'user_opt', 'allow_post')) + { + bb_die($lang['RULES_REPLY_CANNOT']); + } $is_auth_type = 'auth_reply'; - break; + break; + case 'editpost': - if(bf($userdata['user_opt'], 'user_opt', 'allow_post_edit')) - { - bb_die($lang['RULES_EDIT_CANNOT']); - } + if (bf($userdata['user_opt'], 'user_opt', 'allow_post_edit')) + { + bb_die($lang['RULES_EDIT_CANNOT']); + } $is_auth_type = 'auth_edit'; - break; + break; + case 'delete': case 'poll_delete': $is_auth_type = 'auth_delete'; - break; + break; + case 'vote': $is_auth_type = 'auth_vote'; - break; + break; + default: message_die(GENERAL_MESSAGE, $lang['NO_POST_MODE']); - break; + break; } // Here we do various lookups to find topic_id, forum_id, post_id etc. @@ -117,7 +122,7 @@ switch ($mode) message_die(GENERAL_MESSAGE, $lang['FORUM_NOT_EXIST']); } $sql = "SELECT * FROM ". BB_FORUMS ." WHERE forum_id = $forum_id LIMIT 1"; - break; + break; case 'reply': case 'vote': @@ -130,7 +135,7 @@ switch ($mode) WHERE t.topic_id = $topic_id AND f.forum_id = t.forum_id LIMIT 1"; - break; + break; case 'quote': case 'editpost': @@ -158,7 +163,7 @@ switch ($mode) " : ''; $sql = "$select_sql $from_sql $where_sql LIMIT 1"; - break; + break; default: message_die(GENERAL_MESSAGE, $lang['NO_VALID_MODE']); @@ -175,7 +180,7 @@ if ($post_info = DB()->fetch_row($sql)) { message_die(GENERAL_MESSAGE, $lang['FORUM_LOCKED']); } - else if ($mode != 'newtopic' && $post_info['topic_status'] == TOPIC_LOCKED && !$is_auth['auth_mod']) + elseif ($mode != 'newtopic' && $post_info['topic_status'] == TOPIC_LOCKED && !$is_auth['auth_mod']) { message_die(GENERAL_MESSAGE, $lang['TOPIC_LOCKED']); } @@ -235,11 +240,11 @@ if ($post_info = DB()->fetch_row($sql)) message_die(GENERAL_MESSAGE, $message); } - else if (!$post_data['last_post'] && !$is_auth['auth_mod'] && ($mode == 'delete' || $delete)) + elseif (!$post_data['last_post'] && !$is_auth['auth_mod'] && ($mode == 'delete' || $delete)) { message_die(GENERAL_MESSAGE, $lang['CANNOT_DELETE_REPLIED']); } - else if (!$post_data['edit_poll'] && !$is_auth['auth_mod'] && ($mode == 'poll_delete' || $poll_delete)) + elseif (!$post_data['edit_poll'] && !$is_auth['auth_mod'] && ($mode == 'poll_delete' || $poll_delete)) { message_die(GENERAL_MESSAGE, $lang['CANNOT_DELETE_POLL']); } @@ -405,7 +410,7 @@ if ( ( $delete || $poll_delete || $mode == 'delete' ) && !$confirm ) 'HIDDEN_FIELDS' => build_hidden_fields($hidden_fields), )); } -else if ( $mode == 'vote' ) +elseif ( $mode == 'vote' ) { // // Vote in a poll @@ -480,8 +485,8 @@ else if ( $mode == 'vote' ) } } //snp -// else if ( $submit || $confirm ) -else if ( ($submit || $confirm) && !$topic_has_new_posts ) +// elseif ( $submit || $confirm ) +elseif ( ($submit || $confirm) && !$topic_has_new_posts ) //snp end { // @@ -611,11 +616,11 @@ if( $refresh || isset($_POST['del_poll_option']) || $error_msg || ($submit && $t # while( list($option_id, $option_text) = @each($_POST['poll_option_text']) ) foreach ($_POST['poll_option_text'] as $option_id => $option_text) { - if( isset($_POST['del_poll_option'][$option_id]) ) + if (isset($_POST['del_poll_option'][$option_id])) { unset($poll_options[$option_id]); } - else if ( !empty($option_text) ) + elseif (!empty($option_text)) { $poll_options[$option_id] = clean_title($option_text); } @@ -655,13 +660,13 @@ else $subject = ''; $message = ''; } - else if ( $mode == 'reply' ) + elseif ( $mode == 'reply' ) { $username = ( $userdata['session_logged_in'] ) ? $userdata['username'] : ''; $subject = ''; $message = ''; } - else if ( $mode == 'quote' || $mode == 'editpost' ) + elseif ( $mode == 'quote' || $mode == 'editpost' ) { $subject = ( $post_data['first_post'] ) ? $post_info['topic_title'] : ''; $message = $post_info['post_text']; diff --git a/upload/viewforum.php b/upload/viewforum.php index 48d714bcb..5cce8892e 100644 --- a/upload/viewforum.php +++ b/upload/viewforum.php @@ -53,7 +53,7 @@ if ($only_new == ONLY_NEW_POSTS) { $only_new_sql = "AND t.topic_last_post_time > $lastvisit"; } -else if ($only_new == ONLY_NEW_TOPICS) +elseif ($only_new == ONLY_NEW_TOPICS) { $only_new_sql = "AND t.topic_time > $lastvisit"; } @@ -181,12 +181,12 @@ if (!$forum_data['forum_parent'] && isset($forums['f'][$forum_id]['subforums']) { $folder_image = $images['forum_locked']; } - else if (is_unread($sf_data['topic_last_post_time'], $sf_last_tid, $sf_forum_id)) + elseif (is_unread($sf_data['topic_last_post_time'], $sf_last_tid, $sf_forum_id)) { $folder_image = $images['forum_new']; } - $last_post_user = profile_url(array('username' => $sf_data['sf_last_username'], 'user_id' => $sf_data['sf_last_user_id'], 'user_rank' => $sf_data['user_rank'])); + $last_post_user = profile_url(array('username' => $sf_data['sf_last_username'], 'user_id' => $sf_data['sf_last_user_id'], 'user_rank' => $sf_data['user_rank'])); if ($sf_data['forum_last_post_id']) { @@ -226,7 +226,7 @@ if (!$forum_data['forum_parent'] && isset($forums['f'][$forum_id]['subforums']) } } } -else if ($parent_id = $forum_data['forum_parent']) +elseif ($parent_id = $forum_data['forum_parent']) { $template->assign_vars(array( 'HAS_PARENT_FORUM' => true, @@ -475,12 +475,12 @@ foreach ($topic_rowset as $topic) define('ANNOUNCE_SEP', true); $separator = $lang['TOPICS_ANNOUNCEMENT']; } - else if ($t_type == POST_STICKY && !defined('STICKY_SEP')) + elseif ($t_type == POST_STICKY && !defined('STICKY_SEP')) { define('STICKY_SEP', true); $separator = $lang['TOPICS_STICKY']; } - else if ($t_type == POST_NORMAL && !defined('NORMAL_SEP')) + elseif ($t_type == POST_NORMAL && !defined('NORMAL_SEP')) { if (defined('ANNOUNCE_SEP') || defined('STICKY_SEP')) { diff --git a/upload/viewtopic.php b/upload/viewtopic.php index 282bdcb73..8877379e6 100644 --- a/upload/viewtopic.php +++ b/upload/viewtopic.php @@ -94,7 +94,7 @@ if ($topic_id) AND f.forum_id = t.forum_id LIMIT 1"; } -else if ($post_id) +elseif ($post_id) { $sql = "SELECT t.*, f.*, p.post_time FROM ". BB_TOPICS ." t, ". BB_FORUMS ." f, ". BB_POSTS ." p @@ -496,7 +496,7 @@ if ( $is_auth['auth_mod'] ) } } } -else if (($t_data['topic_poster'] == $userdata['user_id']) && $userdata['session_logged_in'] && $t_data['self_moderated']) +elseif (($t_data['topic_poster'] == $userdata['user_id']) && $userdata['session_logged_in'] && $t_data['self_moderated']) { $topic_mod .= "' . $lang['MOVE_TOPIC'] . ' '; } @@ -852,7 +852,7 @@ for($i = 0; $i < $total_posts; $i++) { $user_sig = $lang['SIGNATURE_DISABLE']; } - else if ($user_sig) + elseif ($user_sig) { $user_sig = bbcode2html($user_sig); } @@ -938,7 +938,7 @@ for($i = 0; $i < $total_posts; $i++) { $post_mod_comment_html = '
    K'. $postrow[$i]['post_mc_mod_name'] .' '. $lang['WROTE'] .':

    '. bbcode2html($postrow[$i]['post_mod_comment']) .'
    '; } - else if ($postrow[$i]['post_mod_comment_type'] == 2) + elseif ($postrow[$i]['post_mod_comment_type'] == 2) { $post_mod_comment_html = '
    !'. $postrow[$i]['post_mc_mod_name'] .' '. $lang['WROTE'] .':

    '. bbcode2html($postrow[$i]['post_mod_comment']) .'
    '; }