how to resize image post between [img] tag resize automatically?

01-08-2010, 10:13 PM
Post: #1
how to resize image post between [img] tag resize automatically?
how to resize image post between [img] tag resize automatically?
but i need configuration via css, plugin image resizer make our server worked hard

thx for answer
01-09-2010, 03:00 AM
Post: #2
RE: how to resize image post between [img] tag resize automatically?
Unless [img] is replaced with <img src... class="mycustomclass">, it's not possible.
You may want to look at inc/class_parser.php and search for [img] replacements

[Image: s.png]
01-12-2010, 02:41 AM
Post: #3
RE: how to resize image post between [img] tag resize automatically?
solved :

add this code to global.css of your theme
Code:
.imagespost{

max-width: 500px; /* Adjust this value according to your content area size*/
    height: auto;

}

find this code at inc/class_parser.php
Code:
return "<img src=\"{$url}\" width=\"{$dimensions[0]}\" height=\"{$dimensions[1]}\" border=\"0\" alt=\"{$alt}\"{$css_align} />";
        }
        else
        {
            return "<img src=\"{$url}\" border=\"0\" alt=\"{$alt}\"{$css_align} /></div>";

change into this
Code:
return "<div id=\"imagespost\"><img src=\"{$url}\" class=\"imagespost\" width=\"{$dimensions[0]}\" height=\"{$dimensions[1]}\" border=\"0\" alt=\"{$alt}\"{$css_align} /></div>";
        }
        else
        {
            return "<div id=\"imagespost\"> <img src=\"{$url}\" class=\"imagespost\" border=\"0\" alt=\"{$alt}\"{$css_align} /></div>";

viola! large image will resize automatically without using GD image that make server load increase
01-12-2010, 04:22 AM
Post: #4
RE: how to resize image post between [img] tag resize automatically?
(01-12-2010 02:41 AM)caranibieros Wrote:  solved :

add this code to global.css of your theme
Code:
.imagespost{

max-width: 500px; /* Adjust this value according to your content area size*/
    height: auto;

}

find this code at inc/class_parser.php
Code:
return "<img src=\"{$url}\" width=\"{$dimensions[0]}\" height=\"{$dimensions[1]}\" border=\"0\" alt=\"{$alt}\"{$css_align} />";
        }
        else
        {
            return "<img src=\"{$url}\" border=\"0\" alt=\"{$alt}\"{$css_align} /></div>";

change into this
Code:
return "<div id=\"imagespost\"><img src=\"{$url}\" class=\"imagespost\" width=\"{$dimensions[0]}\" height=\"{$dimensions[1]}\" border=\"0\" alt=\"{$alt}\"{$css_align} /></div>";
        }
        else
        {
            return "<div id=\"imagespost\"> <img src=\"{$url}\" class=\"imagespost\" border=\"0\" alt=\"{$alt}\"{$css_align} /></div>";

viola! large image will resize automatically without using GD image that make server load increase

Good job Smile

[Image: s.png]
10-29-2010, 08:19 PM (This post was last modified: 10-29-2010 08:20 PM by trialnick.)
Post: #5
RE: how to resize image post between [img] tag resize automatically?
Hi there!

How to do that in mybb 1.6?

i didn't find there .imagespost{

many thanks in advanced!!!
05-25-2011, 04:42 AM
Post: #6
RE: how to resize image post between [img] tag resize automatically?
This was very helpful, thanks for the tip.
05-30-2011, 02:29 AM
Post: #7
RE: how to resize image post between [img] tag resize automatically?
This is really old. Did you need to bump it??

If you PM me asking me to download and give you a paid plugin, you'll be reported to Pirata and be left a negative rep. If you want the plugin, then pay for a subscription, you cheap skates!
05-31-2011, 03:01 AM
Post: #8
RE: how to resize image post between [img] tag resize automatically?
Well all the threads here are old. So I have no choice.
11-18-2011, 04:25 PM
Post: #9
RE: how to resize image post between [img] tag resize automatically?
im using it for mybb 1.6 and not have any problem Smile
still useful Smile
11-18-2011, 04:56 PM (This post was last modified: 11-18-2011 04:57 PM by Sama34.)
Post: #10
RE: how to resize image post between [img] tag resize automatically?
Actually, you don't need edit core files, just wrap the {$post['message'] into a div, give the class to the div instead of the the img, and then add the css addition mentioned above like this:
Code:
.imagespost img{

max-width: 500px; /* Adjust this value according to your content area size*/
     height: auto;

}

If you are using a theme that already contains the post_content class, just try adding this:
Code:
.post_content img{

max-width: 500px; /* Adjust this value according to your content area size*/
     height: auto;

}

You can even create a new mycode to overwrite the default one. The thing is, you don't need to edit core files to do this.

Support PM's will be ignored. Exclamation
Plugins: Announcement Bars - Custom Reputation - Mark PM As Unread





User(s) browsing this thread: 1 Guest(s)