Auto resize [img] code

Support for IntegraMOD 141

Moderator: Integra Moderator

Auto resize [img] code

PostAuthor: xfx » Wed Feb 14, 2007 4:39 pm

Your phpBB Version: 2.0.22
phpBB Type: Integramod 141
MODs: No
Your knowledge: Beginner
Board URL: [url]http://[/url]

PHP Version:
MySQL Version:


What was done before the problem appeared?



What was done to try to solve the problem?




De.scription and Message

How do I set my forum to resize images from bbcode [img] to a default size like 640x480? when I use [img] to display an image from external server like imageshack, the image is displayed in the original size, so if the image is too big, my forum looks terrible after image show up.
hope someone can help me to fix this
tnks
Last edited by xfx on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.

xfx
Newbie
Newbie
 
Posts: 26
Likes: 0 post
Liked in: 0 post
Joined: Mon Jan 29, 2007 7:01 pm
Cash on hand: 0.00

Re: Auto resize [img] code

PostAuthor: xfx » Wed Feb 14, 2007 4:52 pm

I've solved...
Last edited by xfx on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.

xfx
Newbie
Newbie
 
Posts: 26
Likes: 0 post
Liked in: 0 post
Joined: Mon Jan 29, 2007 7:01 pm
Cash on hand: 0.00

PostAuthor: ayasha » Thu Feb 15, 2007 5:28 pm

how did you do this? i would like to be able to control the signatures to be no larger than 500 x 500 on my forum, and the images in post too
Last edited by ayasha on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
No one can make you feel inferior without your consent.
~Eleanor Roosevelt

ayasha
Sr Integra Member
Sr Integra Member
 
Posts: 634
Likes: 0 post
Liked in: 0 post
Joined: Tue Mar 28, 2006 6:10 pm
Cash on hand: 0.00

Re: Auto resize [img] code

PostAuthor: DjPorkchop » Thu Feb 15, 2007 7:01 pm

Yeah that would be sweet. I have a screenshots forum that I am having people upload too before I add them to a album for various reasons. Very much needed. I agree with Cleo. How did you work this out?
Last edited by DjPorkchop on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
"Don't gain the world and lose your soul, wisdom is better than silver and gold" -Bob Marley

If you build it, I can break it! ~ Whispered in the tone of the movie Field of Dreams.
User avatar
DjPorkchop
Administrator
Administrator
 
Posts: 1593
Likes: 136 posts
Liked in: 26 posts
Images: 12
Joined: Fri Apr 21, 2006 7:59 pm
Cash on hand: 1,575.25
Location: Illinois
IntegraMOD version: phpBB2x

Re: Auto resize [img] code

PostAuthor: xfx » Wed Feb 21, 2007 8:08 am

#-----[ OPEN ]---------------------------------------------
#You should modify all the templates that you have.

template/integra2/bbcode.tpl

#
#-----[ FIND ]---------------------------------------------
#

<BEGIN><img><END>

#
#-----[ REPLACE WITH ]--------------------------------------
# you can change 800 value with the values you like... They are in pixels...

<BEGIN><img><END>
Last edited by xfx on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.

xfx
Newbie
Newbie
 
Posts: 26
Likes: 0 post
Liked in: 0 post
Joined: Mon Jan 29, 2007 7:01 pm
Cash on hand: 0.00

PostAuthor: Max Paint » Thu Aug 09, 2007 11:20 pm

You can also try this modification: (I removed HEIGHT for easier use.
Code: Select all
 ############################################################## ## MOD Title]http://www.robintown.nl[/url] ## MOD De.scription: With this mod you can set the weidth and height of an image via the BBcode ## MOD Version: 1.0.0## ## Installation Level: (Easy) ## Installation Time: 5 Minutes ## Files To Edit: bbcode.php, bbcode.tpl ## Included Files: (n/a)############################################################## ## For Security Purposes, Please Check: [url=http://www.phpbb.com/mods/]http://www.phpbb.com/mods/[/url] for the ## latest version of this MOD. Downloading this MOD from other sites could cause malicious code ## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered ## in our MOD-Database, located at: [url=http://www.phpbb.com/mods/]http://www.phpbb.com/mods/[/url] ############################################################## ## Author Notes: ## My first 'real' mod <img>############################################################## ## MOD History: ## ## 2005-02-15 - Version 1.0.0 ## - release## ############################################################## ## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD ##############################################################  # #-----[ OPEN ]------------------------------------------ # includes/bbcode.php  # #-----[ FIND ]------------------------------------------ #     $bbcode_tpl['img'] = str_replace('{URL}', '\1', $bbcode_tpl['img']);  # #-----[ AFTER, ADD ]------------------------------------------ #     $bbcode_tpl['imgwh'] = str_replace('{URL}', '\2', $bbcode_tpl['imgwh']);     $bbcode_tpl['imgwh'] = str_replace('{WIDTH}', '\1', $bbcode_tpl['imgwh']);  # #-----[ FIND ]------------------------------------------ #     // matches a [url]xxxx://www.phpbb.com[/url] code..  # #-----[ BEFORE, ADD ]------------------------------------------ #     // [img width= height= ] and [/img] code..     $patterns[95] = "#[img width=([0-9]?[0-9]?[0-9]):$uid](.*?)[/img]#si";     $replacements[95] = $bbcode_tpl['imgwh'];  # #-----[ FIND ]------------------------------------------ #     // [flash=,:2e8cvjq5]image_url_here[/flash:2e8cvjq5] code..     $text = preg_replace("#[img]((http|ftp|https|ftps)://)([^ ?&=#"nrt<]*?(.(jpg|jpeg|gif|png)))[/img]#sie", "'[img]\1' . str_replace(' ', '%20', '\3') . '[/img]'", $text);  # #-----[ AFTER, ADD ]------------------------------------------ #     // [img width= heigth=] and [/img] code..     $text = preg_replace("#[img width=([0-9]?[0-9]?[0-9])](([a-z]+?)://([^, nr]+))[/img]#si","[img width=\1:$uid]\2[/img]", $text);  # #-----[ OPEN ]------------------------------------------ # templates/********/bbcode.tpl  # #-----[ FIND ]------------------------------------------ # <BEGIN><img><END>  # #-----[ AFTER, ADD ]------------------------------------------ # <BEGIN><img></img><END>  # #-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ # # EoM  

Now you can add a simple [img width=mypx] to the post and the pic will resize, if you want it to.
Last edited by Max Paint on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.

Max Paint
Members
Members
 
Posts: 31
Likes: 0 post
Liked in: 0 post
Joined: Tue May 09, 2006 9:50 am
Cash on hand: 0.00


Return to IntegraMOD 141

Who is online

Registered users: App360MonitorBot, Bing [Bot], Google [Bot], Majestic-12 [Bot]