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

smarty_function_pager examples?
Goto page Previous  1, 2
 
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 -> Plugins
View previous topic :: View next topic  
Author Message
Eistee
Smarty Rookie


Joined: 18 Jun 2004
Posts: 10

PostPosted: Tue Jun 29, 2004 11:28 pm    Post subject: Reply with quote

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 Sad
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 Wink

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 Sad

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
View user's profile Send private message
moreshwarsm
Smarty n00b


Joined: 18 Jun 2007
Posts: 1

PostPosted: Mon Jun 18, 2007 8:35 am    Post subject: Can we add "First" & "Last" link wit Reply with quote

I am using the same plug in

But
Can we add "First" and "Last" link with this pug in

Regards,
moreshwarsm
Back to top
View user's profile Send private message
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 -> Plugins All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
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