Author Topic: Getting direct image url on page after image upload  (Read 8729 times)

0 Members and 1 Guest are viewing this topic.

Offline JCoster

  • Pre-Newbie
  • Posts: 7
    • View Profile
Getting direct image url on page after image upload
« on: April 28, 2007, 01:09:06 AM »
Hi.

At the moment I display the URL of the image under the image on the image view page (details) with the code on the details template tag:
Code: [Select]
<textarea name="select1" rows="3" cols="50">
<a href="myurl"><img src="{image_path}"></a>
</textarea>
..where {image_path} is defined by a mod (can't remember which one) stated somewhere on these forums.

However, I would also like to display this code on the page directly after the image is uploaded which just says the name of the image and the image.

How can I do this?

Thanks.

Offline MaveriC

  • Newbie
  • *
  • Posts: 32
    • View Profile
Re: Getting direct image url on page after image upload
« Reply #1 on: June 20, 2007, 11:21:39 AM »
i hope there is a solution to this..

Offline JCoster

  • Pre-Newbie
  • Posts: 7
    • View Profile
Re: Getting direct image url on page after image upload
« Reply #2 on: June 20, 2007, 04:52:45 PM »
Hmm yes me too, I'm still waiting for a response.

Would be really really useful if there was anyone who could help?>

Offline MaveriC

  • Newbie
  • *
  • Posts: 32
    • View Profile
Re: Getting direct image url on page after image upload
« Reply #3 on: June 20, 2007, 10:17:23 PM »
I tried to play around with 4i this evening and have come up with a mod! Found it to be rather simple. A couple of steps and done!

Modification updated as on June 30 2007 and moved to the below page:

Mod: Display image path, link and BBCode after image upload
http://www.4homepages.de/forum/index.php?topic=17911.0

Changelog:

1. Added the BBCodes and Thumbnail links.
2. This Mod will now display the uploaded image as a thumbnail instead of a complete image on the uploaded page.
3. The Mod is more portable now and also finishes in just 2 steps.
4. Added a follow up mod to display the same codes on the details page.

Thanks all for your kind words which made me work on this mod further.  :D
« Last Edit: June 30, 2007, 09:23:21 PM by MaveriC »

Offline JCoster

  • Pre-Newbie
  • Posts: 7
    • View Profile
Re: Getting direct image url on page after image upload
« Reply #4 on: June 21, 2007, 08:23:38 PM »
To be fair, you're a bit of a beast.

cheers- you genius.

Offline CeJay

  • Sr. Member
  • ****
  • Posts: 425
    • View Profile
Re: Getting direct image url on page after image upload
« Reply #5 on: June 21, 2007, 11:24:17 PM »
Nice little mod!!

You may want to create a topic in "Mods & Plugins (Releases & Support)" then include the bbcode part as well. I am sure many people would like to use it.

Offline impss

  • Sr. Member
  • ****
  • Posts: 382
    • View Profile
    • Cusstom.net
Re: Getting direct image url on page after image upload
« Reply #6 on: June 22, 2007, 03:23:08 AM »
Thanks for this Mod

I made some changes on my own to add BBCode large linked image and BBCode Thumbnail linked image.

Code: [Select]
//Mod: UploadInfo
/**
 * Get image information immediately after successful upload
 * Contact: arjoon@gmail.com
 */

      $sitename = "http://www.your-site-name.com"; // modify this to your site's name without any trailing slash
      $cat_name = $cat_cache[$cat_id]['cat_name'];
      $uploaded_image_path = $sitename."/data/media"."/".$cat_id."/".$new_name;
      $uploaded_image_link = $sitename."/details.php?image_id=".$image_id;
      $uploaded_thumbnail_path = $sitename."/data/thumbnails"."/".$cat_id."/".$new_name; // use this for generating BB code for forums
      $uploaded_forum_code = "[URL=".$uploaded_image_link."][IMG]".$uploaded_image_path."[/IMG][/URL]";
      $uploaded_thumb_code = "[URL=".$uploaded_image_link."][IMG]".$uploaded_thumbnail_path."[/IMG][/URL]";
      $uploadinfo .= "<font size='2' face='Tahoma'><a href='".$sitename."/member.php?action=uploadform'><b>Upload another image</b></a>";
      $uploadinfo .= "<hr color='#C0C0C0' width='80%' size='1'>";
      $uploadinfo .= "Direct Path:<br /> <input onclick='highlight(this);' style='border-style:solid; border-width:1; padding:0; width: 300px; background-color:#FFFFFF; color:#000000' size='70' value='".$uploaded_image_path."' type='text' name='image'><br />";
      $uploadinfo .= "Image Path:<br /> <input onclick='highlight(this);' style='border-style:solid; border-width:1; padding:0; width: 300px; background-color:#FFFFFF; color:#000000' size='70' value='".$uploaded_image_link."' type='text' name='image'></font><br /><br />";
      $uploadinfo .= "BBCode with Full size Image:<br /> <input onclick='highlight(this);' style='border-style:solid; border-width:1; padding:0; width: 300px; background-color:#FFFFFF; color:#000000' size='70' value='".$uploaded_forum_code."' type='text' name='image'></font><br /><br />";
      $uploadinfo .= "BBCode with Thumbnail Image:<br /> <input onclick='highlight(this);' style='border-style:solid; border-width:1; padding:0; width: 300px; background-color:#FFFFFF; color:#000000' size='70' value='".$uploaded_thumb_code."' type='text' name='image'></font><br /><br />";
      $uploadinfo .= "<font size='1' face='Tahoma'>[ This image has to be validated by the admin before adding it to the site ]</font>";  // remove this line if you dont require validation
      $content .= "<table border=\"0\" align=\"center\">\n<tr>\n<td>\n".$uploadinfo."\n</td>\n</tr>\n</table>\n";

//end of UploadInfo

Offline CeJay

  • Sr. Member
  • ****
  • Posts: 425
    • View Profile
Re: Getting direct image url on page after image upload
« Reply #7 on: June 22, 2007, 03:52:39 PM »
Very nice impss, thanks!

Offline MaveriC

  • Newbie
  • *
  • Posts: 32
    • View Profile
Re: Getting direct image url on page after image upload
« Reply #8 on: June 30, 2007, 09:52:53 AM »
lolz! thanks for the comments.. I plan to work on this mod to enhance it further  :)

And thanks impss for the add-on.. i'll include this in the original and create a new topic in the Mod section  :wink:

Offline kai

  • Administrator
  • Addicted member
  • *****
  • Posts: 1.408
    • View Profile
    • 4images - Image Gallery Management System
Re: Getting direct image url on page after image upload
« Reply #9 on: June 30, 2007, 10:17:59 AM »
@ MaveriC: Good work!
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline MaveriC

  • Newbie
  • *
  • Posts: 32
    • View Profile
Re: Getting direct image url on page after image upload
« Reply #10 on: June 30, 2007, 08:14:31 PM »
Thanks kai!

Added another follow-up mod for people who'd like to continue the same image codes on the details page. The below mod can also be used as an individual mod to display image codes.
Mod: Display image codes on details page
http://www.4homepages.de/forum/index.php?topic=17912.0

Guess the little tweak which I did last week has come too far!  :roll: :D

« Last Edit: June 30, 2007, 09:19:36 PM by MaveriC »

 

Post your comments here