smilies[':)'] = '001_smile.gif'; $this->smilies[':('] = 'sad.gif'; $this->smilies[':D'] = 'biggrin.gif'; $this->smilies[':P'] = '001_tongue.gif'; $this->init = true; } function parseSmiliesFirstPass($text) { if (!$this->init) { $this->init(); } foreach ($this->smilies as $name => $value) { $text = str_replace($name, '[emoticon]' . $name . '[/emoticon]', $text); } return $text; } function parseSmiliesSecondPass($text) { if (!$this->init) { $this->init(); } foreach ($this->smilies as $name => $value) { $text = str_replace('[emoticon]' . $name . '[/emoticon]', '' . $name . '', $text); } return $text; } } function parseSmiliesFirstPass($text) { global $smilies; if (!isset($smilies)) { $smilies = new Smilies(); } return $smilies->parseSmiliesFirstPass($text); } function parseSmiliesSecondPass($text) { global $smilies; if (!isset($smilies)) { $smilies = new Smilies(); } return $smilies->parseSmiliesSecondPass($text); } ?>