1、打开根目录中的.htaccess文件
查找代码:
RewriteRule ^(.*)-pri-([0-9]+).html$ index\.php?main_page=product_reviews_info&products_id=$2&%{QUERY_STRING} [L]
在其后加入以下代码:
RewriteRule ^(.*)-ezp-([0-9]+).html$ index\.php?main_page=page&id=$2&%{QUERY_STRING} [L]
2、打开includes\classes\seo.url.php
2.1、查找代码: 'info_manager_page_id' => '-i-',
在其后加入以下代码:
// EZ-Pages SEO support
'id' => '-ezp-',
2.2、查找代码:if ( $this->attributes['USE_SEO_CACHE_INFO_PAGES'] == 'true' && defined('TABLE_INFO_MANAGER')) $this->generate_info_manager_cache();
在其后加入以下代码:
if ( $this->attributes['USE_SEO_CACHE_EZ_PAGES'] == 'true' ) $this->generate_ezpages_cache();
2.3、查找代码:
case 'pID':
switch(true){
case ($page == FILENAME_POPUP_IMAGE):
$url = $this->make_url($page, $this->get_product_name($p2[1]), $p2[0], $p2[1], '.html', $separator);
break;
default:
$container[$p2[0]] = $p2[1];
break;
} # end switch
break;
在其后加入以下代码:
case 'id': // EZ-Pages
switch(true){
case ($page == FILENAME_EZPAGES):
$url = $this->make_url($page, $this->get_ezpages_name($p2[1]), $p2[0], $p2[1], '.html', $separator);
break;
default:
$container[$p2[0]] = $p2[1];
break;
} # end switch
break;
2.4、查找代码:function get_full_cPath($cID, &$original){
在其前面加入以下代码:
function get_ezpages_name($ezpID){
switch(true){
case ($this->attributes['USE_SEO_CACHE_GLOBAL'] == 'true' && defined('EZPAGES_NAME_' . $ezpID)):
$sql = "SELECT pages_title as ezpName
FROM ".TABLE_EZPAGES."
WHERE pages_id='".(int)$ezpID."'
LIMIT 1";
$result = $this->db->Execute($sql);
$ezpName = $this->strip($result->fields['ezpName']);
$return = $ezpName;
//$return = constant('EZPAGES_NAME_' . $ezpID);
$this->cache['EZPAGES'][$ezpID] = $return;
break;
case ($this->attributes['USE_SEO_CACHE_GLOBAL'] == 'true' && isset($this->cache['EZPAGES'][$ezpID])):
$sql = "SELECT pages_title as ezpName
FROM ".TABLE_EZPAGES."
WHERE pages_id='".(int)$ezpID."'
LIMIT 1";
$result = $this->db->Execute($sql);
$ezpName = $this->strip($result->fields['ezpName']);
$return = $ezpName;
//$return = $this->cache['EZPAGES'][$ezpID];
break;
default:
$sql = "SELECT pages_title as ezpName
FROM ".TABLE_EZPAGES."
WHERE pages_id='".(int)$ezpID."'
LIMIT 1";
$result = $this->db->Execute($sql);
$ezpName = $this->strip($result->fields['ezpName']);
$this->cache['EZPAGES'][$ezpID] = $ezpName;
$return = $ezpName;
break;
} # end switch
return $return;
}
2.5、查找代码: function generate_products_cache(){
在其前面加入以下代码:
function generate_ezpages_cache(){
$this->is_cached($this->cache_file . 'ezpages', $is_cached, $is_expired);
if ( !$is_cached || $is_expired ) {
$sql = "SELECT pages_id as id, pages_title as name
FROM ".TABLE_EZPAGES."
WHERE language_id = '".(int)$this->languages_id."'";
$ezpages = $this->db->Execute($sql);
$ezpages_cache = '';
while (!$ezpages->EOF) {
$define = 'define(\'EZPAGES_NAME_' . $ezpages->fields['id'] . '\', \'' . $this->strip($ezpages->fields['name']) . '\');';
$ezpages_cache .= $define . "\n";
eval("$define");
$product->MoveNext();
}
$this->save_cache($this->cache_file . 'ezpages', $ezpages_cache, 'EVAL', 1 , 1);
unset($ezpages_cache);
} else {
$this->get_cache($this->cache_file . 'ezpages');
}
}