- {postrow.POSTER_NAME} {postrow.POSTER_RANK} {postrow.RANK_IMAGE}{postrow.POSTER_AVATAR} {postrow.POSTER_JOINED} {postrow.POSTER_POSTS} {postrow.POSTER_FROM}
+ {postrow.POSTER_NAME} {postrow.POSTER_RANK} {postrow.RANK_IMAGE}{postrow.POSTER_AVATAR} {postrow.POSTER_JOINED} {postrow.POSTER_POSTS} {postrow.POSTER_FROM}
Back to top
@@ -34,11 +34,11 @@
- {L_POSTED}: {postrow.POST_DATE} {L_POST_SUBJECT}: {postrow.POST_SUBJECT}
- {postrow.EDIT_IMG} {postrow.QUOTE_IMG}
+ {L_POSTED}: {postrow.POST_DATE} {L_POST_SUBJECT}: {postrow.POST_SUBJECT}
+ {postrow.EDIT_IMG} {postrow.QUOTE_IMG}
-
+
@@ -48,7 +48,7 @@
-
+
{postrow.PROFILE_IMG} {postrow.PM_IMG} {postrow.EMAIL_IMG} {postrow.WWW_IMG} {postrow.ICQ_STATUS_IMG} {postrow.ICQ_ADD_IMG} {postrow.AIM_IMG} {postrow.YIM_IMG} {postrow.MSN_IMG}
@@ -62,7 +62,7 @@
-
+
{L_PAGE} {ON_PAGE} {L_OF} {TOTAL_PAGES}
{PAGINATION}
@@ -72,9 +72,11 @@
+
+
- {S_TIMEZONE} {S_TOPIC_ADMIN}
- {JUMPBOX}{S_AUTH_LIST}
+ {S_TIMEZONE} {S_TOPIC_ADMIN}
+ {JUMPBOX}{S_AUTH_LIST}
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php
index 64e1d6f32f..82a0edf24b 100644
--- a/phpBB/viewforum.php
+++ b/phpBB/viewforum.php
@@ -140,7 +140,7 @@ if( $total_mods = $db->sql_numrows($result_mods) )
{
if($mods_rowset[$i]['group_single_user'])
{
- $mod_url = "profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $mods_rowset[$i]['user_id'];
+ $mod_url = "profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $mods_rowset[$i]['user_id'];
$mod_name = $mods_rowset[$i]['username'];
}
else
@@ -166,23 +166,23 @@ else
}
//
-// Generate a 'Show posts in previous x days' select box. If the postdays var is POSTed
+// Generate a 'Show topics in previous x days' select box. If the topicsdays var is sent
// then get it's value, find the number of topics with dates newer than it (to properly
// handle pagination) and alter the main query
//
$previous_days = array(0, 1, 7, 14, 30, 90, 180, 364);
$previous_days_text = array($lang['All_Topics'], "1 " . $lang['Day'], "7 " . $lang['Days'], "2 " . $lang['Weeks'], "1 " . $lang['Month'], "3 ". $lang['Months'], "6 " . $lang['Months'], "1 " . $lang['Year']);
-if(!empty($HTTP_POST_VARS['postdays']) || !empty($HTTP_GET_VARS['postdays']))
+if(!empty($HTTP_POST_VARS['topicdays']) || !empty($HTTP_GET_VARS['topicdays']))
{
- $post_days = (!empty($HTTP_POST_VARS['postdays'])) ? $HTTP_POST_VARS['postdays'] : $HTTP_GET_VARS['postdays'];
- $min_post_time = time() - ($post_days * 86400);
+ $topic_days = (!empty($HTTP_POST_VARS['topicdays'])) ? $HTTP_POST_VARS['topicdays'] : $HTTP_GET_VARS['topicdays'];
+ $min_topic_time = time() - ($topic_days * 86400);
$sql = "SELECT COUNT(t.topic_id) AS forum_topics
FROM " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p
WHERE t.forum_id = $forum_id
AND p.post_id = t.topic_last_post_id
- AND ( p.post_time > $min_post_time
+ AND ( p.post_time >= $min_topic_time
OR t.topic_type = " . POST_ANNOUNCE . " )";
if(!$result = $db->sql_query($sql))
@@ -191,9 +191,9 @@ if(!empty($HTTP_POST_VARS['postdays']) || !empty($HTTP_GET_VARS['postdays']))
}
list($topics_count) = $db->sql_fetchrow($result);
- $limit_posts_time = "AND ( p.post_time > $min_post_time OR t.topic_type = " . POST_ANNOUNCE . " ) ";
+ $limit_topics_time = "AND ( p.post_time >= $min_post_time OR t.topic_type = " . POST_ANNOUNCE . " ) ";
- if(!empty($HTTP_POST_VARS['postdays']))
+ if(!empty($HTTP_POST_VARS['topicdays']))
{
$start = 0;
}
@@ -202,17 +202,17 @@ else
{
$topics_count = $forum_row['forum_topics'];
- $limit_posts_time = "";
- $post_days = 0;
+ $limit_topics_time = "";
+ $topic_days = 0;
}
-$select_post_days = "";
+$select_topic_days = "";
for($i = 0; $i < count($previous_days); $i++)
{
- $selected = ($post_days == $previous_days[$i]) ? " selected" : "";
- $select_post_days .= "".$previous_days_text[$i]." ";
+ $selected = ($topic_days == $previous_days[$i]) ? " selected=\"selected\"" : "";
+ $select_topic_days .= "" . $previous_days_text[$i] . " ";
}
-$select_post_days .= " ";
+$select_topic_days .= " ";
//
// Grab all the basic data (all topics except global announcements)
@@ -225,7 +225,7 @@ $sql = "SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as i
AND p.post_id = t.topic_last_post_id
AND p.poster_id = u2.user_id
AND t.topic_type <> " . POST_GLOBAL_ANNOUNCE . "
- $limit_posts_time
+ $limit_topics_time
ORDER BY t.topic_type DESC, p.post_time DESC
LIMIT $start, ".$board_config['topics_per_page'];
@@ -238,15 +238,15 @@ $total_topics = $db->sql_numrows($t_result);
//
// Post URL generation for templating vars
//
-$post_new_topic_url = append_sid("posting.$phpEx?mode=newtopic&" . POST_FORUM_URL . "=$forum_id");
+$post_new_topic_url = append_sid("posting.$phpEx?mode=newtopic&" . POST_FORUM_URL . "=$forum_id");
$template->assign_vars(array(
"L_DISPLAY_TOPICS" => $lang['Display_topics'],
"U_POST_NEW_TOPIC" => $post_new_topic_url,
- "S_SELECT_POST_DAYS" => $select_post_days,
- "S_POST_DAYS_ACTION" => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=" . $forum_id . "&start=$start"))
+ "S_SELECT_TOPIC_DAYS" => $select_topic_days,
+ "S_POST_DAYS_ACTION" => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=" . $forum_id . "&start=$start"))
);
//
@@ -276,6 +276,9 @@ $template->set_filenames(array(
$jumpbox = make_jumpbox();
$template->assign_vars(array(
+ "L_GO" => $lang['Go'],
+ "L_JUMP_TO" => $lang['Jump_to'],
+ "L_SELECT_FORUM" => $lang['Select_forum'],
"JUMPBOX_LIST" => $jumpbox,
"SELECT_NAME" => POST_FORUM_URL)
);
@@ -326,7 +329,7 @@ if($total_topics)
if($replies > $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'])
@@ -335,7 +338,7 @@ if($total_topics)
{
if( $j + $board_config['posts_per_page'] >= $replies + 1 )
{
- $goto_page .= " ... $times ";
+ $goto_page .= " ... $times ";
}
}
else
@@ -344,7 +347,7 @@ if($total_topics)
{
$goto_page .= ", ";
}
- $goto_page .= "$times ";
+ $goto_page .= "$times ";
}
$times++;
}
@@ -357,7 +360,7 @@ if($total_topics)
if($topic_rowset[$i]['topic_status'] == TOPIC_LOCKED)
{
- $folder_image = " ";
+ $folder_image = " ";
}
else
{
@@ -380,26 +383,26 @@ if($total_topics)
if(empty($HTTP_COOKIE_VARS['phpbb2_' . $forum_id . '_' . $topic_id]) && $topic_rowset[$i]['post_time'] > $userdata['session_last_visit'])
{
- $folder_image = " ";
+ $folder_image = " ";
}
else
{
if( isset($HTTP_COOKIE_VARS['phpbb2_' . $forum_id . '_' . $topic_id]) )
{
- $folder_image = ($HTTP_COOKIE_VARS['phpbb2_' . $forum_id . '_' . $topic_id] < $topic_rowset[$i]['post_time'] ) ? " " : " ";
+ $folder_image = ($HTTP_COOKIE_VARS['phpbb2_' . $forum_id . '_' . $topic_id] < $topic_rowset[$i]['post_time'] ) ? " " : " ";
}
else
{
- $folder_image = " ";
+ $folder_image = " ";
}
}
}
- $view_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=" . $topic_id . "&" . $replies);
+ $view_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id");
$topic_poster = stripslashes($topic_rowset[$i]['username']);
- $topic_poster_profile_url = append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $topic_rowset[$i]['user_id']);
+ $topic_poster_profile_url = append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $topic_rowset[$i]['user_id']);
$last_post_time = create_date($board_config['default_dateformat'], $topic_rowset[$i]['post_time'], $board_config['default_timezone']);
@@ -413,8 +416,8 @@ if($total_topics)
}
$last_post = $last_post_time . " by ";
- $last_post .= "" . $last_post_user . " ";
- $last_post .= " ";
+ $last_post .= "" . $last_post_user . " ";
+ $last_post .= " ";
$views = $topic_rowset[$i]['topic_views'];
@@ -436,7 +439,7 @@ if($total_topics)
}
$template->assign_vars(array(
- "PAGINATION" => generate_pagination("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id&postdays=$post_days", $topics_count, $board_config['topics_per_page'], $start),
+ "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'] ),
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index eb8269466e..3ca7068f68 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -133,7 +133,7 @@ $join_sql_table = (!isset($post_id)) ? "" : "" . POSTS_TABLE . " p, " . POSTS_TA
$join_sql = (!isset($post_id)) ? "t.topic_id = $topic_id" : "p.post_id = $post_id AND t.topic_id = p.topic_id AND p2.topic_id = p.topic_id AND p2.post_id <= $post_id";
$count_sql = (!isset($post_id)) ? "" : ", COUNT(p2.post_id) AS prev_posts";
-$order_sql = (!isset($post_id)) ? "" : "GROUP BY p.post_id, t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, f.forum_name, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_votecreate, f.auth_vote, f.auth_attachments ORDER BY p.post_id ASC";
+$order_sql = (!isset($post_id)) ? "" : "GROUP BY p.post_id, t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, f.forum_name, f.forum_status, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_votecreate, f.auth_vote, f.auth_attachments ORDER BY p.post_id ASC";
$sql = "SELECT t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, f.forum_name, f.forum_status, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_votecreate, f.auth_vote, f.auth_attachments" . $count_sql . "
FROM $join_sql_table " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f
@@ -158,7 +158,6 @@ $forum_id = $forum_row['forum_id'];
$topic_title = stripslashes($forum_row['topic_title']);
$topic_id = $forum_row['topic_id'];
$topic_time = $forum_row['topic_time'];
-$total_replies = $forum_row['topic_replies'] + 1;
if(!empty($post_id))
{
@@ -192,6 +191,76 @@ if(!$is_auth['auth_view'] || !$is_auth['auth_read'])
// End auth check
//
+//
+// Generate a 'Show posts in previous x days' select box. If the postdays var is POSTed
+// then get it's value, find the number of topics with dates newer than it (to properly
+// handle pagination) and alter the main query
+//
+$previous_days = array(0, 1, 7, 14, 30, 90, 180, 364);
+$previous_days_text = array($lang['All_Posts'], "1 " . $lang['Day'], "7 " . $lang['Days'], "2 " . $lang['Weeks'], "1 " . $lang['Month'], "3 ". $lang['Months'], "6 " . $lang['Months'], "1 " . $lang['Year']);
+
+if(!empty($HTTP_POST_VARS['postdays']) || !empty($HTTP_GET_VARS['postdays']))
+{
+ $post_days = (!empty($HTTP_POST_VARS['postdays'])) ? $HTTP_POST_VARS['postdays'] : $HTTP_GET_VARS['postdays'];
+ $min_post_time = time() - ($post_days * 86400);
+
+ $sql = "SELECT COUNT(post_id) AS num_posts
+ FROM " . POSTS_TABLE . "
+ WHERE topic_id = $topic_id
+ AND post_time >= $min_post_time";
+ if(!$result = $db->sql_query($sql))
+ {
+ message_die(GENERAL_ERROR, "Couldn't obtain limited topics count information", "", __LINE__, __FILE__, $sql);
+ }
+ list($total_replies) = $db->sql_fetchrow($result);
+
+ $limit_posts_time = "AND p.post_time >= $min_post_time ";
+
+ if(!empty($HTTP_POST_VARS['postdays']))
+ {
+ $start = 0;
+ }
+}
+else
+{
+ $total_replies = $forum_row['topic_replies'] + 1;
+
+ $limit_posts_time = "";
+ $post_days = 0;
+}
+
+$select_post_days = "";
+for($i = 0; $i < count($previous_days); $i++)
+{
+ $selected = ($post_days == $previous_days[$i]) ? " selected=\"selected\"" : "";
+ $select_post_days .= "" . $previous_days_text[$i] . " ";
+}
+$select_post_days .= " ";
+
+//
+// Decide how to order the post display
+//
+if(!empty($HTTP_POST_VARS['postorder']) || !empty($HTTP_GET_VARS['postorder']))
+{
+ $post_order = (!empty($HTTP_POST_VARS['postorder'])) ? $HTTP_POST_VARS['postorder'] : $HTTP_GET_VARS['postorder'];
+ $post_time_order = ($post_order == "asc") ? "ASC" : "DESC";
+}
+else
+{
+ $post_time_order = "ASC";
+}
+
+$select_post_order = "";
+if($post_time_order == "ASC")
+{
+ $select_post_order .= "" . $lang['Oldest_First'] . " " . $lang['Newest_First'] . " ";
+}
+else
+{
+ $select_post_order .= "" . $lang['Oldest_First'] . " " . $lang['Newest_First'] . " ";
+}
+$select_post_order .= " ";
+
//
// Go ahead and pull all data for this topic
//
@@ -199,8 +268,9 @@ $sql = "SELECT u.username, u.user_id, u.user_posts, u.user_from, u.user_website,
FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt
WHERE p.topic_id = $topic_id
AND p.poster_id = u.user_id
- AND p.post_id = pt.post_id
- ORDER BY p.post_time ASC
+ AND p.post_id = pt.post_id
+ $limit_posts_time
+ ORDER BY p.post_time $post_time_order
LIMIT $start, ".$board_config['posts_per_page'];
if(!$result = $db->sql_query($sql))
{
@@ -236,6 +306,9 @@ $template->set_filenames(array(
$jumpbox = make_jumpbox();
$template->assign_vars(array(
+ "L_GO" => $lang['Go'],
+ "L_JUMP_TO" => $lang['Jump_to'],
+ "L_SELECT_FORUM" => $lang['Select_forum'],
"JUMPBOX_LIST" => $jumpbox,
"SELECT_NAME" => POST_FORUM_URL)
);
@@ -246,8 +319,13 @@ $template->assign_vars(array(
"FORUM_NAME" => $forum_name,
"TOPIC_ID" => $topic_id,
"TOPIC_TITLE" => $topic_title,
- "POST_FORUM_URL" => POST_FORUM_URL,
- "USERS_BROWSING" => $users_browsing)
+
+ "L_DISPLAY_POSTS" => $lang['Display_posts'],
+
+ "S_SELECT_POST_DAYS" => $select_post_days,
+ "S_SELECT_POST_ORDER" => $select_post_order,
+ "S_POST_DAYS_ACTION" => append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=" . $topic_id . "&start=$start"))
+
);
//
// End header
@@ -257,13 +335,13 @@ $template->assign_vars(array(
// Post, reply and other URL generation for
// templating vars
//
-$new_topic_url = append_sid("posting.$phpEx?mode=newtopic&" . POST_FORUM_URL . "=$forum_id");
-$reply_topic_url = append_sid("posting.$phpEx?mode=reply&" . POST_TOPIC_URL . "=$topic_id");
+$new_topic_url = append_sid("posting.$phpEx?mode=newtopic&" . POST_FORUM_URL . "=$forum_id");
+$reply_topic_url = append_sid("posting.$phpEx?mode=reply&" . POST_TOPIC_URL . "=$topic_id");
$view_forum_url = append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id");
-$view_prev_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&view=previous");
-$view_next_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&view=next");
+$view_prev_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&view=previous");
+$view_next_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&view=next");
$reply_img = ($forum_row['forum_status'] == FORUM_LOCKED || $forum_row['topic_status'] == TOPIC_LOCKED) ? $images['reply_locked'] : $images['reply_new'];
$post_img = ($forum_row['forum_status'] == FORUM_LOCKED) ? $images['post_locked'] : $images['post_new'];
@@ -318,7 +396,7 @@ for($i = 0; $i < $total_posts; $i++)
if($postrow[$i]['user_avatar'] != "" && $poster_id != ANONYMOUS)
{
- $poster_avatar = (strstr("http", $postrow[$i]['user_avatar']) && $board_config['allow_avatar_remote']) ? " " : " ";
+ $poster_avatar = (strstr("http", $postrow[$i]['user_avatar']) && $board_config['allow_avatar_remote']) ? " " : " ";
}
else
{
@@ -367,19 +445,19 @@ for($i = 0; $i < $total_posts; $i++)
if($poster_id != ANONYMOUS)
{
- $profile_img = " ";
+ $profile_img = " ";
- $pm_img = " ";
+ $pm_img = " ";
- $email_img = ($postrow[$i]['user_viewemail'] == 1) ? " " : "";
+ $email_img = ($postrow[$i]['user_viewemail'] == 1) ? " " : "";
- $www_img = ($postrow[$i]['user_website']) ? " " : "";
+ $www_img = ($postrow[$i]['user_website']) ? " " : "";
if($postrow[$i]['user_icq'])
{
- $icq_status_img = " ";
+ $icq_status_img = " ";
- $icq_add_img = " ";
+ $icq_add_img = " ";
}
else
{
@@ -387,11 +465,11 @@ for($i = 0; $i < $total_posts; $i++)
$icq_add_img = "";
}
- $aim_img = ($postrow[$i]['user_aim']) ? " " : "";
+ $aim_img = ($postrow[$i]['user_aim']) ? " " : "";
- $msn_img = ($postrow[$i]['user_msnm']) ? " " : "";
+ $msn_img = ($postrow[$i]['user_msnm']) ? " " : "";
- $yim_img = ($postrow[$i]['user_yim']) ? " " : "";
+ $yim_img = ($postrow[$i]['user_yim']) ? " " : "";
}
else
{
@@ -406,17 +484,17 @@ for($i = 0; $i < $total_posts; $i++)
$yim_img = "";
}
- $search_img = " ";
+ $search_img = " ";
- $edit_img = " ";
+ $edit_img = " ";
- $quote_img = " ";
+ $quote_img = " ";
if( $is_auth['auth_mod'] )
{
- $ip_img = " ";
+ $ip_img = " ";
- $delpost_img = " ";
+ $delpost_img = " ";
}
$post_subject = ($postrow[$i]['post_subject'] != "") ? stripslashes($postrow[$i]['post_subject']) : $topic_title;
@@ -474,13 +552,15 @@ for($i = 0; $i < $total_posts; $i++)
// Again this will be handled by the templating
// code at some point
//
- $color = (!($i % 2)) ? "#" . $theme['td_color1'] : "#" . $theme['td_color2'];
+ $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,
"POSTER_NAME" => $poster,
"POSTER_RANK" => $poster_rank,
"RANK_IMAGE" => $rank_image,
- "ROW_COLOR" => $color,
"POSTER_JOINED" => $poster_joined,
"POSTER_POSTS" => $poster_posts,
"POSTER_FROM" => $poster_from,
@@ -521,23 +601,23 @@ if( $is_auth['auth_mod'] )
{
$s_auth_can .= $lang['You'] . " " . $lang['can'] . " " . $lang['moderate_forum'] . " ";
- $topic_mod = " ";
+ $topic_mod = " ";
- $topic_mod .= " ";
+ $topic_mod .= " ";
if($forum_row['topic_status'] == TOPIC_UNLOCKED)
{
- $topic_mod .= " ";
+ $topic_mod .= " ";
}
else
{
- $topic_mod .= " ";
+ $topic_mod .= " ";
}
- $topic_mod .= " ";
+ $topic_mod .= " ";
}
$template->assign_vars(array(
- "PAGINATION" => generate_pagination("viewtopic.$phpEx?".POST_TOPIC_URL."=$topic_id", $total_replies, $board_config['posts_per_page'], $start),
+ "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'] ),