Thread: Chat Modifications - MGC Chatbox Evo
View Single Post
  #4405  
Old 02-28-2009, 12:03 PM
VBDev's Avatar
VBDev VBDev is offline
 
Join Date: Jan 2004
Location: France
Posts: 2,570
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by punk23 View Post
Excellent Mod

I will purchase the branding free option if someone can tell me how I achieve the following....

I need it so that just the chatbox gets launched in its own window (without anything else - no forum header, logo, navbar or other VB stuff), say 640x300px in size, via a single link to launch it.
I think you could achieve this pretty easily.

Open the mgc_cb_evo.php file, search for :
PHP Code:
/* Chatbox display in full mode */
if ($_REQUEST['do'] == "view_chatbox")
{
   
/* The user can't view the chatbox or full mode is not yet enabled ? */
   
if (!can_view_mgc_cb_evo() || !$vbulletin->options['mgc_cb_evo_fullmode_active'])
   {
      
print_no_permission();
   }

   
$HTML build_mgc_cb_evo_display($vbulletin->options['mgc_cb_evo_fullmode_height']);

   
$navbits = array();
   
// change the line below to contain whatever you want to show in the navbar (title of your custom page)
   
$navbits[$parent] = $vbulletin->options['mgc_cb_evo_title'];

   
$navbits construct_navbits($navbits);
   eval(
'$navbar = "' fetch_template('navbar') . '";');

   
// change the line below to contain the name of the actual main output template used in your script
   
eval('print_output("' fetch_template('GENERIC_SHELL') . '");');

Here you should change that to :
PHP Code:
/* Chatbox display in full mode */
if ($_REQUEST['do'] == "view_chatbox")
{
   
/* The user can't view the chatbox or full mode is not yet enabled ? */
   
if (!can_view_mgc_cb_evo() || !$vbulletin->options['mgc_cb_evo_fullmode_active'])
   {
      
print_no_permission();
   }

   
$HTML build_mgc_cb_evo_display($vbulletin->options['mgc_cb_evo_fullmode_height']);

   
// change the line below to contain the name of the actual main output template used in your script
   
eval('print_output("' fetch_template('mgc_cb_evo_page') . '");');

Then at the top of the file, add mgc_cb_evo_page in the globaltemplates var, it should look like :
PHP Code:
$globaltemplates = array(
   
'GENERIC_SHELL',
   
'mgc_cb_evo_archives',
   
'mgc_cb_evo_static_chatbit',
   
'mgc_chatbox_archives_nobit',
   
'mgc_cb_evo_channel_button',
   
'mgc_cb_evo',
   
'mgc_cb_evo_editor',
   
'mgc_cb_evo_chatbit',
   
'mgc_cb_evo_chatbit_menu',
   
'editor_jsoptions_font',
   
'editor_jsoptions_size',
   
'mgc_cb_evo_help',
   
'mgc_cb_evo_help_bit',
   
'mgc_cb_evo_smilies',
   
'mgc_cb_evo_rules',
   
'mgc_cb_evo_table',
   
'mgc_cb_evo_table_bit',
   
'mgc_cb_evo_search',
   
'mgc_cb_evo_page'
); 
Then edit the clientscript/mgc_cb_evo/mgc_cb_evo_functions.js file append to it :
Code:
function open_chatbox_window()
{
   window.open(bburl + "/mgc_cb_evo.php?" + SESSIONURL + "do=view_chatbox" , "view_chatbox", "toolbar=no,scrollbars=yes,resizable=yes,left=0 top=0,width=640,height=480");
   return false;
}
Last step is to edit the mgc_cb_evo_editor template, search for :
Code:
     <if condition="$vbulletin->options[mgc_cb_evo_fullmode_active] && THIS_SCRIPT != 'mgc_cb_evo'">
        <if condition="$vbulletin->options[mgc_cb_evo_fullmode_link_topopup]">
           <a href="mgc_cb_evo.php?$session[sessionurl]do=view_chatbox" target="_blank"><img class="inlineimg" id="mgc_cb_evo_fullmode" title="$vbphrase[mgc_cb_evo_fullmode]" src="$stylevar[imgdir_misc]/mgc_cb_evo/mgc_cb_evo_full.gif" alt="$vbphrase[mgc_cb_evo_fullmode]" border="0" /></a>
        <else />
           <a href="mgc_cb_evo.php?$session[sessionurl]do=view_chatbox" target="_top"><img class="inlineimg" id="mgc_cb_evo_fullmode" title="$vbphrase[mgc_cb_evo_fullmode]" src="$stylevar[imgdir_misc]/mgc_cb_evo/mgc_cb_evo_full.gif" alt="$vbphrase[mgc_cb_evo_fullmode]" border="0" /></a>            
        </if>
     </if>
In the two links of that bit of code add before the end of the opening <a tag add :
Code:
onclick="return open_chatbox_window();"
I have not tested but this should work !

If it does I perhaps would implement that in the next version.

Don't forget to activate the chatbox in full mode option.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01311 seconds
  • Memory Usage 1,810KB
  • 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_code
  • (3)bbcode_php
  • (1)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