gee.....I'm the trouble maker...am I?.. (I see u still having problem)
ok, here is compleate smiles code I have://--------------------------
//--------Smiles------------
//--------------------------
function smilies($text,$enablesmilies = 1) {
global $smileyfromcache, $smileytocache;
$imagesdir = TEMPLATE_PATH."/smiles";
if(gettype($smileyfromcache) != "array") {
$smilesfrom = get_smiles();
foreach ($smilesfrom as $key => $val) {
$smileyfromcache[] ='/(((>[^<]*)|(^[^<]*))([\s\n\r]|^|<br( \/)?[>]))('.str_replace('|','\|', quotemeta(str_replace("<", "<", str_replace(">", ">", str_replace("\/", "\\\/", $key))))).')/s';
$smileytocache[] = "\\1<img src=\"$imagesdir/$val.gif\" alt=\"\" border=\"0\">";
}
}
if ($enablesmilies) {
$text = parsesmilies($text);
}
return $text;
}
function parsesmilies($text) {
global $smileyfromcache, $smileytocache;
$oldtext = "";
while($oldtext != $text) {
$oldtext = $text;
$text = preg_replace($smileyfromcache, $smileytocache, $text);
}
return $text;
}
function get_smiles(){
/* $smilesfrom = array(
":)" => "smiley",
":angry:" => "angry",
";)" => "wink",
":D" => "cheesy",
";D" => "grin",
":(" => "sad",
":o" => "shocked",
":O" => "shocked",
"8)" => "cool",
":P" => "tongue",
":p" => "tongue",
"???" => "huh",
":-[" => "embarassed",
":-X" => "lipsrsealed",
":-x" => "lipsrsealed",
":-'(" => "cry",
":-\\" => "undecided",
"::)" => "rolleyes",
":kiss:" => "kiss",
":laugh:" => "laugh"
);*/
$smilesfrom = array(
":D" => "icon_biggrin",
":)" => "icon_smile",
":(" => "icon_sad",
":oops:" => "icon_redface",
":o" => "icon_surprised",
"8O" => "icon_eek",
":?" => "icon_confused",
"8)" => "icon_cool",
":lol:" => "icon_lol",
":x" => "icon_mad",
":P" => "icon_razz",
":p" => "icon_razz",
":cry:" => "icon_cry",
":evil:" => "icon_evil",
":twisted:" => "icon_twisted",
":roll:" => "icon_rolleyes",
":wink:" => "icon_wink",
"(?)" => "icon_question",
":idea:" => "icon_idea",
":arrow:" => "icon_arrow",
":neutral:" => "icon_neutral",
":mrgreen:" => "icon_mrgreen"
);
return $smilesfrom;
}
function get_smiles_text() {
$smilesfrom = get_smiles();
$val_old = "";
$i = 0;
foreach ($smilesfrom as $key => $val) {
if ($val_old != $val) {
$smiles_text .= "<a href=\"javascript:emoticon('$key')\"><img src=\"".TEMPLATE_PATH."/smiles/$val.gif\" alt=\"$key\" border=\"0\"></a> ";
}
$val_old = $val;
$i++;
if ($i > 18) {
$smiles_text .= "<a href=\"smiles.php\" onclick=\"window.open('smiles.php', '_4imagessmilies', 'HEIGHT=110,resizable=yes,scrollbars=yes,WIDTH=180');return false;\" target=\"_4imagessmilies\"> All Emoticons</a>";
return $smiles_text;
}
}
return $smiles_text;
}
//------End Smiles-------