Restrict images in signatures

Hulp nodig bij een modificaties of op zoek naar een MOD? Bekijk ons archief. Support wordt helaas niet meer verleend.
Forumregels

Sinds 1 januari 2009 wordt phpBB2 niet meer ondersteund.
Onderstaande informatie is verouderd en dient uitsluitend als archief.
phpBB2.0.x
Gesloten
topslob
Berichten: 233
Lid geworden op: 24 jan 2003, 13:00

Restrict images in signatures

Bericht door topslob » 04 aug 2004, 23:03

Dit heb ik de laatste tijd wel vaker zodra ik wat verander in mijn lang_dutch krijg ik deze error.

Code: Selecteer alles

Parse error: parse error, unexpected T_VARIABLE in d:\easyphp\www\forum\language\lang_dutch\lang_main.php on line 1008
Met deze mod is het nog erger.

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
Al mijn header teksen zoals groepen enz zijn nu weg:S

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 ]--------------------------
#
Wat doe ik fout??

Gebruikersavatar
WebSiteNet
Berichten: 6524
Lid geworden op: 20 okt 2003, 16:56
Locatie: Wieringerwerf
Contacteer:

Bericht door WebSiteNet » 05 aug 2004, 00:10

het is eigenlijk precies dezelfde foutmelding. Kan je regel 1000 t/m 1015 van dat bestand geven?

topslob
Berichten: 233
Lid geworden op: 24 jan 2003, 13:00

Bericht door topslob » 05 aug 2004, 09:13

astu, regel 1000 t/m 1016 want dat is de laatste.

Code: Selecteer alles

$lang['Critical_Error'] = 'Fatale Fout';
$lang['An_error_occured'] = 'Er is een fout opgetreden';
$lang['A_critical_error'] = 'Er is een fatale fout opgetreden';

//Add on for Rules mod 
$lang['Rules'] = 'Regels'

// 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.';

//
// That's all Folks!
// -------------------------------------------------

?>

cartoontje
Berichten: 1518
Lid geworden op: 29 jun 2003, 10:57
Locatie: Home Sweet Home
Contacteer:

Bericht door cartoontje » 05 aug 2004, 10:42

Code: Selecteer alles

//Add on for Rules mod 
$lang['Rules'] = 'Regels'
Er mist hier een ";"

Maak er dus dit van:

Code: Selecteer alles

//Add on for Rules mod 
$lang['Rules'] = 'Regels';

topslob
Berichten: 233
Lid geworden op: 24 jan 2003, 13:00

Bericht door topslob » 05 aug 2004, 11:00

Probleem opgelost :thumb:

Tip voor allen mod niet te veel als je al wat :bier: op hebt.

Gesloten