Plugin Directory

Changeset 397471


Ignore:
Timestamp:
06/15/2011 12:41:22 PM (15 years ago)
Author:
pantsonhead
Message:

v0.2.8 2011-06-15

  • Fixed pagination issues on admin page.
Location:
randomtext/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • randomtext/trunk/randomtext.php

    r393494 r397471  
    55Plugin URI: http://www.pantsonhead.com/wordpress/randomtext/
    66Description: A widget to display randomized text on your site
    7 Version: 0.2.7
     7Version: 0.2.8
    88Author: Greg Jackson
    99Author URI: http://www.pantsonhead.com
  • randomtext/trunk/randomtext_admin.php

    r393494 r397471  
    6969    $author = array();
    7070   
    71     $lastitem = $startrow+count($rows);
    72    
    73    
    74     // Make pagination links
    75     if($startrow) {
    76         if($paged > 1) {
    77             $paging = '<a href="'.$pageURL.$page_params.'&paged='.($paged-1).'" class="prev page-numbers">&laquo;</a>';
    78             if($lastitem == $totalrows)
    79                 $paging .= '<a href="'.$pageURL.$page_params.'&paged='.($paged-2).'" class="page-numbers">'.($paged-2).'</a> ';
    80             $paging .= '<a href="'.$pageURL.$page_params.'&paged='.($paged-1).'" class="page-numbers">'.($paged-1).'</a>
    81                 <span class="page-numbers current">'.$paged.'</span> ';
    82         }
    83     }
    84     if($lastitem < $totalrows) {
    85         if($paged==1)
    86             $paging = '<span class="page-numbers current">1</span>
    87             <a href="'.$pageURL.$page_params.'&paged=2" class="page-numbers">2</a>
    88             <a href="'.$pageURL.$page_params.'&paged=3" class="page-numbers">3</a>
    89             <a href="'.$pageURL.$page_params.'&paged=2" class="next page-numbers">&raquo;</a>';
    90         else
    91             $paging .=  '<a href="'.$pageURL.$page_params.'&paged='.($paged+1).'" class="page-numbers">'.($paged+1).'</a>
    92             <a href="'.$pageURL.$page_params.'&paged='.($paged+1).'" class="next page-numbers">&raquo;</a>';
    93     }
    94    
    95     $item_range = $lastitem<2 ? $lastitem : ($startrow+1).'-'.$lastitem;
    96     $paging = '';
     71    $num_pages = 1+floor($totalrows/$perpage);
     72   
     73    $paging = paginate_links( array(
     74        'base' => add_query_arg( 'paged', '%#%' ),
     75        'format' => '',
     76        'prev_text' => __('&laquo;'),
     77        'next_text' => __('&raquo;'),
     78        'total' => $num_pages,
     79        'current' => $paged
     80        ));
     81
    9782    ?>
    9883<div class="wrap">
  • randomtext/trunk/readme.txt

    r393494 r397471  
    3535Yes, you can use [randomtext] or [randomtext category="funny"] or even [randomtext category="funny" random="1"].
    3636
     37= What about template tags? =
     38
     39You can use something like this, where 'category' is the group you wish to select items from.
     40< ?php randomtext('category'); ?>
     41
    3742
    3843== Changelog ==
     44
     45= v0.2.8 2011-06-15 =
     46
     47* Fixed pagination issues on admin page.
    3948
    4049= v0.2.7 2011-06-05 =
Note: See TracChangeset for help on using the changeset viewer.