vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Profile Enhancements - Mood Manager - with AJAX mood update. (https://vborg.vbsupport.ru/showthread.php?t=127220)

deezelpope 03-25-2007 10:09 AM

The names of your moods need to be typed in your vBulletin Options in your AdminCP exactly as they're named and uploaded into your image folder.

hambil 03-26-2007 08:34 PM

Hey, here is some code to align the image with the text and make it look nicer. I already made the edits on my board, and thought I'd share :)

In the quick_mood_change_by_sniper template
HTML Code:

<span style="vertical-align: middle;">$vbphrase[my_mood]: </span><a href="#" id="moods"><if condition="!empty($bbuserinfo[mood])"><img style="vertical-align: middle;" src="images/mood/$bbuserinfo[mood].gif" border="0" /><else />$vbphrase[change_mood]</if></a>
In the ajax_start plugin
PHP Code:

die("<img style=\"vertical-align: middle;\" src=\"images/mood/" $new_mood".gif\" border=\"0\" />"); 

In the postbit or postbit_legacy templates
HTML Code:

                                <if condition="!empty($post[mood])">
                                <div>
                                        <span style="vertical-align: middle;">$vbphrase[my_mood]:</span> <img style="vertical-align: middle;" src="images/mood/$post[mood].gif" border="0" />
                                </div>

Feel free to put this into the hack with no obligation or need to mention me. Great hack btw!

dbirosel 03-26-2007 08:39 PM

Quote:

Originally Posted by hambil (Post 1213043)
Hey, here is some code to align the image with the text and make it look nicer. I already made the edits on my board, and thought I'd share :)

In the quick_mood_change_by_sniper template
HTML Code:

<span style="vertical-align: middle;">$vbphrase[my_mood]: </span><a href="#" id="moods"><if condition="!empty($bbuserinfo[mood])"><img style="vertical-align: middle;" src="images/mood/$bbuserinfo[mood].gif" border="0" /><else />$vbphrase[change_mood]</if></a>
In the ajax_start plugin
PHP Code:

die("<img style=\"vertical-align: middle;\" src=\"images/mood/" $new_mood".gif\" border=\"0\" />"); 

In the postbit or postbit_legacy templates
HTML Code:

                                <if condition="!empty($post[mood])">
                                <div>
                                        <span style="vertical-align: middle;">$vbphrase[my_mood]:</span> <img style="vertical-align: middle;" src="images/mood/$post[mood].gif" border="0" />
                                </div>

Feel free to put this into the hack with no obligation or need to mention me. Great hack btw!

Can i see a sshot of the differences and improvements you have done?

hambil 03-26-2007 09:15 PM

Sure, I also used optgroup to put images in the drop down instead of text.

Here is a couple screenshots:

deezelpope 03-26-2007 10:27 PM

WOW!!! That's cool!!! Great job!!! I think I might hafta do it your way!!! I like, I like!!:up: :up: :up:

How'd you do that??

hambil 03-26-2007 10:31 PM

LOL

If what I already posted makes no sense to you, then I recommend you wait for the mod author to incorporate my changes if he/she decides to do so. ;)

deezelpope 03-26-2007 10:34 PM

You added the images to the drop-down with just that coding? I can handle that!! But it's what you said about using 'optgroup'? I'm sorry, but ya lost me there.:o

hambil 03-26-2007 10:41 PM

Oh. Optgroup is an html tag that allows background images.

So, I made this change to the select in the "[Mood Manager] - Make Drop Down Menu" hook:

PHP Code:

foreach ($moodslist AS $mood)
{
    
$mood trim($mood);
    if (
$mood == $vbulletin->userinfo['mood']) { $selectedmood ' Selected'; } else { $selectedmood ''; }
    
$vbmoods['mood'] .= '<optgroup style="background-image: url(images/mood/' .$mood'.gif); height: 15px; width: 72px;"><option value="' .$mood'"' .$selectedmood'></option></optgroup>';
    
$vbmoods['mood'] .= "\r";


Also note that you need to make two small changes in the images. In Love.gif will need to have the space removed (and the name in settings needs the space removed to match). And Psychadelic.gif needs to be Psychedelic.gif (which technically is a problem with or without images in the drop-down, but might as well fix it) :)

I hard-coded the image size. If someone wanted to get all fancy they could probably make that more dynamic, but with the included images it works just fine.

deezelpope 03-26-2007 10:50 PM

Sweet!! Thank you for taking the time to explain this to me. I will work on this in the morning! I'm looking forward to this!! I will let you know how it goes! Thanks again, Hambil! BTW, LOVE your avatar!! So cute!:o

Invalid ID 03-27-2007 01:11 AM

It's not working with vbadvanced. Please check the attached photo. Thanks


All times are GMT. The time now is 07:37 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.01745 seconds
  • Memory Usage 1,760KB
  • 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
  • (4)bbcode_html_printable
  • (3)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (3)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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