Jump to content

clientarea.php blank


myrte

Recommended Posts

It looks like the object "$smarty" isn't available globally for hooks anymore in 5.2 so when the livehelp hook tries to assign variables to the template it crashes out. Does anyone know what the new syntax is? I can't believe that this sort of stuff wasn't included in the release notes.

Link to comment
Share on other sites

It looks like the object "$smarty" isn't available globally for hooks anymore in 5.2 so when the livehelp hook tries to assign variables to the template it crashes out. Does anyone know what the new syntax is? I can't believe that this sort of stuff wasn't included in the release notes.

 

So in effect they have released 5.2 that will not work with livehelp, but i bet this will not stop WHMCS from still charging you the $8 a month for their live help addon even though it wont work with 5.2.

Link to comment
Share on other sites

So in effect they have released 5.2 that will not work with livehelp, but i bet this will not stop WHMCS from still charging you the $8 a month for their live help addon even though it wont work with 5.2.

 

I'm sure it was just an oversight. They will probably issue a patch soon.

Link to comment
Share on other sites

New Code ;)

 

<?php
/*
stardevelop.com Live Help
International Copyright stardevelop.com

You may not distribute this program in any manner,
modified or otherwise, without the express, written
consent from stardevelop.com

You may make modifications, but only for your own 
use and within the confines of the License Agreement.
All rights reserved.

Selling the code for this program without prior 
written consent is expressly forbidden. Obtain 
permission before redistributing this program over 
the Internet or in any other medium.  In all cases 
copyright and header must remain intact.  
*/

// Report all PHP errors
//error_reporting(E_ALL);

// Database
$table_prefix = 'modlivehelp_';

function hook_livehelpclientarea($vars) {
global $CONFIG;

if (!empty($CONFIG['SystemSSLURL'])) {
	$server = trim($CONFIG['SystemSSLURL']);
} else {
	$server = trim($CONFIG['SystemURL']);
}

if (substr($server, -1) != '/') {
	$server = $server . '/';
}
$server .= 'modules/';

$userid = (isset($vars['clientsdetails']['userid'])) ? $vars['clientsdetails']['userid'] : '';
$name = (!empty($vars['clientsdetails']['lastname'])) ? $vars['clientsdetails']['firstname'] . ' ' . $vars['clientsdetails']['lastname'] : $vars['clientsdetails']['firstname'];
$email = (isset($vars['clientsdetails']['email'])) ? $vars['clientsdetails']['email'] : '';
$locale = (isset($_SESSION['Language'])) ? $_SESSION['Language'] : $CONFIG['Language'];

switch ($locale) {
	case 'czech':
		$locale = 'cs';
		break;
	case 'danish':
		$locale = 'da';
		break;
	case 'dutch':
		$locale = 'nl';
		break;
	case 'french':
		$locale = 'fr';
		break;
	case 'german':
		$locale = 'de';
		break;
	case 'italian':
		$locale = 'it';
		break;
	case 'norwegian':
		$locale = 'no';
		break;
	case 'portuguese-br':
		$locale = 'pt';
		break;
	case 'portuguese-pt':
		$locale = 'pt';
		break;
	case 'spanish':
		$locale = 'es';
		break;
	case 'swedish':
		$locale = 'sv';
		break;
	case 'turkish':
		$locale = 'tr';
		break;
	default:
		$locale = 'en';
		break;
}

$code = <<<END
<!-- stardevelop.com Live Help International Copyright - All Rights Reserved //-->
<!--  BEGIN stardevelop.com Live Help Messenger Code - Copyright - NOT PERMITTED TO MODIFY COPYRIGHT LINE / LINK //-->
<a href="#" class="LiveHelpButton default"><img src="{$server}livehelp/include/status.php" id="LiveHelpStatusDefault" name="LiveHelpStatusDefault" border="0" alt="Live Help" class="LiveHelpStatus"/></a>
<!--  END stardevelop.com Live Help Messenger Code - Copyright - NOT PERMITTED TO MODIFY COPYRIGHT LINE / LINK //-->
END;

if ($_SERVER['SERVER_PORT'] == '443') {	$protocol = 'https://'; } else { $protocol = 'http://'; }
$server = str_replace(array('http://', 'https://'), '', $server);

$jscode = <<<END
<!-- stardevelop.com Live Help International Copyright - All Rights Reserved //-->
<!--  BEGIN stardevelop.com Live Help Messenger Code - Copyright - NOT PERMITTED TO MODIFY COPYRIGHT LINE / LINK //-->
<script type="text/javascript">
<!--
var LiveHelpSettings = {};
LiveHelpSettings.server = '{$server}';
LiveHelpSettings.embedded = true;
LiveHelpSettings.locale = '{$locale}';
LiveHelpSettings.plugin = 'WHMCS';
LiveHelpSettings.name = '{$name}';
LiveHelpSettings.custom = '{$userid}';
LiveHelpSettings.email = '{$email}';
(function(d, $, undefined) { 
	$(window).ready(function() {
		LiveHelpSettings.server = LiveHelpSettings.server.replace(/[a-z][a-z0-9+\-.]*:\/\/|\/livehelp\/*(\/|[a-z0-9\-._~%!$&'()*+,;=:@\/]*(?![a-z0-9\-._~%!$&'()*+,;=:@]))|\/*$/g, '');
		var LiveHelp = document.createElement('script'); LiveHelp.type = 'text/javascript'; LiveHelp.async = true;
		LiveHelp.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + LiveHelpSettings.server + '/livehelp/scripts/jquery.livehelp.js';
		var s = document.getElementsByTagName('script')[0];
		s.parentNode.insertBefore(LiveHelp, s);
	});
})(document, jQuery);
-->
</script>
<!--  END stardevelop.com Live Help Messenger Code - Copyright - NOT PERMITTED TO MODIFY COPYRIGHT LINE / LINK //-->
END;

   return array('livehelp'=>$code,'livehelpjs'=>$jscode);

}

add_hook('ClientAreaPage', 1 , 'hook_livehelpclientarea');

?>

Link to comment
Share on other sites

@jamched_11946

 

This may be happening if you are using J!WHMCS Integrator or Integrator 3.

 

If you are using J!WHMCS Integrator or Integrator 3, we are working to bring a patch out very quickly this afternoon.

 

You will need to have PHP version 5.3 on your server for the next release unfortunately - most probably do, but just in case...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated