Gossamer Forum
Home : Products : Links 2.0 : Customization :

Re: [LILHOMIE] Here's a working image upload mod!

Quote Reply
Re: [LILHOMIE] Here's a working image upload mod! In reply to
I was working on this last night on a fresh install, testing functions. I have it uploading the pictures fine, but so far not adding the link ID to the upload, which is supposed to go infront of the underscore. Have ideas for that, working on it...

Using the code I posted recently, these changes/additions need to be made:


  • Create the pics directory in you html/www directory, where the photos are uploaded to.
  • Add a field to any existing entries in links.db, by adding a pipe | to the end of each entry.
  • Change the form action in add.html template to <form action="<%db_cgi_url%>/add.cgi" enctype="multipart/form-data" method="post">
  • Replace template.pm with updated version so you can use conditional statement in your template.
  • Put this in link.html template to call the picture: <%if Image_1%><br/><img src="<%upload_url%>/<%Image_1%>" alt="<%Title%>" />
    <%endif%>
  • Add this to globals in site_html_template.pl: upload_url => $upload_url,
  • Add ths to site_html_link in same file: Image_1 => $image_1,

That's all I can think of right now. Do all that, see if you get the uploader to work for you at all. I'll look at adding the ID to the file (makes it easy to know which pic goes with which link), and if this works for you, there will be more changes in success/error pages, etc to make it all flow. Can work on the delete option, too, but remove it for now, it just complicates things.

Note, copy the large code chunk added to add.cgi from the attachement, as it will be formatted correctly, copying it from the thread results in a mess... Make sure no comments # are blocking needed code...


Leonard
aka PerlFlunkie
Subject Author Views Date
Thread Here's a working image upload mod! PerlFlunkie 22246 Feb 17, 2005, 9:55 PM
Thread Re: [PerlFlunkie] Here's a working image upload mod!
PerlFlunkie 21885 Feb 17, 2005, 11:11 PM
Thread Re: [PerlFlunkie] Here's a working image upload mod!
jayman 21616 Nov 4, 2005, 5:57 AM
Thread Re: [jayman] Here's a working image upload mod!
PerlFlunkie 21626 Nov 4, 2005, 2:40 PM
Thread Re: Here's a working image upload mod!
LILHOMIE 20956 Nov 8, 2009, 4:50 PM
Post Re: [LILHOMIE] Here's a working image upload mod!
LILHOMIE 20951 Nov 8, 2009, 7:50 PM
Thread Re: [LILHOMIE] Here's a working image upload mod!
PerlFlunkie 20972 Nov 8, 2009, 8:01 PM
Post Re: [PerlFlunkie] Here's a working image upload mod!
LILHOMIE 20978 Nov 8, 2009, 9:13 PM
Thread Re: [PerlFlunkie] Here's a working image upload mod!
LILHOMIE 21007 Nov 8, 2009, 10:16 PM
Thread Re: [LILHOMIE] Here's a working image upload mod!
PerlFlunkie 20942 Nov 9, 2009, 9:50 AM
Thread Re: [PerlFlunkie] Here's a working image upload mod!
LILHOMIE 20887 Nov 11, 2009, 6:53 AM
Thread Re: [LILHOMIE] Here's a working image upload mod!
PerlFlunkie 20877 Nov 11, 2009, 8:58 AM
Thread Re: [PerlFlunkie] Here's a working image upload mod!
LILHOMIE 20908 Nov 11, 2009, 3:40 PM
Thread Re: [LILHOMIE] Here's a working image upload mod!
LILHOMIE 20864 Nov 11, 2009, 3:53 PM
Thread Re: [LILHOMIE] Here's a working image upload mod!
PerlFlunkie 20848 Nov 11, 2009, 5:15 PM
Thread Re: [PerlFlunkie] Here's a working image upload mod!
LILHOMIE 20813 Nov 12, 2009, 9:13 PM
Thread Re: [LILHOMIE] Here's a working image upload mod!
PerlFlunkie 20745 Nov 14, 2009, 3:06 PM
Post Re: [PerlFlunkie] Here's a working image upload mod!
PerlFlunkie 20450 Nov 24, 2009, 5:38 PM
Post Re: [LILHOMIE] Here's a working image upload mod!
LILHOMIE 20901 Nov 11, 2009, 5:12 PM