Current Mood

The What kind of mood are you in? thread over at the InvisionFree Support forums got me thinking about something i’d like to make, but am not 100% sure about.

I’d like to make something showing my current “mood” which i can display somewhere (such as a forum or webpage), which can be easily changeable without hassle. The way i have this planned in my head is that i have a simple web-based control panel (perhaps even a wordpress plugin so i could do it when blogging?) where i can log in, and simply choose from a list of pre-defined “moods”. Because I want to display this on forums/webpages etc. it’d most likely be an image i’d want to display (i used to have an unhappy avatar over at InvisionFree Support which is similar to what i’d want now). Once i’ve chosen a mood, the script - most likely written in PHP - would just copy an existing image and rename it “mood.png” or something (keeping the original) so that in a signature I could just easily link the image.

The bit i’m unsure as to how to do is the copying and renaming of images. I *think* i’ve done something similar before when I did the CMS for GTA Xtreme, but it wasn’t 100% the same.

If anyone has any ideas/suggestions about how to do this, with code snippets or links to references that I could look at, that would be awesome.

You can leave a response, or trackback from your own site.

Comments

  1. The easiest way to do it would be using .htaccess, Rory. I do something similar for my Trillian Status thingy:

    RewriteEngine On

    RewriteRule ^mood.png$ mood.php [NC] [L]

    Then, use mood.php to read a text file or MySQL field. It can then select the appropriate image from a folder, and use this code to output:

    header("Content-type: image/png");
    $img = imagecreatefrompng("images/mood_happy.png");
    imagepng($img);

    Seth commented on 22nd January 2006 at 8:51 pm
  2. Looks like it worked like a charm. Thanks Seth :)

    Rory commented on 22nd January 2006 at 11:00 pm
  3. Sweet, looks nice. Might want to add an option in your .htaccess to prevent listing of that directory though :)

    /me wants your current mood to be potato :)

    Seth commented on 23rd January 2006 at 2:56 am
Leave a reply
  1. Required fields marked *