Email
Share

We Rock Your Web Forum » Content Management Systems

Set max size for bbPress images?

(2 posts)
  1. sam

    member
    Joined: Aug '09
    Posts: 19

    Hi there,

    I'm using bbPress as well. I love the forum for its ease of use, SEO friendliness & sitemap support, and of course, the support of one of the largest blog/ CMS communities out there - Wordpress.

    I've gotten the forum pretty much fined tuned to my liking, with one exception. I can't seem to set images (via the Allow Images plugin) to have a max width. In other words, when users post an image, and it's larger than 500px or so, it will overflow and break my layout.

    FYI - I'm also using the bbCode buttons and bbCode lite plugins - so that's how users add images - by using the IMG tag button.

    So, is there any way to set a max-width restriction on the images, or have them resize automatically if they're too large?

    Posted 2 years ago #

  2. Posted 2 years ago
  3. cwd

    senior admin
    Joined: Jul '09
    Posts: 225

    Good question. While there was work done on an Image Resizer module, that module doesn't seem to work correctly or be up to date. However, there is a way for you to set a style declaration within your bbCode Lite module that will set a max width for images your users create in bbPress.

    Within your BBcode Lite plugin, edit the following file: BBcode-lite.php, on line 46 (additions in bold):

    foreach($bbcode_lite['complex'] as $bbcode=>$html){
    if($bbcode!='url') {$text = preg_replace('/\['.$bbcode.'\](.+?)\[\/'.$bbcode.'\]/is','<'.$html[0].' '.$html[1].'="$1" style="max-width:463px">',$text);}

    For our bbPress theme, the 463px fits perfectly within the layout. You may need to adjust this value for your particular bbPress template.

    Posted 2 years ago #

RSS feed for this topic

Reply

(required)

Allowed markup: BBcode blockquote code em strong ul ol li font strike center u hr.
You can also put code in between backtick ( ` ) characters.