Code: Select all
##############################################################
## MOD Title: Resize Posted Images with HTML tag
## MOD Author: spooky2280 < [email protected] > (Christian Fecteau) http://portfolio.christianfecteau.com/
## MOD Description: This MOD makes "Resize Posted Images Based on Max Width MOD" processes
## images posted with HTML <img> tag
##
## MOD Version: 1.0.1
##
## Installation Level: Easy
## Installation Time: 5 Minutes
##
## Files To Edit: 4
## viewtopic.php
## posting.php
## includes/topic_review.php
## privmsg.php
##
## Included Files: none
##
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
## If the user specifies the width and height attributes,
## the script might fail or behave abnormally. The script assumes
## that width and height won't be set on the IMG element.
## If the members of your board are used to specify the width
## and height attributes when they post images with HTML,
## it is recommended to not install this add-on to the MOD.
## Disable the IMG tag for allowed HTML in the ACP instead
## of making the modifications below.
##
##############################################################
## MOD History:
##
## 2005-01-19 - Version 1.0.1
## - Fixed a OPEN
##
## 2005-01-19 - Version 1.0.0
## - First release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------
#
# around line 1136
#
$message = str_replace("\n", "\n<br />\n", $message);
#
#-----[ AFTER, ADD ]------------------------------------------
#
$message = str_replace('resizemod="on" onload="rmw_img_loaded(this)"','',$message);
$message = str_replace('<img','<img resizemod="on" onload="rmw_img_loaded(this)" ',$message);
#
#-----[ OPEN ]------------------------------------------
#
posting.php
#
#-----[ FIND ]------------------------------------------
#
# around line 699
#
$preview_message = str_replace("\n", '<br />', $preview_message);
#
#-----[ AFTER, ADD ]------------------------------------------
#
$preview_message = str_replace('resizemod="on" onload="rmw_img_loaded(this)"','',$preview_message);
$preview_message = str_replace('<img','<img resizemod="on" onload="rmw_img_loaded(this)" ',$preview_message);
#
#-----[ OPEN ]------------------------------------------
#
includes/topic_review.php
#
#-----[ FIND ]------------------------------------------
#
# around line 181
#
$message = str_replace("\n", '<br />', $message);
#
#-----[ AFTER, ADD ]------------------------------------------
#
$message = str_replace('resizemod="on" onload="rmw_img_loaded(this)"','',$message);
$message = str_replace('<img','<img resizemod="on" onload="rmw_img_loaded(this)" ',$message);
#
#-----[ OPEN ]------------------------------------------
#
privmsg.php
#
#-----[ FIND ]------------------------------------------
#
# around line 611
#
$private_message = str_replace("\n", '<br />', $private_message);
#
#-----[ AFTER, ADD ]------------------------------------------
#
$private_message = str_replace('resizemod="on" onload="rmw_img_loaded(this)"','',$private_message);
$private_message = str_replace('<img','<img resizemod="on" onload="rmw_img_loaded(this)" ',$private_message);
#
#-----[ FIND ]------------------------------------------
#
# around line 1570
#
$preview_message = str_replace("\n", '<br />', $preview_message);
#
#-----[ AFTER, ADD ]------------------------------------------
#
$preview_message = str_replace('resizemod="on" onload="rmw_img_loaded(this)"','',$preview_message);
$preview_message = str_replace('<img','<img resizemod="on" onload="rmw_img_loaded(this)" ',$preview_message);
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM