Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Bug in /forum/viewthread.php post# redirecting wrong.

Asked Modified Viewed 968 times
W
Wanabo
W
Wanabo 10
www.probemyip.com/probe-my-ip-80x15.png
pHp-Fusion.Asia & pHp-Fusion.Fr & pHp-Fusion.Cn are available for a localized support community. Send PB for info.
  • Senior Member, joined since
  • Contributed 598 posts on the community forums.
  • Started 94 threads in the forums
  • Started this discussions
asked
Senior Member

After fiddling with RSS where I discovered that I needed to add pid to the url of the feed to go to the correct post I also found out that "post redirecting" by clicking on the #number of the post does not function properly. You only can see this problem if you click on a post# when it is not the first page.

I examined the code and the pid part was missing.
Change in viewthread.php

echo " <a href='".BASEDIR."forum/viewthread.php?forum_id=".$_GET['thread_id']."&thread_id=".$_GET['thread_id']."#post_".$data['post_id']."' name='post_".$data['post_id']."' id='post_".$data['post_id']."'>#".($current_row + $_GET['rowstart'])."</a>"; 

to
 echo " <a href='".BASEDIR."forum/viewthread.php?forum_id=".$_GET['thread_id']."&thread_id=".$_GET['thread_id']."&pid=".$data['post_id']."#post_".$data['post_id']."' name='post_".$data['post_id']."' id='post_".$data['post_id']."'>#".($current_row + $_GET['rowstart'])."</a>"; 


Full snippet with comment.

 echo "<tr>\n<td class='tbl2 forum_thread_user_name' style='width:140px'><!--forum_thread_user_name-->".profile_link($data['user_id'], $data['user_name'], $data['user_status'])."</td>\n";
 echo "<td class='tbl2 forum_thread_post_date'>\n";
 echo "<div style='float:right' class='small'>";
 echo "<a href='".BASEDIR."forum/viewthread.php?forum_id=".$_GET['thread_id']."&thread_id=".$_GET['thread_id']."#top'><img src='".get_image("up")."' alt='".$locale['541']."' title='".$locale['542']."' style='border:0;vertical-align:middle' /></a>\n";
 echo " <a href='".BASEDIR."forum/viewthread.php?forum_id=".$_GET['thread_id']."&thread_id=".$_GET['thread_id']."&pid=".$data['post_id']."#post_".$data['post_id']."' name='post_".$data['post_id']."' id='post_".$data['post_id']."'>#".($current_row + $_GET['rowstart'])."</a>"; // mod Wanabo, added pid for showing the wright post and avoiding problems referring to posts.
 echo " <a href='".BASEDIR."print.php?type=F&thread=".$_GET['thread_id']."&post=".$data['post_id']."&nr=".($current_row + $_GET['rowstart'])."'><img src='".get_image("printer")."' alt='".$locale['519a']."' title='".$locale['519a']."' style='border:0;vertical-align:middle' /></a></div>\n";
 echo "<div class='small'>".$locale['505'].showdate("forumdate", $data['post_datestamp'])."</div>\n";
 echo "</td>\n";
 echo "</tr>\n<tr>\n<td valign='top' class='tbl2 forum_thread_user_info' style='width:140px'>\n";
 if ($data['user_avatar'] && file_exists(IMAGES."avatars/".$data['user_avatar']) && $data['user_status'] != 6 && $data['user_status'] != 5) {
Edited by Wanabo on 02-06-2019 10:31,
0 replies

1 post

F
Falk
F
Falk 146
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 12 questions
answered
Super Admin

Thank you for the reports!
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 1 post
  • Votes 0 votes
  • Topic users 2 members

2 participants

F
F
Falk 146
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 12 questions
W
W
Wanabo 10
www.probemyip.com/probe-my-ip-80x15.png
pHp-Fusion.Asia & pHp-Fusion.Fr & pHp-Fusion.Cn are available for a localized support community. Send PB for info.
  • Senior Member, joined since
  • Contributed 598 posts on the community forums.
  • Started 94 threads in the forums
  • Started this discussions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet