Widescreen Gaming Forum

[-noun] Web community dedicated to ensuring PC games run properly on your tablet, netbook, personal computer, HDTV and multi-monitor gaming rig.
It is currently 15 Dec 2024, 18:46

All times are UTC [ DST ]




Post new topic Reply to topic  [ 37 posts ]  Go to page 1, 2, 3, 4  Next
Author Message
PostPosted: 18 Jun 2007, 22:17 
Offline
Insiders
Insiders
User avatar

Joined: 25 Jul 2004, 04:41
Posts: 365
Since this is a recurring issue, add the attachment mod with a max image size before being linkified, or add one of the client side javascript mods that resize embedded photos to fit the browser window. Client side resize is a 10 minute mod and allows images to match the viewers resolution instead of simply guessing what the max should be. Someone is always going to come along with 640x480 res and think the standard is too big, and someone with 2560x1600 res thinks they are too small. Client side resize for the win!


Top
 Profile  
 


PostPosted: 19 Jun 2007, 06:55 
Offline
Insiders
Insiders
User avatar

Joined: 25 Jul 2004, 04:41
Posts: 365
http://www.phpbb.com/community/viewtopic.php?t=123690 - Simple Image Resize 1.10 - Installation time: 1 minute - Installation Level - Easy

Code:
    #################################################################
       ## Mod Title:       Simple Image Resize
       ## Mod Version:    1.1.0 Final
       ## Author:       likeatim < admin @ essential-freebies.de > < http://www.efb.nu >
       ## Description:
       ## Orginal Code by opa @ invisionpower.de
       ## This adds a simple Image resize code so your tables won't get screwed by oversized images.
       ## Works dynamically with every screen resolution.
       ## Uses Javascript, so resizing might not work if people have adblocker (Proxomitron etc.) installed.
       ## Solution: Users should then add your site to their trusted sites within the adblocker.
       ##
       ## Installation Level:    Easy
       ## Installation Time:    1 Minute
       ## Files To Edit:    bb.code.tpl
       ## Included Files: n/a
       #################################################################
       ## Security Disclaimer: This MOD Cannot Be Posted To Or Added At Any Non-Official phpBB Sites
       #################################################################
       ##
       ## Author Note:
       ## No Notes.
       ##
       ## History:
       ## 1.10: Images now are resized proportionally (as an alternative)
       ## 1.00: Initial Release
       ##
       ## the phpBB Group Reserves The Right To Remove/Edit Author Notes,
       ## Should It Be Warranted
       ##
       #################################################################
       ## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
       #################################################################
   
       #
       #-----[ OPEN ]------------------------------------------
       #
       templates/subsilver (or whatever you use/bbcode.tpl
   
   
   
       #
       #-----[ FIND ]------------------------------------------
       #
       <!-- BEGIN img --><img src="{URL}" border="0" /><!-- END img -->
   
       #
       #-----[ REPLACE WITH ]------------------------------------------
       #
       <!-- BEGIN img --><img src='{URL}' border='0' onload="javascript:if(this.width > screen.width-300)this.width = (screen.width-300)" onclick="javascript:window.open('{URL}','','scrollbars=1,toolbar=yes,resizable=1,menubar=yes,directories=yes,status=yes')" alt="Posted Image, might have been reduced in size. Click Image to view fullscreen." title="Posted Image, might have been reduced in size. Click Image to view fullscreen." />
       <!-- END img -->
   
   
   
       FOR PROPORTIANAL RESIZING:
   
       #
       #-----[ REPLACE WITH ]------------------------------------------
       #
       <!-- BEGIN img --><img src='{URL}' border='0' onload="javascript:if(this.width > screen.width-300){ this.height = Math.round(((screen.width-300)/this.width)*this.height); this.width = (screen.width-300); }" onclick="javascript:window.open('{URL}','','scrollbars=1,toolbar=0,resizable=1,menubar=0,directories=0,status=0')" alt="Posted Image, might have been reduced in size. Click Image to view fullscreen." title="Posted Image, might have been reduced in size. Click Image to view fullscreen." />
       <!-- END img -->
   
       #
       #-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
       #
       # EoM
   


Top
 Profile  
 
PostPosted: 19 Jun 2007, 07:37 
Offline
Editors
Editors

Joined: 17 Nov 2005, 09:02
Posts: 2820
Lol, another thing we talked about many times with the difference that we now actually have something easy to implement. :)
It's all up to Ibrin.


Top
 Profile  
 
PostPosted: 19 Jun 2007, 09:57 
Offline
Editors
Editors
User avatar

Joined: 14 Oct 2003, 13:52
Posts: 5706
It's more a matter of the mods conflicting with tweaks that are already made to the underlying phpBB code used on the WSGF. It might work without issues, but I don't know for sure.


Top
 Profile  
 
PostPosted: 19 Jun 2007, 14:34 
Offline
Founder
Founder
User avatar

Joined: 13 Oct 2003, 05:00
Posts: 7358
I tried it this morning, but it didn't resize the pics. I did get the "Posted Image, might have been reduced in size. Click Image to view fullscreen." text when I moused-over, so I know the code took. But, it didn't resize in Safari or FireFox.


Top
 Profile  
 
PostPosted: 19 Jun 2007, 16:27 
Offline

Joined: 31 May 2007, 09:43
Posts: 43
The Javascript code seems to open up a new window with the full sized image, maybe your popup blocker is being overzealous? To do inline resizing, you might have something like this (keep in mind I don't really work with Javascript, so this code might not be perfect):

Code:
<!-- BEGIN img --><img src='{URL}' border='0' onload="javascript:origwidth = this.width; origheight = this.height; if(this.width > screen.width-300){ this.height = Math.round(((screen.width-300)/this.width)*this.height); this.width = (screen.width-300); }" onclick="this.width = origwidth; this.height = origheight;" alt="Posted Image, might have been reduced in size. Click Image to view fullscreen." title="Posted Image, might have been reduced in size. Click Image to view fullscreen." />
       <!-- END img -->


Top
 Profile  
 
PostPosted: 19 Jun 2007, 17:38 
Offline
Founder
Founder
User avatar

Joined: 13 Oct 2003, 05:00
Posts: 7358
It would open the "full size" image in the new window. The issue is that it didn't to the inline re-size. Will try this one later.


Top
 Profile  
 
PostPosted: 20 Jun 2007, 10:41 
Offline

Joined: 31 May 2007, 09:43
Posts: 43
My previous example does work, but it would only go from the scaled size to the full size. I've reworked it so that if you click it multiple times, it toggles between the scaled size and the full size :D If you want it to scale it smaller, increase the last two "300" values.

Code:
<img src='{URL}' border='0' onload="javascript:this.origwidth = this.width; this.origheight = this.height; this.resized = 0; if(this.width > screen.width-300){ this.height = Math.round(((screen.width-300)/this.width)*this.height); this.width = (screen.width-300); this.resized = 1;} this.scaledheight = this.height; this.scaledwidth = this.width;" onclick="if(this.resized){this.width = this.origwidth; this.height = this.origheight; this.resized = 0;} else {this.width = this.scaledwidth; this.height = this.scaledheight; this.resized = 1;}" alt="Posted Image, might have been reduced in size. Click Image to view fullscreen." title="Posted Image, might have been reduced in size. Click Image to view fullscreen." />


Top
 Profile  
 
PostPosted: 22 Jun 2007, 08:39 
Offline
Insiders
Insiders
User avatar

Joined: 25 Jul 2004, 04:41
Posts: 365
Any luck?


Top
 Profile  
 
PostPosted: 22 Jun 2007, 19:43 
Offline
Founder
Founder
User avatar

Joined: 13 Oct 2003, 05:00
Posts: 7358
Just tried it, and no go. Must be some way that phpBB is handling the code. I do get the new alt txt when I mouse-over, but no resize.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 37 posts ]  Go to page 1, 2, 3, 4  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  




Powered by phpBB® Forum Software © phpBB Group