WebmasterSite.net: PHP scripts to enable your creativity
WSN Links PHP Directory Software
PHP Scripts Webmaster Links Support Forums

Register | Forgot Password

Using thumbnail.php on static pages.
No thumbnail with ATTACH file uploads

Version: 3.15
printPrint


Page: 1 2

Using thumbnail.php on static pages.
hyperal2
Member

Usergroup: Customer
Joined: Apr 12, 2005
Total Topics: 3
Total Posts: 16
Posted 06/07/05 - 06:27 AM:
quote post
#1
I have created 5 new fields named LINKIMAGE1ATTACH to LINKIMAGE5ATTACH

The input form is working OK and the images upload OK as I have checked them via FTP.

On the static custom html_details template I have included the following code. I show just code for one image.

<table width="730" border="3" cellspacing="1" cellpadding="1" bordercolor="#66CC99" height="100%" align="center">
<tr>
<td valign="top" bgcolor="#FFFFFF" bordercolor="#009999" align="center">
<img src="http://www.webmastersite.net/forums/thumbnail.php?id={LINKID}&field=linkimage1attach&thumbwidth=200&thumbheight=200">
<br>{LINKIMAGETITLE5}
</td>
</tr>
</table>

The above code was pulled from the WSN Links Manual from chapter 'Custom File Attachment Fields'

The trouble is no image appears.

I have tried the above using CAPITALS for the field, but no luck

On the same template I have

<img src="http://www.webmastersite.net/forums/thumbnail.php?id={LINKID}">

And this works

So the paths to the attachments directory and thumbnail.php must be correct.

I have taken a look at thumbnail.php and have found the bit were

if ($field != '')
{
$parts = explode('[,]', $thelink->$field);
$thelink->filename = $parts[0];
$thelink->xwidth = $parts[3];
$thelink->yheight = $parts[4];
}

I just can't see what is wrong, but I am not a php coder.

Can anyone explain how I get a thumbnail displayed using an ATTACH file upload?

I would like add that despite this problem I am having, WSN Links is excellent no other links package comes anywhere close to it.

Thanks

Alastair
hyperal2
Member

Usergroup: Customer
Joined: Apr 12, 2005
Total Topics: 3
Total Posts: 16
Posted 06/08/05 - 08:50 AM:
quote post
#2
Has anyone implemented uploaded images within templates ie used attach files to display thumbnail images.

Could someone show me the code they used?

I thought the problem was with static pages only, but I'm also having the same problem on dynamic pages.

Any help/ideas would be appreciated as I need to get this resolved.

Is there another way of uploading images and displaying as thumnails

Thanks
mrowton
Forum Regular
Avatar

Usergroup: Customer
Joined: Feb 19, 2004
Location: Michigan
Total Topics: 59
Total Posts: 189

Last Blog:

Posted 06/08/05 - 12:04 PM:
quote post
#3
Here's what I'm using on the main page of my site, as well as a couple of different sites that I've done.

This checks to see if there is jpg or png attachment, if so then it displays the thumbnail and links it to the link comments page (library/{LINKID} for me.

<IF {LINKFILETITLE}>
<?php if (strstr("jpg png", extension("{LINKFILETITLE}"))) { ?>
<a href="http://www.webmastersite.net/forums/library/{LINKID}">
<img src="http://www.webmastersite.net/forums/thumbnail.php?id={LINKID}&thumbwidth=100&thumbheight=100" border="0" alt="{LINKTITLE}" class="image"></a> <?php } ?>
</IF>



http://www.packetsource.com/
Directory of Security Papers
hyperal2
Member

Usergroup: Customer
Joined: Apr 12, 2005
Total Topics: 3
Total Posts: 16
Posted 06/08/05 - 12:40 PM:
quote post
#4
Thanks for your input on this.

I have already used that command, but if you want to post multiple images under a single LINKID you have to use use the file upload which creates a field with ATTACH added to the field name. This field name is then suppose to tell thumbnails where to pick up the file, still can't get it to work.

I have followed the instructions at http://scripts.webmastersite.net/wsnlinks/wsnmanu...

Anyone else with any ideas?
Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 57
Total Posts: 6316
Posted 06/09/05 - 06:50 AM:
quote post
#5
Go to the url of the dead image and tack &debug=1 onto it to get the debug info.

"Do things you love doing, because then it ain't work. Don't do something you don't really enjoy, because you're never going to work hard enough at it." - Bob Young, founder of Red Hat
hyperal2
Member

Usergroup: Customer
Joined: Apr 12, 2005
Total Topics: 3
Total Posts: 16
Posted 06/09/05 - 07:35 AM:
quote post
#6
Hi Paul,

OK done that. I am also in debug mode, if you could take a quick look at

http://www.bedsaway.co.uk/scotland/link12.htm

Hope you can see all the info. I note a few errors in there but am not sure what's caused them.

Not sure what I have done but since this morning the <img src="http://www.webmastersite.net/forums/thumbnail.php?id={LINKID}"> command has stopped working as well.

I attach the html_details.tpl file

Thanks for any advice/help.

Attached Files:
html_details.tpl
(16 KB, 29 downloads)
hyperal2
Member

Usergroup: Customer
Joined: Apr 12, 2005
Total Topics: 3
Total Posts: 16
Posted 06/09/05 - 12:57 PM:
quote post
#7
Things are going rapidly down hill for me.

I noticed that one of the warnings in the above link was at line 123 in prestart.php. To do IE6 cookies

So I thought I may resolve it if I deleted my cookies. Now I cant log in, my username/password is not recognised and even when I have received a new password via E-mail I can't get in. This is using both FireFox and IE6. I have spent weeks putting plans together for this site and now this.

Is the password username stored in the database?

What are the cookies used for?

:confused:
Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 57
Total Posts: 6316
Posted 06/10/05 - 09:56 AM:
quote post
#8
Read the manual, header warnings simply mean you're in debug mode. Also read the manual entry "Can't get into admin panel."

Anyhow, that wasn't the debug of the thumbnail. I'll take a wild guess and suppose it's http://www.bedsaway.co.uk/scotland/thumbnail.php?... . That indicates a file path problem, usrlocalbintemplates. Sounds like slashes were removed. Either add them back in in your admin panel settings->system config or add them to config.php: http://scripts.webmastersite.net/wsnlinks/wsnmanu...

"Do things you love doing, because then it ain't work. Don't do something you don't really enjoy, because you're never going to work hard enough at it." - Bob Young, founder of Red Hat
hyperal2
Member

Usergroup: Customer
Joined: Apr 12, 2005
Total Topics: 3
Total Posts: 16
Posted 06/12/05 - 08:43 AM:
quote post
#9
Added the required info to the config file ie

$dirurl = 'http://www.bedsaway.co.uk/scotland';
$uploadpath = '/content/DesignerPlus/b/e/www.bedsaway.co.uk/web/scotland/attachments/';
?>

Also checked the path in the admin panel configuration setup and this is correct

Noticed that I had a closing back slash for the path to my ImageMagic, your sample does not so I removed my back slash and this resolved the <img src="http://www.webmastersite.net/forums/thumbnail.php?id={LINKID}"> problem.

but still can't get <img src="http://www.webmastersite.net/forums/thumbnail.php?id={LINKID}&field=linkimage3attach&thumbwidth=200&thumbheight=200&debug=1"> to work either in the dynamic template detail.tpl or the custom template html_details used to create the static pages.

Do the image commands above look correct?

The images have uploaded into the attachment directory OK, so this suggests the paths are correct, well certainly for upload.

How do I pickup the debug=1 info from the above?

I note the thumbnails have to be created and are stored in the attachment folder. These have not been created.

Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 57
Total Posts: 6316
Posted 06/12/05 - 09:16 AM:
quote post
#10
http://www.bedsaway.co.uk/scotland/thumbnail.php?...

simply says it can't do a thumbnail (probably because it can't find the file) and you don't have a nothumbnail.png file to use in place.

http://www.bedsaway.co.uk/scotland/thumbnail.php?... on the other hand works.

"Do things you love doing, because then it ain't work. Don't do something you don't really enjoy, because you're never going to work hard enough at it." - Bob Young, founder of Red Hat
Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 57
Total Posts: 6316
Posted 06/12/05 - 09:24 AM:
quote post
#11
I'll add some more useful debug output to it. Use the attached file.

Edit: I see you're using 3.15, best to upgrade to 3.16 as well so that we're using the same files.

Edited by Paul on 06/12/05 - 09:27 AM

Attached Files:
thumbnail.php
(3 KB, 27 downloads)

"Do things you love doing, because then it ain't work. Don't do something you don't really enjoy, because you're never going to work hard enough at it." - Bob Young, founder of Red Hat
hyperal2
Member

Usergroup: Customer
Joined: Apr 12, 2005
Total Topics: 3
Total Posts: 16
Posted 07/21/05 - 03:32 AM:
quote post
#12
Hi Paul,

Sorry for the long delay getting back, I have been away from the office.

I have upgraded to 3.16 and uploaded your debug copy of thumbnail.php, I have also created a nothumbnail.png file.

If you could take a another look that would be great.

Regards

Al
Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 57
Total Posts: 6316
Posted 07/24/05 - 12:37 PM:
quote post
#13
Field is linkimage3attach, which contains for our id #12


It says there's no content in linkimage3attach for that link.

If there's no reason these images need to be treated as distinct you'd be better of with 3.20 anyway instead of using custom fields.

"Do things you love doing, because then it ain't work. Don't do something you don't really enjoy, because you're never going to work hard enough at it." - Bob Young, founder of Red Hat
hyperal2
Member

Usergroup: Customer
Joined: Apr 12, 2005
Total Topics: 3
Total Posts: 16
Posted 08/06/05 - 02:27 PM:
quote post
#14
Hi Paul,

I've done a complete new install of v 3.22

I want members to be able to upload 5 images and display them as thumbnails, when they click on any of the thumbnails they see a larger image.

My attempts with earlier versions failed.

With the new version at http://www.bedsaway.co.uk/s/ I have created 3 new fields for file upload, these are LINKPIC1ATTACH , LINKPIC2ATTACH , LINKPIC3ATTACH

So far when I have inserted {LINKPIC1ATTACH} in the Link Details default template is just see the the following appear bf1145f7f4b8bc503951eb8f35341c74.wsn[,]18th.jpg[,]0[,]384[,] or such like. I just can't get any images even though it is clear that the attachments directory path is correct.

With this new version file are being created in the attachments directory with the ending .wsn, what are these files and where are the actual images stored.

Could you please supply the code to display field {LINKPIC1ATTACH} as a thumbnail and as a full size image?

Or can WSN LINKS not do this with uploaded image attachments?

I also have a licence for WSN Gallery, can I do what I require within that?

But then I will have to integrate the two and I hit problems when I attempted to do that as well, that is why I've kept going along with just using WSN Links.

Thanks for your help.

Alastair

Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 57
Total Posts: 6316
Posted 08/07/05 - 03:03 PM:
quote post
#15
With 3.22 there's no real sense in using custom link attachments. Why not simply allow people to upload 5 files by setting the usergroup permission for the normal file option?

As for file attachments, go to admin panel -> settings -> files. There you can select if you want to keep the original file extension or -- as it defaults to -- remove those in favor of .wsn.

WSN Gallery does of course have the default code in the templates to show any number of images per submission. But again that's with the normal field, custom fields always involve custom work.

As for the code to show custom attachments, if you do want to keep using custom fields, please read the manual entry as that's what it's there for: http://scripts.webmastersite.net/wsnlinks/wsnmanu...

"Do things you love doing, because then it ain't work. Don't do something you don't really enjoy, because you're never going to work hard enough at it." - Bob Young, founder of Red Hat
Search thread for
Download thread as

Page: 1 2



You don't have permission to post.

Please login or register.

   
 
© 2008 Paul Knierim. All rights reserved.