Reverse Order in viewtopic - default for one ID only.

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
Locked
The Founder
Registered User
Posts: 24
Joined: Thu May 06, 2004 6:46 pm

Reverse Order in viewtopic - default for one ID only.

Post by The Founder »

In my PHPBB forum (2.06) I have one room (forum ID = 20)

That we generally use as a blogger. They can post their thoughts and people can't reply.

The problem with this is that the posts show up in the normal format, with the oldest post on top. This is perfect for the rest of the forum, however for the blogger the Newist topic should be on the top.

I don't mind hardcoding that forum ID into whatever code I need to do..

Is there any ideas or code that you guys have to do this? It's my understanding it should be a very short bit of code to viewtopic.php
User avatar
AdamR
Former Team Member
Posts: 9731
Joined: Tue Mar 02, 2004 5:40 pm
Location: Tampa, Florida
Name: Adam Reyher
Contact:

Post by AdamR »

phpBB Support: Welcome | Userguide | Knowledge Base | Search
Honored supporter of the phpBB Group!
"If I have seen a little further it is by standing on the shoulders of Giants." - Isaac Newton
The Founder
Registered User
Posts: 24
Joined: Thu May 06, 2004 6:46 pm

Post by The Founder »

Thanks Adam... I tried that one last night and it didn't work I wound up getting parse errors and I gave up..... I am really looking for something as simple as:

else
{
$post_order = 'desc';
$post_time_order = 'DESC';
}


I just need it to realize that if it's forum ID 20 to do it in

else
{
$post_order = 'asc';
$post_time_order = 'ASC';
}
The Founder
Registered User
Posts: 24
Joined: Thu May 06, 2004 6:46 pm

Post by The Founder »

I guess I am dreaming about a easier mod (allittle worrried about that beta because it gave me a site full of parse errors)
The Founder
Registered User
Posts: 24
Joined: Thu May 06, 2004 6:46 pm

Post by The Founder »

does anyone have any ideas on this?

,..............begging...
User avatar
Drexion
Former Team Member
Posts: 8892
Joined: Sat Jan 25, 2003 9:54 pm
Location: City 17

Post by Drexion »

This is a quick fix you can try, it pretty much renders the sort buttons in forum 20 useless.
In viewtopic.php,

Right below

Code: Select all

else
{
	$post_order = 'asc';
	$post_time_order = 'ASC';
}
Add

Code: Select all

if ($forum_id == 20)
{
	$post_order = 'desc';
	$post_time_order = 'DESC';
	$post_time_order = "DESC";
}
This should work - I've tested it a bit, but not as much as I would like.
Backup the file before editing it.
edit: fixed code.
Last edited by Drexion on Sat Sep 11, 2004 4:25 am, edited 1 time in total.
The Founder
Registered User
Posts: 24
Joined: Thu May 06, 2004 6:46 pm

Post by The Founder »

It sort of worked... it did it for all the forums though.. not just 20

Anything else you guys think I can try?

Thanks for helping ...
The Founder
Registered User
Posts: 24
Joined: Thu May 06, 2004 6:46 pm

Post by The Founder »

Thanks for your help on this. I fixed the code. There was only one = sign so it assigned the variable rather than doing the if - then statement.

It needs two ( == ) in order to make the proper IF Then statement.


Right below

Code: Select all

else 
{ 
   $post_order = 'asc'; 
   $post_time_order = 'ASC'; 
} 
 
Add

Code: Select all


if ($forum_id == 20) 
{ 
   $post_order = 'desc'; 
   $post_time_order = 'DESC'; 
   $post_time_order = "DESC"; 
} 
User avatar
Drexion
Former Team Member
Posts: 8892
Joined: Sat Jan 25, 2003 9:54 pm
Location: City 17

Post by Drexion »

Dont know how I missed that :oops:
Thanks for the heads up.
Locked

Return to “2.0.x Support Forum”