diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 66b72a986b..237bd48982 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -29,18 +29,18 @@ function get_db_stat($mode) { case 'postcount': $sql = "SELECT COUNT(post_id) AS total - FROM ".POSTS_TABLE; + FROM " . POSTS_TABLE; break; case 'usercount': $sql = "SELECT COUNT(user_id) AS total - FROM ". USERS_TABLE ." + FROM " . USERS_TABLE . " WHERE user_id <> " . ANONYMOUS; break; case 'newestuser': $sql = "SELECT user_id, username - FROM ".USERS_TABLE." + FROM " . USERS_TABLE . " WHERE user_id <> " . ANONYMOUS . " ORDER BY user_id DESC LIMIT 1"; @@ -48,7 +48,7 @@ function get_db_stat($mode) case 'topiccount': $sql = "SELECT SUM(forum_topics) AS total - FROM ".FORUMS_TABLE; + FROM " . FORUMS_TABLE; break; } @@ -82,15 +82,15 @@ function get_userdata_from_id($userid) message_die(GENERAL_ERROR, "Couldn't obtain userdata for id", "", __LINE__, __FILE__, $sql); } - if($db->sql_numrows($result)) - { - $myrow = $db->sql_fetchrowset($result); - return($myrow[0]); - } - else + if( !$db->sql_numrows($result) ) { message_die(GENERAL_ERROR, "No userdata for this user_id", "", __LINE__, __FILE__, $sql); } + + $row = $db->sql_fetchrow($result); + + return($row); + } function get_userdata($username) { @@ -106,15 +106,14 @@ function get_userdata($username) { message_die(GENERAL_ERROR, "Tried obtaining data for a non-existent user", "", __LINE__, __FILE__, $sql); } - if($db->sql_numrows($result)) - { - $myrow = $db->sql_fetchrowset($result); - return($myrow[0]); - } - else + if( !$db->sql_numrows($result) ) { message_die(GENERAL_ERROR, "Tried obtaining data for a non-existent user", "", __LINE__, __FILE__, $sql); } + + $row = $db->sql_fetchrow($result); + + return($row); } function make_jumpbox($match_forum_id = 0) @@ -226,21 +225,15 @@ function make_forum_select($box_name) // Initialise user settings on page load function init_userprefs($userdata) { - global $board_config, $theme, $images, $template, $lang, $phpEx, $phpbb_root_path; + global $board_config, $theme, $images; + global $template, $lang, $phpEx, $phpbb_root_path; -// if( !defined("IN_ADMIN") ) -// { - if( !$board_config['override_user_style'] ) + if( !$board_config['override_user_style'] ) + { + if( $userdata['user_id'] != ANONYMOUS && isset($userdata['user_style']) ) { - if( $userdata['user_id'] != ANONYMOUS && isset($userdata['user_style']) ) - { - $theme = setup_style($userdata['user_style']); - if( !$theme ) - { - $theme = setup_style($board_config['default_style']); - } - } - else + $theme = setup_style($userdata['user_style']); + if( !$theme ) { $theme = setup_style($board_config['default_style']); } @@ -249,11 +242,11 @@ function init_userprefs($userdata) { $theme = setup_style($board_config['default_style']); } -// } -// else -// { -// $theme = setup_style($board_config['default_admin_style']); -// } + } + else + { + $theme = setup_style($board_config['default_style']); + } if( $userdata['user_id'] != ANONYMOUS ) { @@ -262,24 +255,24 @@ function init_userprefs($userdata) $board_config['default_lang'] = $userdata['user_lang']; } - if(!empty($userdata['user_dateformat'])) + if( !empty($userdata['user_dateformat']) ) { $board_config['default_dateformat'] = $userdata['user_dateformat']; } - if(isset($userdata['user_timezone'])) + if( isset($userdata['user_timezone']) ) { $board_config['board_timezone'] = $userdata['user_timezone']; } } - if(file_exists("language/lang_".$board_config['default_lang']."/lang_main.".$phpEx) ) + if( file_exists($phpbb_root_path . "language/lang_" . $board_config['default_lang'] . "/lang_main.".$phpEx) ) { - include($phpbb_root_path . 'language/lang_'.$board_config['default_lang'].'/lang_main.'.$phpEx); + include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx); } else { - include($phpbb_root_path . 'language/lang_english/lang_main.'.$phpEx); + include($phpbb_root_path . 'language/lang_english/lang_main.' . $phpEx); } return; @@ -302,8 +295,6 @@ function setup_style($style) message_die(CRITICAL_ERROR, "Couldn't get theme data for themes_id=$style."); } -// $template_path = ( defined('IN_ADMIN') ) ? 'admin/templates/' : 'templates/' ; -// $template_name = ( defined('IN_ADMIN') ) ? $board_config['board_admin_template'] : $myrow['template_name'] ; $template_path = 'templates/' ; $template_name = $row['template_name'] ; @@ -349,16 +340,12 @@ function encode_ip($dotquad_ip) { $ip_sep = explode(".", $dotquad_ip); return (sprintf("%02x%02x%02x%02x", $ip_sep[0], $ip_sep[1], $ip_sep[2], $ip_sep[3])); - -// return (( $ip_sep[0] * 0xFFFFFF + $ip_sep[0] ) + ( $ip_sep[1] * 0xFFFF + $ip_sep[1] ) + ( $ip_sep[2] * 0xFF + $ip_sep[2] ) + ( $ip_sep[3] ) ); } function decode_ip($int_ip) { $hexipbang = explode(".",chunk_split($int_ip, 2, ".")); return hexdec($hexipbang[0]).".".hexdec($hexipbang[1]).".".hexdec($hexipbang[2]).".".hexdec($hexipbang[3]); - -// return sprintf( "%d.%d.%d.%d", ( ( $int_ip >> 24 ) & 0xFF ), ( ( $int_ip >> 16 ) & 0xFF ), ( ( $int_ip >> 8 ) & 0xFF ), ( ( $int_ip ) & 0xFF ) ); } // @@ -387,81 +374,93 @@ function generate_pagination($base_url, $num_items, $per_page, $start_item, $add global $lang; $total_pages = ceil($num_items/$per_page); - if($total_pages == 1) + + if( $total_pages == 1 ) { return ""; } - $on_page = floor($start_item/$per_page) + 1; + $on_page = floor($start_item / $per_page) + 1; $page_string = ""; - $this_block_start = ($on_page < 10) ? 1 : floor($on_page/10) * 10; - $this_block_end = ($on_page < 10) ? 9 : $this_block_start + 9; - if($this_block_end > $total_pages) + if( $total_pages > 8 ) { - $this_block_end = $total_pages; - } - for($i = $this_block_start; $i <= $this_block_end; $i++) - { - $page_string .= ($i == $on_page) ? "$i" : "$i"; - if($i < $this_block_end) + $init_page_max = ( $total_pages > 2 ) ? 2 : $total_pages; + + for($i = 1; $i < $init_page_max + 1; $i++) { - $page_string .= ", "; - } - } - - if($this_block_start > 1) - { - $page_string_prepend = ""; - for($i = 0; $i < $this_block_start; $i += 10) - { - $page_string_prepend .= "" . ( ($i == 0) ? ($i + 1) : $i) . " - " . ($i + 9) . ", "; - } - - $page_string = $page_string_prepend . $page_string; - } - - if($this_block_end < $total_pages) - { - $page_string_append = ", "; - - if(!($total_pages%10)) - { - $page_url = append_sid($base_url."&start=".( ( ($this_block_end + 1) * $per_page ) - $per_page ) ); - $page_string_append .= "$total_pages"; - } - else - { - - for($i = $this_block_end + 1; $i < $total_pages; $i += 10) + $page_string .= ($i == $on_page) ? "$i" : "$i"; + if( $i < $init_page_max ) { - $page_string_append .= "" . ( ($i == 0) ? ($i + 1) : $i) . " - " . ((($i + 9) < $total_pages) ? ($i + 9) : $total_pages) . ""; - if($i < $total_pages - 10) + $page_string .= ", "; + } + } + + if( $total_pages > 2 ) + { + if( $on_page > 1 && $on_page < $total_pages ) + { + $page_string .= ( $on_page > 4 ) ? " ... " : ", "; + + $init_page_min = ( $on_page > 3 ) ? $on_page : 4; + $init_page_max = ( $on_page < $total_pages - 3 ) ? $on_page : $total_pages - 3; + + for($i = $init_page_min - 1; $i < $init_page_max + 2; $i++) { - $page_string_append .= ", "; + $page_string .= ($i == $on_page) ? "$i" : "$i"; + if( $i < $init_page_max + 1 ) + { + $page_string .= ", "; + } + } + + $page_string .= ( $on_page < $total_pages - 3 ) ? " ... " : ", "; + } + else + { + $page_string .= " ... "; + } + + for($i = $total_pages - 1; $i < $total_pages + 1; $i++) + { + $page_string .= ($i == $on_page) ? "$i" : "$i"; + if( $i < $total_pages ) + { + $page_string .= ", "; } } } - $page_string .= $page_string_append; + } + else + { + for($i = 1; $i < $total_pages + 1; $i++) + { + $page_string .= ($i == $on_page) ? "$i" : "$i"; + if( $i < $total_pages ) + { + $page_string .= ", "; + } + } } - if($add_prevnext_text) + if( $add_prevnext_text ) { if($on_page > 1) { $page_string = " " . $lang['Previous'] . "  " . $page_string; } + if($on_page < $total_pages) { $page_string .= "  " . $lang['Next'] . ""; } - $page_string = $lang['Goto_page'] . ": " . $page_string; - } + $page_string = $lang['Goto_page'] . " " . $page_string; + return $page_string; } diff --git a/phpBB/includes/page_header.php b/phpBB/includes/page_header.php index 578639bee1..0876397e25 100644 --- a/phpBB/includes/page_header.php +++ b/phpBB/includes/page_header.php @@ -142,12 +142,11 @@ for($i = 0; $i < count($userlist_ary); $i++) } } } +$online_userlist = $lang['Registered_users'] . " " . $online_userlist; -$l_g_user_s = ($guests_online == 1) ? $lang['User'] : $lang['Users']; -$l_h_user_s = ($logged_hidden_online == 1) ? $lang['User'] : $lang['Users']; -$l_r_user_s = ($logged_visible_online == 1) ? $lang['User'] : $lang['Users']; -$l_is_are = ($logged_visible_online == 1) ? $lang['is'] : $lang['are']; -$online_userlist = ($logged_visible_online > 0) ? $lang['Registered'] . " $l_r_user_s: " . $online_userlist : $lang['Registered'] . " $l_r_user_s: " . $lang['None']; +$total_online_users = $logged_visible_online + $logged_hidden_online + $guests_online; + +$l_online_users = ( $total_online_users == 1 ) ? sprintf($lang['Online_user'], $total_online_users, $logged_visible_online, $logged_hidden_online, $guests_online) : sprintf($lang['Online_users'], $total_online_users, $logged_visible_online, $logged_hidden_online, $guests_online); // // Obtain number of new private messages @@ -168,8 +167,8 @@ if( $userdata['session_logged_in'] ) { $new_pm_messages = $pm_result['new_messages']; - $l_message_new = ( $new_pm_messages == 1 ) ? $lang['message'] : $lang['messages']; - $l_privmsgs_text = $lang['You_have'] . " $new_pm_messages " . $lang['new'] . " $l_message_new"; + $l_message_new = ( $new_pm_messages == 1 ) ? $lang['New_pm'] : $lang['New_pms']; + $l_privmsgs_text = sprintf($l_message_new, $new_pm_messages); } else { @@ -189,17 +188,16 @@ else $template->assign_vars(array( "SITENAME" => $board_config['sitename'], "PAGE_TITLE" => $page_title, - "TOTAL_USERS_ONLINE" => $lang['There'] . " $l_is_are $logged_visible_online " . $lang['Registered'] . " $l_r_user_s, $logged_hidden_online " . $lang['Hidden'] . " $l_h_user_s ". $lang['and'] . " $guests_online " . $lang['Guest'] . " $l_g_user_s " . $lang['online'], + "TOTAL_USERS_ONLINE" => $l_online_users, "LOGGED_IN_USER_LIST" => $online_userlist, "PRIVATE_MESSAGE_INFO" => $l_privmsgs_text, "PRIVATE_MESSAGE_COUNT" => $new_pm_messages_session, - "LAST_VISIT_DATE" => $s_last_visit, + "LAST_VISIT_DATE" => $s_last_visit, "L_USERNAME" => $lang['Username'], "L_PASSWORD" => $lang['Password'], "L_LOGIN" => $lang['Login'], "L_LOG_ME_IN" => $lang['Log_me_in'], - "L_WELCOMETO" => $lang['Welcome_to'], "L_INDEX" => $lang['Forum_Index'], "L_REGISTER" => $lang['Register'], "L_PROFILE" => $lang['Profile'], @@ -216,11 +214,13 @@ $template->assign_vars(array( "L_POSTS" => $lang['Posts'], "L_LASTPOST" => $lang['Last_Post'], "L_MODERATOR" => $lang['Moderator'], - "L_NONEWPOSTS" => $lang['No_new_posts'], - "L_NEWPOSTS" => $lang['New_posts'], - "L_NONEWPOSTS_HOT" => $lang['No_new_posts_hot'], - "L_NEWPOSTS_HOT" => $lang['New_posts_hot'], - "L_TOPIC_IS_LOCKED" => $lang['Topic_is_locked'], + "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_TOPIC_IS_LOCKED" => $lang['Topic_is_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'], @@ -242,6 +242,8 @@ $template->assign_vars(array( "U_MEMBERSLIST" => append_sid("memberlist.".$phpEx), "U_GROUP_CP" => append_sid("groupcp.".$phpEx), + "S_CONTENT_DIRECTION" => $lang['DIRECTION'], + "S_CONTENT_ENCODING" => $lang['ENCODING'], "S_TIMEZONE" => $lang['All_times'] . " " . $lang[$board_config['board_timezone']], "S_LOGIN_ACTION" => append_sid("login.$phpEx"), "S_CURRENT_TIME" => create_date($board_config['default_dateformat'], time(), $board_config['board_timezone']), @@ -291,11 +293,11 @@ $template->assign_vars(array( // if( !$userdata['session_logged_in'] ) { - $template->assign_block_vars("user_logged_out", array()); + $template->assign_block_vars("switch_user_logged_out", array()); } else { - $template->assign_block_vars("user_logged_in", array()); + $template->assign_block_vars("switch_user_logged_in", array()); } header ("Cache-Control: no-store, no-cache, must-revalidate"); diff --git a/phpBB/index.php b/phpBB/index.php index 1c5e884836..052f689291 100644 --- a/phpBB/index.php +++ b/phpBB/index.php @@ -85,10 +85,10 @@ if( $mark_read == "forums" ) } $template->assign_vars(array( - "META" => '') + "META" => '') ); - $message = $lang['Forums_marked_read'] . "

" . $lang['Click'] . " " . $lang['HERE'] . " " . $lang['to_return_index']; + $message = $lang['Forums_marked_read'] . "

" . sprintf($lang['Click_return_index'], "", " "); message_die(GENERAL_MESSAGE, $message); } @@ -104,7 +104,6 @@ if( $mark_read == "forums" ) // $total_posts = get_db_stat('postcount'); $total_users = get_db_stat('usercount'); -$total_topics = get_db_stat('topiccount'); $newest_userdata = get_db_stat('newestuser'); $newest_user = $newest_userdata['username']; $newest_uid = $newest_userdata['user_id']; @@ -136,13 +135,13 @@ if($total_categories = $db->sql_numrows($q_categories)) case 'postgresql': $limit_forums = ($viewcat != -1) ? "AND f.cat_id = $viewcat " : ""; - $sql = "SELECT f.*, p.post_time, u.username, u.user_id + $sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id FROM " . FORUMS_TABLE . " f, " . POSTS_TABLE . " p, " . USERS_TABLE . " u WHERE p.post_id = f.forum_last_post_id AND u.user_id = p.poster_id $limit_forums UNION ( - SELECT f.*, NULL, NULL, NULL + SELECT f.*, NULL, NULL, NULL, NULL FROM " . FORUMS_TABLE . " f WHERE NOT EXISTS ( SELECT p.post_time @@ -156,7 +155,7 @@ if($total_categories = $db->sql_numrows($q_categories)) case 'oracle': $limit_forums = ($viewcat != -1) ? "AND f.cat_id = $viewcat " : ""; - $sql = "SELECT f.*, p.post_time, u.username, u.user_id + $sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id FROM " . FORUMS_TABLE . " f, " . POSTS_TABLE . " p, " . USERS_TABLE . " u WHERE p.post_id = f.forum_last_post_id(+) AND u.user_id = p.poster_id(+) @@ -167,7 +166,7 @@ if($total_categories = $db->sql_numrows($q_categories)) default: $limit_forums = ($viewcat != -1) ? "WHERE f.cat_id = $viewcat " : ""; - $sql = "SELECT f.*, p.post_time, u.username, u.user_id + $sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id FROM (( " . FORUMS_TABLE . " f LEFT JOIN " . POSTS_TABLE . " p ON p.post_id = f.forum_last_post_id ) LEFT JOIN " . USERS_TABLE . " u ON u.user_id = p.poster_id ) @@ -191,7 +190,8 @@ if($total_categories = $db->sql_numrows($q_categories)) WHERE t.forum_id = f.forum_id AND p.post_id = t.topic_last_post_id AND p.post_time > " . $userdata['session_last_visit'] . " - AND t.topic_moved_id IS NULL"; + AND t.topic_moved_id IS NULL + AND t.topic_status <> " . TOPIC_LOCKED; if(!$new_topic_ids = $db->sql_query($sql)) { message_die(GENERAL_ERROR, "Could not query new topic information", "", __LINE__, __FILE__, $sql); @@ -247,20 +247,16 @@ if($total_categories = $db->sql_numrows($q_categories)) ); $template->assign_vars(array( - "TOTAL_POSTS" => $total_posts, - "TOTAL_USERS" => $total_users, - "TOTAL_TOPICS" => $total_topics, - "NEWEST_USER" => $newest_user, - "NEWEST_UID" => $newest_uid, - "USERS_BROWSING" => $users_browsing, + "TOTAL_POSTS" => sprintf($lang['Posted_total'], $total_posts), + "TOTAL_USERS" => ( $total_users == 1 ) ? sprintf($lang['Registered_user_total'], $total_users) : sprintf($lang['Registered_users_total'], $total_users), + "NEWEST_USER" => sprintf($lang['Newest_user'], "", $newest_user, ""), "L_FORUM_LOCKED" => $lang['Forum_is_locked'], "L_MARK_FORUMS_READ" => $lang['Mark_all_forums'], "L_SEARCH_NEW" => $lang['Search_new'], "U_SEARCH_NEW" => append_sid("search.$phpEx?search_id=newposts"), - "U_MARK_READ" => append_sid("index.$phpEx?mark=forums"), - "U_NEWEST_USER_PROFILE" => append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$newest_uid")) + "U_MARK_READ" => append_sid("index.$phpEx?mark=forums")) ); // @@ -326,8 +322,9 @@ if($total_categories = $db->sql_numrows($q_categories)) $last_post_time = create_date($board_config['default_dateformat'], $forum_rows[$j]['post_time'], $board_config['board_timezone']); $last_post = $last_post_time . "
" . $lang['by'] . " "; - $last_post .= ( $forum_rows[$j]['user_id'] == ANONYMOUS ) ? $forum_rows[$j]['username'] . " " : "" . $forum_rows[$j]['username'] . " "; + $last_post .= ( $forum_rows[$j]['user_id'] == ANONYMOUS ) ? ( ($forum_rows[$j]['post_username'] != "" ) ? $forum_rows[$j]['post_username'] . " " : $lang['Guest'] . " " ) : "" . $forum_rows[$j]['username'] . " "; + $last_post .= "\"""; } else diff --git a/phpBB/language/lang_english/lang_main.php b/phpBB/language/lang_english/lang_main.php index d3ef0c5caa..b395ac3188 100644 --- a/phpBB/language/lang_english/lang_main.php +++ b/phpBB/language/lang_english/lang_main.php @@ -19,23 +19,19 @@ * ***************************************************************************/ -// ------------------------------------------------------------------------- -// NOTE THE FOLLOWING -// ------------------------------------------------------------------------- // // The format of this file is: // // ---> $lang['message'] = "text"; // -// 'message' should be a GOOD representation of text, including capitalisation -// and underscoring for spacing. Remember different languages often interpret -// consecutive words in different ways, so if you're building a sentence then -// try and indicate what 'words' follow if applicable -// -// The number of phrases should be kept to a minimum so try and reuse as much -// as possible. +// You should also try to set a locale and a character +// encoding (plus direction). The encoding and direction +// will be sent to the template // +setlocale(LC_ALL, "en"); +$lang['ENCODING'] = "iso-8859-1"; +$lang['DIRECTION'] = "LTR"; // // Common, these terms are used @@ -82,34 +78,24 @@ $lang['Previous'] = "Previous"; $lang['Goto_page'] = "Goto page"; $lang['Page'] = "Page"; // Followed by the current page number then 'of x' where x is total pages $lang['Pages'] = "Pages"; +$lang['IP_Address'] = "IP Address"; + +$lang['View_latest_post'] = "View latest post"; +$lang['Page_of'] = "Page %d of %d"; // Replaces with: Page 1 of 2 for example +$lang['Page'] = "Page"; // Followed by the current page number then 'of x' where x is total pages +$lang['Pages'] = "Pages"; $lang['of'] = "of"; // See Page above -$lang['Go'] = "Go"; $lang['Submit'] = "Submit"; $lang['Reset'] = "Reset"; $lang['Cancel'] = "Cancel"; $lang['Yes'] = "Yes"; $lang['No'] = "No"; - -$lang['Private_messaging'] = "Send a Private Message"; - -$lang['and'] = "and"; // used within a sentence in various places +$lang['Go'] = "Go"; +$lang['Joined'] = "Joined"; $lang['Admin_panel'] = "Go to Administration Panel"; -$lang['You'] = "You"; // This is followed by the auth results for a given function (see below) -$lang['can'] = "can"; -$lang['cannot'] = "cannot"; -$lang['read_posts'] = "read posts in this forum"; -$lang['post_topics'] = "post new topics in this forum"; -$lang['reply_posts'] = "reply to posts in this forum"; -$lang['edit_posts'] = "edit your posts in this forum"; -$lang['delete_posts'] = "delete your posts in this forum"; -$lang['vote_polls'] = "vote in polls in this forum"; -$lang['moderate_forum'] = "moderate this forum"; - -$lang['View_latest_post'] = "View latest post"; - $lang['ICQ'] = "ICQ Number"; $lang['AIM'] = "AIM Address"; $lang['MSNM'] = "MSN Messenger"; @@ -117,30 +103,22 @@ $lang['YIM'] = "Yahoo Messenger"; $lang['Error'] = "Error"; -$lang['HERE'] = "HERE"; - -$lang['IP_Address'] = "IP Address"; - $lang['Jump_to'] = "Jump to"; $lang['Select_forum'] = "Select a forum"; -$lang['Go'] = "Go"; $lang['Success'] = "Success"; +$lang['Private_messaging'] = "Send a Private Message"; // // Global Header strings // -$lang['There'] = "There"; -$lang['Registered'] = "Registered"; -$lang['Guest'] = "Guest"; -$lang['Hidden'] = "Hidden"; -$lang['None'] = "None"; -$lang['online'] = "online"; +$lang['Registered_users'] = "Registered Users:"; +$lang['Online_users'] = "In total there are %d users online :: %d Registered, %d Hidden and %d Guests"; +$lang['Online_user'] = "In total there is %d user online :: %d Registered, %d Hidden and %d Guests"; $lang['You_last_visit'] = "You last visited on"; $lang['Add'] = "Add"; -$lang['Welcome_to'] = "Welcome to"; // Followed by site name $lang['Register'] = "Register"; $lang['Profile'] = "Profile"; $lang['Edit_profile'] = "Edit your profile"; @@ -159,13 +137,10 @@ $lang['Mark_all_forums'] = "Mark all forums read"; // // Stats block text // -$lang['Posted_Total'] = "Our users have posted a total of"; // Number of posts -$lang['We_have'] = "We have"; // # registered users -$lang['Regedusers'] = "Registered users"; -$lang['newestuser'] = "The newest Registered User is"; // username -$lang['browsing'] = "browsing"; -$lang['arecurrently'] = "There are currently"; // # users browsing -$lang['theforums'] = "the forums"; +$lang['Posted_total'] = "Our users have posted a total of %d articles"; // Number of posts +$lang['Registered_user_total'] = "We have %d registered user"; // # registered users +$lang['Registered_users_total'] = "We have %d registered users"; // # registered users +$lang['Newest_user'] = "The newest registered user is %s%s%s"; // username $lang['No_new_posts'] = "No new posts"; $lang['New_posts'] = "New posts"; @@ -174,7 +149,6 @@ $lang['No_new_posts_hot'] = "No new posts [ Popular ]"; $lang['New_posts_hot'] = "New posts [ Popular ]"; $lang['Topic_is_locked'] = "Topic is locked"; $lang['Forum_is_locked'] = "Forum is locked"; -$lang['Joined'] = "Joined"; // @@ -182,8 +156,6 @@ $lang['Joined'] = "Joined"; // $lang['Login'] = "Login"; $lang['Logout'] = "Logout"; -$lang['You_are_logged_in'] = "You are logged in as"; // This is followed by the username -$lang['You_are_not_logged_in'] = "You are not logged in"; $lang['Forgotten_password'] = "I forgot my password"; $lang['Log_me_in'] = "Log me on automatically each visit"; @@ -207,8 +179,8 @@ $lang['Forums_marked_read'] = "All forums have been marked read"; // $lang['View_forum'] = "View Forum"; -$lang['Forum_not_exist'] = "The forum you selected does not exist, please go back and try again"; -$lang['Reached_on_error'] = "You have reached this page in error, please go back and try again"; +$lang['Forum_not_exist'] = "The forum you selected does not exist"; +$lang['Reached_on_error'] = "You have reached this page in error"; $lang['Display_topics'] = "Display topics from previous"; $lang['All_Topics'] = "All Topics"; @@ -220,6 +192,17 @@ $lang['Topic_Poll'] = "[ Poll ]"; $lang['View_newest_posts'] = "View posts since your last visit"; $lang['Topics_marked_read'] = "The topics for this forum have now been marked read"; +$lang['Rules_post_can'] = "You can post new topics in this forum"; +$lang['Rules_post_cannot'] = "You can post new topics in this forum"; +$lang['Rules_reply_can'] = "You can reply to topics in this forum"; +$lang['Rules_reply_cannot'] = "You can reply to topics in this forum"; +$lang['Rules_edit_can'] = "You can edit your posts in this forum"; +$lang['Rules_edit_cannot'] = "You can edit your posts in this forum"; +$lang['Rules_delete_can'] = "You can delete posts in this forum"; +$lang['Rules_delete_cannot'] = "You can delete posts in this forum"; +$lang['Rules_vote_can'] = "You can vote in polls in this forum"; +$lang['Rules_vote_cannot'] = "You can vote in polls in this forum"; +$lang['Rules_moderate'] = "You can %smoderate this forum%s"; // %s replaced by a href // // Viewtopic @@ -236,11 +219,12 @@ $lang['View_results'] = "View Results"; $lang['No_newer_topics'] = "There are no newer topics in this forum"; $lang['No_older_topics'] = "There are no older topics in this forum"; $lang['Topic_post_not_exist'] = "The topic or post you requested does not exist"; +$lang['No_posts_topic'] = "No posts exist for this topic"; + $lang['Display_posts'] = "Display posts from previous"; $lang['All_Posts'] = "All Posts"; $lang['Newest_First'] = "Newest First"; $lang['Oldest_First'] = "Oldest First"; -$lang['No_posts_topic'] = "No posts exist for this topic"; $lang['Return_to_top'] = "Return to top"; @@ -253,11 +237,8 @@ $lang['Reply_with_quote'] = "Reply with quote"; $lang['View_IP'] = "View IP of poster"; $lang['Delete_post'] = "Delete this post"; -$lang['Edited_by'] = "Last edited by"; // followed by -> [username] on ... -$lang['on'] = "on"; -$lang['edited'] = "edited"; // followed by -> [num] times in total -$lang['time_in_total'] = "time in total"; -$lang['times_in_total'] = "times in total"; +$lang['Edited_time_total'] = "Last edited by %s on %s, edited %d time in total"; // Last edited by me on 12 Oct 2001, edited 1 time in total +$lang['Edited_times_total'] = "Last edited by %s on %s, edited %d times in total"; // Last edited by me on 12 Oct 2001, edited 2 times in total $lang['Lock_topic'] = "Lock this topic"; $lang['Unlock_topic'] = "Unlock this topic"; @@ -297,7 +278,7 @@ $lang['Submit_post'] = "Submit Post"; $lang['Preview'] = "Preview"; $lang['Cancel_post'] = "Cancel post"; -$lang['Flood_Error'] = "You cannot make another post so soon after your last, please try again in a short while."; +$lang['Flood_Error'] = "You cannot make another post so soon after your last, please try again in a short while"; $lang['Empty_subject'] = "You must specifiy a subject when posting a new topic"; $lang['Empty_message'] = "You must enter a message when posting"; $lang['Announce_and_sticky'] = "You cannot post a topic that is both an announcement and a sticky topic"; @@ -352,6 +333,10 @@ $lang['to_return_forum'] = "to return to the forum"; $lang['to_view_message'] = "to view your message"; $lang['to_return_topic'] = "to return to the topic"; +$lang['Click_return_topic'] = "Click %sHere%s to return to the topic"; +$lang['Click_return_forum'] = "Click %sHere%s to return to the forum"; +$lang['Click_view_message'] = "Click %sHere%s to view your message"; + $lang['Topic_reply_notification'] = "Topic Reply Notification"; @@ -360,12 +345,10 @@ $lang['Topic_reply_notification'] = "Topic Reply Notification"; // $lang['Private_Messaging'] = "Private Messaging"; -$lang['You_have'] = "You have"; // followed by "x new message/s" -$lang['new'] = "new"; // see above -$lang['message'] = "message"; // see above -$lang['messages'] = "messages"; // see above -$lang['No_new_pm'] = "You have no new messages"; $lang['Login_check_pm'] = "Login to check your private messages"; +$lang['New_pms'] = "You have %d new messages"; // You have 2 new messages +$lang['New_pm'] = "You have %d new message"; // You have 1 new message +$lang['No_new_pm'] = "You have no new messages"; $lang['Inbox'] = "Inbox"; $lang['Sent'] = "Sent"; @@ -382,14 +365,14 @@ $lang['All_Messages'] = "All Messages"; $lang['No_messages_folder'] = "You have no messages in this folder"; -$lang['Cannot_send_privmsg'] = "Sorry but you are not currently allowed to send private messages."; +$lang['Cannot_send_privmsg'] = "Sorry but the administrator has prevented you from sending private messages"; $lang['No_to_user'] = "You must specify a username to send this message"; $lang['No_such_user'] = "Sorry but no such user exists"; $lang['Message_sent'] = "Your message has been sent"; -$lang['to_return_inbox'] = " to return to your Inbox"; // This follows a "Click HERE ... " -$lang['to_return_index'] = " to return to the Index"; // This follows a "Click HERE ... " +$lang['Click_return_inbox'] = "Click %sHere%s to return to your Inbox"; +$lang['Click_return_index'] = "Click %sHere%s to return to the Index"; $lang['Re'] = "Re"; // Re as in 'Response to' @@ -413,8 +396,8 @@ $lang['Sentbox'] = "Sent box"; $lang['Mark_all'] = "Mark all"; $lang['Unmark_all'] = "Unmark all"; -$lang['Your'] = "Your"; // Example of use of this var : "Your Inbox is 50% full"; -$lang['full'] = "full"; +$lang['Box_size'] = "Your %s is %d%% full"; // eg. Your Inbox is 50% full +//$lang['Box_size'] = "Your {BOXNAME} is {BOXSIZE}% full"; // eg. Your Inbox is 50% full // @@ -688,7 +671,7 @@ $lang['Critical_Error'] = "Critical Error"; $lang['An_error_occured'] = "An Error Occured"; $lang['A_critical_error'] = "A Critical Error Occured"; -$lang['Error_login'] = "Login Failed
You have specified an incorrect/inactive username or invalid password, please go back and try again"; +$lang['Error_login'] = "Login Failed

You have specified an incorrect or inactive username or an invalid password"; $lang['Not_Moderator'] = "You are not a moderator of this forum"; $lang['Not_Authorised'] = "Not Authorised"; @@ -875,7 +858,7 @@ $lang['Reply'] = "Reply"; $lang['Edit'] = "Edit"; $lang['Delete'] = "Delete"; $lang['Sticky'] = "Sticky"; -$lang['Announce'] = "Announce"; +$lang['Announce'] = "Announce"; $lang['Vote'] = "Vote"; $lang['Pollcreate'] = "Poll create"; @@ -1122,7 +1105,7 @@ $lang['no_disallowed'] = "No Disallowed Usernames"; // Styles Admin // $lang['Styles_admin'] = "Styles Administration"; -$lang['Styles_explain'] = "In this panel you can edit or remove styles from your forum. To import a new styles click on 'Add New' in the left hand panel, to create a new styles click on 'Create New'"; +$lang['Styles_explain'] = "Using this facility you can add, remove and manage styles (templates and themes) available to your users."; $lang['Styles_addnew_explain'] = "The following list contains all the themes that are available for the templates you currently have. The items on this list HAVE NOT yet been installed into the phpBB database. To install a theme simply click the 'install' link beside a selected entry"; $lang['Style'] = "Style"; $lang['Template'] = "Template"; diff --git a/phpBB/privmsg.php b/phpBB/privmsg.php index 157eb3b80d..cd204521e0 100644 --- a/phpBB/privmsg.php +++ b/phpBB/privmsg.php @@ -784,7 +784,6 @@ else if( $submit || $refresh || $mode != "" ) } $attach_sig = ( $submit || $refresh ) ? ( ( !empty($HTTP_POST_VARS['attach_sig']) ) ? TRUE : 0 ) : $userdata['user_attachsig']; - $user_sig = ( $userdata['user_sig'] != "" ) ? $userdata['user_sig'] : ""; if( $submit && $mode != "edit" ) @@ -998,10 +997,10 @@ else if( $submit || $refresh || $mode != "" ) } $template->assign_vars(array( - "META" => '') + "META" => '') ); - $msg = $lang['Message_sent'] . "

" . $lang['Click'] . " " . $lang['Here'] . " " . $lang['to_return_inbox'] . "

" . $lang['Click'] . " " . $lang['Here'] . " ". $lang['to_return_index']; + $msg = $lang['Message_sent'] . "

" . sprintf($lang['Click_return_inbox'], "", " ") . "

" . sprintf($lang['Click_return_index'], "", ""); message_die(GENERAL_MESSAGE, $msg); } @@ -1167,9 +1166,10 @@ else if( $submit || $refresh || $mode != "" ) { message_die(GENERAL_ERROR, "Could not obtain private message for editing.", "", __LINE__, __FILE__, $sql); } + if( !$db->sql_numrows($pm_reply_status) ) { -// header("Location: " . append_sid("privmsg.$phpEx?folder=$folder", true)); + header("Location: " . append_sid("privmsg.$phpEx?folder=$folder", true)); } $privmsg = $db->sql_fetchrow($pm_reply_status); @@ -1178,20 +1178,18 @@ else if( $submit || $refresh || $mode != "" ) $to_username = $privmsg['username']; $to_userid = $privmsg['user_id']; + $privmsg_message = preg_replace("/\:$post_bbcode_uid(|\:[a-z])/si", "", $privmsg_message); + $privmsg_message = str_replace("
", "\n", $privmsg_message); + $privmsg_message = preg_replace($html_entities_match, $html_entities_replace, $privmsg_message); + $privmsg_message = preg_replace('##si', '</textarea>', $privmsg_message); + if( $mode == "quote" ) { $privmsg_message = $privmsg['privmsgs_text']; $msg_date = create_date($board_config['default_dateformat'], $privmsg['privmsgs_date'], $board_config['board_timezone']); //"[date]" . $privmsg['privmsgs_time'] . "[/date]"; - $privmsg_message = preg_replace("/\:[0-9a-z\:]*?\]/si", "]", $privmsg_message); - $privmsg_message = str_replace("
", "\n", $privmsg_message); - $privmsg_message = preg_replace($html_entities_match, $html_entities_replace, $privmsg_message); - $privmsg_message = preg_replace('##si', '</textarea>', $privmsg_message); - - $msg_date = create_date($board_config['default_dateformat'], $privmsg['privmsgs_date'], $board_config['default_timezone']); - - $privmsg_message = $to_username . " wrote:\n\n[quote]\n" . $privmsg_message . "\n[/quote]"; + $privmsg_message = "[quote=" . $to_username . "]\n" . $privmsg_message . "\n[/quote]"; $mode = "reply"; } @@ -1707,7 +1705,11 @@ if( $folder != "outbox" ) $template->assign_block_vars("box_size_notice", array()); - $l_box_size_status = $lang['Your'] . " " . $l_box_name . " " . $lang['is'] . " " . $inbox_limit_pct . "% " . $lang['full']; +// $lang_match = array("'{BOXNAME}'", "'{BOXSIZE}'"); +// $lang_replace = array($l_box_name, $inbox_limit_pct); +// $l_box_size_status = preg_replace($lang_match, $lang_replace, $lang['Box_size']); + + $l_box_size_status = sprintf($lang['Box_size'], $l_box_name, $inbox_limit_pct); } diff --git a/phpBB/templates/subSilver/index_body.tpl b/phpBB/templates/subSilver/index_body.tpl index 38bc0b2b21..8c44d79c51 100644 --- a/phpBB/templates/subSilver/index_body.tpl +++ b/phpBB/templates/subSilver/index_body.tpl @@ -6,6 +6,7 @@ on {LAST_VISIT_DATE} + @@ -31,12 +32,14 @@
 {L_FORUM} 
+
{L_MARK_FORUMS_READ} {S_TIMEZONE}
+ @@ -44,19 +47,16 @@ -
{L_WHO_IS_ONLINE}
{L_WHO_IS_ONLINE} -

A total of {TOTAL_POSTS} posts have been - made.
- We have {TOTAL_USERS} registered users.
- Welcome to our newest member {NEWEST_USER}.

+

{TOTAL_POSTS}
{TOTAL_USERS}
{NEWEST_USER}

{TOTAL_USERS_ONLINE}.
+
{TOTAL_USERS_ONLINE}
{LOGGED_IN_USER_LIST}
- +
@@ -75,18 +75,19 @@
- + + +
-
  - - + + - - + + -
{L_NEWPOSTS}{L_NEWPOSTS}{L_NEW_POSTS}{L_NEW_POSTS}   {L_NONEWPOSTS}{L_NONEWPOSTS}{L_NO_NEW_POSTS}{L_NO_NEW_POSTS}    {L_FORUM_LOCKED} {L_FORUM_LOCKED}
\ No newline at end of file + diff --git a/phpBB/templates/subSilver/viewforum_body.tpl b/phpBB/templates/subSilver/viewforum_body.tpl index 0d36751256..29a6b752a8 100644 --- a/phpBB/templates/subSilver/viewforum_body.tpl +++ b/phpBB/templates/subSilver/viewforum_body.tpl @@ -13,6 +13,7 @@ {L_MARK_TOPICS_READ} + @@ -27,7 +28,7 @@ - + @@ -43,52 +44,52 @@
 {L_TOPICS} {topicrow.NEWEST_POST_IMG}{topicrow.TOPIC_TYPE}{topicrow.TOPIC_TITLE}
{topicrow.GOTO_PAGE}
{topicrow.REPLIES}{topicrow.TOPIC_POSTER}{topicrow.TOPIC_POSTER} {topicrow.VIEWS} {topicrow.LAST_POST}
+ - + + + +
{L_NEW_TOPIC}    {SITENAME} {L_INDEX} -> {FORUM_NAME}{L_PAGE} - {ON_PAGE} {L_OF} {TOTAL_PAGES}  :: {PAGINATION} -
- {S_TIMEZONE}
{S_TIMEZONE}
{PAGINATION} +
{PAGE_NUMBER}
+
{JUMPBOX}
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
{L_NEWPOSTS}New posts  {L_NONEWPOSTS}Old topic  No new postsAnnouncement {L_NEWPOSTS}Topic is locked
{L_NEWPOSTS}New hot topic  {L_NEWPOSTS}Hot topic  No new postsSticky post    
- - + +
+ + -
+ + + + + + + + + + + + + + + + + + + + + + + +
{L_NEW_POSTS}{L_NEW_POSTS}  {L_NO_NEW_POSTS}{L_NO_NEW_POSTS}  {L_ANNOUNCEMENT}{L_ANNOUNCEMENT}  {L_TOPIC_IS_LOCKED}{L_TOPIC_IS_LOCKED}
{L_NEW_POSTS_HOT}{L_NEW_POSTS_HOT}  {L_NO_NEW_POSTS_HOT}{L_NO_NEW_POSTS_HOT}  {L_STICKY}{L_STICKY}
{S_AUTH_LIST}
diff --git a/phpBB/templates/subSilver/viewtopic_body.tpl b/phpBB/templates/subSilver/viewtopic_body.tpl index aa0cb20c7a..df101b19e8 100644 --- a/phpBB/templates/subSilver/viewtopic_body.tpl +++ b/phpBB/templates/subSilver/viewtopic_body.tpl @@ -39,14 +39,14 @@ {postrow.MINI_POST_IMG}{L_POSTED}: {postrow.POST_DATE}    {L_POST_SUBJECT}: {postrow.POST_SUBJECT} - {postrow.IP_IMG} {postrow.QUOTE_IMG} - {postrow.EDIT_IMG} {postrow.DELETE_IMG} + {postrow.QUOTE_IMG} + {postrow.EDIT_IMG} {postrow.DELETE_IMG} {postrow.IP_IMG}
- {postrow.MESSAGE} + {postrow.MESSAGE}{postrow.EDITED_MESSAGE} @@ -87,12 +87,14 @@ {L_TOPIC_POST}   {L_TOPIC_REPLY}    {SITENAME} {L_INDEX} -> {FORUM_NAME} - {L_PAGE} - {ON_PAGE} {L_OF} {TOTAL_PAGES}  :: {PAGINATION} -
- {S_TIMEZONE}
+ {S_TIMEZONE}
{PAGINATION} + + + + {PAGE_NUMBER} +
{S_WATCH_TOPIC}
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index adb26d24dd..e119af7dcf 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -117,8 +117,7 @@ if( $mark_read == "topics" ) WHERE t.forum_id = $forum_id AND p.post_id = t.topic_last_post_id AND p.post_time > " . $userdata['session_last_visit'] . " - AND t.topic_moved_id IS NULL - LIMIT $start, " . $board_config['topics_per_page']; + AND t.topic_moved_id IS NULL"; if(!$t_result = $db->sql_query($sql)) { message_die(GENERAL_ERROR, "Couldn't obtain topic information", "", __LINE__, __FILE__, $sql); @@ -148,10 +147,10 @@ if( $mark_read == "topics" ) } $template->assign_vars(array( - "META" => '') + "META" => '') ); - $message = $lang['Topics_marked_read'] . "

" . $lang['Click'] . " " . $lang['HERE'] . " " . $lang['to_return_forum']; + $message = $lang['Topics_marked_read'] . "

" . sprintf($lang['Click_return_forum'], "", " "); message_die(GENERAL_MESSAGE, $message); } // @@ -337,25 +336,15 @@ $template->assign_vars(array( // // User authorisation levels output // -$s_auth_can = $lang['You'] . " " . ( ($is_auth['auth_read']) ? $lang['can'] : $lang['cannot'] ) . " " . $lang['read_posts'] . "
"; -$s_auth_can .= $lang['You'] . " " . ( ($is_auth['auth_post']) ? $lang['can'] : $lang['cannot'] ) . " " . $lang['post_topics'] . "
"; -$s_auth_can .= $lang['You'] . " " . ( ($is_auth['auth_reply']) ? $lang['can'] : $lang['cannot'] ) . " " . $lang['reply_posts'] . "
"; -$s_auth_can .= $lang['You'] . " " . ( ($is_auth['auth_edit']) ? $lang['can'] : $lang['cannot'] ) . " " . $lang['edit_posts'] . "
"; -$s_auth_can .= $lang['You'] . " " . ( ($is_auth['auth_delete']) ? $lang['can'] : $lang['cannot'] ) . " " . $lang['delete_posts'] . "
"; +$s_auth_can = ( ( $is_auth['auth_post'] ) ? $lang['Rules_post_can'] : $lang['Rules_post_cannot'] ) . "
"; +$s_auth_can .= ( ( $is_auth['auth_reply'] ) ? $lang['Rules_reply_can'] : $lang['Rules_reply_cannot'] ) . "
"; +$s_auth_can .= ( ( $is_auth['auth_edit'] ) ? $lang['Rules_edit_can'] : $lang['Rules_edit_cannot'] ) . "
"; +$s_auth_can .= ( ( $is_auth['auth_delete'] ) ? $lang['Rules_delete_can'] : $lang['Rules_delete_cannot'] ) . "
"; +$s_auth_can .= ( ( $is_auth['auth_vote'] ) ? $lang['Rules_vote_can'] : $lang['Rules_vote_cannot'] ) . "
"; -/* -$s_auth_read_img = "\"""; -$s_auth_post_img = "\"""; -$s_auth_reply_img = "\"""; -$s_auth_edit_img = "\"""; -$s_auth_delete_img = "\"""; -*/ if( $is_auth['auth_mod'] ) { - $s_auth_can .= $lang['You'] . " " . $lang['can'] . " " . $lang['moderate_forum'] . "
"; - -// $s_auth_mod_img = "\"""; - + $s_auth_can .= sprintf($lang['Rules_moderate'], "", ""); } else { @@ -455,7 +444,7 @@ if($total_topics) if( ( $replies + 1 ) > $board_config['posts_per_page'] ) { - $goto_page = "   (\""" . $lang['Goto_page'] . ": "; + $goto_page = " [ \""" . $lang['Goto_page'] . ": "; $times = 1; for($j = 0; $j < $replies + 1; $j += $board_config['posts_per_page']) @@ -477,19 +466,19 @@ if($total_topics) } $times++; } - $goto_page .= ")"; + $goto_page .= " ] "; } else { $goto_page = ""; } - if($topic_rowset[$i]['topic_status'] == TOPIC_LOCKED) + if( $topic_rowset[$i]['topic_status'] == TOPIC_LOCKED ) { $folder_image = "\"""; $newest_post_img = ""; } - else if($topic_rowset[$i]['topic_status'] == TOPIC_MOVED) + else if( $topic_rowset[$i]['topic_status'] == TOPIC_MOVED ) { $topic_type = $lang['Topic_Moved'] . " "; $topic_id = $topic_rowset[$i]['topic_moved_id']; @@ -499,12 +488,12 @@ if($total_topics) } else { - if($topic_rowset[$i]['topic_type'] == POST_ANNOUNCE) + if( $topic_rowset[$i]['topic_type'] == POST_ANNOUNCE ) { $folder = $images['folder_announce']; $folder_new = $images['folder_announce_new']; } - else if($topic_rowset[$i]['topic_type'] == POST_STICKY) + else if( $topic_rowset[$i]['topic_type'] == POST_STICKY ) { $folder = $images['folder_sticky']; $folder_new = $images['folder_sticky_new']; @@ -555,13 +544,14 @@ if($total_topics) $view_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id"); - $topic_poster = $topic_rowset[$i]['username']; - $topic_poster_profile_url = append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $topic_rowset[$i]['user_id']); + $topic_poster = ( $topic_rowset[$i]['user_id'] != ANONYMOUS ) ? "" : ""; + $topic_poster .= $topic_rowset[$i]['username']; + $topic_poster .= ( $topic_rowset[$i]['user_id'] != ANONYMOUS ) ? "" : ""; $last_post_time = create_date($board_config['default_dateformat'], $topic_rowset[$i]['post_time'], $board_config['board_timezone']); $last_post = $last_post_time . "
" . $lang['by'] . " "; - $last_post .= ( $topic_rowset[$i]['id2'] == ANONYMOUS ) ? $topic_rowset[$i]['user2'] . " " : "" . $topic_rowset[$i]['user2'] . " "; + $last_post .= ( $topic_rowset[$i]['id2'] == ANONYMOUS ) ? ( ($topic_rowset[$i]['post_username'] != "" ) ? $topic_rowset[$i]['post_username'] . " " : $lang['Guest'] . " " ) : "" . $topic_rowset[$i]['user2'] . " "; $last_post .= "\"""; $views = $topic_rowset[$i]['topic_views']; @@ -579,18 +569,14 @@ if($total_topics) "VIEWS" => $views, "LAST_POST" => $last_post, - "U_VIEW_TOPIC" => $view_topic_url, - "U_TOPIC_POSTER_PROFILE" => $topic_poster_profile_url) + "U_VIEW_TOPIC" => $view_topic_url) ); } $template->assign_vars(array( "PAGINATION" => generate_pagination("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id&topicdays=$topic_days", $topics_count, $board_config['topics_per_page'], $start), - "ON_PAGE" => ( floor( $start / $board_config['topics_per_page'] ) + 1 ), - "TOTAL_PAGES" => ceil( $topics_count / $board_config['topics_per_page'] ), + "PAGE_NUMBER" => sprintf($lang['Page_of'], ( floor( $start / $board_config['topics_per_page'] ) + 1 ), ceil( $topics_count / $board_config['topics_per_page'] )), - "L_OF" => $lang['of'], - "L_PAGE" => $lang['Page'], "L_GOTO_PAGE" => $lang['Goto_page'], "S_NO_TOPICS" => FALSE) diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 429b08c87b..2fd341fccf 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -56,7 +56,7 @@ if( isset($HTTP_GET_VARS["view"]) && empty($HTTP_GET_VARS[POST_POST_URL]) ) { if( $HTTP_GET_VARS["view"] == "newest" ) { - if(isset($HTTP_COOKIE_VARS[$board_config['cookie_name']])) + if( isset($HTTP_COOKIE_VARS[$board_config['cookie_name']]) ) { $sessiondata = unserialize(stripslashes($HTTP_COOKIE_VARS[$board_config['cookie_name']])); @@ -68,7 +68,7 @@ if( isset($HTTP_GET_VARS["view"]) && empty($HTTP_GET_VARS[POST_POST_URL]) ) AND post_time >= $newest_time ORDER BY post_time ASC LIMIT 1"; - if(!$result = $db->sql_query($sql)) + if( !$result = $db->sql_query($sql) ) { message_die(GENERAL_ERROR, "Couldn't obtain newer/older topic information", "", __LINE__, __FILE__, $sql); } @@ -88,12 +88,12 @@ if( isset($HTTP_GET_VARS["view"]) && empty($HTTP_GET_VARS[POST_POST_URL]) ) header("Location: " . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id", true)); } } - else if($HTTP_GET_VARS["view"] == "next") + else if( $HTTP_GET_VARS["view"] == "next" ) { $sql_condition = ">"; $sql_ordering = "ASC"; } - else if($HTTP_GET_VARS["view"] == "previous") + else if( $HTTP_GET_VARS["view"] == "previous" ) { $sql_condition = "<"; $sql_ordering = "DESC"; @@ -116,7 +116,7 @@ if( isset($HTTP_GET_VARS["view"]) && empty($HTTP_GET_VARS[POST_POST_URL]) ) if( !$row = $db->sql_fetchrow($result) ) { - if($HTTP_GET_VARS["view"] == "next") + if( $HTTP_GET_VARS["view"] == "next" ) { message_die(GENERAL_MESSAGE, 'No_newer_topics'); } @@ -485,6 +485,33 @@ if( count($orig_word) ) $topic_title = preg_replace($orig_word, $replacement_word, $topic_title); } +// +// Was a highlight request part of the URI? Yes, this idea was +// taken from vB but we did already have a highlighter in place +// in search itself ... it's just been extended a bit! +// + +if( isset($HTTP_GET_VARS['highlight']) ) +{ + // + // Split words and phrases + // + $words = explode(" ", $HTTP_GET_VARS['highlight']); + + for($i = 0; $i < count($words); $i++) + { + $highlight_match[] = "#\b(" . str_replace("\*", ".*?", preg_quote($words[$i], "#")) . ")\b#i"; + $highlight_replace[] = "\\1"; + } + + $highlight_active = ( count($words) ) ? true : false; + +} +else +{ + $highlight_active = false; +} + $template->assign_vars(array( "FORUM_NAME" => $forum_name, "TOPIC_TITLE" => $topic_title, @@ -672,7 +699,7 @@ for($i = 0; $i < $total_posts; $i++) switch( $postrow[$i]['user_avatar_type'] ) { case USER_AVATAR_UPLOAD: - $poster_avatar = "\"\""; + $poster_avatar = ( $board_config['avatar_upload_db'] ) ? "\"\"" : "\"\""; break; case USER_AVATAR_REMOTE: $poster_avatar = "\"\""; @@ -806,7 +833,7 @@ for($i = 0; $i < $total_posts; $i++) $quote_img = "\"""; - $search_img = ""; + $search_img = ""; if( ( $userdata['user_id'] == $poster_id && $is_auth['auth_edit'] ) || $is_auth['auth_mod'] ) { @@ -872,6 +899,11 @@ for($i = 0; $i < $total_posts; $i++) $message = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($message, $bbcode_uid) : preg_replace("/\:[0-9a-z\:]+\]/si", "]", $message); } + if( $highlight_active ) + { + $message = preg_replace($highlight_match, $highlight_replace, $message); + } + $message = make_clickable($message); if( $postrow[$i]['enable_sig'] && $user_sig != "" ) @@ -885,7 +917,7 @@ for($i = 0; $i < $total_posts; $i++) $message = preg_replace($orig_word, $replacement_word, $message); } - if($board_config['allow_smilies'] && $postrow[$i]['enable_smilies']) + if( $board_config['allow_smilies'] && $postrow[$i]['enable_smilies'] ) { $message = smilies_pass($message); } @@ -895,11 +927,11 @@ for($i = 0; $i < $total_posts; $i++) // // Editing information // - if($postrow[$i]['post_edit_count']) + if( $postrow[$i]['post_edit_count'] ) { - $l_edit_total = ($postrow[$i]['post_edit_count'] == 1) ? $lang['time_in_total'] : $lang['times_in_total']; - - $message = $message . "

" . $lang['Edited_by'] . " " . $poster . " " . $lang['on'] . " " . create_date($board_config['default_dateformat'], $postrow[$i]['post_edit_time'], $board_config['board_timezone']) . ", " . $lang['edited'] . " " . $postrow[$i]['post_edit_count'] . " $l_edit_total"; + $l_edit_time_total = ( $postrow[$i]['post_edit_count'] == 1 ) ? $lang['Edited_time_total'] : $lang['Edited_times_total']; + + $l_edited_by = "

" . sprintf($l_edit_time_total, $poster, create_date($board_config['default_dateformat'], $postrow[$i]['post_edit_time'], $board_config['board_timezone']), $postrow[$i]['post_edit_count']); } // @@ -913,6 +945,7 @@ for($i = 0; $i < $total_posts; $i++) "ROW_COLOR" => "#" . $row_color, "ROW_CLASS" => $row_class, "MINI_POST_IMG" => $mini_post_img, + "POSTER_NAME" => $poster, "POSTER_RANK" => $poster_rank, "RANK_IMAGE" => $rank_image, @@ -920,9 +953,12 @@ for($i = 0; $i < $total_posts; $i++) "POSTER_POSTS" => $poster_posts, "POSTER_FROM" => $poster_from, "POSTER_AVATAR" => $poster_avatar, + "POST_DATE" => $post_date, "POST_SUBJECT" => $post_subject, - "MESSAGE" => $message, + "MESSAGE" => $message, + "EDITED_MESSAGE" => $l_edited_by, + "PROFILE_IMG" => $profile_img, "SEARCH_IMG" => $search_img, "PM_IMG" => $pm_img, @@ -933,6 +969,7 @@ for($i = 0; $i < $total_posts; $i++) "AIM_IMG" => $aim_img, "MSN_IMG" => $msn_img, "YIM_IMG" => $yim_img, + "EDIT_IMG" => $edit_img, "QUOTE_IMG" => $quote_img, "PMSG_IMG" => $pmsg_img, @@ -946,24 +983,15 @@ for($i = 0; $i < $total_posts; $i++) // // User authorisation levels output // -$s_auth_can = $lang['You'] . " " . ( ($is_auth['auth_post']) ? $lang['can'] : $lang['cannot'] ) . " " . $lang['post_topics'] . "
"; -$s_auth_can .= $lang['You'] . " " . ( ($is_auth['auth_reply']) ? $lang['can'] : $lang['cannot'] ) . " " . $lang['reply_posts'] . "
"; -$s_auth_can .= $lang['You'] . " " . ( ($is_auth['auth_edit']) ? $lang['can'] : $lang['cannot'] ) . " " . $lang['edit_posts'] . "
"; -$s_auth_can .= $lang['You'] . " " . ( ($is_auth['auth_delete']) ? $lang['can'] : $lang['cannot'] ) . " " . $lang['delete_posts'] . "
"; -$s_auth_can .= $lang['You'] . " " . ( ($is_auth['auth_vote']) ? $lang['can'] : $lang['cannot'] ) . " " . $lang['vote_polls'] . "
"; -/* -$s_auth_post_img = "\"""; -$s_auth_reply_img = "\"""; -$s_auth_edit_img = "\"""; -$s_auth_delete_img = "\"""; -$s_auth_delete_img = "\"""; -*/ +$s_auth_can = ( ( $is_auth['auth_post'] ) ? $lang['Rules_post_can'] : $lang['Rules_post_cannot'] ) . "
"; +$s_auth_can .= ( ( $is_auth['auth_reply'] ) ? $lang['Rules_reply_can'] : $lang['Rules_reply_cannot'] ) . "
"; +$s_auth_can .= ( ( $is_auth['auth_edit'] ) ? $lang['Rules_edit_can'] : $lang['Rules_edit_cannot'] ) . "
"; +$s_auth_can .= ( ( $is_auth['auth_delete'] ) ? $lang['Rules_delete_can'] : $lang['Rules_delete_cannot'] ) . "
"; +$s_auth_can .= ( ( $is_auth['auth_vote'] ) ? $lang['Rules_vote_can'] : $lang['Rules_vote_cannot'] ) . "
"; if( $is_auth['auth_mod'] ) { - $s_auth_can .= $lang['You'] . " " . $lang['can'] . " " . $lang['moderate_forum'] . "
"; - -// $s_auth_mod_img = "\"""; + $s_auth_can .= sprintf($lang['Rules_moderate'], "", ""); $topic_mod = "\"" "; @@ -983,9 +1011,9 @@ if( $is_auth['auth_mod'] ) // // Topic watch information // -if($can_watch_topic) +if( $can_watch_topic ) { - if($is_watching_topic) + if( $is_watching_topic ) { $s_watching_topic = "" . $lang['Stop_watching_topic'] . ""; $s_watching_topic_img = "\"""; @@ -1003,21 +1031,12 @@ else $template->assign_vars(array( "PAGINATION" => generate_pagination("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&postdays=$post_days&postorder=$post_order", $total_replies, $board_config['posts_per_page'], $start), - "ON_PAGE" => ( floor( $start / $board_config['posts_per_page'] ) + 1 ), - "TOTAL_PAGES" => ceil( $total_replies / $board_config['posts_per_page'] ), + "PAGE_NUMBER" => sprintf($lang['Page_of'], ( floor( $start / $board_config['posts_per_page'] ) + 1 ), ceil( $total_replies / $board_config['posts_per_page'] )), "S_AUTH_LIST" => $s_auth_can, - "S_AUTH_READ_IMG" => $s_auth_read_img, - "S_AUTH_POST_IMG" => $s_auth_post_img, - "S_AUTH_REPLY_IMG" => $s_auth_reply_img, - "S_AUTH_EDIT_IMG" => $s_auth_edit_img, - "S_AUTH_MOD_IMG" => $s_auth_mod_img, "S_TOPIC_ADMIN" => $topic_mod, "S_WATCH_TOPIC" => $s_watching_topic, - "S_WATCH_TOPIC_IMG" => $s_watching_topic_img, - "L_OF" => $lang['of'], - "L_PAGE" => $lang['Page'], "L_GOTO_PAGE" => $lang['Goto_page']) );