zencart 新闻模块的标题,关键字更改

看看下载的新闻模块安装包,里面可选安装中,\includes\modules\meta_tags.php 里有实现方法。下面这段代码要加到你现有的 meta_tags.php 文件中

代码: 全选
//// Dynamic titles for news pages
// BOF
case 'news':
if (isset($_GET['date']) && zen_not_null($_GET['date'])) {
define('META_TAG_TITLE', (defined('NAVBAR_TITLE') ? NAVBAR_TITLE . SECONDARY_SECTION : '') . zen_date_long($date) . PRIMARY_SECTION . TITLE . TAGLINE);
} else {
define('META_TAG_TITLE', (defined('NAVBAR_TITLE') ? NAVBAR_TITLE . PRIMARY_SECTION : '') . TITLE . TAGLINE);
}
define(‘META_TAG_DESCRIPTION’, TITLE . PRIMARY_SECTION . NAVBAR_TITLE . SECONDARY_SECTION . KEYWORDS);
define(‘META_TAG_KEYWORDS’, KEYWORDS . ‘ ‘ . NAVBAR_TITLE);
break;case ‘news_article’:
define(‘META_TAG_TITLE’, (defined(‘NAVBAR_TITLE’) ? NAVBAR_TITLE . SECONDARY_SECTION : ”) . $article->fields[‘news_article_name’] . PRIMARY_SECTION . TITLE . TAGLINE);
define(‘META_TAG_DESCRIPTION’, TITLE . PRIMARY_SECTION . NAVBAR_TITLE . SECONDARY_SECTION . KEYWORDS);
define(‘META_TAG_KEYWORDS’, KEYWORDS . ‘ ‘ . NAVBAR_TITLE);
break;case ‘news_comments’:
define(‘META_TAG_TITLE’, (defined(‘NAVBAR_TITLE’) ? NAVBAR_TITLE . SECONDARY_SECTION : ”) . $article->fields[‘news_article_name’] . SECONDARY_SECTION . NAVBAR_TITLE_COMMENTS . PRIMARY_SECTION . TITLE . TAGLINE);
define(‘META_TAG_DESCRIPTION’, TITLE . PRIMARY_SECTION . NAVBAR_TITLE . SECONDARY_SECTION . KEYWORDS);
define(‘META_TAG_KEYWORDS’, KEYWORDS . ‘ ‘ . NAVBAR_TITLE);
break;

case ‘news_archive’:
define(‘META_TAG_TITLE’, (defined(‘NAVBAR_TITLE’) ? NAVBAR_TITLE . SECONDARY_SECTION : ”) . news_date_archive($archive_date) . PRIMARY_SECTION . TITLE . TAGLINE);
define(‘META_TAG_DESCRIPTION’, TITLE . PRIMARY_SECTION . NAVBAR_TITLE . SECONDARY_SECTION . KEYWORDS);
define(‘META_TAG_KEYWORDS’, KEYWORDS . ‘ ‘ . NAVBAR_TITLE);
break;
// EOF
//// Dynamic titles for news pages

以上代码添加到下面代码的前面:

default:
    define('META_TAG_TITLE', (defined('NAVBAR_TITLE') ? NAVBAR_TITLE . PRIMARY_SECTION : '') . TITLE . TAGLINE);
    define('META_TAG_DESCRIPTION', TITLE . PRIMARY_SECTION . NAVBAR_TITLE . SECONDARY_SECTION . KEYWORDS);
    define('META_TAG_KEYWORDS', KEYWORDS . ' ' . NAVBAR_TITLE);




This entry was posted in zen-cart.

发表评论

无觅相关文章插件,快速提升流量