Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
2
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
hf
9 years ago
Commit
408ab8d5434410face7e33d057bb198f33eccaeb
1 parent
96b583e9
code review by fei.hong: do modify pc home page boys code
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
32 deletions
library/Action/WebAction.php
library/WebPlugin/TemplateLayout.php
yohobuy/www.yohobuy.com/application/controllers/Index.php
library/Action/WebAction.php
View file @
408ab8d
...
...
@@ -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
);
...
...
library/WebPlugin/TemplateLayout.php
View file @
408ab8d
...
...
@@ -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
{
}
else
if
(
!
isset
(
$tpl_vars
[
'keywords'
]))
{
$tpl_vars
[
'keywords'
]
=
$config
->
seo
->
keywords
;
}
if
(
!
empty
(
$tpl_vars
[
'description_more'
]))
{
...
...
yohobuy/www.yohobuy.com/application/controllers/Index.php
View file @
408ab8d
...
...
@@ -14,33 +14,24 @@ class IndexController extends WebAction
*/
public
function
indexAction
()
{
if
(
isset
(
$_COOKIE
[
'_Channel'
]))
{
$this
->
setCookie
(
'_Channel'
,
''
);
}
if
(
isset
(
$_COOKIE
[
'_Gender'
]))
{
$this
->
setCookie
(
'_Gender'
,
''
);
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
->
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
...
...
Please
register
or
login
to post a comment