diff --git a/phpBB/common.php b/phpBB/common.php
index 74754c5b12..d8db3c1e50 100644
--- a/phpBB/common.php
+++ b/phpBB/common.php
@@ -37,11 +37,11 @@ include('config.'.$phpEx);
include('includes/constants.'.$phpEx);
$url_images = "images";
-$images['quote'] = "$url_images/quote.gif";
+$images['quote'] = "$url_images/icon_quote.gif";
+$images['edit'] = "$url_images/icon_edit.gif";
$images['search_icon'] = "$url_images/search_icon.gif";
-$images['edit'] = "$url_images/edit.gif";
-$images['profile'] = "$url_images/profile.gif";
-$images['privmsg'] = "$url_images/icon_privmsg.gif";
+$images['profile'] = "$url_images/icon_profile.gif";
+$images['privmsg'] = "$url_images/icon_pm.gif";
$images['email'] = "$url_images/email.gif";
$images['delpost'] = "$url_images/edit.gif";
$images['ip'] = "$url_images/ip_logged.gif";
@@ -50,7 +50,6 @@ $images['icq'] = "$url_images/icq_add.gif";
$images['aim'] = "$url_images/aim.gif";
$images['yim'] = "$url_images/yim.gif";
$images['msnm'] = "$url_images/msnm.gif";
-$images['quote'] = "$url_images/quote.gif";
$images['posticon'] = "$url_images/posticon.gif";
$images['folder'] = "$url_images/folder.gif";
$images['new_folder'] = "$url_images/red_folder.gif";
diff --git a/phpBB/images/icon_edit.gif b/phpBB/images/icon_edit.gif
new file mode 100644
index 0000000000..619bf4455c
Binary files /dev/null and b/phpBB/images/icon_edit.gif differ
diff --git a/phpBB/images/icon_pm.gif b/phpBB/images/icon_pm.gif
index d1988a015b..87900fc58a 100644
Binary files a/phpBB/images/icon_pm.gif and b/phpBB/images/icon_pm.gif differ
diff --git a/phpBB/images/icon_profile.gif b/phpBB/images/icon_profile.gif
new file mode 100644
index 0000000000..9123b8f759
Binary files /dev/null and b/phpBB/images/icon_profile.gif differ
diff --git a/phpBB/images/icon_quote.gif b/phpBB/images/icon_quote.gif
new file mode 100644
index 0000000000..e262b3f8a7
Binary files /dev/null and b/phpBB/images/icon_quote.gif differ
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index ddee1421aa..82ddc10785 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -53,7 +53,7 @@ $start = (isset($HTTP_GET_VARS['start'])) ? $HTTP_GET_VARS['start'] : 0;
// Find topic id if user requested a newer
// or older topic
//
-if( isset($HTTP_GET_VARS["view"]) )
+if( isset($HTTP_GET_VARS["view"]) && empty($HTTP_GET_VARS[POST_POST_URL]) )
{
if($HTTP_GET_VARS["view"] == "next")
{
@@ -67,13 +67,15 @@ if( isset($HTTP_GET_VARS["view"]) )
}
$sql = "SELECT t.topic_id
- FROM " . TOPICS_TABLE . " t, " . TOPICS_TABLE . " t2
+ FROM " . TOPICS_TABLE . " t, " . TOPICS_TABLE . " t2, " . POSTS_TABLE . " p, " . POSTS_TABLE . " p2
WHERE t2.topic_id = $topic_id
+ AND p2.post_id = t2.topic_last_post_id
AND t.forum_id = t2.forum_id
- AND t.topic_time $sql_condition t2.topic_time
- ORDER BY t.topic_time $sql_ordering
+ AND p.post_id = t.topic_last_post_id
+ AND p.post_time $sql_condition p2.post_time
+ AND p.topic_id = t.topic_id
+ ORDER BY p.post_time $sql_ordering
LIMIT 1";
-
if(!$result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, "Couldn't obtain newer/older topic information", "", __LINE__, __FILE__, $sql);
@@ -273,7 +275,8 @@ $template->assign_vars(array(
"U_VIEW_OLDER_TOPIC" => $view_prev_topic_url,
"U_VIEW_NEWER_TOPIC" => $view_next_topic_url,
"U_POST_NEW_TOPIC" => $new_topic_url,
- "U_POST_REPLY_TOPIC" => $reply_topic_url));
+ "U_POST_REPLY_TOPIC" => $reply_topic_url)
+);
//
// Update the topic view counter
@@ -308,6 +311,10 @@ for($i = 0; $i < $total_posts; $i++)
{
$poster_avatar = (strstr("http", $postrow[$i]['user_avatar']) && $board_config['allow_avatar_remote']) ? "
" : "
";
}
+ else
+ {
+ $poster_avatar = "";
+ }
//
// Generate ranks
@@ -321,7 +328,7 @@ for($i = 0; $i < $total_posts; $i++)
{
for($j = 0; $j < count($ranksrow); $j++)
{
- if($postrow[$i]['user_rank'] == $ranksrow[$j]['rank_special'])
+ if($postrow[$i]['user_rank'] == $ranksrow[$j]['rank_id'] && $ranksrow[$j]['rank_special'])
{
$poster_rank = $ranksrow[$j]['rank_title'];
$rank_image = ($ranksrow[$j]['rank_image']) ? "
" : "";
@@ -332,7 +339,7 @@ for($i = 0; $i < $total_posts; $i++)
{
for($j = 0; $j < count($ranksrow); $j++)
{
- if($postrow[$i]['user_posts'] > $ranksrow[$j]['rank_min'] && $postrow[$i]['user_posts'] < $ranksrow[$j]['rank_max'])
+ if($postrow[$i]['user_posts'] > $ranksrow[$j]['rank_min'] && $postrow[$i]['user_posts'] < $ranksrow[$j]['rank_max'] && !$ranksrow[$j]['rank_special'])
{
$poster_rank = $ranksrow[$j]['rank_title'];
$rank_image = ($ranksrow[$j]['rank_image']) ? "
" : "";
@@ -349,21 +356,21 @@ for($i = 0; $i < $total_posts; $i++)
$poster_rank = $lang['Guest'];
}
- $profile_img = "
";
+ $profile_img = "
";
$search_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
{
@@ -371,34 +378,31 @@ 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']) ? "
" : "";
if($i == 0)
{
- $edit_post_url = append_sid("posting.$phpEx?mode=editpost&".POST_POST_URL."=".$postrow[$i]['post_id']."&".POST_TOPIC_URL."=$topic_id&".POST_FORUM_URL."=$forum_id&is_first_post=1");
+ $edit_post_url = append_sid("posting.$phpEx?mode=editpost&" . POST_POST_URL . "=" . $postrow[$i]['post_id'] . "&" . POST_TOPIC_URL . "=$topic_id&" . POST_FORUM_URL . "=$forum_id&is_first_post=1");
}
else
{
- $edit_post_url = append_sid("posting.$phpEx?mode=editpost&".POST_POST_URL."=".$postrow[$i]['post_id']."&".POST_TOPIC_URL."=$topic_id&".POST_FORUM_URL."=$forum_id");
+ $edit_post_url = append_sid("posting.$phpEx?mode=editpost&" . POST_POST_URL . "=" . $postrow[$i]['post_id'] . "&" . POST_TOPIC_URL . "=$topic_id&" . POST_FORUM_URL . "=$forum_id");
}
- $edit_img = "
";
+ $edit_img = "
";
- $quote_img = "
";
-
- $pmsg_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;
$bbcode_uid = $postrow[$i]['bbcode_uid'];
@@ -431,11 +435,11 @@ for($i = 0; $i < $total_posts; $i++)
//
if(!($i % 2))
{
- $color = "#".$theme['td_color1'];
+ $color = "#" . $theme['td_color1'];
}
else
{
- $color = "#".$theme['td_color2'];
+ $color = "#" . $theme['td_color2'];
}
$message = eregi_replace("\[addsig]$", "
_________________
" . nl2br($user_sig), $message);