As was foretold, we've added advertisements to the forums! If you have questions, or if you encounter any bugs, please visit this thread: https://forums.penny-arcade.com/discussion/240191/forum-advertisement-faq-and-reports-thread/

Page browsing

JinniganJinnigan Registered User regular
So, currently, in long threads, the page system goes:

1,2,3...13,14,15...46,47,48

You can see how trying to get at a post in, say, the mid-30s might get annoying.

Would it be possible to have either a pagemark every ten pages:
1,2,3...10...13,14,15...20,30,40... 46,47,48 (or some similar notation)

or

A pulldown menu of all page numbers?

whatifihadnofriendsshortenedsiggy2.jpg
Jinnigan on

Posts

  • Munkus BeaverMunkus Beaver You don't have to attend every argument you are invited to. Philosophy: Stoicism. Politics: Democratic SocialistRegistered User, ClubPA regular
    edited October 2004
    Just multiply the page number you want by 50.

    Munkus Beaver on
    Humor can be dissected as a frog can, but dies in the process.
  • ÄlphämönkëyÄlphämönkëy Registered User regular
    edited October 2004
    Jinnigan wrote:
    So, currently, in long threads, the page system goes:

    1,2,3...13,14,15...46,47,48

    You can see how trying to get at a post in, say, the mid-30s might get annoying.

    Would it be possible to have either a pagemark every ten pages:
    1,2,3...10...13,14,15...20,30,40... 46,47,48 (or some similar notation)

    or

    A pulldown menu of all page numbers?
    Orthanc had a cool idea of a javascript popup that asked for what page you wanted, multiplied it by 50, and sent you there. I just dont have the time for it. If someone wants to sketch up some *good* javascript, I would implement it.

    Älphämönkëy on
  • DogDog Registered User, Administrator, Vanilla Staff admin
    edited October 2004
    At the top of viewtopic_body.tpl add:
    <script language="javascript">
    <!--
    function jump_to_page(string) {
    	document.location=string;
    }
    -->
    </script>
    

    In functions.php, replace the generate_pagination function with:
    function generate_pagination($base_url, $num_items, $per_page, $start_item, $add_prevnext_text = TRUE)
    {
    	global $lang;
    
    	$total_pages = ceil($num_items/$per_page);
    
    	if ( $total_pages == 1 )
    	{
    		return '';
    	}
    
    	$on_page = floor($start_item / $per_page) + 1;
    	
    	// Get topic
    	preg_match('/t=([0-9]+)/', $base_url, $topic_num);
    	
    	$page_string .= "Go to page: \n<select id=\"page\" onChange=\"jump_to_page(this.value);\">";
    		
    	for ($i = 1; $i <= $total_pages; $i++) {
    		$value = $i * $per_page - $per_page;
    		$page_string .= "<option value=\"viewtopic.php?t=$topic_num[1]&start=$value\"";
    		$page_string .= ($on_page == $i) ? ' selected' : '';
    		$page_string .= ">$i</option>\n";
    	}
    	
    	$page_string .= "</select>";
    	return $page_string;
    }
    

    That should make a drop down list of all available forum pages in place of the normal links. The current page should be selected and changing the menu should auto change pages, assuming JavaScript is enabled on the user's browser.

    Please note I have not tested this extensively, however I ran into no problems.

    Unknown User on
  • OrthancOrthanc Death Lite, Only 1 Calorie Off the end of the internet, just turn left.Registered User, ClubPA regular
    edited October 2004
    nyet. I have an extreme hatred of pages that require javascript for navigation. Something like that could be in addition to the existing navigation system. But it should not be the only one.

    Orthanc on
    orthanc
  • SmasherSmasher Starting to get dizzy Registered User regular
    edited October 2004
    Erm... isn't it 25 posts per page?

    Smasher on
  • DogDog Registered User, Administrator, Vanilla Staff admin
    edited October 2004
    Orthanc wrote:
    nyet. I have an extreme hatred of pages that require javascript for navigation. Something like that could be in addition to the existing navigation system. But it should not be the only one.

    Fine, keep the existing function, add a
    and tack on mine. That way you have the links AND the drop down function.

    Unknown User on
  • LordCrankLordCrank Registered User regular
    edited October 2004
    Orthanc wrote:
    nyet. I have an extreme hatred of pages that require javascript for navigation. Something like that could be in addition to the existing navigation system. But it should not be the only one.

    Fine, keep the existing function, add a
    and tack on mine. That way you have the links AND the drop down function.

    I don't have the forum software, but it looks like if you set up the dropdown box, you could have a 'go' button next to it that will send you to viewtopic.php, with the dropdown box being labeled 'start' instead of having it in the url. then at the start of viewtopic.php multiply start by 25 to get the first post that should be listed [I do believe it is 25, not 50], which would result in it displaying the proper page.

    ninja edit: subtract 25 at the end, otherwise it'll go an extra page

    LordCrank on
    woop woop
  • DogDog Registered User, Administrator, Vanilla Staff admin
    edited October 2004
    LordCrank wrote:
    Orthanc wrote:
    nyet. I have an extreme hatred of pages that require javascript for navigation. Something like that could be in addition to the existing navigation system. But it should not be the only one.

    Fine, keep the existing function, add a
    and tack on mine. That way you have the links AND the drop down function.

    I don't have the forum software, but it looks like if you set up the dropdown box, you could have a 'go' button next to it that will send you to viewtopic.php, with the dropdown box being labeled 'start' instead of having it in the url. then at the start of viewtopic.php multiply start by 25 to get the first post that should be listed [I do believe it is 25, not 50], which would result in it displaying the proper page.

    ninja edit: subtract 25 at the end, otherwise it'll go an extra page

    You could do it that way as well. Alpha mentioned javascript, so I did it in javascript. :)

    Unknown User on
  • OrthancOrthanc Death Lite, Only 1 Calorie Off the end of the internet, just turn left.Registered User, ClubPA regular
    edited November 2004
    you do know that you can actually have a differnet value submitted than the one that is displayed. IE, "Page 5" could actually submit 100.

    I still think this is a retarded idea, I'm just saying there is no reason to complicate things by adding yet another parameter to viewtopic

    Orthanc on
    orthanc
  • LaOsLaOs SaskatoonRegistered User regular
    edited November 2004
    But you must agree that something needs to be done, don't you? ;)

    LaOs on
  • OrthancOrthanc Death Lite, Only 1 Calorie Off the end of the internet, just turn left.Registered User, ClubPA regular
    edited November 2004
    LaOs wrote:
    But you must agree that something needs to be done, don't you? ;)

    No actually. In the rare situations I need to skip deep into threads, I find changing the url perfectly servicable.

    Orthanc on
    orthanc
  • LaOsLaOs SaskatoonRegistered User regular
    edited November 2004
    Somehow I predicted this ;)

    Oh well.

    LaOs on
  • FyreWulffFyreWulff YouRegistered User, ClubPA regular
    edited November 2004
    Except it's annoying as all hell, you stick in the mud.

    FyreWulff on
  • DogDog Registered User, Administrator, Vanilla Staff admin
    edited November 2004
    MY SOLUTION IS THE CORRECT ONE, YOU BASTARDS! ;)

    That said, the new version of phpBB is a LOT different (in terms of backend coding) than the current version, so I'm pretty sure Alpha is just holding off from making any changes (small as they may be) to the current code, as we'll be switching relatively soon.

    Unknown User on
  • Salvation122Salvation122 Registered User regular
    edited November 2004
    Real Life Forums has a mod that allows you to put the page number you want in a little box. Click go and it takes you there. Pure PHP, as far as I know, and theirs is set up so the box only displays when pages start getting cut out of the middle.

    Salvation122 on
Sign In or Register to comment.