Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 1 of 1

Thread: [PHP] Pagelink

  1. #1
    Member
    Join Date
    Nov 2002
    Location
    Elmira, NY
    Posts
    41
    Member #
    261
    I wanna relink my pages

    below is the actual page and the code i use

    http://www.neonsonline.com/gallery2.php

    this is the code i use for the pagelinks, it was given to me by someone else. and what i wanted at the time was 1 2 3 4 5 ... 66 67 68 69 70 (if my last page was 70. but this never worked from the beginning. i know how to make every page show up but its kinda long since i have like 75 pages in the gallery to date. and add about 5-10 images a day now so it will grow quick. so i have kinda changed my mind and was wondering if someone could help out. I have searched all over for help and cant get it. but what i want now is.

    if i had 70 pages
    1 ... 33 34 35 36 37... 70

    where it shows the first page, and 5 where they are browsing and the last page

    so if they were browsing page 35 then it would show page 35 and the 2 before and the 2 after and the center 5 numbers would move depending on where they were browsing.

    PHP Code:
    // Config //////////////////////////////////////
    $pages_at_front 5;
    $pages_frontback_sep "...";
    $pages_at_back 5;
    ////////////////////////////////////////////////

    echo "<center><table width='75%' cellpadding='5' cellspacing='0' class='main'>
    <tr><td width='25%' valign='top'>"
    ;

    if (
    $page != "1") {
    $prevpage $page 1;
    echo 
    "<a href='{$PHP_SELF}?page=$prevpage'>Prev. Page</a>";
    }

    echo 
    "</td><td width='50%' valign='top' align='center'>Pages:&nbsp;";

    $pagelink 1;
    $printed_sep 0;
    do {

    if(
    $pagelink <= $pages_at_front) {
    if (
    $page $pagelink) {
    echo 
    $pagelink "&nbsp;";
    }

    else {
    echo 
    "<a href='{$PHP_SELF}?page=$pagelink'>" $pagelink "</a>&nbsp;";
    }
    }

    elseif(
    $pagelink >= ($num_pages $pages_at_back)) {
    if(
    $printed_sep 0) {
    echo 
    $pages_frontback_sep;
    $printed_sep 1;
    }

    elseif (
    $page == $pagelink) {
    echo 
    $pagelink "&nbsp;";
    }

    else {
    echo 
    "<a href='{$PHP_SELF}?page=$pagelink'>" $pagelink "</a>&nbsp;";
    }
    }

    $pagelink $pagelink 1;
    } while (
    $pagelink <= $num_pages);

    echo 
    "</td><td width='25%'valign='top' align='right'>";

    if (
    $page != $num_pages) {
        
    $nextpage $page 1;
        echo 
    "<a href='{$PHP_SELF}?page=$nextpage'>Next Page</a>";
    }

    echo 
    "</td></tr></table></center>";


    // End link table 

  2.  


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 04:43 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com