disputedip.com

PHP

Emoticon Engine!

by Martyn on Jan.01, 2008, under PHP

I needed an emoticon engine, so I made one (tired of writing a ‘new’ one everytime a client needs one). How to use it:

  • Include the class file
  • Edit it as required (suggest a url for the path to the files)
  • Then do something like:

$dpe = new DPEmoticonEngine();
$content = $dpe->parseText($content);

  • And its done!

If you have a lot of icons, or lots of different sets of icons then you may want to pre-load the emoticon variable.

  • Set the class file as required
  • Then so something like:

$dpe = new DPEmoticonEngine();
$evar = $dpe->getEmoticons();

  • Save $evar in a database, create as many different setups as you like, just edit the class file each time.
  • To use the saved setup:

$evar = …
$dpe = new DPEmoticonEngine($evar);

  • And everything else as normal

Have fun. (and Happy New Year)

Download DisputedIP Emoticon Engine (PHP) by clicking here

This work is licenced under a Creative Commons Licence.

Leave a Comment more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...