[Trouble] Template + Plugin SQL
Posted: Thu Dec 08, 2005 1:14 am
Hi everyone, i need your precious help 
for my website, i needed to add a field in the MySQL Database, so i add the field "image_path" in the table "cms_module_news". This field contains the image's path link to the news posted on my website.
I also made a plugin called "get_imagepath" :
I also made a news template and here is my problem
Why??? we can not a "{...}" method in an another "{...}" ?? If not, how can i make this happens?
The {get_imagepath fileid='5'} works fine but not {get_imagepath fileid='{$entry->id}'}. WHY NOT?
i hope you can help me out.
thx, alex

for my website, i needed to add a field in the MySQL Database, so i add the field "image_path" in the table "cms_module_news". This field contains the image's path link to the news posted on my website.
I also made a plugin called "get_imagepath" :
the plug'in works !!!!Execute($query);
if ($dbresult && $dbresult->RowCount() > 0) {
$row = $dbresult->FetchRow();
echo $row['image_path'];
}
}
function smarty_cms_help_function_get_imagepath() {
?>
What does this do?
Displays the picture linked to your news.
How do I use it?
Just insert the tag into your page like: {get_imagepath fileid=""}
What parameters does it take?
fileid - the news id from the MySQL Database
Author: Alexandre Falaise afalaise@intechinfo.fr
Version: 1.0
Change History:
1.0 - Initial release
I also made a news template and here is my problem
As you can see above, i used the "get_imagepath method" but the '{$entry->id}' do NOT work in it.{if $entry->id}
id}'}" align="left" width="114" height="90"/>
{/if}
Why??? we can not a "{...}" method in an another "{...}" ?? If not, how can i make this happens?
The {get_imagepath fileid='5'} works fine but not {get_imagepath fileid='{$entry->id}'}. WHY NOT?
i hope you can help me out.
thx, alex