My Smilies
I’m fixing the code in this post right now! I’m trying to make the codebeautifier plugin work!
A few notes on my smilies and how I set them up. I had bigger smilies before that were purple that I had made. But I was kinda tired of them, and plus, I wanted to put some icons in my comments that people could select from, and I only had like 7 different images before.
So when I was looking at smilies to use, I decided to try my hand at making some that were smaller. I like pixel editing, and making favicons for my sites a few weeks ago got me started on it again. These ones are small enough that when I use them in a paragraph, they don’t make the line height change, and that makes me happier.
Once I had the images made, I went through several of Lisa ’s tutorials and adapted them for what I wanted. I knew I wanted it to come up as the macro keyword instead of the image tag, that way if I felt like changing images later, I’d just change the macro file and rebuild.
So when I was looking at smilies to use, I decided to try my hand at making some that were smaller. I like pixel editing, and making favicons for my sites a few weeks ago got me started on it again. These ones are small enough that when I use them in a paragraph, they don’t make the line height change, and that makes me happier.
Once I had the images made, I went through several of Lisa ’s tutorials and adapted them for what I wanted. I knew I wanted it to come up as the macro keyword instead of the image tag, that way if I felt like changing images later, I’d just change the macro file and rebuild.
I already had the macros set up for most of the smiles, and just added the lines for the cute little images (like ) to go along with the smiles like this:
So I took the Lazyman smileys (embedded) tutorial and the Adding smileys to your blog tutorials and kinda combined them.
So my smilies.php file that I include into each individual archive looks like this:
And that’s how I did it. Make sure that you do check out Lisa ’s tutorials, as they are more complete, these are just notes
And for easy inserting of links with the macros plugin, its just as easy. then I can type :lisa:, and it automatically generates a link to her site Shortcuts make me happy!
<MTMacroDefine name="prheart" string=": prheart:"> <img src="http://kadyellebee.com/icon/squaries/prheart.gif" height="10" width="10" alt="prheart" /> </MTMacroDefine>
So I took the Lazyman smileys (embedded) tutorial and the Adding smileys to your blog tutorials and kinda combined them.
So my smilies.php file that I include into each individual archive looks like this:
<? $smiliepath = "http://my-site.com/smilies/"; $serverPathToSmilies ="/home/dir/to/smiles/"; $cellcount=0; if ($handle = opendir($serverPathToSmilies)) { while (false !== ($file = readdir($handle))) { $retVal[count($retVal)] = $file; } closedir($handle); sort($retVal); for ($xx=0; $xx < count($retVal); $xx++) { if (substr($retVal[$xx], -4) == ".gif") { $size = getimagesize($serverPathToSmilies . $retVal[$xx]); $name = substr($retVal[$xx],0,(strpos($retVal[$xx],".gif"))); $width = $size[0]; $height = $size[1]; echo ""; } } } ?>Just slightly different than the Lazyman embedded version.
And that’s how I did it. Make sure that you do check out Lisa ’s tutorials, as they are more complete, these are just notes
And for easy inserting of links with the macros plugin, its just as easy. then I can type :lisa:, and it automatically generates a link to her site Shortcuts make me happy!
Comments
I MTMacros! I have shortcuts for all my fav people (and software).
Posted by: Lisa, Gal of Unix | March 16, 2003 07:35 PM
i had a quick question for you about this post and css. i’m using your default skin, and the code you posted in this post doesn’t word wrap, it goes all the way across the page. anyway, i’m just really curious why this happens, cause i’m just starting to mess with css stuff. love the smilies, btw.
Posted by: maura | March 16, 2003 07:55 PM
I need to set up my macros again. Since my hosting change, I haven’t reinstalled the macros plugin and such.
My plan is to mostly use macros for acronyms that not everyone out there knows the meaning to. I’ll have a couple for people that I link to, but I don’t link to all that many people regularly (well, besides my wife ;).
Posted by: milbertus | March 16, 2003 08:03 PM
MTMacros is definitely a great tool. I love your small smileys. They have a whimsical feel to them which fits here nicely.
Posted by: Brandy | March 16, 2003 08:22 PM
The smilies are fabulous!!! I love how tiny and cute they are. The fact that they don’t change the line height is really neat, too. You’re a .
Posted by: Heather | March 16, 2003 11:16 PM
These are adorable!!! The change in line height is precisely why I don’t use smilies as much anymore. Has always bugged me a little too. I might have to try this when I have more play time.
Posted by: Jill | March 18, 2003 10:14 AM
I’m not able to get your smiles.php to work in conjunction with Lisa’s... Any help?
Posted by: Katherine | February 22, 2005 07:28 AM
Hi ive been using this code to try and get smilies working on my blog site, and i can get the pallet to appear and display the images but i get an error saying undefined variable: retVal in the index.php and clicking on an image doesnt do anything im guessing because of the error has any1 got any ideas why this happens.
Thanx
Posted by: Liam | May 7, 2005 09:14 AM