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.

Reverse Pagination on Viewforum??

Goto page 1, 2  Next
 
Search this topic... | Search phpBB2 Discussion... | Search Box
Register or Login to Post    Index » phpBB2 Discussion  Previous TopicPrint TopicNext Topic
Author Message
JLA
Board Member



Joined: 30 Apr 2009

Posts: 451
Location: U.S.A


flag
PostPosted: Wed Nov 14, 2012 3:30 pm 
Post subject: Reverse Pagination on Viewforum??

Anybody have the code to change the pagination on view forum from higher to lower instead of lower to higher?

Should lead to better indexing since topics will always remain on same page.

_________________
http://www.jlaforums.com
Back to top
Jim_UK
Board Member



Joined: 19 Nov 2008

Posts: 656
Location: North West UK


flag
PostPosted: Wed Nov 14, 2012 5:42 pm 
Post subject: Re: Reverse Pagination on Viewforum??

I have this at line 429 but of course depending on mods added yours might be different
Code:
   ORDER BY t.topic_type DESC, t.topic_last_post_id DESC


Have you tried turning the DESCending to ASCending ?

Jim
Back to top
JLA
Board Member



Joined: 30 Apr 2009

Posts: 451
Location: U.S.A


flag
PostPosted: Wed Nov 14, 2012 8:42 pm 
Post subject: Re: Reverse Pagination on Viewforum??

Jim_UK wrote:
I have this at line 429 but of course depending on mods added yours might be different
Code:
   ORDER BY t.topic_type DESC, t.topic_last_post_id DESC


Have you tried turning the DESCending to ASCending ?

Jim


We are wanting to keep same topic display on viewforum (newest topics 1st). We just want the highest page numbers assigned to the newest topics. So when you look at the navigation on view forum you would see

1306, 1305, 1304, ... 3, 2, 1 Next

1, 2, 3, ... 1304, 1305, 1306 Next

By doing this, topics would always remain on the same page number regardless of any new topics added to a forum. Anybody have any thoughts about this idea???

_________________
http://www.jlaforums.com
Back to top
Dog Cow
Board Member



Joined: 18 Nov 2008

Posts: 378


flag
PostPosted: Thu Nov 15, 2012 4:32 pm 
Post subject: Re: Reverse Pagination on Viewforum??

JLA wrote:

By doing this, topics would always remain on the same page number regardless of any new topics added to a forum. Anybody have any thoughts about this idea???

Change the generate_pagination() function in /includes/functions.php

This is from the block for if a topic or forum has 10 or fewer pages.
Code:

   else
   {
      for($i = 1; $i < $total_pages + 1; $i++)
      {
         $page_string .= ( $i == $on_page ) ? '<b>' . $i . '</b>' : '<a href="' . append_sid($base_url . "&amp;start=" . ( ( $i - 1 ) * $per_page ) ) . '">' . $i . '</a>';
         if ( $i <  $total_pages )
         {
            $page_string .= ', ';
         }
      }
   }


try changing this to:

Code:

   else
   {
      for($i = 1; $i < $total_pages + 1; $i++)
      {
         $page_string .= ( $i == $on_page ) ? '<b>' . $i . '</b>' : '<a href="' . append_sid($base_url . "&amp;start=" . ( ( $i - 1 ) * $per_page ) ) . '">' . ($total_pages + 1 - $i) . '</a>';
         if ( $i <  $total_pages )
         {
            $page_string .= ', ';
         }
      }
   }


Changing the rest of the function is left as an exercise for the reader. icon_smile.gif

_________________
Moof!
Lincoln's Tomb, Oak Ridge Cemetery, Springfield ILMac 512K BlogMac GUI
Back to top
drathbun
Board Member



Joined: 24 Jul 2008

Posts: 729
Location: Texas


flag
PostPosted: Thu Nov 15, 2012 5:48 pm 
Post subject: Re: Reverse Pagination on Viewforum??

JLA wrote:
By doing this, topics would always remain on the same page number regardless of any new topics added to a forum.

But they won't. If you take the oldest topic on the board and add a new post, it moves to the "first" page, whether that's number 1 or 1306. Or maybe I'm missing your point... icon_confused.gif

_________________
phpBBDoctor Blog
Back to top
JLA
Board Member



Joined: 30 Apr 2009

Posts: 451
Location: U.S.A


flag
PostPosted: Thu Nov 15, 2012 8:20 pm 
Post subject: Re: Reverse Pagination on Viewforum??

drathbun wrote:
JLA wrote:
By doing this, topics would always remain on the same page number regardless of any new topics added to a forum.

But they won't. If you take the oldest topic on the board and add a new post, it moves to the "first" page, whether that's number 1 or 1306. Or maybe I'm missing your point... icon_confused.gif


Ok, each forum now is displayed with the newest topics 1st (unless an older topic has had a reply) going backwards. As more topics are added to a forum section, the topics are moved down each page. So today a topic that has no replies might be on page 1 and then tomorrow on page 2, etc etc etc

By reversing the pagination (not the topic display order) each new page with that days new topics will be the next highest page number and topics without replies will always stay on the page number at which they appear (if they have no further replies)

_________________
http://www.jlaforums.com
Back to top
Holger
Board Member



Joined: 19 Jan 2009

Posts: 509
Location: Hanover


flag
PostPosted: Fri Nov 16, 2012 3:22 pm 
Post subject: Re: Reverse Pagination on Viewforum??

When visiting your forums I get

You appear to be in violation of our Terms Of Service.
Your request to view this site has been denied.

Please check to verify that you are not:
Using a device that is infected with a virus or other malware
Using an Anonymizer or Proxy Service
Using an out of date web browser
Using a posting agent
Using Opera

error number 0859



I am using Chrome ...

_________________
Love your data! Back it up!
Back to top
JLA
Board Member



Joined: 30 Apr 2009

Posts: 451
Location: U.S.A


flag
PostPosted: Fri Nov 16, 2012 4:38 pm 
Post subject: Re: Reverse Pagination on Viewforum??

Holger wrote:
When visiting your forums I get

You appear to be in violation of our Terms Of Service.
Your request to view this site has been denied.

Please check to verify that you are not:
Using a device that is infected with a virus or other malware
Using an Anonymizer or Proxy Service
Using an out of date web browser
Using a posting agent
Using Opera

error number 0859



I am using Chrome ...

Sorry - probably block area if not one of the other things

There was a previous discussion on this here awhile back

_________________
http://www.jlaforums.com
Back to top
dogs and things
Board Member



Joined: 18 Nov 2008

Posts: 628
Location: Spain


flag
PostPosted: Sat Nov 17, 2012 2:08 am 
Post subject: Re: Reverse Pagination on Viewforum??

I am blocked too, since a very long time, I told you this when it first happened. Nothing changed.
_________________
phpBB2 will never die, I hope!
Back to top
JLA
Board Member



Joined: 30 Apr 2009

Posts: 451
Location: U.S.A


flag
PostPosted: Sat Nov 17, 2012 4:16 am 
Post subject: Re: Reverse Pagination on Viewforum??

dogs and things wrote:
I am blocked too, since a very long time, I told you this when it first happened. Nothing changed.


Sorry - not much we can do

_________________
http://www.jlaforums.com
Back to top
StarWolf3000
Board Member



Joined: 10 Jun 2010

Posts: 175
Location: Germany


flag
PostPosted: Sat Nov 17, 2012 6:34 am 
Post subject: Re: Reverse Pagination on Viewforum??

Holger wrote:
When visiting your forums I get

You appear to be in violation of our Terms Of Service.
Your request to view this site has been denied.

Please check to verify that you are not:
Using a device that is infected with a virus or other malware
Using an Anonymizer or Proxy Service
Using an out of date web browser
Using a posting agent
Using Opera

error number 0859



I am using Chrome ...

If I read this, then my question is: Why do you block Opera users? I neither use a device that is infected, an anonymizer/proxy service, out of date web browser nor a posting agent, simply an Opera. I also get an error if I visit it with Firefox or Chrome (IE is out of the question).
Back to top
dogs and things
Board Member



Joined: 18 Nov 2008

Posts: 628
Location: Spain


flag
PostPosted: Sat Nov 17, 2012 8:21 am 
Post subject: Re: Reverse Pagination on Viewforum??

JLA wrote:
dogs and things wrote:
I am blocked too, since a very long time, I told you this when it first happened. Nothing changed.


Sorry - not much we can do

Seems pretty strange to me, but I guess you have your reasons to block people that are interested in visiting your site.

_________________
phpBB2 will never die, I hope!
Back to top
JLA
Board Member



Joined: 30 Apr 2009

Posts: 451
Location: U.S.A


flag
PostPosted: Sat Nov 17, 2012 8:13 pm 
Post subject: Re: Reverse Pagination on Viewforum??

You can't even begin to imagine.

Again - sorry for the trouble!

_________________
http://www.jlaforums.com
Back to top
JLA
Board Member



Joined: 30 Apr 2009

Posts: 451
Location: U.S.A


flag
PostPosted: Mon Nov 19, 2012 11:56 pm 
Post subject: Re: Reverse Pagination on Viewforum??

Dog Cow wrote:
JLA wrote:

By doing this, topics would always remain on the same page number regardless of any new topics added to a forum. Anybody have any thoughts about this idea???

Change the generate_pagination() function in /includes/functions.php

This is from the block for if a topic or forum has 10 or fewer pages.
Code:

   else
   {
      for($i = 1; $i < $total_pages + 1; $i++)
      {
         $page_string .= ( $i == $on_page ) ? '<b>' . $i . '</b>' : '<a href="' . append_sid($base_url . "&amp;start=" . ( ( $i - 1 ) * $per_page ) ) . '">' . $i . '</a>';
         if ( $i <  $total_pages )
         {
            $page_string .= ', ';
         }
      }
   }


try changing this to:

Code:

   else
   {
      for($i = 1; $i < $total_pages + 1; $i++)
      {
         $page_string .= ( $i == $on_page ) ? '<b>' . $i . '</b>' : '<a href="' . append_sid($base_url . "&amp;start=" . ( ( $i - 1 ) * $per_page ) ) . '">' . ($total_pages + 1 - $i) . '</a>';
         if ( $i <  $total_pages )
         {
            $page_string .= ', ';
         }
      }
   }


Changing the rest of the function is left as an exercise for the reader. icon_smile.gif


Thanks for that. Was able to get everything with the exception of a manual page input box we have for forums with more than 100 pages

Code:
$input_box = '<input type="text" size="7" value="'.$on_page.'" onKeyPress="var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode; if ( keyCode == 13 ) { var page_no = parseInt(this.value, 10); if ( !isNaN(page_no) && page_no <= '.$total_pages.' && page_no > 0) { var start = String((page_no - 1)*'.$per_page.'); window.location.href = \'' . append_sid($base_url . '&amp;start=\'+start+\'') . '\'; return false;} else { this.value = '.$on_page.'; return false;} }" />&nbsp;<br> ';


Tried a couple variations but still showing the original page number in this box???

_________________
http://www.jlaforums.com
Back to top
JLA
Board Member



Joined: 30 Apr 2009

Posts: 451
Location: U.S.A


flag
PostPosted: Tue Dec 04, 2012 2:45 pm 
Post subject: Re: Reverse Pagination on Viewforum??

JLA wrote:
Dog Cow wrote:
JLA wrote:

By doing this, topics would always remain on the same page number regardless of any new topics added to a forum. Anybody have any thoughts about this idea???

Change the generate_pagination() function in /includes/functions.php

This is from the block for if a topic or forum has 10 or fewer pages.
Code:

   else
   {
      for($i = 1; $i < $total_pages + 1; $i++)
      {
         $page_string .= ( $i == $on_page ) ? '<b>' . $i . '</b>' : '<a href="' . append_sid($base_url . "&amp;start=" . ( ( $i - 1 ) * $per_page ) ) . '">' . $i . '</a>';
         if ( $i <  $total_pages )
         {
            $page_string .= ', ';
         }
      }
   }


try changing this to:

Code:

   else
   {
      for($i = 1; $i < $total_pages + 1; $i++)
      {
         $page_string .= ( $i == $on_page ) ? '<b>' . $i . '</b>' : '<a href="' . append_sid($base_url . "&amp;start=" . ( ( $i - 1 ) * $per_page ) ) . '">' . ($total_pages + 1 - $i) . '</a>';
         if ( $i <  $total_pages )
         {
            $page_string .= ', ';
         }
      }
   }


Changing the rest of the function is left as an exercise for the reader. icon_smile.gif


Thanks for that. Was able to get everything with the exception of a manual page input box we have for forums with more than 100 pages

Code:
$input_box = '<input type="text" size="7" value="'.$on_page.'" onKeyPress="var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode; if ( keyCode == 13 ) { var page_no = parseInt(this.value, 10); if ( !isNaN(page_no) && page_no <= '.$total_pages.' && page_no > 0) { var start = String((page_no - 1)*'.$per_page.'); window.location.href = \'' . append_sid($base_url . '&amp;start=\'+start+\'') . '\'; return false;} else { this.value = '.$on_page.'; return false;} }" />&nbsp;<br> ';


Tried a couple variations but still showing the original page number in this box???


Any ideas???

_________________
http://www.jlaforums.com
Back to top
Display posts from previous:   
Register or Login to Post    Index » phpBB2 Discussion  Previous TopicPrint TopicNext Topic
Page 1 of 2 All times are GMT - 4 Hours
Goto page 1, 2  Next
 
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.0858 seconds using 17 queries. (SQL 0.0111 Parse 0.0012 Other 0.0736)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo