why some smiles didnt show this is my code
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(
":)" => "happy",
"(:" => "happy",
":-))" => "laughing",
":lol:" => "laughing",
":D" => "big_grin",
":O" => "surprise",
":o" => "surprise",
";)" => "winking",
":wink:" => "winking",
":(" => "sad",
":*(" => "crying",
":cry:" => "crying",
":confused:" => "confused",
":shy:" => "blushing",
":vicious:" => "smug",
":|" => "straight_face",
":pig:" => "pig",
":P" => "tongue",
":p" => "tongue",
"B)" => "cool",
":B" => "nerd",
"X(" => "angry",
":X" => "love_struck",
"|)" => "sleepy",
"=;" => "talk_to_the_hand",
"@};-" => "rose",
"):)" => "cowboy",
"8X" => "skull",
"=:)" => "alien",
"0:)" => "angel",
":devil:" => "devil",
":clown:" => "clown",
"3:O" => "cow",
"3:o" => "cow",
":monkey:" => "monkey",
"(~~)" => "pumpkin",
"[-(" => "not_talking",
"*:)" => "idea",
":$" => "dont_tell_anyone",
":chicken:" => "chicken",
"~o)" => "coffee",
"%%-" => "good_luck",
"b(" => "feeling_beat_up",
":E:" => "peace_sign",
":&" => "sick",
"=*" => "kiss",
";;)" => "batting_eyelashes",
":?)" => "raised_eyebrow",
"(%)" => "yin_yang",
"o-+" => "april",
":billy:" => "billy",
":hiro:" => "hiro",
":mad:" => "frustrated",
":R:" => "praying",
"[-x" => "shame_on_you",
"[:D]" => "big_hug",
":dance:" => "dancing",
"=D" => "applause",
"(?)" => "thinking",
":^o" => "liar",
"@)" => "hypnotized",
"8|" => "rolling_eyes",
"8}" => "silly",
"?|" => "yawn",
"=p~" => "drooling",
"$)" => "money_eyes",
":whistle:" => "whistling",
"#o" => "doh",
":alien:" => "bug",
":S" => "worried",
"~X(" => "at_wits_end",
"o=>" => "billy",
">:b" => "bring_it_on",
"=((" => "broken_heart",
":-c" => "call_me",
":-@" => "chatterbox",
"8->" => "daydreaming",
";))" => "hee_hee",
":-??" => "i_dont_know",
"L-)" => "loser",
":-SS" => "nailbiting",
"%-(" => "not_listening",
"^:)^" => "not_worthy",
":-j" => "oh_go_on",
":)]" => "on_the_phone",
"<:-p" => "party",
">:-p" => "phbbbbt",
"=))" => "rolling_on_the_floor",
":-<" => "sigh",
"(*)" => "star",
":-t" => "time_out",
":-w" => "waiting",
":-h" => "wave",
"w:-S" => "whew",
);
return $smilesfrom;
}
function get_smiles_text() {
$smilesfrom = get_smiles();
$val_old = "";
$i = 0;
$val_old = array();
foreach ($smilesfrom as $key => $val) {
if (!in_array($val, $val_old)) {
$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 > 100) {
$smiles_text .= "<a href=\"smiles.php\" onclick=\"window.open('smiles.php', '_4imagessmilies', ',',',',','HEIGHT=310,resizable=yes,scrollbars=yes,WIDTH=225');return false;\" target=\"_4imagessmilies\"> Mostrar Todas</a>";
return $smiles_text;
}
}
return $smiles_text;
}
//------End Smiles-------
the smilies like <:-p dindt show, it show like text and didnt show the image
thanks for your help