smiles Posted March 19, 2007 Share Posted March 19, 2007 I have just finished a forum, now I want in the post 's part having some smileys How can I do that ???Do I need Javascript ???thanks ! Link to comment Share on other sites More sharing options...
Anders Moen Posted March 19, 2007 Share Posted March 19, 2007 You can use bbCodes <?phpfunction someName($text) {$text = str_replace(':)', '<img src="img_smile.jpg" alt="" />', $text);$text = str_replace(':D', '<img src="img_bigsmile.jpg" alt="" />', $text);$text = str_replace(':(', '<img src="img_sad.jpg" alt="" />', $text);return $text;}?> You get it? You do something like that :)Add this line to each new smiley: $text = str_replace(' in here you write in example :) ', ' and here you continue with the img code', $text);=:) replaced with <img src="url to image" alt="" /> If you're relative new with functions and stuff, in the while loop, you write: echo someName($row['content']); Link to comment Share on other sites More sharing options...
smiles Posted March 19, 2007 Author Share Posted March 19, 2007 but where exactly should I put that function Link to comment Share on other sites More sharing options...
smiles Posted March 19, 2007 Author Share Posted March 19, 2007 hi that works thanks so much !!! Link to comment Share on other sites More sharing options...
Anders Moen Posted March 19, 2007 Share Posted March 19, 2007 Lol, okay.. That's good :)I presume you found out that you can put it anywhere, hehe. It's best to include it, because if you need to change or add a smiley, you don't need to go to all pages hehe...oh well, I think you know that already Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now