Revision: 20382
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at November 14, 2009 01:15 by gnetsystems
Initial Code
function smiley($str){ //smileys to check for $smiles=array( ":)",":-)",":D",":-D",";)",";-)",":O", ":-O",":P",":-P","w00t","8)","8-)",":S", ":s","\:\(","\;\(","\|\)",":@" ); // replace with emoticons $replacements=array( "<img src="http//yourwebsite.com/image/smile.gif" width="20" height="20" title="happy smiley" />", "<img src="http//yourwebsite.com/image/smile.gif" width="20" height="20" title="happy smiley" />", "<img src="http//yourwebsite.com/image/biggrin.gif" width="20" height="20" title="big grin smiley" />", "<img src="http//yourwebsite.com/image/biggrin.gif" width="20" height="20" title="big grin smiley" />", "<img src="http//yourwebsite.com/image/wink.gif" width="20" height="20" title="winking smiley" />", "<img src="http//yourwebsite.com/image/wink.gif" width="20" height="20" title="winking smiley" />", "<img src="http//yourwebsite.com/image/ohmy.gif" width="20" height="20" title="oh my smiley" />", "<img src="http//yourwebsite.com/image/ohmy.gif" width="20" height="20" title="oh my smiley" />", "<img src="http//yourwebsite.com/image/tongue.gif" width="20" height="20" title="tongue smiley" />", "<img src="http//yourwebsite.com/image/tongue.gif" width="20" height="20" title="tongue smiley" />", "<img src="http//yourwebsite.com/image/w00t.gif" width="20" height="20" title="w00t smiley" />", "<img src="http//yourwebsite.com/image/roll.gif" width="20" height="20" title="roll eyes smiley" />", "<img src="http//yourwebsite.com/image/roll.gif" width="20" height="20" title="roll eyes smiley" />", "<img src="http//yourwebsite.com/image/huh.gif" width="20" height="20" title="huh smiley" />", "<img src="http//yourwebsite.com/image/huh.gif" width="20" height="20" title="huh smiley" />", "<img src="http//yourwebsite.com/image/sad.gif" width="20" height="20" title="sad smiley" />", "<img src="http//yourwebsite.com/image/crying.gif" width="20" height="20" title="crying smiley" />", "<img src="http//yourwebsite.com/image/sleep.gif" width="20" height="20" title="sleep smiley" />", "<img src="http//yourwebsite.com/image/mad.gif" width="20" height="20" title="mad smiley" />", ); for($i=0;$i < sizeof($smiles);$i++){ $str=eregi_replace($smiles[$i], $replacements[$i], strtolower($str)); } return $str; }
Initial URL
Initial Description
Initial Title
Emoticons :) to Image
Initial Tags
Initial Language
PHP