| | |
emoticon integration into shout box
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
I recently added a shout box to my page and I am interesting in adding emoticons. I have searched around and found no standalone emoticon script, at least none that I could get to work.
I would appreciate any suggestions on how to add emoticons to my shout box script.
Thanks
www.nikuki.com
I would appreciate any suggestions on how to add emoticons to my shout box script.
Thanks
www.nikuki.com
Suppose a user enters something and it is stored as a string. Run the php function str_replace on that string before posting. Each time you find the sequence :) then replace it with <img src="smiley.gif">
Here is some more info: http://us2.php.net/str-replace
Here is some more info: http://us2.php.net/str-replace
Dani the Computer Science Gal 
Follow my Twitter feed! twitter.com/DaniWeb
And if you're interested in Internet marketing there is twitter.com/DaniWebAds

Follow my Twitter feed! twitter.com/DaniWeb
And if you're interested in Internet marketing there is twitter.com/DaniWebAds
ok, so now, i want to offer a page with a list of all emoticons and let the user click on one to add it to their post... like on www.skinbase.org
Create a table with all of the different icons as images. Use javascript (sorry, I don't know the language enough to provide sample code, but it shouldn't be difficult at all) so that when an image is clicked on, it adds the text equivalent of the smilie to the textbox. When the user clicks submit, the php file will run the str_replace function and make it into an image.
Dani the Computer Science Gal 
Follow my Twitter feed! twitter.com/DaniWeb
And if you're interested in Internet marketing there is twitter.com/DaniWebAds

Follow my Twitter feed! twitter.com/DaniWeb
And if you're interested in Internet marketing there is twitter.com/DaniWebAds
•
•
Join Date: Feb 2003
Posts: 282
Reputation:
Solved Threads: 6
Make sure your code is compatible with more browsers than just IE. And Dani, the code should be: <img src="smiley.gif" /> :p
actually it should be
<img src="smilie.gif" alt="" />
<img src="smilie.gif" alt="" />
Firefox: no, its not the end all solution, it has its own issues and in time it will be just as insecure as IE, when its hit Firefox 6, if it makes it that far. Oh, and AOL pays for it, incase you didn't know.
Microsoft & Windows: If you hate it so much, move to linux, or bsd, or anything else, stop complaning and move on.
Good starting places: Gentoo Novell SUSE Fedora Core Apple
Microsoft & Windows: If you hate it so much, move to linux, or bsd, or anything else, stop complaning and move on.
Good starting places: Gentoo Novell SUSE Fedora Core Apple
•
•
Join Date: Feb 2003
Posts: 282
Reputation:
Solved Threads: 6
Well if you wanna be like that, you should have included some alt text. 
Besides, come to think of it, there's anotherr new standard which is something like <object type="image/gif" src="smilie.gif" alt="Smile!" />

Besides, come to think of it, there's anotherr new standard which is something like <object type="image/gif" src="smilie.gif" alt="Smile!" />
![]() |
Views: 6883 | Replies: 8
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code cron curl database date directory display download dynamic echo email encode error file files folder form forms function functions google howtowriteathesis href htaccess html image include insert integration ip java javascript joomla jquery limit link login loop mail menu methods mlm mod_rewrite multiple multipletables mysql oop parse paypal pdf php problem provider query radio random recursion regex remote script search select server sessions sms soap source space speed sql structure syntax system table template tutorial update updates upload url validation validator variable video web xml youtube






