/
admincp.inc.php
145 lines (128 loc) · 4.63 KB
/
admincp.inc.php
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<?php
/**
* [Sanree] (C)2001-2099 Sanree Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: admincp.inc.php 2014-07-29 10:20:00 sanree checkedby liuhuan $
*/
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
exit('2014042523s4K4QUOUT9||5057||1411992002');
}
$modfile=DISCUZ_ROOT.'./source/plugin/'.$plugin['identifier'].'/config.inc.php';
@require_once($modfile);
$modfile=DISCUZ_ROOT.'./source/plugin/'.$plugin['identifier'].'/function/function_core.php';
require_once($modfile);
$branddefault = array();
$modfile=DISCUZ_ROOT.'./data/sysdata/cache_sanree_brand_config.php';
file_exists($modfile) && @require_once $modfile;
$defaultconfig = unserialize($branddefault);
foreach($_GET as $k => $v) {
$_G['sr_'.$k] = daddslashes($v);
}
$act= $_G['sr_act'];
$config = array();
foreach($pluginvars as $key => $val) {
$config[$key] = $val['value'];
}
$_G['cache']['plugin']['sanree_brand'] = $config;
$defaultzhishu = empty($config['defaultzhishu']) ? '99.9' : $config['defaultzhishu'];
$mapapi = trim($config['mapapi']);
$mapapi = empty($mapapi) ? 'baidu' : $mapapi;
$ismultiple = intval($config['ismultiple']);
$allicq = array('qq', 'msn', 'wangwang', 'baiduhi', 'skype');
$icq = trim($config['icq']);
$icq = !in_array($icq, $allicq) ? 'qq' : $icq;
$qqcode = trim($config['qqcode']);
$msncode = trim($config['msncode']);
$wangwangcode = trim($config['wangwangcode']);
$baiduhicode = trim($config['baiduhicode']);
$skypecode = trim($config['skypecode']);
$icqshow = $icq.'code';
$icqshow = $$icqshow;
$selectdiscount = $config['selectdiscount'];
$isbdomain = intval($config['isbdomain']);
$mdomain = $config['mdomain'];
$marr = explode("\r\n", $selectdiscount);
$cardname = $config['cardname'];
$config['selectdiscountshow'] = array();
foreach($marr as $row) {
list($key , $val) = explode("=", $row);
$config['selectdiscountshow'][$key] = $val;
}
$isselfdistrict = intval($config['isselfdistrict']);
if ($isselfdistrict==1) {
$actlist =array(
'base' => array('base', 'updatecache'),
'businesses' => array('businesseslist'),
'category' => array('list'),
'district' => array('district'),
'slide' => array('slide'),
'group' => array('group'),
'cmenu' => array('cmenu'),
'msgmanage' => array('msg'),
'tag' => array('tag'),
'mf' => array('mf'),
'album' => array( 'album_category','album'),
'diymanage' => array('diyconfig', 'diystyle', 'diytemplate'),
'domain' => array('domainconfig'),
'card' => array('card'),
'navigation' => array('navigation'),
'friendly_link' => array('friendly_link'),
);
} else {
$actlist =array(
'base' => array('base', 'updatecache'),
'businesses' => array('businesseslist'),
'category' => array('list'),
'slide' => array('slide'),
'group' => array('group'),
'cmenu' => array('cmenu'),
'msgmanage' => array('msg'),
'tag' => array('tag'),
'mf' => array('mf'),
'album' => array('album', 'album_category'),
'diymanage' => array('diyconfig', 'diystyle', 'diytemplate'),
'domain' => array('domainconfig'),
'card' => array('card'),
'navigation' => array('navigation')
);
}
$pdo = $navbar =array();
foreach ($actlist as $k => $v){
$pdo=array_merge($pdo,$v);
}
if(!in_array($act, $pdo)) {
$act = 'base';
}
$current=' class="current"';
$menustr='<ul class="tab1">';
foreach ($actlist as $k => $v){
$navbar[$k]=in_array($act,$v) ? $current:'';
if($k == 'card') {
$menustr.='<li'.$navbar[$k].'><a href="'.ADMINSCRIPT.'?action=plugins&operation=config&act='.$v[0].'&identifier=sanree_brand&pmod=admincp"><span>'.$cardname.'</span></a></li>';
}
$menustr.='<li'.$navbar[$k].'><a href="'.ADMINSCRIPT.'?action=plugins&operation=config&act='.$v[0].'&identifier=sanree_brand&pmod=admincp"><span>'.$langs[$k].'</span></a></li>';
}
$menustr.='</ul>';
$thisurl = "plugins&operation=config&identifier=sanree_brand&pmod=admincp&act=$act";
$gotourl = 'action=plugins&operation=config&identifier=sanree_brand&pmod=admincp&act=';
$adminurl = ADMINSCRIPT.'?action=plugins&operation=config&identifier=sanree_brand&pmod=admincp';
$menustr=$rightlink.$menustr;
cpheader();
$cateid=intval($_G['sr_cateid']);
if ($cateid) $thisurl.='&cateid='.$cateid;
$actfile=sanree_libfile('admincp/'.$plugin['identifier'].'/'.$act, $plugin['identifier']);
if(!file_exists($actfile)) {
cpmsg($langs['isbusiness'], 'action=plugins&operation=config&identifier=sanree_brand&pmod=admincp&act=list', 'error');
}
$bindingforum = intval($config['bindingforum']);
if ($bindingforum<1) {
cpmsg_error($langs['nobindingforum']);
}
chkformtitle($bindingforum);
$creditunit = $config['creditunit'];
if(empty($creditunit)){
cpmsg_error($langs['nocreditunit']);
}
require_once $actfile;
?>