cloud_search.php 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. /**
  3. * [Discuz!] (C)2001-2099 Comsenz Inc.
  4. * This is NOT a freeware, use is subject to license terms
  5. *
  6. * $Id: cloud_search.php 33387 2013-06-05 03:21:26Z jeffjzhang $
  7. */
  8. if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
  9. exit('Access Denied');
  10. }
  11. $op = $_GET['op'];
  12. $anchor = isset($_GET['anchor']) ? $_GET['anchor'] : 'setting';
  13. $current = array($anchor => 1);
  14. if (!$_G['inajax']) {
  15. cpheader();
  16. shownav('navcloud', 'menu_cloud_search');
  17. showsubmenu('menu_cloud_search', array(
  18. array(array('menu' => 'search_menu_settingsearch', 'submenu' => array(
  19. array('search_menu_basicsetting', 'cloud&operation=search&anchor=setting', $current['setting']),
  20. array('search_menu_modulesetting', 'cloud&operation=search&anchor=modulesetting', $current['modulesetting']),
  21. )), in_array($anchor, array('setting', 'modulesetting'))),
  22. array('Iwenwen', 'cloud&operation=search&anchor=iwenwen', $current['iwenwen']),
  23. ));
  24. }
  25. if($anchor == 'modulesetting') {
  26. if(!submitcheck('modulesetting')) {
  27. showtips('search_modulesetting_tips');
  28. showformheader('cloud&operation=search&anchor=modulesetting');
  29. showtableheader();
  30. 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');
  31. 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');
  32. showsubmit('modulesetting');
  33. showtablefooter();
  34. showformfooter();
  35. } else {
  36. $_G['setting']['my_search_data']['allow_thread_related'] = dintval($_POST['cloudsearch_relatedthread']);
  37. $_G['setting']['my_search_data']['allow_recommend_related'] = dintval($_POST['cloudsearch_relatedrecommend']);
  38. $updateData = array(
  39. 'my_search_data' => $_G['setting']['my_search_data']
  40. );
  41. C::t('common_setting')->update_batch($updateData);
  42. updatecache('setting');
  43. cpmsg('setting_update_succeed', 'action=cloud&operation=search&anchor='.$anchor, 'succeed');
  44. }
  45. } elseif(preg_match('/^[a-z|A-Z|\d]+$/', $anchor)) {
  46. $utilService = Cloud::loadClass('Service_Util');
  47. $cp_version = $_G['setting']['my_search_data']['cp_version'];
  48. $params = array('link_url' => ADMINSCRIPT . '?action=cloud&operation=search', 'cp_version' => $cp_version, 'anchor' => $anchor, 'm_setting' => 1);
  49. $signUrl = $utilService->generateSiteSignUrl($params);
  50. $utilService->redirect($cloudDomain . '/search/' . $anchor . '/?' . $signUrl);
  51. }