diff options
author | Paul S. Owen <psotfx@users.sourceforge.net> | 2002-03-31 00:06:34 +0000 |
---|---|---|
committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2002-03-31 00:06:34 +0000 |
commit | e1f7400b8da1088ebabd351fe9b6e1f246c34531 (patch) | |
tree | f5271ef99c1d83076002f1cb9d43e8728e40398e /phpBB/includes | |
parent | f74fa81851cb9b03cd84400e9a4817f216b09a5b (diff) | |
download | forums-e1f7400b8da1088ebabd351fe9b6e1f246c34531.tar forums-e1f7400b8da1088ebabd351fe9b6e1f246c34531.tar.gz forums-e1f7400b8da1088ebabd351fe9b6e1f246c34531.tar.bz2 forums-e1f7400b8da1088ebabd351fe9b6e1f246c34531.tar.xz forums-e1f7400b8da1088ebabd351fe9b6e1f246c34531.zip |
pre-freeze on main templates, various bug fixes (highlighting search results, various search related issues, blah blah). These updates need _thorough_ checking, quickly
git-svn-id: file:///svn/phpbb/trunk@2448 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/functions.php | 19 | ||||
-rw-r--r-- | phpBB/includes/functions_search.php | 140 | ||||
-rw-r--r-- | phpBB/includes/page_header.php | 168 | ||||
-rw-r--r-- | phpBB/includes/topic_review.php | 67 | ||||
-rw-r--r-- | phpBB/includes/usercp_avatar.php | 5 | ||||
-rw-r--r-- | phpBB/includes/usercp_email.php | 36 | ||||
-rw-r--r-- | phpBB/includes/usercp_register.php | 31 | ||||
-rw-r--r-- | phpBB/includes/usercp_sendpasswd.php | 72 | ||||
-rw-r--r-- | phpBB/includes/usercp_viewprofile.php | 105 |
9 files changed, 292 insertions, 351 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 602d241578..8ae87f656f 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -90,9 +90,9 @@ function get_userdata($user) return ( $row = $db->sql_fetchrow($result) ) ? $row : false; } -function make_jumpbox($match_forum_id = 0) +function make_jumpbox($action, $match_forum_id = 0) { - global $lang, $db, $SID, $nav_links, $phpEx; + global $template, $lang, $db, $SID, $nav_links, $phpEx; $sql = "SELECT c.cat_id, c.cat_title, c.cat_order FROM " . CATEGORIES_TABLE . " c, " . FORUMS_TABLE . " f @@ -174,7 +174,20 @@ function make_jumpbox($match_forum_id = 0) $boxstring .= '<input type="hidden" name="sid" value="' . $SID . '" />'; } - return $boxstring; + $template->set_filenames(array( + 'jumpbox' => 'jumpbox.tpl') + ); + $template->assign_vars(array( + 'L_GO' => $lang['Go'], + 'L_JUMP_TO' => $lang['Jump_to'], + 'L_SELECT_FORUM' => $lang['Select_forum'], + + 'S_JUMPBOX_SELECT' => $boxstring, + 'S_JUMPBOX_ACTION' => append_sid($action)) + ); + $template->assign_var_from_handle('JUMPBOX', 'jumpbox'); + + return; } // diff --git a/phpBB/includes/functions_search.php b/phpBB/includes/functions_search.php index b28bf699ee..b74ac398b4 100644 --- a/phpBB/includes/functions_search.php +++ b/phpBB/includes/functions_search.php @@ -22,20 +22,12 @@ function clean_words($mode, &$entry, &$stopword_list, &$synonym_list) { // Weird, $init_match doesn't work with static when double quotes (") are used... - static $drop_char_match = array('^', '$', '&', '(', ')', '<', '>', '`', "'", '|', ',', '@', '_', '?', '%', '-', '~', '+', '.', '[', ']', '{', '}', ':', '\\', '/', '=', '#', '\'', ';', '!'); - static $drop_char_replace = array(' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' , ' ', ' ', ' ', ' ', ' ', ' '); - -// static $accent_match = array("�", "�", "�", "�", "�", "�", "�", "�", "�", "�", "�", "�", "�", "�", "�", "�", "�", "�", "�", "�", "�", "�", "�", "�", "�", "�", "�", "�", "�", "�", "�", "�"); -// static $accent_replace = array("s", "a", "a", "a", "a", "a", "a", "a", "c", "e", "e", "e", "e", "i", "i", "i", "i", "o", "n", "o", "o", "o", "o", "o", "o", "u", "u", "u", "u", "y", "t", "y"); + static $drop_char_match = array('^', '$', '&', '(', ')', '<', '>', '`', '\'', '"', '|', ',', '@', '_', '?', '%', '-', '~', '+', '.', '[', ']', '{', '}', ':', '\\', '/', '=', '#', '\'', ';', '!'); + static $drop_char_replace = array(' ', ' ', ' ', ' ', ' ', ' ', ' ', '', '', ' ', ' ', ' ', ' ', '', ' ', ' ', '', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' , ' ', ' ', ' ', ' ', ' ', ' '); $entry = ' ' . strip_tags(strtolower($entry)) . ' '; - for($i = 0; $i < count($accent_match); $i++) - { - $entry = str_replace($accent_match[$i], $accent_replace[$i], $entry); - } - - if( $mode == 'post' ) + if ( $mode == 'post' ) { // Replace line endings by a space $entry = preg_replace('/[\n\r]/is', ' ', $entry); @@ -48,7 +40,7 @@ function clean_words($mode, &$entry, &$stopword_list, &$synonym_list) $entry = preg_replace('/\[\/?url(=.*?)?\]/', ' ', $entry); $entry = preg_replace('/\[\/?[a-z\*=\+\-]+(\:?[0-9a-z]+)?:[a-z0-9]{10,}(\:[a-z0-9]+)?=?.*?\]/', ' ', $entry); } - else if( $mode == 'search' ) + else if ( $mode == 'search' ) { $entry = str_replace('+', ' and ', $entry); $entry = str_replace('-', ' not ', $entry); @@ -65,15 +57,15 @@ function clean_words($mode, &$entry, &$stopword_list, &$synonym_list) $entry = str_replace($drop_char_match[$i], $drop_char_replace[$i], $entry); } - if( $mode == 'post' ) + if ( $mode == 'post' ) { $entry = str_replace('*', ' ', $entry); // 'words' that consist of <=3 or >=25 characters are removed. - $entry = preg_replace('/\b([a-z0-9]{1,3}|[a-z0-9]{25,})\b/',' ', $entry); + $entry = preg_replace('/\b([a-z0-9]{1,3}|[a-z0-9]{20,})\b/',' ', $entry); } - if( !empty($stopword_list) ) + if ( !empty($stopword_list) ) { for ($j = 0; $j < count($stopword_list); $j++) { @@ -86,7 +78,7 @@ function clean_words($mode, &$entry, &$stopword_list, &$synonym_list) } } - if( !empty($synonym_list) ) + if ( !empty($synonym_list) ) { for ($j = 0; $j < count($synonym_list); $j++) { @@ -103,7 +95,7 @@ function clean_words($mode, &$entry, &$stopword_list, &$synonym_list) function split_words(&$entry, $mode = 'post') { - if( $mode == 'post' ) + if ( $mode == 'post' ) { preg_match_all("/\b(\w[\w']*\w+|\w+?)\b/", $entry, $split_entries); } @@ -128,10 +120,10 @@ function add_search_words($post_id, $post_text, $post_title = '') $word = array(); $word_insert_sql = array(); - while( list($word_in, $search_matches) = @each($search_raw_words) ) + while ( list($word_in, $search_matches) = @each($search_raw_words) ) { $word_insert_sql[$word_in] = ''; - if( !empty($search_matches) ) + if ( !empty($search_matches) ) { for ($i = 0; $i < count($search_matches); $i++) { @@ -149,7 +141,7 @@ function add_search_words($post_id, $post_text, $post_title = '') } } - if( count($word) ) + if ( count($word) ) { sort($word); @@ -178,12 +170,12 @@ function add_search_words($post_id, $post_text, $post_title = '') $sql = "SELECT word_id, word_text FROM " . SEARCH_WORD_TABLE . " WHERE word_text IN ($word_text_sql)"; - if( !($result = $db->sql_query($sql)) ) + if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not select words', '', __LINE__, __FILE__, $sql); } - while( $row = $db->sql_fetchrow($result) ) + while ( $row = $db->sql_fetchrow($result) ) { $check_words[$row['word_text']] = $row['word_id']; } @@ -195,18 +187,18 @@ function add_search_words($post_id, $post_text, $post_title = '') for ($i = 0; $i < count($word); $i++) { $new_match = true; - if( isset($check_words[$word[$i]]) ) + if ( isset($check_words[$word[$i]]) ) { $new_match = false; } - if( $new_match ) + if ( $new_match ) { switch( SQL_LAYER ) { case 'mysql': case 'mysql4': - $value_sql .= ( ( $value_sql != '' ) ? ', ' : '' ) . "('" . $word[$i] . "')"; + $value_sql .= ( ( $value_sql != '' ) ? ', ' : '' ) . '(\'' . $word[$i] . '\')'; break; case 'mssql': $value_sql .= ( ( $value_sql != '' ) ? ' UNION ALL ' : '' ) . "SELECT '" . $word[$i] . "'"; @@ -238,7 +230,7 @@ function add_search_words($post_id, $post_text, $post_title = '') break; } - if( !($result = $db->sql_query($sql)) ) + if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not insert new word', '', __LINE__, __FILE__, $sql); } @@ -255,7 +247,7 @@ function add_search_words($post_id, $post_text, $post_title = '') SELECT $post_id, word_id, $title_match FROM " . SEARCH_WORD_TABLE . " WHERE word_text IN ($match_sql)"; - if( !($result = $db->sql_query($sql)) ) + if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not insert new word matches', '', __LINE__, __FILE__, $sql); } @@ -278,18 +270,18 @@ function remove_common($mode, $fraction, $word_id_list = array()) global $db; $sql = ( $mode == 'global' ) ? "SELECT COUNT(post_id) AS total_posts FROM " . SEARCH_MATCH_TABLE . " GROUP BY post_id" : "SELECT SUM(forum_posts) AS total_posts FROM " . FORUMS_TABLE; - if( !($result = $db->sql_query($sql)) ) + if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not obtain post count', '', __LINE__, __FILE__, $sql); } $row = $db->sql_fetchrow($result); - if( $row['total_posts'] >= 100 ) + if ( $row['total_posts'] >= 100 ) { $common_threshold = floor($row['total_posts'] * $fraction); - if( $mode == 'single' && count($word_id_list) ) + if ( $mode == 'single' && count($word_id_list) ) { $word_id_sql = ''; for($i = 0; $i < count($word_id_list); $i++) @@ -312,32 +304,32 @@ function remove_common($mode, $fraction, $word_id_list = array()) HAVING COUNT(word_id) > $common_threshold"; } - if( !($result = $db->sql_query($sql)) ) + if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not obtain common word list', '', __LINE__, __FILE__, $sql); } $common_word_id = ''; - while( $row = $db->sql_fetchrow($result) ) + while ( $row = $db->sql_fetchrow($result) ) { $common_word_id .= ( ( $common_word_id != '' ) ? ', ' : '' ) . $row['word_id']; } $db->sql_freeresult($result); - if( $common_word_id != '' ) + if ( $common_word_id != '' ) { $sql = "UPDATE " . SEARCH_WORD_TABLE . " SET word_common = " . TRUE . " WHERE word_id IN ($common_word_id)"; - if( !($result = $db->sql_query($sql)) ) + if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not delete word list entry', '', __LINE__, __FILE__, $sql); } $sql = "DELETE FROM " . SEARCH_MATCH_TABLE . " WHERE word_id IN ($common_word_id)"; - if( !($result = $db->sql_query($sql)) ) + if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not delete word match entry', '', __LINE__, __FILE__, $sql); } @@ -353,7 +345,7 @@ function remove_search_post($post_id_sql) $words_removed = false; - switch( SQL_LAYER ) + switch ( SQL_LAYER ) { case 'mysql': case 'mysql4': @@ -364,7 +356,7 @@ function remove_search_post($post_id_sql) if ( $result = $db->sql_query($sql) ) { $word_id_sql = ''; - while( $row = $db->sql_fetchrow($result) ) + while ( $row = $db->sql_fetchrow($result) ) { $word_id_sql .= ( $word_id_sql != '' ) ? ', ' . $row['word_id'] : $row['word_id']; } @@ -377,7 +369,7 @@ function remove_search_post($post_id_sql) if ( $result = $db->sql_query($sql) ) { $word_id_sql = ''; - while( $row = $db->sql_fetchrow($result) ) + while ( $row = $db->sql_fetchrow($result) ) { $word_id_sql .= ( $word_id_sql != '' ) ? ', ' . $row['word_id'] : $row['word_id']; } @@ -434,12 +426,12 @@ function remove_search_post($post_id_sql) // // Username search // -function username_search($search_match, $is_inline_review = 0, $default_list = "") +function username_search($search_match) { global $db, $board_config, $template, $lang, $images, $theme, $phpEx, $phpbb_root_path; global $starttime; - $author_list = ''; + $username_list = ''; if ( !empty($search_match) ) { $username_search = preg_replace('/\*/', '%', trim(strip_tags($search_match))); @@ -457,55 +449,49 @@ function username_search($search_match, $is_inline_review = 0, $default_list = " { do { - $author_list .= '<option value="' . $row['username'] . '">' .$row['username'] . '</option>'; + $username_list .= '<option value="' . $row['username'] . '">' . $row['username'] . '</option>'; } while ( $row = $db->sql_fetchrow($result) ); } else { - $author_list = '<option>' . $lang['No_match']. '</option>'; + $username_list .= '<option>' . $lang['No_match']. '</option>'; } - } - if ( !$is_inline_review ) - { - $gen_simple_header = TRUE; - $page_title = $lang['Search']; - include($phpbb_root_path . 'includes/page_header.'.$phpEx); - - $template->set_filenames(array( - 'search_user_body' => 'search_username.tpl') - ); - - $template->assign_vars(array( - 'L_CLOSE_WINDOW' => $lang['Close_window'], - 'L_SEARCH_USERNAME' => $lang['Find_username'], - 'L_UPDATE_USERNAME' => $lang['Select_username'], - 'L_SELECT' => $lang['Select'], - 'L_SEARCH' => $lang['Search'], - 'L_SEARCH_EXPLAIN' => $lang['Search_author_explain'], - 'L_CLOSE_WINDOW' => $lang['Close_window'], - - 'S_AUTHOR_OPTIONS' => $author_list, - 'S_SEARCH_ACTION' => append_sid("search.$phpEx?mode=searchuser")) - ); - - // - // If we have results then dump them out and enable - // the appropriate switch block - // - if ( !empty($author_list) ) - { - $template->assign_block_vars('switch_select_name', array()); - } + $gen_simple_header = TRUE; + $page_title = $lang['Search']; + include($phpbb_root_path . 'includes/page_header.'.$phpEx); + + $template->set_filenames(array( + 'search_user_body' => 'search_username.tpl') + ); + + $template->assign_vars(array( + 'USERNAME' => ( !empty($search_match) ) ? $search_match : '', + + 'L_CLOSE_WINDOW' => $lang['Close_window'], + 'L_SEARCH_USERNAME' => $lang['Find_username'], + 'L_UPDATE_USERNAME' => $lang['Select_username'], + 'L_SELECT' => $lang['Select'], + 'L_SEARCH' => $lang['Search'], + 'L_SEARCH_EXPLAIN' => $lang['Search_author_explain'], + 'L_CLOSE_WINDOW' => $lang['Close_window'], - $template->pparse('search_user_body'); + 'S_USERNAME_OPTIONS' => $username_list, + 'S_SEARCH_ACTION' => append_sid("search.$phpEx?mode=searchuser")) + ); - include($phpbb_root_path . 'includes/page_tail.'.$phpEx); + if ( $username_list != '' ) + { + $template->assign_block_vars('switch_select_name', array()); } - return($author_list); + $template->pparse('search_user_body'); + + include($phpbb_root_path . 'includes/page_tail.'.$phpEx); + + return; } ?>
\ No newline at end of file diff --git a/phpBB/includes/page_header.php b/phpBB/includes/page_header.php index 1d6465f4d1..8fde164676 100644 --- a/phpBB/includes/page_header.php +++ b/phpBB/includes/page_header.php @@ -31,22 +31,22 @@ define('HEADER_INC', TRUE); // gzip_compression // $do_gzip_compress = FALSE; -if($board_config['gzip_compress']) +if ( $board_config['gzip_compress'] ) { $phpver = phpversion(); - if($phpver >= '4.0.4pl1') + if ( $phpver >= '4.0.4pl1' ) { - if(extension_loaded('zlib')) + if ( extension_loaded('zlib') ) { ob_start('ob_gzhandler'); } } - else if($phpver > '4.0') + else if ( $phpver > '4.0' ) { - if(strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip')) + if ( strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip') ) { - if(extension_loaded('zlib')) + if ( extension_loaded('zlib') ) { $do_gzip_compress = TRUE; ob_start(); @@ -68,14 +68,14 @@ $template->set_filenames(array( // // Generate logged in/logged out status // -if($userdata['session_logged_in']) +if ( $userdata['session_logged_in'] ) { - $u_login_logout = "login.$phpEx?logout=true"; - $l_login_logout = $lang['Logout'] . ' [ ' . $userdata["username"] . ' ]'; + $u_login_logout = 'login.'.$phpEx.'?logout=true'; + $l_login_logout = $lang['Logout'] . ' [ ' . $userdata['username'] . ' ]'; } else { - $u_login_logout = "login.$phpEx"; + $u_login_logout = 'login.'.$phpEx; $l_login_logout = $lang['Login']; } @@ -87,7 +87,6 @@ $s_last_visit = ( $userdata['session_logged_in'] ) ? create_date($board_config[' // $user_forum_sql = ( !empty($forum_id) ) ? "AND ( u.user_session_page = $forum_id OR s.session_page = $forum_id)" : ''; - $sql = "SELECT u.username, u.user_id, u.user_allow_viewonline, u.user_level, s.session_logged_in, s.session_ip FROM ".USERS_TABLE." u, ".SESSIONS_TABLE." s WHERE u.user_id = s.session_user_id @@ -95,8 +94,7 @@ $sql = "SELECT u.username, u.user_id, u.user_allow_viewonline, u.user_level, s.s OR u.user_session_time >= " . ( time() - 300 ) . " ) $user_forum_sql ORDER BY u.username ASC, s.session_ip ASC"; -$result = $db->sql_query($sql); -if(!$result) +if( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not obtain user/online information', '', __LINE__, __FILE__, $sql); } @@ -115,24 +113,24 @@ $prev_user_ip = ''; while( $row = $db->sql_fetchrow($result) ) { // User is logged in and therefor not a guest - if( $row['session_logged_in'] ) + if ( $row['session_logged_in'] ) { // Skip multiple sessions for one user - if( $row['user_id'] != $prev_user_id ) + if ( $row['user_id'] != $prev_user_id ) { $style_color = ''; - if( $row['user_level'] == ADMIN ) + if ( $row['user_level'] == ADMIN ) { $row['username'] = '<b>' . $row['username'] . '</b>'; $style_color = 'style="color:#' . $theme['fontcolor3'] . '"'; } - else if( $row['user_level'] == MOD ) + else if ( $row['user_level'] == MOD ) { $row['username'] = '<b>' . $row['username'] . '</b>'; $style_color = 'style="color:#' . $theme['fontcolor2'] . '"'; } - if( $row['user_allow_viewonline'] ) + if ( $row['user_allow_viewonline'] ) { $user_online_link = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'>' . $row['username'] . '</a>'; $logged_visible_online++; @@ -143,26 +141,27 @@ while( $row = $db->sql_fetchrow($result) ) $logged_hidden_online++; } - if( $row['user_allow_viewonline'] || $userdata['user_level'] == ADMIN ) + if ( $row['user_allow_viewonline'] || $userdata['user_level'] == ADMIN ) { - $online_userlist .= ( $online_userlist != "" ) ? ", " . $user_online_link : $user_online_link; + $online_userlist .= ( $online_userlist != '' ) ? ', ' . $user_online_link : $user_online_link; } } + + $prev_user_id = $row['user_id']; } else { // Skip multiple sessions for one user - if( $row['session_ip'] != $prev_session_ip ) + if ( $row['session_ip'] != $prev_session_ip ) { $guests_online++; } } $prev_session_ip = $row['session_ip']; - $prev_user_id = $row['user_id']; } -if( empty($online_userlist) ) +if ( empty($online_userlist) ) { $online_userlist = $lang['None']; } @@ -172,31 +171,31 @@ $total_online_users = $logged_visible_online + $logged_hidden_online + $guests_o if ( $total_online_users > $board_config['record_online_users']) { + $board_config['record_online_users'] = $total_online_users; + $board_config['record_online_date'] = time(); + $sql = "UPDATE " . CONFIG_TABLE . " SET config_value = '$total_online_users' WHERE config_name = 'record_online_users'"; - if ( !$result = $db->sql_query($sql) ) + if ( !$db->sql_query($sql) ) { message_die(GENERAL_ERROR, 'Could not update online user record (nr of users)', '', __LINE__, __FILE__, $sql); } $sql = "UPDATE " . CONFIG_TABLE . " - SET config_value = '" . time() . "' + SET config_value = '" . $board_config['record_online_date'] . "' WHERE config_name = 'record_online_date'"; - if ( !$result = $db->sql_query($sql) ) + if ( !$db->sql_query($sql) ) { message_die(GENERAL_ERROR, 'Could not update online user record (date)', '', __LINE__, __FILE__, $sql); } - - $board_config['record_online_users'] = $total_online_users; - $board_config['record_online_date'] = time(); } -if( $total_online_users == 0 ) +if ( $total_online_users == 0 ) { $l_t_user_s = $lang['Online_users_zero_total']; } -else if( $total_online_users == 1 ) +else if ( $total_online_users == 1 ) { $l_t_user_s = $lang['Online_user_total']; } @@ -205,11 +204,11 @@ else $l_t_user_s = $lang['Online_users_total']; } -if( $logged_visible_online == 0 ) +if ( $logged_visible_online == 0 ) { $l_r_user_s = $lang['Reg_users_zero_total']; } -else if( $logged_visible_online == 1 ) +else if ( $logged_visible_online == 1 ) { $l_r_user_s = $lang['Reg_user_total']; } @@ -218,11 +217,11 @@ else $l_r_user_s = $lang['Reg_users_total']; } -if( $logged_hidden_online == 0 ) +if ( $logged_hidden_online == 0 ) { $l_h_user_s = $lang['Hidden_users_zero_total']; } -else if( $logged_hidden_online == 1 ) +else if ( $logged_hidden_online == 1 ) { $l_h_user_s = $lang['Hidden_user_total']; } @@ -231,11 +230,11 @@ else $l_h_user_s = $lang['Hidden_users_total']; } -if( $guests_online == 0 ) +if ( $guests_online == 0 ) { $l_g_user_s = $lang['Guest_users_zero_total']; } -else if( $guests_online == 1 ) +else if ( $guests_online == 1 ) { $l_g_user_s = $lang['Guest_user_total']; } @@ -253,19 +252,19 @@ $l_online_users .= sprintf($l_g_user_s, $guests_online); // Obtain number of new private messages // if user is logged in // -if( $userdata['session_logged_in'] ) +if ( $userdata['session_logged_in'] ) { - if( $userdata['user_new_privmsg'] ) + if ( $userdata['user_new_privmsg'] ) { $l_message_new = ( $userdata['user_new_privmsg'] == 1 ) ? $lang['New_pm'] : $lang['New_pms']; $l_privmsgs_text = sprintf($l_message_new, $userdata['user_new_privmsg']); - if( $userdata['user_last_privmsg'] > $userdata['user_lastvisit'] ) + if ( $userdata['user_last_privmsg'] > $userdata['user_lastvisit'] ) { $sql = "UPDATE " . USERS_TABLE . " SET user_last_privmsg = " . $userdata['user_lastvisit'] . " WHERE user_id = " . $userdata['user_id']; - if( !$status = $db->sql_query($sql) ) + if ( !($status = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not update private message new/read time for user', '', __LINE__, __FILE__, $sql); } @@ -287,7 +286,7 @@ if( $userdata['session_logged_in'] ) $icon_pm = $images['pm_no_new_msg']; } - if( $userdata['user_unread_privmsg'] ) + if ( $userdata['user_unread_privmsg'] ) { $l_message_unread = ( $userdata['user_unread_privmsg'] == 1 ) ? $lang['Unread_pm'] : $lang['Unread_pms']; $l_privmsgs_text_unread = sprintf($l_message_unread, $userdata['user_unread_privmsg']); @@ -301,7 +300,7 @@ else { $icon_pm = $images['pm_no_new_msg']; $l_privmsgs_text = $lang['Login_check_pm']; - $l_privmsgs_text_unread = ""; + $l_privmsgs_text_unread = ''; $s_privmsg_new = 0; } @@ -310,16 +309,16 @@ else // $nav_links_html = ''; $nav_link_proto = '<link rel="%s" href="%s" title="%s" />' . "\n"; -while(list($nav_item, $nav_array) = @each($nav_links) ) +while( list($nav_item, $nav_array) = @each($nav_links) ) { - if( !empty($nav_array['url']) ) + if ( !empty($nav_array['url']) ) { $nav_links_html .= sprintf($nav_link_proto, $nav_item, $nav_array['url'], $nav_array['title']); } else { // We have a nested array, used for items like <link rel='chapter'> that can occur more than once. - while(list(,$nested_array) = each($nav_array) ) + while( list(,$nested_array) = each($nav_array) ) { $nav_links_html .= sprintf($nav_link_proto, $nav_item, $nested_array['url'], $nested_array['title']); } @@ -328,63 +327,43 @@ while(list($nav_item, $nav_array) = @each($nav_links) ) // // The following assigns all _common_ variables that may be used at any point -// in a template. Note that all URL's should be wrapped in append_sid, as -// should all S_x_ACTIONS for forms. +// in a template. // $template->assign_vars(array( 'SITENAME' => $board_config['sitename'], 'SITE_DESCRIPTION' => $board_config['site_desc'], 'PAGE_TITLE' => $page_title, + 'LAST_VISIT_DATE' => sprintf($lang['You_last_visit'], $s_last_visit), + 'CURRENT_TIME' => sprintf($lang['Current_time'], create_date($board_config['default_dateformat'], time(), $board_config['board_timezone'])), 'TOTAL_USERS_ONLINE' => $l_online_users, - 'LOGGED_IN_USER_LIST' => $online_userlist, + 'LOGGED_IN_USER_LIST' => $online_userlist, + 'RECORD_USERS' => sprintf($lang['Record_online_users'], $board_config['record_online_users'], create_date($board_config['default_dateformat'], $board_config['record_online_date'], $board_config['board_timezone'])), 'PRIVATE_MESSAGE_INFO' => $l_privmsgs_text, 'PRIVATE_MESSAGE_INFO_UNREAD' => $l_privmsgs_text_unread, 'PRIVATE_MESSAGE_NEW_FLAG' => $s_privmsg_new, - 'LAST_VISIT_DATE' => sprintf($lang['You_last_visit'], $s_last_visit), - 'CURRENT_TIME' => sprintf($lang['Current_time'], create_date($board_config['default_dateformat'], time(), $board_config['board_timezone'])), 'PRIVMSG_IMG' => $icon_pm, - 'L_USERNAME' => $lang['Username'], - 'L_PASSWORD' => $lang['Password'], - 'L_LOGIN' => $lang['Login'], - 'L_LOG_ME_IN' => $lang['Log_me_in'], - 'L_INDEX' => sprintf($lang['Forum_Index'], $board_config['sitename']), - 'L_REGISTER' => $lang['Register'], - 'L_PROFILE' => $lang['Profile'], - 'L_SEARCH' => $lang['Search'], - 'L_PRIVATEMSGS' => $lang['Private_Messages'], - 'L_WHO_IS_ONLINE' => $lang['Who_is_Online'], - 'L_MEMBERLIST' => $lang['Memberlist'], - 'L_FAQ' => $lang['FAQ'], - 'L_USERGROUPS' => $lang['Usergroups'], - 'L_FORUM' => $lang['Forum'], - 'L_TOPICS' => $lang['Topics'], - 'L_REPLIES' => $lang['Replies'], - 'L_VIEWS' => $lang['Views'], - 'L_POSTS' => $lang['Posts'], - 'L_LASTPOST' => $lang['Last_Post'], - 'L_NO_NEW_POSTS' => $lang['No_new_posts'], - 'L_NEW_POSTS' => $lang['New_posts'], - 'L_NO_NEW_POSTS_HOT' => $lang['No_new_posts_hot'], - 'L_NEW_POSTS_HOT' => $lang['New_posts_hot'], - 'L_NO_NEW_POSTS_LOCKED' => $lang['No_new_posts_locked'], - 'L_NEW_POSTS_LOCKED' => $lang['New_posts_locked'], - 'L_ANNOUNCEMENT' => $lang['Post_Announcement'], - 'L_STICKY' => $lang['Post_Sticky'], - 'L_POSTED' => $lang['Posted'], - 'L_JOINED' => $lang['Joined'], - 'L_AUTO_LOGIN' => $lang['Log_me_in'], - 'L_AUTHOR' => $lang['Author'], - 'L_SUBJECT' => $lang['Subject'], - 'L_MESSAGE' => $lang['Message'], - 'L_LOGIN_LOGOUT' => $l_login_logout, + 'L_USERNAME' => $lang['Username'], + 'L_PASSWORD' => $lang['Password'], + 'L_LOGIN_LOGOUT' => $l_login_logout, + 'L_LOGIN' => $lang['Login'], + 'L_LOG_ME_IN' => $lang['Log_me_in'], + 'L_AUTO_LOGIN' => $lang['Log_me_in'], + 'L_INDEX' => sprintf($lang['Forum_Index'], $board_config['sitename']), + 'L_REGISTER' => $lang['Register'], + 'L_PROFILE' => $lang['Profile'], + 'L_SEARCH' => $lang['Search'], + 'L_PRIVATEMSGS' => $lang['Private_Messages'], + 'L_WHO_IS_ONLINE' => $lang['Who_is_Online'], + 'L_MEMBERLIST' => $lang['Memberlist'], + 'L_FAQ' => $lang['FAQ'], + 'L_USERGROUPS' => $lang['Usergroups'], 'L_SEARCH_NEW' => $lang['Search_new'], - 'L_SEARCH_UNANSWERED' => $lang['Search_unanswered'], + 'L_SEARCH_UNANSWERED' => $lang['Search_unanswered'], 'L_SEARCH_SELF' => $lang['Search_your_posts'], 'L_WHOSONLINE_ADMIN' => sprintf($lang['Admin_online_color'], '<span style="color:#' . $theme['fontcolor3'] . '">', '</span>'), 'L_WHOSONLINE_MOD' => sprintf($lang['Mod_online_color'], '<span style="color:#' . $theme['fontcolor2'] . '">', '</span>'), - 'L_RECORD_USERS' => sprintf($lang['Record_online_users'], $board_config['record_online_users'], create_date($board_config['default_dateformat'], $board_config['record_online_date'], $board_config['board_timezone'])), 'U_SEARCH_UNANSWERED' => append_sid('search.'.$phpEx.'?search_id=unanswered'), 'U_SEARCH_SELF' => append_sid('search.'.$phpEx.'?search_id=egosearch'), @@ -455,7 +434,7 @@ $template->assign_vars(array( // // Login box? // -if( !$userdata['session_logged_in'] ) +if ( !$userdata['session_logged_in'] ) { $template->assign_block_vars('switch_user_logged_out', array()); } @@ -463,23 +442,20 @@ else { $template->assign_block_vars('switch_user_logged_in', array()); - if( !empty($userdata['user_popup_pm']) ) + if ( !empty($userdata['user_popup_pm']) ) { $template->assign_block_vars('switch_enable_pm_popup', array()); } } -if ( $HTTP_SERVER_VARS['REQUEST_METHOD'] == 'POST' ) -{ - header ('Cache-Control: private, must-revalidate, max-age=25'); -} -else + +if ( getenv('REQUEST_METHOD') != 'POST' ) { header ('Cache-Control: private, no-cache, must-revalidate, pre-check=2, post-check=2, max-age=25'); header ('Pragma: no-cache'); - header ('Expires: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT'); } +header ('Expires: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT'); header ('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); $template->pparse('overall_header'); -?> +?>
\ No newline at end of file diff --git a/phpBB/includes/topic_review.php b/phpBB/includes/topic_review.php index 54afbbc074..bc4d0b05e4 100644 --- a/phpBB/includes/topic_review.php +++ b/phpBB/includes/topic_review.php @@ -28,9 +28,9 @@ function topic_review($topic_id, $is_inline_review) global $orig_word, $replacement_word; global $starttime; - if( !$is_inline_review ) + if ( !$is_inline_review ) { - if( !isset($topic_id) ) + if ( !isset($topic_id) ) { message_die(GENERAL_MESSAGE, 'Topic_not_exist'); } @@ -42,12 +42,12 @@ function topic_review($topic_id, $is_inline_review) FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f WHERE t.topic_id = $topic_id AND f.forum_id = t.forum_id"; - if( !($result = $db->sql_query($sql)) ) + if ( !($result = $db->sql_query($sql)) ) { - message_die(GENERAL_ERROR, "Couldn't obtain topic information", "", __LINE__, __FILE__, $sql); + message_die(GENERAL_ERROR, 'Could not obtain topic information', '', __LINE__, __FILE__, $sql); } - if( !($forum_row = $db->sql_fetchrow($result)) ) + if ( !($forum_row = $db->sql_fetchrow($result)) ) { message_die(GENERAL_MESSAGE, 'Topic_post_not_exist'); } @@ -76,7 +76,7 @@ function topic_review($topic_id, $is_inline_review) // // Define censored word matches // - if( empty($orig_word) && empty($replacement_word) ) + if ( empty($orig_word) && empty($replacement_word) ) { $orig_word = array(); $replacement_word = array(); @@ -87,15 +87,15 @@ function topic_review($topic_id, $is_inline_review) // // Dump out the page header and load viewtopic body template // - if( !$is_inline_review ) + if ( !$is_inline_review ) { $gen_simple_header = TRUE; - $page_title = $lang['Topic_review'] ." - $topic_title"; + $page_title = $lang['Topic_review'] . ' - ' . $topic_title; include($phpbb_root_path . 'includes/page_header.'.$phpEx); $template->set_filenames(array( - "reviewbody" => "posting_topic_review.tpl") + 'reviewbody' => 'posting_topic_review.tpl') ); } @@ -109,9 +109,9 @@ function topic_review($topic_id, $is_inline_review) AND p.post_id = pt.post_id ORDER BY p.post_time DESC LIMIT " . $board_config['posts_per_page']; - if( !($result = $db->sql_query($sql)) ) + if ( !($result = $db->sql_query($sql)) ) { - message_die(GENERAL_ERROR, "Couldn't obtain post/user information.", "", __LINE__, __FILE__, $sql); + message_die(GENERAL_ERROR, 'Could not obtain post/user information', '', __LINE__, __FILE__, $sql); } // @@ -120,6 +120,9 @@ function topic_review($topic_id, $is_inline_review) // if ( $row = $db->sql_fetchrow($result) ) { + $mini_post_img = $images['icon_minipost']; + $mini_post_alt = $lang['Post']; + $i = 0; do { @@ -128,8 +131,6 @@ function topic_review($topic_id, $is_inline_review) $post_date = create_date($board_config['default_dateformat'], $row['post_time'], $board_config['board_timezone']); - $mini_post_img = '<img src="' . $images['icon_minipost'] . '" alt="' . $lang['Post'] . '" />'; - // // Handle anon users posting with usernames // @@ -139,7 +140,7 @@ function topic_review($topic_id, $is_inline_review) $poster_rank = $lang['Guest']; } - $post_subject = ( $row['post_subject'] != "" ) ? $row['post_subject'] : ""; + $post_subject = ( $row['post_subject'] != '' ) ? $row['post_subject'] : ''; $message = $row['post_text']; $bbcode_uid = $row['bbcode_uid']; @@ -150,12 +151,12 @@ function topic_review($topic_id, $is_inline_review) // if ( !$board_config['allow_html'] && $row['enable_html'] ) { - $message = preg_replace("#(<)([\/]?.*?)(>)#is", "<\\2>", $message); + $message = preg_replace('#(<)([\/]?.*?)(>)#is', '<\2>', $message); } if ( $bbcode_uid != "" ) { - $message = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($message, $bbcode_uid) : preg_replace("/\:[0-9a-z\:]+\]/si", "]", $message); + $message = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($message, $bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $message); } $message = make_clickable($message); @@ -171,7 +172,7 @@ function topic_review($topic_id, $is_inline_review) $message = smilies_pass($message); } - $message = str_replace("\n", "<br />", $message); + $message = str_replace("\n", '<br />', $message); // // Again this will be handled by the templating @@ -180,15 +181,17 @@ function topic_review($topic_id, $is_inline_review) $row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2']; $row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2']; - $template->assign_block_vars("postrow", array( - "ROW_COLOR" => "#" . $row_color, - "ROW_CLASS" => $row_class, - - "MINI_POST_IMG" => $mini_post_img, - "POSTER_NAME" => $poster, - "POST_DATE" => $post_date, - "POST_SUBJECT" => $post_subject, - "MESSAGE" => $message) + $template->assign_block_vars('postrow', array( + 'ROW_COLOR' => '#' . $row_color, + 'ROW_CLASS' => $row_class, + + 'MINI_POST_IMG' => $mini_post_img, + 'POSTER_NAME' => $poster, + 'POST_DATE' => $post_date, + 'POST_SUBJECT' => $post_subject, + 'MESSAGE' => $message, + + 'L_MINI_POST_ALT' => $mini_post_alt) ); $i++; @@ -197,18 +200,20 @@ function topic_review($topic_id, $is_inline_review) } else { - message_die(GENERAL_MESSAGE, 'Topic_post_not_exist', "", __LINE__, __FILE__, $sql); + message_die(GENERAL_MESSAGE, 'Topic_post_not_exist', '', __LINE__, __FILE__, $sql); } $template->assign_vars(array( - "L_POSTED" => $lang['Posted'], - "L_POST_SUBJECT" => $lang['Post_subject'], - "L_TOPIC_REVIEW" => $lang['Topic_review']) + 'L_AUTHOR' => $lang['Author'], + 'L_MESSAGE' => $lang['Message'], + 'L_POSTED' => $lang['Posted'], + 'L_POST_SUBJECT' => $lang['Post_subject'], + 'L_TOPIC_REVIEW' => $lang['Topic_review']) ); if ( !$is_inline_review ) { - $template->pparse("reviewbody"); + $template->pparse('reviewbody'); include($phpbb_root_path . 'includes/page_tail.'.$phpEx); } } diff --git a/phpBB/includes/usercp_avatar.php b/phpBB/includes/usercp_avatar.php index b5b0fb1a02..9ba50399ee 100644 --- a/phpBB/includes/usercp_avatar.php +++ b/phpBB/includes/usercp_avatar.php @@ -278,7 +278,7 @@ function display_avatar_gallery($mode, &$category, &$user_id, &$email, &$current } @reset($avatar_images); - $s_categories = ''; + $s_categories = '<select name="avatarcategory">'; while( list($key) = each($avatar_images) ) { $selected = ( $key == $category ) ? ' selected="selected"' : ''; @@ -287,6 +287,7 @@ function display_avatar_gallery($mode, &$category, &$user_id, &$email, &$current $s_categories .= '<option value="' . $key . '"' . $selected . '>' . ucfirst($key) . '</option>'; } } + $s_categories .= '</select>'; $s_colspan = 0; for($i = 0; $i < count($avatar_images[$category]); $i++) @@ -323,7 +324,7 @@ function display_avatar_gallery($mode, &$category, &$user_id, &$email, &$current 'L_RETURN_PROFILE' => $lang['Return_profile'], 'L_CATEGORY' => $lang['Select_category'], - 'S_OPTIONS_CATEGORIES' => $s_categories, + 'S_CATEGORY_SELECT' => $s_categories, 'S_COLSPAN' => $s_colspan, 'S_PROFILE_ACTION' => append_sid("profile.$phpEx?mode=$mode"), 'S_HIDDEN_FIELDS' => $s_hidden_vars) diff --git a/phpBB/includes/usercp_email.php b/phpBB/includes/usercp_email.php index 1ffcf6be71..7970c4f1c8 100644 --- a/phpBB/includes/usercp_email.php +++ b/phpBB/includes/usercp_email.php @@ -94,16 +94,16 @@ if ( $result = $db->sql_query($sql) ) include($phpbb_root_path . 'includes/emailer.'.$phpEx); $emailer = new emailer($board_config['smtp_delivery']); - $email_headers = "From: " . $userdata['user_email'] . "\n"; + $email_headers = 'From: ' . $userdata['user_email'] . "\n"; if ( !empty($HTTP_POST_VARS['cc_email']) ) { $email_headers .= "Cc: " . $userdata['user_email'] . "\n"; } - $email_headers .= "Return-Path: " . $userdata['user_email'] . "\n"; - $email_headers .= "X-AntiAbuse: Board servername - " . $server_name . "\n"; - $email_headers .= "X-AntiAbuse: User_id - " . $userdata['user_id'] . "\n"; - $email_headers .= "X-AntiAbuse: Username - " . $userdata['username'] . "\n"; - $email_headers .= "X-AntiAbuse: User IP - " . decode_ip($user_ip) . "\r\n"; + $email_headers .= 'Return-Path: ' . $userdata['user_email'] . "\n"; + $email_headers .= 'X-AntiAbuse: Board servername - ' . $server_name . "\n"; + $email_headers .= 'X-AntiAbuse: User_id - ' . $userdata['user_id'] . "\n"; + $email_headers .= 'X-AntiAbuse: Username - ' . $userdata['username'] . "\n"; + $email_headers .= 'X-AntiAbuse: User IP - ' . decode_ip($user_ip) . "\r\n"; $emailer->use_template('profile_send_email', $user_lang); $emailer->email_address($user_email); @@ -138,20 +138,9 @@ if ( $result = $db->sql_query($sql) ) include($phpbb_root_path . 'includes/page_header.'.$phpEx); $template->set_filenames(array( - 'body' => 'profile_send_email.tpl', - 'jumpbox' => 'jumpbox.tpl') + 'body' => 'profile_send_email.tpl') ); - - $jumpbox = make_jumpbox(); - $template->assign_vars(array( - 'L_GO' => $lang['Go'], - 'L_JUMP_TO' => $lang['Jump_to'], - 'L_SELECT_FORUM' => $lang['Select_forum'], - - 'S_JUMPBOX_LIST' => $jumpbox, - 'S_JUMPBOX_ACTION' => append_sid("viewforum.$phpEx")) - ); - $template->assign_var_from_handle('JUMPBOX', 'jumpbox'); + make_jumpbox('viewforum.'.$phpEx); if ( $error ) { @@ -164,15 +153,9 @@ if ( $result = $db->sql_query($sql) ) $template->assign_var_from_handle('ERROR_BOX', 'reg_header'); } - if ( $userdata['user_sig'] != '' ) - { - $template->assign_block_vars('signature_checkbox', array()); - } - $template->assign_vars(array( 'USERNAME' => $username, - 'S_SIGNATURE_CHECKED' => ( $attach_sig ) ? 'checked="checked"' : '', 'S_POST_ACTION' => append_sid("profile.$phpEx?&mode=email&" . POST_USERS_URL . "=$user_id"), 'L_SEND_EMAIL_MSG' => $lang['Send_email_msg'], @@ -184,7 +167,6 @@ if ( $result = $db->sql_query($sql) ) 'L_EMPTY_MESSAGE_EMAIL' => $lang['Empty_message_email'], 'L_OPTIONS' => $lang['Options'], 'L_CC_EMAIL' => $lang['CC_email'], - 'L_NOTIFY_ON_REPLY' => $lang['Notify'], 'L_SPELLCHECK' => $lang['Spellcheck'], 'L_SEND_EMAIL' => $lang['Send_email']) ); @@ -203,4 +185,4 @@ else message_die(GENERAL_MESSAGE, $lang['User_not_exist']); } -?> +?>
\ No newline at end of file diff --git a/phpBB/includes/usercp_register.php b/phpBB/includes/usercp_register.php index a3f762765a..4c92af339b 100644 --- a/phpBB/includes/usercp_register.php +++ b/phpBB/includes/usercp_register.php @@ -680,20 +680,7 @@ else if ( $mode == 'editprofile' && !isset($HTTP_POST_VARS['avatargallery']) && // include($phpbb_root_path . 'includes/page_header.'.$phpEx); -$template->set_filenames(array( - "jumpbox" => "jumpbox.tpl") -); - -$jumpbox = make_jumpbox(); -$template->assign_vars(array( - 'L_GO' => $lang['Go'], - 'L_JUMP_TO' => $lang['Jump_to'], - 'L_SELECT_FORUM' => $lang['Select_forum'], - - 'S_JUMPBOX_LIST' => $jumpbox, - 'S_JUMPBOX_ACTION' => append_sid('viewforum.$phpEx')) -); -$template->assign_var_from_handle('JUMPBOX', 'jumpbox'); +make_jumpbox('viewforum.'.$phpEx); if ( $mode == 'editprofile' ) { @@ -711,7 +698,7 @@ if( isset($HTTP_POST_VARS['avatargallery']) && !$error ) $avatar_category = ( !empty($HTTP_POST_VARS['avatarcategory']) ) ? $HTTP_POST_VARS['avatarcategory'] : ''; $template->set_filenames(array( - "body" => "profile_avatar_gallery.tpl") + 'body' => 'profile_avatar_gallery.tpl') ); display_avatar_gallery($mode, $avatar_category, $user_id, $email, $current_email, $coppa, $username, $email, $icq, $aim, $msn, $yim, $website, $location, $occupation, $interests, $signature, $viewemail, $notifypm, $popuppm, $notifyreply, $attachsig, $allowhtml, $allowbbcode, $allowsmilies, $allowviewonline, $user_style, $user_lang, $user_timezone, $user_dateformat); @@ -786,7 +773,7 @@ else if ( $mode == 'editprofile' ) { - $template->assign_block_vars('edit_profile', array()); + $template->assign_block_vars('switch_edit_profile', array()); } // @@ -908,25 +895,25 @@ else // if ( $userdata['user_allowavatar'] && ( $board_config['allow_avatar_upload'] || $board_config['allow_avatar_local'] || $board_config['allow_avatar_remote'] ) ) { - $template->assign_block_vars('avatar_block', array() ); + $template->assign_block_vars('switch_avatar_block', array() ); if ( $board_config['allow_avatar_upload'] && file_exists('./' . $board_config['avatar_path']) ) { if ( $form_enctype != '' ) { - $template->assign_block_vars('avatar_block.avatar_local_upload', array() ); + $template->assign_block_vars('switch_avatar_block.switch_avatar_local_upload', array() ); } - $template->assign_block_vars('avatar_block.avatar_remote_upload', array() ); + $template->assign_block_vars('switch_avatar_block.switch_avatar_remote_upload', array() ); } if ( $board_config['allow_avatar_remote'] ) { - $template->assign_block_vars('avatar_block.avatar_remote_link', array() ); + $template->assign_block_vars('switch_avatar_block.switch_avatar_remote_link', array() ); } if ( $board_config['allow_avatar_local'] && file_exists('./' . $board_config['avatar_gallery_path']) ) { - $template->assign_block_vars('avatar_block.avatar_local_gallery', array() ); + $template->assign_block_vars('switch_avatar_block.switch_avatar_local_gallery', array() ); } } } @@ -935,4 +922,4 @@ $template->pparse('body'); include($phpbb_root_path . 'includes/page_tail.'.$phpEx); -?> +?>
\ No newline at end of file diff --git a/phpBB/includes/usercp_sendpasswd.php b/phpBB/includes/usercp_sendpasswd.php index c5b810faf5..2ca37ffb6b 100644 --- a/phpBB/includes/usercp_sendpasswd.php +++ b/phpBB/includes/usercp_sendpasswd.php @@ -23,14 +23,14 @@ if ( !defined('IN_PHPBB') ) { - die("Hacking attempt"); + die('Hacking attempt'); exit; } if ( isset($HTTP_POST_VARS['submit']) ) { - $username = ( !empty($HTTP_POST_VARS['username']) ) ? trim(strip_tags($HTTP_POST_VARS['username'])) : ""; - $email = ( !empty($HTTP_POST_VARS['email']) ) ? trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['email']))) : ""; + $username = ( !empty($HTTP_POST_VARS['username']) ) ? trim(strip_tags($HTTP_POST_VARS['username'])) : ''; + $email = ( !empty($HTTP_POST_VARS['email']) ) ? trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['email']))) : ''; $sql = "SELECT user_id, username, user_email, user_active, user_lang FROM " . USERS_TABLE . " @@ -40,7 +40,7 @@ if ( isset($HTTP_POST_VARS['submit']) ) { if ( $row = $db->sql_fetchrow($result) ) { - if ( $row['user_active'] == 0 ) + if ( !$row['user_active'] ) { message_die(GENERAL_MESSAGE, $lang['No_send_account_inactive']); } @@ -53,37 +53,37 @@ if ( isset($HTTP_POST_VARS['submit']) ) $sql = "UPDATE " . USERS_TABLE . " SET user_newpasswd = '" .md5($user_password) . "', user_actkey = '$user_actkey' WHERE user_id = " . $row['user_id']; - if ( !$result = $db->sql_query($sql) ) + if ( !$db->sql_query($sql) ) { - message_die(GENERAL_ERROR, "Couldn't update new password information", "", __LINE__, __FILE__, $sql); + message_die(GENERAL_ERROR, 'Could not update new password information', '', __LINE__, __FILE__, $sql); } include($phpbb_root_path . 'includes/emailer.'.$phpEx); $emailer = new emailer($board_config['smtp_delivery']); - $email_headers = "From: " . $board_config['board_email'] . "\nReturn-Path: " . $board_config['board_email'] . "\r\n"; + $email_headers = 'From: ' . $board_config['board_email'] . "\nReturn-Path: " . $board_config['board_email'] . "\r\n"; - $emailer->use_template("user_activate_passwd", $row['user_lang']); + $emailer->use_template('user_activate_passwd', $row['user_lang']); $emailer->email_address($row['user_email']); $emailer->set_subject();//$lang['New_password_activation'] $emailer->extra_headers($email_headers); $emailer->assign_vars(array( - "SITENAME" => $board_config['sitename'], - "USERNAME" => $username, - "PASSWORD" => $user_password, - "EMAIL_SIG" => str_replace("<br />", "\n", "-- \n" . $board_config['board_email_sig']), + 'SITENAME' => $board_config['sitename'], + 'USERNAME' => $username, + 'PASSWORD' => $user_password, + 'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']), - "U_ACTIVATE" => $server_url . "?mode=activate&act_key=$user_actkey") + 'U_ACTIVATE' => $server_url . "?mode=activate&act_key=$user_actkey") ); $emailer->send(); $emailer->reset(); $template->assign_vars(array( - "META" => '<meta http-equiv="refresh" content="15;url=' . append_sid("index.$phpEx") . '">') + 'META' => '<meta http-equiv="refresh" content="15;url=' . append_sid("index.$phpEx") . '">') ); - $message = $lang['Password_updated'] . "<br /><br />" . sprintf($lang['Click_return_index'], "<a href=\"" . append_sid("index.$phpEx") . "\">", "</a>"); + $message = $lang['Password_updated'] . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>'); message_die(GENERAL_MESSAGE, $message); } @@ -94,13 +94,13 @@ if ( isset($HTTP_POST_VARS['submit']) ) } else { - message_die(GENERAL_ERROR, "Couldn't obtain user information for sendpassword", "", __LINE__, __FILE__, $sql); + message_die(GENERAL_ERROR, 'Could not obtain user information for sendpassword', '', __LINE__, __FILE__, $sql); } } else { - $username = ""; - $email = ""; + $username = ''; + $email = ''; } // @@ -109,33 +109,23 @@ else include($phpbb_root_path . 'includes/page_header.'.$phpEx); $template->set_filenames(array( - "body" => "profile_send_pass.tpl", - "jumpbox" => "jumpbox.tpl") + 'body' => 'profile_send_pass.tpl') ); +make_jumpbox('viewforum.'.$phpEx); -$jumpbox = make_jumpbox(); $template->assign_vars(array( - "L_GO" => $lang['Go'], - "L_JUMP_TO" => $lang['Jump_to'], - "L_SELECT_FORUM" => $lang['Select_forum'], - - "S_JUMPBOX_LIST" => $jumpbox, - "S_JUMPBOX_ACTION" => append_sid("viewforum.$phpEx")) + 'USERNAME' => $username, + 'EMAIL' => $email, + + 'L_SEND_PASSWORD' => $lang['Send_password'], + 'L_ITEMS_REQUIRED' => $lang['Items_required'], + 'L_EMAIL_ADDRESS' => $lang['Email_address'], + 'L_SUBMIT' => $lang['Submit'], + 'L_RESET' => $lang['Reset']) ); -$template->assign_var_from_handle("JUMPBOX", "jumpbox"); -$template->assign_vars(array( - "USERNAME" => $username, - "EMAIL" => $email, - - "L_SEND_PASSWORD" => $lang['Send_password'], - "L_ITEMS_REQUIRED" => $lang['Items_required'], - "L_EMAIL_ADDRESS" => $lang['Email_address'], - "L_SUBMIT" => $lang['Submit'], - "L_RESET" => $lang['Reset']) -); - -$template->pparse("body"); +$template->pparse('body'); include($phpbb_root_path . 'includes/page_tail.'.$phpEx); -?> + +?>
\ No newline at end of file diff --git a/phpBB/includes/usercp_viewprofile.php b/phpBB/includes/usercp_viewprofile.php index 6960e4a9ca..0b5bd0939b 100644 --- a/phpBB/includes/usercp_viewprofile.php +++ b/phpBB/includes/usercp_viewprofile.php @@ -51,20 +51,9 @@ $db->sql_freeresult($result); // Output page header and profile_view template // $template->set_filenames(array( - 'body' => 'profile_view_body.tpl', - 'jumpbox' => 'jumpbox.tpl') + 'body' => 'profile_view_body.tpl') ); - -$jumpbox = make_jumpbox(); -$template->assign_vars(array( - 'L_GO' => $lang['Go'], - 'L_JUMP_TO' => $lang['Jump_to'], - 'L_SELECT_FORUM' => $lang['Select_forum'], - - 'S_JUMPBOX_LIST' => $jumpbox, - 'S_JUMPBOX_ACTION' => append_sid("viewforum.$phpEx")) -); -$template->assign_var_from_handle('JUMPBOX', 'jumpbox'); +make_jumpbox('viewforum.'.$phpEx); // // Calculate the number of days this user has been a member ($memberdays) @@ -85,19 +74,6 @@ else $percentage = 0; } -if ( !empty($profiledata['user_viewemail']) || $userdata['user_level'] == ADMIN ) -{ - $email_uri = ( $board_config['board_email_form'] ) ? append_sid("profile.$phpEx?mode=email&" . POST_USERS_URL . "=" . $profiledata['user_id']) : 'mailto:' . $profiledata['user_email']; - - $email = '<a href="' . $email_uri . '">' . $lang['Send_email'] . '</a>'; - $email_img = '<a href="' . $email_uri . '"><img src="' . $images['icon_email'] . '" alt="' . $lang['Send_email'] . '" border="0" /></a>'; -} -else -{ - $email = ''; - $email_img = ''; -} - $avatar_img = ''; if ( $profiledata['user_avatar_type'] && $profiledata['user_allowavatar'] ) { @@ -140,29 +116,51 @@ else } } -if ( !empty($profiledata['user_icq']) ) +$temp_url = append_sid("privmsg.$phpEx?mode=post&" . POST_USERS_URL . "=" . $profiledata['user_id']); +$pm_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_pm'] . '" alt="' . $lang['Send_private_message'] . '" title="' . $lang['Send_private_message'] . '" border="0" /></a>'; +$pm = '<a href="' . $temp_url . '">' . $lang['Send_private_message'] . '</a>'; + +if ( !empty($profiledata['user_viewemail']) || $userdata['user_level'] == ADMIN ) { - $icq_status_img = '<a href="http://wwp.icq.com/' . $profiledata['user_icq'] . '#pager"><img src="http://web.icq.com/whitepages/online?icq=' . $profiledata['user_icq'] . '&img=5" width="18" height="18" border="0" /></a>'; - $icq_add_img = '<a href="http://wwp.icq.com/scripts/search.dll?to=' . $profiledata['user_icq'] . '"><img src="' . $images['icon_icq'] . '" alt="' . $lang['ICQ'] . '" border="0" /></a>'; + $email_uri = ( $board_config['board_email_form'] ) ? append_sid("profile.$phpEx?mode=email&" . POST_USERS_URL .'=' . $profiledata['user_id']) : 'mailto:' . $profiledata['user_email']; + + $email_img = '<a href="' . $email_uri . '"><img src="' . $images['icon_email'] . '" alt="' . $lang['Send_email'] . '" title="' . $lang['Send_email'] . '" border="0" /></a>'; + $email = '<a href="' . $email_uri . '">' . $lang['Send_email'] . '</a>'; } else { - $icq_status_img = ' '; - $icq_add_img = ' '; + $email_img = ' '; + $email = ' '; } -$aim_img = ( $profiledata['user_aim'] ) ? '<a href="aim:goim?screenname=' . $profiledata['user_aim'] . '&message=Hello+Are+you+there?"><img src="' . $images['icon_aim'] . '" border="0" alt="' . $lang['AIM'] . '" /></a>' : ' '; +$www_img = ( $profiledata['user_website'] ) ? '<a href="' . $profiledata['user_website'] . '" target="_userwww"><img src="' . $images['icon_www'] . '" alt="' . $lang['Visit_website'] . '" title="' . $lang['Visit_website'] . '" border="0" /></a>' : ' '; +$www = ( $profiledata['user_website'] ) ? '<a href="' . $profiledata['user_website'] . '" target="_userwww">' . $profiledata['user_website'] . '</a>' : ' '; -$msnm_img = ( $profiledata['user_msnm'] ) ? '<img src="' . $images['icon_msnm'] . '" border="0" alt="' . $lang['MSNM'] . '" /> ' . $profiledata['user_msnm'] : ' '; +if ( !empty($profiledata['user_icq']) ) +{ + $icq_status_img = '<a href="http://wwp.icq.com/' . $profiledata['user_icq'] . '#pager"><img src="http://web.icq.com/whitepages/online?icq=' . $profiledata['user_icq'] . '&img=5" width="18" height="18" border="0" /></a>'; + $icq_img = '<a href="http://wwp.icq.com/scripts/search.dll?to=' . $profiledata['user_icq'] . '"><img src="' . $images['icon_icq'] . '" alt="' . $lang['ICQ'] . '" title="' . $lang['ICQ'] . '" border="0" /></a>'; + $icq = '<a href="http://wwp.icq.com/scripts/search.dll?to=' . $profiledata['user_icq'] . '">' . $lang['ICQ'] . '</a>'; +} +else +{ + $icq_status_img = ' '; + $icq_img = ' '; + $icq = ' '; +} -$yim_img = ( $profiledata['user_yim'] ) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $profiledata['user_yim'] . '&.src=pg"><img src="' . $images['icon_yim'] . '" border="0" alt="' . $lang['YIM'] . '" /></a>' : ' '; +$aim_img = ( $profiledata['user_aim'] ) ? '<a href="aim:goim?screenname=' . $profiledata['user_aim'] . '&message=Hello+Are+you+there?"><img src="' . $images['icon_aim'] . '" alt="' . $lang['AIM'] . '" title="' . $lang['AIM'] . '" border="0" /></a>' : ' '; +$aim = ( $profiledata['user_aim'] ) ? '<a href="aim:goim?screenname=' . $profiledata['user_aim'] . '&message=Hello+Are+you+there?">' . $lang['AIM'] . '</a>' : ' '; -$search_img = '<a href="' . append_sid("search.$phpEx?search_author=" . urlencode($profiledata['username']) . "&showresults=posts") . '"><img src="' . $images['icon_search'] . '" border="0" alt="' . $lang['Search_user_posts'] . '" /></a>'; -$search = '<a href="' . append_sid("search.$phpEx?search_author=" . urlencode($profiledata['username']) . "&showresults=posts") . '">' . $lang['Search_user_posts'] . '</a>'; +$msn_img = ( $profiledata['user_msnm'] ) ? $profiledata['user_msnm'] : ' '; +$msn = $msn_img; -$www_img = ( $profiledata['user_website'] ) ? '<a href="' . $profiledata['user_website'] . '"><img src="' . $images['icon_www'] . '" alt="' . $lang['Visit_website'] . '" border="0" /></a>' : ' '; +$yim_img = ( $profiledata['user_yim'] ) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $profiledata['user_yim'] . '&.src=pg"><img src="' . $images['icon_yim'] . '" alt="' . $lang['YIM'] . '" title="' . $lang['YIM'] . '" border="0" /></a>' : ''; +$yim = ( $profiledata['user_yim'] ) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $profiledata['user_yim'] . '&.src=pg">' . $lang['YIM'] . '</a>' : ''; -$pm_img = '<a href="' . append_sid("privmsg.$phpEx?mode=post&" . POST_USERS_URL . "=" . $profiledata['user_id']) . '"><img src="' . $images['icon_pm'] . '" alt="' . $lang['Send_private_message'] . '" border="0" /></a>'; +$temp_url = append_sid("search.$phpEx?search_author=" . urlencode($profiledata['username']) . "&showresults=posts"); +$search_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_search'] . '" alt="' . $lang['Search_user_posts'] . '" title="' . $lang['Search_user_posts'] . '" border="0" /></a>'; +$search = '<a href="' . $temp_url . '">' . $lang['Search_user_posts'] . '</a>'; // // Generate page @@ -180,23 +178,25 @@ $template->assign_vars(array( 'PERCENTAGE' => $percentage . '%', 'POST_DAY_STATS' => sprintf($lang['User_post_day_stats'], $posts_per_day), 'POST_PERCENT_STATS' => sprintf($lang['User_post_pct_stats'], $percentage), - 'EMAIL' => $email, - 'EMAIL_IMG' => $email_img, - 'PM_IMG' => $pm_img, - 'UL_SEARCH' => $search, + 'SEARCH_IMG' => $search_img, - 'ICQ' => ( $profiledata['user_icq'] ) ? $profiledata['user_icq'] : ' ', - 'ICQ_IMG' => ( $profiledata['user_icq'] ) ? $images['icon_icq'] : ' ', - 'ICQ_ADD_IMG' => $icq_add_img, + 'SEARCH' => $search, + 'PM_IMG' => $pm_img, + 'PM' => $pm, + 'EMAIL_IMG' => $email_img, + 'EMAIL' => $email, + 'WWW_IMG' => $www_img, + 'WWW' => $www, 'ICQ_STATUS_IMG' => $icq_status_img, - 'AIM' => ( $profiledata['user_aim'] ) ? '<a href="aim:goim?screenname=' . $profiledata['user_aim'] . '&message=Hello+Are+you+there?">' . $profiledata['user_aim'] . '</a>' : ' ', + 'ICQ_IMG' => $icq_img, + 'ICQ' => $icq, 'AIM_IMG' => $aim_img, - 'MSN' => ( $profiledata['user_msnm'] ) ? $profiledata['user_msnm'] : ' ', - 'MSN_IMG' => $msnm_img, - 'YIM' => ( $profiledata['user_yim'] ) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $profiledata['user_yim'] . '&.src=pg">' . $profiledata['user_yim'] . '</a>' : ' ', + 'AIM' => $aim, + 'MSN_IMG' => $msn_img, + 'MSN' => $msn, 'YIM_IMG' => $yim_img, - 'WEBSITE' => ( $profiledata['user_website'] ) ? '<a href="' . $profiledata['user_website'] . '" target="_phpbbwebsite">' . $profiledata['user_website'] . '</a>' : ' ', - 'WEBSITE_IMG' => $www_img, + 'YIM' => $yim, + 'LOCATION' => ( $profiledata['user_from'] ) ? $profiledata['user_from'] : ' ', 'OCCUPATION' => ( $profiledata['user_occ'] ) ? $profiledata['user_occ'] : ' ', 'INTERESTS' => ( $profiledata['user_interests'] ) ? $profiledata['user_interests'] : ' ', @@ -206,6 +206,7 @@ $template->assign_vars(array( 'L_ABOUT_USER' => sprintf($lang['About_user'], $profiledata['username']), 'L_AVATAR' => $lang['Avatar'], 'L_POSTER_RANK' => $lang['Poster_rank'], + 'L_JOINED' => $lang['Joined'], 'L_TOTAL_POSTS' => $lang['Total_posts'], 'L_SEARCH_USER_POSTS' => sprintf($lang['Search_user_posts'], $profiledata['username']), 'L_CONTACT' => $lang['Contact'], @@ -230,4 +231,4 @@ $template->pparse('body'); include($phpbb_root_path . 'includes/page_tail.'.$phpEx); -?> +?>
\ No newline at end of file |