search_wap.class.php
1.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
<?php
/**
 *      [Discuz! X] (C)2001-2099 Comsenz Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: search_wap.class.php 34044 2013-09-25 02:55:02Z nemohou $
 */
if(!defined('IN_DISCUZ')) {
	exit('Access Denied');
}
class mobileplugin_cloudsearch {
	public function mobileplugin_cloudsearch() {
		global $_G, $searchparams;
		$cloudAppService = Cloud::loadClass('Service_App');
		$this->allow = $cloudAppService->getCloudAppStatus('search');
		if($this->allow) {
			include_once template('cloudsearch:module');
			if(!function_exists('tpl_global_header_mobile')) {
				$this->allow = false;
				return;
			}
			if (!$searchparams) {
				$searchHelper = Cloud::loadClass('Cloud_Service_SearchHelper');
				$searchparams = $searchHelper->makeSearchSignUrl();
			}
		}
	}
	function global_header_mobile() {
		if (!$this->allow) {
			return;
		}
		global $_G, $searchparams;
		$srchotquery = '';
		if(!empty($searchparams['params'])) {
			foreach($searchparams['params'] as $key => $value) {
				$srchotquery .= '&' . $key . '=' . rawurlencode($value);
			}
		}
		return tpl_global_header_mobile($searchparams, $srchotquery);
	}
}