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 22397 Feb 17, 2005, 9:55 PM
Thread Re: [PerlFlunkie] Here's a working image upload mod!
PerlFlunkie 22032 Feb 17, 2005, 11:11 PM
Thread Re: [PerlFlunkie] Here's a working image upload mod!
jayman 21762 Nov 4, 2005, 5:57 AM
Thread Re: [jayman] Here's a working image upload mod!
PerlFlunkie 21772 Nov 4, 2005, 2:40 PM
Thread Re: Here's a working image upload mod!
LILHOMIE 21103 Nov 8, 2009, 4:50 PM
Post Re: [LILHOMIE] Here's a working image upload mod!
LILHOMIE 21097 Nov 8, 2009, 7:50 PM
Thread Re: [LILHOMIE] Here's a working image upload mod!
PerlFlunkie 21118 Nov 8, 2009, 8:01 PM
Post Re: [PerlFlunkie] Here's a working image upload mod!
LILHOMIE 21125 Nov 8, 2009, 9:13 PM
Thread Re: [PerlFlunkie] Here's a working image upload mod!
LILHOMIE 21155 Nov 8, 2009, 10:16 PM
Thread Re: [LILHOMIE] Here's a working image upload mod!
PerlFlunkie 21089 Nov 9, 2009, 9:50 AM
Thread Re: [PerlFlunkie] Here's a working image upload mod!
LILHOMIE 21034 Nov 11, 2009, 6:53 AM
Thread Re: [LILHOMIE] Here's a working image upload mod!
PerlFlunkie 21025 Nov 11, 2009, 8:58 AM
Thread Re: [PerlFlunkie] Here's a working image upload mod!
LILHOMIE 21055 Nov 11, 2009, 3:40 PM
Thread Re: [LILHOMIE] Here's a working image upload mod!
LILHOMIE 21011 Nov 11, 2009, 3:53 PM
Thread Re: [LILHOMIE] Here's a working image upload mod!
PerlFlunkie 20996 Nov 11, 2009, 5:15 PM
Thread Re: [PerlFlunkie] Here's a working image upload mod!
LILHOMIE 20960 Nov 12, 2009, 9:13 PM
Thread Re: [LILHOMIE] Here's a working image upload mod!
PerlFlunkie 20891 Nov 14, 2009, 3:06 PM
Post Re: [PerlFlunkie] Here's a working image upload mod!
PerlFlunkie 20596 Nov 24, 2009, 5:38 PM
Post Re: [LILHOMIE] Here's a working image upload mod!
LILHOMIE 21048 Nov 11, 2009, 5:12 PM