31
Mods & Plugins (Requests & Discussions) / Re: Getting direct image url on page after image upload
« 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.
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