More capitalised lang strings, fixed some unset or incorrect variables

git-svn-id: file:///svn/phpbb/trunk@3469 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Ludovic Arnaud 2003-02-17 06:20:41 +00:00
parent 615e676b02
commit 83c605a6e2
9 changed files with 79 additions and 94 deletions

View file

@ -201,9 +201,9 @@ function get_forum_rules($mode, &$rules, &$forum_id)
function make_jumpbox($action, $forum_id = false, $extra_form_fields = array()) function make_jumpbox($action, $forum_id = false, $extra_form_fields = array())
{ {
global $auth, $template, $user, $db, $nav_links, $phpEx; global $auth, $template, $user, $db, $nav_links, $phpEx, $SID;
$boxstring = '<select name="f" onChange="if(this.options[this.selectedIndex].value != -1){ forms[\'jumpbox\'].submit() }"><option value="-1">' . $user->lang['Select_forum'] . '</option><option value="-1">-----------------</option>'; $boxstring = '<select name="f" onChange="if(this.options[this.selectedIndex].value != -1){ forms[\'jumpbox\'].submit() }"><option value="-1">' . $user->lang['SELECT_FORUM'] . '</option><option value="-1">-----------------</option>';
$sql = 'SELECT forum_id, forum_name, forum_postable, left_id, right_id $sql = 'SELECT forum_id, forum_name, forum_postable, left_id, right_id
FROM ' . FORUMS_TABLE . ' FROM ' . FORUMS_TABLE . '
@ -277,9 +277,6 @@ function make_jumpbox($action, $forum_id = false, $extra_form_fields = array())
} }
$template->assign_vars(array( $template->assign_vars(array(
'L_GO' => $user->lang['Go'],
'L_JUMP_TO' => $user->lang['Jump_to'],
'S_JUMPBOX_SELECT' => $boxstring, 'S_JUMPBOX_SELECT' => $boxstring,
'S_JUMPBOX_ACTION' => $action) 'S_JUMPBOX_ACTION' => $action)
); );
@ -922,10 +919,10 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
break; break;
case E_NOTICE: case E_NOTICE:
// if (defined('DEBUG_EXTRA')) if (defined('DEBUG_EXTRA'))
// { {
// echo "PHP Notice on line <b>$errline</b> in <b>$errfile</b> :: <b>$msg_text</b>"; echo "PHP Notice on line <b>$errline</b> in <b>$errfile</b> :: <b>$msg_text</b><br />";
// } }
break; break;
case E_USER_ERROR: case E_USER_ERROR:

View file

@ -156,22 +156,22 @@ function display_forums($root_data = '', $display_moderators = TRUE)
$unread_topics = ($user->data['user_id'] && $row['lastread_time'] < $row['forum_last_post_time'] ) ? TRUE : FALSE; $unread_topics = ($user->data['user_id'] && $row['lastread_time'] < $row['forum_last_post_time'] ) ? TRUE : FALSE;
$folder_image = ($unread_topics) ? 'forum_new' : 'forum'; $folder_image = ($unread_topics) ? 'forum_new' : 'forum';
$folder_alt = ($unread_topics) ? 'New_posts' : 'No_new_posts'; $folder_alt = ($unread_topics) ? 'NEW_POSTS' : 'NO_NEW_POSTS';
if ($row['left_id'] + 1 < $row['right_id']) if ($row['left_id'] + 1 < $row['right_id'])
{ {
$folder_image = ($unread_topics) ? 'sub_forum_new' : 'sub_forum'; $folder_image = ($unread_topics) ? 'sub_forum_new' : 'sub_forum';
$folder_alt = ($unread_topics) ? 'New_posts' : 'No_new_posts'; $folder_alt = ($unread_topics) ? 'NEW_POSTS' : 'NO_NEW_POSTS';
} }
elseif ($row['forum_status'] == ITEM_LOCKED) elseif ($row['forum_status'] == ITEM_LOCKED)
{ {
$folder_image = 'forum_locked'; $folder_image = 'forum_locked';
$folder_alt = 'Forum_locked'; $folder_alt = 'FORUM_LOCKED';
} }
else else
{ {
$folder_image = ($unread_topics) ? 'forum_new' : 'forum'; $folder_image = ($unread_topics) ? 'forum_new' : 'forum';
$folder_alt = ($unread_topics) ? 'New_posts' : 'No_new_posts'; $folder_alt = ($unread_topics) ? 'NEW_POSTS' : 'NO_NEW_POSTS';
} }
if ($row['forum_last_post_id']) if ($row['forum_last_post_id'])
@ -180,7 +180,7 @@ function display_forums($root_data = '', $display_moderators = TRUE)
$last_post .= ($row['forum_last_poster_id'] == ANONYMOUS) ? (($row['forum_last_poster_name'] != '') ? $row['forum_last_poster_name'] . ' ' : $user->lang['GUEST'] . ' ') : '<a href="ucp.' . $phpEx . $SID . '&amp;mode=viewprofile&amp;u=' . $row['forum_last_poster_id'] . '">' . $row['forum_last_poster_name'] . '</a> '; $last_post .= ($row['forum_last_poster_id'] == ANONYMOUS) ? (($row['forum_last_poster_name'] != '') ? $row['forum_last_poster_name'] . ' ' : $user->lang['GUEST'] . ' ') : '<a href="ucp.' . $phpEx . $SID . '&amp;mode=viewprofile&amp;u=' . $row['forum_last_poster_id'] . '">' . $row['forum_last_poster_name'] . '</a> ';
$last_post .= '<a href="viewtopic.' . $phpEx . $SID . '&amp;f=' . $row['forum_id'] . '&amp;p=' . $row['forum_last_post_id'] . '#' . $row['forum_last_post_id'] . '">' . $user->img('goto_post_latest', 'View_latest_post') . '</a>'; $last_post .= '<a href="viewtopic.' . $phpEx . $SID . '&amp;f=' . $row['forum_id'] . '&amp;p=' . $row['forum_last_post_id'] . '#' . $row['forum_last_post_id'] . '">' . $user->img('goto_post_latest', 'VIEW_LATEST_POST') . '</a>';
} }
else else
{ {
@ -231,8 +231,6 @@ function display_forums($root_data = '', $display_moderators = TRUE)
'MODERATORS' => $moderators_list, 'MODERATORS' => $moderators_list,
'SUBFORUMS' => $subforums_list, 'SUBFORUMS' => $subforums_list,
'FORUM_IMG' => $forum_image,
'L_SUBFORUM_STR' => $l_subforums, 'L_SUBFORUM_STR' => $l_subforums,
'L_MODERATOR_STR' => $l_moderator, 'L_MODERATOR_STR' => $l_moderator,
'L_FORUM_FOLDER_ALT'=> $folder_alt, 'L_FORUM_FOLDER_ALT'=> $folder_alt,
@ -243,7 +241,7 @@ function display_forums($root_data = '', $display_moderators = TRUE)
$template->assign_vars(array( $template->assign_vars(array(
'S_HAS_SUBFORUM' => ($visible_forums) ? TRUE : FALSE, 'S_HAS_SUBFORUM' => ($visible_forums) ? TRUE : FALSE,
'L_SUBFORUM' => ($visible_forums == 1) ? $user->lang['Subforum'] : $user->lang['Subforums'] 'L_SUBFORUM' => ($visible_forums == 1) ? $user->lang['SUBFORUM'] : $user->lang['SUBFORUMS']
)); ));
} }
?> ?>

View file

@ -280,14 +280,6 @@ $template->assign_vars(array(
'L_LOGIN_LOGOUT' => $l_login_logout, 'L_LOGIN_LOGOUT' => $l_login_logout,
'L_INDEX' => $user->lang['Forum_Index'], 'L_INDEX' => $user->lang['Forum_Index'],
'L_FAQ' => $user->lang['FAQ'],
'L_REGISTER' => $user->lang['Register'],
'L_PROFILE' => $user->lang['Profile'],
'L_SEARCH' => $user->lang['Search'],
'L_PRIVATEMSGS' => $user->lang['Private_Messages'],
'L_MEMBERLIST' => $user->lang['Memberlist'],
'L_USERGROUPS' => $user->lang['Usergroups'],
'L_WHO_IS_ONLINE' => $user->lang['Who_is_Online'],
'U_PRIVATEMSGS' => 'privmsg.'.$phpEx.$SID.'&amp;folder=inbox', 'U_PRIVATEMSGS' => 'privmsg.'.$phpEx.$SID.'&amp;folder=inbox',
'U_MEMBERLIST' => 'memberlist.'.$phpEx.$SID, 'U_MEMBERLIST' => 'memberlist.'.$phpEx.$SID,

View file

@ -485,8 +485,10 @@ class user extends session
if (empty($imgs[$img]) || $no_cache) if (empty($imgs[$img]) || $no_cache)
{ {
$alt = (!empty($this->lang[$alt])) ? $this->lang[$alt] : '';
$width = ($width) ? 'width="' . $width . '" ' : ''; $width = ($width) ? 'width="' . $width . '" ' : '';
$imgs[$img] = '<img src=' . str_replace('{LANG}', $this->img_lang, $this->theme[$img]) . '" ' . $width . 'alt="' . $this->lang[$alt] . '" title="' . $this->lang[$alt] . '" />'; $imgs[$img] = '<img src=' . str_replace('{LANG}', $this->img_lang, $this->theme[$img]) . '" ' . $width . 'alt="' . $alt . '" title="' . $alt . '" />';
} }
return $imgs[$img]; return $imgs[$img];
} }

View file

@ -103,17 +103,9 @@ $template->assign_vars(array(
'TOTAL_USERS' => sprintf($l_total_user_s, $total_users), 'TOTAL_USERS' => sprintf($l_total_user_s, $total_users),
'NEWEST_USER' => sprintf($user->lang['Newest_user'], '<a href="ucp.' . $phpEx . $SID . '&amp;mode=viewprofile&amp;u=' . $newest_uid . '">', $newest_user, '</a>'), 'NEWEST_USER' => sprintf($user->lang['Newest_user'], '<a href="ucp.' . $phpEx . $SID . '&amp;mode=viewprofile&amp;u=' . $newest_uid . '">', $newest_user, '</a>'),
'FORUM_IMG' => $user->img('forum', $user->lang['No_new_posts']), 'FORUM_IMG' => $user->img('forum', 'NO_NEW_POSTS'),
'FORUM_NEW_IMG' => $user->img('forum_new', $user->lang['New_posts']), 'FORUM_NEW_IMG' => $user->img('forum_new', 'NEW_POSTS'),
'FORUM_LOCKED_IMG' => $user->img('forum_locked', $user->lang['No_new_posts_locked']), 'FORUM_LOCKED_IMG' => $user->img('forum_locked', 'NO_NEW_POSTS_LOCKED'),
'L_ONLINE_EXPLAIN' => $user->lang['Online_explain'],
'L_VIEW_MODERATORS' => $user->lang['View_moderators'],
'L_FORUM_LOCKED' => $user->lang['Forum_is_locked'],
'L_MARK_FORUMS_READ' => $user->lang['Mark_all_forums'],
'L_LEGEND' => $user->lang['Legend'],
'L_NO_FORUMS' => $user->lang['No_forums'],
'U_MARK_READ' => "index.$phpEx$SID&amp;mark=forums") 'U_MARK_READ' => "index.$phpEx$SID&amp;mark=forums")
); );

View file

@ -688,6 +688,7 @@ else
$config_data .= "//\n// phpBB 2.x auto-generated config file\n// Do not change anything in this file!\n//\n\n"; $config_data .= "//\n// phpBB 2.x auto-generated config file\n// Do not change anything in this file!\n//\n\n";
$config_data .= '$dbms = "' . $dbms . '";' . "\n\n"; $config_data .= '$dbms = "' . $dbms . '";' . "\n\n";
$config_data .= '$dbhost = "' . $dbhost . '";' . "\n"; $config_data .= '$dbhost = "' . $dbhost . '";' . "\n";
$config_data .= '$dbport = "' . $dbport . '";' . "\n";
$config_data .= '$dbname = "' . $dbname . '";' . "\n"; $config_data .= '$dbname = "' . $dbname . '";' . "\n";
$config_data .= '$dbuser = "' . $dbuser . '";' . "\n"; $config_data .= '$dbuser = "' . $dbuser . '";' . "\n";
$config_data .= '$dbpasswd = "' . $dbpasswd . '";' . "\n\n"; $config_data .= '$dbpasswd = "' . $dbpasswd . '";' . "\n\n";

View file

@ -128,11 +128,11 @@ $lang = array_merge($lang, array(
'SEARCH_NEW' => 'View posts since last visit', 'SEARCH_NEW' => 'View posts since last visit',
'SEARCH_SELF' => 'View your posts', 'SEARCH_SELF' => 'View your posts',
'SEARCH_UNANSWERED' => 'View unanswered posts', 'SEARCH_UNANSWERED' => 'View unanswered posts',
'Register' => 'Register', 'REGISTER' => 'Register',
'Profile' => 'Control Panel', 'PROFILE' => 'Control Panel',
'Edit_profile' => 'Edit your profile', 'Edit_profile' => 'Edit your profile',
'Search' => 'Search', 'SEARCH' => 'Search',
'Memberlist' => 'Members', 'MEMBERLIST' => 'Members',
'FAQ' => 'FAQ', 'FAQ' => 'FAQ',
'BBCode_guide' => 'BBCode Guide', 'BBCode_guide' => 'BBCode Guide',
'USERS' => 'Users', 'USERS' => 'Users',
@ -153,6 +153,9 @@ $lang = array_merge($lang, array(
'Posted_articles_zero_total' => 'Our users have posted a total of <b>0</b> article', 'Posted_articles_zero_total' => 'Our users have posted a total of <b>0</b> article',
'Posted_articles_total' => 'Our users have posted a total of <b>%d</b> articles', 'Posted_articles_total' => 'Our users have posted a total of <b>%d</b> articles',
'Posted_article_total' => 'Our users have posted a total of <b>%d</b> article', 'Posted_article_total' => 'Our users have posted a total of <b>%d</b> article',
'Posted_topics_zero_total' => 'Our users have posted a total of <b>0</b> topic',
'Posted_topics_total' => 'Our users have posted a total of <b>%d</b> topics',
'Posted_topic_total' => 'Our users have posted a total of <b>%d</b> topic',
'Registered_users_zero_total' => 'We have <b>0</b> registered users', 'Registered_users_zero_total' => 'We have <b>0</b> registered users',
'Registered_users_total' => 'We have <b>%d</b> registered users', 'Registered_users_total' => 'We have <b>%d</b> registered users',
'Registered_user_total' => 'We have <b>%d</b> registered user', 'Registered_user_total' => 'We have <b>%d</b> registered user',
@ -179,8 +182,8 @@ $lang = array_merge($lang, array(
'No_forums' => 'This board has no forums', 'No_forums' => 'This board has no forums',
'Private_Message' => 'Private Message', 'Private_Message' => 'Private Message',
'Private_Messages' => 'Private Messages', 'Private_Messages' => 'Private Messages',
'Who_is_Online' => 'Who is Online', 'WHO_IS_ONLINE' => 'Who is Online',
'Mark_all_forums' => 'Mark all forums read', 'MARK_FORUMS_READ' => 'Mark all forums read',
'Forums_marked_read' => 'All forums have been marked read', 'Forums_marked_read' => 'All forums have been marked read',
'View_forum' => 'View Forum', 'View_forum' => 'View Forum',
'Forum_not_exist' => 'The forum you selected does not exist', 'Forum_not_exist' => 'The forum you selected does not exist',
@ -191,7 +194,7 @@ $lang = array_merge($lang, array(
'Topic_Sticky' => '<b>Sticky:</b>', 'Topic_Sticky' => '<b>Sticky:</b>',
'Topic_Moved' => '<b>Moved:</b>', 'Topic_Moved' => '<b>Moved:</b>',
'Topic_Poll' => '<b>[ Poll ]</b>', 'Topic_Poll' => '<b>[ Poll ]</b>',
'Mark_all_topics' => 'Mark all topics read', 'MARK_TOPICS_READ' => 'Mark all topics read',
'Topics_marked_read' => 'The topics for this forum have now been marked read', 'Topics_marked_read' => 'The topics for this forum have now been marked read',
'Rules_post_can' => 'You <b>can</b> post new topics in this forum', 'Rules_post_can' => 'You <b>can</b> post new topics in this forum',
'Rules_post_cannot' => 'You <b>cannot</b> post new topics in this forum', 'Rules_post_cannot' => 'You <b>cannot</b> post new topics in this forum',
@ -388,7 +391,7 @@ $lang = array_merge($lang, array(
'Savebox' => 'Savebox', 'Savebox' => 'Savebox',
'Sentbox' => 'Sentbox', 'Sentbox' => 'Sentbox',
'Flag' => 'Flag', 'Flag' => 'Flag',
'Subject' => 'Subject', 'SUBJECT' => 'Subject',
'From' => 'From', 'From' => 'From',
'To' => 'To', 'To' => 'To',
'Date' => 'Date', 'Date' => 'Date',
@ -417,7 +420,7 @@ $lang = array_merge($lang, array(
'Send_a_reply' => 'Reply to a private message', 'Send_a_reply' => 'Reply to a private message',
'Edit_message' => 'Edit private message', 'Edit_message' => 'Edit private message',
'Notification_subject' => 'New Private Message has arrived', 'Notification_subject' => 'New Private Message has arrived',
'FIND_USERNAME' => 'Find a username', 'Find_username' => 'Find a username',
'Find' => 'Find', 'Find' => 'Find',
'No_match' => 'No matches found', 'No_match' => 'No matches found',
'No_such_folder' => 'No such folder exists', 'No_such_folder' => 'No such folder exists',

View file

@ -3,7 +3,7 @@
<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center"> <table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
<tr> <tr>
<td align="left" valign="bottom"><a class="maintitle" href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a></span><br /><span class="gensmall"><b>{L_MODERATORS}: {MODERATORS}</b></span></td> <td align="left" valign="bottom"><a class="maintitle" href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a></span><br /><span class="gensmall"><b>{L_MODERATORS}: {MODERATORS}</b></span></td>
<td align="right" valign="bottom"><span class="gensmall">{MOD_CP}</span></td> <td align="right" valign="bottom"><span class="gensmall">{MCP}</span></td>
</tr> </tr>
<tr> <tr>
<td colspan="2" align="right" valign="bottom" nowrap="nowrap"><span class="gensmall"><b>{PAGINATION}</b></span></td> <td colspan="2" align="right" valign="bottom" nowrap="nowrap"><span class="gensmall"><b>{PAGINATION}</b></span></td>

View file

@ -110,6 +110,7 @@ if ($forum_data['left_id'] != $forum_data['right_id'] - 1)
} }
else else
{ {
$template->assign_var('S_HAS_SUBFORUM', FALSE);
get_moderators($forum_moderators, $forum_id); get_moderators($forum_moderators, $forum_id);
} }
@ -165,11 +166,12 @@ if ($forum_data['forum_postable'])
$sort_by_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 'r' => $user->lang['REPLIES'], 's' => $user->lang['SUBJECT'], 'v' => $user->lang['VIEWS']); $sort_by_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 'r' => $user->lang['REPLIES'], 's' => $user->lang['SUBJECT'], 'v' => $user->lang['VIEWS']);
$sort_by = array('a' => 'u.username', 't' => 't.topic_last_post_id', 'r' => 't.topic_replies', 's' => 't.topic_title', 'v' => 't.topic_views'); $sort_by = array('a' => 'u.username', 't' => 't.topic_last_post_id', 'r' => 't.topic_replies', 's' => 't.topic_title', 'v' => 't.topic_views');
$sort_days = $topic_days = '';
if (isset($_POST['sort'])) if (isset($_POST['sort']))
{ {
if (!empty($_POST['sort_days'])) if (!empty($_POST['sort_days']))
{ {
$sort_days = (!empty($_POST['sort_days'])) ? intval($_POST['sort_days']) : intval($_GET['sort_days']); $sort_days = intval($_POST['sort_days']);
$min_topic_time = time() - ( $sort_days * 86400 ); $min_topic_time = time() - ( $sort_days * 86400 );
// ref type on as rows as topics ... also not great // ref type on as rows as topics ... also not great
@ -225,29 +227,22 @@ if ($forum_data['forum_postable'])
'S_IS_POSTABLE' => TRUE, 'S_IS_POSTABLE' => TRUE,
'POST_IMG' => (intval($forum_data['forum_status']) == ITEM_LOCKED) ? $user->img('post_locked', $post_alt) : $user->img('post_new', $post_alt), 'POST_IMG' => (intval($forum_data['forum_status']) == ITEM_LOCKED) ? $user->img('post_locked', $post_alt) : $user->img('post_new', $post_alt),
'PAGINATION' => generate_pagination("viewforum.$phpEx$SID&amp;f=$forum_id&amp;topicdays=$topic_days", $topics_count, $config['topics_per_page'], $start), 'PAGINATION' => generate_pagination("viewforum.$phpEx$SID&amp;f=$forum_id&amp;topicdays=$topic_days", $topics_count, $config['topics_per_page'], $start),
'PAGE_NUMBER' => sprintf($user->lang['Page_of'], (floor( $start / $config['topics_per_page'] ) + 1), ceil( $topics_count / $config['topics_per_page'] )), 'PAGE_NUMBER' => sprintf($user->lang['PAGE_OF'], (floor( $start / $config['topics_per_page'] ) + 1), ceil( $topics_count / $config['topics_per_page'] )),
'MOD_CP' => ($auth->acl_gets('m_', 'a_', $forum_id)) ? sprintf($user->lang['MCP'], '<a href="mcp.' . $phpEx . '?sid=' . $user->session_id . '&amp;f=' . $forum_id . '">', '</a>') : '', 'MOD_CP' => ($auth->acl_gets('m_', 'a_', $forum_id)) ? sprintf($user->lang['MCP'], '<a href="mcp.' . $phpEx . '?sid=' . $user->session_id . '&amp;f=' . $forum_id . '">', '</a>') : '',
'MODERATORS' => (sizeof($forum_moderators[$forum_id])) ? implode(', ', $forum_moderators[$forum_id]) : $user->lang['NONE'], 'MODERATORS' => (!empty($forum_moderators[$forum_id])) ? implode(', ', $forum_moderators[$forum_id]) : $user->lang['NONE'],
'FOLDER_IMG' => $user->img('folder', 'No_new_posts'), 'FOLDER_IMG' => $user->img('folder', 'NO_NEW_POSTS'),
'FOLDER_NEW_IMG' => $user->img('folder_new', 'New_posts'), 'FOLDER_NEW_IMG' => $user->img('folder_new', 'NEW_POSTS'),
'FOLDER_HOT_IMG' => $user->img('folder_hot', 'No_new_posts_hot'), 'FOLDER_HOT_IMG' => $user->img('folder_hot', 'NO_NEW_POSTS_HOT'),
'FOLDER_HOT_NEW_IMG' => $user->img('folder_hot_new', 'New_posts_hot'), 'FOLDER_HOT_NEW_IMG' => $user->img('folder_hot_new', 'NEW_POSTS_HOT'),
'FOLDER_LOCKED_IMG' => $user->img('folder_locked', 'No_new_posts_locked'), 'FOLDER_LOCKED_IMG' => $user->img('folder_locked', 'NO_NEW_POSTS_LOCKED'),
'FOLDER_LOCKED_NEW_IMG' => $user->img('folder_locked_new', 'New_posts_locked'), 'FOLDER_LOCKED_NEW_IMG' => $user->img('folder_locked_new', 'NEW_POSTS_LOCKED'),
'FOLDER_STICKY_IMG' => $user->img('folder_sticky', 'Post_Sticky'), 'FOLDER_STICKY_IMG' => $user->img('folder_sticky', 'POST_STICKY'),
'FOLDER_STICKY_NEW_IMG' => $user->img('folder_sticky_new', 'Post_Sticky'), 'FOLDER_STICKY_NEW_IMG' => $user->img('folder_sticky_new', 'POST_STICKY'),
'FOLDER_ANNOUNCE_IMG' => $user->img('folder_announce', 'Post_Announcement'), 'FOLDER_ANNOUNCE_IMG' => $user->img('folder_announce', 'POST_ANNOUNCEMENT'),
'FOLDER_ANNOUNCE_NEW_IMG' => $user->img('folder_announce_new', 'Post_Announcement'), 'FOLDER_ANNOUNCE_NEW_IMG' => $user->img('folder_announce_new', 'POST_ANNOUNCEMENT'),
'L_DISPLAY_TOPICS' => $user->lang['Display_topics'],
'L_SORT_BY' => $user->lang['Sort_by'],
'L_MARK_TOPICS_READ' => $user->lang['Mark_all_topics'],
'L_POSTED' => $user->lang['Posted'],
'L_JOINED' => $user->lang['Joined'],
'L_AUTHOR' => $user->lang['Author'],
'L_NO_TOPICS' => ( $forum_data['forum_status'] == ITEM_LOCKED ) ? $user->lang['Forum_locked'] : $user->lang['No_topics_post_one'], 'L_NO_TOPICS' => ( $forum_data['forum_status'] == ITEM_LOCKED ) ? $user->lang['Forum_locked'] : $user->lang['No_topics_post_one'],
'L_GOTO_PAGE' => $user->lang['Goto_page'],
'S_TOPIC_ICONS' => ($forum_data['enable_icons']) ? true : false, 'S_TOPIC_ICONS' => ($forum_data['enable_icons']) ? true : false,
'S_SELECT_SORT_DIR' => $select_sort_dir, 'S_SELECT_SORT_DIR' => $select_sort_dir,
@ -348,14 +343,16 @@ if ($forum_data['forum_postable'])
// Okay, lets dump out the page ... // Okay, lets dump out the page ...
if ($total_topics) if ($total_topics)
{ {
for($i = 0; $i < $total_topics; $i++) $i = 0;
foreach ($topic_rowset as $topic_row)
{ {
$topic_id = $topic_rowset[$i]['topic_id']; $topic_id = $topic_row['topic_id'];
$replies = $topic_row['topic_replies'];
$topic_title = (!empty($censors)) ? preg_replace($censors['match'], $censors['replace'], $topic_rowset[$i]['topic_title']) : $topic_rowset[$i]['topic_title']; $topic_title = (!empty($censors)) ? preg_replace($censors['match'], $censors['replace'], $topic_row['topic_title']) : $topic_row['topic_title'];
// See if the user has posted in this topic. // See if the user has posted in this topic.
if($topic_rowset[$i]['lastread_type'] == LASTREAD_POSTED) if($topic_row['lastread_type'] == LASTREAD_POSTED)
{ {
// Making titles italic is only a hack. This should be done in the templates or in the folder images. // Making titles italic is only a hack. This should be done in the templates or in the folder images.
$topic_title = "<i>" . $topic_title . "</i>"; $topic_title = "<i>" . $topic_title . "</i>";
@ -363,10 +360,10 @@ if ($forum_data['forum_postable'])
// Type and folder // Type and folder
$topic_type = ''; $topic_type = '';
if ($topic_rowset[$i]['topic_status'] == ITEM_MOVED) if ($topic_row['topic_status'] == ITEM_MOVED)
{ {
$topic_type = $user->lang['Topic_Moved'] . ' '; $topic_type = $user->lang['Topic_Moved'] . ' ';
$topic_id = $topic_rowset[$i]['topic_moved_id']; $topic_id = $topic_row['topic_moved_id'];
$folder_image = 'folder'; $folder_image = 'folder';
$folder_alt = 'Topic_Moved'; $folder_alt = 'Topic_Moved';
@ -374,7 +371,7 @@ if ($forum_data['forum_postable'])
} }
else else
{ {
switch ($topic_rowset[$i]['topic_type']) switch ($topic_row['topic_type'])
{ {
case POST_ANNOUNCE: case POST_ANNOUNCE:
$topic_type = $user->lang['Topic_Announcement'] . ' '; $topic_type = $user->lang['Topic_Announcement'] . ' ';
@ -407,9 +404,9 @@ if ($forum_data['forum_postable'])
$unread_topic = true; $unread_topic = true;
if ($user->data['user_id'] if ($user->data['user_id']
&& &&
( $topic_rowset[$i]['topic_last_post_time'] <= $topic_rowset[$i]['lastread_time'] ( $topic_row['topic_last_post_time'] <= $topic_row['lastread_time']
|| $topic_rowset[$i]['topic_last_post_time'] < (time()-$config['lastread']) || $topic_row['topic_last_post_time'] < (time()-$config['lastread'])
|| $topic_rowset[$i]['topic_last_post_time'] < $forum_row['lastread_time'] || $topic_row['topic_last_post_time'] < $forum_row['lastread_time']
) )
) )
{ {
@ -418,22 +415,20 @@ if ($forum_data['forum_postable'])
$newest_post_img = ($unread_topic) ? '<a href="viewtopic.' . $phpEx . $SID . '&amp;f=' . $forum_id . '&amp;t=' . $topic_id . '&amp;view=newest#newest">' . $user->img('goto_post_newest', 'View_newest_post') . '</a> ' : ''; $newest_post_img = ($unread_topic) ? '<a href="viewtopic.' . $phpEx . $SID . '&amp;f=' . $forum_id . '&amp;t=' . $topic_id . '&amp;view=newest#newest">' . $user->img('goto_post_newest', 'View_newest_post') . '</a> ' : '';
$folder_img = ($unread_topic) ? $folder_new : $folder; $folder_img = ($unread_topic) ? $folder_new : $folder;
$folder_alt = ($unread_topic) ? 'New_posts' : (($topic_rowset[$i]['topic_status'] == ITEM_LOCKED) ? 'Topic_locked' : 'No_new_posts'); $folder_alt = ($unread_topic) ? 'New_posts' : (($topic_row['topic_status'] == ITEM_LOCKED) ? 'Topic_locked' : 'No_new_posts');
} }
if (intval($topic_rowset[$i]['poll_start'])) if (intval($topic_row['poll_start']))
{ {
$topic_type .= $user->lang['Topic_Poll'] . ' '; $topic_type .= $user->lang['Topic_Poll'] . ' ';
} }
$replies = $topic_rowset[$i]['topic_replies'];
// Goto message // Goto message
if (($replies + 1 ) > intval($config['posts_per_page'])) if (($replies + 1 ) > intval($config['posts_per_page']))
{ {
$total_pages = ceil(($replies + 1) / intval($config['posts_per_page'])); $total_pages = ceil(($replies + 1) / intval($config['posts_per_page']));
$goto_page = ' [ ' . $user->img('goto_post', 'Goto_page') . $user->lang['Goto_page'] . ': '; $goto_page = ' [ ' . $user->img('goto_post', 'GOTO_PAGE') . $user->lang['GOTO_PAGE'] . ': ';
$times = 1; $times = 1;
for($j = 0; $j < $replies + 1; $j += intval($config['posts_per_page'])) for($j = 0; $j < $replies + 1; $j += intval($config['posts_per_page']))
@ -461,18 +456,18 @@ if ($forum_data['forum_postable'])
// Generate all the URIs ... // Generate all the URIs ...
$view_topic_url = 'viewtopic.' . $phpEx . $SID . '&amp;f=' . $forum_id . '&amp;t=' . $topic_id; $view_topic_url = 'viewtopic.' . $phpEx . $SID . '&amp;f=' . $forum_id . '&amp;t=' . $topic_id;
$topic_author = ($topic_rowset[$i]['user_id'] != ANONYMOUS) ? '<a href="ucp.' . $phpEx . $SID . '&amp;mode=viewprofile&amp;u=' . $topic_rowset[$i]['user_id'] . '">' : ''; $topic_author = ($topic_row['user_id'] != ANONYMOUS) ? '<a href="ucp.' . $phpEx . $SID . '&amp;mode=viewprofile&amp;u=' . $topic_row['user_id'] . '">' : '';
$topic_author .= ($topic_rowset[$i]['user_id'] != ANONYMOUS) ? $topic_rowset[$i]['username'] : (($topic_rowset[$i]['topic_first_poster_name'] != '') ? $topic_rowset[$i]['topic_first_poster_name'] : $user->lang['GUEST']); $topic_author .= ($topic_row['user_id'] != ANONYMOUS) ? $topic_row['username'] : (($topic_row['topic_first_poster_name'] != '') ? $topic_row['topic_first_poster_name'] : $user->lang['GUEST']);
$topic_author .= ($topic_rowset[$i]['user_id'] != ANONYMOUS) ? '</a>' : ''; $topic_author .= ($topic_row['user_id'] != ANONYMOUS) ? '</a>' : '';
$first_post_time = $user->format_date($topic_rowset[$i]['topic_time'], $config['board_timezone']); $first_post_time = $user->format_date($topic_row['topic_time'], $config['board_timezone']);
$last_post_time = $user->format_date($topic_rowset[$i]['topic_last_post_time']); $last_post_time = $user->format_date($topic_row['topic_last_post_time']);
$last_post_author = ($topic_rowset[$i]['id2'] == ANONYMOUS) ? (($topic_rowset[$i]['topic_last_poster_name'] != '') ? $topic_rowset[$i]['topic_last_poster_name'] . ' ' : $user->lang['GUEST'] . ' ') : '<a href="ucp.' . $phpEx . $SID . '&amp;mode=viewprofile&amp;u=' . $topic_rowset[$i]['topic_last_poster_id'] . '">' . $topic_rowset[$i]['user2'] . '</a>'; $last_post_author = ($topic_row['id2'] == ANONYMOUS) ? (($topic_row['topic_last_poster_name'] != '') ? $topic_row['topic_last_poster_name'] . ' ' : $user->lang['GUEST'] . ' ') : '<a href="ucp.' . $phpEx . $SID . '&amp;mode=viewprofile&amp;u=' . $topic_row['topic_last_poster_id'] . '">' . $topic_row['user2'] . '</a>';
$last_post_url = '<a href="viewtopic.' . $phpEx . $SID . '&amp;f=' . $forum_id . '&amp;p=' . $topic_rowset[$i]['topic_last_post_id'] . '#' . $topic_rowset[$i]['topic_last_post_id'] . '">' . $user->img('goto_post_latest', 'View_latest_post') . '</a>'; $last_post_url = '<a href="viewtopic.' . $phpEx . $SID . '&amp;f=' . $forum_id . '&amp;p=' . $topic_row['topic_last_post_id'] . '#' . $topic_row['topic_last_post_id'] . '">' . $user->img('goto_post_latest', 'VIEW_LATEST_POST') . '</a>';
// Send vars to template // Send vars to template
@ -487,22 +482,27 @@ if ($forum_data['forum_postable'])
'LAST_POST_AUTHOR' => $last_post_author, 'LAST_POST_AUTHOR' => $last_post_author,
'LAST_POST_IMG' => $last_post_url, 'LAST_POST_IMG' => $last_post_url,
'GOTO_PAGE' => $goto_page, 'GOTO_PAGE' => $goto_page,
'REPLIES' => $topic_rowset[$i]['topic_replies'], 'REPLIES' => $topic_row['topic_replies'],
'VIEWS' => $topic_rowset[$i]['topic_views'], 'VIEWS' => $topic_row['topic_views'],
'TOPIC_TITLE' => $topic_title, 'TOPIC_TITLE' => $topic_title,
'TOPIC_TYPE' => $topic_type, 'TOPIC_TYPE' => $topic_type,
'TOPIC_ICON' => (!empty($topic_rowset[$i]['icon_id']) ) ? '<img src="' . $config['icons_path'] . '/' . $icons[$topic_rowset[$i]['icon_id']]['img'] . '" width="' . $icons[$topic_rowset[$i]['icon_id']]['width'] . '" height="' . $icons[$topic_rowset[$i]['icon_id']]['height'] . '" alt="" title="" />' : '', 'TOPIC_ICON' => (!empty($icons[$topic_row['icon_id']]) ) ? '<img src="' . $config['icons_path'] . '/' . $icons[$topic_row['icon_id']]['img'] . '" width="' . $icons[$topic_row['icon_id']]['width'] . '" height="' . $icons[$topic_row['icon_id']]['height'] . '" alt="" title="" />' : '',
'S_ROW_COUNT' => $i, 'S_ROW_COUNT' => $i,
'U_VIEW_TOPIC' => $view_topic_url) 'U_VIEW_TOPIC' => $view_topic_url)
); );
++$i;
} }
} }
if ($user->data['user_id'] != ANONYMOUS) if ($user->data['user_id'] != ANONYMOUS)
{ {
setcookie($config['cookie_name'] . '_t', serialize($mark_topics), 0, $config['cookie_path'], $config['cookie_domain'], $config['cookie_secure']); //
// $mark_topics isn't set as of now
//
//setcookie($config['cookie_name'] . '_t', serialize($mark_topics), 0, $config['cookie_path'], $config['cookie_domain'], $config['cookie_secure']);
} }
} }