New Posts
Live Radio
Welcome guest, is this your first visit?
  • Login:
ChipSplit.com Affiliate Programs
+ Reply to Thread
Results 1 to 9 of 9
  1. #1
    Banned Myself
    Got a New Job See Below
     

    Add as a friend
    Join Date
    Nov 2008
    Location
    On The Run
    Posts
    983
    Feedback Score
    11 (100%)

    Default Php Page Display help

    Trouble figuring this one out. Trying to get in touch with guy who coded it but cant so asking your help here.

    Take a look t this page Poker News | Casino News | Gambling News | Online Gambling News | Online Poker | see how on the bottem it showing all 190 different news pages, I would like to change that to show only the next few such as Poker News | Online Poker News | PokerNews see how it shows 1-10 then it changes as you go to different pages such as 2-11 or 10-20. This is the code on the page on my site which controls the page showing display, can you let me know what i would need to change to fix it .

    Thanks

    <?
    if($page > 1){
    $prev = ($page - 1);
    echo "<a href=news.php?page=$prev class='yellow_link'>Previous</a> ";
    }
    for($i = 1; $i <= $total_pages; $i++){
    if(($page) == $i){
    echo "$i ";
    } else {
    echo "<a href=news.php?page=$i class='yellow_link'>$i</a> ";
    }
    }
    // Build Next Link
    if($page < $total_pages){
    $next = ($page + 1);
    echo "<a href=news.php?page=$next class='yellow_link'>Next</a>";
    }
    echo "</center>";
    ?>
    I swear to ( insert God name ) If i get screwed by one more program in the US facing gaming business im going to go work for the DOJ and Make sure your hit next

    USA Online Gamblers get the best Buzzluck Bonus Code. All USA Players Welcome. Not From the USA then check out a PartyCasino bonus code site, but if you want to play online poker and you don't live in the USA then get your Party Poker Bonus Code.

  2. #2
    Member
    My Status
     

    Add as a friend
    Join Date
    Jan 2009
    Location
    USA
    Posts
    36
    Feedback Score
    0

    Default

    Try adding single quotes around the URLs. You are already using single quotes on the "class" portion; try using them on the "href" part, too.

    Old way:

    echo "<a href=news.php?page=$prev class='yellow_link'>Previous</a> ";

    Try this instead:

    echo "<a href='news.php?page=$prev' class='yellow_link'>Previous</a> ";

  3. #3
    Banned Myself
    Got a New Job See Below
     

    Add as a friend
    Join Date
    Nov 2008
    Location
    On The Run
    Posts
    983
    Feedback Score
    11 (100%)

    Default

    Thanks for the look engineer.
    Think i have not explained myself correctly as I myself do not know what im talking about.

    After much searching found out this is called "pagenation"

    What im trying to do is just to show a range of news pages instead of all of them. So trying in the pages to show only current page and a few previous ones and a few future ones.

    What i think im trying to do is Set the number of page links to show on either side of the current page. Currently no matter what news page your on it shows all news page links.
    I swear to ( insert God name ) If i get screwed by one more program in the US facing gaming business im going to go work for the DOJ and Make sure your hit next

    USA Online Gamblers get the best Buzzluck Bonus Code. All USA Players Welcome. Not From the USA then check out a PartyCasino bonus code site, but if you want to play online poker and you don't live in the USA then get your Party Poker Bonus Code.

  4. #4
    Senior Member
    My Status
     

    Add as a friend
    Join Date
    Nov 2008
    Location
    Ireland
    Posts
    112
    Feedback Score
    10 (100%)

    Default

    How comfortable are you with changing the code? If you want you could look at the code on this link xxhttp://www.webmasterworld.com/php/3506050.htm which is pretty close to what you want, but might take a bit of messing around.

  5. #5
    Banned Myself
    Got a New Job See Below
     

    Add as a friend
    Join Date
    Nov 2008
    Location
    On The Run
    Posts
    983
    Feedback Score
    11 (100%)

    Default

    nah, dont want to mess around changing things. Thanks for the info i forgot about them, will post my question there,

    Thankyou.
    I swear to ( insert God name ) If i get screwed by one more program in the US facing gaming business im going to go work for the DOJ and Make sure your hit next

    USA Online Gamblers get the best Buzzluck Bonus Code. All USA Players Welcome. Not From the USA then check out a PartyCasino bonus code site, but if you want to play online poker and you don't live in the USA then get your Party Poker Bonus Code.

  6. #6
    #!/usr/bin/mikebrad
    My Status
     

    Add as a friend
    Join Date
    Nov 2008
    Location
    USA
    Posts
    697
    Feedback Score
    8 (100%)

    Default

    Your numbered pages are built using the "for" loop in the above code. I don't have access to your full code but I'm guessing some simple change to that line will make the difference.

    PHP Code:
    for($i $page-2$i <= $page+8$i++){ 
    To explain the way "for" loops work, there are 3 variables, usually expressed as ($i = beginning number; $i = ending number; $i = increment in counting).

    Your orginal code counted from 1 ($i = 1) to greater than or equal to the total number of pages ($i <= $total_pages) using increments of 1 ($i++).

    I changed it to count from current page - 2 pages ($i = $page-2) to greater than or equal to current page plus 8 pages ($i <= $page+8) using increments of 1 ($i++)

    My code is not going to be perfect but it may get you started in the right direction.

  7. #7
    Banned Myself
    Got a New Job See Below
     

    Add as a friend
    Join Date
    Nov 2008
    Location
    On The Run
    Posts
    983
    Feedback Score
    11 (100%)

    Default

    Mike, thanks that seems to work except for one problem. If your on page 1 or 2 When it reads the back pages it goes into the negative showing page numbers 0 and -1

    i changed the bold part to 10 and 10 , so if your on page 3 it shows 0 and -1 - -7

    Any way for it to not show before the first page?

    for($i = $page-2; $i <= $page+8; $i++){
    I swear to ( insert God name ) If i get screwed by one more program in the US facing gaming business im going to go work for the DOJ and Make sure your hit next

    USA Online Gamblers get the best Buzzluck Bonus Code. All USA Players Welcome. Not From the USA then check out a PartyCasino bonus code site, but if you want to play online poker and you don't live in the USA then get your Party Poker Bonus Code.

  8. #8
    #!/usr/bin/mikebrad
    My Status
     

    Add as a friend
    Join Date
    Nov 2008
    Location
    USA
    Posts
    697
    Feedback Score
    8 (100%)

    Default

    pm'd you

  9. #9
    Banned Myself
    Got a New Job See Below
     

    Add as a friend
    Join Date
    Nov 2008
    Location
    On The Run
    Posts
    983
    Feedback Score
    11 (100%)

    Default

    All Fixed, Thanks Mike
    I swear to ( insert God name ) If i get screwed by one more program in the US facing gaming business im going to go work for the DOJ and Make sure your hit next

    USA Online Gamblers get the best Buzzluck Bonus Code. All USA Players Welcome. Not From the USA then check out a PartyCasino bonus code site, but if you want to play online poker and you don't live in the USA then get your Party Poker Bonus Code.


 

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Wordpress Plugin to Display PAS Rakeback Offers
    By cprpoker in forum Wordpress - Web Design - Coding - Technical
    Replies: 17
    Last Post: 04-03-2010, 07:23 PM
  2. How much do you care about PageRank display?
    By pokerprop in forum General Poker Affiliate Forum
    Replies: 30
    Last Post: 10-22-2009, 10:40 AM
  3. How Can I Display This Better?
    By doovde in forum New Affiliate Questions & Answers
    Replies: 6
    Last Post: 10-17-2009, 05:03 AM
  4. Potential Suggestion - Rep Points Display
    By pokerprop in forum PAL Suggestions - Questions - Feedback
    Replies: 5
    Last Post: 12-24-2008, 03:40 PM
  5. Replies: 0
    Last Post: 11-27-2008, 05:12 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Powered by vBulletin® Version 4.1.5
Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.
SEO by vBSEO 3.6.0
Affiliate Program Consultant