2006-12-02 04:36:16 +00:00
|
|
|
|
<?php
|
|
|
|
|
/*
|
|
|
|
|
+ ----------------------------------------------------------------------------+
|
|
|
|
|
| e107 website system
|
|
|
|
|
|
|
|
|
|
|
| <EFBFBD>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 $
|
2009-07-25 07:54:36 +00:00
|
|
|
|
| $Revision: 1.5 $
|
|
|
|
|
| $Date: 2009-07-25 07:54:34 $
|
|
|
|
|
| $Author: marj_nl_fr $
|
2006-12-02 04:36:16 +00:00
|
|
|
|
+----------------------------------------------------------------------------+
|
|
|
|
|
*/
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
2007-04-15 16:07:39 +00:00
|
|
|
|
$str = '';
|
2007-05-24 21:07:21 +00:00
|
|
|
|
foreach($tp->e_emote->emotes as $key => $value) // filename => text code
|
2006-12-02 04:36:16 +00:00
|
|
|
|
{
|
2007-05-24 21:07:21 +00:00
|
|
|
|
$key = str_replace("!", ".", $key); // Usually '.' was replaced by '!' when saving
|
|
|
|
|
$key = preg_replace("#_(\w{3})$#", ".\\1", $key); // '_' followed by exactly 3 chars is file extension
|
|
|
|
|
$key = e_IMAGE."emotes/" . $pref['emotepack'] . "/" .$key; // Add in the file path
|
2006-12-02 04:36:16 +00:00
|
|
|
|
|
|
|
|
|
$value2 = substr($value, 0, strpos($value, " "));
|
|
|
|
|
$value = ($value2 ? $value2 : $value);
|
|
|
|
|
$value = ($value == '&|') ? ':((' : $value;
|
2009-07-25 07:54:36 +00:00
|
|
|
|
//TODO CSS class
|
|
|
|
|
$str .= "\n<a href=\"javascript:addtext('$value',true)\"><img src='$key' alt='' /></a> ";
|
2006-12-02 04:36:16 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return "<div class='spacer'>".$str."</div>";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
?>
|