朱军 毕福剑:开源社区 osCommerce phpnuke php mysql

来源:百度文库 编辑:偶看新闻 时间:2024/05/02 08:46:42

概括介绍:

可以为左右两边区块添加图片,每个区块图片可以相同,也可以不同。



解决办法

  • 标题文本替换法
  • 使用层叠样式表法(Cascading Style Sheets)
  •  标题文本替换法

最简单的方法是用图片将标题文本替换掉.

可以通过修改语言目录includes/languages/中的语言文件,如:includes/languages/english.php文件。

修改商品分类区块标题图片, 标题 BOX_HEADING_CATEGORIES 定义需要修改如下:

define('BOX_HEADING_CATEGORIES', 'Categories');

 修改为:

define('BOX_HEADING_CATEGORIES', '');

  • 使用层叠样式表法(Cascading Style Sheets)

更高级一种方法是使用CSS定义为每一个要显示图片的区块(box)单独定义。

下面的例子集中在分类区块(Categories box)中,需要以下三个文件进行修改:

includes/classes/boxes.php
includes/boxes/categories.php
stylesheet.css

下面代码要添加到includes/classes/boxes.php文件未尾,最后?>标记前。

class infoBoxHeadingCategories extends tableBox {
function infoBoxHeadingCategories($contents) {
$this->table_cellpadding = '0';

$info_box_contents = array();
$info_box_contents[] = array(array('params' => 'width="100%" class="infoBoxHeadingCategories"',
'text' => $contents[0]['text']));

$this->tableBox($info_box_contents, true);
}
}

 
The code above creates a new class called infoBoxHeadingCategories which will be used in the Categories box.
当分类区块(Categories box)被使用时,上面代码产生一个新类 infoBoxHeadingCategorie。

在 includes/boxes/categories.php文件中下面的代码:

new infoBoxHeading($info_box_contents, true, false);

 必须修改为:

new infoBoxHeadingCategories($info_box_contents, true, false);

当新的类 infoBoxHeadingCategories在一个新的风格页(stylesheet)中定义时,下面代码必须要添加到 stylesheet.css文件中:

TD.infoBoxHeadingCategories {
background: #33c3d3;
background-image: url('images/some_graphic.gif');
background-repeat: no-repeat;
}

新的风格页通过css styles 可以进行字体,字大小,空间大小,等设置.