Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Help! Trying to add a new box


Recommended Posts

Posted

I am trying to add a new box in the right column.

I have created a box called links.php with the following code:

<?php
/*
 $Id: information.php,v 1.6 2003/02/10 22:31:00 hpdl Exp $

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

 Copyright (c) 2003 osCommerce

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

 new infoBoxHeading($info_box_contents, false, false);

 $info_box_contents = array();
 $info_box_contents[] = array('text' => '<a href="http://thevampireslair.com" target="_blank">The Vampire's Lair</a><br>' .
						 '<a href="http://trans-illusions.com" target="_blank">Transcendent Illusions</a><br>' .
						 '<a href="http://www.cafepress.com/bluedrag" target="_blank">Vampire's Lair Gift Shop</a><br>' .
						 '<a href="http://www.cafepress.com/duvessa_estate" target="_blank">Duvessa Estate Gift Shoppe</a><br>');

 new infoBox($info_box_contents);
?>
		</td>
	  </tr>
<!-- information_eof //-->

 

I edited column_right.php to read:

  if (substr(basename($PHP_SELF), 0, 8) != 'checkout') {
include(DIR_WS_BOXES . 'links.php');
include(DIR_WS_BOXES . 'languages.php');
include(DIR_WS_BOXES . 'currencies.php');
 }
?>

When I look at my store I see this at the top of the right column:

Parse error: parse error, unexpected T_STRING, expecting ')' in /var/www/myservernamehere/catalog/includes/boxes/links.php on line 23

 

What am I doing wrong? Am I supposed to edit other files, or am I just doing the code wrong? I'm a newbie when it comes to PHP, so I'm figuring this out through trial & error.

DELETE MY ACCOUNT NOW

Posted

I also tried adding

// links box text in includes/boxes/links.php
define('BOX_HEADING_LINKS', 'Links');

to catalog/includes/languages/english.php, and that didn't help either

I'm guessing there is some kind of error in the way I did links.php, and I have a feeling it's in the last line

 '<a href="http://www.cafepress.com/duvessa_estate" target="_blank">Duvessa Estate Gift Shoppe</a>');

but I could be wrong. Is it because the box doesn't contain any pages, just links? I know I can add links to an existing infobox, so I figured I could make an infobox with nothing but links.

DELETE MY ACCOUNT NOW

Posted
A links page is an info page. You can use this excellent contribution for adding unlimited info pages via the Admin Tool:

 

http://www.oscommerce.com/community/contributions,1026

 

I downloaded that just in case, but I'm not trying to create a links PAGE, I'm just trying to make an infobox with some off-store links in it.

DELETE MY ACCOUNT NOW

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...