1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
<?
/*
* MSN Emoticons Script
* Easily Inserts MSN Emoticons onto your Website
*
* Author : JMan
* HomePage : www.bedpan.ca
* Email : jman@bedpan.ca
*/
function sortLen($a, $b){
if (strlen($a) == strlen($b)) return 0;
return (strlen($a) > strlen($b)) ?-1 :1;
}
function Smilies($text){
$imgdir = "smilies/";
$code = array(":)",":D",":O",":P",";)",":(",":S",":|",":'(",":$","(H)",":@","(A)","(6)",":-#","8o|","8-|","^o)",":-*","+o(",":^)","*-)","<:o)","8-)","|-)","(C)","(Y)","(N)","(B)","(D)","(X)","(Z)","({)","(})",":[","(^)","(L)","(U)","(K)","(G)","(F)","(W)","(P)","(~)","(@)","(&)","(T)","(I)","(8)","(S)","(*)","(E)","(O)","(M)","(sn)","(bah)","(pl)","(||)","(pi)","(so)","(au)","(ap)","(um)","(ip)","(co)","(mp)","(st)","(li)","(mo)","(%)","(R)","(?)","(#)","(ci)","(brb)","(tu)","(h5)","(xx)","(yn)","(nah)");
uasort($code, 'sortLen');
$used = array();
if ($text) {
foreach ($code as $b => $r){
$text = str_ireplace($r, "<img src=\"$imgdir$b.gif\" border=\"0\">", $text);
$used[$b] = htmlspecialchars($r);
}
foreach ($used as $b => $r){
$text = str_ireplace("<img src=\"$imgdir$b.gif\" border=\"0\">", "<img src=\"$imgdir$b.gif\" alt=\"$r\" title=\"$r\" border=\"0\">", $text);
}
return $text;
}
}
?>
|