...
|
...
|
@@ -23,9 +23,13 @@ class IndexController extends AbstractAction |
|
|
|
|
|
$uid = $this->getUid();
|
|
|
$udid = $this->getUdid();
|
|
|
$type = $this->get('id', 0);
|
|
|
$gender = rawurldecode($this->get('gender', '1,2,3'));
|
|
|
|
|
|
$type = $this->get('id', 0);
|
|
|
$gender = $this->get('gender', '1,2,3');
|
|
|
if (is_string($gender)) {
|
|
|
$gender = rawurldecode($gender);
|
|
|
}
|
|
|
|
|
|
// // 设置侧边栏逛的默认选中状态
|
|
|
// if ($gender === '1,3') {
|
|
|
// $this->setNavSide('boys');
|
...
|
...
|
@@ -51,19 +55,36 @@ class IndexController extends AbstractAction |
|
|
$tag = $this->get('query');
|
|
|
$channel = $this->get('yh_channel');
|
|
|
|
|
|
// 标识是不是APP客户端
|
|
|
$isApp = is_numeric($channel);
|
|
|
// APP访问时通过频道参数判断性别
|
|
|
if ($isApp) {
|
|
|
switch (intval($channel)) {
|
|
|
case 1: // 男
|
|
|
$gender = '1,3';
|
|
|
break;
|
|
|
case 2: // 女
|
|
|
$gender = '2,3';
|
|
|
break;
|
|
|
default: // 所有
|
|
|
$gender = '1,2,3';
|
|
|
}
|
|
|
}
|
|
|
// 从Cookie获取
|
|
|
else {
|
|
|
$gender = Helpers::getGenderByCookie();
|
|
|
|
|
|
$this->setNavHeader($tag, true, SITE_MAIN);
|
|
|
}
|
|
|
|
|
|
// 标签聚合内容列表
|
|
|
$article = ListData::article('', 0, $uid, $udid, 1, $tag);
|
|
|
$article = ListData::article($gender, 0, $uid, $udid, 1, $tag);
|
|
|
// 标签聚合内容不存在, 跳到错误页面
|
|
|
if (empty($article['data']['list']['artList'])) {
|
|
|
$this->error();
|
|
|
}
|
|
|
// 标识是不是APP客户端
|
|
|
$isApp = isset($channel);
|
|
|
|
|
|
$this->setTitle($tag);
|
|
|
if (!$isApp) {
|
|
|
$this->setNavHeader($tag, true, SITE_MAIN);
|
|
|
}
|
|
|
|
|
|
$data = array();
|
|
|
// 模板中使用JS的标识
|
...
|
...
|
@@ -78,6 +99,8 @@ class IndexController extends AbstractAction |
|
|
|
|
|
// 分页需要的参数
|
|
|
$data['guang']['tag'] = $tag;
|
|
|
$data['guang']['gender'] = $gender;
|
|
|
$data['guang']['isApp'] = $isApp ? 1 : 0;
|
|
|
|
|
|
$this->_view->display('list', $data);
|
|
|
}
|
...
|
...
|
@@ -99,14 +122,31 @@ class IndexController extends AbstractAction |
|
|
if (!isset($author['name'])) {
|
|
|
$this->error();
|
|
|
}
|
|
|
|
|
|
// 标识是不是APP客户端
|
|
|
$isApp = isset($channel);
|
|
|
|
|
|
$this->setTitle('编辑简介');
|
|
|
if (!$isApp) {
|
|
|
$isApp = is_numeric($channel);
|
|
|
// APP访问时通过频道参数判断性别
|
|
|
if ($isApp) {
|
|
|
switch (intval($channel)) {
|
|
|
case 1: // 男
|
|
|
$gender = '1,3';
|
|
|
break;
|
|
|
case 2: // 女
|
|
|
$gender = '2,3';
|
|
|
break;
|
|
|
default: // 所有
|
|
|
$gender = '1,2,3';
|
|
|
}
|
|
|
}
|
|
|
// 从Cookie获取
|
|
|
else {
|
|
|
$gender = Helpers::getGenderByCookie();
|
|
|
|
|
|
$this->setNavHeader('编辑简介', true, SITE_MAIN);
|
|
|
}
|
|
|
|
|
|
$this->setTitle('编辑简介');
|
|
|
|
|
|
$uid = $this->getUid();
|
|
|
$udid = $this->getUdid();
|
|
|
|
...
|
...
|
@@ -122,15 +162,18 @@ class IndexController extends AbstractAction |
|
|
$data['author']['id'] = $id;
|
|
|
|
|
|
// 标签聚合内容列表
|
|
|
$article = ListData::article('', 0, $uid, $udid, 1, null, $id);
|
|
|
$article = ListData::article($gender, 0, $uid, $udid, 1, null, $id);
|
|
|
// 构建资讯文章内容
|
|
|
if (!empty($article['data']['list']['artList'])) {
|
|
|
$build = array();
|
|
|
foreach ($article['data']['list']['artList'] as $article) {
|
|
|
$build[] = Helpers::formatArticle($article, true, false, false);
|
|
|
$build[] = Helpers::formatArticle($article, true, $isApp, false);
|
|
|
}
|
|
|
$data['guang']['infos'] = $build;
|
|
|
}
|
|
|
|
|
|
$data['guang']['gender'] = $gender;
|
|
|
$data['guang']['isApp'] = $isApp ? 1 : 0;
|
|
|
|
|
|
$this->_view->display('list', $data);
|
|
|
}
|
...
|
...
|
@@ -161,6 +204,7 @@ class IndexController extends AbstractAction |
|
|
$page = $this->get('page');
|
|
|
$gender = $this->get('gender');
|
|
|
$authorId = $this->get('authorId');
|
|
|
$isApp = $this->get('isApp', false);
|
|
|
$showAuthor = true;
|
|
|
if (!empty($sortId) && !is_numeric($sortId)) {
|
|
|
break;
|
...
|
...
|
@@ -185,7 +229,7 @@ class IndexController extends AbstractAction |
|
|
$data = array();
|
|
|
$build = array();
|
|
|
foreach ($article['data']['list']['artList'] as $article) {
|
|
|
$build[] = Helpers::formatArticle($article, true, false, $showAuthor);
|
|
|
$build[] = Helpers::formatArticle($article, true, $isApp, $showAuthor);
|
|
|
}
|
|
|
$data['infos'] = $build;
|
|
|
|
...
|
...
|
|