kadyellebee.com is a site for all-things-kristine.


my life is powered by Six Apart.

« happy bday zuly! | Main | lotsa posts »

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.
I already had the macros set up for most of the smiles, and just added the lines for the cute little images (like prheart ) to go along with the smiles like this:
<MTMacroDefine name="prheart" string=": prheart:">
<img src="http://kadyellebee.com/icon/squaries/prheart.gif" 
height="10" width="10" alt="prheart" />

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/";

if ($handle = opendir($serverPathToSmilies)) {
while (false !== ($file = readdir($handle))) {
$retVal[count($retVal)] = $file;
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 smile

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 smile Shortcuts make me happy!


TrackBack URL for this entry:


I heart MTMacros! I have shortcuts for all my fav people (and software).

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. laughing

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 ;).

MTMacros is definitely a great tool. I love your small smileys. They have a whimsical feel to them which fits here nicely. smile

bug 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 star .

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.

I’m not able to get your smiles.php to work in conjunction with Lisa’s... Any help? confused

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.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)