• Resolved Stephr0x0rs

    (@stephr0x0rs)


    I’ve been using the MyCustomSmilies hack for a few versions, and I decided to see how my site looked in IE when I noticed a problem.

    Some of the smilies appear stretched and distorted, and clicking on them does not insert them into the comment box. Some random ones do work, but the majority do not.

    I saw that there is a Custom Smilies plugin, but that is just way too robust for what I need. I already have my smilies setup the way I want, I don’t want to have to do that all over again. This hack is much more simple and I prefer that.

    I’m using IE9 and the hack seems to be malfunctioning with that, but it works in FF 3.6.22. WP version 3.2.1

    Here’s the code if anyone needs it (I updated it with what looked like new code in 3.2.1 compared to 2.8):

    <?php
    /*
    Plugin Name: My Custom Smilies
    Description: Replace the smilies without editing functions.php
    */
    	global $wpsmiliestrans, $wp_smiliessearch;
    
    	// don't bother setting up smilies if they are disabled
    	if ( !get_option( 'use_smilies' ) )
    		return;
    
    	if ( !isset( $wpsmiliestrans ) ) {
    		$wpsmiliestrans = array(
    		       ':)' => 'Smile1.png',
    		  ':smile:' => 'Smile1.png',
    		      ':-)' => 'Smile1.png',
    		       ':D' => 'Grin.png',
    		   ':grin:' => 'Grin.png',
    		      ':-D' => 'Grin.png',
    		      '^_^' => 'CuteSmile.png',
    		       '^^' => 'CuteSmile.png',
    	       ':happycry:' => 'HappyCry.png',
    		    ':yay:' => 'Yay.gif',
    		   '(w00t)' => 'w00t.png',
    		   ':w00t:' => 'w00t.png',
    		  ':sweat:' => 'Sweat.png',
    	      ':sweatdrop:' => 'Sweat.png',
    		       '8)' => 'Cool.png',
    		      '8-)' => 'Cool.png',
    		   ':cool:' => 'Cool.png',
    		       ';)' => 'Wink.png',
    		      ';-)' => 'Wink.png',
    		   ':wink:' => 'Wink.png',
    		       ':P' => 'Tongue.png',
    		      ':-P' => 'Tongue.png',
    		       ':p' => 'Tongue.png',
    		       ';P' => 'TongueWink.png',
    		':whistle:' => 'Whistle.png',
    		 ':shifty:' => 'Shifty.gif',
    		    ':yum:' => 'YUM.png',
    		  ':drool:' => 'Drool.png',
    		    ':$_$:' => 'Money.png',
    		   ':tard:' => 'Tard.png',
    		':giggidy:' => 'EagerGrin.gif',
    		       'XD' => 'LOL.png',
    		    ':lol:' => 'LOL.png',
    		   ':rofl:' => 'ROFL.png',
    		      'O:)' => 'Angel.png',
    		  ':angel:' => 'Angel.png',
    		  ':blush:' => 'Blush.png',
    		   ':oops:' => 'Blush.png',
    		       ':*' => 'Kiss.png',
    		   ':kiss:' => 'Kiss.png',
    		    ':wub:' => 'InLove.png',
    	        ':smitten:' => 'Smitten.png',
    		  ':heart:' => 'Love.png',
    		       '<3' => 'Love.png',
    	     ':heartbreak:' => 'Heartbreak.png',
    		  ':devil:' => 'Devil.png',
    		':twisted:' => 'Devil.png',
    		   ':evil:' => 'Devil.png',
    		  ':shock:' => 'Shock.png',
    		':jawdrop:' => 'Aww.png',
    		    ':aww:' => 'Aww.png',
    		       ':O' => 'Surprise.png',
    		       ':o' => 'Surprise.png',
    		    ':eek:' => 'Surprise.png',
    		      '8-O' => 'Surprise.png',
    		      ':-o' => 'Surprise.png',
    		       '8O' => 'Surprise.png',
    		   ':noes:' => 'OhNoes.png',
    		   ':zomg:' => 'OMG.png',
    		    ':cry:' => 'Cry.png',
    		       'X(' => 'Bawl.png',
    		   ':bawl:' => 'Bawl.png',
    		       ':(' => 'Sad.png',
    		      ':-(' => 'Sad.png',
    		    ':sad:' => 'Sad.png',
    		   ':pout:' => 'Pout.png',
    	      ':invisible:' => 'Invisible.png',
    		    ':hmm:' => 'Hmm.png',
    		   ':hrmm:' => 'Hmm.png',
    		   ':ermm:' => 'Hmm.png',
    		    ':umm:' => 'Umm.gif',
    		 ':unsure:' => 'Umm.gif',
    		       ':S' => 'Worried.png',
    		    ':doh:' => 'DOH.png',
    		    ':mad:' => 'Mad.png',
    		  ':angry:' => 'Angry.png',
    		   ':rawr:' => 'RAWR.gif',
    		':annoyed:' => 'Annoyed.png',
    		  ':glare:' => 'GlareLeft.png',
    	       ':rolleyes:' => 'Rolleyes.gif',
    		   ':roll:' => 'Rolleyes.gif',
    		  ':hmmph:' => 'Hmph.png',
    		      '-_-' => 'Bleh.png',
    		      'v_v' => 'NotImpressed.png',
    		       ':|' => 'Stare.png',
    		      ':-|' => 'Stare.png',
    		':neutral:' => 'Stare.png',
    		      'o_O' => 'WTF.gif',
    		      ':-?' => 'WTF.gif',
    		       ':?' => 'WTF.gif',
    		    ':huh:' => 'WTF.gif',
    		       ':X' => 'Mute.png',
    		       ':x' => 'Mute.png',
    		 ':zipped:' => 'Mute.png',
    		      ':-x' => 'Mute.png',
    	     ':thumbsdown:' => 'ThumbsDown.png',
    	      ':thumbdown:' => 'ThumbsDown.png',
    	       ':thumbsup:' => 'ThumbsUp.png',
    	        ':thumbup:' => 'ThumbsUp.png',
    		   ':puke:' => 'Puke.png',
    		   ':sick:' => 'Sick.png',
    		      'x_x' => 'Dead.png',
    		   ':dead:' => 'Dead.png',
    		  ':sleep:' => 'Sleep.gif',
    		    ':zzz:' => 'Sleep.gif',
    		   ':yawn:' => 'Yawn.png',
    		   ':erk:'  => 'Erk.png',
    		   ':bebi:' => 'BebiBulma.png',
    		   ':chet:' => 'DigitalCHET.png',
    		  ':alfie:' => 'DigitalCHET.png',
    		  ':ninja:' => 'Ninja.png',
    		  ':troll:' => 'Troll.png',
    		   ':borg:' => 'Borg.png',
    		  ':cylon:' => 'Cylon.gif',
    		 ':vulcan:' => 'Vulcan.png',
                     ':3po:'    => 'SW-C3-P0.png',
                      ':r2:'    => 'SW-R2-D2.png',
                     ':chewie:' => 'SW-Chewie.png',
                      ':yoda:'  => 'SW-Yoda.png',
                      ':vader:' => 'SW-DarthVader.png',
                    ':trooper:' => 'SW-StormTrooper.png',
                   ':lscombat:' => 'SW-LSCombat.png',
                       ':1up:'  => '1UP.png',
                     ':shroom:' => 'Shroom.png',
                     ':?block:' => 'QuestionBlock.png',
    		   ':meow:' => 'Meow.png',
    		    '=^.^=' => 'Meow.png',
    		   ':woof:' => 'Woof.png',
    		  ':sheep:' => 'Sheepish.png',
    		 ':justin:' => 'Sheepish.png',
    	      ':banhammer:' => 'Banhammer.png',
    		   ':beer:' => 'Beer.png',
    		   ':star:' => 'Star.png',
    		    ':sun:' => 'Sun.png',
       	   ':waaambulance:' => 'Waaambulance.png',
             	  ':1star:' => '1star.png',
    		 ':2stars:' => '2stars.png',
    		 ':3stars:' => '3stars.png',
    		 ':4stars:' => '4stars.png',
    		 ':5stars:' => '5stars.png',
    		  ':maybe:' => 'Maybe.png',
    		    ':yes:' => 'Yes.png',
    		     ':no:' => 'No.png',
    		   ':time:' => 'Time.png',
    		   ':cake:' => 'BirthdayCake.png',
    		);
    	}
    
    	if (count($wpsmiliestrans) == 0) {
    		return;
    	}

    Appreciate any help making this compatible with Exploder.

  • The topic ‘[Plugin: smilies] MyCustomSmilies hack and IE’ is closed to new replies.