I'm writing a simple chat system.
When I say simple, I mean simple, you type in your message and press chat to send the message. The user also have to press the button to update the page. I've done it like this because I don't wanna use any autorefresh stuff because some of the users will be using SmartPhones which don't support autorefresh.
Anyways, I've added several smilies using string replace. When a user enters :smoke: then a smilie smoking gets inserted. This is working fine.
But I also want to let the users have the ability to insert urls, maybe using bbcode format or something similar. I tried using string replace for this but it just messed up the whole thing as you probably can imagine.
I want users to be able to insert a link like this [ url = http://www.geotrail.no ] GeoTrail [ /url ] and then a link would be inserted with the link title. And I also want to be able to add links to text that starts with [url]http://[/url]
Hopefully someone can help me with this 🙂
Thanks in advance.