Webmastersite.net
Register Log In

show image attachment

Comments on show image attachment

babrees
Expert

Usergroup: Customer
Joined: Aug 19, 2005
Location: England

Total Topics: 391
Total Comments: 1303
babrees
Posted Nov 20, 2005 - 1:17 AM:

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
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Nov 21, 2005 - 7:25 PM:

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.
babrees
Expert

Usergroup: Customer
Joined: Aug 19, 2005
Location: England

Total Topics: 391
Total Comments: 1303
babrees
Posted Nov 21, 2005 - 8:52 PM:

Paul wrote:
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...

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
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Nov 23, 2005 - 3:07 PM:

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.
damon
Member

Usergroup: Customer
Joined: Oct 14, 2005
Location: Singapore

Total Topics: 11
Total Comments: 31
damon
Posted Nov 24, 2005 - 6:28 AM:

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
babrees
Expert

Usergroup: Customer
Joined: Aug 19, 2005
Location: England

Total Topics: 391
Total Comments: 1303
babrees
Posted Nov 24, 2005 - 7:22 AM:

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!!!


Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.