Plugin Directory

Changeset 201728


Ignore:
Timestamp:
02/04/2010 09:55:37 AM (16 years ago)
Author:
are79
Message:

Pagination of the paypal data

Location:
are-paypal/trunk
Files:
6 added
3 edited

Legend:

Unmodified
Added
Removed
  • are-paypal/trunk/are-paypal.php

    r201172 r201728  
    44Plugin URI: http://arepaypal.ehibou.com/
    55Description: This plugin is used to monetize wordpress blog content using PayPal.
    6 Version: 1.7.2
     6Version: 1.7.3
    77Author: Aurimas Norkevicius
    88Author URI: http://are.ehibou.com
     
    2828include_once (dirname ( __FILE__ ) . "/are-paypal-templates.php");
    2929require (dirname ( __FILE__ ) . "/smarty/Smarty.class.php");
     30require (dirname ( __FILE__ ) . "/smarty/SmartyPaginate.class.php");
    3031if (! class_exists ( 'Are_PayPal' )) {
    3132    class Are_PayPal {
     
    111112            register_activation_hook ( __FILE__, array (&$install, 'install' ) );
    112113            $this->set_templates ();
    113             $this->smarty = new Smarty ( );
     114            $this->smarty =& new Smarty;
    114115            $this->smarty->template_dir = dirname ( __FILE__ ) . "/templates/";
    115116            $this->smarty->compile_dir = dirname ( __FILE__ ) . "/cache/";
     
    489490                }
    490491            }
     492            SmartyPaginate::connect();
     493            SmartyPaginate::setLimit(25);
     494            SmartyPaginate::setUrl('admin.php?page=Are_PayPal_PaypalData');
     495
     496            SmartyPaginate::setTotal(count($data));
     497           
     498            $chunked_data = array_chunk($data,SmartyPaginate::getLimit(),true);
     499           
     500            $pageNumber=SmartyPaginate::getCurrentIndex()/SmartyPaginate::getLimit();
     501            $pageNumber=floor($pageNumber);
     502           
     503            echo SmartyPaginate::getCurrentItem();
     504            echo " / ";
     505            echo SmartyPaginate::getLimit();
     506            echo " = ";
     507            echo $pageNumber;
     508
     509            $data=$chunked_data[$pageNumber];
    491510           
    492511            $this->smarty->assign ( 'PageHeader', __ ('View Payments') );
    493512            $this->smarty->assign ( 'Data', $data);
     513            SmartyPaginate::assign($this->smarty);
     514
    494515            $this->smarty->display ( 'view_payments.tpl' );
    495516        }
  • are-paypal/trunk/readme.txt

    r201172 r201728  
    55Requires at least: 2.0.2
    66Tested up to: 2.9.1
    7 Stable tag: 1.7.2
     7Stable tag: 1.7.3
    88
    99This plugin is used to monetize wordpress blog content using PayPal. It is designed to sell your knowledge.
  • are-paypal/trunk/templates/view_payments.tpl

    r186232 r201728  
    11<div class="wrap">
    22    <h2>{$PageHeader}</h2>
     3    Items {$paginate.first}-{$paginate.last} out of {$paginate.total} displayed.
    34    <table width="100%" border="0" cellspacing="3" cellpadding="3">
    45        {foreach from=$Data item=rq key=k name=data_props}
     
    5253        {/foreach}
    5354    </table>
     55    {paginate_prev} {paginate_middle} {paginate_next}
    5456</div>
     57
     58
Note: See TracChangeset for help on using the changeset viewer.