星光大道今天怎么了:开源社区 osCommerce phpnuke php mysql

来源:百度文库 编辑:偶看新闻 时间:2024/05/03 13:41:13
osCommerce: 为osCommerce区块(box)相应项添加网页  概括介绍:

osCommerce增加附加的box页面使店主能在不同的区块(boxes)中更灵活地添加新的网页链接。上一次我介绍了如何添加新的区块和在原区块中添加新的网页链接,但只添加链接没有新的页面与之对应,还是不能工作的,这一次我来说说如何建立区块新添加链接所对应的网页,让其工作起来。详细过程如下:

osCommerce添加 Box Pages

为默认box中添加的新项添加新网页或为新增osCommerce 区块box中相应项添加网页 ,将使你很容易为你的网站添加新的内容. 将用 includes/boxes/information.php box作为示例.

下面5个文件必须要修改。这些文件将用于产生新box或显示一个框。

文件列表如下:

catalog/shipping.php
catalog/includes/filenames.php
catalog/includes/languages/english.php
catalog/includes/languages/english/shipping.php
catalog/includes/boxes/information.php

打开 catalog/shipping.php 页面并用另外一个文件名保存,例如,about_us.php.

在新的 about_us.php 文件中,你仅需要修改下面require$breadcrumb 中文件名修改为你的新文件 ABOUT_US .

/*
$Id: about_us.php,v 1.21 2003/02/13 04:23:23 hpdl Exp $
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2003 osCommerce
Released under the GNU General Public License
*/
require('includes/application_top.php');
require(
DIR_WS_LANGUAGES . $language . '/' . FILENAME_ABOUT_US );
$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_ABOUT_US ));

接下来用 define 定义名为 about_us.php 文件名常量。因此在catalog/includes/filenames.php中复制一个defines,并粘贴在文件的最后(在?>前),并将其修改成下面代码:
define('FILENAME_ABOUT_US', 'about_us.php');

在catalog/includes/languages/english.php文件中添加将在box中显示的常量定义,如下面最后一行:

// information box text in includes/boxes/information.php
define('BOX_HEADING_INFORMATION', 'Information');
define('BOX_INFORMATION_PRIVACY', 'Privacy Notice');
define('BOX_INFORMATION_CONDITIONS', 'Conditions of Use');
define('BOX_INFORMATION_SHIPPING', 'Shipping & Returns');
define('BOX_INFORMATION_CONTACT', 'Contact Us');
define('BOX_INFORMATION_ABOUT_US', 'About Us');

在catalog/includes/languages/english/和其他语言目录下,打开shipping.php文件,另存为about_us.php,并将内容修改如下:


/*
$Id: about_us.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', 'About Us');
define('HEADING_TITLE', 'About Us');
define('TEXT_INFORMATION', 'YOUR ABOUT US TEXT GOES HERE');
?>

将新定义的about_us.php添加到catalog/includes/boxes/information.php中或其他新box中。代码如下:


'' . BOX_INFORMATION_SHIPPING . '
' .
'' . BOX_INFORMATION_PRIVACY . '
' .
'' . BOX_INFORMATION_CONDITIONS . '
' .
'' . BOX_INFORMATION_CONTACT . '
' .
'' . BOX_INFORMATION_ABOUT_US . ''
);

在information.php文件中,你还可以修改其排列顺序,但必须要注意 '')'
'
标记不要弄错。