Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TGML 1

Status
Not open for further replies.

hedidit

Technical User
Jul 21, 2005
142
GB
Hi all,

I've written a set of forums for our company intranet that are working great however users want to be able to easily add hyperlinks into their posts.

I sometimes use TGML on tek-tips and was wondering how they work as I'd like to do the same thing but with just hyperlinks ?

Can anyone give me any pointers? I guess it'll involve InStr and replace etc?

Cheers in advance
 

For a markup system I have an array

Sample of the array;
Code:
ReplaceCode(11,0) = "[ red]"
ReplaceCode(11,1) = "<span style=" & chr(34) & "color:red;" & chr(34) & ">"
ReplaceCode(12,0) = "[/red]"
ReplaceCode(12,1) = "</span>"
ReplaceCode(13,0) = "[ blue]"
ReplaceCode(13,1) = "<span style=" & chr(34) & "color:blue;" & chr(34) & ">"
ReplaceCode(14,0) = "[/blue]"
ReplaceCode(14,1) = "</span>"
ReplaceCode(15,0) = "[ green]"
ReplaceCode(15,1) = "<span style=" & chr(34) & "green;" & chr(34) & ">"
ReplaceCode(16,0) = "[/green]"
ReplaceCode(16,1) = "</span>"
(added space after "[" so the TGML processor doesn't pick it up)
Then a function the loops through the array and replaces the markup tags.

Code:
function ReplaceGenMarkUp(strIn)
dim i
for i = 0 to ubound(ReplaceCode,1)
	strIn = replace(strIn, ReplaceCode(i,0), ReplaceCode(i,1))
next
ReplaceGenMarkUp = strIn
end function

Chris.

Indifference will be the downfall of mankind, but who cares?
Woo Hoo! the cobblers kids get new shoes.
People Counting Systems

So long, and thanks for all the fish.
 
That's great thanks Chris...

Have a star as this certainly isn't the first time you've helped me out and that link / example is just the thing!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top