News:

Want to get involved in developing SMF? Why not lend a hand on our GitHub!

Main Menu

Mood Bobels V2.1

Started by Chaos Dragon, September 04, 2008, 04:29:13 PM

Previous topic - Next topic

Chaos Dragon

Link to Mod

Compatibility
For SMF 1.1.x


Introduction
Based off of Gobo's Bear/Mood Tags
Adds "Mood Bobels" to the display of the post profile as well as on users profiles.  Users can change their "mood" status via their profile settings.


Changelog
- 1.0 Initial Release
- 1.1 Added support for the Ultimate Profile Mod by JovanT
- 1.2 Modified the code to use language files instead of hard coding, and fixed several other minor details
- 1.3 Added a array/foreach loop to cut down on the coding
- 1.4 Added mood on Personal Message Index
- 2.0 Added ability to have no mood shown, added a preview of the mood to the profile manager, added Alt text to the images so when you hover over the image it shows the mood in text form
- 2.1 taken over by wdm2005 from lord anubus
- 2.3 translate portuguese and brazilian
- 2.3.1 added mood name to post and pm messages instead of just the picture

"Never stop exploring new ideas, concepts and techniques, but never forget the old ones, they just may come in handy someday!"
"Don't give up! Otherwise you do not win and nothing gets accomplished!"
Einstein "Insanity is doing the same thing over and over again, and expecting different results..."
Do Not PM me for Support. They will be Ignored. Use the Threads the have been provided.

MissyNL

Hi!

I really don;t know what this mod will do.. do you have any screenshots?
Sorry for my poor English, but i think it's probably better then your Dutch :)

robbie93

we created our moods using the custom profile mod and it is is proving to be a far more better way to add moods to you're profile and posts I think :D

I tried this mod and didn't like it  :'(

StarChildxox

  I love our moods in profile robbie, because the way you set it up
we can have so many more different choices of smileys in there...
I love mine, it sends heart kisses.... awwwww  Well Done babe big
hugs for you! 

                                                   O:)

                                              hotchildxox
                                                    xx

SA™

Quote from: Lafemme on September 04, 2008, 04:41:32 PM
Hi!

I really don;t know what this mod will do.. do you have any screenshots?

screen shots added
http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

AZ-{OVGY}

#5
So what has changed in the new version? Did you add the fix I sent Lord Anubus (he said he would send it to you) for the text to the images so when you hover over the image it shows the mood in text form but never worked in all browsers in previous version?

Edit: OK Just checked and it looks like you didn't, theres two occurences of alt= in modification.xml, change both of these to title= and the hover text will work in all browsers  ;)

Also (As originally posted by Lord Anubus in original Mood Bobels topic)

Using TinyPortal?
This code is for use the MOOD BOBELS V2.0 mod for SMF Only

Use a PHP Block

global $db_prefix, $ID_MEMBER, $txt, $context;

$query = db_query(
    "SELECT value
     FROM {$db_prefix}themes
     WHERE ID_MEMBER = $ID_MEMBER
       AND variable LIKE 'bobel'", __FILE__, __LINE__);

if(db_affected_rows() != 0) {
  $row = mysql_fetch_assoc($query);
  $bobel_select = $row['value'];
}
else {
  $bobel_select = '';
}
//Has one been selected?
if(isset($_POST['bobel'])) {
  $bobel_new = $_POST['bobel'];
// There's already a mood selected
  if ($bobel_select <> '') {
    $query = db_query(
      "UPDATE {$db_prefix}themes
       SET value=$bobel_new
       WHERE ID_MEMBER = $ID_MEMBER
         AND variable LIKE 'bobel'
       LIMIT 1", __FILE__, __LINE__);
  }

// No mood previously selected
  else {
    $query = db_query(
      "INSERT INTO {$db_prefix}themes (ID_MEMBER, ID_THEME, variable, value)
       VALUES ($ID_MEMBER, 1, 'bobel', $bobel_new)", __FILE__, __LINE__);

  }
  $bobel_select = $bobel_new;
}

// Call the function that has all the mood info
$bobel = MoodBobel();

// find out where we are and figure out how to get back
$str = getenv("QUERY_STRING");
if ($str)
  $action = 'index.php?'.$str;
else
  $action = 'index.php';

// print out the form
echo '
<form  accept-charset="', $context['character_set'], '" class="smalltext" style="padding: 0; margin: 8px 0 8px 0; text-align: center;" name="MoodBobel();"  id="MoodBobel();" action="'. $action . '" method="post" >
  <table><tr><td><b>', $txt['mood_bobel'], ':</b></td>
             <td><select name="bobel" onchange="MoodBobel();">
                 <option value=""></option>';

// Loop and show the drop down.
  foreach ($bobel as $key => $name)
    echo '
      <option value="', $key, '" ', ($bobel_select <> '' && $bobel_select == $key) ? 'selected="selected"' : '', '>', $name, '</option>';

  echo '</select></td></tr></table></ br>';
echo '
  <input type="submit" value="', $txt[10], '" />
  </form>';


A special thanks goes out to JPDeni from TinyPortal for making this code possible!!! 
[nofollow]

MissyNL

Sorry for my poor English, but i think it's probably better then your Dutch :)

SA™

thanks ill update the package now
http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

AZ-{OVGY}

[nofollow]

SA™

package now works with smf2
http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

edi67

#10
sorry me but this part of code in PROFILE.php dont exist in smf2.0:

$erase_options = array();
if (isset($_POST['default_options']) && is_array($_POST['default_options']))
foreach ($_POST['default_options'] as $opt => $val)
{
$themeSetArray[] = "($memID, 1, SUBSTRING('" . addslashes($opt) . "', 1, 255), SUBSTRING('" . (is_array($val) ? implode(',', $val) : $val) . "', 1, 65534))";
$erase_options[] = addslashes($opt);
}


That code exist only in smf 1.1x

in PROFILE_VIEW.PHP exist this code:

$erase_options = array();
if (isset($_POST['default_options']) && is_array($_POST['default_options']))
foreach ($_POST['default_options'] as $opt => $val)
{
// These need to be controlled.
if ($opt == 'topics_per_page' || $opt == 'messages_per_page')
$val = max(0, min($val, 50));

$themeSetArray[] = array($memID, 1, $opt, is_array($val) ? implode(',', $val) : $val);
$erase_options[] = $opt;
}


may be you must update package
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

Aeoni

How do you remove the word 'Mood:' in the display.template, so that only the bobel appears?

thanks.

Respect To
Sabre™ | YodaOfDarkness | spearfish | Neorics | [SiNaN]

please note: if I request a mod or a service, you MUST accept PayPal or Xoom

SA™

display.template.php

find

', $txt['mood_bobel'], ':<br /> <img src="', $settings['default_theme_url'], '/images/moodbobels/', $message['member']['options']['bobel'], '.gif" alt="', $bobel[$message['member']['options']['bobel']], '" /><br /><br />';


replace with

<br /> <img src="', $settings['default_theme_url'], '/images/moodbobels/', $message['member']['options']['bobel'], '.gif" alt="', $bobel[$message['member']['options']['bobel']], '" /><br /><br />';
http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

Aeoni


Respect To
Sabre™ | YodaOfDarkness | spearfish | Neorics | [SiNaN]

please note: if I request a mod or a service, you MUST accept PayPal or Xoom

SA™

http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

MoreBloodWine

One thing you didnt comment on that would be kinda nice is how many moods there are.
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


RoarinRow

thanks for the fun mod!   8)

SMF 2.0
TP 1.0 RC1.1
Wordpress 3.1.3

Brenflakes

#17
Great mod, only suggestion i have is it would be great to be able to update the mood from the index page, rather than having to go into the profiles each time to change it. Perhaps a small drop down box next to the user's name at the top of the page. :) I can code it up to display the mood box, but cant get it to update it.

BillyBob31

When I am manually installing, in the part of ./Themes/default/Profile.template.php

It says find:

// Callback function for entering a birthdate!
function template_profile_birthdate()
{
           global $txt, $context;


but there is nothing in the the sort of that in my Profile.template.php

and I am supposed to replace that 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> <tr> <td width="40%" align="top"> <b>', $txt['mood_bobel'], ':</b> </td> <td> <select name="bobel" onchange="showmoods()"> <option value=""></option>'; // 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" /> </td> </tr><tr>';


so what should i do?

SA™

@ Brenflakes 
theres a tp block that does that :)


@BillyBob31 can you post up youi Profile.template.php please
http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

Advertisement: