pf » Auto-Linking Comments
Auto-Linking Comments
To avoid comment spam, my blog comments are displayed as plain text. However urls to other entries on my blog are often posted to in the comments. So I wrote a simple regular expression to create hyperlinks out of them:
REReplaceNoCase(comments.comment, "(http://www\.petefreitag\.com/[^[:space:]]+)", "<a href=""\1"">\1</a>", "ALL")
If you want this to work with or without the www you can use something like this for the regular expression:
(http://w*\.?petefreitag\.com/[^[:space:]]+)
Related Entries
- Regex to Replace Multiple Blank Lines with One - May 19, 2005
- Gravatar's not showing up? - December 18, 2006
- Widon't and Widows - September 5, 2006
- How To Make a Tag Cloud - June 24, 2005
- Last 100 Comments - May 23, 2005
[OT]
you wouldnt happen to know how they have and can display the content in different languages over at MXNA, would ya?
http://weblogs.macromedia.com/mxna/UserPreferences.cfm
I think the other languages on MXNA are blogs that are actually written in those languages. I could be mistaken perhaps Christain Cantrell or Mike Chambers will read this and can comment further.
Then I can construct which posts are most useful, and which are not.
See http://www.petefreitag.com/about/ for a list of most useful posts so far. (ooh that should auto-link)
www.kl4e.com/music
thanks
much love, Jewlz
- CFSCRIPT Cheatsheet
- 3 New Image Effects for ColdFusion 8
- Googlebot to Submit Web Forms
- ColdFusion 8 Update 1 Fixes some Image Processing Quirks
- 10 Most Useful Image Functions in ColdFusion 8
- Speaking at NYC CFUG This Week
- Adobe AIR Tutorial for HTML / JavaScript Developers
- INFORMATION_SCHEMA Support in MySQL, PostgreSQL
RSS
add to del.icio.us
Pete Freitag is a software engineer, and web developer located in










