Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Using the tep_href_link on info pages


Guest

Recommended Posts

The Problem

I found out that adding a tep_href_link will not work when used in the text area of an info page such as privacy, shipping, etc. Only the href function can be used and that does not hold the osCsid. This can cause problems when you want to add additional info pages below the main page linked together in a "tree" format.

 

The Fix

In a page such as catalog/privacy.php find the lines;

 

<tr>
<td class="main"><?php echo TEXT_MESSAGE; ?></td>
</tr>

 

And change to;

 

<tr>
<td class="main"><?php include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRIVACY_TEXT); ?></td>
</tr>

 

In languages/english/privacy.php change the file to (remove the rest of the file);

 

<?php
/*
 $Id: privacy.php,v 1.4 2002/11/19 01:48:08 dgw_ Exp $

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

 Copyright (c) 2002 osCommerce

 Released under the GNU General Public License
*/

define('NAVBAR_TITLE', 'Privacy');
define('HEADING_TITLE', 'Privacy');
?>

 

Create a new file called languages/english/privacy_text.php. In this file you have only the text for the page, such as;

 

Put your privacy text here
<TABLE cellSpacing=1 cellPadding=2 width="100%" border=0>
<TBODY>
<TR>
<TD class="main"><P align="center"><a href="<?php echo tep_href_link(FILENAME_PRIVACY1); ?>"><img src="images/privacy1.gif" alt="Privacy" width="80" height="15" border="0"></a></TD>
<TD class="main"><P align="center"><a href="<?php echo tep_href_link(FILENAME_PRIVACY2); ?>"><img src="images/privacy2.gif" alt="Privacy" width="80" height="15" border="0"></a></TD>
<TD class="main"><P align="center"><a href="<?php echo tep_href_link(FILENAME_PRIVACY3); ?>"><img src="images/privacy3.gif" alt="Privacy" width="80" height="15" border="0"></a></TD>
<TD class="main"><P align="center"><a href="<?php echo tep_href_link(FILENAME_PRIVACY4); ?>"><img src="images/privacy4.gif" alt="Privacy" width="80" height="15" border="0"></a></TD>
<TD class="main"></TD></TR></TBODY></TABLE>

 

Last step is to include the new file in includes/filenames.php

 

define('FILENAME_PRIVACY_TEXT', 'privacy_text.php');

 

This uses the same logic as Mattice's define mainpage contribution.

Link to comment
Share on other sites

What you suggest works, I'm sure, but there's no reason you can't use tep_href_link in the body of the define for the privacy, etc. text. It's just an expression that is substituted and can include function calls.

Link to comment
Share on other sites

The href function works perfectly but for some reason the tep_href_link does not work, it produces bad URL's or error messages. This was the only way I could get it to work.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...