News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Cleaning Up User Posted URL's

Started by -MunDy-, August 24, 2006, 09:50:37 AM

Previous topic - Next topic

-MunDy-

I've made a simple shoutbox for a friend, it allows the user to input a name, a url/link (their name will be hyper-linked to this link) and their message.

What I want to do is be able to clean up the link the user puts in, because more often than not its quiet messy (leaving things like http:// out, or not even putting a valid link in etc).

I know SMF does this automaticall for posts (for example, it finds links in someones posts and automatically hyperlinks them to the "cleaned" address), but I've been looking through the sources trying to find where it does it and how, but with little luck. I'm still only a novice when it comes to PHP and things like regular expressions confuse the hell out of me =(.

I understand the way SMF does it is probably rather tricky, so I was wondering if there a simpler way to do it? Could someone point out a few functions that I'd need to have a look at? Or does anyone know of a similar tutorial?

Thanks in advance =)

-MunDy-

Anyone have any idea on how to do this?

Advertisement: