[問題]限制簽名檔圖片大小有小許問題
發表於 : 2004-01-06 01:05
安裝原本成功,可以限制,後臺設定也沒問題,但發現修改個人資料簽名檔時,如超出規定大小及數量時,上方error message沒有文字出現,只有一個方框,請問怎樣修改,我估計是下列需要修改一下
[php]<?php
#-----[ 打開]-------------------------------------------- \r
#
includes/usercp_register.php
#
#-----[ 尋找 ]--------------------------------------------
#
if ( strlen($signature) > $board_config['max_sig_chars'] )
{
$error = TRUE;
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Signature_too_long'];
}
#
#-----[ 在之後加入 ]--------------------------------------
#
else
{
if( preg_match_all("#\[img\]((ht|f)tp://)([^
\t<\"]*?)\[/img\]#sie", $signature, $matches) )
{
if( count($matches[0]) > $board_config['sig_images_max_limit'] )
{
$error = TRUE;
$l_too_many_images = ( $board_config['images_max_limit'] == 1 ) ? sprintf($lang['Too_many_sig_image'], $board_config['sig_images_max_limit']) : sprintf($lang['Too_many_sig_images'], $board_config['sig_images_max_limit']);
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $l_too_many_images;
}
else
{
for( $i = 0; $i < count($matches[0]); $i++ )
{
$image = preg_replace("#\[img\](.*)\[/img\]#si", "\\\1", $matches[0][$i]);
list($width, $height) = @getimagesize($image);
if( $width > $board_config['sig_images_max_width'] || $height > $board_config['sig_images_max_height'] )
{
$error = TRUE;
$l_image_too_large = sprintf($lang['Sig_image_too_large'], $board_config['sig_images_max_width'], $board_config['sig_images_max_height']);
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $l_image_too_large;
break;
}
}
}
}
}
?>[/php]
自機架站
藍天MX110(base on php2.0.6)
appserv 2.2
附上原MOD http://idisk.mac.com/phpbbmods/Public/r ... gs_010.zip
[php]<?php
#-----[ 打開]-------------------------------------------- \r
#
includes/usercp_register.php
#
#-----[ 尋找 ]--------------------------------------------
#
if ( strlen($signature) > $board_config['max_sig_chars'] )
{
$error = TRUE;
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Signature_too_long'];
}
#
#-----[ 在之後加入 ]--------------------------------------
#
else
{
if( preg_match_all("#\[img\]((ht|f)tp://)([^
\t<\"]*?)\[/img\]#sie", $signature, $matches) )
{
if( count($matches[0]) > $board_config['sig_images_max_limit'] )
{
$error = TRUE;
$l_too_many_images = ( $board_config['images_max_limit'] == 1 ) ? sprintf($lang['Too_many_sig_image'], $board_config['sig_images_max_limit']) : sprintf($lang['Too_many_sig_images'], $board_config['sig_images_max_limit']);
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $l_too_many_images;
}
else
{
for( $i = 0; $i < count($matches[0]); $i++ )
{
$image = preg_replace("#\[img\](.*)\[/img\]#si", "\\\1", $matches[0][$i]);
list($width, $height) = @getimagesize($image);
if( $width > $board_config['sig_images_max_width'] || $height > $board_config['sig_images_max_height'] )
{
$error = TRUE;
$l_image_too_large = sprintf($lang['Sig_image_too_large'], $board_config['sig_images_max_width'], $board_config['sig_images_max_height']);
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $l_image_too_large;
break;
}
}
}
}
}
?>[/php]
自機架站
藍天MX110(base on php2.0.6)
appserv 2.2
附上原MOD http://idisk.mac.com/phpbbmods/Public/r ... gs_010.zip