Arrays giving out to little information
| From: | Eskil Kvalnes | Date: | Mon, 16 Sep 2002 19:13:15 +0000 |
| Subject: | Arrays giving out to little information | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-5979@lists.php.net to get a copy of this message | ||
Hey,
I have two arrays, one containing the news information and one containing
the number of comments
for each news-post. I use {section} to loop trough these arrays. But when
the comment count gets
above 9 comments (Two digits) it only prints out the first digit.
Like, if there's 14 comments, it prints out 1.
I've checked the commentsData-array and it says Array ( [0] => 14 [1] => 1
[2] => 4 [3] => 2 [4] => 6 )
Wich prints out: 1<br>1<br>4<br>2<br>6<br>
{section name=news
loop=$newsData}{$commentsData[news].commentsCount}{/section}
This is what I use to print out the number in the .tpl.htm files.
---------------
Sincerely,
Eskil Kvalnes
eskil@uten.net