
Segun lo que entiendo es que si en algun tema se pone una imagen mayor a la establecida por el administrador esta se reduce, pero no lo hacer poner la imagen con el tamaí?Â?í?Â?í?Â?í?Â?í?Â?í?Â?í?Â?í?±o normal?
Esta mal el codigo?
Este es el codigo:
Código: Seleccionar todo
##############################################################
## MOD Title: Post Image Size
## MOD Author: Swizec (N/A) http://www.randy-comic.com
## MOD Description: Admin can set the maximum size of images displayed in posts. Images bigger than that are shrunk and turned into a link to the normal sized version.
## MOD Version: 1.1.1
##
## Installation Level: Easy
## Installation Time: ~3 Minutes
## Files To Edit:
## includes/bbcode.php
## admin/admin_board.php
## templates/subSilver/bbcode.tpl
## templates/subSilver/admin/board_config_body.tpl
## language/lang_english/lang_main.php
## language/lang_english/lang_admin.php
## Included Files: N/A
##
##############################################################
## 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:
##
## demo board: http://www.swizec.com/forum
##
##############################################################
## MOD History:
##
## 2005-04-17 - Version 1.0.0
## - working mod
##
## 2005-04-17 - Version 1.0.1
## - oops, small bug in the .mod file
##
## 2005-04-17 - Version 1.0.2
## - omg I'm so fucken hasty
##
## 2005-05-01 - Version 1.0.3
## - fixed a bug
##
## 2005-05-01 - Version 1.0.4
## - some slashes got left behind
##
## 2005-05-02 - Version 1.0.5
## - added "this is thumbnail" notice wished by MaddoxX
##
## 2005-05-24 - Version 1.0.6
## - use of bbcode.tpl added
##
## 2005-05-31 - Version 1.0.7
## - getting closer :)
##
## 2005-05-31 - Version 1.1.0
## -fixed a bug
## -implemented image aligning by pichirichi
##
## 2005-06-23 - Version 1.1.1
## - fixed XHTML compliancy
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ SQL ]------------------------------------------
#
INSERT INTO phpbb_config( config_name, config_value ) VALUES ( 'postimg_width', '800' );
INSERT INTO phpbb_config( config_name, config_value ) VALUES ( 'postimg_height', '600' );
#
#-----[ OPEN ]------------------------------------------
#
includes/bbcode.php
#
#-----[ FIND ]------------------------------------------
#
$bbcode_tpl = null;
#
#-----[ AFTER, ADD ]------------------------------------------
#
// mod img size add
function makeimgsize ( $width, $height ) {
global $board_config;
$size = '';
if ( $width > $height ) {
if ( $board_config['postimg_width'] $img ) {
if ( !$size = @getimagesize( $img ) ) break;
$width = $size[0]; $height = $size[1];
$size = makeimgsize ( $size[0], $size[1] );
$img_align = strtok( $matches[1][$k], ":" );
switch($img_align)
{
case "img=right":
$align = $lang['RIGHT'];
break;
case "img=left":
case "img":
default:
$align = $lang['LEFT'];
break;
}
$first = $matches[1][$k];
$secnd = $matches[3][$k];
$find = '[' . $first . ']' . str_replace( '', '/', $img ) . '[/' . $secnd . ']';
if ( !empty( $size ) )
{
$replace = $bbcode_tpl['thmbimg'];
$seek = array( '{IMAGE}', '{WIDTH}', '{HEIGHT}', '{SIZE}', '{NOTICE}', '{ALIGN}' );
$with = array( $img, $width, $height, $size, $lang['postimg_clickme'], $align );
$replace = str_replace( $seek, $with, $replace );
$post = str_replace( $find, $replace, $post );
}
}
return $post;
}
// mod img size end
#
#-----[ FIND ]------------------------------------------
#
$patterns[] = "#\[img:$uid\]([^?].*?)\[/img:$uid\]#i";
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// mod img size replace with call to image parsing function
$text = image_parse ( $text, $uid );
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_board.php
#
#-----[ FIND ]------------------------------------------
#
$namechange_no = ( !$new['allow_namechange'] ) ? "checked=\"checked\"" : "";
#
#-----[ AFTER, ADD ]------------------------------------------
#
// mod img size add
$postimg_width = $new['postimg_width'];
$postimg_height = $new['postimg_height'];
// mod img size end
#
#-----[ FIND ]------------------------------------------
#
"L_RESET" => $lang['Reset'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
// mod img size add
"L_POSTIMG_SIZE" => $lang['postimg_size'],
"POSTIMG_WIDTH" => $postimg_width,
"POSTIMG_HEIGHT" => $postimg_height,
// mod img size end
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/bbcode.tpl
#
#-----[ FIND ]------------------------------------------
#
{EMAIL}
#
#-----[ AFTER, ADD ]------------------------------------------
#
{NOTICE}
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/board_config_body.tpl
#
#-----[ FIND ]------------------------------------------
#
{L_ENABLE_PRUNE}
{L_YES} {L_NO}
#
#-----[ AFTER, ADD ]------------------------------------------
#
{L_POSTIMG_SIZE}
X
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// mod img size add
$lang['postimg_clickme'] = 'Thumbnail, click to enlarge.';
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_admin.php
#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// mod img size add
$lang['postimg_size'] = 'Maximum size of images in posts';
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM