15 years on The Web
miniBB ® miniBB®
miniBB Support Forums
 | Forums | Register | Reply | Search | Statistics | Manual |
Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /   

When posts are sorted in DESC order, after posting a topic, the forum redirects to the last page

Author Anonymous
#1 | Posted: 3 Apr 2004 22:44 
I have changed stuff so the last post is always on top of the first page.
Can i anchor the redirecting to the first post instead off the last?

Author Anonymous
#2 | Posted: 17 May 2004 23:06 
Let me make myself clear on this....

I have changed the forum orders to ASC instead of DESC and the problem that i have is that when a user posts a message, the forum goes to the last page instead of the first page.
I know it's an anchorthing, so team please let me know if it is possibble to change the page redirects.

Author Sergei
Team member
#3 | Posted: 18 May 2004 00:56 
i'm confused.. have you changed post order or forum order?

Author Anonymous
#4 | Posted: 20 May 2004 02:39 
The forum order looks like this:

Suppose there are 4 pages filled with posts.
The last post is now on top off page 1 ASC instead off page 4 DESC
When someone replies on the last post wich is on page 1 and pushes the submit button, the forum shows page 4 instead off page 1 where the last post is at that moment.

Author Team
#5 | Posted: 24 May 2004 10:27 
This is redirect algorithm. You need to change also bb_pthread. When header("location"...) goes to page=-1, it goes to the last page. You need to set location's page to 0.

Author Anonymous
#6 | Posted: 24 May 2004 14:48 
I cannot seem to find this in bb_func_pthread

Is it somewhere near this anchor:

$totalPosts = (integer) DB_query(6,0);
$vmax = (integer) $viewmaxreplys;
$anchor = $totalPosts;
if ($anchor>$vmax) { $anchor = $totalPosts-((floor($totalPosts/$vmax))*$vmax); if ($anchor==0) $anchor=$vmax;}

Author Team
#7 | Posted: 24 May 2004 15:02 
Sorry... you'll find it in index.php
Look for page=$page

Author Anonymous
#8 | Posted: 24 May 2004 21:07 
Got it ;)

The best forum i ever had is mini_bb !!
keep up the good work.....


Author Anonymous
#9 | Posted: 29 Jun 2006 21:47 
I have got the same problem and I can´t find header("location"...) in index.php . Can anybody help?

Author Paul
Lead Developer
#10 | Posted: 30 Jun 2006 07:23 | Edited by: Paul 
Look up for:


in index.php and you'll find if($action=='pthread') { above this code. This is a place of redirection.

Nothing changed here for about 2 years :)

Author Jana
#11 | Posted: 30 Jun 2006 09:56 
I found this:

if($action=='pthread') {
if (!isset($errorMSG)) {
if(isset($anchor)) $anchor='#msg'.$anchor; else $anchor='';
if(file_exists($pathToFiles.'bb_plugins2.php')) require_once($pathToFiles.'bb_plugins2.php');
if(isset($metaLocation)) {
$meta_relocate="http://www.minibb.com/forums/{$indexphp}action=vthread&forum=$forum&top ic=$topic&page=$page{$ancho

r}"; echo ParseTpl(makeUp($metaLocation)); exit; } else { if(isset($mod_rewrite) and

$mod_rewrite) $furl=$forum.'_'.$topic.'_'.$page.'.html'.$anchor; else

$furl="{$indexphp}action=vthread&forum=$forum&topic=$topic&page=$page{ $anchor}";
header("Location: http://www.minibb.com/forums/{$furl}"); exit; }

But I still don´t know what to change there

Author Paul
Lead Developer
#12 | Posted: 30 Jun 2006 09:59 | Edited by: Paul 
In general, what are you trying to achieve? Why do you need to change something there? If you are not experienced PHP coder, we are not the right people to teach you.

Author Jana
#13 | Posted: 30 Jun 2006 10:03 
I´ve changed the posts order so the newest posts are on the first page, but when I add new post it redirects me to the last page instead of the first one.

Author Paul
Lead Developer
#14 | Posted: 30 Jun 2006 10:17 
Ok, so in the code above, you need to replace $page to '0' everywhere you can find it.

Author Jana
#15 | Posted: 30 Jun 2006 10:36 
Thanks very much! It works now!

Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications / When posts are sorted in DESC order, after posting a topic, the forum redirects to the last page Top

Your Reply Click this icon to move up to the quoted message

 Short link for this topic:

You are welcome to post anonymously, by entering a nickname with no password (if the similar Username has not been taken yet), or by leaving both fields empty. If you have a forums account, you can also sign in from this page without posting a message, or sign in and post at once.

Before posting, make sure your message is compliant with our forum posting rules. If not, it may be locked or deleted with no explanation.
miniBB Support Forums Powered by Forum Software miniBB ® Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contacts
Proceed with the Captcha add-on: protect your miniBB-forums from the automated spam and flood.
Captcha Addon for miniBB