I've made some changes in this that I thought would be good for updating this plugin. For the most part, the changes only affect image drop downs.
#1 I've gotten rid of the multiple optgroups and replaced them with just options. This has resulted in a much smaller code size, plus, the selected image is no longer blurred out and it looks much better and is faster.
#2 Since I've got a lot of animated .gifs and they have different sizes, I had a problem with overlapping images and it was hard to select those moods. So what I've done is made the size of the selections changeable. I made the size the biggest gif I had, in my case 36px x 100px. This makes the selections more spaced out, but I think it looks nicer. These changes have my defaults in them. I've also separated out the style info into a css tag, so that should make the code smaller as well.
Hopefully you'll find this useful.
If you're not comfortable making these changes, please don't or at least back things up...
The changes are in 2 places:
#1 replace the contents of the template
quick_mood_change_by_sniper with
Code:
<!-- / dropdown mood select by sniper start -->
<style>
.moods_option {
height: 36px; width: 100px; background-repeat: no-repeat; background-position: center;
}
</style>
<div class="vbmenu_popup" id="moods_menu" style="display:none">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="thead" valign="middle">$vbphrase[change_mood]:</td>
</tr>
<tr>
<td class="alt1" valign="middle">
<form action="index.php?do=ajax_mood_update" method="post" id="mood_form">
<input type="hidden" name="s" value="$session[sessionhash]" />
<select name="mood" size="7" onchange="change_mood(this.value);">
<option style="text-align: center;" value=""<if condition="empty($bbuserinfo[mood])"> Selected</if>>$vbphrase[no_mood]</option>
$vbmoods[mood]
</select>
</form>
</td>
</tr>
</table>
</div>
<div><strong>$vbphrase[change_mood]:</strong> <a href="#" id="moods"><if condition="!empty($bbuserinfo[mood])"><img src="$vboptions[bburl]/images/mood/$bbuserinfo[mood].gif" border="0" align="absmiddle"/><else />$vbphrase[change_mood]</if></a> <script type="text/javascript"> vbmenu_register("moods", 1); </script></div>
<!-- / dropdown mood select by sniper end -->
#2 replace the contents of the plugin
[Mood Manager] - Make Drop Down Menu with
PHP Code:
if ($vbulletin->options['moodmanageronoff'] AND $vbulletin->userinfo['userid'] AND !in_array($vbulletin->userinfo['usergroupid'], explode("|", $vbulletin->options['moodmanagerusergroup'])))
{
$vbulletin->templatecache['header'] .= '<script type=\"text/javascript\">
<!--
function update_mood()
{
fetch_object(\'moods\').innerHTML = \'Updating...\';
if (ajax_mood.handler.readyState == 4 && ajax_mood.handler.status == 200 && ajax_mood.handler.responseText)
{
fetch_object(\'moods\').innerHTML = ajax_mood.handler.responseText;
}
}
function change_mood(mood)
{
ajax_mood = new vB_AJAX_Handler(true);
ajax_mood.onreadystatechange(update_mood);
ajax_mood.send(\'ajax.php\', \'do=insertmood&mood=\' + PHP.urlencode(mood));
}
//-->
</script>';
$moodslist = explode("\n", $vbulletin->options['moodmanagermoods']);
if ($vbulletin->options['moodmanagerimages'] && !eregi("MSIE", $_SERVER['HTTP_USER_AGENT']))
{
$vbmoods['mood'] .= '<optgroup>';
}
foreach ($moodslist AS $mood)
{
$mood = trim($mood);
if ($mood == $vbulletin->userinfo['mood']) { $selectedmood = ' Selected'; } else { $selectedmood = ''; }
if (!$vbulletin->options['moodmanagerimages'] || eregi("MSIE", $_SERVER['HTTP_USER_AGENT']))
{
$vbmoods['mood'] .= '<option value="' .$mood. '"' .$selectedmood. '>' .$mood. '</option>';
}
else
{
$vbmoods['mood'] .= '<option class="moods_option" style="background-image: url(images/mood/' .$mood. '.gif);" value="' .$mood. '"' .$selectedmood. '></option>';
}
}
if ($vbulletin->options['moodmanagerimages'] && !eregi("MSIE", $_SERVER['HTTP_USER_AGENT']))
{
$vbmoods['mood'] .= '</optgroup>';
}
if ($vbulletin->options['moodmanagerglobal'])
{
$search_text = '$vbphrase[private_messages_nav]';
$vbulletin->templatecache['navbar'] = str_replace($search_text, $search_text . "<br />" . fetch_template('quick_mood_change_by_sniper'), $vbulletin->templatecache['navbar']);
}
else
{
eval('$usermoods = "' . fetch_template('quick_mood_change_by_sniper') . '";');
}
}
To change the size of the amount of space each gif takes, modify
.moods_option
height: 36px; width: 100px;
to the size you want.
Here's a picture of what it looks like on my site:
(Sorry for the poor quality animated gif!)
you can try it out on my site by registering on
http://www.u-assist.com