zen cart 关于页面 title

页面 title 具体一些有助于 SEO 。

zc-v-1.39 的新闻插件所有的新闻title都是一样的。现在将其改为与新闻标题一致。

修改 include/modules/meta_tags.php

在 case 'page': 之前(大概在314行左右)添加:

  //---bof:get news title by xiang
  case 'news_article':
	//echo '<!--'.$_GET['article_id'].'-->';
	$sql = 'SELECT news_article_name from '. TABLE_NEWS_ARTICLES_TEXT . ' WHERE article_id = "' . $_GET['article_id'] . '" AND language_id = "' . (int)$_SESSION['languages_id'] . '"';
	$news_article = $db->Execute($sql);
        if ($news_article->EOF) {
          $meta_tags_over_ride = true; 
        } else {
			//echo '<!--'. $news_article->fields['news_article_name'] .'-->'; 
			define('META_TAG_TITLE','News: ' . $news_article->fields['news_article_name']);
		}
  break;  
  //---eof:get news title by xiang

 

完成。
--------------------------------2012 05 10-------------

  //---bof:get news title by xiang
  case 'news_article':
	//echo '<!--'.$_GET['article_id'].'-->';
	$sql = 'SELECT news_article_name, news_article_shorttext from '. TABLE_NEWS_ARTICLES_TEXT . ' WHERE article_id = "' . $_GET['article_id'] . '" AND language_id = "' . (int)$_SESSION['languages_id'] . '"';
	$news_article = $db->Execute($sql);
        if ($news_article->EOF) {
          $meta_tags_over_ride = true; 
        } else {
			//echo '<!--'. $news_article->fields['news_article_name'] .'-->'; 
			define('META_TAG_TITLE','News: ' . $news_article->fields['news_article_name']);
			define('META_TAG_KEYWORDS',str_replace('"','',STORE_NAME . ' News ' . $news_article->fields['news_article_name']));
			define('META_TAG_DESCRIPTION',str_replace('"','',STORE_NAME . ' News ' . $news_article->fields['news_article_shorttext']));
		}
  break;  
  //---eof:get news title by xiang
// EZ-Pages:

 

posted @ 2012-03-24 15:03  象牛  阅读(327)  评论(0编辑  收藏  举报