Mod Name:Mood Bobel (Updated For 2.0 RC3)
http://custom.simplemachines.org/mods/index.php?mod=1380
File Edits./Themes/default/languages/Modifications.english.phpFind:
?>
Add Before:
// Mood Bobel
$txt['mood_bobel'] = 'Mood';
./Sources/Subs.phpFind:
?>
Add Before:
function MoodBobel()
{
$bobel = array(
'Amused', 'Angry', 'Busy', 'Calm', 'Cold', 'Confused', 'Content', 'Curious',
'Depressed', 'Drunk', 'Embarrassed', 'Energetic', 'Envious', 'Exhausted',
'Flirty', 'Full', 'Grumpy', 'Happy', 'High', 'Horny', 'Hot', 'Hungry', 'Hyper',
'Indescribable', 'Lazy', 'Loved', 'Mischievous', 'Okay', 'Pissed', 'Relaxed', 'Relieved',
'Sad', 'Scared', 'Sick', 'Silly', 'Sleepy', 'Smart', 'Stressed', 'Thoughtful', 'Worried'
);
return $bobel;
}
./Sources/Profile-Modify.phpFind:
$erase_options = array();
if (isset($_POST['default_options']) && is_array($_POST['default_options']))
Add Before:
// Convert the $_POST['bobel'] to $_POST['default_options']['bobel']
if (isset($_POST['bobel']))
{
$_POST['default_options']['bobel'] = $_POST['bobel'];
}
./Themes/default/Profile.template.phpFind:
if (!isset($context['disabled_fields']['location']) && !empty($context['member']['location']))
echo '
<dt>', $txt['location'], ':</dt>
<dd>', $context['member']['location'], '</dd>';
echo '
</dl>';
Add After:
if(isset($context['member']['options']['bobel']) && !empty($context['member']['options']['bobel']))
{
$bobel = MoodBobel();
echo '
<dl><dt style="color:blue;">', $txt['mood_bobel'], ':</dt>
<dd>', $bobel[$context['member']['options']['bobel']], '</dd>';
}
echo' </dl>';
Find:
// Callback function for entering a birthdate!
function template_profile_birthdate()
{
global $txt, $context;
Replace With:
// Callback function for entering a birthdate!
function template_profile_birthdate()
{
global $txt, $settings, $context;
// Begin Mood Bobels
// Call the function that has all the mood info
$bobel = MoodBobel();
echo '
<script language="JavaScript" type="text/javascript">
function showmoods()
{
document.images.moods.src = document.forms.creator.bobel.options[document.forms.creator.bobel.selectedIndex].value != \'\' ? \'' . $settings['default_theme_url'] . '/images/moodbobels/\' + document.forms.creator.bobel.options[document.forms.creator.bobel.selectedIndex].value + \'.gif\' : \'' . $settings['default_theme_url'] . '/images/moodbobels/blank.gif\';
}
</script>
<dt style="color:red;">
',$txt['mood_bobel'],':
</dt>
<dd>
<select name="bobel" onchange="showmoods()">
<option value="">Choose Mood</option></br>';
// Loop and show the drop down.
foreach ($bobel as $key => $name)
echo '
<option value="', $key, '" ', isset($context['member']['options']['bobel']) && $context['member']['options']['bobel'] == $key ? 'selected="selected"' : '', '>', $name, '</option>';
echo '
</select>
<img id="moods" src="', $settings['default_theme_url'], '/images/', isset($context['member']['options']['bobel']) && !empty($context['member']['options']['bobel']) ? 'moodbobels/' . $context['member']['options']['bobel'] . '.gif': 'blank.gif', '" align="top" />
</dd>';
./Themes/default/Display.template.phpFind:
// Show their personal text?
Add Before:
// Did they select a mood?
if(isset($message['member']['options']['bobel']) && !empty($message['member']['options']['bobel']))
{
$bobel = MoodBobel();
echo '
', $txt['mood_bobel'], ': ', $bobel[$message['member']['options']['bobel']], ' <br /><img src="', $settings['default_theme_url'], '/images/moodbobels/', $message['member']['options']['bobel'], '.gif" alt="', $bobel[$message['member']['options']['bobel']], '" />';
}
./Themes/default/PersonalMessage.template.phpFind:
// Show their personal text?
Add Before:
// Did they select a mood?
if(isset($message['member']['options']['bobel']) && !empty($message['member']['options']['bobel']))
{
$bobel = MoodBobel();
echo '
<br />', $txt['mood_bobel'], ':', $bobel[$message['member']['options']['bobel']], ' <br /> <img src="', $settings['default_theme_url'], '/images/moodbobels/', $message['member']['options']['bobel'], '.gif" alt="', $bobel[$message['member']['options']['bobel']], '" /><br /><br />';
}
File OperationsMove the included directory "moodbobels" to "./Themes/default/images".