UBB.Dev
Posted By: Simkin Closed topics to bottom - 03/19/2002 1:27 PM
Is it possible to auto move all closed topics to the bottom of the page?
Would be very nice laugh

If this function is already implemented, please ignore this suggestion.
Posted By: Zombie Re: Closed topics to bottom - 03/04/2005 12:01 AM
Has this been done ? Any News ?
Posted By: Ian Spence Re: Closed topics to bottom - 03/04/2005 1:10 AM
this has not been done, but I'm gonna give it a shot now
Posted By: Ian Spence Re: Closed topics to bottom - 03/04/2005 2:01 AM
In ubb_forum.cgi
FIND:

Code
	my($had_stickies, $had_polls, $had_hots, $had_moves, $had_locks) = (0, 0, 0, 0, 0);
ADD BEFORE/ABOVE:

Code
	my $bonus_html = "";
my $is_bonus = 0;
FIND:
Code
		next unless($one && ($one =~ m/^d{6}$/));
undef($hot_icon);
ADD AFTER:
Code
$is_bonus = 0;
FIND:
Code
			$had_locks++;
$closed = 'X';
ADD AFTER:
Code
			$is_bonus = 1;
FIND:
Code
		$ThisHTML .= &topic_row;
REPLACE WITH:
Code
		if($is_bonus > 0)
{
$bonus_html .= &topic_row;
} else {
$ThisHTML .= &topic_row;
}
FIND:
Code
	$ThisHTML .= &page_bottom($had_stickies, $had_polls, $had_hots, $had_moves, $had_locks);
ADD BEFORE:
Code
$ThisHTML .= $bonus_html;
Then clear the forum page cache
Posted By: 1QuickSI Re: Closed topics to bottom - 03/04/2005 4:03 AM
Could this be made a selectable option (top/bottom) on a per forum basis via the ACP?
Posted By: Ian Spence Re: Closed topics to bottom - 03/04/2005 4:10 AM
already built in. if you want a closed topic to appear at the topic, sticky it
Posted By: 1QuickSI Re: Closed topics to bottom - 03/04/2005 5:38 AM
OK I get it, I am confusing closed with sticky tipsy

I was looking for a way to make a sticky an option to be either at the top or bottom selectable by forum.

Not sure what I was thinking when I read this...
Posted By: 1QuickSI Re: Closed topics to bottom - 03/04/2005 5:40 AM
BTW if anyone is using this make sure you place an underscore between any ones missing from

$is bonus
$bonus html

They should be
$is_bonus
$bonus_html

Else you will get erros wink
Posted By: Ian Spence Re: Closed topics to bottom - 03/04/2005 7:45 PM
updated my code to add those wink tipsy
Posted By: Zombie Re: Closed topics to bottom - 04/19/2005 11:16 PM
this works great on a per-page basis for me. BUT ... can we make all of the closed topics go to the bottom ? I am using a forum as a to-do list , and when a topic has been solved, we close it. I would like the open topics (all of them) to be at the top.

Any Ideas ?
Posted By: Zombie Re: Closed topics to bottom - 04/19/2005 11:18 PM
What would be really cool is to have a display option to not show the closed topics at all

wink
Posted By: Gizmo Re: Closed topics to bottom - 04/20/2005 2:57 PM
Quote
Originally posted by Zombie:

What would be really cool is to have a display option to not show the closed topics at all

wink
There is one, it's called delete wink
Posted By: Ian Spence Re: Closed topics to bottom - 04/20/2005 3:57 PM
you aren't getting a UI, but if you just don't do the last step from my earlier post, you'll get the desired results
© UBB.Developers