Code: Selecteer alles
Parse error: parse error, unexpected T_VARIABLE in d:\easyphp\www\forum\language\lang_dutch\lang_main.php on line 1008
Code: Selecteer alles
Parse error: parse error, unexpected T_VARIABLE in d:\easyphp\www\forum\language\lang_dutch\lang_main.php on line 1008
Warning: Cannot add header information - headers already sent by (output started at d:\easyphp\www\forum\language\lang_dutch\lang_main.php:1008) in d:\easyphp\www\forum\includes\page_header.php on line 476
Warning: Cannot add header information - headers already sent by (output started at d:\easyphp\www\forum\language\lang_dutch\lang_main.php:1008) in d:\easyphp\www\forum\includes\page_header.php on line 478
Warning: Cannot add header information - headers already sent by (output started at d:\easyphp\www\forum\language\lang_dutch\lang_main.php:1008) in d:\easyphp\www\forum\includes\page_header.php on line 479
Hier is de mod.
Code: Selecteer alles
###############################################
## Hack Title: Restrict images in signatures
## Hack Version: 0.1.1
## Author: Freakin' Booty ;-P
## Description: Restrict the width, the height and the number of images in signatures. Everything
## is configurable from the Administration Control Panel.
## Compatibility: 2.0.4 - 2.0.9
##
## Installation Level: Easy
## Installation Time: 5 - 10 minutes
## Files To Edit: 6
## admin/admin_board.php
## admin/admin_users.php
## includes/usercp_register.php
## language/lang_english/lang_admin.php
## language/lang_english/lang_main.php
## templates/subSilver/admin/board_config_body.tpl
##
## Included Files: 1
## db_update.php
##
## History:
## 0.1.0: Initial release
## 0.1.1: Fixed a few mistakes in the admin board configuration file.
##
## Author Notes:
## None
##
## Support: http://www.phpbbhacks.com/forums
## Copyright: ©2003 Restrict images in signatures 0.1.1 - Freakin' Booty ;-P
##
###############################################
## You downloaded this hack from phpBBHacks.com, the #1 source for phpBB related downloads.
## Please visit http://www.phpbbhacks.com/forums for support.
###############################################
##
###############################################
## This hack is released under the GPL License.
## This hack can be freely used, but not distributed, without permission.
## Intellectual Property is retained by the hack author(s) listed above.
###############################################
#
#-----[ COPY ]--------------------------------------------
#
# Run this file once (access it with your browser) and then delete it!
#
db_update.php => db_update.php
#
#-----[ OPEN ]--------------------------------------------
#
admin/admin_board.php
#
#-----[ FIND ]--------------------------------------------
#
"L_MAX_SIG_LENGTH" => $lang['Max_sig_length'],
"L_MAX_SIG_LENGTH_EXPLAIN" => $lang['Max_sig_length_explain'],
#
#-----[ AFTER, ADD ]--------------------------------------
#
"L_MAX_SIG_IMAGES_LIMIT" => $lang['Max_sig_images_limit'],
"L_MAX_SIG_IMAGES_SIZE" => $lang['Max_sig_images_size'],
"L_MAX_SIG_IMAGES_SIZE_EXPLAIN" => $lang['Max_sig_images_explain'],
#
#-----[ FIND ]--------------------------------------------
#
"SIG_SIZE" => $new['max_sig_chars'],
#
#-----[ AFTER, ADD ]--------------------------------------
#sig_images_max_width
"SIG_IMAGES_MAX_LIMIT" => $new['sig_images_max_limit'],
"SIG_IMAGES_MAX_HEIGHT" => $new['sig_images_max_height'],
"SIG_IMAGES_MAX_WIDTH" => $new['sig_images_max_width'],
#
#-----[ OPEN ]--------------------------------------------
#
admin/admin_users.php
#
#-----[ FIND ]--------------------------------------------
#
if ( strlen($sig_length_check) > $board_config['max_sig_chars'] )
{
$error = TRUE;
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Signature_too_long'];
}
#
#-----[ AFTER, ADD ]--------------------------------------
#
else
{
if( preg_match_all("#\[img(:$signature_bbcode_uid)?\]((ht|f)tp://)([^\r\n\t<\"]*?)\[/img(:$signature_bbcode_uid)?\]#sie", $signature, $matches) )
{
if( count($matches[0]) > $board_config['sig_images_max_limit'] )
{
$error = TRUE;
$l_too_many_images = ( $board_config['sig_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(:$signature_bbcode_uid)?\]((ht|f)tp://)([^\r\n\t<\"]*?)\[/img(:$signature_bbcode_uid)?\]#si", "\\2\\4", $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;
}
}
}
}
}
#
#-----[ OPEN ]--------------------------------------------
#
includes/usercp_register.php
#
#-----[ FIND ]--------------------------------------------
#
if ( strlen($signature) > $board_config['max_sig_chars'] )
{
$error = TRUE;
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Signature_too_long'];
}
#
#-----[ AFTER, ADD ]--------------------------------------
#
else
{
if( preg_match_all("#\[img\]((ht|f)tp://)([^\r\n\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;
}
}
}
}
}
#
#-----[ OPEN ]--------------------------------------------
#
# Make sure to edit this file for every language installed
#
language/lang_english/lang_admin.php
#
#-----[ FIND ]--------------------------------------------
#
//
// That's all Folks!
// -------------------------------------------------
#
#-----[ BEFORE, ADD ]-------------------------------------
#
//
// Restrict images in signatures
//
$lang['Max_sig_images_limit'] = 'Maximum Images Per Signatures';
$lang['Max_sig_images_size'] = 'Maximum Image Dimensions In Signatures';
$lang['Max_sig_images_size_explain'] = '(Height x Width in pixels)';
#
#-----[ OPEN ]--------------------------------------------
#
# Make sure to edit this file for every language installed
#
language/lang_english/lang_main.php
#
#-----[ FIND ]--------------------------------------------
#
//
// That's all Folks!
// -------------------------------------------------
#
#-----[ BEFORE, ADD ]-------------------------------------
#
//
// Restrict images in signatures
//
$lang['Too_many_sig_image'] = 'You have added too many images in your signature. You can only add %d image in your signature.';
$lang['Too_many_sig_images'] = 'You have added too many images in your signature. You can only add %d images in your signature.';
$lang['Sig_image_too_large'] = 'You have added an image that is too large. Images can only be %d pixels wide and %d pixels high.';
#
#-----[ OPEN ]--------------------------------------------
#
# Make sure to edit this file for every template installed
#
templates/subSilver/admin/board_config_body.tpl
#
#-----[ FIND ]--------------------------------------------
#
<tr>
<td class="row1">{L_MAX_SIG_LENGTH}<br /><span class="gensmall">{L_MAX_SIG_LENGTH_EXPLAIN}</span></td>
<td class="row2"><input class="post" type="text" size="5" maxlength="4" name="max_sig_chars" value="{SIG_SIZE}" /></td>
</tr>
#
#-----[ AFTER, ADD ]--------------------------------------
#
<tr>
<td class="row1">{L_MAX_SIG_IMAGES_LIMIT} <br />
<span class="gensmall">{L_MAX_SIG_IMAGES_LIMIT_EXPLAIN}</span>
</td>
<td class="row2"><input class="post" type="text" size="3" maxlength="4" name="sig_images_max_limit" value="{SIG_IMAGES_MAX_LIMIT}" /></td>
</tr>
<tr>
<td class="row1">{L_MAX_SIG_IMAGES_SIZE} <br />
<span class="gensmall">{L_MAX_SIG_IMAGES_SIZE_EXPLAIN}</span>
</td>
<td class="row2"><input class="post" type="text" size="3" maxlength="4" name="sig_images_max_height" value="{SIG_IMAGES_MAX_HEIGHT}" /> x <input class="post" type="text" size="3" maxlength="4" name="sig_images_max_width" value="{SIG_IMAGES_MAX_WIDTH}" /></td>
</tr>
#
#-----[ SAVE & CLOSE ALL FILES ]--------------------------
#