Author |
Message |
Holger Board Member
Joined: 19 Jan 2009
Posts: 509 Location: Hanover
|
Posted: Thu May 20, 2010 2:47 am Post subject: Limiting the mod "Big Threads in One Page" |
|
|
Hi,
I am using this one:
http://www.phpbbhacks.com/download/3444
But I would like to hide the link if there are more then a certain amount of pages.
Is that possible?
Thanks!
/Holger |
|
Back to top |
|
|
Holger Board Member
Joined: 19 Jan 2009
Posts: 509 Location: Hanover
|
Posted: Wed Jun 02, 2010 4:08 am Post subject: Re: Limiting the mod "Big Threads in One Page" |
|
|
Nobody?
When there are more then 10 pages the normal pagination should be shown. Without "all". |
|
Back to top |
|
|
Salvatos Board Member
Joined: 19 Feb 2009
Posts: 449 Location: Québec
|
Posted: Wed Jun 02, 2010 11:33 am Post subject: Re: Limiting the mod "Big Threads in One Page" |
|
|
Can you post a screenshot of the MOD in action? If it's what I think, it shouldn't be too hard. |
|
Back to top |
|
|
Holger Board Member
Joined: 19 Jan 2009
Posts: 509 Location: Hanover
|
Posted: Wed Jun 02, 2010 1:42 pm Post subject: Re: Limiting the mod "Big Threads in One Page" |
|
|
I have modified the mod, so it does not look like the one above.
Basically it looks like this:
previous 1,2,3,...,55,56,57 next [all]
When clicking on "all" I get all posts on one LONG page, without pagination.
But, that is not good if the topic has several hundred pages.
So I want to hide the "all"-link if there are more then a certain amount of replies or pages. |
|
Back to top |
|
|
Salvatos Board Member
Joined: 19 Feb 2009
Posts: 449 Location: Québec
|
Posted: Wed Jun 02, 2010 6:24 pm Post subject: Re: Limiting the mod "Big Threads in One Page" |
|
|
Okay. According to the MOD,
Code: | #-----[ OPEN ]------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]-------------------------------------
#
if(!empty($pagination)) {
$pagination.=" <a href='".append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&start=all&postdays=$post_days&postorder=$post_order")."' style='text-decoration:none;'>".$lang['View_all_pages']."</a>";
} else{$pagination=" ";}
};
#
#-----[ BEFORE, ADD ]-------------------------------------
#
$total_pages = ceil($total_replies/$board_config['posts_per_page']);
#
#-----[ FIND ]-------------------------------------
#
if(!empty($pagination)) {
#
#-----[ REPLACE WITH ]-------------------------------------
#
if(!empty($pagination) && $total_pages <= 100) {
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
# |
should give you something like this
Code: | $total_pages = ceil($total_replies/$board_config['posts_per_page']);
if(!empty($pagination) && $total_pages <= 100) {
$pagination.=" <a href='".append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&start=all&postdays=$post_days&postorder=$post_order")."' style='text-decoration:none;'>".$lang['View_all_pages']."</a>";
} else{$pagination=" ";}
}; |
which I think should do the trick. You're gonna have to fix the indentation, and change 100 to the amount of pages you want to set as the limit after which "all" stops appearing.
If that doesn't work, please show me your viewtopic.php and describe the problem. And of course, remember to back up your files before trying this
Edit: By the way, this will not disable the function if someone inserts "&start=all" into the URL themselves, it just removes the link from the pagination. |
|
Back to top |
|
|
Holger Board Member
Joined: 19 Jan 2009
Posts: 509 Location: Hanover
|
Posted: Thu Jun 03, 2010 2:39 am Post subject: Re: Limiting the mod "Big Threads in One Page" |
|
|
Ok, this is what I am looking for! I will test your solution! Thank you! |
|
Back to top |
|
|
Holger Board Member
Joined: 19 Jan 2009
Posts: 509 Location: Hanover
|
Posted: Thu Jun 03, 2010 8:55 am Post subject: Re: Limiting the mod "Big Threads in One Page" |
|
|
Hm, with your suggested code change the pagination is hidden completely when over 100 pages. |
|
Back to top |
|
|
Holger Board Member
Joined: 19 Jan 2009
Posts: 509 Location: Hanover
|
Posted: Thu Jun 03, 2010 9:07 am Post subject: Re: Limiting the mod "Big Threads in One Page" |
|
|
I found the problem.
Code: | else
{
$pagination=" ";
} |
should be
Code: | else
{
$pagination.=" ";
} |
Notice that tiny little dot!
I also managed to restrict it on viewforum-level. |
|
Back to top |
|
|
Salvatos Board Member
Joined: 19 Feb 2009
Posts: 449 Location: Québec
|
Posted: Thu Jun 03, 2010 12:31 pm Post subject: Re: Limiting the mod "Big Threads in One Page" |
|
|
Oh, that makes sense. I just assumed it was there ^^ |
|
Back to top |
|
|
|