Jump to content

Forum Images


guitar idiot

Recommended Posts

Ok I have my own forums I made using php code, but have encountered one problem, you know how they have the pictures when the post? Well I got that part down, but I haven't been able to figure out how to get to shrink down to an appropriate size. Ive tried dividing the height and width values but if its a big image it looks fine but if its a small one it looks like a speck. Any Help?Another thing I'm trying to do is you know inW3schools forums(these forums) when you put the code tags around something it displays different, is there anyway I can do that in mine?Thanks

Link to comment
Share on other sites

I've tried dividing the height and width values but if its a big image it looks fine but if its a small one it looks like a speck.
Check the image size before you resize it, if it's small enough you don't need to resize it.
Another thing I'm trying to do is you know inW3schools forums(these forums) when you put the code tags around something it displays different, is there anyway I can do that in mine?
Do a Google search for BBCode, there are implementations you can use.
Link to comment
Share on other sites

Another thing I'm trying to do is you know inW3schools forums(these forums) when you put the code tags around something it displays different, is there anyway I can do that in mine?
Or you could make your own implementation, using regular expressions it is quite simple e.g.
$text = preg_replace("/\[code\](.*?)\[\/code\]/i", "<div class=\"code\">$1</div>", $text);

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...