Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: smile

Parašė linuteko· 2007 Lie. 17 11:07:01
#20

// Parse smiley bbcode into HTML images
function parsesmileys($message) {
   $smiley = array(
      "#\:\)#si" => "<img src='".IMAGES."smiley/icon_smile.gif' alt='smiley'>",
      "#\;\)#si" => "<img src='".IMAGES."smiley/icon_wink.gif' alt='smiley'>",
      "#\:\(#si" => "<img src='".IMAGES."smiley/icon_sad.gif' alt='smiley'>",
      "#\:\|#si" => "<img src='".IMAGES."smiley/icon_frown.gif' alt='smiley'>",
      "#\:o#si" => "<img src='".IMAGES."smiley/icon_surprised.gif' alt='smiley'>",
      "#\:p#si" => "<img src='".IMAGES."smiley/icon_razz.gif' alt='smiley'>",
      "#b\)#si" => "<img src='".IMAGES."smiley/icon_cool.gif' alt='smiley'>",
      "#\:d#si" => "<img src='".IMAGES."smiley/icon_biggrin.gif' alt='smiley'>",
      "#\:@#si" => "<img src='".IMAGES."smiley/icon_evil.gif' alt='smiley'>",
      "#\:cheesygrin#si" => "<img src='".IMAGES."smiley/icon_cheesygrin.gif' alt='smiley'>",
      "#\;\(#si" => "<img src='".IMAGES."smiley/icon_cry.gif' alt='smiley'>",
      "#\:\(#si" => "<img src='".IMAGES."smiley/icon_sad.gif' alt='smiley'>",
      "#\:eek#si" => "<img src='".IMAGES."smiley/icon_eek.gif' alt='smiley'>",
      "#\:evil#si" => "<img src='".IMAGES."smiley/icon_evil.gif' alt='smiley'>",
      "#\:exclaim#si" => "<img src='".IMAGES."smiley/icon_exclaim.gif' alt='smiley'>",
      "#\:idea#si" => "<img src='".IMAGES."smiley/icon_idea.gif' alt='smiley'>",
      "#\:lol#si" => "<img src='".IMAGES."smiley/icon_lol.gif' alt='smiley'>",
      "#\:mad#si" => "<img src='".IMAGES."smiley/icon_mad.gif' alt='smiley'>",
      "#\:mrgreen#si" => "<img src='".IMAGES."smiley/icon_mrgreen.gif' alt='smiley'>",
      "#\:neutral#si" => "<img src='".IMAGES."smiley/icon_neutral.gif' alt='smiley'>",
      "#\:question#si" => "<img src='".IMAGES."smiley/icon_question.gif' alt='smiley'>",
      "#\:redface#si" => "<img src='".IMAGES."smiley/icon_redface.gif' alt='smiley'>",
      "#\:rolleyes#si" => "<img src='".IMAGES."smiley/icon_rolleyes.gif' alt='smiley'>",
      "#\:twisted#si" => "<img src='".IMAGES."smiley/icon_twisted.gif' alt='smiley'>",
      "#\:arrow#si" => "<img src='".IMAGES."smiley/icon_arrowd.gif' alt='smiley'>",
      "#\:arrowl#si" => "<img src='".IMAGES."smiley/icon_arrowdl.gif' alt='smiley'>",
      "#\:arrowd#si" => "<img src='".IMAGES."smiley/icon_arrowd.gif' alt='smiley'>",
      "#\:arrowu#si" => "<img src='".IMAGES."smiley/icon_arrowu.gif' alt='smiley'>",
      "#\:arrowu#si" => "<img src='".IMAGES."smiley/icon_arrowu.gif' alt='smiley'>",
      "#\:cheerful#si" => "<img src='".IMAGES."smiley/cheerful.gif' alt='smiley'>",
      "#\:waved#si" => "<img src='".IMAGES."smiley/wave.gif' alt='smiley'>",
      "#\:starry-eyed#si" => "<img src='".IMAGES."smiley/starry-eyed.gif' alt='smiley'>",
      "#\:eyebrowl#si" => "<img src='".IMAGES."smiley/eyebrow.gif' alt='smiley'>",
      "#\:character\0127#si" => "<img src='".IMAGES."smiley/character0127.gif' alt='smiley'>",
      "#\:tongue\0027#si" => "<img src='".IMAGES."smiley/tongue0027.gif' alt='smiley'>",
      "#\:happy\0191#si" => "<img src='".IMAGES."smiley/happy0191.gif' alt='smiley'>",
      "#\:glassesslip#si" => "<img src='".IMAGES."smiley/glasses-slip.gif' alt='smiley'>",
      "#\:scratchchin#si" => "<img src='".IMAGES."smiley/scratchchin.gif' alt='smiley'>",
      "#\:party\0049#si" => "<img src='".IMAGES."smiley/party0049.gif' alt='smiley'>",
      "#\:reading#si" => "<img src='".IMAGES."smiley/reading.gif' alt='smiley'>",
      "#\:highfive#si" => "<img src='".IMAGES."smiley/highfive.gif' alt='smiley'>",
      "#\:flirt#si" => "<img src='".IMAGES."smiley/flirt.gif' alt='smiley'>",
      "#\:heartbeat#si" => "<img src='".IMAGES."smiley/heartbeat.gif' alt='smiley'>",
      "#\:lovestruck#si" => "<img src='".IMAGES."smiley/lovestruck.gif' alt='smiley'>",
      "#\:hug#si" => "<img src='".IMAGES."smiley/hug.gif' alt='smiley'>",
      "#\:bored1#si" => "<img src='".IMAGES."smiley/bored1.gif' alt='smiley'>",
      "#\:bored#si" => "<img src='".IMAGES."smiley/bored.gif' alt='smiley'>",
      "#\:yawn#si" => "<img src='".IMAGES."smiley/yawn.gif' alt='smiley'>",
      "#\:faint#si" => "<img src='".IMAGES."smiley/faint.gif' alt='smiley'>",
      "#\:blah2#si" => "<img src='".IMAGES."smiley/blah2.gif' alt='smiley'>",
      "#\:wrong#si" => "<img src='".IMAGES."smiley/wrong.gif' alt='smiley'>",
      "#\:confused\0081#si" => "<img src='".IMAGES."smiley/confused0081.gif' alt='smiley'>",
      "#\:confused\0074#si" => "<img src='".IMAGES."smiley/confused0074.gif' alt='smiley'>",
      "#\:scared\0005" => "<img src='".IMAGES."smiley/scared0005.gif' alt='smiley'>",
      "#\:sneeze#si" => "<img src='".IMAGES."smiley/sneeze.gif' alt='smiley'>",
      "#\:vomit#si" => "<img src='".IMAGES."smiley/vomit.gif' alt='smiley'>",
      "#\:party\0006#si" => "<img src='".IMAGES."smiley/party0006.gif' alt='smiley'>",
      "#\:jump#si" => "<img src='".IMAGES."smiley/jump.gif' alt='smiley'>",
      "#\:yes#si" => "<img src='".IMAGES."smiley/yes.gif' alt='smiley'>",
      "#\:no#si" => "<img src='".IMAGES."smiley/no.gif' alt='smiley'>",
      "#\:winner" => "<img src='".IMAGES."smiley/winner.gif' alt='smiley'>",
      "#\:horse#si" => "<img src='".IMAGES."smiley/horse.gif' alt='smiley'>",
      "#\:dog#si" => "<img src='".IMAGES."smiley/dog13.gif' alt='smiley'>",
      "#\:ferret#si" => "<img src='".IMAGES."smiley/ferret.gif' alt='smiley'>",
      "#\:parrot#si" => "<img src='".IMAGES."smiley/parrot.gif' alt='smiley'>",
      "#\:tropicalfish#si" => "<img src='".IMAGES."smiley/tropicalfis.gif' alt='smiley'>",
      "#\:chameleon#si" => "<img src='".IMAGES."smiley/chameleon.gif' alt='smiley'>",
      "#\:frog" => "<img src='".IMAGES."smiley/frog.gif' alt='smiley'>",
      "#\:spider#si" => "<img src='".IMAGES."smiley/spider1.gif' alt='smiley'>",
      "#\:snail#si" => "<img src='".IMAGES."smiley/snail3.gif' alt='smiley'>",
      "#\:ladybird#si" => "<img src='".IMAGES."smiley/ladybird2.gif' alt='smiley'>",
      "#\:butterfly#si" => "<img src='".IMAGES."smiley/butterfly01.gif' alt='smiley'>",
      "#\:rose#si" => "<img src='".IMAGES."smiley/rose.gif' alt='smiley'>",
      "#\:present#si" => "<img src='".IMAGES."smiley/present.gif' alt='smiley'>",
      "#\:birthday" => "<img src='".IMAGES."smiley/birthday.gif' alt='smiley'>",
      "#\:trophy#si" => "<img src='".IMAGES."smiley/trophy.gif' alt='smiley'>",
      "#\:cup#si" => "<img src='".IMAGES."smiley/sign0196.gif' alt='smiley'>",
      "#\:star" => "<img src='".IMAGES."smiley/star.gif' alt='smiley'>",
      "#\:moon#si" => "<img src='".IMAGES."smiley/moon.gif' alt='smiley'>",
      "#\:sunrise#si" => "<img src='".IMAGES."smiley/sunrise.gif' alt='smiley'>"
 );
foreach($smiley as $key=>$smiley_img) $message = preg_replace($key, $smiley_img, $message);
return $message;
}