View previous topic :: View next topic |
Author |
Message |
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Wed Mar 09, 2005 3:38 pm Post subject: SmartyPaginate 1.3 released |
|
|
Main feature addition: you can now group your pagination links so only a segment of the total pages show up in the navigation.
1.3 March 9th, 2005
-------------------
* added HTML attribute passthru (monte)
* add pagination grouping limits (monte, Josef Whiter)
* fix bug in paginate_* UrlVar setting (Fernando_AndrX, monte)
* fix functions paginate_* urls to be XHTML compliant (kilburn, monte)
* add the assign() method and new {$paginate} vars to the README (monte) |
|
Back to top |
|
AjRap2 Smarty Rookie
Joined: 06 Nov 2004 Posts: 13
|
Posted: Thu Mar 10, 2005 1:17 am Post subject: |
|
|
This was on time lol. I was just coming to get 1.2 |
|
Back to top |
|
Jeremy- Smarty Rookie
Joined: 11 Feb 2005 Posts: 16
|
Posted: Fri Mar 11, 2005 12:19 am Post subject: |
|
|
Can the online doc PLEASE be edited to include a full MySQL query SmartyPaginate method demo? I know it's touched on a little bit, but I'd like to see a full block of code I could copy and paste, then edit for my needs. I'm just having a lot of trouble getting it to work for me at the moment and seeing it as it should be done would be the biggest help possible. Thanks |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Fri Mar 11, 2005 2:30 pm Post subject: |
|
|
I suppose an example could be put in there, although every DB implementation is different.
Under the IMPLEMENTATION section of the README, it spells out exactly what needs to happen in detail in the case you are using MySQL. |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Fri Mar 11, 2005 3:15 pm Post subject: |
|
|
Here is how you might write the get_db_results() function from the SYNOPSIS example using MySQL:
[php:1:3c905d4f4d]function get_db_results() {
$_link = mysql_connect('mysql_host', 'mysql_user', 'mysql_password'));
mysql_select_db('my_database');
$_query = sprintf("SELECT SQL_CALC_FOUND_ROWS * FROM my_table LIMIT %d,%d",
SmartyPaginate::getCurrentIndex(), SmartyPaginate::getLimit());
$_result = mysql_query($_query));
while ($_row = mysql_fetch_array($_result, MYSQL_ASSOC)) {
// collect each record into $_data
$_data[] = $_row;
}
// now we get the total number of records from the table
$_query = "SELECT FOUND_ROWS()";
$_result = mysql_query($_query));
$_row = mysql_fetch_array($_result, MYSQL_ASSOC);
SmartyPaginate::setTotal($_row['FOUND_ROWS']);
mysql_free_result($_result);
mysql_close($_link);
return $_data;
}[/php:1:3c905d4f4d] |
|
Back to top |
|
netnamues Smarty Rookie
Joined: 29 Dec 2004 Posts: 30
|
Posted: Fri Mar 11, 2005 3:38 pm Post subject: |
|
|
I'm getting this error:
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/modules/mod_orders.php on line 18
That line states:
SmartyPaginate::connect();
I'm getting an error like this for every SmartyPaginate:: that is in the code... any suggestions?
Btw, the output still works, i just get these errors before it. |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Fri Mar 11, 2005 7:29 pm Post subject: |
|
|
Are you passing the Smarty object?
$smarty = new Smarty;
SmartyPaginate::connect($smarty); |
|
Back to top |
|
netnamues Smarty Rookie
Joined: 29 Dec 2004 Posts: 30
|
Posted: Fri Mar 11, 2005 7:38 pm Post subject: |
|
|
Doing that actually printed out more errors...
Code:
Code: | SmartyPaginate::connect(); |
Output:
Quote: | Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/modules/mod_customers.php on line 17
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/includes/smarty/SmartyPaginate.class.php on line 51
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/modules/mod_customers.php on line 19
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/modules/mod_customers.php on line 21
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/modules/mod_customers.php on line 24
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/modules/mod_customers.php on line 24
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/modules/mod_customers.php on line 26
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/modules/mod_customers.php on line 38
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/includes/smarty/SmartyPaginate.class.php on line 238
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/includes/smarty/SmartyPaginate.class.php on line 239
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/includes/smarty/SmartyPaginate.class.php on line 240
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/includes/smarty/SmartyPaginate.class.php on line 223
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/includes/smarty/SmartyPaginate.class.php on line 224
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/includes/smarty/SmartyPaginate.class.php on line 225
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/includes/smarty/SmartyPaginate.class.php on line 241
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/includes/smarty/SmartyPaginate.class.php on line 223
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/includes/smarty/SmartyPaginate.class.php on line 224
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/includes/smarty/SmartyPaginate.class.php on line 225
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/includes/smarty/SmartyPaginate.class.php on line 241
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/includes/smarty/SmartyPaginate.class.php on line 242
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/includes/smarty/SmartyPaginate.class.php on line 242
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/includes/smarty/SmartyPaginate.class.php on line 244
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/includes/smarty/SmartyPaginate.class.php on line 245
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/includes/smarty/SmartyPaginate.class.php on line 246
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/includes/smarty/SmartyPaginate.class.php on line 247
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/includes/smarty/SmartyPaginate.class.php on line 248
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/includes/smarty/SmartyPaginate.class.php on line 249 |
Code:
Code: | SmartyPaginate::connect($smarty); |
Output:
Quote: | Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/modules/mod_customers.php on line 17
Warning: Illegal offset type in /home/mividdes/public_html/oms/includes/smarty/SmartyPaginate.class.php on line 43
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/includes/smarty/SmartyPaginate.class.php on line 44
Warning: Illegal offset type in /home/mividdes/public_html/oms/includes/smarty/SmartyPaginate.class.php on line 71
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/includes/smarty/SmartyPaginate.class.php on line 51
Warning: Illegal offset type in /home/mividdes/public_html/oms/includes/smarty/SmartyPaginate.class.php on line 148
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/modules/mod_customers.php on line 19
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/modules/mod_customers.php on line 21
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/modules/mod_customers.php on line 24
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/modules/mod_customers.php on line 24
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/modules/mod_customers.php on line 26
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/modules/mod_customers.php on line 38
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/includes/smarty/SmartyPaginate.class.php on line 238
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/includes/smarty/SmartyPaginate.class.php on line 239
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/includes/smarty/SmartyPaginate.class.php on line 240
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/includes/smarty/SmartyPaginate.class.php on line 223
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/includes/smarty/SmartyPaginate.class.php on line 224
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/includes/smarty/SmartyPaginate.class.php on line 225
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/includes/smarty/SmartyPaginate.class.php on line 241
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/includes/smarty/SmartyPaginate.class.php on line 223
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/includes/smarty/SmartyPaginate.class.php on line 224
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/includes/smarty/SmartyPaginate.class.php on line 225
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/includes/smarty/SmartyPaginate.class.php on line 241
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/includes/smarty/SmartyPaginate.class.php on line 242
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/includes/smarty/SmartyPaginate.class.php on line 242
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/includes/smarty/SmartyPaginate.class.php on line 244
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/includes/smarty/SmartyPaginate.class.php on line 245
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/includes/smarty/SmartyPaginate.class.php on line 246
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/includes/smarty/SmartyPaginate.class.php on line 247
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/includes/smarty/SmartyPaginate.class.php on line 248
Warning: Problem with method call - please report this bug in /home/mividdes/public_html/oms/includes/smarty/SmartyPaginate.class.php on line 249
OMS | [/code] |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Fri Mar 11, 2005 7:55 pm Post subject: |
|
|
I haven't seen that problem, although some google searching revealed this:
A bit more searching revealed that this was a problem with PHP 4 (to be
addressed in PHP 5) when calling classes statically. The solution? Add a @
on the front-end of the line and everything works fine.
So maybe apply an "@" in front of the static method call as a workaround? |
|
Back to top |
|
netnamues Smarty Rookie
Joined: 29 Dec 2004 Posts: 30
|
Posted: Fri Mar 11, 2005 7:58 pm Post subject: |
|
|
Ok... I promise I didn't do ANYTHING between now and when I posted last, but the error seemed to have cleared up.
If it appears again, I will try the @
Thanks for your help! |
|
Back to top |
|
netnamues Smarty Rookie
Joined: 29 Dec 2004 Posts: 30
|
Posted: Fri Mar 11, 2005 7:59 pm Post subject: |
|
|
Thanks also for a great add-on! |
|
Back to top |
|
jalefkowit Smarty n00b
Joined: 16 Mar 2005 Posts: 2 Location: Alexandria, VA
|
Posted: Wed Mar 16, 2005 11:13 am Post subject: page_limit not working? |
|
|
Hey --
first off, thanks for the great tool! It's a real timesaver.
I grabbed 1.3 and was excited to see the page_limit option on {paginate_middle}, since I was having a problem on a project I'm working on with the page #s running out of control and breaking my layout. This sounded like just the thing to solve the problem
However -- when I went into my template and changed
to
Code: | {paginate_middle page_limit="5"} |
... nothing happened. I still get the complete listing of pages spit out on the page. It doesn't seem to respect the page limit setting.
Is there another setting somewhere I have to tweak to enable page_limit? Or am I just missing something? (entirely possible )
Thanks!
-- Jason Lefkowitz |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Wed Mar 16, 2005 3:47 pm Post subject: |
|
|
Did you replace the page_middle plugin? |
|
Back to top |
|
jalefkowit Smarty n00b
Joined: 16 Mar 2005 Posts: 2 Location: Alexandria, VA
|
Posted: Wed Mar 16, 2005 6:47 pm Post subject: |
|
|
Oh, duh. No.
Excuse me while I go bang my head into the desk for a while |
|
Back to top |
|
oPT Smarty n00b
Joined: 27 Mar 2005 Posts: 2
|
Posted: Sun Mar 27, 2005 7:18 pm Post subject: prefix/suffix attribute for paginate_middle |
|
|
I'm looking at the paginate_middle function addon - and I don't see any prefix/suffix attribute for BEFORE the <a href=
Is that accurate?
I want to clean up the pages so there are spaces in between the links - that and create a [ <a href="">PageNumber</a> ] so the brackets don't actually have a link on them.
Am I missing something?
Thx,
oPT |
|
Back to top |
|
|