|
From: Andreas K. <la...@us...> - 2003-05-20 14:20:21
|
Update of /cvsroot/pn-modules/PN_phpBB_14/html/modules/phpBB_14
In directory sc8-pr-cvs1:/tmp/cvs-serv21648/PN_phpBB_14/html/modules/phpBB_14
Modified Files:
reply.php
Log Message:
fixed redirect for threads with more then one page
Index: reply.php
===================================================================
RCS file: /cvsroot/pn-modules/PN_phpBB_14/html/modules/phpBB_14/reply.php,v
retrieving revision 1.114
retrieving revision 1.115
diff -C2 -d -r1.114 -r1.115
*** reply.php 21 Jan 2003 17:18:30 -0000 1.114
--- reply.php 20 May 2003 14:20:16 -0000 1.115
***************
*** 269,274 ****
notify_by_email($topic_id, $pn_uid, $posted_message, '2');
! pnRedirect('modules.php?op=modload&name='.$ModName.'&file=index&action=viewtopic&topic='.pnVarPrepForStore($topic_id).'');
} else {
$sql = "SELECT f.forum_name,
--- 269,298 ----
notify_by_email($topic_id, $pn_uid, $posted_message, '2');
+
+ // get topic_replies for correct redirect
+ $sql = "SELECT topic_replies FROM $pntable[phpbb14_topics] WHERE topic_id = '$topic'";
+ $result = $dbconn->Execute($sql);
+ if($dbconn->ErrorNo() != 0) {
+ die("Error accesing to the database " . $dbconn->ErrorNo() . ": " . $dbconn->ErrorMsg() . "<br />");
+ }
+ list ($topic_replies) = $result->fields;
! // get some enviroment
! $posts_per_page = pnModGetVar('phpBB_14', 'posts_per_page');
! $post_sort_order = pnModGetVar('phpBB_14', 'post_sort_order');
!
! 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;
! }
! pnRedirect('modules.php?op=modload&name='.$ModName.'&file=index&action=viewtopic&topic='.pnVarPrepForStore($topic_id).'&start='.pnVarPrepForStore($start).'');
} else {
$sql = "SELECT f.forum_name,
|