Orthodoxboy 1 Report post Posted September 6, 2006 Hallo, gibt es eine Möglichkeit dass Grafiken die das Forumlayot sprengen automatisch auf eine bestimmte größe verkleinert werden? z.B. alle bilder die breiter als 600px sind werden verkleinert. Gruß, Boki Share this post Link to post
smurf 0 Report post Posted September 8, 2006 (edited) Natürlich! TOOLS & SETTINGS / Topics, Posts and Polls -> suche nach Attached Image Options Für "verlinkte" Bilder ist eine Modifikation erforderlich. (Hier nach resize suchen) Edited September 8, 2006 by smurf Share this post Link to post
kdt 0 Report post Posted September 20, 2006 (edited) Der hier: http://mods.invisionize.com/db/index.php/f/5417 /* +------------------------------------------------------------------- | Invision Power Board 2.1 Modification | Provided as is, use at your own risk | | Automatic Resize [IMG] [/IMG] in topics | By: Lateralus | Orignal Code (for IPB 2.0.x) By: BigBallerAlwayz | Orignal Code (for IPB 1.3) By: Quang Trung +-------------------------------------------------------------------- */ - What does this mod do? This modification resizes images that use the bbcode [IMG] [/IMG] to the size defined by "Attachment thumbnail size" inside of the Admin Cpanel. The image will be clickable and launch in new window if user(s) wishes to view the full image. This allows forums to maintain orignal look and allow topics to load much faster then before. This is a 2.1 mod but is also available for 2.0 (by BigBallerAlwayz) and 1.3 (by Quang Trung). It is a small three files modification. - Files to edit sources/classes/bbcode/class_bbcode.php sources/classes/bbcode/class_bbcode_core.php sources/classes/bbcode/class_bbcode_legacy.php //------------------------------------------------------------------- //------------------------------------------------------------------- /*in file: sources/classes/bbcode/class_bbcode.php*/ FIND [in function pre_edit_parse()]: $txt = preg_replace( "#<img src=[\"'](\S+?)['\"].+?".">#" , "\[img\]\\1\[/img\]" , $txt ); ADD below: $txt = preg_replace( "#<!--ImageUrlBegin-->(.+?)<!--ImageUrlEBegin-->#" , '' , $txt ); $txt = preg_replace( "#<!--ImageUrlEnd-->(.+?)<!--ImageUrlEEnd-->#" , '' , $txt ); $txt = preg_replace( "#<img .+? src=[\"'](\S+?)['\"].+?".">#" , "\[img\]\\1\[/img\]" , $txt ); /*in file: sources/classes/bbcode/class_bbcode_legacy.php*/ Find [in function pre_edit_parse()]: $txt = preg_replace( "#<img src=[\"'](\S+?)['\"].+?".">#" , "\[img\]\\1\[/img\]" , $txt ); ADD below: $txt = preg_replace( "#<!--ImageUrlBegin-->(.+?)<!--ImageUrlEBegin-->#" , '' , $txt ); $txt = preg_replace( "#<!--ImageUrlEnd-->(.+?)<!--ImageUrlEEnd-->#" , '' , $txt ); $txt = preg_replace( "#<img .+? src=[\"'](\S+?)['\"].+?".">#" , "\[img\]\\1\[/img\]" , $txt ); /*in file: sources/classes/bbcode/class_bbcode_core.php*/ FIND [in function regex_check_image()]: return "<img src=\"$url\" border=\"0\" alt=\"{$this->ipsclass->lang['bbcode_img_alt']}\" />"; REPLACE with: // START Image Auto Resize Mod $qt_maxwidth = $this->ipsclass->vars['siu_width']; $qt_img_info = getimagesize("$url"); $qt_out_width = 0; if ( $qt_img_info[0] > $qt_maxwidth ) { $qt_out_width = $qt_maxwidth; return "<!--ImageUrlBegin--><a href=\"$url\" target=\"_new\"><!--ImageUrlEBegin--><img width=\"$qt_out_width\" class=\"attach\" src=\"$url\" border='0' alt=\"{$this->ipsclass->lang['bbcode_img_alt']}\" /><!--ImageUrlEnd--></a><!--ImageUrlEEnd--><br />"; } else return "<img src=\"$url\" border=\"0\" alt=\"{$this->ipsclass->lang['bbcode_img_alt']}\" />"; // END Image Auto Resize Mod Save & upload all the edited files And you're done :) Demo: http://www.gamereplays.org/community/Testing_the_new_img_resize_mod-t31427.html And visit Invisionize of course for support :) Edited September 20, 2006 by kdt Share this post Link to post