Página 1 de 1

Ayuda con el mod post_img_1.1.1b

Publicado: 20 Oct 2005, 17:54
por LVenon
He intalado el mod post_img_1.1.1b en mi pagina con la version phpBB 2.0.17 y no ase nada. :?

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

Publicado: 20 Oct 2005, 19:01
por tole
Por lo que dice el mod, el administrador es el que configura los parí?Â?í?Â?í?Â?í?Â?í?Â?í?Â?í?Â?í?¡metros desde el [acronym="Panel de control del Administrador"]ACP[/acronym], has hechado un vistazo alli?.

Salu2.

Publicado: 20 Oct 2005, 19:02
por LVenon
Si lo he puesto a 400x400 y he probado con una imagen de 564x784 y no le hace nada la muestra tal cual

Publicado: 20 Oct 2005, 19:52
por ThE KuKa
Revisa el [acronym="Un aí?Â?í?Â?í?Â?í?Â?í?Â?í?Â?í?Â?í?±adido para una mejora en el foro"]MOD[/acronym] completo, en especial esta parte:

Código: Seleccionar todo

# 
#-----[ FIND ]------------------------------------------ 
# 

$patterns[] = "#\[img:$uid\]([^?].*?)\[/img:$uid\]#i"; 

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
# 

// mod img size replace with call to image parsing function 
$text = image_parse ( $text, $uid );
S@lu2

Publicado: 20 Oct 2005, 20:17
por LVenon
Si esta bien colocado en el archivo de bbcode.php, si le di como tres repasadas a todos los archivos incluso borraba los del hosting y los volvia a poner pero, nada no hace absolutamentenada todo sigue igual que antes las imagenes las muestra del tamano normal.

Por eso mi duda de que si este mod ya estaba probado por alguien o si tenia alguna correcccií?Â?í?Â?í?Â?í?Â?í?Â?í?Â?í?Â?í?³n.