Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

{section} pukes if more than 999 elements

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Bugs
View previous topic :: View next topic  
Author Message
kevin_traas
Smarty n00b


Joined: 30 Jul 2004
Posts: 2
Location: BC, Canada

PostPosted: Fri Jul 30, 2004 8:23 pm    Post subject: {section} pukes if more than 999 elements Reply with quote

Running Smarty 2.6.3 on PHP 4.3.8 (Debian Sid).

If the array I pass to section (loop=$myarray) contains 1000 or more elements (count($myarray) >= 1000), only the first array element for every 1000 elements in the array will be displayed.

For instance, if I have 1000-1999 elements in the array, Smarty will display only element #1. If I have 2000-2999 elements in the array, Smarty will only display elements #1 and #2. (I'm not sure about "and so on..." as I've only tested this far.)

As expected, if I have 1-999 elements in the array, Smarty will display them all correctly as expected.


Oh, and yes, I have my (good) reasons for displaying that many elements on one page... Wink
_________________
Regards,
Kevin Traas
Back to top
View user's profile Send private message Visit poster's website
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Fri Jul 30, 2004 9:08 pm    Post subject: Reply with quote

you must be doing something seriously wrong.

[section loop=100000 name=j}{$smarty.section.j.index}
{/section}

dumps all numbers requested for me.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kevin_traas
Smarty n00b


Joined: 30 Jul 2004
Posts: 2
Location: BC, Canada

PostPosted: Fri Jul 30, 2004 10:43 pm    Post subject: Reply with quote

Thanks for the (quick) reply!

The code I'm using is as follows:

{section name=id loop=$files}
<TR bgcolor="{cycle values="#DDDDDD, #CCCCCC"}">
<TD>{$filename[id]}</TD>
<TD align=right>{$filesize[id]}</TD>
<TD>{$filedate[id]}</TD>
</TR>
{/section}

$files is an integer, $file[name|size|date] are arrays.
_________________
Regards,
Kevin Traas
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Bugs All times are GMT
Page 1 of 1

 
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