channel.ctrl.php
2.2 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
<?php
/**
* [WeEngine System] Copyright (c) 2014 WE7.CC
* WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
*/
defined('IN_IA') or exit('Access Denied');
if (!empty($_GPC['styleid'])) {
$_W['account']['styleid'] = $_GPC['styleid'];
$_W['account']['template'] = pdo_fetchcolumn("SELECT name FROM ".tablename('site_templates')." WHERE id = '{$_W['account']['styleid']}'");
}
load()->model('app');
$channel = array('index', 'mc', 'list', 'detail', 'album', 'photo','exchange');
$name = $_GPC['name'];
if ($name == 'home') {
header("Location: ".url('mobile/mc', array('uniacid' => $_W['uniacid'])));
exit;
}
$name = in_array($_GPC['name'], $channel) ? $name : 'index';
if ($name == 'index') {
load()->model('site');
$position = 1;
$title = $_W['account']['name'];
$navs = app_navs($position);
$cover = pdo_fetch("SELECT description, title, thumb FROM ".tablename('cover_reply')." WHERE uniacid = :uniacid AND module = 'wesite'", array(':uniacid' => $_W['uniacid']));
$_share_content = $cover['description'];
$title = $cover['title'];
$_share_img = $cover['thumb'];
} elseif ($name == 'mc') {
$title = '个人中心';
$position = 2;
if (empty($_W['uid']) && empty($_W['openid'])) {
message('非法访问,请重新点击链接进入个人中心!');
}
$navs = app_navs($position);
if (!empty($navs)) {
foreach ($navs as $row) {
$menus[$row['module']][] = $row;
}
foreach ($menus as $module => $row) {
if (count($row) <= 2) {
$menus['other'][$module] = $row;
unset($menus[$module]);
}
}
}
} elseif ($name == 'list') {
header("Location: ".url('mobile/module/list', array('name' => 'site', 'uniacid' => $_W['uniacid'], 'cid' => $_GPC['cid'])));
exit;
} elseif ($name == 'detail') {
header("Location: ".url('mobile/module/detail', array('name' => 'site', 'uniacid' => $_W['uniacid'], 'id' => $_GPC['id'])));
exit;
} elseif ($name == 'album') {
header("Location: ".url('mobile/module/list', array('name' => 'album', 'uniacid' => $_W['uniacid'])));
exit;
} elseif ($name == 'photo') {
header("Location: ".url('mobile/module/detail', array('name' => 'album', 'uniacid' => $_W['uniacid'], 'id' => $_GPC['id'])));
exit;
}
template('channel/'.$name);