Name:
UploadInfo v1.0Works on 1.7.4
Last updated:
June 30 2007Requirements: GD or any other image editor to create thumbnails on the fly
How this works:Whenever a user uploads an image, 4images by default does not include any details apart from the image. This mod will display the below codes on the successful upload page just like any free image hosting service.
Apart from the code, the mod will display a thumbnail link to the image rather than the complete image.
Image Codes:1. Hot link for websites
2. Hot link for forums
3. Thumbnail code for websites
4. Thumbnail code for forums
5. Image link
6. Image path
You can customize the mod to display the complete image and remove any of the above options. This mod should work with other mods and different 4images versions without any issues.
Here's the procedure:
Please take a backup of all the files before modifying the codeStep 1: Open
templates/your template name/header.htmlAdd the below code anywhere inside the <head> tag
<script type="text/javascript">
function highlight(field) {
field.focus();
field.select();
}
</script>
Step 2:Open
member.phpFind
$content .= "<table border=\"0\" align=\"center\">\n<tr>\n<td>\n".$media."\n</td>\n</tr>\n</table>\n";
Replace with://-----------------------------------------------------
//--- UploadInfo v1.0 Begins --------------------------
//-----------------------------------------------------
// Mod: UploadInfo v1.0
// Version: 1.0
// Description : Display image path, link and bbcode after image upload
// Contact: arjoon@gmail.com
// Last update: June 30 2007
$cat_name = $cat_cache[$cat_id]['cat_name'];
$uploaded_image_path = $script_url."/".MEDIA_DIR."/".$cat_id."/".$new_name;
$uploaded_thumb_path = $script_url."/".THUMB_DIR."/".$cat_id."/".$new_name;
$uploaded_image_link = $script_url."/details.php?image_id=".$image_id;
$uploaded_thumb_hotlink = "<a href=\"".$uploaded_image_link."\"><img src=\"".$uploaded_thumb_path."\" border=\"0\" alt=\"".$new_name."\"></a>";
$uploaded_image_hotlink = "<a href=\"".$script_url."\"><img src=\"".$uploaded_image_path."\" border=\"0\" alt=\"".$new_name."\"></a>";
$uploaded_image_bbcode = "[URL=http://".$script_url."][IMG]http://".$uploaded_image_path."[/img][/URL]";
$uploaded_thumb_bbcode = "[URL=http://".$uploaded_image_link."][IMG]http://".$uploaded_thumb_path."[/img][/URL]";
$uploadinfo .= "<center><font size='1' face='Tahoma'>click on the above thumbnail for the full sized image</font><br /><br />";
$uploadinfo .= "<font size='2' face='Tahoma'><a href='".$script_url."/member.php?action=uploadform&cat_id=".$cat_id."'><b>Upload another image</b></a> or goto <a href='".$script_url."/categories.php?cat_id=".$cat_id."'><b>".$cat_name."'s gallery</b></a></center><br />";
$uploadinfo .= "<hr color='#C0C0C0' width='80%' size='1'>";
$uploadinfo .= "<br />";
$uploadinfo .= "<b>Image Codes:</b><br />";
$uploadinfo .= "<input onclick='highlight(this);' style='border-style:solid; border-width:1; padding:2; width: 300px; background-color:#FFFFFF; color:#000000' size='70' value='".$uploaded_thumb_hotlink."' type='text' name='image'> Thumbnail for websites<br />";
$uploadinfo .= "<input onclick='highlight(this);' style='border-style:solid; border-width:1; padding:2; width: 300px; background-color:#FFFFFF; color:#000000' size='70' value='".$uploaded_thumb_bbcode."' type='text' name='image'> Thumbnail for forums<br /><br />";
$uploadinfo .= "<font size='1' face='Tahoma'>Use the below codes to post the full sized image on other websites or forums</font><br />";
$uploadinfo .= "<input onclick='highlight(this);' style='border-style:solid; border-width:1; padding:2; width: 300px; background-color:#FFFFFF; color:#000000' size='70' value='".$uploaded_image_hotlink."' type='text' name='image'> Hotlink for websites<br />";
$uploadinfo .= "<input onclick='highlight(this);' style='border-style:solid; border-width:1; padding:2; width: 300px; background-color:#FFFFFF; color:#000000' size='70' value='".$uploaded_image_bbcode."' type='text' name='image'> Hotlink for forums<br /><br />";
$uploadinfo .= "<font size='1' face='Tahoma'>Share this image with your friends</font><br />";
$uploadinfo .= "<input onclick='highlight(this);' style='border-style:solid; border-width:1; padding:2; width: 300px; background-color:#FFFFFF; color:#000000' size='70' value='".$uploaded_image_link."' type='text' name='image'> Share this image<br />";
$uploadinfo .= "<input onclick='highlight(this);' style='border-style:solid; border-width:1; padding:2; width: 300px; background-color:#FFFFFF; color:#000000' size='70' value='".$uploaded_image_path."' type='text' name='image'> Direct path to image<br /><br /></font>";
// remove the below line if your site doesnt require image validation
$uploadinfo .= "<center><font size='1' face='Tahoma'>[ This image may require validation before it actually appears on the gallery ]</font></center>";
$content .= "<table border=\"0\" align=\"center\">\n<tr>\n<td>\n<a href='".$uploaded_image_link."'>".$media."</a>\n</td>\n</tr>\n</table>\n";
$content .= "<table border=\"0\" width=\"500px\" align=\"center\">\n<tr>\n<td>\n".$uploadinfo."\n</td>\n</tr>\n</table>\n";
//-----------------------------------------------------
//--- end of UploadInfo v1.0 --------------------------
//-----------------------------------------------------
That's it!
If you want to use the same image codes on the details page as well, click belowhttp://www.4homepages.de/forum/index.php?topic=17912.0If there are any bugs/changes/suggestions, do let me know.