Code: Select all
function InsertSmiley($text, $root_url)
{
if ($this->SmileysModuleIsInstalled())
{
$mi = &$this->getModuleInstance('Smileys');
return $mi->ReplaceSmileys($text);
}
$base = $root_url . '/modules/' . $this->GetName() . '/images/smileys/default';
$img1 = '<img src="' . $base . '/' . 'biggrin.gif"' . ' alt="breites grinsen" />';
$img2 = '<img src="' . $base . '/' . 'confused.gif"' . ' alt="verwirrt" />';
$img3 = '<img src="' . $base . '/' . 'cool.gif"' . ' alt="cool" />';
$img4 = '<img src="' . $base . '/' . 'cry.gif"' . ' alt="weinen" />';
$img5 = '<img src="' . $base . '/' . 'eek.gif"' . ' alt="erschrocken" />';
$img6 = '<img src="' . $base . '/' . 'evil.gif"' . ' alt="böse" />';
$img7 = '<img src="' . $base . '/' . 'lol.gif"' . ' alt="laut lachen" />';
$img8 = '<img src="' . $base . '/' . 'zunge.gif"' . ' alt="zunge rausstrecken" />';
$img9 = '<img src="' . $base . '/' . 'rolleyes.gif"' . ' alt="augen verdrehen" />';
$img10 = '<img src="' . $base . '/' . 'sad.gif"' . ' alt="traurig" />';
$img11 = '<img src="' . $base . '/' . 'smile.gif"' . ' alt="lächeln" />';
$img12 = '<img src="' . $base . '/' . 'wink.gif"' . ' alt="zwinckern" />';
$text = str_replace(':D', $img1, $text);
$text = str_replace(':-D', $img1, $text);
$text = str_replace(':/', $img2, $text);
$text = str_replace(':-/', $img2, $text);
$text = str_replace('8)', $img3, $text);
$text = str_replace('8-)', $img3, $text);
$text = str_replace('=(', $img4, $text);
$text = str_replace('=-(', $img4, $text);
$text = str_replace(':o', $img5, $text);
$text = str_replace(':-o', $img5, $text);
$text = str_replace('X(', $img6, $text);
$text = str_replace('x(', $img6, $text);
$text = str_replace('X-(', $img6, $text);
$text = str_replace('x-(', $img6, $text);
$text = str_replace(':lol:', $img7, $text);
$text = str_replace(':P', $img8, $text);
$text = str_replace(':-P', $img8, $text);
$text = str_replace(':p', $img8, $text);
$text = str_replace(':-p', $img8, $text);
$text = str_replace(':roll:', $img9, $text);
$text = str_replace(':(', $img10, $text);
$text = str_replace(':-(', $img10, $text);
$text = str_replace(':)', $img11, $text);
$text = str_replace(':-)', $img11, $text);
$text = str_replace(';)', $img12, $text);
$text = str_replace(';-)', $img12, $text);
return $text;
}
Code: Select all
<img src="http<img src="http://www.myurl.tld/modules/Guestbook/images/smileys/default/confused.gif" alt="verwirrt" />/www.myurl.tld/modules/Guestbook/images/smileys/default/biggrin.gif" alt="breites grinsen" /><br />
<img src="http<img src="http://www.myurl.tld/modules/Guestbook/images/smileys/default/confused.gif" alt="verwirrt" />/www.myurl.tld/modules/Guestbook/images/smileys/default/biggrin.gif" alt="breites grinsen" /><br />
<img src="http://www.myurl.tld/modules/Guestbook/images/smileys/default/confused.gif" alt="verwirrt" /><br />
<img src="http://www.myurl.tld/modules/Guestbook/images/smileys/default/confused.gif" alt="verwirrt" />
G