Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 Adding a new tag like [code] (syntax highligight)
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

altisdesign
Junior Member

United Kingdom
357 Posts

Posted - 01 September 2003 :  06:44:50  Show Profile
Hi,

Over at my forum, www.ianbergson.com/scissors it is used for running an online game alliance. We have "comm" scans, of fleet movements in different sectors. What I want to do, is syntax highlight them, because people need to be able to post them into the forums and to make it less confusing I want to change the colours of the comm information based on the alliance. I've already written a script to do this using the split() function. Its located here: www.ianbergson.com/scissors/a_comms.asp

A sample comms report would be something like:
Fleet1 [FS] (xx:xx:xx:xx) x 4,000
Fleet2 [RWS] (xx:xx:xx:xx) x 112,000
Fleet3 [IGF] (xx:xx:xx:xx) x 224,000
Fleet4 [FS] (xx:xx:xx:xx) x 4,000
Fleet5 [RWS] (xx:xx:xx:xx) x 232,000

The script highlights based on the alliance tag eg. [FS] [RWS] as can be seen from that link. That script isnt the important thing though, its how i wood integrate that into the forum. I was thinking something like [comms] [/comms]. I wonder if anyone has tried this before? I looked in inc_func_common.asp, which is where I assume I would have to make any changes, but I couldn't find an easy way to put in the split() code. This would be really good if I could get it working , just wondering if its possible. I did a search on syntax highlighting, but didnt find anything. Its something VBulletin will do with syntax highlighting php code with [php][/php] so I guess there must be some way to do it in asp and integrate it with Snitz.

Any help very much appreciated
-Altis Design

Altis Design offers all manner of web design services to a variety of commercial and personal clients

DavidRhodes
Senior Member

United Kingdom
1222 Posts

Posted - 01 September 2003 :  08:20:59  Show Profile
Have a look at the flash mod (similar idea) or do a search for questions posted by me, I asked a similar question not so long back.

The UK MkIVs Forum
Go to Top of Page

altisdesign
Junior Member

United Kingdom
357 Posts

Posted - 01 September 2003 :  09:16:29  Show Profile
Thanks for the links David, I hadnt thought of the Flash Mod . The thing is.. I think what I'm wanting is a bit more complicated, cos it isnt a simple matter of converting [comms] into the tag I want, it has to do a bit of processing to convert the comms to how i want them. Maybe it helps if I post the code I'm using to convert the comms into the different colours:


'Split up the comms info by the line breaks
MyArray = Split(request.form("comms"), vbcrlf, -1, 1)

'start bullet points
response.write("<UL>")

'iterate through the whole of the comms
For intCount = LBound(myarray) To UBound(myarray)

'work out the tag of the alliance
startchr = instr(myarray(intcount),"[")+1
endchr = instr(myarray(intcount),"]")-startchr
allytag = mid(myarray(intcount),startchr,endchr)

'work out what font the comms line should appear in (set to a variable so more colours can be added later)
If allytag="RWS" Then
font = "green"
Else
font = "red"
End If

'write out the comms in that colour
Response.write "<LI><font face=""Arial, helvetica, sans-serif"" color="""&font&""">"&myarray(intcount)&"</font>"
Next
Response.write("</UL>")


What I want to do, is have that code execute to whatever is put inside [comms] [/comms] delimiters, probably when the post is displayed (so if a user edits their post it just shows up as [comms] [/comms]). Is this something that is easy to accomplish?

Altis Design offers all manner of web design services to a variety of commercial and personal clients
Go to Top of Page

altisdesign
Junior Member

United Kingdom
357 Posts

Posted - 03 September 2003 :  13:56:14  Show Profile
<bump>

Does anyone know where I can add this code to make it highlight like I want .. the code is written for what I want to do, I just need to know how to get it to replace [comms] tags with that...

Altis Design offers all manner of web design services to a variety of commercial and personal clients
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.27 seconds. Powered By: Snitz Forums 2000 Version 3.4.07