URL conversion into an active links

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
khaki_monster
Forum Commoner
Posts: 73
Joined: Tue Oct 11, 2005 12:36 am
Location: Philippines
Contact:

URL conversion into an active links

Post by khaki_monster »

hi guyz! new guy here...

how do I convert URL’s into an active links on a shoutbox like when a visitor’s in input something like “this is my website http://www.yahoo.comhttp://www.yahoo.com should become an active link ("similar to this post") that would popup in a new page. :roll:

tanx in advanced...
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

You would need to parse the input and match the pattern with a regex, then replace the match with the <a href="www.somesite.com">www.somesite.com</a>
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

pull up the phpbb codebase. Find make_clickable() in bbcode.php (I think it's in there)
User avatar
khaki_monster
Forum Commoner
Posts: 73
Joined: Tue Oct 11, 2005 12:36 am
Location: Philippines
Contact:

Post by khaki_monster »

can anyone show me some good example? :D
Post Reply