[2.0.19] Post Image Max. Size

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Post Reply

Rating:

Excellent!
25
60%
Very Good
7
17%
Good
6
14%
Fair
1
2%
Poor
3
7%
 
Total votes: 42

Extensions Robot
Extensions Robot
Extensions Robot
Posts: 27921
Joined: Sat Aug 16, 2003 7:36 am

[2.0.19] Post Image Max. Size

Post by Extensions Robot » Mon May 30, 2005 10:36 pm

MOD Name: Post Image Max. Size
Author: Swizec
MOD Description: Admin can set the maximum display size of images displayed in posts. Images bigger than that are shrunk and turned into a link to the normal sized version.
This mod also enables you to align your image left right or center with img=left, img=center, img=right

Versions 1.2.0 and above also have the load time issue everyone was nagging about fixed as best as I can.



MOD Version: 1.2.7 (Updated 01/04/06)

Download File: post_img_1.2.7.mod
mods overview page: View
File Size: 10398 Bytes

Security Score: 0

Support for this MOD needs to be asked within this topic. The phpBB Teams are not responsible or required to give anyone support for this MOD. By installing this MOD, the phpBB Support Team or phpBB MODifications Team may not be able to provide support.

This MOD has only been tested by the phpBB MOD Team with the phpBB version in the topic title. It may not work in any other versions of phpBB.
Last edited by Extensions Robot on Mon Apr 30, 2007 12:31 am, edited 1 time in total.
(this is a non-active account manager for the phpBB Extension Customisations Team)

wGEric
Former Team Member
Posts: 8805
Joined: Sun Oct 13, 2002 3:01 am
Location: Friday
Name: Eric Faerber
Contact:

Post by wGEric » Fri Jun 10, 2005 6:16 pm

MOD Validated/Released

Notes:
If images bigger than what the administrator of the board sets in the Admin Contrl Panel are posted, then the image is shrunk down to the correct size so that it doesn't break the boards layout.
Eric

Swizec
Former Team Member
Posts: 1701
Joined: Mon Mar 10, 2003 9:42 pm
Location: Slovenia
Contact:

Post by Swizec » Fri Jun 10, 2005 6:21 pm

hope you guys like this :)

markus_petrux
Former Team Member
Posts: 1887
Joined: Wed Apr 23, 2003 7:11 am
Location: Girona, Catalunya (Spain)
Contact:

Post by markus_petrux » Fri Jun 10, 2005 7:32 pm

Very nice. A couple of comments:

1) Whenever you need to update this MOD, please end the IMG tag with /> so it gets XHTML compliant.

2) Have you thought about caching the result of the image_parse job (which might take too much server time depending on how many images are posted on a topic page). ie. you're actually rewritting the [img] BBCode into an "internal" [thmbimg] BBCode at second_pass time (render time). Maybe you could do the job at first_pass time, so the job gets done just once, at post time.

Not sure if 2 is possible, though. But, if it is... I would definitively vote for this MOD to be the best to approach the problem (I think there are already one or two MODs with same goal on the MODDB).
EasyMOD Standards | MOD Template Actions | MODs in Development Rules
Useful information for MOD Authors | MOD Queue Stats | Search MODs
Write SQL/DDL portable to all SQL servers supported by phpBB!
Get EasyMOD 0.3.0! | Suport al phpBB en Català!
8)

Swizec
Former Team Member
Posts: 1701
Joined: Mon Mar 10, 2003 9:42 pm
Location: Slovenia
Contact:

Post by Swizec » Fri Jun 10, 2005 7:52 pm

1. did not know that existed :)

2. that would be my image cacher, yet to be validated :)

markus_petrux
Former Team Member
Posts: 1887
Joined: Wed Apr 23, 2003 7:11 am
Location: Girona, Catalunya (Spain)
Contact:

Post by markus_petrux » Fri Jun 10, 2005 7:56 pm

Swizec wrote: 1. did not know that existed :)

Yup. Forgot to add... also the alt attribute is required by XHTML, alt="" would do the trick.
Swizec wrote: 2. that would be my image cacher, yet to be validated :)

Sounds promising ;)

Thanks for quick answer. :)
EasyMOD Standards | MOD Template Actions | MODs in Development Rules
Useful information for MOD Authors | MOD Queue Stats | Search MODs
Write SQL/DDL portable to all SQL servers supported by phpBB!
Get EasyMOD 0.3.0! | Suport al phpBB en Català!
8)

pichirichi
Registered User
Posts: 83
Joined: Wed Jun 02, 2004 5:34 am
Contact:

Post by pichirichi » Sat Jun 11, 2005 7:30 pm

Since it is not possible to download the MOD right now I have to ask:
What's the different between this mod and this mod?


thanks
Last edited by pichirichi on Sat Jun 11, 2005 10:43 pm, edited 1 time in total.

Swizec
Former Team Member
Posts: 1701
Joined: Mon Mar 10, 2003 9:42 pm
Location: Slovenia
Contact:

Post by Swizec » Sat Jun 11, 2005 7:40 pm

actually, there's no difference,

I just didn't know it existed untill just a few days before this got validated :)

User avatar
3Di
Former Team Member
Posts: 13792
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Post by 3Di » Sat Jun 11, 2005 7:49 pm

MOD Name: Post Image Max. Size
Author: Swizec
MOD Description: Admin can set the maximum size of images displayed in posts. Images bigger than that are shrunk and turned into a link to the normal sized version.

vs.
MOD Name: Limit Image Width
Author: Vic D'Elfant
MOD Description: This MOD will scale each image in a post so it does not exceed the maximum image width set by you. Smaller images will retain their original size. When clicking such a scaled down image it will open at its original size in a separate popup window.

The image dimensions will be cached in order to avoid unnecessary delays when loading a page and checking the image dimensions


Reading these descpriptions I have thought there are differencies, would you mind to explain us?

Best Regards. :)
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
👨‍🏫 | Take a tour to | The Studio | 👨‍🏫

Swizec
Former Team Member
Posts: 1701
Joined: Mon Mar 10, 2003 9:42 pm
Location: Slovenia
Contact:

Post by Swizec » Sat Jun 11, 2005 8:31 pm

yeah, it's the same thing, safe for that mod caching which images need to be scaled so it doesn't check them again, atleast thats how I understood the description

pichirichi
Registered User
Posts: 83
Joined: Wed Jun 02, 2004 5:34 am
Contact:

Post by pichirichi » Sat Jun 11, 2005 10:44 pm

Swizec wrote: actually, there's no difference,

I just didn't know it existed untill just a few days before this got validated :)


thanks

markus_petrux
Former Team Member
Posts: 1887
Joined: Wed Apr 23, 2003 7:11 am
Location: Girona, Catalunya (Spain)
Contact:

Post by markus_petrux » Sun Jun 12, 2005 2:59 am

However, this MOD is simpler. To cache the getimagesize() result, it could simply do the job at first_pass time to replace the [img] bbcode with the [thmbimg] (already used by this MOD), so it gets saved in the posts_text table at post time (as if the user had used the [thmbimg] bbcode) with the image width et all.

IMHO, it looks interesting...
EasyMOD Standards | MOD Template Actions | MODs in Development Rules
Useful information for MOD Authors | MOD Queue Stats | Search MODs
Write SQL/DDL portable to all SQL servers supported by phpBB!
Get EasyMOD 0.3.0! | Suport al phpBB en Català!
8)

pichirichi
Registered User
Posts: 83
Joined: Wed Jun 02, 2004 5:34 am
Contact:

Post by pichirichi » Sun Jun 12, 2005 6:34 am

markus_petrux wrote: However, this MOD is simpler. To cache the getimagesize() result, it could simply do the job at first_pass time to replace the [img] bbcode with the [thmbimg] (already used by this MOD), so it gets saved in the posts_text table at post time (as if the user had used the [thmbimg] bbcode) with the image width et all.

IMHO, it looks interesting...


Now that I've managed to download it is sure look simpler. I'll try to find a way to incluede the [img=align] and [siteimg] for smartor album into this MOD. It will solve alot of issues on my site.

thanks!

pichirichi
Registered User
Posts: 83
Joined: Wed Jun 02, 2004 5:34 am
Contact:

Support in image align MOD

Post by pichirichi » Sun Jun 12, 2005 3:42 pm

Hi,
I've implemented few updates in the MOD to support the image align MOD.
the changes ahs no influense on those who didn't implemented the image align MOD.

here are the chages:
replace the function image_parse in includes\bbcode.php

Code: Select all

function image_parse ( $post, $uid ) {

	global $board_config, $lang, $bbcode_tpl;

	preg_match_all( "/\[(img:$uid|img=right:$uid|img=left:$uid)\](\S+)\[\/(img:$uid)\]/i", $post, $matches); 

	foreach ( $matches[2] as $k => $img ) { 
		if ( !$size = @getimagesize( $img ) ) break; 
		$w = $size[0]; $h = $size[1]; 
		$size = makeimgsize ( $size[0], $size[1] ); 
		$img_align = strtok($matches[1][$k],":");
		switch($img_align)
		{
			case "img=right":
				$align = $lang['RIGHT'];
				break;
			case "img=left":
			case "img":
			default:
				$align = $lang['LEFT'];
				break;
		}			
		$first = $matches[1][$k]; 
		$secnd = $matches[3][$k]; 
		$find = "[" . $first . "]" . str_replace( '', '/', $img ) . "[/" . $secnd . "]"; 
		
		if ( !empty( $size ) )
		{
			$replace = $bbcode_tpl['thmbimg'];
			$seek = array( '{IMAGE}', '{WIDTH}', '{HEIGHT}', '{SIZE}', '{NOTICE}', '{ALIGN}' );
			$with = array( $img, $width, $height, $size, $lang['postimg_clickme'], $align );
			$replace = str_replace( $seek, $with, $replace );
			$post = str_replace( $find, $replace, $post );
		}
	}
	return $post;
}

replace the tag thmbimg in templates\subSilver\bbcode.tpl

Code: Select all

<!-- BEGIN thmbimg --><table cellspacing="5" cellpadding="3" border="0" align="{ALIGN}"><tr><td align="center"><a href="#" onclick="javascript: window.open( '{IMAGE}', 'imgpop',  'width={WIDTH},height={HEIGHT},status=no,toolbar=no,menubar=no' );"><img src="{IMAGE}" align="center" border="0" {SIZE}></a><br /><span class="gensmall"><i>{NOTICE}</i></span></td></tr></table><!-- END thmbimg -->

Swizec
Former Team Member
Posts: 1701
Joined: Mon Mar 10, 2003 9:42 pm
Location: Slovenia
Contact:

Post by Swizec » Sun Jun 12, 2005 4:54 pm

nice nice :)

very usefull, thanks

Post Reply

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