From c895d2f41b0737f8a2799d36beca087e6b642f05 Mon Sep 17 00:00:00 2001 From: Starla Insigna Date: Wed, 17 Dec 2008 21:00:03 -0500 Subject: Added an emoticon parsing system I decided that, because I use the :) emoticon so often, I might as well replace it with an actual image. I've added a Smiley parsing system to complement the BBCode parsing one. --- includes/smilies.php | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100755 includes/smilies.php (limited to 'includes/smilies.php') diff --git a/includes/smilies.php b/includes/smilies.php new file mode 100755 index 0000000..843af05 --- /dev/null +++ b/includes/smilies.php @@ -0,0 +1,64 @@ +smilies[':)'] = '001_smile.gif'; + + $this->init = true; + } + + function parseSmilies($text) + { + if (!$this->init) + { + $this->init(); + } + + foreach ($this->smilies as $name => $value) + { + $text = str_replace($name, '' . $name . '', $text); + } + + return $text; + } +} + +function parseSmilies($text) +{ + global $smilies; + if (!isset($smilies)) + { + $smilies = new Smilies(); + } + + return $smilies->parseSmilies($text); +} + +?> -- cgit 1.4.1