Trying to show an image attachment. The following is not working, can you tell me where I have gone wrong please (taken from manual)
<IF {LINKFILEFIELD}> <p align="center"> <!-- BEGIN LINK ATTACHMENTS --> <IF {ATTACHISIMAGE}><img scr="download.php?id={LINKID}"></IF> <!-- END LINK ATTACHMENTS --> </p> </IF>
Have tried various things, including <IF {ATTACHISIMAGE}><img scr="download.php?id={LINKID}&attachid={ATTACHID}"></IF> but just can't get it to work
Paul wrote: Your latter example within the attachment begin and end tags would be correct.
Perhaps it should work - but as I said it does not work. So please help me further I have now put it as that so it is...
<IF {LINKFILEFIELD}> <p align="center"> <!-- BEGIN LINK ATTACHMENTS --> <IF {ATTACHISIMAGE}><img scr="download.php?id={LINKID}&attachid={ATTACHID}></IF> <!-- END LINK ATTACHMENTS --> </p> </IF>
But even Dreamweaver has thrown up errors on that one, not liking the IF statement as though I have missed off a bracket or something
Well if you'd use the code tag I could tell if you are, but the 2; in your post is obviously not a proper closing tag. I'd presumed it was an artifact of wordwrap when not using code tags.
Also you've written "scr" multiple times in your posts, which isn't a valid html tag attribute, src is what's in the manual.
Reading that page I still can't find it. There's no "download.php?id={LINKID}" tag in there anywhere I can find, every tag/url there looks correctly formed.
Edit by Paul: The following is bad advice which can render your site inoperable by creating a duplicate function. The poster was probably using files from different versions or the like.
Hope this help. At your own risk!
Edit attachment.php in classes folder
After the code below : -
function iszip() { $e = strtolower(extension($this->filetitle)); $list = '|zip|'; if (strstr($list, "|$e|")) return '1'; else return '0'; }
Add: -
function isimage() { $e = strtolower(extension($this->filetitle)); $list = '|jpg|jpeg|gif|png|bmp|'; if (strstr($list, "|$e|")) return '1'; else return '0'; }
Thanks Damon but I have just got it working without altering the php file. I think it all had something to do with the fact that my db had gone screwy!!!
0/5
1
2
3
4
5
This thread is closed, so you cannot post a reply.
Comments on show image attachment
Expert
Usergroup: Customer
Joined: Aug 19, 2005
Location: England
Total Topics: 391
Total Comments: 1303
Trying to show an image attachment. The following is not working, can you tell me where I have gone wrong please (taken from manual)
<IF {LINKFILEFIELD}>
<p align="center">
<!-- BEGIN LINK ATTACHMENTS -->
<IF {ATTACHISIMAGE}><img scr="download.php?id={LINKID}"></IF>
<!-- END LINK ATTACHMENTS -->
</p>
</IF>
Have tried various things, including <IF {ATTACHISIMAGE}><img scr="download.php?id={LINKID}&attachid={ATTACHID}"></IF> but just can't get it to work
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
Where does the manual have that? If that's really in there I need to update it, but I can't find it in a search.
Your latter example within the attachment begin and end tags would be correct.
Expert
Usergroup: Customer
Joined: Aug 19, 2005
Location: England
Total Topics: 391
Total Comments: 1303
Where does the manual have that? If that's really in there I need to update it, but I can't find it in a search..
http://scripts.webmastersite.net/wsnlinks/wsnmanu...
Your latter example within the attachment begin and end tags would be correct.
Perhaps it should work - but as I said it does not work. So please help me further
I have now put it as that so it is...
<IF {LINKFILEFIELD}>
<p align="center">
<!-- BEGIN LINK ATTACHMENTS -->
<IF {ATTACHISIMAGE}><img scr="download.php?id={LINKID}&attachid={ATTACHID}></IF>
<!-- END LINK ATTACHMENTS -->
</p>
</IF>
But even Dreamweaver has thrown up errors on that one, not liking the IF statement as though I have missed off a bracket or something
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
Well if you'd use the code tag I could tell if you are, but the 2; in your post is obviously not a proper closing tag. I'd presumed it was an artifact of wordwrap when not using code tags.
Also you've written "scr" multiple times in your posts, which isn't a valid html tag attribute, src is what's in the manual.
http://scripts.webmastersite.net/wsnlinks/wsnmanu...
Reading that page I still can't find it. There's no "download.php?id={LINKID}" tag in there anywhere I can find, every tag/url there looks correctly formed.
Member
Usergroup: Customer
Joined: Oct 14, 2005
Location: Singapore
Total Topics: 11
Total Comments: 31
Edit by Paul: The following is bad advice which can render your site inoperable by creating a duplicate function. The poster was probably using files from different versions or the like.
Hope this help. At your own risk!
Edit attachment.php in classes folder
After the code below : -
function iszip()
{
$e = strtolower(extension($this->filetitle));
$list = '|zip|';
if (strstr($list, "|$e|")) return '1'; else return '0';
}
Add: -
function isimage()
{
$e = strtolower(extension($this->filetitle));
$list = '|jpg|jpeg|gif|png|bmp|';
if (strstr($list, "|$e|")) return '1'; else return '0';
}
Now ATTACHISIMAGE should work
Expert
Usergroup: Customer
Joined: Aug 19, 2005
Location: England
Total Topics: 391
Total Comments: 1303
Thanks Damon but I have just got it working without altering the php file. I think it all had something to do with the fact that my db had gone screwy!!!