Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Please Help... How To Call Javascript From Box


aresman

Recommended Posts

Okay, so we have multiple sites that use a live chat feature. The feature works by incorporating javascript into the page at some defined place and adding the "online" or "offline" image - depending on which is which.

 

Well, I thought incorporating this into a box would be easy, just change the text area to the script - but no such luck.

 

Does anyone have any suggestions on what I need to do to make this work?

 

Here's the box text that I thought would work, but instead halts my site.

 

<?php
/*
?$Id: reviews.php,v 1.37 2003/06/09 22:20:28 hpdl Exp $

?osCommerce, Open Source E-Commerce Solutions
?http://www.oscommerce.com

?Copyright (c) 2003 osCommerce

?Released under the GNU General Public License
*/
?>
<!-- warrantyregistration //-->
? ? ? ? ?<tr>
? ? ? ? ? ?<td>
<?php
?$info_box_contents = array();
?$info_box_contents[] = array('text' => 'Chat Live');

?new infoBoxHeading($info_box_contents, false, false);

?$info_box_contents = array();
?$info_box_contents[] = array('text' => '<!-- BEGIN PHP Live! code, (c) OSI Codes Inc. -->
<script language="JavaScript" src="http://www.mysite.com/phplive/js/status_image.php?base_url=http://www.mysite.com/phplive&l=mysitename&x=1&deptid=0&btn=1"><a href="http://www.phplivesupport.com"></a></script>
<!-- END PHP Live! code : (c) OSI Codes Inc. --><br>');

?new infoBox($info_box_contents);
?>

 

And here is the code I inserted into the sts_user_code as instructed:

 

// Live Chat Box
$sts_block_name = 'livechat';
require(STS_START_CAPTURE);
require(DIR_WS_BOXES . 'livchat.php');
require(STS_STOP_CAPTURE);
$template['livechat'] = strip_unwanted_tags($sts_block['livechat'], 'livechat');

 

Thank you.

 

Nick

Edited by aresman
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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.

×
×
  • Create New...