Thread: Chat Modifications - Cyb - ChatBox
View Single Post
  #552  
Old 09-11-2008, 07:19 PM
vbboarder's Avatar
vbboarder vbboarder is offline
 
Join Date: Jun 2008
Location: Silicon Valley, CA
Posts: 417
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Bug: About a week ago I reported that the chatbox shifted the page down & up by ~2 pixels in IE7 whenever the "refreshing messages" appeared. Several other people have confirmed this bug, but no fix has yet been posted. Well, I finally got annoyed and decided to debug it myself.

Solution: Currently, when the chatbox is about to update messages, it hides the "Refreshing Messages" text. The solution simply displays "Updating Messages" instead - you can change this to whatever text you want. I prefer to change the color of the "Refreshing Messages" instead of changing the text so I added that code to the hack. Unfortunately, the color change does not work in IE7 (so IE7 will get the text change and other browsers will get the color change) - you can change the colors to whatever you want or even remove the condition to check for non-IE browsers. So finally here's the 3-steps fix on how to squash the bug - the problem is in the Ccb_getMessages() and Ccb_updateMessages() functions in the chatbox template (surprise, surprise ....): Go to Style Manager > Edit Templates > Cybernetec Templates > cyb_chatbox, and
1. FIND:

PHP Code:
                ccb_Messages = new vB_AJAX_Handler(true);
                
ccb_Messages.onreadystatechange(Ccb_updateMessages);
                
ccb_Messages.send('misc.php?show=ccbmessages');
            }
        }

        function 
Ccb_updateMessages()
        {
            if (
ccb_Messages)
            { 
.
REPLACE WITH:
PHP Code:
                if (navigator.userAgent.indexOf('MSIE') > -1)
                    
fetch_object('cybcb_infoarea').innerHTML ':: Updating Messages';
                else
                    
fetch_object('cybcb_infoarea').style.color 'aqua';
                
ccb_Messages = new vB_AJAX_Handler(true);
                
ccb_Messages.onreadystatechange(Ccb_updateMessages);
                
ccb_Messages.send('misc.php?show=ccbmessages');
            }
        }

        function 
Ccb_updateMessages()
            {
            if (
ccb_Messages)
            {
                
fetch_object('cybcb_infoarea').innerHTML ':: $vbphrase[cybcb_status_refreshing]';
                
fetch_object('cybcb_infoarea').style.color 'gray'
.
2. FIND AND DELETE:
PHP Code:
             if (!Ccb_nowLoading)
            {
                
fetch_object('cybcb_infoarea').style.display 'none';
                
fetch_object('ccb_entermessage').style.height '$cybcb_height_input';
            } 
.
3. FOR MAC USERS: to fix a mac sizing bug where the text area will contract & expand on refresh, find all:
Quote:
$cybcb_height_input_wstatus
and replace with:
Quote:
$cybcb_height_input
Hope that helps everyone from gettin' shifty eyes when using IE7
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01260 seconds
  • Memory Usage 1,792KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete