Yeah it was an annoyance i found with long long pieces of code which were posted, so the others helped me out to limit it.
Here's my original thread, http://www.php-fusion.co.uk/forum/viewthread.php?forum_id=13&thread_id=10979
but this is how its done on m site
Step 2 - the "codebox"
Edit the file "maincore.php"
Find this, around line 374:
for ($i=0;$i < $ccount;$i++) $text = preg_replace('#\[code\](.*?)\[/code\]#si', '<div class=\'quote\' style=\'width:400px;white-space:nowrap;overflow:auto\'><code style=\'white-space:nowrap\'>\1<br><br><br></code></div>', $text);
Edit it like this (changes marked in red):
for ($i=0;$i < $ccount;$i++) $text = preg_replace('#\[code\](.*?)\[/code\]#si', '<div class=\'quote\' style=\'width:600px;height:300px;white-space:normal;overflow:auto\'><code style=\'white-space:normal\'>\1<br><br><br></code></div>', $text);
hope that helps you out,
Adnan.
NOTE:
width:600px;height:300px - Gives you a codebox of the given size. Change it to your preferences.
NOTE:
white-space:normal - Gives you line breaks in the box, so it remains the width you specify.
You will get an scrollbar (down, not sideways! ) if the box is bigger than the specified height (300px)
I've tested this in IE, Mozilla and Firefox, btw. |