[2.0.11] Resize Posted Images Based on Max Width

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

Rating:

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

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

[2.0.11] Resize Posted Images Based on Max Width

Post by Extensions Robot » Sun Nov 28, 2004 9:58 pm

MOD Name: Resize Posted Images Based on Max Width
Author: spooky2280
MOD Description: This MOD resizes images within posts to make it so they don't break your layout. Images resized are made clickable and openable in a popup in full-size. You can specify a different max width for each of your themes. Images that do not exceed the max width are left as is. See the MOD in action: http://christianfecteau.com/rmw



MOD Version: 2.4.5 (Updated 01/27/05)

Download File: Resize_Posted_Images_Based_on_Max_Width_2.4.5.zip
mods overview page: View
File Size: 8287 Bytes

Security Score: 0
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)

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

Post by wGEric » Fri Dec 10, 2004 10:07 pm

MOD Validated/Released

Notes:
This MOD resizes images within posts to make it so they don't break your layout.
Eric

spooky2280
Registered User
Posts: 142
Joined: Tue Jul 20, 2004 8:48 pm

Post by spooky2280 » Fri Dec 10, 2004 10:26 pm

I won't be online 2005/02/23 and 2005/02/24

Thank you for approving my MOD. It is sincerely an honor for me to contribute to the OS community in which I believe strongly, and to contribute to the phpBB project in particular.

This board below is runinng the MOD where you can post as guest and test it:
http://www.christianfecteau.com/phpBB2/ ... um.php?f=1


For those who don't know what is EasyMod, here's a link where you can download, install, and learn to use EasyMod:
http://area51.phpbb.com/phpBB/viewtopic.php?t=15391


If you want support for a bug with the MOD, you must provide ALL these info with your question:
  • You post a link to the board where the problem is. Or, if you're concerned about privacy, you mail me that link at webmaster@christianfecteau.com
  • You describe all the steps I have to follow for reproducing that bug on your board.
  • If the bug occurs with a browser in particular, you provide the browser's name and the version number of that browser
  • You give me the version number of your phpBB (if you removed it from the footer)
  • You list all the MODs that you made to the board, or if there are too many, you list the ones that you think could conflict with mine and cause the bug. The same goes for themes. If you have more than one, you tell me which theme triggers the bug, AND you post links where I can download the source code of these MODs/themes. Don't just give me a MODs's title without a link.
I will not troubleshoot a bug if you don't provide all these info with your question.
Last edited by spooky2280 on Wed Feb 23, 2005 5:35 am, edited 4 times in total.

N@stY
Registered User
Posts: 93
Joined: Wed Nov 17, 2004 9:11 pm

Post by N@stY » Sat Dec 11, 2004 1:41 am

whats the differents between this one and this one http://www.phpbb.com/phpBB/viewtopic.php?t=224522

spooky2280
Registered User
Posts: 142
Joined: Tue Jul 20, 2004 8:48 pm

Post by spooky2280 » Sat Dec 11, 2004 2:04 am


msie
Registered User
Posts: 15
Joined: Mon Oct 04, 2004 5:42 am

Post by msie » Sat Dec 11, 2004 3:54 am

Excellent!
:D

NightriderXP
Registered User
Posts: 1418
Joined: Sat Oct 09, 2004 8:17 am
Location: Florida, US
Contact:

Post by NightriderXP » Sat Dec 11, 2004 9:34 am

Installed without any need for modification on my heavily modified 2.0.11 board using EasyMod. It works great in Opera 7.54 and on dial-up too. I'm sure that I will be receiving feedback from my Mozilla/Netscape/Firefox, SlimBrowser, and IE members too. If this works well with Mozilla/Netscape/Firefox, I will be a happy camper. Those seem to be the touchiest of all the browsers for my members...

Is there any chance of creating an ACP setting for the max width? It's not a huge deal to modify the overall-header.tpl and simple_header.tpl files, but it would be nice to have an ACP setting instead...

Nice MOD spooky!!!

:lol:

spooky2280
Registered User
Posts: 142
Joined: Tue Jul 20, 2004 8:48 pm

Post by spooky2280 » Sat Dec 11, 2004 11:13 am

http://www.flashpeak.com/sbrowser/ wrote: System Requirements
Win98+IE5 is recommended.

SlimBrowser... It's another one of those browsers that use the IE engine? Then there should be no problem.

It's been tested thouroughly with all W3C DOM versions of the other browsers you mentionned: Opera 7.54, old/new Geckos, and IE5+.

Implementing a different max width for each template in the ACP has a too bad "complicated vs. useful" ratio. I mean you set it once in your templates and that's it. It's not something that you change every day. Why clogging the board for such a trivial thing? If I ever decide to do it, it's gonna be just for the fun of experimenting and learning more about the source code of phpBB. It's certainly not gonna be for the necessity of it. :lol:

I would modify admin_styles.php, styles_list_body.tpl, and add a field to the themes' table.

NightriderXP
Registered User
Posts: 1418
Joined: Sat Oct 09, 2004 8:17 am
Location: Florida, US
Contact:

Post by NightriderXP » Sun Dec 12, 2004 3:47 am

Yes I do believe that SlimBrowser may run off of the IE libraries. It rarely causes any problems with our community. Whenever there is a problem, it's almost always from a Netscape/Mozilla/Firefox user... :cry:

I was hoping for an ACP setting since I am not the only Admin on my board. The other is not as technically inclined, so it would be nice if she had the means to modify most settings through the ACP should something happen where I couldn't be there to do it myself...

Since this width setting would apply to all Templates, wouldn't it be better to have a global setting rather than forcing a modification in each template? I am a programmer, but I don't know php enough to understand what can and can't be feasibly accomplished. Hopefully with help from you and others, I will be better able to understand what is possible in this coding environment in the near future...

:lol:

spooky2280
Registered User
Posts: 142
Joined: Tue Jul 20, 2004 8:48 pm

Post by spooky2280 » Sun Dec 12, 2004 4:24 am

No, the width wouldn't be global for all styles, even if I make it ACP configurable. There are styles with a 700px (or even less) centered table. You can't have the same max width for those as for exemple the subSilver style which fill up the screen width, whatever it is. Login to the test account on my demo board and change the style to Skaidon, you'll see what I mean. The max width for Skaidon is set to 150px:
max_width for each style installed on this board:

Solaris (300)
Skaidon (150) this design is buggy anyway
all the other styles (400)


I would add a field in the Theme Settings page. You would change the max width for each style just like you change the CSS Stylesheet and colors on this page.

The max width for each style would be saved in the database and retreived along with the other board style settings whenever a page is loaded.

You're lucky, I'm bored this week-end. Maybe I'll code it. But it's no picnic... I've never coded a MOD that alters the database. I guess there are a whole bunch of MOD standards to follow for that as well. I'll have a look at how the others do it and get back to you.

NightriderXP
Registered User
Posts: 1418
Joined: Sat Oct 09, 2004 8:17 am
Location: Florida, US
Contact:

Post by NightriderXP » Sun Dec 12, 2004 4:54 am

For me, the SQL code would be the easy part. It's the php coding that I still have to learn. I'm a Delphi programmer so the php environment is quite different from what I'm used to. SQL is right up my ally though. There are syntax variations of SQL for each DB type, but they are all very similar...

:lol:

4rum
Registered User
Posts: 60
Joined: Sun Jul 04, 2004 3:21 am

Post by 4rum » Sun Dec 12, 2004 4:02 pm

Excellent thanks, just installed on a 2.0.11 board . :D

Would it be possible to somehow exclude signatures. Our signature limit is 468 width and I would like to set the MODification width to 300.

It's not a big deal, but would be nice to use a max of 300 without resizing sigs.

spooky2280
Registered User
Posts: 142
Joined: Tue Jul 20, 2004 8:48 pm

Post by spooky2280 » Mon Dec 13, 2004 1:00 am

NightriderXP, the ACP will wait: I have 3 feet of snow to shovel, otherwise the mailman won't walk to my door and deliver my mail tomorrow. Our mailmen in Quebec don't have the "neither rain, snow, sleet or hail." credo. :roll:

4rum, there are 2 possible answers:
  1. If this "signature limit" MOD has been validated by the phpBB MOD team, give me the link to that MOD and I will see what I can do in the future to make my MOD compatible with this other one.
  2. If it's not a MOD validated by phpBB, post a link to your board or email it to me (see my first post that I edited). Also post a link to the source code of this MOD if you have it. I will see what I can do to tweak my MOD for your board.

NightriderXP
Registered User
Posts: 1418
Joined: Sat Oct 09, 2004 8:17 am
Location: Florida, US
Contact:

Post by NightriderXP » Mon Dec 13, 2004 8:36 am

spooky2280 wrote: NightriderXP, the ACP will wait: I have 3 feet of snow to shovel, otherwise the mailman won't walk to my door and deliver my mail tomorrow. Our mailmen in Quebec don't have the "neither rain, snow, sleet or hail." credo. :roll:

I wouldn't want to trade places with you spooky. We are experiencing a cold front and it may only get up to 70 degrees tomorrow and possible lows in the 30's to 40's. I am freezing. I lived in a frigid environment for most of my life, then one day I decided that I didn't want to deal with it anymore and I moved to Florida. I never thought I would ever need a jacket again once I got here. Boy was I wrong... :(

This ACP change isn't the highest priority in the world for me since I've already made the modifications to the appropriate files. I can see how adding the ACP setting would enhance the MOD for others who plan to add it to their board in the future. I certainly can be patient for the changes. If you need help with the SQL code, don't hesitate to ask when you're ready to tackle this project. I would be more than happy to help if I can...

:lol:

spooky2280
Registered User
Posts: 142
Joined: Tue Jul 20, 2004 8:48 pm

Post by spooky2280 » Mon Dec 13, 2004 8:02 pm

Somebody had a javascript error that led me to find a bug with the script:
http://www.christianfecteau.com/phpBB2/ ... c.php?t=21

The solution was to comment (or delete) line 73 in rmw_jslib.js

Code: Select all

// rmw_preload[rmw_index] = null;

This line is not necessary. I've added it just to free memory on old computers, but it I've found out that the same onload event could fire twice in specific situations, and that's why this line was producing an error on this person's board: on the second firing, the object was not found anymore because of line 73. I'm working on a new version of the MOD that not only fixes that multiple firing, but also allows newer Geckos (such as Firefox and NN7.1+) to resize images before knowing their width, just like I do with IE5+ on Windows. Coming soon... 8)

I will not release a version of the MOD just to remove line 73 since the problem might not occur anymore, and because the new improved version of the MOD is already coming along. NightriderXP, this new version is somehow needed fast and it will not have yet the ACP configurable feature.

Post Reply

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

Who is online

Users browsing this forum: No registered users and 5 guests