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

need help with this one...

 
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 -> General
View previous topic :: View next topic  
Author Message
Gregor
Smarty Rookie


Joined: 13 Jul 2003
Posts: 10

PostPosted: Sun Jul 13, 2003 7:08 pm    Post subject: need help with this one... Reply with quote

index.php

Code:

// some code here

$moderator_edit = "<a href='edit.php?postid={\$posts[i].id}'>Edit post</a>";

// more code here


$smarty->assign('moderator_edit', $moderator_edit);

$smarty->display('showposts.tpl');



showposts.tpl

Code:

    {section name=i loop=$posts}
     
      <!-- here is then some html and smarty code for showing posts, for example: -->

       {$posts[i].title}<br /><br />
       {$posts[i].text}


       <!-- HERE I PUT THAT VARIABLE, CREATED IN PHP FILE -->
       {$moderator_edit}

    {/section}



result, only for that moderator link:

[url=http://p2p.dotproject.org/ed2k/edited2k.php?linkid={$ed2k_links[i].id}]Edit post[/url]

so,.. anyone know, how should i parse or put that link in php file, so smarty could recognize it right?

thanks for ansers!
Back to top
View user's profile Send private message
messju
Administrator


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

PostPosted: Sun Jul 13, 2003 9:15 pm    Post subject: Reply with quote

http://smarty.php.net/manual/en/language.function.eval.php
Back to top
View user's profile Send private message Send e-mail Visit poster's website
AZTEK
Smarty Pro


Joined: 16 Apr 2003
Posts: 235
Location: Purdue University

PostPosted: Sun Jul 13, 2003 9:15 pm    Post subject: Reply with quote

http://smarty.php.net/manual/en/language.function.eval.php

rofl I posted like seconds after messju
_________________
"Imagine a school with children that can read and write, but with teachers who cannot, and you have a metaphor of the Information Age in which we live." -Peter Cochrane
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: Sun Jul 13, 2003 9:27 pm    Post subject: Reply with quote

@Aztek: and i hit "post reply" at http://www.phpinsider.com/smarty-forum/viewtopic.php?p=3180#3180 just to realize in the topic review, that you posted the answer seconds ago Smile
Back to top
View user's profile Send private message Send e-mail 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 -> General 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