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)
-   -   Chat Modifications - MGC Chatbox (with AJAX) (https://vborg.vbsupport.ru/showthread.php?t=148472)

class101 10-16-2007 03:54 PM

MGC Chatbox 1.5 & vBadvanced CMPS Integration

First read the documentation to build the chatbox module in vBa, I assume you already have your Chatbox template module linked to a template adv_portal_mgc_chatbox with the variable
$mgc_chatbox into. Then follow theses instructions:

1) MGC Chatbox > Display and position > Display on defined pages above the navbar > NO
2) MGC Chatbox > Display and position > Display on defined pages in a variable > YES
3) vBa CMPS > Default Settings > Main Options > Portal Output Global Variables > Enter the value mgc_chatbox
4) Plugins & Products > Plugin Manager > Product : MGC chatbox : Variables globales chatbox > Click Large Edit Box and start editing as mentioned below:

FIND

Code:

        if (THIS_SCRIPT == 'adv_index' && !empty($forumpath)) {
                $mgc_cb_floc = $forumpath;
        } else {
                $mgc_cb_floc = '.';
        }

AND DELETE IT, SAVE THE FILE.

5) Styles & Templates > Style Manager > Edit Templates > MGC Chatbox Templates > mgc_chatbox and start editing as mentioned below:

FIND

Code:

var mgc_cb_jsloc = "$mgc_cb_floc";
REPLACE BY

Code:

var mgc_cb_jsloc = "$vboptions[bburl]";
FIND

Code:

<script type="text/javascript" src="$mgc_cb_floc/clientscript/mgc_chatbox.js"></script>
REPLACE BY

Code:

<script type="text/javascript" src="$vboptions[bburl]/clientscript/mgc_chatbox.js"></script>
6) Styles & Templates > Style Manager > Edit Templates > MGC Chatbox Templates > mgc_chatbox_editor and start editing as mentioned below:

FIND

Code:

<a href="mgc_chatbox.php?$session[sessionurl]do=view_chatbox" target="_blank">
REPLACE BY

Code:

<a href="$vboptions[bburl]/mgc_chatbox.php?$session[sessionurl]do=view_chatbox" target="_blank">
FIND

Code:

<a href="mgc_chatbox.php?$session[sessionurl]do=view_chatbox" target="_top">
REPLACE BY

Code:

<a href="$vboptions[bburl]/mgc_chatbox.php?$session[sessionurl]do=view_chatbox" target="_top">
Pay attention to correct each steps carefully and MGC will run smoothly :) (This does not alter in any way how MGC is working, I have checked carefully my modifications the way that it shouldnt produce new bugs or disable functions, but if you have a problem feel free to report.)
It makes MGC no more dependent on directories paths so you must be able to place it in any dir/pages with $mgc_chatbox like vba wich is often placed in another one.

france 0wwnz ;)) Greetings VBDev , hope I helped you out

Amiga75 10-16-2007 05:21 PM

Great, Thanks.

class101 10-17-2007 01:17 AM

have figured out how to workaround the chatbox width problem on the portal, when you have a small width portal then the chatbox is too long and will break the layout, figured out how to correct it like in the picture attached, if some need explanations feel free to request

VBDev 10-17-2007 05:27 AM

Thanks for your sharing class101.

However, your solution was kinda like the previous way I did the integration with vbportal and also why I removed it.

Let me explain it a bit.

In that code :
Code:

var mgc_cb_jsloc = "$vboptions[bburl]";
You're adding the $vboptions[bburl] var. So ajax calls in the mgc_chatbox.js file will be done with a full http url.

Calling ajax with full http url is generally not allowed by browsers (forbidden action in the javascript language definition).

It might work on some host but it might also not work at all on others.

So I recommend to becareful when using your fix as this could not work.

class101 10-17-2007 09:44 AM

No problems in IE and Firefox, who cares of others ? ;) You must try out the various browsers ouuta there but I doubt this is a problem, I have IE 7 + Firefox and there is no problems at all , no scripting error spawn at all so I guess all is ok if both major broswers are rendering it correctly, personnaly I prefer to use that way because the forum path isn't defined in all vbuletin config, most are forgetting to set it up, and having the local path of the computer showable in the source is not really security friendly :) I mean you just have to read the source of the index to read what is the full system path with the /home included of your box, really not security friendly (that's probably why vbulletin replaces the defaults mysql error page by a standalone one wich looks like a 404 error to hide the path to each errors).

Well anyway you dont like it or not I think I showed you enough to understand from where vbadvanced is giving some complications, that path can be modified in seconds if you prefer another way but the main goal to make 1.5 working with vba is done :)

VBDev 10-17-2007 10:42 AM

This doesn't seem to depend on the browser.

In the 1.4 version, the code was the same as yours but this caused problem on some host.

Don't know exactly why on some but not all ... But when there was an error it said that this action was not allowed (I mean the call of a js files with full http url).

Putting the $forumpath was the only simple way I found as for now. Indeed it might not be secure enough but the big problem is the full http url in the path.

This problem is not that simple and needs more reflexion to find the perfect solution which I don't have for the moment.

class101 10-17-2007 11:01 AM

a ok I see you mean some web hosting problems. Well then warn in the documentation some host may disallow direct .js linking explaining a workaround for that issue because your script is very fine and that's not to you to workaround stupid server's configuration, just my 2cent mind.

jonbaker 10-17-2007 05:30 PM

new problem. it seems that some users do not have access to the chatbox, but many others do. they are all lumped in the same primary usergroups. the odd think is that i have a test screen name that does not have access to the chatbox when i log in under that name.

VBDev 10-18-2007 05:22 AM

Have you made the modifications to the modifyoptions template ?

andrewtr89 10-18-2007 10:24 PM

Quote:

Originally Posted by VBDev (Post 1348745)
It seems that it depends of the server configuration coz user with big boards haven't experienced such problems while few of you have.

What refresh rate have you put for the chatbox ?

Have you activated team message warning system and inactive mode ?



I have the reset rate at 10 seconds.

All Mods and Admins (11 total) have access to the chatbox. Only registered users with 5 or more posts can view it, which is only around 500 members.


All times are GMT. The time now is 10:30 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.02553 seconds
  • Memory Usage 1,757KB
  • 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
  • (10)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (5)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