|
From: Andreas K. <la...@us...> - 2003-01-18 16:24:48
|
Update of /cvsroot/pn-modules/PN_phpBB_14/html/modules/phpBB_14
In directory sc8-pr-cvs1:/tmp/cvs-serv3527/PN_phpBB_14/html/modules/phpBB_14
Modified Files:
latest.php
Log Message:
jump to correct page (if more then one)
Index: latest.php
===================================================================
RCS file: /cvsroot/pn-modules/PN_phpBB_14/html/modules/phpBB_14/latest.php,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** latest.php 8 Jan 2003 18:04:01 -0000 1.13
--- latest.php 18 Jan 2003 16:24:45 -0000 1.14
***************
*** 93,96 ****
--- 93,99 ----
// end of input checking
+ // get some enviroment
+ $posts_per_page = pnModGetVar('phpBB_14', 'posts_per_page');
+ $post_sort_order = pnModGetVar('phpBB_14', 'post_sort_order');
phpbb14_page_header($pagetype);
$page_header_included = 1;
***************
*** 190,202 ****
$cat_title = pnVarPrepForDisplay($cat_title);
$topic_replies = pnVarPrepForDisplay($topic_replies);
!
// check permission before display
if ((pnSecAuthAction(0, 'phpBB_14::Forum', "$forum_name::", ACCESS_READ))
&& (pnSecAuthAction(0, 'phpBB_14::Category', "$cat_title::", ACCESS_READ))) {
// get postername and posttime
$last_boardpost = get_last_boardpost($topic_id, 'topic');
echo "<TR BGCOLOR=\"".$GLOBALS['bgcolor3']."\">\n";
! echo "<TD WIDTH=\"50%\" onMouseOver=\"this.style.backgroundColor='".$GLOBALS['bgcolor4']."';\" onMouseOut=\"this.style.backgroundColor='".$GLOBALS['bgcolor3']."'\"><a href=\"modules.php?op=modload&name=$ModName&file=index&action=viewtopic&topic=$topic_id&forum=$forum_id\" title=\"$forum_name :: $cat_title\">$topic_title</a></TD>\n";
echo "<td>$topic_replies</td>\n";
echo $last_boardpost;
--- 193,219 ----
$cat_title = pnVarPrepForDisplay($cat_title);
$topic_replies = pnVarPrepForDisplay($topic_replies);
!
// check permission before display
if ((pnSecAuthAction(0, 'phpBB_14::Forum', "$forum_name::", ACCESS_READ))
&& (pnSecAuthAction(0, 'phpBB_14::Category', "$cat_title::", ACCESS_READ))) {
+ // get correct page for latest entry
+ if ($post_sort_order == "ASC") {
+ $hc_dlink_times = 0;
+ if (($topic_replies+1-$posts_per_page)>= 0) {
+ $hc_dlink_times = 0;
+ for ($x = 0; $x < $topic_replies+1-$posts_per_page; $x+= $posts_per_page)
+ $hc_dlink_times++;
+ }
+ $start = $hc_dlink_times*$posts_per_page;
+ } else {
+ // latest topic is on top anyway...
+ $start = 0;
+ }
+
// get postername and posttime
$last_boardpost = get_last_boardpost($topic_id, 'topic');
echo "<TR BGCOLOR=\"".$GLOBALS['bgcolor3']."\">\n";
! echo "<TD WIDTH=\"50%\" onMouseOver=\"this.style.backgroundColor='".$GLOBALS['bgcolor4']."';\" onMouseOut=\"this.style.backgroundColor='".$GLOBALS['bgcolor3']."'\"><a href=\"modules.php?op=modload&name=$ModName&file=index&action=viewtopic&topic=$topic_id&forum=$forum_id&start=$start\" title=\"$forum_name :: $cat_title\">$topic_title</a></TD>\n";
echo "<td>$topic_replies</td>\n";
echo $last_boardpost;
|