Pagina 1 van 1

restrict images nette versie?

Geplaatst: 02 aug 2006, 10:10
door versatile
Heeft er iemand misschien de nette versie van de hack die een maximum op de hoogte en breedte zet van alle plaatjes op je forum?

Ik bedoel deze hack:
http://www.phpbbhacks.com/download/1590

Als je die opent en kijkt naar install.txt zit alles door elkaar en sommige tekens heeft ie opgepakt als zon vierkant blokje.

Heeft iemand de goeie versie ervan?

alvast bedankt

Geplaatst: 02 aug 2006, 10:35
door GertJan

Code: Selecteer alles

###############################################
##	Hack Title:		Restrict images in posts
##	Hack Version:	0.3.0
##	Author:			Freakin' Booty ;-P
##	Description:	Restrict the width and height of images in posts, and also the number per post. Everything
##					is configurable from the Administration Control Panel.
##	Compatibility:	2.0.3 - 2.0.5
##
##	Installation Level: Easy
##	Installation Time: 5-10 minutes
##	Files To Edit: 5
##		admin/admin_board.php
##		includes/functions_post.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.2.0	Added a limit of images per post - configurable from the ACP.
##				Changed the preg-expression for better results, and more flexibility.
##		0.3.0	Removed an evil semicolon.
##
##	Author Notes:
##		None
##
##	Support:		http://www.phpbbhacks.com/forums
##	Copyright:		©2003 Restrict images in posts 0.3.0 - 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_AVATAR_GALLERY_PATH_EXPLAIN" => $lang['Avatar_gallery_path_explain'],

#
#-----[ AFTER, ADD ]--------------------------------------
#
	"L_MAX_IMAGES_LIMIT" => $lang['Max_images_limit'],
	"L_MAX_IMAGES_SIZE" => $lang['Max_images_size'],
	"L_MAX_IMAGES_SIZE_EXPLAIN" => $lang['Max_images_explain'],

#
#-----[ FIND ]--------------------------------------------
#
	"AVATAR_GALLERY_PATH" => $new['avatar_gallery_path'],

#
#-----[ AFTER, ADD ]--------------------------------------
#
	"IMAGES_MAX_LIMIT" => $new['images_max_limit'],
	"IMAGES_MAX_HEIGHT" => $new['images_max_height'],
	"IMAGES_MAX_WIDTH" => $new['images_max_width'],

#
#-----[ OPEN ]--------------------------------------------
#
includes/functions_post.php

#
#-----[ FIND ]--------------------------------------------
#
	// Check message
	if (!empty($message))
	{

#
#-----[ AFTER, ADD ]--------------------------------------
#
		if( preg_match_all("#\[img\]((ht|f)tp://)([^\r\n\t<\"]*?)\[/img\]#sie", $message, $matches) )
		{
			if( count($matches[0]) > $board_config['images_max_limit'] )
			{
				$l_too_many_images = ( $board_config['images_max_limit'] == 1 ) ? sprintf($lang['Too_many_image'], $board_config['images_max_limit']) : sprintf($lang['Too_many_images'], $board_config['images_max_limit']);
				$error_msg .= (!empty($error_msg)) ? '<br />' . $l_too_many_images : $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['images_max_width'] || $height > $board_config['images_max_height'] )
					{
						$l_image_too_large = sprintf($lang['Image_too_large'], $board_config['images_max_width'], $board_config['images_max_height']);
						$error_msg .= (!empty($error_msg)) ? '<br />' . $l_image_too_large : $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 image size in posts
//
$lang['Max_images_limit'] = 'Maximum Images Per Post';
$lang['Max_images_size'] = 'Maximum Image Dimensions In Posts';
$lang['Max_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 posts
//
$lang['Too_many_image'] = 'You have added too many images in your post. You can only add %d image per post.';
$lang['Too_many_images'] = 'You have added too many images in your post. You can only add %d images per post.';
$lang['Image_too_large'] = 'You have posted 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_ALLOW_NAME_CHANGE}</td>
		<td class="row2"><input type="radio" name="allow_namechange" value="1" {NAMECHANGE_YES} /> {L_YES}&nbsp;&nbsp;<input type="radio" name="allow_namechange" value="0" {NAMECHANGE_NO} /> {L_NO}</td>
	</tr>

#
#-----[ AFTER, ADD ]--------------------------------------
#
	<tr>
		<td class="row1">{L_MAX_IMAGES_LIMIT} <br />
			<span class="gensmall">{L_MAX_IMAGES_LIMIT_EXPLAIN}</span>
		</td>
		<td class="row2"><input class="post" type="text" size="3" maxlength="4" name="images_max_limit" value="{IMAGES_MAX_LIMIT}" /></td>
	</tr>
	<tr>
		<td class="row1">{L_MAX_IMAGES_SIZE} <br />
			<span class="gensmall">{L_MAX_IMAGES_SIZE_EXPLAIN}</span>
		</td>
		<td class="row2"><input class="post" type="text" size="3" maxlength="4" name="images_max_height" value="{IMAGES_MAX_HEIGHT}" /> x <input class="post" type="text" size="3" maxlength="4" name="images_max_width" value="{IMAGES_MAX_WIDTH}" /></td>
	</tr>

#
#-----[ SAVE & CLOSE ALL FILES ]--------------------------
#
hier heb je hem. maar eigenlijk had je dat zelf ook gekund. Even de rar uitpakken en het tekstbestandje openen met word, of zoals ik gedaan hem, met dreamweaver

Re: restrict images nette versie?

Geplaatst: 02 aug 2006, 11:03
door Xanland
versatile schreef:...Als je die opent en kijkt naar install.txt zit alles door elkaar en sommige tekens heeft ie opgepakt als zon vierkant blokje....
Dat is iets raars van kladblok! Open in Wordpad helpt, ben je vierkantjes ook kwijt. Heb ik ook wel eens.

Geplaatst: 02 aug 2006, 11:24
door versatile
ok bedankt
dan weet ik dat voor de volgende keer :)

edit:
heeft iemand er trouwens ooit problemen mee gehad? want hij werkt niet bij mij en ik heb alles gedaan

Geplaatst: 02 aug 2006, 12:59
door hendry
versatile schreef:ok bedankt
dan weet ik dat voor de volgende keer :)

edit:
heeft iemand er trouwens ooit problemen mee gehad? want hij werkt niet bij mij en ik heb alles gedaan


Dat de intall er niet mooi uit ziet? Zovaak :)

Geplaatst: 02 aug 2006, 13:20
door versatile
das minder
want ik had deze hack wel nodig :?
waarschijnlijk is de hack niet genoeg geupdate

Geplaatst: 03 aug 2006, 08:18
door Coen
Nee, zoals hierboven al een keer is vermeld, ligt het aan kladblok en dus niet aan de MOD! Op de install.txt in een nette editor, of desnoods in Wordpad, daarin zal het prima werken! :)

Geplaatst: 03 aug 2006, 09:06
door versatile
ja maar ik bedoel de mod zelf..

edit:
de mod werkte wel, maar ik had m uitgetest met mn admin account
dus hij werkt wel!
excuses