Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

SmartyPaginate 1.6 released
Goto page Previous  1, 2, 3, 4
 
Post new topic   Reply to topic    Smarty Forum Index -> Add-ons
View previous topic :: View next topic  
Author Message
markbijl
Smarty n00b


Joined: 14 Jan 2011
Posts: 1

PostPosted: Fri Jan 14, 2011 12:05 pm    Post subject: When to expected new SmartyPaginate release? Reply with quote

Hi mohrt,

First of all my compliments for a very nice Smarty Plug-in! Due to coincidence I got in charge of maintaining and updating/upgrading a website that was built using Smarty. At that point in time it used there was no paging, which made the large tables an absolute mess to work with!

Now, with the SmartyPaginate and SmartyColumnSort plug-ins its pretty neat!

If I read the remarks on the forum correctly there were a few minor bugfixes and I was just curious to find out when we can expect a new release?

Cheers from the Netherlands,
Mark
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7361
Location: Lincoln Nebraska, USA

PostPosted: Fri Jan 14, 2011 2:49 pm    Post subject: Reply with quote

What isn't working?
Back to top
View user's profile Send private message Visit poster's website
Noramarth
Smarty n00b


Joined: 02 Nov 2011
Posts: 2

PostPosted: Wed Nov 02, 2011 11:26 pm    Post subject: Reply with quote

Ok so it looks like i'm in a bit of a ... dead zone. Here's the issue I'm using SmartyPaginate (ofc) and here's the error i get:

I really have no idea why the args array in the plugin handler is null ... which is actually the reason why the error is thrown (at least i think so).

Anyway, any help would be greatly appreciated.

Code:
Warning: Parameter 2 to smarty_function_paginate_first() expected to be a reference, value given in /sra/www/liquidflowclothing.com/classes/sysplugins/smarty_internal_plugin_handler.php on line 29 C


Here's the php code for the page:
Code:
require_once("config.php");
require('classes/stores.class.php');
require_once("classes/SmartyPaginate.class.php");
$storeHandler= new shops;
SmartyPaginate::connect();
SmartyPaginate::setLimit(6);
SmartyPaginate::assign($smarty,'paginate');
SmartyPaginate::setUrlVar('page');
function setPageTrunks($data)
{
   SmartyPaginate::setTotal(count($data));
   return array_slice($data, SmartyPaginate::getCurrentIndex(),SmartyPaginate::getLimit());
}
$allinfo=$storeHandler->storeActions('list',true);
$data=setPageTrunks($allinfo['information']);
$systeminfo=$allinfo['system'];
$pageName = basename($_SERVER["PHP_SELF"], ".php");
$smarty->assign('pageName',$pageName);
$smarty->assign('data',$data);
$smarty->assign('sysinfo',$systeminfo);
$smarty->display('stores.tpl');

$smarty is being instantiated in stores.class.php

and here's the TPL code (well part of it, the interesting one)
Code:
<tdcolspan="2">Displaying {$paginate.first}-{$paginate.last} out of {$paginate.total} total stores</td><td>{paginate_first}{paginate_middle}{paginate_last}</td>
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5052
Location: Hamburg / Germany

PostPosted: Thu Nov 03, 2011 12:02 pm    Post subject: Reply with quote

Smarty3 does no longer pass objects to plugins by reference as this is no longer required with PHP5.

Remove the '&' in the function paramter of the smarty_function_paginate_first plugin.
Back to top
View user's profile Send private message
Noramarth
Smarty n00b


Joined: 02 Nov 2011
Posts: 2

PostPosted: Thu Nov 03, 2011 4:53 pm    Post subject: Reply with quote

omg ... i had no idea about that ... thx a lot for the input!
Back to top
View user's profile Send private message
geoB
Smarty Regular


Joined: 09 Sep 2010
Posts: 46

PostPosted: Mon Nov 21, 2011 10:31 pm    Post subject: Smarty 3 modifications Reply with quote

U.Tews wrote:
Remove the '&' in the function parameter of the smarty_function_paginate_first plugin.

Are there any other modifications required for Smarty 3? Does the above include the '&' in each of the other functions?

Thnx.

George
Back to top
View user's profile Send private message
Omegatcu
Smarty n00b


Joined: 26 May 2010
Posts: 3

PostPosted: Thu Jun 21, 2012 1:22 pm    Post subject: Reply with quote

is this plugin still working with Smarty 3?
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7361
Location: Lincoln Nebraska, USA

PostPosted: Thu Jun 21, 2012 3:04 pm    Post subject: Reply with quote

Omegatcu wrote:
is this plugin still working with Smarty 3?


It should work, let me know if not.
Back to top
View user's profile Send private message Visit poster's website
floppydrivez
Smarty Rookie


Joined: 31 Mar 2008
Posts: 14

PostPosted: Fri Aug 10, 2012 1:33 am    Post subject: Reply with quote

I'm having trouble getting this to work with smarty 3. It's an old script that I just moved to smarty 3, but I think I got everything right.

It doesn't want to change pages.

Edit: scratch the above. For some reason caching is keeping it from changing pages.

Edit2:: Got caching working. Thanks for the excellent plugin btw.
Back to top
View user's profile Send private message
krone
Smarty Rookie


Joined: 17 Apr 2013
Posts: 6

PostPosted: Wed May 08, 2013 6:43 am    Post subject: Reply with quote

whenever i click on pagination link (nex, prev,...), it throws me on my main page? what is the problem?
Back to top
View user's profile Send private message
tdan
Smarty Rookie


Joined: 27 Mar 2015
Posts: 8

PostPosted: Sat May 02, 2015 11:07 am    Post subject: Mod for get[page] session Reply with quote

I propose an modification to smartypaginate. Sorry my english is bad.

Proposition de modification pour SmartyPaginate v1.6 pour conserver la session de l'URL $_GET['page'].
Raisons: GET['page'] ne se conserve pas quand on clique sur les liens de pagination.

A index.php en racine:
search:
Code:

// Gestion de Routing
if (isset($_GET['action']) && file_exists(_CTRL_.'action/'.str_replace('.', '', $_GET['action']).'.php'))
    include(_CTRL_.'action/'.$_GET['action'].'.php');


replace by:
Code:

// Gestion de Routing
if (isset($_GET['action']) && file_exists(_CTRL_.'action/'.str_replace('.', '', $_GET['action']).'.php')){
    $_SESSION['page'] = $_GET['page'];
    include(_CTRL_.'action/'.$_GET['action'].'.php');}


A function.paginate.first.php
search:
Code:

function smarty_function_paginate_first($params, &$smarty) {


to add after:
Code:

    $lapage = '&page='.$_SESSION['page'];


and search:
Code:

    return '<a href="' . str_replace('&','&amp;', $_url) . '"' . $_attrs . '>' . $_text . '</a>';


replace by:
Code:

    return '<a href="' . str_replace('&','&amp;', $_url) . $lapage . '"' . $_attrs . '>' . $_text . '</a>';


do the same for:
*_last.php :
Code:
return '<a href="' . str_replace('&','&amp;', $_url) . $lapage . $lapage . '"' . $_attrs . '>' . $_text . '</a>';

*_middle.php :
Code:
$_ret .= $_link_prefix . '<a href="' . str_replace('&', '&amp;', $_this_url) . $lapage . '"' . $_attrs . '>' . $_text . '</a>' . $_link_suffix;

*_next.php :
Code:
return $_show ? '<a href="' . str_replace('&','&amp;', $_url) . $lapage . '"' . $_attrs . '>' . $_text . '</a>' : '';

*_prev.php :
Code:
return $_show ? '<a href="' . str_replace('&','&amp;', $_url) . $lapage . '"' . $_attrs . '>' . $_text . '</a>' : '';


I only added: $lapage .

It works and if it can help someone
Back to top
View user's profile Send private message
hiteshb
Smarty Rookie


Joined: 10 Jul 2010
Posts: 11

PostPosted: Mon Aug 17, 2015 4:01 am    Post subject: Strict Standards: Non-static method SmartyPaginate::_getPrev Reply with quote

I am getting Strict Standard error in latest PHP 5.5.8 on Smarty 3.0

Below are full errors.

Code:
Strict Standards: Non-static method SmartyPaginate::_getPrevPageItem() should not be called statically in  system\libs\plugins\function.paginate_prev.php on line 67

 Strict Standards: Non-static method SmartyPaginate::_getNextPageItem() should not be called statically in  system\libs\plugins\function.paginate_next.php on line 67

 Strict Standards: Non-static method SmartyPaginate::getNextText() should not be called statically in system\libs\plugins\function.paginate_next.php on line 69
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Add-ons All times are GMT
Goto page Previous  1, 2, 3, 4
Page 4 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP