|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
Eistee Smarty Rookie
Joined: 18 Jun 2004 Posts: 10
|
Posted: Tue Jun 29, 2004 11:28 pm Post subject: |
|
|
Though i'm a real noob to smarty, i'm trying to set up my homepage for this interesting template-engine.
I've got big trouble with this pager-function, as i've got no idea, how to to set it up right
I think it's best, i'll just post my source-code, so you yourself can easily get an overview, about what i've done so far.
First of all, my guestbook.php:
[php:1:e8fed253d2]
$sqlab = "SELECT * FROM guestbook ORDER BY id DESC";
$res = mysql_query($sqlab);
$totalRecords = mysql_num_rows($res);
$gb_entry = array();
while ($row = mysql_fetch_array($res))
{
...
...
...
$tmp = array(
'date'=>$date,
'time'=>$time,
'id'=>$row[id],
'name'=>$row[name],
'mail'=>$row[email],
'homepage'=>$row[homepage],
'icq'=>$row[icq],
'message'=>$message,
'totalRecords'=>$totalRecords
);
$gb_entry[] = $tmp;
}
$tpl_ct->assign('gb_entry', $gb_entry);
$tpl->assign_by_ref('ct', $tpl_ct->fetch('templates/gbrow.html'));
$tpl->display('templates/index.html');
[/php:1:e8fed253d2]
Now, the gbrow.html:
Code: |
...
...
...
{foreach item=row from=$gb_entry}
...
{$row.date}
{$row.name}
...
{$row.text}
...
{/foreach}
...
{pager rowcount=$gb_entry.totalRecords limit=1 shift=1 txt_first=$L_MORE class_num="fl" class_numon="fl" class_text="fl"}
|
"..." stands for some unimportant HTML/PHP-Code as you might have asumed yet
When i now request the guestbook-site, all entries are shown (nearly 100).
At the bottom of the page there is no output by the pager-plugin. No error-warning, just nothing
I would be very happe, if you could tell me what i've done wrong and show me the right way.
Thank you very much!
Philipp |
|
Back to top |
|
moreshwarsm Smarty n00b
Joined: 18 Jun 2007 Posts: 1
|
Posted: Mon Jun 18, 2007 8:35 am Post subject: Can we add "First" & "Last" link wit |
|
|
I am using the same plug in
But
Can we add "First" and "Last" link with this pug in
Regards,
moreshwarsm |
|
Back to top |
|
|
|
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
|