Index.php
3.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<?php
use Action\WebAction;
use WebPlugin\Helpers;
use LibModels\Web\Guang\ListData;
use Guang\IndexModel;
use WebPlugin\Paging;
use Index\HomeModel;
class IndexController extends WebAction
{
/**
* 逛的首页
*/
public function indexAction()
{
$this->setWebNavHeader();
$paging = new Paging('yoho');
$type = intval($this->get('type', 0));
$channel = Helpers::getChannelNameByCookie();
$gender = Helpers::getGenderByCookie();
$page = intval($this->get('page', 1));
$uid = $this->getUid();
$udid = $this->getUdid();
$limit = 20;
$article = IndexModel::article($gender, $type, $uid, $udid, $page, '', '', $limit);
$this->setTitle('逛', true);
$total = $article['total'];
$tags = IndexModel::getHotTags(1, 20);
$ads = IndexModel::getAds($channel);
$paging->setTotal($total)->setSize($limit)->setQuery(array('type' => $type));
$data['guangIndexPage'] = true;
//导航
$data['pathNav'] = array_merge(array(HomeModel::getHomeChannelNav()), IndexModel::getPathNav());
$data['guang'] = array(
'slider' => IndexModel::getBanner($channel),
'msgTypes' => IndexModel::getCategory($type),
'msgs' => $article['msgs'],
'ads'=> $ads,
'msgPager'=> $paging->view(false),
'exRecos' => IndexModel::getExcellectRecos($gender, 1, 10),
'hotTags' => $tags
);
$this->_view->display('index', $data);
}
/**
* 作者信息
*/
public function editorAction()
{
$this->setWebNavHeader();
//author_id = 7613683
$author_id = $this->get('author_id');
$channel = Helpers::getChannelNameByCookie();
// APP访问时通过频道参数判断性别
$gender = Helpers::getGenderByCookie();
$uid = $this->getUid();
$udid = $this->getUdid();
// 获取作者信息
$author = ListData::author($author_id);
// 作者信息不存在,则跳到错误页面
if (!isset($author['data']['name'])) {
$this->error();
}
// 设置标签页标题
$authorName = $author['data']['name'];
$this->setTitle($authorName, true, '');
$data = array();
// 模板中使用JS的标识
$data['guangList'] = true;
$page = intval($this->get('page', 1));
$limit = 20;
// 标签聚合内容列表
$article = IndexModel::article($gender, null, $uid, $udid, $page, '', $author_id, $limit);
$data['guang']['gender'] = $gender;
$paging = new Paging('yoho');
$total = $article['total'];
$tags = IndexModel::getHotTags(1, 20);
$ads = IndexModel::getAds($channel);
$paging->setTotal($total)->setSize($limit)->setQuery(null);
$data = array(
'guangListPage' => true,
'guang' => array(
'editor' => array(
'avatar' => Helpers::getImageUrl($author['data']['avatar'], 100, 100),
'name' => $author['data']['name'],
'intro' => $author['data']['author_desc'],
'info' => '设计理念:时尚,线条流畅'
),
'msgs' => $article['msgs'],
'exRecos' => IndexModel::getExcellectRecos($gender, 1, 10),
'hotTags' => $tags,
'ads' => $ads,
'msgPager' => $paging->view(false)
),
'pathNav' => array_merge(array(HomeModel::getHomeChannelNav()), IndexModel::getPathNav())
);
$this->_view->display('editor', $data);
}
}