Zen Cart Logo
Forums / Addon Sideboxes / blank_sidebox mod define, how to put in HTML??

blank_sidebox mod define, how to put in HTML??

Locked

Views: 1,423

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
28 Oct 2008, 4:33 PM
#1
tlyczko avatar

tlyczko

Zen Follower

Join Date:
Dec 2003
Location:
UPstate NY
Posts:
398
Plugin Contributions:
1

blank_sidebox mod define, how to put in HTML??

I am working with the current version of the blank_sidebox mod, and I have in the *defines.php the following:

<?php /** * blank sidebox definitions - text for inclusion in a new blank sidebox * * @package templateSystem * @copyright 2007 Kuroi Web Design * @copyright Portions Copyright 2003-2007 Zen Cart Development Team * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * @version $Id: blank_sidebox.php 2007-05-26 kuroi $ * // 10/28/08 modified by tom lyczko */ define('BOX_HEADING_SSL_BOX', 'SSL / Credit Cards'); define('TEXT_SSL_BOX','<div class="centered"><a href="http://www.instantssl.com" target="_blank" title="Essex Industries' SSL certificate provider."><img src="includes/templates/crhei2/images/secure_site.gif" alt="Essex Industries' SSL certificate provider." border="0" height="85" width="100"></a><br /><br /><img src="includes/templates/crhei2/images/mc_accpt_023_gif.gif" title="We accept MasterCard." alt="We accept MasterCard." border="0" height="23" width="37"> <img src="includes/templates/crhei2/images/visa1_37x23_a.gif" title="We accept Visa." alt="We accept Visa." border="0" height="23" width="37"></div>'); ?>

I keep getting a syntax error unexpected T_STRING for the TEXT_SSL_BOX constant.

What is the correct way to include valid html code into a PHP constant??

I tried escaping all the double quotes with \ but that did not fix it.

Could not find anything on Google about the proper way to put html code into a PHP constant.

BTW I am taking blank_sidebox and renaming everything to ssl_box.

Thank you, Tom

28 Oct 2008, 5:02 PM
#2
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: blank_sidebox mod define, how to put in HTML??

The HTML string you are using has single quotes (') in it, which are interpreted by PHP as terminating the string. You need to escape those with a backslash ' so they are seen correctly as part of the text string.

28 Oct 2008, 5:20 PM
#3
tlyczko avatar

tlyczko

Zen Follower

Join Date:
Dec 2003
Location:
UPstate NY
Posts:
398
Plugin Contributions:
1

Re: blank_sidebox mod define, how to put in HTML??

I escaped the single quotes before and after the div tags and I'll see what happens.

Thank you, Tom

28 Oct 2008, 5:39 PM
#4
tlyczko avatar

tlyczko

Zen Follower

Join Date:
Dec 2003
Location:
UPstate NY
Posts:
398
Plugin Contributions:
1

Re: blank_sidebox mod define, how to put in HTML??

This did not really work -- the new sidebox etc. installs properly, but then the test site does not display at all!! :(

Thank you, Tom

28 Oct 2008, 5:45 PM
#5
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: blank_sidebox mod define, how to put in HTML??

The quotes before and after the <div> tags are the ones that are supposed to be there. This is causing the problem:
alt="Essex Industries' SSL certificate provider."
Make it
alt="Essex Industries' SSL certificate provider."

Check for all such instances inside the text string.

28 Oct 2008, 5:56 PM
#6
tlyczko avatar

tlyczko

Zen Follower

Join Date:
Dec 2003
Location:
UPstate NY
Posts:
398
Plugin Contributions:
1

Re: blank_sidebox mod define, how to put in HTML??

gjh42:

alt="Essex Industries' SSL certificate provider."
Make it
alt="Essex Industries' SSL certificate provider."

OIC!!! :) :) :)

You are a genius, I completely missed those. :thumbsup: :clap:

Thank you, Tom