mirror of
https://github.com/e107inc/e107.git
synced 2025-01-18 05:09:05 +01:00
46 lines
1.2 KiB
PHP
46 lines
1.2 KiB
PHP
<?php
|
|
/*
|
|
+ ----------------------------------------------------------------------------+
|
|
| e107 website system
|
|
|
|
|
| ©Steve Dunstan 2001-2002
|
|
| http://e107.org
|
|
| jalist@e107.org
|
|
|
|
|
| Released under the terms and conditions of the
|
|
| GNU General Public License (http://gnu.org).
|
|
|
|
|
| $Source: /cvs_backup/e107_0.8/e107_handlers/emote.php,v $
|
|
| $Revision: 1.2 $
|
|
| $Date: 2006-12-19 20:34:12 $
|
|
| $Author: e107steved $
|
|
+----------------------------------------------------------------------------+
|
|
*/
|
|
if (!defined('e107_INIT')) { exit; }
|
|
|
|
function r_emote()
|
|
{
|
|
global $sysprefs, $pref, $tp;
|
|
|
|
if (!is_object($tp->e_emote))
|
|
{
|
|
require_once(e_HANDLER.'emote_filter.php');
|
|
$tp->e_emote = new e_emoteFilter;
|
|
}
|
|
|
|
foreach($tp->e_emote->emotes as $key => $value)
|
|
{
|
|
$key = str_replace("!", "_", $key);
|
|
$key = preg_replace("#_(\w{3})$#", ".\\1", $key);
|
|
$key = e_IMAGE."emotes/" . $pref['emotepack'] . "/" .$key;
|
|
|
|
$value2 = substr($value, 0, strpos($value, " "));
|
|
$value = ($value2 ? $value2 : $value);
|
|
$value = ($value == '&|') ? ':((' : $value;
|
|
$str .= "\n<a href=\"javascript:addtext('$value',true)\"><img src='$key' style='border:0; padding-top:2px;' alt='' /></a> ";
|
|
}
|
|
|
|
return "<div class='spacer'>".$str."</div>";
|
|
}
|
|
|
|
?>
|