Jump to content

Recommended Posts

Hello

Need some help please with this file. I am geting the error (T_CONSTANT_ENCAPSED_STRING) on the following line below. I know it has to due with escaping, but I can not seem to be able to place (\) in the correct postitions.

 

$data = '<div><script type="text/javascript">document.write('<scr');document.write('ipt type="text/javascript" data-ppmnid="43423" src="//ad.where.com/jin/spotlight/ads?pubid=05693f&format=js&v=2.4&placementtype=120x240&ppmnid=43423&rand=' + Math.round(Math.random() * 100000000000000) + '">');document.write('</scr' + 'ipt>');</script></div>';

 

Original File:

<?php
/*
$Id$
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2010 osCommerce
Released under the GNU General Public License
*/
class bm_paypal {
var $code = 'bm_paypal';
var $group = 'boxes';
var $title;
var $description;
var $sort_order;
var $enabled = false;
function bm_paypal() {
 $this->title = MODULE_BOXES_PAYPAL_TITLE;
 $this->description = MODULE_BOXES_PAYPAL_DESCRIPTION;
 if ( defined('MODULE_BOXES_PAYPAL_STATUS') ) {
 $this->sort_order = MODULE_BOXES_PAYPAL_SORT_ORDER;
 $this->enabled = (MODULE_BOXES_PAYPAL_STATUS == 'True');
 $this->group = ((MODULE_BOXES_PAYPAL_CONTENT_PLACEMENT == 'Left Column') ? 'boxes_column_left' : 'boxes_column_right');
 }
}
// BOF MTS
function dataF() {
 $data = '<div><script type="text/javascript">document.write('<scr');document.write('ipt type="text/javascript" data-ppmnid="43423" src="//ad.where.com/jin/spotlight/ads?pubid=05693f&format=js&v=2.4&placementtype=120x240&ppmnid=43423&rand=' + Math.round(Math.random() * 100000000000000) + '">');document.write('</scr' + 'ipt>');</script></div>';

 return $data;
}
function execute() {
 global $oscTemplate;
 $oscTemplate->addBlock($this->dataF(), $this->group);
}
// EOF MTS
function isEnabled() {
 return $this->enabled;
}
function check() {
 return defined('MODULE_BOXES_PAYPAL_STATUS');
}
function install() {
 tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable paypal Module', 'MODULE_BOXES_PAYPAL_STATUS', 'True', 'Do you want to add the module to your shop?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
 tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Placement', 'MODULE_BOXES_PAYPAL_CONTENT_PLACEMENT', 'Left Column', 'Should the module be loaded in the left or right column?', '6', '1', 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', now())");
 tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_BOXES_PAYPAL_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
}
function remove() {
 tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
}
function keys() {
 return array('MODULE_BOXES_PAYPAL_STATUS', 'MODULE_BOXES_PAYPAL_CONTENT_PLACEMENT', 'MODULE_BOXES_PAYPAL_SORT_ORDER');
}
}
?>

 

Thanks JR

Link to comment
https://forums.phpfreaks.com/topic/269741-help-with-t_constant_encapsed_string/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.