MyBB Community Forums

Full Version: [Release 1.4/1.6] Fit on Page (Update: v2.3 Released)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
EDIT: 09/09/2010
Plugin updated to v2.3
Read more about it here:
http://community.mybb.com/thread-53553-p...#pid570694
-------------------------
EDIT: 09/30/2009
Plugin updated to v2.2
Read more about it here:
http://community.mybboard.net/thread-535...#pid407384
-------------------------

EDIT: 08/17/2009
Plugin updated. v2.1 now out, read more about it here:
http://community.mybboard.net/thread-535...#pid390573
-------------------------

EDIT: 08/16/2009
Plugin updated. v2.0 now out, read more about it here:
http://community.mybboard.net/thread-535...#pid390014
-------------------------

This plugin resizes (scales down) large embeded images on the page that cause the page to run over. The scaling down is done by javascript on the client side and hence no extra load on the server.
Plugin is configurable by setting the max width to scale the images down to, you can also use auto and a percentage value to scale down to for fluid layouts.

NOTE: As with any javascript resizer, the image will first load up as usual and be scaled down after it loads up.

KNOWN ISSUE: [PARTIAL IN v2.0] If an image is posted using quickreply the image will not resize till the page is reloaded. I'm working on a fix for this and it will most probably involve a file edit of one of the jscripts of mybb.

ISSUE2: [RESOLVED IN v2.0] Do you have large header/banner or other large images on your site that are also getting resized which you do not want to resize? Read this post, 3 posts down


/**********************/
/* Fit on Page v1.0 by -G33K - */
/* MyBB v1.4.* Plugin */

DESCRIPTION:
Scales down or resizes large embeded images so as to avoid the page running over.

FEATURES:
- Configurable from settings page.
- Automatically adjusts according to screen size for fluid layouts.
- Fixed width option for fixed layouts
- Scaling is done on client side through javascript hence no extra load on the site's servers

INSTALL:
- Unzip/Unrar, upload inc/plugins/fitonpage.php, jscripts/fitonpage.js and inc/languages/english/fitonpage.lang.php to the respective directories on the server
- Activate the plugin from the Admin Panel, Plugins section
- Setup options from settings page.

UNINSTALL:
- Deactivate from the plugins page

[attachment=14858][attachment=14859]

Plugin Validated!
http://mods.mybboard.net/view/fit-on-page

Alternate download location:
http://geekplugins.com/

To check templates for edits: http://community.mybb.com/thread-53553-p...#pid582651
Nice and no need for the GD libraries, thanks.
Nice mod but it resizes my banner too. Anyway I can change this? Dodgy
EDIT: 08/16/09
This fix is not required for v2.0 of the plugin. I am removing the js file I attached to this post as it is no longer necessary.



--------------------------------------------------
(2009-07-25, 08:27 AM)Milnez Wrote: [ -> ]Nice mod but it resizes my banner too. Anyway I can change this? Dodgy

Oh damn! I totally overlooked the fact that some users will have large banners or other images on their pages.

To fix this:
1. Overwrite the jscripts/fitonpage.js with the one I've attached to this post.

2. Add a 'no_fop' class to any large image that you do not want to resize.

For example to prevent your header being resized, go to your header template and look for the img element which holds the logo and add class="no_fop". If you already have a class then add it like this: class="yourexistingclass no_fop"

For example, the default MyBB logo img element in the header template looks like this

<div class="logo"><a href="{$mybb->settings['bburl']}/index.php"><img src="{$theme['logo']}" alt="{$mybb->settings['bbname']}" title="{$mybb->settings['bbname']}" /></a></div>

After the changes it would look like this:

<div class="logo"><a href="{$mybb->settings['bburl']}/index.php"><img src="{$theme['logo']}" alt="{$mybb->settings['bbname']}" title="{$mybb->settings['bbname']}" class="no_fop" /></a></div>

OR

<div class="logo"><a href="{$mybb->settings['bburl']}/index.php"><img src="{$theme['logo']}" alt="{$mybb->settings['bbname']}" title="{$mybb->settings['bbname']}" class="someexistingclass no_fop" /></a></div>

This should fix it and if you have any problems let me know.
It seems like more trouble than it is worth just to have images resize ...
That works - G33K -. Thanks alot!
Thanks man, this is awesome


(2009-07-25, 10:24 AM)Bey Brad Wrote: [ -> ]It seems like more trouble than it is worth just to have images resize ...

this is called "ingratitude" in some places
you´re now with ghazal in my ignore list
(2009-07-25, 03:33 PM)aglioeolio Wrote: [ -> ]this is called "ingratitude" in some places
you´re now with ghazal in my ignore list

How can I be ungrateful for something I never asked for or wanted in the first place?

There is already an image resizer available ... this one seemed to be better, until it was revealed that you'd need to add a class to any image you want to not be resized, which is IMO, ridiculous and a huge thing to "overlook".
Is a great idea because dont make server load, but needs to fix the resize area, so, maybe you will move it to development subforum Wink
(2009-07-25, 06:16 PM)Bey Brad Wrote: [ -> ]How can I be ungrateful for something I never asked for or wanted in the first place?

There is already an image resizer available ... this one seemed to be better, until it was revealed that you'd need to add a class to any image you want to not be resized, which is IMO, ridiculous and a huge thing to "overlook".

Yes I really did overlook that and for that my apologies. Like I said in my first release thread the plugins I'll be releasing are those that I'm making to use on my site and put them up here for anyone else that might find them useful. I don't use large images for my header or anywhere else so didn't think about the effect of having those untill Milnez brought it to my attention.

The fix I've provided above is a quickfix and is to be used for only those that have a large header/banner image on their page which has a width larger than than the size/percentage they have set in the plugin, even then they only need to apply the class to the image that gets resized which they don't want, not every other image. For everyone else, this should work as it is.

I should have this fixed in the next release.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37