phpBB2Refugees.com Logo
Not affiliated with or endorsed by the phpBB Group

Register •  Login 

Continue the legacy...

Welcome to all phpBB2 Refugees!Wave Smilie

This site is intended to continue support for the legacy 2.x line of the phpBB2 bulletin board package. If you are a fan of phpBB2, please, by all means register, post, and help us out by offering your suggestions. We are primarily a community and support network. Our secondary goal is to provide a phpBB2 MOD Author and Styles area.

Limiting the mod "Big Threads in One Page"


 
Search this topic... | Search MOD Requests... | Search Box
Register or Login to Post    Index » MOD Requests  Previous TopicPrint TopicNext Topic
Author Message
Holger
Board Member



Joined: 19 Jan 2009

Posts: 509
Location: Hanover


flag
PostPosted: 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


flag
PostPosted: 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


flag
PostPosted: 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


flag
PostPosted: 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


flag
PostPosted: 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.="&nbsp;<a href='".append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;start=all&amp;postdays=$post_days&amp;postorder=$post_order")."' style='text-decoration:none;'>".$lang['View_all_pages']."</a>";
    } else{$pagination="&nbsp;";}
};

#
#-----[ 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.="&nbsp;<a href='".append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;start=all&amp;postdays=$post_days&amp;postorder=$post_order")."' style='text-decoration:none;'>".$lang['View_all_pages']."</a>";
    } else{$pagination="&nbsp;";}
};


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 icon_smile.gif

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


flag
PostPosted: 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


flag
PostPosted: 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


flag
PostPosted: 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="&nbsp;";
    }

should be
Code:
    else
    {
       $pagination.="&nbsp;";
    }


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


flag
PostPosted: 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
Display posts from previous:   
Register or Login to Post    Index » MOD Requests  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT - 4 Hours
 
Jump to:  

Index • About • FAQ • Rules • Privacy • Search •  Register •  Login 
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.0542 seconds using 16 queries. (SQL 0.0091 Parse 0.0008 Other 0.0444)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo