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)

NeutralizeR 09-23-2006 09:20 PM

I think it looks better this way (at least for my own style):

Download mymood.gif below: (Right click and "Save as...")
https://vborg.vbsupport.ru/

Upload mymood.gif to /forum/images/mood/ folder...

Open your quick_mood_change_by_sniper template:

Replace:
Quote:

$vbphrase[my_mood]:
with the code below:
Quote:

<img src="images/mood/mymood.gif" width="72" height="15" border="0" />
Replace:
Quote:

<script type="text/javascript"> vbmenu_register("moods"); </script>
with the code below: (if you don't want the arrow icon)
Quote:

<script type="text/javascript">vbmenu_register("moods" ,1);</script>
Result:
http://img230.imageshack.us/img230/6974/snap4qm1.png

For the postbit_legacy template:

Replace:
Quote:

<if condition="!empty($post[mood])">
<div>
$vbphrase[my_mood]: <img src="images/mood/$post[mood].gif" border="0" />
</div>
</if>
with the code below:
Quote:

<if condition="!empty($post[mood])">
<div><img src="images/mood/mymood.gif" width="72" height="15" border="0" /> <img src="images/mood/$post[mood].gif" border="0" />
</div>
</if>
Result:
http://img235.imageshack.us/img235/4030/snap3sf2.png

NeutralizeR 09-23-2006 09:39 PM

Quote:

Originally Posted by -=Sniper=-
steadicamop; try disabling the auto edit and do it manually.

NeutralizeR; does it work with the full path then?

Yes, i've solved the vBadvanced CMPS problem...

Add vbmoods to Portal Output Global Variables list.

If you use vBadvanced and the index of it is not located in the same directory with your forum e.g. http://www.msxlabs.org/index.php (my vbadvanced page), http://www.msxlabs.org/forum/ (my forums), you have to edit these template and the plugins:

quick_mood_change_by_sniper template:
Add the bold text:
Quote:

<img src="http://www.yourdomain.com/forum/images/mood/$bbuserinfo[mood].gif" border="0" />
Plugin Manager > [Mood Manager] - Ajax Update:
Quote:

die("<img src=\"http://www.yourdomain.com/forum/images/mood/" . $new_mood. ".gif\" border=\"0\" />");
Plugin Manager > [Mood Manager] - Make Drop Down Menu:
Quote:

ajax_mood.send(\'../forum/ajax.php\', \'do=insertmood&mood=\' + PHP.urlencode(mood));
Thanks for the hack

Emanet-Kaos 09-23-2006 10:29 PM

thanks very much, cool hack :O)

Lionel 09-24-2006 02:56 PM

Quote:

Originally Posted by NeutralizeR
How did you do it?

create a template adv_portal_mymood
PHP Code:

<tr>
<
td>$usermoods</td></tr

here is the module (basically the same as hack. Only this line is added : eval('$home[$mods[\'modid\']][\'content\'] = "' . fetch_template('adv_portal_mymood') . '";');
)

PHP Code:

<?php
if ($vbulletin->options['moodmanageronoff']) 

$vbulletin->templatecache['header'] .= '<script type=\"text/javascript\"> 
<!-- 
    function update_mood() 
    { 
        fetch_object(\'mood_box\').innerHTML = \'Updating...\'; 
        if (ajax_mood.handler.readyState == 4 && ajax_mood.handler.status == 200 && ajax_mood.handler.responseText) 
        { 
            fetch_object(\'mood_box\').innerHTML = ajax_mood.handler.responseText; 
        } 
    } 
     
    function change_mood(mood) 
    { 
        ajax_mood = new vB_AJAX_Handler(true); 
        ajax_mood.onreadystatechange(update_mood); 
        ajax_mood.send(\'/forums/ajax.php\', \'do=insertmood&mood=\' + PHP.urlencode(mood)); 
    } 
//--> 
</script>'

$moods explode("\n"$vbulletin->options['moodmanagermoods']); 
foreach (
$moods AS $mood

    
$mood trim($mood); 
    if (
$mood == $vbulletin->userinfo[mood]) { $selected ' Selected'; } 
    
$moods[mood] .= '<option value="' .$mood'"' .$selected'>' .$mood'</option>'
    
$moods[mood] .= "\r"

if (
$vbulletin->options['moodmanagerglobal']) 

    
$search_text '$vbphrase[private_messages_nav]'
    
$vbulletin->templatecache['navbar'] = str_replace($search_text
    
$search_text.fetch_template('quick_mood_change_by_sniper'),$vbulletin->templatecache['navbar']); 

else 

  
    eval(
'$usermoods = "' fetch_template('adv_portal_quick_mood_change_by_sniper') . '";');
eval(
'$home[$mods[\'modid\']][\'content\'] = "' fetch_template('adv_portal_mymood') . '";');


?>

use shell module

NeutralizeR 09-24-2006 03:20 PM

Quote:

Originally Posted by Lionel
create a template adv_portal_mymood
PHP Code:

<tr>
<
td>$usermoods</td></tr

here is the module (basically the same as hack. Only this line is added : eval('$home[$mods[\'modid\']][\'content\'] = "' . fetch_template('adv_portal_mymood') . '";');
)

PHP Code:

<?php
if ($vbulletin->options['moodmanageronoff']) 

$vbulletin->templatecache['header'] .= '<script type=\"text/javascript\"> 
<!-- 
    function update_mood() 
    { 
        fetch_object(\'mood_box\').innerHTML = \'Updating...\'; 
        if (ajax_mood.handler.readyState == 4 && ajax_mood.handler.status == 200 && ajax_mood.handler.responseText) 
        { 
            fetch_object(\'mood_box\').innerHTML = ajax_mood.handler.responseText; 
        } 
    } 
     
    function change_mood(mood) 
    { 
        ajax_mood = new vB_AJAX_Handler(true); 
        ajax_mood.onreadystatechange(update_mood); 
        ajax_mood.send(\'/forums/ajax.php\', \'do=insertmood&mood=\' + PHP.urlencode(mood)); 
    } 
//--> 
</script>'

$moods explode("\n"$vbulletin->options['moodmanagermoods']); 
foreach (
$moods AS $mood

    
$mood trim($mood); 
    if (
$mood == $vbulletin->userinfo[mood]) { $selected ' Selected'; } 
    
$moods[mood] .= '<option value="' .$mood'"' .$selected'>' .$mood'</option>'
    
$moods[mood] .= "\r"

if (
$vbulletin->options['moodmanagerglobal']) 

    
$search_text '$vbphrase[private_messages_nav]'
    
$vbulletin->templatecache['navbar'] = str_replace($search_text
    
$search_text.fetch_template('quick_mood_change_by_sniper'),$vbulletin->templatecache['navbar']); 

else 

  
    eval(
'$usermoods = "' fetch_template('adv_portal_quick_mood_change_by_sniper') . '";');
eval(
'$home[$mods[\'modid\']][\'content\'] = "' fetch_template('adv_portal_mymood') . '";');


?>

use shell module

Thanks for the reply... I've found an alternative way as i have many non-vbulletin pages in different folders integrated to forum database.

Exitilus 09-24-2006 09:33 PM

Quote:

Originally Posted by NeutralizeR
Yes, i've solved the vBadvanced CMPS problem...

Add vbmoods to Portal Output Global Variables list.

If you use vBadvanced and the index of it is not located in the same directory with your forum e.g. http://www.msxlabs.org/index.php (my vbadvanced page), http://www.msxlabs.org/forum/ (my forums), you have to edit these template and the plugins:

quick_mood_change_by_sniper template:
Add the bold text:


Plugin Manager > [Mood Manager] - Ajax Update:


Plugin Manager > [Mood Manager] - Make Drop Down Menu:

Thanks for the hack

I also had to add usermoods to the Global Output for vBadvanced to get it working.

Though I'm still having a problem with the final edit. the ../forums/ajax.php\

If I set that it will work on the vbAdvanced Page. But will not work in the main forums. Though what I really need to do is specify a exact path. I have two different folders, gallery and forums. So obviously when I'm in gallery folder the mod doesn't work because of the directory. if I can define the exact location or url .. then it woudl work. Just dunno how :|

NeutralizeR 09-24-2006 11:14 PM

Quote:

Originally Posted by Exitilus
I also had to add usermoods to the Global Output for vBadvanced to get it working.

Though I'm still having a problem with the final edit. the ../forums/ajax.php\

If I set that it will work on the vbAdvanced Page. But will not work in the main forums. Though what I really need to do is specify a exact path. I have two different folders, gallery and forums. So obviously when I'm in gallery folder the mod doesn't work because of the directory. if I can define the exact location or url .. then it woudl work. Just dunno how :|

Did you try /forums/ajax.php ?
****
Can you type all of the custom folders you have?

Exitilus 09-25-2006 12:13 AM

In my public_html directory I have gallery and forums directories.

But I use them in such a way as forums.houseofcrazed.com and gallery.houseofcrazed.com

if I try /forums/ajax.php it will only work on my vbadvanced page.

Morrus 09-25-2006 12:27 AM

Seems to work fine. Even got it displaying in my blog area.

However, I can't seem to get it to show up in the postbit. Wherever I place it, nothing happens. Any ideas?

I addition, if the user has not slected a mood, I get a broken image. Right-clicking indicates it's trying to find an image with no name (images/moods/.gif).

Adrian Schneider 09-25-2006 12:36 AM

Cool hack... may add it to one of my sites.


All times are GMT. The time now is 05:50 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.01953 seconds
  • Memory Usage 1,795KB
  • 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_php_printable
  • (14)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)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