[2.0.11] Resize Posted Images Based on Max Width

The cleanup is complete. This forum is now read only.

Rating:

Excellent!
46
64%
Very Good
10
14%
Good
10
14%
Fair
3
4%
Poor
3
4%
 
Total votes: 72

Blisk
Registered User
Posts: 270
Joined: Wed Aug 20, 2003 10:43 am
Location: Slovenia

Re: [2.0.11] Resize Posted Images Based on Max Width

Post by Blisk »

I have this MOD installed and it works ok on firefox, but not on IE, what could be wrong?
diabolic.bg
Registered User
Posts: 447
Joined: Mon Dec 11, 2006 3:41 pm
Location: Bulgaria, Sofia
Contact:

Re: [2.0.11] Resize Posted Images Based on Max Width

Post by diabolic.bg »

Blisk wrote: I have this MOD installed and it works ok on firefox, but not on IE, what could be wrong?


IE is wrong - you see my previous post in page 19. :D
Blisk
Registered User
Posts: 270
Joined: Wed Aug 20, 2003 10:43 am
Location: Slovenia

Re: [2.0.11] Resize Posted Images Based on Max Width

Post by Blisk »

Yes I know but I cannot, force all users of my forum to use Firefox.
Is there a way to make it work in IE too?
diabolic.bg
Registered User
Posts: 447
Joined: Mon Dec 11, 2006 3:41 pm
Location: Bulgaria, Sofia
Contact:

Re: [2.0.11] Resize Posted Images Based on Max Width

Post by diabolic.bg »

Blisk wrote: Yes I know but I cannot, force all users of my forum to use Firefox.
Is there a way to make it work in IE too?

I don't know this way. I don't find him.
I have just written: "If you use IE, you may have problems... The choice is yours!" ;)
Blisk
Registered User
Posts: 270
Joined: Wed Aug 20, 2003 10:43 am
Location: Slovenia

Re: [2.0.11] Resize Posted Images Based on Max Width

Post by Blisk »

Is there somebody who can fix this mod?
Aquilla
Registered User
Posts: 3
Joined: Thu Mar 22, 2007 11:09 pm

Re: [2.0.11] Resize Posted Images Based on Max Width

Post by Aquilla »

Blisk,

I never could get this mod to work with IE on my forums either, so I ended up using this one instead.

Hope that helps.
bLACKADDER2
Registered User
Posts: 8
Joined: Wed Mar 28, 2007 7:00 pm

Re: [2.0.11] Resize Posted Images Based on Max Width

Post by bLACKADDER2 »

I have made a little MOD that makes it possible to define the maximum image width through the admin panel.
NOTE: This MOD hasn't been validated by the phpBB team, but is hopefully a useful addition to the Resize Posted Images Based on Max Width MOD.

Code: Select all

##############################################################
##
## Files To Edit:      6
##      admin/admin_board.php
##      admin/page_header_admin.php
##      includes/page_header.php
##      templates/SubSilver/admin/board_config_body.tpl
##      templates/SubSilver/overall_header.tpl
##      templates/SubSilver/simple_header.tpl
##
##############################################################
## 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 (
'max_image_width', '400'
);
#
#-----[ OPEN ]------------------------------------------
#
templates/SubSilver/admin/board_config_body.tpl
#
#-----[ FIND ]------------------------------------------
#
	<tr>
		<td class="row1">{L_ALLOW_BBCODE}</td>
		<td class="row2"><input type="radio" name="allow_bbcode" value="1" {BBCODE_YES} /> {L_YES}&nbsp;&nbsp;<input type="radio" name="allow_bbcode" value="0" {BBCODE_NO} /> {L_NO}</td>
	</tr>
#
#-----[ AFTER, ADD ]------------------------------------------
#
<!-- start mod : Resize Posted Images Based on Max Width -->
	<tr>
		<td class="row1">{L_MAX_IMAGE_WIDTH} <br /><span class="gensmall">{L_MAX_IMAGE_WIDTH_EXPLAIN}</span></td>
		<td class="row2"><input class="post" type="text" size="20" maxlength="255" name="max_image_width" value="{MAX_IMAGE_WIDTH}" /></td>
	</tr>
<!-- fin mod : Resize Posted Images Based on Max Width -->
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_admin.php
#
#-----[ FIND ]------------------------------------------
#
$lang['Allow_BBCode'] = 'Allow BBCode';
#
#-----[ AFTER, ADD ]------------------------------------------
#
$lang['Max_image_width'] = 'Maximum width of images [px]'; // mod : Resize Posted Images Based on Max Width
$lang['Max_image_width_explain'] = 'The maximum width images in messages are allowed to have. Images that are wider than this amount of pixels are resized automatically.'; // mod : Resize Posted Images Based on Max Width
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_board.php
#
#-----[ FIND ]------------------------------------------
#
	"L_ALLOW_BBCODE" => $lang['Allow_BBCode'],
#
#-----[ AFTER, ADD ]------------------------------------------
#

//-- start mod : Resize Posted Images Based on Max Width ----------------------------------
	'L_MAX_IMAGE_WIDTH' => $lang['Max_image_width'],
	'L_MAX_IMAGE_WIDTH_EXPLAIN' => $lang['Max_image_width_explain'],
//-- fin mod : Resize Posted Images Based on Max Width ------------------------------------

#
#-----[ OPEN ]------------------------------------------
#
admin/page_header_admin.php
#
#-----[ FIND ]------------------------------------------
#
	'U_INDEX' => append_sid('../index.'.$phpEx),
#
#-----[ AFTER, ADD ]------------------------------------------
#

//-- start mod : Resize Posted Images Based on Max Width ----------------------------------
	'MAX_IMAGE_WIDTH' => $board_config['max_image_width'],
//-- fin mod : Resize Posted Images Based on Max Width ------------------------------------

#
#-----[ OPEN ]------------------------------------------
#
includes/page_header.php
#
#-----[ FIND ]------------------------------------------
#
	'U_RMW_JSLIB' => $phpbb_root_path . 'templates/rmw_jslib.js',
#
#-----[ AFTER, ADD ]------------------------------------------
#
	'MAX_IMAGE_WIDTH' => $board_config['max_image_width'],
#
#-----[ OPEN ]------------------------------------------
#
templates/SubSilver/overall_header.tpl
#
#-----[ FIND ]------------------------------------------
#
var rmw_max_width = 400;
#
#-----[ REPLACE WITH ]------------------------------------------
#
var rmw_max_width = {MAX_IMAGE_WIDTH};
#
#-----[ OPEN ]------------------------------------------
#
templates/SubSilver/simple_header.tpl
#
#-----[ FIND ]------------------------------------------
#
var rmw_max_width = 400;
#
#-----[ REPLACE WITH ]------------------------------------------
#
var rmw_max_width = {MAX_IMAGE_WIDTH};
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Last edited by bLACKADDER2 on Sat May 12, 2007 6:14 pm, edited 1 time in total.
diabolic.bg
Registered User
Posts: 447
Joined: Mon Dec 11, 2006 3:41 pm
Location: Bulgaria, Sofia
Contact:

Re: [2.0.11] Resize Posted Images Based on Max Width

Post by diabolic.bg »

Aquilla wrote: Blisk,

I never could get this mod to work with IE on my forums either, so I ended up using this one instead.

Hope that helps.

I have tested it.
Yes it is works with IE, Opera and Firefox, but it damage banners links

Code: Select all

[url=http://mysite.com][img]http://mybanner.jpg[/img][/url]
and also

Code: Select all

[url=http://mybanner.jpg][img]http://mybanner_small.jpg[/img][/url]
.
:( 8O
fatihbaz
Registered User
Posts: 2
Joined: Tue Apr 11, 2006 2:21 am

Re: [2.0.11] Resize Posted Images Based on Max Width

Post by fatihbaz »

link dead :(
bLACKADDER2
Registered User
Posts: 8
Joined: Wed Mar 28, 2007 7:00 pm

Re: [2.0.11] Resize Posted Images Based on Max Width

Post by bLACKADDER2 »

whiskey_peat
Registered User
Posts: 32
Joined: Mon Mar 26, 2007 1:48 pm

Re: [2.0.11] Resize Posted Images Based on Max Width

Post by whiskey_peat »

Please Help !
I tryed installing the MOD, but because of some reason it didn't work. Uninstaled it and now all my posted images are gone :(
When posting text with different font or color I get this:

Code: Select all

Parse error: parse error, unexpected '<' in /home/www/ivaiva98.freehostia.com/phpBB-2.0.21/phpBB2/includes/bbcode.php(89) : eval()'d code on line 21

Warning: Cannot modify header information - headers already sent by (output started at /home/www/ivaiva98.freehostia.com/phpBB-2.0.21/phpBB2/includes/bbcode.php(89) : eval()'d code:21) in /home/www/ivaiva98.freehostia.com/phpBB-2.0.21/phpBB2/includes/page_header.php on line 483
Also on every topic page appears:

Code: Select all

Parse error: parse error, unexpected '<' in /home/www/ivaiva98.freehostia.com/phpBB-2.0.21/phpBB2/includes/bbcode.php(89) : eval()'d code on line 21
Can someone please please help :(
whiskey_peat
Registered User
Posts: 32
Joined: Mon Mar 26, 2007 1:48 pm

Re: [2.0.11] Resize Posted Images Based on Max Width

Post by whiskey_peat »

Fixed it, but I still get the "parse error" message when instaling the MOD.
User avatar
Raimon
Former Team Member
Posts: 12088
Joined: Tue May 30, 2006 5:31 pm
Location: Netherlands
Name: Raimon Meuldijk
Contact:

Re: [2.0.11] Resize Posted Images Based on Max Width

Post by Raimon »

Check your bbcode.php and your bbcode.tpl you have made a fold with adding this mod.
Need phpBB installation, extenstions, Styles or integrate phpBB with you website?
Contact me @ www.raimon.nl for fair prices and good service!
ilmasterx
Registered User
Posts: 75
Joined: Tue Jan 11, 2005 10:08 pm
Contact:

Re: [2.0.11] Resize Posted Images Based on Max Width

Post by ilmasterx »

i'm installed this mod but i'v this error

Code:
Line: 103
Char: 2
Error: 'rmw_max_width' not define
Code: 0


in other page
Code:
Line: 50
Char: 48
Error: Previst ';'
Code: 0


i have version 2.0.22

where is the error???
Blisk
Registered User
Posts: 270
Joined: Wed Aug 20, 2003 10:43 am
Location: Slovenia

Re: [2.0.11] Resize Posted Images Based on Max Width

Post by Blisk »

This mod doesn't work ok.
So I installed this one.
find this in bbcode.tpl it is only a part of file

Code: Select all

<!-- BEGIN img -->
and replace with this

Code: Select all

<!-- BEGIN img --><img src="{URL}" alt="Image" title="Image" border="0" onload="if(this.width > screen.width-454) {this.width=(screen.width-454); this.className='clickable'; }" onclick="if(this.width >= screen.width-454) { window.open('{URL}', '_blank'); return false; }" alt="Klikni za večjo sliko" /><!-- END img -->
It works in IE and Firefox
Post Reply

Return to “[2.0.x] MOD Database Cleanup”