Extra ampersand in URL causes incomplete topic listing [message #186154] |
Mon, 16 June 2014 19:40 |
|
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 |
|
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 .= ' '.(_uid && $r[15] < $r[2] && $usr->last_read < $r[2] ? '**' : '' ) .'
-<a href="'.(empty($r[12]) ? 'index.php?t='.t_thread_view.'&frm_id='.$r[7].'&'._rsid : $r[12] ) .'">'.$r[10].'</a>';
+ if ( $r[18] & 4 && $cat_id != $cid) {
+ $sRSID = ''._rsid;
+ $sTID = empty( $sRSID) ? '' : '&'._rsid;
+ $sDbg = ''; // '&dbg=rk4n3_01';
+ $sFrm = '&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 .= ' '.$sX.'<a href="'.$sURL.'">'.$r[10].'</a>';
continue;
}
@@ -180,10 +187,16 @@
$moderators = ' ';
}
+ $sRSID = ''._rsid;
+ $sTID = empty( $sRSID) ? '' : '&'._rsid;
+ $sDbg = ''; // '&dbg=rk4n3_02';
+ $sFrm = '&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" />' : ' ' ) .'</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.'&frm_id='.$r[7].'&'._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&id='.$r[3].'&'._rsid.'">'.$r[4].'</a>' : $GLOBALS['ANON_NICK'] ) .' <a href="index.php?t='.d_thread_view.'&goto='.$r[8].'&'._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&date=today&<?php echo _rsid; ?>&frm_id=<?php echo (isset($frm->forum_id) ? $frm->forum_id.'' : $frm->id.'' ) .'&th='.$th.'" title="Show all messages that were posted today" rel="nofollow">Today's Messages</a>
+<a href="index.php?t=selmsg&date=today&<?php echo _rsid; ?>&frm_id=<?php echo (isset($frm->forum_id) ? $frm->forum_id.'' : $frm->id.'' ).'&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&unread=1&'._rsid.'&frm_id='.(isset($frm->forum_id) ? $frm->forum_id.'' : $frm->id.'' ) .'" title="Show all unread messages" rel="nofollow">Unread Messages</a> ' : ''); ?>
-<?php echo (!$th ? '<b>::</b> <a href="index.php?t=selmsg&reply_count=0&'._rsid.'&frm_id='.(isset($frm->forum_id) ? $frm->forum_id.'' : $frm->id.'' ) .'" title="Show all messages, which have no replies" rel="nofollow">Unanswered Messages</a> ' : ''); ?>
+<?php echo (!$th ? '<b>::</b> <a href="index.php?t=selmsg&reply_count=0&'._rsid.'&frm_id='.(isset($frm->forum_id) ? $frm->forum_id.'' : $frm->id.'' ).'" title="Show all messages, which have no replies" rel="nofollow">Unanswered Messages</a> ' : ''); ?>
<b>::</b> <a href="index.php?t=polllist&<?php echo _rsid; ?>" rel="nofollow">Show Polls</a>
<b>::</b> <a href="index.php?t=mnav&<?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
|
|
|