How do I get IRC-Colors in HTML ones ?

Talk about pretty much anything here, but DO NOT USE FOR SUPPORT.

Moderator: Supporters

Post Reply
SnakeX
Posts: 2
Joined: Wed Aug 08, 2007 4:33 pm

How do I get IRC-Colors in HTML ones ?

Post by SnakeX » Fri Aug 24, 2007 8:45 am

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 :)

Jobe1986
Official supporter
Posts: 1180
Joined: Wed May 03, 2006 7:09 pm
Location: United Kingdom

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

Post by Jobe1986 » Fri Aug 24, 2007 6:07 pm

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)
Your IP: Image

evul
Posts: 1
Joined: Fri Jan 11, 2008 11:12 pm

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

Post by evul » Fri Jan 11, 2008 11:15 pm

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.

Jobe1986
Official supporter
Posts: 1180
Joined: Wed May 03, 2006 7:09 pm
Location: United Kingdom

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

Post by Jobe1986 » Sat Jan 12, 2008 1:09 pm

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?
Your IP: Image

Post Reply