Mod version: 1.0.0
Author: CyberAlien
phpBB version: 2.0.x (any version)
Description: This mod enables image uploading. All images are stored on image hosting server, not on your forum. Image uploading is very simple and requires no skill. This mod is perfect solution for forums where visitors are not tech savvy and don't know how to upload image or don't know how to use [img] bbcode. Image hosting script creates thumbnails of images and posts thumbnails instead of full images, so large images will be shown as small.
Mod code:
Create file "addform.html" in your forum root directory (for nuke if that won't work then you should create it in nuke root directory) and put this code in it (click on "download" link in code header to download it)[code filename="addform.html"]<html>
<head>
</head>
<body>
<script language="javascript" type="text/javascript">
<!--
function add_code()
{
var text = unescape(document.location.search.substring(1));
opener.document.forms['post'].message.value = opener.document.forms['post'].message.value + text;
opener.focus();
window.close();
}
add_code();
//-->
</script>
</body>
</html>[/code]
Then make this change to 'templates/subSilver/posting_body.tpl':
- Code: Select all
#
#-----[ OPEN ]-------------------------------------------------------
#
templates/subSilver/posting_body.tpl
#
#-----[ FIND ]-------------------------------------------------------
#
<tr>
<td colspan="9"><span class="gen">
<textarea name="message" rows="15" cols="35" wrap="virtual" style="width:450px" tabindex="3" class="post" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);">{MESSAGE}</textarea>
</span></td>
</tr>
#
#-----[ IN-LINE FIND ]-----------------------------------------------
#
{MESSAGE}</textarea>
#
#-----[ IN-LINE AFTER, ADD ]-----------------------------------------
#
<br /><span class="genmed"><a href="javascript:void(0);" onclick="window.open('http://www.postimage.org/index.php?mode=phpbb&tpl=.&forumurl=' + escape(document.location.href), '_imagehost', 'resizable=yes,width=500,height=400');return false;">Add image to post</a></span>
#
#-----[ SAVE/CLOSE ALL FILES ]---------------------------------------
#
# EoM
That's all. This is the simpliest attachment mod there is. And you don't need to worry about disk space because all images are hosted on third party server.
__________________________________________________________________________________
How it works:
Uploading images is as simple as it can get:
1. When starting new thread or posting reply you see "add image to post" link below textarea:
2. Click that link, popup will appear where you should select image and add description to that image (description is optional):
3. You click "upload it" link, image is uploaded and bbcode is automatically inserted in post:
4. You click "submit" to submit post and thumbnail of image appears in post (just like thumbnails posted above)

