FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Bug Reports » Extra ampersand in URL causes incomplete topic listing
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Extra ampersand in URL causes incomplete topic listing [message #186154] Mon, 16 June 2014 19:40 Go to next message
Matt Samudio is currently offline  Matt Samudio   United States
Messages: 3
Registered: June 2014
Location: Albert Lea, MN
Karma: 0
Junior Member

The "normal" navigation links via the forum list, topic list, and "breadcrumb" list(s) results in a URL that has an extra '&' (ampersand) on the end, which for some reason causes an incomplete topic list (for me, only seven topics) to be shown.

If the URL is submitted without the trailing '&', the complete topic list is shown.

I also discovered that the "Goto Forum:" button, when utilized, results in a URL that does not have the trailing '&', and thus seems to work correctly.

Am I missing some notion of intended behavior that can possibly be adjusted through configuration, or is this indeed a bug ?

If the former is true, I haven't been able to find anything in settings or documentation seemingly related to it.

If its a bug, it seems innocent/simple-enough to fix, but I scanned the code for locations where "frm_id=<whatever>" is generated, and the result is so prolific, with lots of variables involved in the "<whatever>" portion, that it struck me as prohibitive for me to try to fix it, without learning a lot about the internals.

This forum software seems pretty darned cool, so I'd like to use it - but if this is indeed a bug, its going to be difficult to share forums very effectively with basic listing of topics not working.

Any assistance greatly appreciated ...
Re: Extra ampersand in URL causes incomplete topic listing [message #186158 is a reply to message #186154] Mon, 16 June 2014 22:11 Go to previous message
Matt Samudio is currently offline  Matt Samudio   United States
Messages: 3
Registered: June 2014
Location: Albert Lea, MN
Karma: 0
Junior Member

Here is a patch for the problem ...

diff -Naur 3.0.5/theme/default/index.php rk4n3/theme/default/index.php
--- 3.0.5/theme/default/index.php	2014-06-16 16:04:39.000000000 -0500
+++ rk4n3/theme/default/index.php	2014-06-16 17:16:46.000000000 -0500
@@ -140,9 +140,16 @@
 		}
 
 		/* Compact category view (ignore when expanded). */
-		if ($r[18] & 4 && $cat_id != $cid) {
-			$cbuf .= '&nbsp; '.(_uid && $r[15] < $r[2] && $usr->last_read < $r[2] ? '**' : '' )  .'
-<a href="'.(empty($r[12]) ? 'index.php?t='.t_thread_view.'&amp;frm_id='.$r[7].'&amp;'._rsid : $r[12] )  .'">'.$r[10].'</a>';
+		if ( $r[18] & 4 && $cat_id != $cid) {
+			$sRSID = ''._rsid;
+			$sTID = empty( $sRSID) ? '' : '&amp;'._rsid;
+			$sDbg = ''; // '&amp;dbg=rk4n3_01';
+			$sFrm = '&amp;frm_id='.$r[7];
+			$sX = (_uid && $r[15] < $r[2] && $usr->last_read < $r[2]) ?'**':'';
+			$sURL	= empty($r[12])
+					?	'index.php?t='.t_thread_view.$sFrm.$sTID.$sDbg
+					: $r[12];
+			$cbuf .= '&nbsp; '.$sX.'<a href="'.$sURL.'">'.$r[10].'</a>';
 			continue;
 		}
 
@@ -180,10 +187,16 @@
 			$moderators = '&nbsp;';
 		}
 
+		$sRSID = ''._rsid;
+		$sTID = empty( $sRSID) ? '' : '&amp;'._rsid;
+		$sDbg = ''; // '&amp;dbg=rk4n3_02';
+		$sFrm = '&amp;frm_id='.$r[7];
+		$sRdr = empty($r[12]) ? $forum_read_indicator : '<img title="Redirection" src="theme/default/images/moved.png" alt="" />';
+		$sURL = empty($r[12]) ? 'index.php?t='.t_thread_view.$sFrm.$sTID : $r[12];
 		$forum_list_table_data .= '<tr style="display: '.(empty($collapse[$cid]) ? 'table-row' : 'none' )  .'" class="row child-c'.$r[5].'">
 	<td class="RowStyleA wo">'.($r[6] ? '<img src="images/forum_icons/'.$r[6].'" alt="Forum Icon" />' : '&nbsp;' ) .'</td>
-	<td class="RowStyleB ac wo">'.(empty($r[12]) ? $forum_read_indicator : '<img title="Redirection" src="theme/default/images/moved.png" alt="" />' )  .'</td>
-	<td class="RowStyleA wa"><a href="'.(empty($r[12]) ? 'index.php?t='.t_thread_view.'&amp;frm_id='.$r[7].'&amp;'._rsid : $r[12] )  .'" class="big">'.$r[10].'</a>'.($r[11] ? '<br />'.$r[11] : '').$moderators.'</td>
+	<td class="RowStyleB ac wo">'.$sRdr.'</td>
+	<td class="RowStyleA wa"><a href="'.$sURL.$sDbg.'" class="big">'.$r[10].'</a>'.($r[11] ? '<br />'.$r[11] : '').$moderators.'</td>
 	<td class="RowStyleB ac">'.(empty($r[12]) ? $r[13] : '--' )  .'</td>
 	<td class="RowStyleB ac">'.(empty($r[12]) ? $r[14] : '--' )  .'</td>
 	<td class="RowStyleA ac nw">'.(empty($r[12]) ? ($r[8] ? '<span class="DateText">'.strftime('%a, %d %B %Y', $r[2]).'</span><br />By: '.($r[3] ? '<a href="index.php?t=usrinfo&amp;id='.$r[3].'&amp;'._rsid.'">'.$r[4].'</a>' : $GLOBALS['ANON_NICK'] ) .' <a href="index.php?t='.d_thread_view.'&amp;goto='.$r[8].'&amp;'._rsid.'#msg_'.$r[8].'"><img title="'.$r[0].'" src="theme/default/images/goto.gif" alt="'.$r[0].'" /></a>' : 'n/a' )  : '--' )  .'</td>
@@ -459,9 +472,9 @@
 </div>
 <?php echo (_uid ? '<span class="GenText">Welcome <b>'.$usr->alias.'</b>, your last visit was on '.strftime('%a, %d %B %Y %H:%M', $usr->last_visit).'</span><br />' : ''); ?>
 <span class="GenText fb">Show:</span>
-<a href="index.php?t=selmsg&amp;date=today&amp;<?php echo _rsid; ?>&amp;frm_id=<?php echo (isset($frm->forum_id) ? $frm->forum_id.'' : $frm->id.'' )  .'&amp;th='.$th.'" title="Show all messages that were posted today" rel="nofollow">Today's Messages</a>
+<a href="index.php?t=selmsg&amp;date=today&amp;<?php echo _rsid; ?>&amp;frm_id=<?php echo (isset($frm->forum_id) ? $frm->forum_id.'' : $frm->id.'' ).'&amp;th='.$th.'" title="Show all messages that were posted today" rel="nofollow">Today's Messages</a>
 '.(_uid ? '<b>::</b> <a href="index.php?t=selmsg&amp;unread=1&amp;'._rsid.'&amp;frm_id='.(isset($frm->forum_id) ? $frm->forum_id.'' : $frm->id.'' )  .'" title="Show all unread messages" rel="nofollow">Unread Messages</a>&nbsp;' : ''); ?>
-<?php echo (!$th ? '<b>::</b> <a href="index.php?t=selmsg&amp;reply_count=0&amp;'._rsid.'&amp;frm_id='.(isset($frm->forum_id) ? $frm->forum_id.'' : $frm->id.'' )  .'" title="Show all messages, which have no replies" rel="nofollow">Unanswered Messages</a>&nbsp;' : ''); ?>
+<?php echo (!$th ? '<b>::</b> <a href="index.php?t=selmsg&amp;reply_count=0&amp;'._rsid.'&amp;frm_id='.(isset($frm->forum_id) ? $frm->forum_id.'' : $frm->id.'' ).'" title="Show all messages, which have no replies" rel="nofollow">Unanswered Messages</a>&nbsp;' : ''); ?>
 <b>::</b> <a href="index.php?t=polllist&amp;<?php echo _rsid; ?>" rel="nofollow">Show Polls</a>
 <b>::</b> <a href="index.php?t=mnav&amp;<?php echo _rsid; ?>" rel="nofollow">Message Navigator</a><?php echo $admin_cp; ?>
 <?php echo $cat_path; ?>


I've also attached a patch file.

[Updated on: Mon, 16 June 2014 22:29]

Report message to a moderator

  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: secret admin log in screen (aka batcave)
Next Topic: global settings not sticking
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Dec 19 03:44:29 GMT 2024

Total time taken to generate the page: 0.02977 seconds