vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Mood Hack (https://vborg.vbsupport.ru/showthread.php?t=81637)

|Jordan| 05-16-2005 10:00 PM

Mood Hack
 
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
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]
This addon puts the mood dropdown selector inside the postbit instead of the USERCP.
Credit goes to paul41598

Please Click Install if you find this hack userful. Thanks.

Marco van Herwaarden 05-17-2005 02:36 PM

Quote:

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.)


Quote:

Originally Posted by boo.3
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 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

Quote:

Originally Posted by Nordinho
looks good, but wouldn't this 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

Quote:

Originally Posted by MyIS_Jordan
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

PHP Code:

<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

Quote:

Originally Posted by yoyoyoyo
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

Quote:

Originally Posted by xtreme-mobile
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

Quote:

Originally Posted by Marboosh.Net
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

Quote:

Originally Posted by xtreme-mobile
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:
Code:

        <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

Quote:

Originally Posted by MyIS_Jordan
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

Quote:

Originally Posted by xtreme-mobile
???? 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:
Code:

ALTER TABLE user ADD mood varchar(15) NOT NULL
to:
Code:

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 :)


All times are GMT. The time now is 04:44 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01278 seconds
  • Memory Usage 1,829KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (1)bbcode_php_printable
  • (10)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete