Default.class.php
1.9 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
<?php
/**
* 默认控制器
*/
class Controller_Default extends Controller_Abstract
{
/**
* 首页
*
*/
public function indexAction()
{
$total = Facade_News::getTotal(array(), array('手机视频'));
$page = new Lib_Helper_Pagination($total, 24);
$page->setOptions(array('afterAppend' => 'setLayout'));
list($offset, $limit) = $page->getLimit();
$this->_view['banners'] = Facade_Index::getIndex(1);
$rightBanners = array();
if(empty($offset))
{
$rightBanners = Facade_Index::getIndex(2);
}
$list = Facade_News::getList(array(), $offset, $limit, array('手机视频'));
$this->_view['partnerList'] = Facade_Partner::getPartner();
$this->_view['partnerTypes'] = Facade_Partner::$types;
$this->_view['pagination'] = $page->getPagination();
$this->_view['rightBanners'] = $rightBanners;
$this->_view['news'] = $list;
}
/**
* 客户端首页模块
*
*/
public function indexMobileAction()
{
$this->_view['banners'] = Facade_Index::getIndex(1);
}
public function otherAction()
{
}
public function contactusAction()
{
}
/**
* 壁纸
*/
public function wallpaperAction()
{
$this->_viewname = 'wallpapermobile';
}
/**
* 壁纸图片
*
*/
public function wallpaperimageAction()
{
$dir = SITE_IMG.'/yohood/wallpaper';
$screenWidth = $this->_request->query('width');
$screenHeight = $this->_request->query('height');
$val = $this->_request->query('val');
if($screenWidth >=1440 && $screenHeight>=1200)
{
$dir.='/1440x1200/';
}
else if($screenWidth >=640 && $screenHeight>=1136)
{
$dir.='/640x1136/';
}
else
{
$dir.='/640x960/';
}
$this->_view['image'] = $dir.$val.'.jpg';
$this->_viewname = 'wallpaperimagemobile';
}
}