Page 1 of 1

How do I get IRC-Colors in HTML ones ?

Posted: Fri Aug 24, 2007 8:45 am
by SnakeX
Hi;

I got Thales as stats-serv and, however, some guys loves putting Colors in theire topic.
now, how do I get these Color-codes into HTML-colors; like str_replace(<code>,<html-thing>,$topic) in PHP; but it doesn't work...
maybe coz my OS uses for the "Box" before the num. other ASCII-codes than PHP does :/

Thanks for your help :)

Re: How do I get IRC-Colors in HTML ones ?

Posted: Fri Aug 24, 2007 6:07 pm
by Jobe
http://www.invictachat.net/format.inc.phps is the PHP code I use.

Simply use:

Code: Select all

include_once("file.name.with.function.in.php");
Then you can use:

Code: Select all

topic_format_html($topic, $maxlength, $dourl);
where $topic is the topic string with the formatting codes in it, $maxlength is the maximum topic length (excluding formatting codes) and $dourl is a "true" or "false" value meaning whether or not to make URL's (beginning "http://", "https://", "ftp://" and "irc://") into links. Both $maxlength and $dourl are optional but to use $dourl you need to specify a $maxlength (-1 for unlimited)

Re: How do I get IRC-Colors in HTML ones ?

Posted: Fri Jan 11, 2008 11:15 pm
by evul
Your script is great, nice work. Only one thing. Some folks like to use those colorful bars which really aren't text and if they have those, then nothing shows at all for the topic. Any solution to this?

T.I.A.

Re: How do I get IRC-Colors in HTML ones ?

Posted: Sat Jan 12, 2008 1:09 pm
by Jobe
Could you show me an example please and if possible somehow send me a text file containing a topic as you describe so I have an example to work with?