| View previous topic :: View next topic |
| Author |
Message |
r0t3n Owner
Joined: 31 May 2005 Posts: 507 Location: UK
|
Posted: Fri Nov 11, 2005 12:58 pm Post subject: channel topic for htcl |
|
|
Hello there.
I need a proc to be used for my htcl webpage
http://81.7.142.2:3006/onchan.htcl?chan=%23all4us
As you can see, the topic section includes all the color/bold/underline tag etc. I need a proc to recognise these, and the colors, and to change them to html color/bold/underline tags. So then the actual color of the topic can be seen on my htcl website.
btw, htcl is html with tcl commands within the html.
Thanks in advance,
Chris  _________________ r0t3n @ #r0t3n @ Quakenet |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Fri Nov 11, 2005 2:37 pm Post subject: |
|
|
something like this might help:
| Code: | proc parseBold str {
set c 0
set htmlstring [lindex [split $str \002] 0]
foreach bs [lrange [split $str \002] 1 end] {
if {$c%2 == 0} {
lappend htmlstring "<bold>$bs</bold>"
} {
lappend htmlstring $bs
}
incr c
}
return [join $htmlstring]
} |
this will replace bold codes with <bold> & </bold> tags. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
r0t3n Owner
Joined: 31 May 2005 Posts: 507 Location: UK
|
Posted: Fri Nov 11, 2005 3:13 pm Post subject: |
|
|
thanks sir_fz
it returns:
| Code: | Channel topic: 3( ( 3( :: W elcome to # alfn 3:: B F2 s tats: http://bf2s.com/player/44315144/ 3:: A uth e quals OP 3:: A uths: 15 H osts: 16 3:: P rotection i s ON :3: ) ) 3)
|
Some spaces within the script where the bold tags were. Its one of these things which seem impossible to do  _________________ r0t3n @ #r0t3n @ Quakenet |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Fri Nov 11, 2005 7:46 pm Post subject: |
|
|
Why not try filtering or play around with it some more? _________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
r0t3n Owner
Joined: 31 May 2005 Posts: 507 Location: UK
|
Posted: Fri Nov 11, 2005 8:46 pm Post subject: |
|
|
because i have no idea of how to do it, if you could give me some starters, then i can try and make something of it  _________________ r0t3n @ #r0t3n @ Quakenet |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
|
| Back to top |
|
 |
|