what i did while i was not sleeping like a sane man

i fiddled with plugins on my blog. 2 huge upgrades today.

1st, I installed ImageScaler Modded . This automatically resizes any images when they are larger than a specified maximum. This helped me simplify a long-standing problem I had with image inserts. Granted, i have not done much research into extending the toolset that comes with WordPress, but this is huge. By default, each image upload had to have width and height specified, which was a royal pain in the ass to do over and over and over again. I fixed this when I started the blog with a simple css addition below:

img {width: 640px; height: 480px;border: double black 3px;}

This worked for about 75% of my images. but anything that was vertically oriented at 480×640, anything i wanted to customize smaller, or any smilies had to have a manual style override in the code like so:

style=”width: 400px; height: 300px”

this got really fucking cumbersome. and because the default image editor in WordPress’ WYSIWYG panel specified image properties but not using the style tag, it did not override my css and was basically useless.

The plugin will autoscale both my horizontal and vertical images to the same defaults I was using, and allow smilies to be their native size. I had to comment out the above css for img, and instead add a command to put border on my photos only, which are always hyperlinked.

a img {border: double black 3px;}

the only thing i will still have to manually specify is atypically-sized images, which represent like 2% of my images. and for that i can use the built-in image editor. if I get sick of the plugin (other than stripping out all the code it adds to each post), I can at least use css and specify hyperlinked images only, which will again break the editor for vertical and atypical images, but at least let smilies be their native size. i’m so happy, here’s a smiley:
Wink

The next upgrade was an emoticon plugin. I tried 4:

  • custom-smilies – this let you add your own gifs, but still required keyboard shortcuts that you had to configure. TOO COMPLICATED.
  • TinyMCE Advanced – a series of plugins to the WYSIWYG editor, one of which was an emoticon panel comparable to most message boards. i had high hopes, but it was a buggy piece of shit and it was all or nothing with its plugins. JUST SAY NO TO BUG-FILLED CODE!
  • Smilies Themer – this let you select from about 10 different smilies themes. but still no customizations, and still had to used keyboard shortcuts. NEXT!
  • WP Super Edit – this was similar to TinyMCE Advanced and used the same emoticon plugin, but it was much more stable and allowed individual plugins to be disabled. THIS WAS JUST RIGHT.

The plugin itself does not do anything for customizing your smilies, it just presents a UI panel, but with a little hacking I was able to make it work:

  1. upload my smilies files to /wp-includes/images/smilies
  2. edit the file /superedit/tinymce_plugins/superemotion/emotions.php. in the table cells, change the code to include my gifs, their sizes, and newly-defined names using the existing format
    • OLD – icon_cool.gif: <td><a href=”javascript:insertEmotion(‘icon_cool.gif’,’lang_superemotions_cool’, ‘<?php bloginfo(‘url’); ?>/wp-includes/images/smilies/’);”><img src=”<?php bloginfo(‘url’); ?>/wp-includes/images/smilies/icon_cool.gif” width=”15″ height=”15″ border=”0″ alt=”{$lang_superemotions_cool}” title=”{$lang_superemotions_cool}” /></a></td>
    • NEW – yikes_gif: <td><a href=”javascript:insertEmotion(‘yikes.gif’,’lang_superemotions_wink’, ‘<?php bloginfo(‘url’); ?>/wp-includes/images/smilies/’);”><img src=”<?php bloginfo(‘url’); ?>/wp-includes/images/smilies/yikes.gif” width=”19″ height=”25″ border=”0″ alt=”{$lang_superemotions_yikes}” title=”{$lang_superemotions_yikes}” /></a></td>
  3. edit the file /superedit/tinymce_plugins/superemotion/js/en.js to include names for my new gifs
    • OLD: cool : ‘Cool’,
    • NEW: yikes : ‘Yikes’,
  4. edit the file /superedit/tinymce_plugins/superemotion/editor_plugin.js to have the popup-menu be whatever size i liked, to support my vast and expansive array of smileys: template[‘width’]=360;template[‘height’]=360

I have to still actually make all the edits for my 30 or so smilies, not to mention re-save about 100 posts to have the new image settings take effect, but that should make posting a ton easier and more emotive.

Wink

1 Comment

Leave a Reply