Please login or register. Welcome to the Studio, guest!


Quick Links:


newBookmarkLockedFalling

Singular

Singular Avatar
v4 Studios :: Coming Soon

***
Dedicated Member

238


September 2005
Ok thanks. :)
Further Solutions :: Hosting :: Scripts :: Templates
furthersolutions.com

v4 Studios - Coming soon

egbakaet

egbakaet Avatar

*
New Member

14


November 2005
You should make one for the [ code ][ /code ] tags that allows php and html to be displayed. I've been baffled on how to do that for weeks.


Last Edit: Nov 19, 2005 16:03:46 GMT by egbakaet

Chris

Chris Avatar

******
Head Coder

19,519


June 2005
EG, its something like this.

preg_replace("/\[code\](.+?)\[\/code\]/i","<table border='1'><tr><td>\\1</td></tr></table>");

And before that, you did the replace for < and > to their entities. :P I dunno how exactly.

egbakaet

egbakaet Avatar

*
New Member

14


November 2005
I got that, it's the part with the <code> and <pre> tag that I'm not sure about. They show the code, but they also show the <br>'s that come from the nl2br() function I use on it. I'm trying to figure out how to hide the <br>'s from the <code></code> tags, but at the same time, utilize it's function as a line break.

Chris

Chris Avatar

******
Head Coder

19,519


June 2005
Do you know about the <xmp> tag? :P Its quite handy. Its deprecated however.

What you could do is check to see if its inside a tag, and then don't replace if it is. I don't know how to however.

Llanilek

Llanilek Avatar
Former Elite Mod

****
Dedicated Studio Member

931


October 2005
i made one using a function .. arrays and foreach.. simple.. lol

function uBBC($iString) {
$iArray = array('/\[b\](.*)\[\/b\]/iU' => '<b>$1</b>', '/\[i\](.*)\[\/i\]/iU' => '<i>$1</i>', '/\[url=(http:\/\/.*)\](.*)\[\/url\]/iU' => '<a href="$1">$2</a>', '/\[img\](.*)\[\/img\]/iU' => '<img src="$1" border="0" />', '/\[u\](.*)\[\/u\]/iU' => '<u>$1</u>'));
foreach ($iArray as $iKey => $iValue) {
$iString = preg_replace($iKey, $iValue, $iString);
}
}


basc i know.. whether it works on not is another matter i ain't actually tested it

egbakaet

egbakaet Avatar

*
New Member

14


November 2005
That doesn't have [ code ][/ code ] tags in it though. Which is my problem.

Llanilek

Llanilek Avatar
Former Elite Mod

****
Dedicated Studio Member

931


October 2005
add them then :P

Chris

Chris Avatar

******
Head Coder

19,519


June 2005
He means do it so that they don't parse inside of [code][/code] tags. :P

Llanilek

Llanilek Avatar
Former Elite Mod

****
Dedicated Studio Member

931


October 2005
add an echo then :P

Llanilek

Llanilek Avatar
Former Elite Mod

****
Dedicated Studio Member

931


October 2005
$str = preg_replace("#\[code\](.*?)\[/code]#si", "<div class=\"codetop\"><u><b>Code:</b></u></div><div class=\"codemain\">\\1</div>", $str);

egbakaet

egbakaet Avatar

*
New Member

14


November 2005
With a long and tedious code, I've solved it: Look.

Llanilek

Llanilek Avatar
Former Elite Mod

****
Dedicated Studio Member

931


October 2005
you've gone over your bandwidth... again :| lol


Chris

Chris Avatar

******
Head Coder

19,519


June 2005
O_o How'd you manage that?

Llanilek

Llanilek Avatar
Former Elite Mod

****
Dedicated Studio Member

931


October 2005
he has 5gig of bandwidth now... he has 2.2gig to start with... the b/w reset at 12:00am 1st Dec... he had used it all up again by the 4th Dec 1:43pm XD

newBookmarkLockedFalling