技术标签: zen cart产品页面伪静态后-c-.html
Zencart 产品页面url的修改(二级分类_一级分类_所属分类_产品模型.html)
1,修改根目录下的.htaccess
RewriteRule ^(.*)_(.*).html$ index\.php?main_page=product_info&products_model=$2&%{QUERY_STRING} [L]
2,修改includes/ini_includes/init_category_path.php
if(zen_not_null($_GET['products_model'])){
$sql="select products_id from ". TABLE_PRODUCTS." where products_model='".$_GET['products_model']."'";
$pid= $db->Execute($sql);
$_GET['products_id']=$pid->fields['products_id'];
}
3,修改文件includes/classes/seo_url.php
case 'products_id':
switch(true) {
case ($page == FILENAME_PRODUCT_REVIEWS):
$url = $this->make_url($page, $this->get_product_name($p2[1]), 'products_id_review',$p2[1], '.html', $separator);
break;
case ($page == FILENAME_PRODUCT_REVIEWS_INFO):
$url = $this->make_url($page, $this->get_product_name($p2[1]), 'products_id_review_info', $p2[1], '.html', $separator);
break;
//
case ($page == FILENAME_PRODUCT_INFO && !$this->is_attribute_string($params)):
case ($page == FILENAME_PRODUCT_INFO):
case ($page == 'product_free_shipping_info'):
case ($page == 'product_music_info'):
case ($page == 'document_product_info'):
case ($page == 'document_general_info'):
default:
;
$url = $this->make_url($page, strtolower($this->get_product_cate_name($p2[1])).'_', '', strtolower($this->get_product_model($p2[1])), '.html', $separator);
break;
} # end switch
break;
添加下面函数:
//bof zhjhqk
function get_product_model($pID){
$sql="select products_model from ". TABLE_PRODUCTS." where products_id=".$pID;
$result = $this->db->Execute($sql, false, true, 43200);
$pModel = $this->strip($result->fields['products_model']);
return $pModel;
}
function get_product_cate_name($pID){
$sql="select master_categories_id from ".TABLE_PRODUCTS. " where products_id='".$pID."'";
$result = $this->db->Execute($sql, false, true, 43200);
$c_id = $this->strip($result->fields['master_categories_id']);
$path = array();
$this->get_zhjhqk_parent_categories_path($path, $c_id);
return $path[1].'_'.$path[0].'_'.$path[sizeof($path)-1];
}
function get_zhjhqk_parent_categories_path(&$path, $categories_id, &$cPath = array())
{
$sql = 'SELECT c.parent_id AS p_id, cd.categories_name AS name ' .
'FROM ' . TABLE_CATEGORIES . ' c ' .
'LEFT JOIN ' . TABLE_CATEGORIES_DESCRIPTION . ' cd ' .
'ON c.categories_id=cd.categories_id ' .
'AND cd.language_id=\'' . (int)$this->languages_id . '\'' .
'WHERE c.categories_id=\'' . (int)$categories_id . '\'';
$parent = $this->db->Execute($sql, false, true, 43200);
while (!$parent->EOF) {
// Recurse if the parent id is not empty or equal the passed categories id
if ($parent->fields['p_id'] != 0 && $parent->fields['p_id'] != $categories_id) {
$this->get_zhjhqk_parent_categories_path($path, $parent->fields['p_id'], $cPath);
}
// Add category id to cPath and name to path
$cPath[sizeof($cPath)] = $categories_id;
$path[sizeof($path)] = $this->strip($parent->fields['name']);
$parent->MoveNext();
}
}
//eof zhjhqk
p = open('python1.csv','wb')注意后面‘wb’,没有这个关键字就会提示错误!!!
我刚刚开始学习面向对象编程的概念,并将一个用于连接数据库,选择数据库和关闭数据库连接的类组合在一起.到目前为止,除了关闭与数据库的连接外,一切似乎都没问题.class Database {private $host, $username, $password;public function __construct($ihost, $iusername, $ipassword){$this->..._oop数据库
点一下PC/Mac搞定_小米键盘mac模式切换
用MHz来衡量计算机的性能,它指的是计算机的【CPU的时钟主频】,时钟频率是指同步电路中时钟的基础频率,它以【若干次周期每秒】来度量,量度单位采用【赫兹】,相应的单位有:Hz【赫兹】、kHz【千赫兹】、MHz【兆赫兹】、GHz【吉赫兹】。本文操作环境:Windows7系统,Dell G3电脑。相关推荐:《编程视频》用MHz来衡量计算机的性能,它指的是计算机的“CPU的时钟主频”。时钟频率(又译:时..._计算机中时钟主频怎么用数字表达
首先将tomcat注册为服务,修改配置文件,打开D:\apache-tomcat-7.0.68\bin目录下的service.bat文件,修改下面图片中红框中的值,这是service注册名称跟显示名称,一般使用默认值打开命令窗口,到D:\apache-tomcat-7.0.68\bin目录下,运行service.bat install 注册名称,如下图所示然后再cmd中出入servic...
对于一个网站开发者而言,在经历了艰难的开发过程后,要将网站推向给用户,必须要做的一步便是部署我们的web应用,这样广大的用户才能成功访问我们的网站。目前主流的部署平台都是基于Linux的。本文将详细讲解使用Linux搭建web服务器的过程。搭建成功之后,可以通过网址:www.zhougb3.cn访问我的个人博客主页。1.准备工作为了让用户都可以访问我们的网站,我们需要有一台可以通过外网访问的服务器,这里选用的是腾讯云的服务器,安装的是Ubuntu16.04的系统。这里我们同时注册了域名,这样子用户就_liunx使用web服务使用虚拟容器技术搭建虚拟网站
连接池配置文件db.properties是java中采用数据库连接池技术完成应用对数据库的操作的配置文件信息的文件。具体配置项目如下:drivers=com.microsoft.sqlserver.jdbc.SQLServerDriver 注册驱动,sqlsever,oracle,mysql都行logfile=d:\\log.txt 日志文件的位置customer_system.url..._db.properties的作用
精确路径url地址必须是/others才能调用servlet<url-pattern>/others</url-pattern>通配符url地址/others/任意路径。<url-pattern>/others/*</url-pattern>全局路径任意的url路径都可以调用servlet。<url-pattern>/..._配置servlet 中/后面写啥
金字塔内部的结构文章中的思想应组成单一思想统领下的金字塔结构,如下图所示:这样的文章总是自金字塔的顶端开始,自上而下地沿着各个分支将作者的思想逐一呈现。但大多数人在准备坐下来开始写作的时候,可能对自己想表达的思想只有模糊的想法,甚至根本不知道从哪里下笔,因此不要幻想一坐下来就开始将思想组织成金字塔。你必须梳理你要表达的思想。金字塔的子结构可以帮助我们加快梳理思想
使用PyCharm,在import mathplotlib时提示没有mathplotlib,因此安装安装后报错:ValueError: check_hostname requires server_hostname具体错误信息如下:解决方法:关闭网络代理_faiss.from_texts valueerror: check_hostname requires server_hostname
http://www.iyoya.com/2012/06/27/upgrade-flash-builder-flashplayer-version.htmlAdobe自发布Flash Builder 4.6后,就暂停了Flash Builder新版本的发布。但AIR和FlashPlayer版本仍然保持不断的更新。在下载新的AIRSDK并覆盖到Flash Builder 4.6 sdks目录
题目:有n盏灯,编号1~n.第1个人把所有灯打开,第2个人按下所有编号为2的倍数的开关(这些灯将被关掉),第3个人按下所有编号为3的倍数的开关(其中关掉的灯将被打开,开着的灯将被关闭),依次类推。一共有k个人,问最后有哪些灯开着?输入n和k,输出开着的灯编号。k样例输入:7 3样例输出:1 5 6 7 代码如下:#include #include #define MAX