well, here the code that will need tweaking a bit as i wrote this just now and havent tested it much
start of code for the tag hrefparser
<cfset val=htmleditformat(attributes.string)> <cfset pos1 = findnocase("http://",val)> <cfif pos1 gt 0> <cfset val2=removechars(val,1,(pos1-1))> <cfset pos2=findnocase(" ",val2,pos1)> <cfif pos2 gt 0> <cfset val2=removechars(val2,pos2,len(val2)-1)>
</cfif> <cfset myval2="{a href='"&val2&" ' target='_blank'>"&val2&"</a>"> <cfset value= replacenocase(val,val2,myval2)>
<cfset caller.href=(value)> <cfelse> <cfset caller.href=val> </cfif>
end of code
usage on other pages
<cfset txt = "amit is good at http://www.quickcoding.com"> <cf_hrefparser string="#txt#"> <cfoutput>#href#</cfoutput>
this is just an example! you need to write a better one to suit your needs! its just based on a factor that web adress cannot contain spaces and must start with http:// for yourneeds you'll have to make it for www as well as email address . just think of those algorithms and then code them happy coding,
Sincerely, Amit Talwar intellikaps
-----Original Message----- From: Tony [mailto:webmigit@alltel.net] Sent: Monday, May 14, 2001 3:08 AM To: CF-Server Subject: Re: Pop2Web Interface Question
How would a regular expression cover any of these types of link... telling it to start at http:// would be easy but how to tell it where to stop? Or what about an email address?
Sorry I'm very new to regular expression and have only successfully used them for a print friendly script....
Tony Hicks ----- Original Message ----- From: {amittalwar@intellikaps.com> To: CF-Server <cf-server@houseoffusion.com> Sent: Sunday, May 13, 2001 4:37 PM Subject: RE: Pop2Web Interface Question
> No, there aint a function to do this but you can always write a custom tag > for the same, you can use regular expressions for this. > Regards, > Amit Talwar > > -----Original Message----- > From: Tony Hicks [mailto:webmaster@righteousdesigns.com] > Sent: Monday, May 14, 2001 2:37 AM > To: CF-Server > Subject: Pop2Web Interface Question > > > I'm writing a POP3 to web interface for checking sending and deleting > email... my question is: > > When the user clicks an email and they see a url or an email address that > should be a link, it's not, is there a function to do this like: > > #TurnValidStaticTextToLinkForm(#Body#)#? > > Thanks, > Tony Hicks > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm ------------------------------------------------------------------------------ To unsubscribe, send a message to cf-server-request@houseoffusion.com with 'unsubscribe' in the body or visit the list page at www.houseoffusion.com