PDA

View Full Version : Mood Hack


|Jordan|
05-16-2005, 10:00 PM
Mood Hack

Note: Please update to the latest version, many bugs were fixed.

This if my first hack. Since this is my first hack i don't know how good i'll be at support, but i'll give it a shot.


What does it do?

This hack displays a user's mood in the postbit. The mood is displayed as an image and there are 40 to choose from. Mood can be changed in UserCP=>Edit Profile.

Note: Tested on vBulletin 3.0.5 with security fixes to 3.0.7
It should work in all 3.0.x versions though.

Credits:

This hack is based off "Image Gender in Postbit" written by tnguy3n.

Full credit is given in the text file. I have modified his code to work with this hack.

Update!tnguy3n has pm'd me saying that the modification is ok. Yay

The creation of this hack was inspired by the request of caliman (https://vborg.vbsupport.ru/showthread.php?t=81123)
The hack images are from the Yabb version of this hack, kudos to whomever made them.

Installation information on hack:

Query to run: 1
File modification: 3
Template modication: 2
New Templates: 0
Estimated Installation Time: 4 to 5 minutes.

Changes:

V 1.02 - Fixed some missing code, made no mood option more noticable. To update repeat step two of template modification.

V 1.01 - Fixed image folder name, added ALT tags to images, fixed misnumbered and redundant code. To update repeat step one of template modification.

V 1.00 - Released

Demo: http://www.gamers-union.net/forums/showthread.php?t=204 (Click on any thread)

Addons:
Extended [Postbit] (https://vborg.vbsupport.ru/showthread.php?t=83488)
This addon puts the mood dropdown selector inside the postbit instead of the USERCP.
Credit goes to paul41598

Please Click Install (https://vborg.vbsupport.ru/vborg_miscactions.php?do=installhack&threadid=81637) if you find this hack userful. Thanks.

Marco van Herwaarden
05-17-2005, 02:36 PM
I have not formally asked his permission due to the open source nature of the hacks at vbulletin.org
Open Source does not mean you can just take bits & pieces and make your own software out of it. I suggest you contact him yourself, to avoid miscommunications.

boo.3
05-17-2005, 02:37 PM
nice!

may i ask a question... how do you make the avatars and stuff on the left side? mines on top?

or is that just the style?

|Jordan|
05-17-2005, 02:37 PM
Oops :(

I pm'd him, haven't received response yet.

I released it now because i was scared someone else would release a mood hack and all my work would be for nothing :(

|Jordan|
05-17-2005, 02:38 PM
It's all style related, you just need to move code around. (i made that style too, not releasing it though)

caliman
05-17-2005, 03:08 PM
YOU RULE JORDAN! Thanks so much for this. I really appreciate it. Clicking install! (I will install tonight.)


nice!

may i ask a question... how do you make the avatars and stuff on the left side? mines on top?

or is that just the style?

Thats actually an option in adminCP somewhere. Something about using a vB2 look I think.

Hellspire
05-17-2005, 03:12 PM
Yes, that is known as the postbit template. Legacy is the v2 look. Although Jordon obviously has a few modifcations to the legacy template. Wouldn't take more than 5 minutes of time, to modify a default legacy theme to match his if you know html and the vb conditionals.

|Jordan|
05-17-2005, 03:16 PM
I didn't know how to make the hack with just template modifcations, so i went with this.

boo.3
05-17-2005, 03:19 PM
ok got it thanks!

yoyoyoyo
05-17-2005, 04:03 PM
this hack didn't work for me at first. I followed the instructions, however there was no image displayed in the postbit - it only said : "current mood:" and no image. Then I noticed that the folder is named "moods" and in the instructions it says to use the name "mood" instead, so after I changed that it worked fine. Also, there was no blank .html in the image folder to prevent folks from snooping inside the image folder, so I changed that as well. I also added the names of the moods to the "alt" tag, so now when people hover over the mood icon it says the name of the emotion as well.

|Jordan|
05-17-2005, 05:00 PM
Ok, fixed.

I fixed folder name, added ALT tags and fixed an error.

Repeat step one of template modification.

Nordinho
05-17-2005, 08:39 PM
looks good, but wouldn't this (https://vborg.vbsupport.ru/showpost.php?p=608166&postcount=2) by an easier way??

|Jordan|
05-17-2005, 09:14 PM
Well yea but i didn't know how to do that. Also that changes avatars, this just adds a new image and doesnt touch the avatar.

iSpanish
05-17-2005, 09:28 PM
looks good, but wouldn't this (https://vborg.vbsupport.ru/showpost.php?p=608166&postcount=2) by an easier way??
Yes,
This is an easier way , Very easier

anyway

i will install it but by the other way (MIX) CoOoL


Thanks MyIS_Jordan For this nice hack
try to do the easier way and update it.

by the way may a have the PSD file
i want translate it to another language

Thank you very much.

Marboosh

Nordinho
05-17-2005, 09:37 PM
Well yea but i didn't know how to do that. Also that changes avatars, this just adds a new image and doesnt touch the avatar.

It doesn't need to touch the avatar...if you just create a new profile field, with the values you need, like sad, happy etc...and name the images sad.gif, happy.gif etc, this condition

<if condition="$post[field28]">
<img src="images/mood/$post[field28].gif" alt="$post[field28]">
</if>

results in images/mood/sad.gif or images/mood/happy.gif on whatever you choose...correct me if I'm wrong...

|Jordan|
05-17-2005, 09:43 PM
The one that the guy in that thread was requesting was to change the avatar based on mood.

kall
05-17-2005, 09:50 PM
Well...the *thread* was, that post was not.

The post linked to describes how to achieve exactly what your Hack does, without the need to change any files, just a User Profile Field and a Template modifciation.

It also uses no queries whatsoever.

Allan
05-18-2005, 12:10 AM
thank you for this hack, and cheer, I like much :)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
click Install
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

yoyoyoyo
05-18-2005, 12:25 AM
Another slight thing I noticed- if nobody selects a mood their postbit is unchanged, however once you select a mood there is no way to deselect having the mood appear in the postbit. It would be nice if you could have the option to choose "do not display my mood" and the postbit would not say "current mood:" etc..

TTG
05-18-2005, 09:47 AM
Another slight thing I noticed- if nobody selects a mood their postbit is unchanged, however once you select a mood there is no way to deselect having the mood appear in the postbit. It would be nice if you could have the option to choose "do not display my mood" and the postbit would not say "current mood:" etc..

Simply go to the top of the list "Tell people about your current mood." .. select nothing and mood in postbit does not appear :)

|Jordan|
05-18-2005, 02:56 PM
I'll make the no mood option clearer and fix one mistake i discovered.

xtreme-mobile
05-18-2005, 04:58 PM
hi guys

im trying to install this on vb 3..0.7 but i get an error when trying to run the querie it says:

#1146 - Table 'admin_vbforum.user' doesn't exist

any ideas?

|Jordan|
05-18-2005, 09:00 PM
hi guys

im trying to install this on vb 3..0.7 but i get an error when trying to run the querie it says:

#1146 - Table 'admin_vbforum.user' doesn't exist

any ideas?

Did you run the sql query?

xtreme-mobile
05-18-2005, 09:02 PM
thats the problem it wont let me run the sql querie

that error above is what i get when i try to run the querie

|Jordan|
05-18-2005, 09:04 PM
Yes,
by the way may a have the PSD file
i want translate it to another language


I dont have the PSD file, images come from the mood hack from Yabb. It's easy to get rid of the text anyhow; just select some of the background that has no text and copy it over the text, then enter the new text.

|Jordan|
05-18-2005, 09:05 PM
thats the problem it wont let me run the sql querie

that error above is what i get when i try to run the querie

What's your table prefix? (name of user table)

Deimos
05-18-2005, 10:10 PM
Got a slight problem with this hack, when a user of mine choose "Tired", it shows the Brooding image instead
I double checked the images themselves and sure enough, the tired image and brooding ones are ok
Any idea why it links to Brooding instead of the Tired one?

|Jordan|
05-18-2005, 10:21 PM
Upgrade to the latest version, just redo both template modification steps.

caliman
05-19-2005, 04:29 AM
INSTALLED. Works great. Thanks again for doing this, I owe you some beers Jordan. :)

Couple little things that would just be icing.

1) It would be nice if when I go to my profile it remembers which one I have selected. Currently it does not and always displays 'Do not display mood.'

2) When one selects a mood, it would be cool if it displayed the selected mood bar in real time in the profile. I am too buzzed on wine to do this, but here is my original code that did this:

<script language="JavaScript1.2" type="text/javascript">
function showmood()
{
if (!document.images) return;
document.images.moodpics.src="http://www.yoursite.com/forums/images/moods/"+document.creator.mood.options[document.creator.mood.selectedIndex].value+".gif";
}
</script>
<td><font size=2><select name="mood" size=6 onChange="showmood()">
<option selected value="Happy">Happy</option>
<option value="Aggressive">Aggressive</option>
<option value="Amazed">Amazed</option>
<option value="Angry">Angry</option>
</select></font>
&nbsp;&nbsp;<img src="http://www.yoursite.com/forums/images/moods/blank.gif" name="moodpics" border=0 hspace=15>

Regardless, thanks again. I really appreciate it.

caliman

xtreme-mobile
05-19-2005, 06:18 PM
What's your table prefix? (name of user table)



???? dunno mate how do i find out (noobie to coding )

|Jordan|
05-19-2005, 06:27 PM
???? dunno mate how do i find out (noobie to coding )
It's a little hard to explain;

Go into phpmyadmin (or whatever script your web providor uses) and look at the name of one of the tables (a table is a sort of directory that holds information).

xtreme-mobile
05-19-2005, 06:32 PM
is this it?

i selected my forums database and this came up

k40tic
05-19-2005, 06:58 PM
I believe your table prefix would be vb3 then.
I think to fix it all you need to to is change the following:
ALTER TABLE user ADD mood varchar(15) NOT NULL
to:
ALTER TABLE vb3user ADD mood varchar(15) NOT NULL

Not sure but I think that would do the trick.

xtreme-mobile
05-19-2005, 07:00 PM
ok thanks ill try that

xtreme-mobile
05-19-2005, 07:35 PM
ok got it working but cant seem to see it in the postbit :(

i couldnt find the text in the postbit template

any ideas?

xtreme-mobile
05-19-2005, 07:55 PM
ok fixed it :)

angelicGrace
05-20-2005, 02:14 AM
For the life of me I can't get this to work. I have checked all my file and template edits a dozen times and it just isn't showing at all. nothing in the postbit, nothing in the edit profile page, zippola. any clue what i am doing wrong.

|Jordan|
05-20-2005, 06:02 PM
Make sure you select a mood. Nothing will display if in the users postbit if they do not select one.

angelicGrace
05-20-2005, 06:49 PM
the mood selection isn't show in the profile page is what i am saying. there is no evidence of it anywhere at all. no in the postbit, no in the edit profile page, not in the admin cp, no where.

Polo
05-20-2005, 07:41 PM
I have my own version of the mood hack, but I would like to know if I could use your mood images? they are cool :)

axi
05-20-2005, 07:43 PM
same the hack isnt showing in the user cp or nowhere.

axi
05-20-2005, 07:47 PM
ahh found the problem, added the mood codes way to early to the modifyprofile template!

the code i added it after was correct:


<td class="panelsurround" align="center">
<div class="panel">
<div style="width:$stylevar[formwidth_usercp]" align="$stylevar[left]">


but i added it too early, there was a second one yes half way in the page and added after the second one and works fine now :)

|Jordan|
05-20-2005, 07:56 PM
I have my own version of the mood hack, but I would like to know if I could use your mood images? they are cool :)
They're not my images, they're from the mood hack for Yabb.

angelicGrace
05-21-2005, 12:17 AM
ahh found the problem, added the mood codes way to early to the modifyprofile template!

the code i added it after was correct:


<td class="panelsurround" align="center">
<div class="panel">
<div style="width:$stylevar[formwidth_usercp]" align="$stylevar[left]">


but i added it too early, there was a second one yes half way in the page and added after the second one and works fine now :)

Thank you Axi. :) i didn't even think to look farther down the template. i know better than that too. lol

yoyoyoyo
05-21-2005, 12:31 PM
since adding this hack the avatars on the forum have been resized. Has this happened to anyone else?

|Jordan|
05-21-2005, 05:19 PM
since adding this hack the avatars on the forum have been resized. Has this happened to anyone else?
It shouldn't mess up any avatars, none of the mood hacks functions modify avatar in any way. Have you installed any other hacks lately? Can you provide an example of the messed up pages in question.

Ebolender
05-21-2005, 09:52 PM
Installed and it works just fine.

:squareeyed: Thanks for this

mustang_lex
06-15-2005, 06:36 PM
Wicked i finally got it working. !! The problem i had was I modified the postbit_legacy when I should of did postbit. i really don't know the difference so i left the changes in both :lick: . My only issue and wasn't sure if this was possible is to save the current mood under the drop down box, instead of reverting back to don't display mood .

besides that. It kicks ass

DJDarknez
06-15-2005, 08:20 PM
HELP

"An error occurred while attempting to execute your query. The following information was returned.
error number: 1146
error desc: Table 'djd_forums.vb3user' doesn't exist"

"Unable to add cookies, header already sent.
File: /home/djd/public_html/forums/includes/functions_showthread.php
Line: 762"

http://forums.djdarknez.net

any of the treads. none of them are viewable.

edit:

i re-uploaded my functions_showthread.php file, so at the very least the threads are viewable. But how to fix?

|Jordan|
06-15-2005, 11:51 PM
HELP

"An error occurred while attempting to execute your query. The following information was returned.
error number: 1146
error desc: Table 'djd_forums.vb3user' doesn't exist"

"Unable to add cookies, header already sent.
File: /home/djd/public_html/forums/includes/functions_showthread.php
Line: 762"

http://forums.djdarknez.net

any of the treads. none of them are viewable.

edit:

i re-uploaded my functions_showthread.php file, so at the very least the threads are viewable. But how to fix?

You need to edit the SQL query to point to your user table.

In this case it should be:

ALTER TABLE .vb3user ADD mood varchar(15) NOT NULL

DJDarknez
06-16-2005, 12:33 AM
OK, I had to add an underscore to the vbs_user

I did all that, damn sure it worked, but still get this when trying to view any thread:

Unable to add cookies, header already sent.
File: /home/djd/public_html/forums/includes/functions_showthread.php
Line: 761

DJDarknez
06-17-2005, 02:05 AM
Nevermind, I un-installed the hack.

|Jordan|
06-17-2005, 07:20 PM
That cookies error is very common (across many many php scripts). Here's the fix:

Create and upload a file in your root forum dir called ".htaccess" or if it already exists, add the following code to it:

PHP_FLAG output_buffering on

paul41598
06-20-2005, 07:47 PM
Is there an easy way in this hack to put the dropdown in the postbit instead of the userCP. Almost like the default VB3 style dropdown. The user could select their MOOD on the fly when posting, instead of going into their CP.

paul41598
06-21-2005, 03:20 PM
N/M, I coded it myself. I will be posting an addon/alteration of this this hack shortly

|Jordan|
06-23-2005, 03:30 PM
When you have it done, PM me, i'll update my thread with your hack and the info about it.

osariase
06-25-2005, 03:40 PM
Hi,
I have tried to install this hack regardless of all the changes i've made it doesn't work. I don't get error message, but I don't see it anywhere. I went to usercp found it there change the mood and still doesn't show up if there is anyone out there just give me a step by step instruction. I know its in the file i don't seem to get it as u have seen.

And by the way I used both hacks, the new one the old one none seems to work

Anyone that can make this work please help thanks in advance

|Jordan|
06-26-2005, 08:50 PM
Depends on which postbit your using. The default one is called "posbit", the new one (which vb.org uses) is called "posbit_legacy". Figure out which one you're using and make the necessary modifications to it.

Good Luck. Hope this helps.

osariase
06-27-2005, 02:40 PM
I am not sure which one I am using, I have both of them so how do i know which one i'm using?, i'm using vb 3.7 so can u please tell me where to go?

another question is, downloading this file you have here, is that all I need? or is there something else? please let me know

thanks

osariase
06-27-2005, 03:37 PM
Now on the postbit I see the list of moods when I click the dropdown arrow, but when I chose a mood it dosn't display the mood it reverts back to 'Your Mood', option,

I have done all the modifications

|Jordan|
06-27-2005, 05:32 PM
It goes back to Your Mood, but the mood you chose is still there. Ask on paul41598's addon for merging instructions.

rb2k1
06-30-2005, 07:20 AM
is there any way to get the mood to display on the member page (view profile pages)?

akanevsky
06-30-2005, 11:59 AM
No offense, but... I kind of do not see the point in this hack. Isn't this the same thing the post icons are intended for?

|Jordan|
06-30-2005, 09:55 PM
Take a look at the screenies, it self explanatory.

Tipi
07-05-2005, 06:44 PM
How do I add more moods? I uploaded some new images in the /images/mood-directory, but I can't find it in mye UserCP. :surprised:

Scooterpig
07-06-2005, 08:46 AM
How do I add more moods? I uploaded some new images in the /images/mood-directory, but I can't find it in mye UserCP. :surprised:

You have to edit the includes/functions_showthread.php, the template-postpit_legacy (or postbit if you use that) & template-modifyprofile by adding the new images names and then updating the numbers depending on the order you put the new moods.

mustang_lex
07-06-2005, 11:58 AM
No offense, but... I kind of do not see the point in this hack. Isn't this the same thing the post icons are intended for?

People seem to love them in my community. Most people forget theres post icons :rolleyes:

Soto
07-07-2005, 02:56 PM
Installed - thnx

kompakt
07-17-2005, 11:12 AM
Thanks. I've been using this hack for a while now with the extended postbit.

Do you happen to have a photoshop file for any of the moods so I could add a few more?

frog229
08-09-2005, 05:51 PM
Hi, I have installed the hack - I think its a great idea - I have put everything in and am using postbit but nothing ios displayed, it does however work on postbit_legacy when i put it in there - whats up??

Thanks,

Alien
08-21-2005, 04:43 AM
Anyone know how to fixed the uncached template?

In showthread, I get 1 uncached template: postbit_moodbit

I tried adding this one to showthread.php but it still remained uncached.. Anyone?

Khashyar
09-01-2005, 05:57 AM
Thanks. I've been using this hack for a while now with the extended postbit.

Do you happen to have a photoshop file for any of the moods so I could add a few more?

Yes, it would be great if someone could post the psd files, or perhaps any additional moods that they created...

My users are really getting into this mood feature.

Khashyar

lefthome
10-16-2005, 01:10 AM
I'm not a coder. Heck, I can just about maintain my own board, but my members really liked this hack and we just moved over to 3.5 so I made a few modifications to this hack, added some stuff from other hacks, and have it working fine in 3.5 gold as a template modification.

If the coder who wrote this wants what I have written, I will be happy, without credit, to hand it over. If anyone wants this nifty hack in 3.5, PM me and I will be very happy to share the information especially if you have designed any other moods that I can have....hint, hint, nudge, nudge!

hbalagh1
10-16-2005, 09:32 PM
I would so love to have this for 3.5... if anyone has got it working please send me a pm on how to do so, or post it here ;)

thanks

Snake
10-18-2005, 12:09 PM
Lovin' this hack. Thank you! :)

cloyal
01-03-2006, 09:34 AM
*clicked installed* After a few issues, I found my problems, I seem to get better results just putting the info in both post bit and post legacy, on all the hacks stating either or.

Nice hack btw, my posters love this.

quanvo81
02-07-2006, 11:21 AM
Yay
Is there anyway to make this work in MEMBERINFO template?

Hades-1
04-13-2006, 03:32 PM
Yay
Is there anyway to make this work in MEMBERINFO template?

Yes we keep asking, is there a way?

Hades-1
04-13-2006, 03:41 PM
you guyys probably wont like where its placed but at least i got it in there for now

http://myfullsize.com/member.php?userid=1

if anyone wants to know how its easy and ill tell you.