Wordpress Plugin Pagination Help...

Discussion in 'Coding Help' started by Mole, Dec 4, 2011.

  1. Mole

    Mole New Member

    There is pagination on a Wordpress plugin I'm using and I not getting any response from the writer.

    Basically I just want to find out how to display the pagination like this:
    < 1 2 3 4 ... 20 >

    It would be great if anyone could help. Thanks in advance.

    Here is the code:
    PHP:
    $pr get_option('frp_rpp'); // rows per page
        
    $page = isset($_GET['page']) ? (int) $_GET['page'] : 1;

        
    // BEGIN PAGINATION HEAD
        
    if($competition != '')
            
    $pages implode(mysql_fetch_assoc(mysql_query("SELECT COUNT(*) FROM `$tbl_match` WHERE DATE_ADD(matchdate, INTERVAL matchtime HOUR_SECOND) <= NOW() AND competitionyear = '$year' AND competition = '$competition' ORDER BY matchdate DESC")));
        if(
    $competition == '')
            
    $pages implode(mysql_fetch_assoc(mysql_query("SELECT COUNT(*) FROM `$tbl_match` WHERE DATE_ADD(matchdate, INTERVAL matchtime HOUR_SECOND) <= NOW() AND competitionyear = '$year' ORDER BY matchdate DESC")));

        
    $pages ceil($pages/$pr);

        
    $querystring '';
        foreach(
    $_GET as $key => $value) {
            if(
    $key != "page"$querystring .= "$key=$value&amp;";
        }
        
    // END PAGINATION HEAD

        // BEGIN PAGINATION DISPLAY
        // TODO: CHECK FOR MORE THAN 1 PAGE
        
    if($pages 1) {
            
    $display .= '<p class="pagination"><strong>Results:</strong> ';
            for(
    $i 1$i <= $pages$i++) {
                
    $display .= '<a '.($i == $page 'class="selected" ' '');
                
    $display .= "href=\"?{$querystring}page=$i";
                
    $display .= '">'.$i.'</a> ';
            }
            
    $display .= '</p>';
        }
        
    // END PAGINATION DISPLAY

     
  2. mneylon

    mneylon Administrator Staff Member

    How is it outputting them at the moment?
     
  3. Mole

    Mole New Member

    It just outputs all the numbers, without Previous or Next buttons or limit to the amount of numbers displayed.
    Results: 1 2 3 4 5 6 7 8 9 10
     
  4. Mole

    Mole New Member

    Can anyone help me with this?

    Site is due to go live in the next couple of days and would like to get this sorted. Thanks.
     
  5. paul

    paul Ninja

  6. Mole

    Mole New Member

    Problem is, that the pagination I need to change is in a plugin... Otherwise I would use a pagination one.
     
  7. Mole

    Mole New Member

    Can anyone help me with this?
     
  8. paul

    paul Ninja

    Are you looking to hire some one ?
     
  9. Mole

    Mole New Member

    No. This forum is called 'Coding Help'. I didn't expect to have to pay anyone.
     
  10. paul

    paul Ninja

    Fair enough. It was just that you've been asking for the last 3 months.

    Best of luck !
     
  11. Mole

    Mole New Member

    I had someone help on here before. I don't think what I'm asking would take much time, it's just my PHP knowledge is limited.
     

Share This Page