Because some plugin developer really like using
My as prefix for their plugin, we will use
MyBB Hacks as prefix for this modification
So, we can call it as
MyBB Hacks Mood System
Not too hard to do this, because we have the amazing tools, conditional in template.
So, to do this, we need
Template Conditionals plugin or
PHP in Templates / Complex Templates plugin. We will "combine" it with Custom Profile Fields.
The mood can be selected in UserCP -> Edit Profile.
The mood can be displayed in several area, like Postbit, Member Profile, Header (Member Panel) and Member List.
Here is how to do that:
In this example, we use Custom Profile Fields ID = 4. The mood images is png images, in
images/mybbhacksmood folder/directory. So, maybe we need to modify it as our needs.
- Create a custom profile fields with these settings:
- Title: Mood
Modify it as our needs.
- Short Description: Your mood today. You can edit your mood whenever you want by visiting this page.
Modify it as our needs.
- Field Type: Select Box
- Field Length: 1
- Selectable Options?:
Modify it as our needs.
- Upload mood images. For the example mood above:
- Mood: Happy
Mood Image: Happy.png
- Mood: Sad
Mood Image: Sad.png
- Mood: In Love
Mood Image: InLove.png
- Now, we will displaying the MyBB Hacks Mood.
- In Postbit:
Put this code in our postbit_author_user template:
Modify it as our needs. Change the 4 to our MyBB Hacks Mood custom profile fields id.
Or, we can put it in our postbit and postbit_classic template.
- In Profile:
member_profile_customfields_field template.
If we didn't modified this template before, replace the template contents with:
Modify it as our needs. Change the 4 to our MyBB Hacks Mood custom profile fields id. If a user didn't select any mood, the MyBB Hacks Mood column will not be displayed.
- In Header:
Put this code in our header_welcomeblock_member template:
Modify it as our needs. Change the 4 to our MyBB Hacks Mood custom profile fields id.
BTW, do you think other Mood System has this feature (displaying mood in header template)? MyBB Hacks Mood System is the pioneer
- In Member List:
Put this code in our memberlist_user template:
Modify it as our needs. Change the 4 to our MyBB Hacks Mood custom profile fields id.
Again, do you think other Mood System has this feature (displaying mood in member list page)? MyBB Hacks Mood System is the pioneer again
That's it. Please tell me if I did something wrong
Note: For PHP In Template plugin, the code is a bit different.