|
From: Paul S. O. <ps...@us...> - 2002-02-19 22:09:11
|
Update of /cvsroot/phpbb/phpBB2
In directory usw-pr-cvs1:/tmp/cvs-serv22539
Modified Files:
viewforum.php
Log Message:
Fix bug #520039, moved topics with wrong goto page links
Index: viewforum.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/viewforum.php,v
retrieving revision 1.130
retrieving revision 1.131
diff -C2 -r1.130 -r1.131
*** viewforum.php 15 Feb 2002 19:58:15 -0000 1.130
--- viewforum.php 19 Feb 2002 22:09:08 -0000 1.131
***************
*** 444,449 ****
--- 444,453 ----
for($i = 0; $i < $total_topics; $i++)
{
+ $topic_id = $topic_rowset[$i]['topic_id'];
+
$topic_title = ( count($orig_word) ) ? preg_replace($orig_word, $replacement_word, $topic_rowset[$i]['topic_title']) : $topic_rowset[$i]['topic_title'];
+ $replies = $topic_rowset[$i]['topic_replies'];
+
$topic_type = $topic_rowset[$i]['topic_type'];
***************
*** 466,501 ****
}
- $topic_id = $topic_rowset[$i]['topic_id'];
-
- $replies = $topic_rowset[$i]['topic_replies'];
-
- if( ( $replies + 1 ) > $board_config['posts_per_page'] )
- {
- $total_pages = ceil(($replies+1)/$board_config['posts_per_page']);
- $goto_page = ' [ <img src="' . $images['icon_gotopost'] . '" alt="' . $lang['Goto_page'] . '" title="' . $lang['Goto_page'] . '" />' . $lang['Goto_page'] . ': ';
-
- $times = 1;
- for($j = 0; $j < $replies + 1; $j += $board_config['posts_per_page'])
- {
- $goto_page .= '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=" . $topic_id . "&start=$j") . '">' . $times . '</a>';
- if( $times == 1 && $total_pages > 4 )
- {
- $goto_page .= ' ... ';
- $times = $total_pages - 3;
- $j += ( $total_pages - 4 ) * $board_config['posts_per_page'];
- }
- else if ( $times < $total_pages )
- {
- $goto_page .= ', ';
- }
- $times++;
- }
- $goto_page .= ' ] ';
- }
- else
- {
- $goto_page = '';
- }
-
if( $topic_rowset[$i]['topic_status'] == TOPIC_MOVED )
{
--- 470,473 ----
***************
*** 604,607 ****
--- 576,607 ----
$newest_post_img = '';
}
+ }
+
+ if( ( $replies + 1 ) > $board_config['posts_per_page'] )
+ {
+ $total_pages = ceil(($replies+1)/$board_config['posts_per_page']);
+ $goto_page = ' [ <img src="' . $images['icon_gotopost'] . '" alt="' . $lang['Goto_page'] . '" title="' . $lang['Goto_page'] . '" />' . $lang['Goto_page'] . ': ';
+
+ $times = 1;
+ for($j = 0; $j < $replies + 1; $j += $board_config['posts_per_page'])
+ {
+ $goto_page .= '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=" . $topic_id . "&start=$j") . '">' . $times . '</a>';
+ if( $times == 1 && $total_pages > 4 )
+ {
+ $goto_page .= ' ... ';
+ $times = $total_pages - 3;
+ $j += ( $total_pages - 4 ) * $board_config['posts_per_page'];
+ }
+ else if ( $times < $total_pages )
+ {
+ $goto_page .= ', ';
+ }
+ $times++;
+ }
+ $goto_page .= ' ] ';
+ }
+ else
+ {
+ $goto_page = '';
}
|