Re: [WebDNA] Display Live URL from a Block of Copy

This WebDNA talk-list message is from

2009


It keeps the original formatting.
numero = 101953
interpreted = N
texte = The more I think about this, the more I think javascript would be the way= to go. There are those=20 ad services that take keywords on pages and turn them into hot-links for = advertising. -Dan On Sun, 08 Feb 2009 12:51:08 -0800 "Dan Strong" wrote: > Hmmm, my very first thought is to [listwords] with the space char. as a= delimiter, but it might=20 >end up being process-intensive if you have a lot of it going on. If you = got this route, it might=20 >be best to detect and change to live URLs then write them to the .db rat= her than detect and=20 >change on-the-fly upon every display. >=20 > [!]-- Do this after all cleansing routines, of course (XSS, etc.) --[/!= ] >=20 > [listwords words=3D[grep search=3D%20&replace=3D=20 >][url][your_block_of_text][/url][/grep]&delimiters=3D=20 > ] > [showif [word]~http://] > [grep search=3D[word]&replace=3D[url] href=3D"[/url][word][url]">[/url][word][url][/url]][word][/grep] > [/showif] > [/listwords] >=20 > I grepped [url]'ed spaces in the [listwords] since multiple chars can't= be delimiters that I=20 >know of and you'd need to force user to enter "http://" or detect and ad= d yourself if not there.=20 >Also, you'd need to obviously [unurl] everything either when writing to = .db or displaying. >=20 > This really seems overly-complicated to me, but it was my first thought= , and an incomplete on at=20 >that. I am sure there's a much more elegant way to tackle this, but hope= fully it will give you an=20 >idea. > -Dan >=20 >=20 > On Sun, 08 Feb 2009 14:01:31 -0600 > Eddie Z wrote: >> I thought I'd ask everyone before I dive in and try some stuff... I ha= ve a >> site where I allow an administrator to post content/text to a db via a >> textarea. I want them to be able to post website URLs in the textarea = and >> have the URL be a live link when it is displayed on the site. So in ot= her >> words, I want to pull out URLs from a block of copy and make them live= , >> clickable links when they are displayed on my web page. I would assume >> there's a way to do this, but I've never had to try it until now. >>=20 >> A push in the right direction would be appreciated. >> Eddie > --------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > archives: http://mail.webdna.us/list/talk@webdna.us > old archives: http://dev.webdna.us/TalkListArchive/ Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] Display Live URL from a Block of Copy (Tom Duke 2009)
  2. Re: [WebDNA] Display Live URL from a Block of Copy ("Dan Strong" 2009)
  3. Re: [WebDNA] Display Live URL from a Block of Copy ("Dan Strong" 2009)
  4. [WebDNA] Display Live URL from a Block of Copy (Eddie Z 2009)
The more I think about this, the more I think javascript would be the way= to go. There are those=20 ad services that take keywords on pages and turn them into hot-links for = advertising. -Dan On Sun, 08 Feb 2009 12:51:08 -0800 "Dan Strong" wrote: > Hmmm, my very first thought is to [listwords] with the space char. as a= delimiter, but it might=20 >end up being process-intensive if you have a lot of it going on. If you = got this route, it might=20 >be best to detect and change to live URLs then write them to the .db rat= her than detect and=20 >change on-the-fly upon every display. >=20 > [!]-- Do this after all cleansing routines, of course (XSS, etc.) --[/!= ] >=20 > [listwords words=3D[grep search=3D%20&replace=3D=20 >][url][your_block_of_text][/url][/grep]&delimiters=3D=20 > ] > [showif [word]~http://] > [grep search=3D[word]&replace=3D[url] href=3D"[/url][word][url]">[/url][word][url][/url]][word][/grep] > [/showif] > [/listwords] >=20 > I grepped [url]'ed spaces in the [listwords] since multiple chars can't= be delimiters that I=20 >know of and you'd need to force user to enter "http://" or detect and ad= d yourself if not there.=20 >Also, you'd need to obviously [unurl] everything either when writing to = .db or displaying. >=20 > This really seems overly-complicated to me, but it was my first thought= , and an incomplete on at=20 >that. I am sure there's a much more elegant way to tackle this, but hope= fully it will give you an=20 >idea. > -Dan >=20 >=20 > On Sun, 08 Feb 2009 14:01:31 -0600 > Eddie Z wrote: >> I thought I'd ask everyone before I dive in and try some stuff... I ha= ve a >> site where I allow an administrator to post content/text to a db via a >> textarea. I want them to be able to post website URLs in the textarea = and >> have the URL be a live link when it is displayed on the site. So in ot= her >> words, I want to pull out URLs from a block of copy and make them live= , >> clickable links when they are displayed on my web page. I would assume >> there's a way to do this, but I've never had to try it until now. >>=20 >> A push in the right direction would be appreciated. >> Eddie > --------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > archives: http://mail.webdna.us/list/talk@webdna.us > old archives: http://dev.webdna.us/TalkListArchive/ "Dan Strong"

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

Help name our technology! I found it (1997) OT: Typhoon (1998) WebCat2final1 crashes (1997) ooops...WebCatalog [FoundItems] Problem - LONG - (1997) Alex's detailed WebMerchant questions (1998) bypassing typo's (1998) WebCat b13 CGI -shownext- (1997) problems with 2 tags shakur (1997) PCS Frames (1997) WebDNA and PostGres SQL (2005) No incentive ... (2000) ListFiles and .DS_Store (2004) RE: [shownext] support - MacOS (1997) formula??? (2000) caching -check- (2001) Bad Cookie / Internet Option / Internet Explorer (2004) form data submission gets truncated (1997) Online reference (1997) Applescript error (1998) Golive parses [showif [index]<4] weird (2003)