WordPress Plugin: Moody

// May 29th, 2004 // Techie

Not sure why I felt compelled to make this, but I figured a lot of people might like to have it. This plugin will add one of those silly “Current Mood” icons to the beginning of all your posts. Read the instructions in the plugin comments for how to use it and where to get the icons.

Download the plugin here (NOTE: Yes, I moved development to wp-plugins.org)

(No I won’t demonstrate it here. Current mood = straight)

Current version: 1.1

Changes since 1.0:

- Moods no longer show at all for posts with no mood added
- Made the image end with xhtml 1.0 transitional code.

More mood icons found here.

112 Responses to “WordPress Plugin: Moody”

  1. Colin says:

    Re: 74 above, moods now work. It required creating a .htaccess in the moods directory, then chmodd’ing the moods dir to 777 (reload page) then down to 755. Haven’t chmodd’d downwards beyond 755 yet, it might work, it might not! :)

  2. jafer says:

    Sorry it took so long for me to get back to you – about the mood showing up twice in the comments. You can go to my site (linked to my name) and click on “you talking to me” if there are no comments, or click on “1 comment” if there are comments.

    Then you’ll see down the page where it shows the time and stuff, that there are two mood icons showing up.

    Here’s a link to a specific post if you want:

    http://www.idiotonastick.com/talk/?p=68#comments

    Thanks for your patience :)

  3. Satoshi says:

    Hallo, for the life of me I can’t get this script to work. I’ve tried adding in a new field: moody value: happy, but it doesn’t seem to work. If anyone can point me in the right direction, that would be greatly appreciated. I’ve seeen and viewed some of the websites with this script running and I’m impressed, so hopefully someone out there will be able to help me get this going. Oh yeah, as far as the problem goes, it doesn’t seem to recognize the added field.

  4. Satoshi says:

    I re-installed this script and it works now, yay me!

  5. Alejandro says:

    Long time ago I tried to put the mood in the title but I allways got a "> before the title, playing a little 5 minutes ago I got it working ok. If you want to put it in the title, you have to delete the "> from line 27 it should look like this:
    print '
    Then
    add_filter('the_time', 'moody'); for add_filter('the_title', 'moody');
    And it will work :D

  6. Alejandro says:

    something happened while i was writing and you can’t see what I meant, it should look like this:
    print '<img src="' . get_settings('siteurl') . $mood_icon_dir . $mood . $mood_icon_ext . '" alt="' . $mood . '" title="' . $mood . '"';
    then change add_filter('the_time', 'moody'); for add_filter('the_title', 'moody');

  7. Alejandro says:

    I forgot one more thing:
    look for this:
    <h3 class="storytitle" id="post-<?php the_ID(); ?>"> ... and at the end of that line add this </a>

  8. Alejandro says:

    Hey Gudlyf, could you edit the comments so there is only one? :) because in my previous post I forgot to tell that the file I was talking about was index.php from the theme you are using. Sorry to bother!! :)

  9. Gudlyf says:

    Which one do you want deleted?

  10. Alejandro says:

    you can make a resume of what I said, right? :)

  11. Mandy says:

    Really cool plug-in. Is there a way to get the moods to show up as a menu and you could just click ? Sort of like wp-smileys. Thanks!

  12. Martin says:

    Hi
    I cant get the plugin to work, it says Headers already sent by header when i activate the plugin. What to do?

  13. [...] btw it’s a wordpress plug in from gudlyf called moody. [...]

  14. Martin says:

    Hi
    I did like Alejandro said in post 81 and 82 and it works but it doesnt work when you click to comment or when you click on the title of the post. the icon shows up on two or three places on the comment page…

  15. Nina says:

    I’m having the same issue mentioned in comment #77. If I view comments for an entry with a mood, the mood icon shows up in two places. Is there a way to change this?

  16. [...] So yea, one thing i did miss was the “Moods” from LJ so I went looking for a plugin to do that and found a nice one. [...]

  17. rose says:

    wheres the step by step installation please thjanks

  18. [...] edit: w00t added mood plugins from here that i found on Alex’s Blog [...]

  19. Elena says:

    Fatal error: Cannot redeclare moody() (previously declared in /www/a/abductedelena/htdocs/wordpressblog/wp-content/plugins/current-mood.php:75) in /www/a/abductedelena/htdocs/wordpressblog/wp-content/plugins/moody.php on line 12

    heeeeeellllllllllllllllllllllllllllllllpppp

  20. Nathanael says:

    Hi,

    Thanks for the great plugin! Just an idea you might want to consider for future versions (I’ve customised my version to do this) …

    How about you add a conditional statement that checks whether the first letter of your mood is a vowel. Using this information you might render the following as alt text:

    “I posted this when I was in a good mood.”

    or

    “I posted this when I was in an angry mood”

    Just a thought :-)

  21. Tarragon says:

    Thanks to everyone who posted tips in this thread. My first installation of this plug-in gave me four seperate images spaced all the way through my date field but I followed the advice here and now have it showing just once at the bottom of my post. It looks great.

  22. jenseeka says:

    Hi guys I figured it all out. I just wanna say this so that you guys can be happy.

    1. WHERE you want to see your mood icon? Find this in the moody.php file:
    add_filter( ‘the_time’, ‘moody’);
    this tells wordpress where to put the mood icon. in this example it tells wordpress that it wants the mood icon next to the time. if I want it next to the title I would put it like this:
    add_filter( ‘the_title’, ‘moody’);
    1.a. If you want to figure out what the codes are, it’s all in the templating in the Themes Editor section.
    eg was in the main template.
    1.b. to change the plugin file it must be chmodded to be writeable before you edit it. or you can change it offline and then upload it.
    1.c. It won’t work if you put mood before the title. well at least I havent figured that one out.

    2. NAME next to the Mood icon – as in you want it to show the icon and then the word next to it. Just insert:
    ‘ . $mood . ‘ – notice the spacing, you must insert that as well, dont take out the spaces unless you know what you’re doing.

    3. HOW to add moods to posts:
    3.a. You must have the advanced editing turned on – that’s in the admin> options> Writing> and choose “Advanced Controls”

    3.b. If you have turned the Advanced Controls on, go to admin> Write> Write Post. when you scroll down, you should see another panel titled “Advanced”. In the botton of this panel there’s custom fields. This is where you insert it.

    3.c. To insert it, if first time, in the key section type in ‘mood’ and in the value section type in ‘bored’ or some mood icon that you have but dont put in the ‘.gif’ .
    Don’t click on the ‘publish’, click on ‘add custom field’
    The page will reload as it saves it. then you’ll see a draft copy at the top of the Write Post page, click on that and the post will show up… do whatever and publish.
    The reason why you click on ‘add custom field’ is so that the next time you make a post, you can just use the drop down menu and choose mood. then type in whatever mood you’re in. otherwise it’s just blank.

    4. if you have done all of the above and the icon doesn’t show. it’s probably because one of the syntax shouldn’t be there or you’ve chmodded the folder ‘moods’ to writeable – it must be 744 or 755. or the icon that you’ve called is not in the folder.

    PS. I’m seriously thinking about making a plugin similar to this, but with a list of mood images available instead of ‘just knowing what you got’. Also that you dont have to change the code, just add the mood code where you want it to show. Please do go to my journal and leave a comment about it if you’re interested.

  23. Cathie says:

    Hi There,
    Where do I go to change the location of where the moody shows. I want it in the post its self, not in the title bar. As of right now I have an avatar there, but would rather have the mood show up there. Do you are anyone know how to do this? To see what I mean, please view my site. Thank you in advance. Cathie

  24. Cathie says:

    Hi There,
    Added a comment yesterday and now I don’t see it. I was able to get the moody to show up in the post itself, however I would like it at the begining of the post, not the end. I have tried the different coding as per your post above, but for some reason I can not get it to show at the begining. If you can please let me know how to get it in the same spot as the avatar, I would be so happy. Please.
    Thank you, Cathie

  25. Cathie says:

    Hi There again, see my post came back. How odd it was not there this morning.

    Update, for those who would like to do this, I have figured out how to add your moody before your post, acting as your avatar.

    Step one: because you need a place for the Moody to go, (in the add filter code itself) I changed it to a an area that is not part of the code in my theme.
    Example ” add_filter(‘comments_popup’, ‘moody’); I was getting an error with nothing in there. When I did this it was fine and it did not show up. (if anyone has a way to fix this, please let know)

    Step two: Add this code into your themes css file
    .moody{
    padding: 3px;
    float: left;
    background-image: url(http://*yoursitename.com/filelocation*/wp-content/plugins/moody.php);
    background-repeat: no-repeat;
    margin-left: 2px;
    margin-top: 12px;
    /* IE Bug Fix */
    display: inline;
    }

    Step Three: Place this code right before your content area.

    Example of where I put mine: ( )

    It works great. No errors and it is showing up right where I want it to.

    Thanks for a great plugin.