[ABD] AIR-box Auto Image Resizer Box

Any abandoned MODs will be moved to this forum.

WARNING: MODs in this forum are not currently being supported or maintained by the original MOD author. Proceed at your own risk.
Forum rules
IMPORTANT: MOD Development Forum rules

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
Locked
rufuz
Registered User
Posts: 249
Joined: Wed Oct 17, 2007 8:07 am
Location: Rome - New York - Rome - New York - and on...

[ABD] AIR-box Auto Image Resizer Box

Post by rufuz »

ImageModification Name: AIR-box Auto Image Resizer
Author: Riccardo Budini @ http://www.unframe.com
Modification Description:: This mod resizes posted large images to fit in your layout and shows them in a lightbox. It is based on a small script (airbox.js) that also includes Slimbox (Christophe Beyls).
It doesn't touch all other images like banner images, etc.. as well signature images.
It uses [img] bbcode, or a custom [slideshow] bbcode to create slideshows with titled images.
It is possible to combine [url] and [img] tags to link resized images and using standard bbcode.
Attachments images also are resized and show in a lightbox.
Users can post their Flickr images in a flash slideshow.
Installation is easy and requires modding of 1 line into 3 files only (one of them is a template file) and no database changes.
All this means you'll have no problems upgrading your board in the future. All changes and additions are tagged to easily locate them after install. Original lines are preserved through comments.

Prosilver and Subsilver2, others styles could be easily adapted.
It requires Mootools 1.1 (included). total size of scripts is ~32KB.
It has been succesfully tested with Firefox 2.0 - 3.0, Internet Exporer 6.0 - 7.0

Modification Version:: RC 06

Phpbb version:: 3.0.6

Features:
  • -Resizes posted images to desired width (only images in posts, doesn't touch banners and all other types)
  • -Show resized images in a lightbox when clicked, a slideshow is automatically created between images (remote or attachments) in the same post
  • -It works with attachments images as well
  • -It doesn't affect other images like banner and signature images. Use in combo with [url] tag is possible
  • -Uses img bbcode or optionally a custom slideshow bbcode to create slideshows with titles
  • -is possible to combine [url] and [img] tags to link resized images and using standard bbcode.
  • -Creates flash slideshows from Flickr
  • -Uses DOMready function: the script is ready to work before page and images are loaded

History:
  • RC06 -fixed --> Signature images don't show in lightbox and are not clickable (only url linked images).
    -fixed --> Some Subsilver 2 theme tuning.
    -fixed --> onload function in the resizer js has been reintroduced and the conflict with quick reply script has been solved.
    -fixed --> Various typos
    - rel RC 05 - fixed --> typo in overall_footer.html : scripts now go before </body></html>
    - fixed --> new feature "quick reply" introduced by phpbb 3.0.6 now shows as expected
    - fixed --> signature images don't show in a lightbox anymore
  • -rel. RC 04 fixed --> Images are resized once all them are loaded. Now they resize while they are loading
  • -rel. RC 03 Added --> Slideshow is set as default for all posted images (remote and attachments) in a post. Now if you post more than one image roll over next and prev button will show up.
    Removed --> Slideshow custom tags, as they are not needed anymore
    Fixed --> A missing tag in subsilver2. (thanks Odklizec)
  • -rel. RC 02 Fixed --> A bug making disappear linked images in signature. | Added --> A db query to fix old attachments tables (thanks Glyphon) Upadate of DYI. | Added --> Alternative code in airbox.js to set width relative to document. (thanks Iftitaj) Upadate of DYI.
  • -rel. RC 01b Fixed --> Some Typos | Added --> link to reference page in styles/prosilver or subsilver2/template/overall_footer.html - must be added.
  • -rel. RC 01 Fixed --> Some URL bbcodes stop working, now all are ok.
    Fixed --> Typos in includes/bbcode.php generating php errors.
  • -rel. 0.9.5b Fixed--> img did'nt show in Lbox since prev. release.
  • -rel. 0.9.5 -Added --> Use of ModX 1.2.1
    Added -->As thousands of you requested it :) , a combination of [url] and [img] is now possible. Images wrapped into [url] tags are still resized but won't open in lbox when clicked, instead will redirect you to posted url, as espected and using solely standard bbcode.
  • -rel. 0.9.3 -Change --> moved lines from overall_header to overall_footer
    Added --> Subsilver2 style (thanks Goztow)
  • -rel. 0.9.2b -Fix --> styles/prosilver/template/attachment.html
  • -rel. 0.9.2 -Change --> Signature images now automaticly don't show in lightbox. BBcode [signature-img] is not needed anymore and deprecated. (thanks Goztow!)
  • Added --> DIY instructions for signature in admin panel (thanks Goztow)
  • Fixed --> attachments (styles/prosilver/template/attachment.html)
  • Added --> DIY instructions to bypass I.E.6/7 bug in conjunction with other mods to post videos
  • -rel. 0.9.1b -Fixed - id -->to class in includes/bbcode.php
  • -rel. 0.9.1 -Fixed - only the first image in a page was resized (issue affecting 0.9.0 only)
  • Fixed - slideshow bbcode Fixed attachments code and added related DIY instructions
  • Fixed signature bbcode
  • Fixed - some typos
  • -rel. 0.9.0 - Js Resizer rewritten from scratch. Now only images in posts are resized. All other images (including banner) are not resized and do not show in a lightbox.
  • -rel. 0.8.9b - Some typos corrected (thanks iftitaj).
    Installation time changed (due to features added)
  • -rel. 0.8.9 - Added bbcode for Flickr slideshows
  • -rel. 0.8.7 - Added lightbox effect to attachments images
  • -rel. 0.8.6 - fixed errors in comments in bbcode.php
  • -rel. 0.8.5 - custom bbcode added for images in signature. Now they don't show in a lightbox and can be linked to a url using in combo with [url] bbcode. Some typos corrected in the xml file.
  • -rel. 0.8.0 - initial release
[/list]

Air-Box reference page: http://www.unframe.com/info/open-source ... ogram.html

Support Forum: http://www.unframe.com/forum/viewforum.php?f=86

Demo URL: http://www.unframe.com/forum/viewtopic.php?f=91&t=34

Modification Download: http://www.unframe.com/info/air-box-for-phpbb.html

If you install it correctly and found it nice you may want to comment and showcase your forum here: http://www.unframe.com/forum/viewforum.php?f=86

bye, ricc.
Last edited by rufuz on Thu Apr 08, 2010 5:40 pm, edited 38 times in total.
xxxgamer
Registered User
Posts: 574
Joined: Mon Jul 16, 2007 11:25 pm

Re: [BETA] AIR-box Auto Image Resizer Box

Post by xxxgamer »

Oh very nice mod :) Im gona try and integrate this into another page in phpbb.

Nice work dude.
XToF.be
Registered User
Posts: 61
Joined: Thu Jun 28, 2007 10:52 am
Contact:

Re: [BETA] AIR-box Auto Image Resizer Box

Post by XToF.be »

Hi rufuz,

Thanks for this mod.
Can you give us the BBCode definition and HTML code to create the custom Slideshow BBCode tag?

EDIT:
It's ok, I found it in the DIY instructions. ;)
rufuz
Registered User
Posts: 249
Joined: Wed Oct 17, 2007 8:07 am
Location: Rome - New York - Rome - New York - and on...

Re: [BETA] AIR-box Auto Image Resizer Box

Post by rufuz »

thanks to you, guys!

I setup a section for quickly testing images: http://www.provisum-illumina.com/forum/ ... m.php?f=92

or if you have nice images, here: http://www.provisum-illumina.com/forum/ ... m.php?f=93
(all in all it is a photography website!)

simple bbcode instructions included in the announcement.

please, as always, don't post images with inappropriate content!

bye

ricc.
Fridge
Registered User
Posts: 307
Joined: Sat Nov 11, 2006 1:41 am
Location: Rotterdam, The Netherlands
Name: Martin
Contact:

Re: [BETA] AIR-box Auto Image Resizer Box

Post by Fridge »

Looks like a very useful modification, i have a little question dough.....
Does the image resizer affect images in the sig of a user ?
rufuz
Registered User
Posts: 249
Joined: Wed Oct 17, 2007 8:07 am
Location: Rome - New York - Rome - New York - and on...

Re: [BETA] AIR-box Auto Image Resizer Box

Post by rufuz »

Fridge wrote:Looks like a very useful modification, i have a little question dough.....
Does the image resizer affect images in the sig of a user ?
In this iniatial realease all images inserted with an img bbcode are resized. Then images in signature should be resized, too.
Since signature width is the same of post view, it should be an advantage to have them resized ( this will happen only when they exceed layout width)... is that right? let me know if you agree and ...let me test (in my forum I disabled imgs in signature).

bye

ricc.
Fridge
Registered User
Posts: 307
Joined: Sat Nov 11, 2006 1:41 am
Location: Rotterdam, The Netherlands
Name: Martin
Contact:

Re: [BETA] AIR-box Auto Image Resizer Box

Post by Fridge »

you're absolutely right about the fact that resizing images in the sig of a user is a advantage but that is not the reason of my question.....
When a image is smaller then the max size, is it clickable and shows up in the airbox anyway ?
Some users have clickable userbars to there own page and other similair mods like this mod are messing this up.
rufuz
Registered User
Posts: 249
Joined: Wed Oct 17, 2007 8:07 am
Location: Rome - New York - Rome - New York - and on...

Re: [BETA] AIR-box Auto Image Resizer Box

Post by rufuz »

yes it is clickable...
Considering that generally who puts clickable usersbars in signature are a bit more skilled than normal users,
an immediate solution could be creating a custom bbcode, something like [sig-img]. If you don't think that could be confusing for users, I can do it... while studying another solution...

bye
ricc.

[edit] added custom bbcode for images in signature.
rufuz
Registered User
Posts: 249
Joined: Wed Oct 17, 2007 8:07 am
Location: Rome - New York - Rome - New York - and on...

Re: [BETA] AIR-box Auto Image Resizer Box

Post by rufuz »

Updated to rel. 0.8.5
- Custom bbcode added for images in signature. Now they don't show in a lightbox and can be linked to a url using in combo with [url] bbcode.
- Some typos corrected in the xml file.

bye

ricc.
FinalBoss
Registered User
Posts: 17
Joined: Fri Apr 20, 2007 9:19 pm

Re:[Solved]

Post by FinalBoss »

Anyway this can work on other styles? I only use prosilver as a test forum. The other styles I have don't possess the

Code: Select all

<script type="text/javascript" src="{T_TEMPLATE_PATH}/forum_fn.js"></script>
.

I tried using it with Industrial Revolution, but it didn't work. I tried it with prosilver and found it very impressive. You did a great job with it, just too bad I can't get it to work with my other styles.
Last edited by FinalBoss on Fri Jul 25, 2008 1:45 am, edited 1 time in total.
rufuz
Registered User
Posts: 249
Joined: Wed Oct 17, 2007 8:07 am
Location: Rome - New York - Rome - New York - and on...

Re: [BETA] AIR-box Auto Image Resizer Box

Post by rufuz »

FinalBoss wrote:Anyway this can work on other styles? I only use prosilver as a test forum. The other styles I have don't possess the

Code: Select all

<script type="text/javascript" src="{T_TEMPLATE_PATH}/forum_fn.js"></script>
.

I tried using it with Industrial Revolution, but it didn't work. I tried it with prosilver and found it very impressive. You did a great job with it, just too bad I can't get it to work with my other styles.
Hi finalboss, the strenghtness of this mod should be the ease of install and upgrade. And it should work with other styles too, unless conflicting with other javascripts:

just forget about:

Code: Select all

<script type="text/javascript" src="{T_TEMPLATE_PATH}/forum_fn.js"></script>
and try to put the code:

Code: Select all

	<!-- AIR-Box mod addition - starts here -->
	<script type="text/javascript" src="{T_TEMPLATE_PATH}/mootools.js"></script>
	<script type="text/javascript" src="{T_TEMPLATE_PATH}/airbox.js"></script>
	<link rel="stylesheet" href="{T_THEME_PATH}/slimbox_css/slimbox.css" type="text/css" media="screen" />
	<!-- AIR-Box mod addition - ends here -->
anywhere between <head> and </head> and right after whatever </script> in the overall_header.html

try it with that scheme in various positions. If it you can't get it, give me the link of industrial rev tpl and I'll try to solve it for you.

bye
ricc.
FinalBoss
Registered User
Posts: 17
Joined: Fri Apr 20, 2007 9:19 pm

Re: [BETA] AIR-box Auto Image Resizer Box

Post by FinalBoss »

Thanks for the reply. It works, I just forgot to include the files to that particular style. Sorry about that, lol. On another note, is there anyway this can work for Attatchments?
rufuz
Registered User
Posts: 249
Joined: Wed Oct 17, 2007 8:07 am
Location: Rome - New York - Rome - New York - and on...

Re: [BETA] AIR-box Auto Image Resizer Box

Post by rufuz »

ok you can put a solved mark in your post ;)

attachments are resized but show up in the traditional way... in this release... let us see if in the next I can add an option for this..

bye

ricc.
jeerima
Registered User
Posts: 19
Joined: Thu Jul 17, 2008 1:45 am

Re: [BETA] AIR-box Auto Image Resizer Box

Post by jeerima »

i keep getting an error when i try to install the bbcode.php:

Parse error: syntax error, unexpected '<', expecting ')' in /homepages/0/d250149980/htdocs/name/phpBB/includes/bbcode.php on line 410

i followed the instructions and removed:

Code: Select all

'img'		=> '<img src="$1" alt="' . $user->lang['IMAGE'] . '" />',
and replaced that with this:

Code: Select all

				<!-- AIR-Box mod change - starts here -->
	<!--  original line starts here
	'img'		=> '<img src="$1" alt="' . $user->lang['IMAGE'] . '" />',
 	original line ends here -->
	'img'		=> '<a href="$1" rel="lightbox" /><img src="$1" alt="' . $user->lang['IMAGE'] . '" /></a>',
<!-- AIR-Box mod change - ends here -->
so that area in the code looks like this:

Code: Select all

	function bbcode_tpl($tpl_name, $bbcode_id = -1, $skip_bitfield_check = false)
	{
		static $bbcode_hardtpl = array();
		if (empty($bbcode_hardtpl))
		{
			global $user;
			
			$bbcode_hardtpl = array(
				'b_open'	=> '<span style="font-weight: bold">',
				'b_close'	=> '</span>',
				'i_open'	=> '<span style="font-style: italic">',
				'i_close'	=> '</span>',
				'u_open'	=> '<span style="text-decoration: underline">',
				'u_close'	=> '</span>',
				<!-- AIR-Box mod change - starts here -->
	<!--  original line starts here
	'img'		=> '<img src="$1" alt="' . $user->lang['IMAGE'] . '" />',
 	original line ends here -->
	'img'		=> '<a href="$1" rel="lightbox" /><img src="$1" alt="' . $user->lang['IMAGE'] . '" /></a>',
<!-- AIR-Box mod change - ends here -->
				'size'		=> '<span style="font-size: $1%; line-height: normal">$2</span>',
				'color'		=> '<span style="color: $1">$2</span>',
				'email'		=> '<a href="mailto:$1">$2</a>'
			);
		}

		if ($bbcode_id != -1 && !$skip_bitfield_check && !$this->template_bitfield->get($bbcode_id))
		{
			return (isset($bbcode_hardtpl[$tpl_name])) ? $bbcode_hardtpl[$tpl_name] : false;
		}

		if (empty($this->bbcode_template))
		{
			if (($tpl = file_get_contents($this->template_filename)) === false)
			{
				trigger_error('Could not load bbcode template', E_USER_ERROR);
			}
and line 410 error is the line w/ the AIR code. any suggestions?
rufuz
Registered User
Posts: 249
Joined: Wed Oct 17, 2007 8:07 am
Location: Rome - New York - Rome - New York - and on...

Re: [BETA] AIR-box Auto Image Resizer Box

Post by rufuz »

yes, jeerima my fault... I rushed a bit...

this is the right code:

Code: Select all

//-------- AIR-Box mod change - starts here --------
	      		//original line starts here
				//'img'		=> '<img src="$1" alt="' . $user->lang['IMAGE'] . '" />',
 				//original line ends here --------
				'img'		=> '<a href="$1" rel="lightbox" /><img src="$1" alt="' . $user->lang['IMAGE'] . '" /></a>',			
//-------- AIR-Box mod change - ends here --------
I'm correcting the file -->0.8.6

bye
ricc.
Locked

Return to “[3.0.x] Abandoned MODs”