images in shoutbox

Started by john, November 23, 2011, 01:28:58 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

john

Quote from: john on November 23, 2011, 01:28:58 PM
images in shoutbox now then we add images in shoutbox like img too small can i resize it just a bit bigger ?
Many thac and ill not do it  ill leave it as it is

Diablo999

#2
Yeah, you could easy do that, but I wouldn't recommend it. Ex. if you drop an image which orig. size is 30*30px and sets images to be resized to min. 250px. Then the image would be ugly cause of the resolution. But you do it in bbcode_function.php
Find this
Code (php) Select
  if (stripos($s, '[img') !== false) {     
  // [img=http://www/image.gif]
$s = preg_replace("/\[img\]((http|https):\/\/[^\s'\"<>]+(\.(jpg|gif|png|bmp)))\[\/img\]/i", "<a href=\"\\1\" rel=\"lightbox\"><img src=\"\\1\" border=\"0\" alt=\"\" style=\"max-width: 150px;\" /></a>", $s);

  // [img=http://www/image.gif]
  $s = preg_replace("/\[img=((http|https):\/\/[^\s'\"<>]+(\.(gif|jpg|png|bmp)))\]/i", "<a href=\"\\1\" rel=\"lightbox\"><img src=\"\\1\" border=\"0\" alt=\"\"  style=\"max-width: 150px;\" /></a>", $s);
  }



See the max-width which resizes pics, if it's over 150px. You could change it to min-width, but as I said it ain't recommended. Large pics doesn't get resized down then and small pics gets ugly anyway. So my opinion is no win win situation.  :P
Dunno if it's possible to use both max-/min-width in the same line.

john

images in shoutbox now then we add images in shoutbox like img too small can i resize it just a bit bigger ?