Authored by hf

code review by fei.hong: do modify pc home page boys code

... ... @@ -401,7 +401,7 @@ class WebAction extends Controller_Abstract
* @param bool $showMore 是否显示更多内容
* @return void
*/
protected function setTitle($title, $showMore = true, $sign = ' | ')
protected function setTitle($title, $showMore = false, $sign = '')
{
$this->_view->assign('title_more', $showMore);
$this->_view->assign('title', $title . $sign);
... ... @@ -411,22 +411,25 @@ class WebAction extends Controller_Abstract
* 设置网站SEO的关键词
*
* @param string $keywords 关键词,多个之间用","逗号分隔
* @param bool $showMore 是否显示更多内容
* @param string $sign 连接的字符串
* @return void
*/
protected function setKeywords($keywords)
protected function setKeywords($keywords, $showMore = false, $sign = '')
{
$this->_view->assign('keywords', rtrim($keywords, ',') . ',');
$this->_view->assign('keywords_more', $showMore);
$this->_view->assign('keywords', rtrim($keywords, ',') . $sign);
}
/**
* 设置网站SEO的描述内容
*
* @param string $description 描述内容
* @param string $sign 连接的字符串
* @param bool $showMore 是否显示更多内容
* @param string $sign 连接的字符串
* @return void
*/
protected function setDescription($description, $showMore = true, $sign = ' ')
protected function setDescription($description, $showMore = false, $sign = '')
{
$this->_view->assign('description_more', $showMore);
$this->_view->assign('description', $description . $sign);
... ...
... ... @@ -130,9 +130,9 @@ class TemplateLayout implements View_Interface
} elseif (!isset($tpl_vars['title'])) {
$tpl_vars['title'] = $config->seo->title;
}
if (isset($tpl_vars['keywords'])) {
if (!empty($tpl_vars['keywords_more'])) {
$tpl_vars['keywords'] .= $config->seo->keywords;
} else {
} elseif (!isset($tpl_vars['keywords'])) {
$tpl_vars['keywords'] = $config->seo->keywords;
}
if (!empty($tpl_vars['description_more'])) {
... ...
... ... @@ -14,33 +14,24 @@ class IndexController extends WebAction
*/
public function indexAction()
{
if (isset($_COOKIE['_Channel'])) {
$this->setCookie('_Channel', '');
if (null !== $this->get('go')) {
// 先检查COOKIE是否有访问过, 有则跳转到相应的频道页
HomeModel::goSwitchChannel();
} else {
// 设置客户端浏览器1分钟内不改变
$this->setLastModified(mktime(date('H'), date('i'), 0, date('n'), date('j'), date('Y')));
// 设置浏览器缓存1分钟
$this->setExpires(60);
}
if (isset($_COOKIE['_Gender'])) {
$this->setCookie('_Gender', '');
}
$this->go('http://www.yohobuy.com');
// if (null !== $this->get('go')) {
// // 先检查COOKIE是否有访问过, 有则跳转到相应的频道页
// HomeModel::goSwitchChannel();
// } else {
// // 设置客户端浏览器1分钟内不改变
// $this->setLastModified(mktime(date('H'), date('i'), 0, date('n'), date('j'), date('Y')));
// // 设置浏览器缓存1分钟
// $this->setExpires(60);
// }
//
// // 传递模板数据,渲染模板
// $this->setWebNavHeader(HomeModel::COOKIE_NAME_BOYS);
// $data = array(
// 'boysHomePage' => true,
// 'footerTop'=> true,
// 'boys' => HomeModel::getChannelResource(HomeModel::COOKIE_NAME_BOYS, HomeModel::CODE_BOYS_CHANNEL)
// );
// $this->_view->display('index', $data);
// 传递模板数据,渲染模板
$this->setWebNavHeader(HomeModel::COOKIE_NAME_BOYS);
$data = array(
'boysHomePage' => true,
'footerTop'=> true,
'boys' => HomeModel::getChannelResource(HomeModel::COOKIE_NAME_BOYS, HomeModel::CODE_BOYS_CHANNEL)
);
$this->_view->display('index', $data);
}
}
\ No newline at end of file
... ...