一个SEO修改ECSHOP的方法

2016-07-07 15:00 来源:www.chinab4c.com 作者:ecshop专家

includes\lib_main.php134行,以下代码
/* 初始化“页面题目”和“当前地位” */

$page_title = $GLOBALS['_CFG']['shop_title'];

$ur_here = '<a href=".">' . $GLOBALS['_LANG']['home'] . '</a>';



/* 依据文件名分别解决中间的局部 */

if ($filename != 'index')

{

/* 解决有分类的 */

if (in_array($filename, array('category', 'goods', 'article_cat', 'article', 'brAnd')))

{

/* 商品分类或商品 */

if ('category' == $filename || 'goods' == $filename || 'brAnd' == $filename)

{

if ($cat > 0)

{

$cat_arr = get_parent_cats($cat);



$key= 'cid';

$type = 'category';

}

else

{

$cat_arr = array();

}

}

/* 文章分类或文章 */

elseif ('article_cat' == $filename || 'article' == $filename)

{

if ($cat > 0)

{

$cat_arr = get_article_parent_cats($cat);



$key= 'acid';

$type = 'article_cat';

}

else

{

$cat_arr = array();

}

}



/* 循环分类 */

if (!empty($cat_arr))

{

krsort($cat_arr);

foreach ($cat_arr AS $val)

{

$page_title = htmlspecialchars($val['cat_name']) . '_' . $page_title;

$args = array($key => $val['cat_id']);

$ur_here .= ' <code>&gt;</code> <a href="' . build_uri($type, $args, $val['cat_name']) . '">' .

htmlspecialchars($val['cat_name']) . '</a>';

}

}

}

/* 解决无分类的 */

else

{

/* 团购 */

if ('group_buy' == $filename)

{

$page_title = $GLOBALS['_LANG']['group_buy_goods'] . '_' . $page_title;

$args = array('gbid' => '0');

$ur_here .= ' <code>&gt;</code> <a href="group_buy.php">' .

$GLOBALS['_LANG']['group_buy_goods'] . '</a>';

}

/* 拍卖 */

elseif ('auction' == $filename)

{

$page_title = $GLOBALS['_LANG']['auction'] . '_' . $page_title;

$args = array('auid' => '0');

$ur_here .= ' <code>&gt;</code> <a href="auction.php">' .

$GLOBALS['_LANG']['auction'] . '</a>';

}

/* 批发 */

elseif ('wholesale' == $filename)

{

$page_title = $GLOBALS['_LANG']['wholesale'] . '_' . $page_title;

$args = array('wsid' => '0');

$ur_here .= ' <code>&gt;</code> <a href="wholesale.php">' .

$GLOBALS['_LANG']['wholesale'] . '</a>';

}

/* 其余的在这里弥补 */

}

}


修正为:
/* 初始化“页面题目”和“当前地位” */

$page_title = '';

$ur_here = '<a href=".">' . $GLOBALS['_LANG']['home'] . '</a>';

/* 依据文件名分别解决中间的局部 */

if ($filename != 'index')

{

/* 解决有分类的 */

if (in_array($filename, array('category', 'goods', 'article_cat', 'article', 'brAnd')))

{

/* 商品分类或商品 */

if ('category' == $filename || 'goods' == $filename || 'brAnd' == $filename)

{

if ($cat > 0)

{

$cat_arr = get_parent_cats($cat);

$key= 'cid';

$type = 'category';

}

else

{

$cat_arr = array();

}

}

/* 文章分类或文章 */

elseif ('article_cat' == $filename || 'article' == $filename)

{

if ($cat > 0)

{

$cat_arr = get_article_parent_cats($cat);

$key= 'acid';

$type = 'article_cat';

}

else

{

$cat_arr = array();

}

}

/* 循环分类 */

if (!empty($cat_arr))

{

krsort($cat_arr);

foreach ($cat_arr AS $val)

{

$page_title = htmlspecialchars($val['cat_name']) . '_' . $page_title;

$args = array($key => $val['cat_id']);

$ur_here .= ' <code>&gt;</code> <a href="' . build_uri($type, $args, $val['cat_name']) . '">' .

htmlspecialchars($val['cat_name']) . '</a>';

}

}

}

/* 解决无分类的 */

else

{

/* 团购 */

if ('group_buy' == $filename)

{

$page_title = $GLOBALS['_LANG']['group_buy_goods'] . '_' . $page_title;

$args = array('gbid' => '0');

$ur_here .= ' <code>&gt;</code> <a href="group_buy.php">' .

$GLOBALS['_LANG']['group_buy_goods'] . '</a>';

}

/* 拍卖 */

elseif ('auction' == $filename)

{

$page_title = $GLOBALS['_LANG']['auction'] . '_' . $page_title;

$args = array('auid' => '0');

$ur_here .= ' <code>&gt;</code> <a href="auction.php">' .

$GLOBALS['_LANG']['auction'] . '</a>';

}

/* 批发 */

elseif ('wholesale' == $filename)

{

$page_title = $GLOBALS['_LANG']['wholesale'] . '_' . $page_title;

$args = array('wsid' => '0');

$ur_here .= ' <code>&gt;</code> <a href="wholesale.php">' .

$GLOBALS['_LANG']['wholesale'] . '</a>';

}

/* 其余的在这里弥补 */

}

}

else

{

$page_title = $GLOBALS['_CFG']['shop_title'];

}

回答:
太好了,顶一下

帮顶一下

顶你,谢谢

谢谢呵呵,这都是我慢慢总结出来的

请问一下楼主你的网站地图是什么什么工具生成的,能给个下载地址吗,谢谢了,我在网站找了几个都不好用

记录.......

还真没明白你要做什么