View previous topic :: View next topic |
Author |
Message |
markbijl Smarty n00b
Joined: 14 Jan 2011 Posts: 1
|
Posted: Fri Jan 14, 2011 12:05 pm Post subject: When to expected new SmartyPaginate release? |
|
|
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 |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Fri Jan 14, 2011 2:49 pm Post subject: |
|
|
What isn't working? |
|
Back to top |
|
Noramarth Smarty n00b
Joined: 02 Nov 2011 Posts: 2
|
Posted: Wed Nov 02, 2011 11:26 pm Post subject: |
|
|
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 |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Thu Nov 03, 2011 12:02 pm Post subject: |
|
|
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 |
|
Noramarth Smarty n00b
Joined: 02 Nov 2011 Posts: 2
|
Posted: Thu Nov 03, 2011 4:53 pm Post subject: |
|
|
omg ... i had no idea about that ... thx a lot for the input! |
|
Back to top |
|
geoB Smarty Regular
Joined: 09 Sep 2010 Posts: 46
|
Posted: Mon Nov 21, 2011 10:31 pm Post subject: Smarty 3 modifications |
|
|
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 |
|
Omegatcu Smarty n00b
Joined: 26 May 2010 Posts: 3
|
Posted: Thu Jun 21, 2012 1:22 pm Post subject: |
|
|
is this plugin still working with Smarty 3? |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Thu Jun 21, 2012 3:04 pm Post subject: |
|
|
Omegatcu wrote: | is this plugin still working with Smarty 3? |
It should work, let me know if not. |
|
Back to top |
|
floppydrivez Smarty Rookie
Joined: 31 Mar 2008 Posts: 14
|
Posted: Fri Aug 10, 2012 1:33 am Post subject: |
|
|
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 |
|
krone Smarty Rookie
Joined: 17 Apr 2013 Posts: 6
|
Posted: Wed May 08, 2013 6:43 am Post subject: |
|
|
whenever i click on pagination link (nex, prev,...), it throws me on my main page? what is the problem? |
|
Back to top |
|
tdan Smarty Rookie
Joined: 27 Mar 2015 Posts: 8
|
Posted: Sat May 02, 2015 11:07 am Post subject: Mod for get[page] session |
|
|
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('&','&', $_url) . '"' . $_attrs . '>' . $_text . '</a>';
|
replace by:
Code: |
return '<a href="' . str_replace('&','&', $_url) . $lapage . '"' . $_attrs . '>' . $_text . '</a>';
|
do the same for:
*_last.php : Code: | return '<a href="' . str_replace('&','&', $_url) . $lapage . $lapage . '"' . $_attrs . '>' . $_text . '</a>'; |
*_middle.php : Code: | $_ret .= $_link_prefix . '<a href="' . str_replace('&', '&', $_this_url) . $lapage . '"' . $_attrs . '>' . $_text . '</a>' . $_link_suffix; |
*_next.php : Code: | return $_show ? '<a href="' . str_replace('&','&', $_url) . $lapage . '"' . $_attrs . '>' . $_text . '</a>' : ''; |
*_prev.php : Code: | return $_show ? '<a href="' . str_replace('&','&', $_url) . $lapage . '"' . $_attrs . '>' . $_text . '</a>' : ''; |
I only added: «$lapage .»
It works and if it can help someone |
|
Back to top |
|
hiteshb Smarty Rookie
Joined: 10 Jul 2010 Posts: 11
|
Posted: Mon Aug 17, 2015 4:01 am Post subject: Strict Standards: Non-static method SmartyPaginate::_getPrev |
|
|
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 |
|
|