cloud_search.php
2.62 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
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: cloud_search.php 33387 2013-06-05 03:21:26Z jeffjzhang $
*/
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
exit('Access Denied');
}
$op = $_GET['op'];
$anchor = isset($_GET['anchor']) ? $_GET['anchor'] : 'setting';
$current = array($anchor => 1);
if (!$_G['inajax']) {
cpheader();
shownav('navcloud', 'menu_cloud_search');
showsubmenu('menu_cloud_search', array(
array(array('menu' => 'search_menu_settingsearch', 'submenu' => array(
array('search_menu_basicsetting', 'cloud&operation=search&anchor=setting', $current['setting']),
array('search_menu_modulesetting', 'cloud&operation=search&anchor=modulesetting', $current['modulesetting']),
)), in_array($anchor, array('setting', 'modulesetting'))),
array('Iwenwen', 'cloud&operation=search&anchor=iwenwen', $current['iwenwen']),
));
}
if($anchor == 'modulesetting') {
if(!submitcheck('modulesetting')) {
showtips('search_modulesetting_tips');
showformheader('cloud&operation=search&anchor=modulesetting');
showtableheader();
showsetting('search_setting_allow_thread_related', 'cloudsearch_relatedthread', isset($_G['setting']['my_search_data']['allow_thread_related']) ? $_G['setting']['my_search_data']['allow_thread_related'] : 1, 'radio');
showsetting('search_setting_allow_recommend_related', 'cloudsearch_relatedrecommend', isset($_G['setting']['my_search_data']['allow_recommend_related']) ? $_G['setting']['my_search_data']['allow_recommend_related'] : 1, 'radio');
showsubmit('modulesetting');
showtablefooter();
showformfooter();
} else {
$_G['setting']['my_search_data']['allow_thread_related'] = dintval($_POST['cloudsearch_relatedthread']);
$_G['setting']['my_search_data']['allow_recommend_related'] = dintval($_POST['cloudsearch_relatedrecommend']);
$updateData = array(
'my_search_data' => $_G['setting']['my_search_data']
);
C::t('common_setting')->update_batch($updateData);
updatecache('setting');
cpmsg('setting_update_succeed', 'action=cloud&operation=search&anchor='.$anchor, 'succeed');
}
} elseif(preg_match('/^[a-z|A-Z|\d]+$/', $anchor)) {
$utilService = Cloud::loadClass('Service_Util');
$cp_version = $_G['setting']['my_search_data']['cp_version'];
$params = array('link_url' => ADMINSCRIPT . '?action=cloud&operation=search', 'cp_version' => $cp_version, 'anchor' => $anchor, 'm_setting' => 1);
$signUrl = $utilService->generateSiteSignUrl($params);
$utilService->redirect($cloudDomain . '/search/' . $anchor . '/?' . $signUrl);
}