Important: This page is using cookies (cookies). Using this website without turning off cookies in browser, means that you agree for using it.
Buy Now! Features Downloads

Earn with us!

If you would like to start earning money with vBET join to Affiliate Program.
Results 1 to 10 of 10

Thread: jquery loading for users unnecessarily

  1. #1
    Senior Member
    Join Date
    Dec 2009
    Posts
    276

    Default jquery loading for users unnecessarily

    The new manual translation feature loads jquery for every user causing my data allocation to go up about 1.75GB a day!

    Please add a function to only load jquery for users that have permission to enter manual translations.

    I entered this as a bug because it's not really a feature request, but the way things should be.

  2. #2
    Banned
    Join Date
    Aug 2012
    Posts
    481

    Default

    You're right. I thank you for your attention.

  3. #3
    Senior Member
    Join Date
    Dec 2009
    Posts
    276

    Default

    Please let me know if there is a manual fix for this in the meantime.

  4. #4
    Banned
    Join Date
    Aug 2012
    Posts
    481

    Default

    Quick will fix for the issue is:
    1. Open file includes/vbenterprisetranslator_functions_hooks.php
    2. Find code:
      PHP Code:
      $vbet_scriptInclude ='<script type="text/javascript" src="clientscript/vbet/vbet.script.js"></script><script type="text/javascript" src="clientscript/vbet/jquery.min.js"></script>';
      if(isset(
      $template_hook['headinclude_javascript']) ){
      $template_hook['headinclude_javascript'] .= $vbet_scriptInclude;
      }else{
      $template_hook['headinclude_javascript'] = $vbet_scriptInclude;

    3. Replace it to code:
      PHP Code:
      require_once(DIR'/includes/vbenterprisetranslator_functions_utils.php');  
      global 
      $vbulletin;
      if(
      vbet_canEditCache($vbulletin->userinfo))
      {
      $vbet_scriptInclude ='<script type="text/javascript" src="clientscript/vbet/vbet.script.js"></script><script type="text/javascript" src="clientscript/vbet/jquery.min.js"></script>';
      if(isset(
      $template_hook['headinclude_javascript']) ){
      $template_hook['headinclude_javascript'] .= $vbet_scriptInclude;
      }else{
      $template_hook['headinclude_javascript'] = $vbet_scriptInclude;
      }


    This should fix the issue. We will be add this fix in next release.
    Last edited by Marcin Kalak; 25-10-12 at 15:52.

  5. #5
    Senior Member
    Join Date
    Dec 2009
    Posts
    276

    Default

    Thanks! I appreciate it!

  6. #6
    Banned
    Join Date
    Aug 2012
    Posts
    481

    Default

    I'm glad I could help you.

  7. #7
    Senior Member
    Join Date
    Dec 2009
    Posts
    276

    Default

    actually, this is producing an error:
    PHP Fatal error: Call to undefined function vbet_canEditCache() in /home/site/public_html/includes/vbenterprisetranslator_functions_hooks.php on line 685

  8. #8
    Banned
    Join Date
    Aug 2012
    Posts
    481

    Default

    Add just before the edit code:
    PHP Code:
    require_once(DIR'/includes/vbenterprisetranslator_functions_utils.php'); 
    I add this code to the quick fix.
    Last edited by Marcin Kalak; 25-10-12 at 15:57.

  9. #9
    Senior Member
    Join Date
    Dec 2009
    Posts
    276

    Default

    Thanks for the quick response!

  10. #10
    Banned
    Join Date
    Aug 2012
    Posts
    481

    Default

    I'm glad I could help you.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •