Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2006-08-28 11:36:54
- mikkeX
- Archived Plugin Author
- Registered: 2004-02-26
- Posts: 74
article_image URL?
Just now I can not figure out how to get just the url for the article_image… Anybody would like to help me on this?
plugin, php code etc.
Offline
Re: article_image URL?
Untested, but should work:
<txp:php>
global $thisarticle,$img_dir;
$theimage = ($thisarticle['article_image']) ? $thisarticle['article_image'] : '';
if ($theimage) {
$rs = safe_row("*",'txp_image',"id='$theimage'");
if ($rs) {
extract($rs);
return hu.$img_dir.'/'.$id.$ext;
}
}
</txp:php>
Offline
Re: article_image URL?
How about this?
<txp:php>
global $thisarticle, $img_dir;
$image = ($thisarticle['article_image'])
? $thisarticle['article_image'] : '';
if ($image && is_numeric($image)) {
$rs = safe_row('*', 'txp_image', "id = '$image'");
if ($rs)
echo hu.$img_dir.'/'.$rs['id'].$rs['ext'];
}
</txp:php>
There might be a plugin which returns just the url, I’m not sure.
Offline
Re: article_image URL?
I’m too slow… lol
Offline
Re: article_image URL?
funny :D
Offline
#6 2006-08-28 16:23:49
- mikkeX
- Archived Plugin Author
- Registered: 2004-02-26
- Posts: 74
Re: article_image URL?
Thanks, both of you :)
It worked exactly like I wanted.
Offline
Pages: 1