@@ -36,8 +36,8 @@ discard block |
||
36 | 36 | * @param string $payload Information from a verified authentication token. |
37 | 37 | */ |
38 | 38 | public function __construct($envelope, $payload) { |
39 | - $this->envelope = $envelope; |
|
40 | - $this->payload = $payload; |
|
39 | + $this->envelope = $envelope; |
|
40 | + $this->payload = $payload; |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
@@ -46,10 +46,10 @@ discard block |
||
46 | 46 | * @return |
47 | 47 | */ |
48 | 48 | public function getUserId() { |
49 | - if (array_key_exists(self::USER_ATTR, $this->payload)) { |
|
50 | - return $this->payload[self::USER_ATTR]; |
|
51 | - } |
|
52 | - throw new Google_AuthException("No user_id in token"); |
|
49 | + if (array_key_exists(self::USER_ATTR, $this->payload)) { |
|
50 | + return $this->payload[self::USER_ATTR]; |
|
51 | + } |
|
52 | + throw new Google_AuthException("No user_id in token"); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | /** |
@@ -58,6 +58,6 @@ discard block |
||
58 | 58 | * @return array |
59 | 59 | */ |
60 | 60 | public function getAttributes() { |
61 | - return array("envelope" => $this->envelope, "payload" => $this->payload); |
|
61 | + return array("envelope" => $this->envelope, "payload" => $this->payload); |
|
62 | 62 | } |
63 | 63 | } |
@@ -45,39 +45,39 @@ discard block |
||
45 | 45 | * application is requesting delegated access. |
46 | 46 | */ |
47 | 47 | public function __construct( |
48 | - $serviceAccountName, |
|
49 | - $scopes, |
|
50 | - $privateKey, |
|
51 | - $privateKeyPassword = 'notasecret', |
|
52 | - $assertionType = 'http://oauth.net/grant_type/jwt/1.0/bearer', |
|
53 | - $sub = false) { |
|
54 | - $this->serviceAccountName = $serviceAccountName; |
|
55 | - $this->scopes = is_string($scopes) ? $scopes : implode(' ', $scopes); |
|
56 | - $this->privateKey = $privateKey; |
|
57 | - $this->privateKeyPassword = $privateKeyPassword; |
|
58 | - $this->assertionType = $assertionType; |
|
59 | - $this->sub = $sub; |
|
60 | - $this->prn = $sub; |
|
48 | + $serviceAccountName, |
|
49 | + $scopes, |
|
50 | + $privateKey, |
|
51 | + $privateKeyPassword = 'notasecret', |
|
52 | + $assertionType = 'http://oauth.net/grant_type/jwt/1.0/bearer', |
|
53 | + $sub = false) { |
|
54 | + $this->serviceAccountName = $serviceAccountName; |
|
55 | + $this->scopes = is_string($scopes) ? $scopes : implode(' ', $scopes); |
|
56 | + $this->privateKey = $privateKey; |
|
57 | + $this->privateKeyPassword = $privateKeyPassword; |
|
58 | + $this->assertionType = $assertionType; |
|
59 | + $this->sub = $sub; |
|
60 | + $this->prn = $sub; |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | public function generateAssertion() { |
64 | - $now = time(); |
|
64 | + $now = time(); |
|
65 | 65 | |
66 | - $jwtParams = array( |
|
67 | - 'aud' => Google_OAuth2::OAUTH2_TOKEN_URI, |
|
68 | - 'scope' => $this->scopes, |
|
69 | - 'iat' => $now, |
|
70 | - 'exp' => $now + self::MAX_TOKEN_LIFETIME_SECS, |
|
71 | - 'iss' => $this->serviceAccountName, |
|
72 | - ); |
|
66 | + $jwtParams = array( |
|
67 | + 'aud' => Google_OAuth2::OAUTH2_TOKEN_URI, |
|
68 | + 'scope' => $this->scopes, |
|
69 | + 'iat' => $now, |
|
70 | + 'exp' => $now + self::MAX_TOKEN_LIFETIME_SECS, |
|
71 | + 'iss' => $this->serviceAccountName, |
|
72 | + ); |
|
73 | 73 | |
74 | - if ($this->sub !== false) { |
|
75 | - $jwtParams['sub'] = $this->sub; |
|
76 | - } else if ($this->prn !== false) { |
|
77 | - $jwtParams['prn'] = $this->prn; |
|
78 | - } |
|
74 | + if ($this->sub !== false) { |
|
75 | + $jwtParams['sub'] = $this->sub; |
|
76 | + } else if ($this->prn !== false) { |
|
77 | + $jwtParams['prn'] = $this->prn; |
|
78 | + } |
|
79 | 79 | |
80 | - return $this->makeSignedJwt($jwtParams); |
|
80 | + return $this->makeSignedJwt($jwtParams); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | /** |
@@ -86,18 +86,18 @@ discard block |
||
86 | 86 | * @return string The signed JWT. |
87 | 87 | */ |
88 | 88 | private function makeSignedJwt($payload) { |
89 | - $header = array('typ' => 'JWT', 'alg' => 'RS256'); |
|
89 | + $header = array('typ' => 'JWT', 'alg' => 'RS256'); |
|
90 | 90 | |
91 | - $segments = array( |
|
92 | - Google_Utils::urlSafeB64Encode(json_encode($header)), |
|
93 | - Google_Utils::urlSafeB64Encode(json_encode($payload)) |
|
94 | - ); |
|
91 | + $segments = array( |
|
92 | + Google_Utils::urlSafeB64Encode(json_encode($header)), |
|
93 | + Google_Utils::urlSafeB64Encode(json_encode($payload)) |
|
94 | + ); |
|
95 | 95 | |
96 | - $signingInput = implode('.', $segments); |
|
97 | - $signer = new Google_P12Signer($this->privateKey, $this->privateKeyPassword); |
|
98 | - $signature = $signer->sign($signingInput); |
|
99 | - $segments[] = Google_Utils::urlSafeB64Encode($signature); |
|
96 | + $signingInput = implode('.', $segments); |
|
97 | + $signer = new Google_P12Signer($this->privateKey, $this->privateKeyPassword); |
|
98 | + $signature = $signer->sign($signingInput); |
|
99 | + $segments[] = Google_Utils::urlSafeB64Encode($signature); |
|
100 | 100 | |
101 | - return implode(".", $segments); |
|
101 | + return implode(".", $segments); |
|
102 | 102 | } |
103 | 103 | } |
@@ -57,13 +57,13 @@ discard block |
||
57 | 57 | * Otherwise, return false. |
58 | 58 | */ |
59 | 59 | protected function setCachedRequest(Google_HttpRequest $request) { |
60 | - // Determine if the request is cacheable. |
|
61 | - if (Google_CacheParser::isResponseCacheable($request)) { |
|
62 | - Google_Client::$cache->set($request->getCacheKey(), $request); |
|
63 | - return true; |
|
64 | - } |
|
60 | + // Determine if the request is cacheable. |
|
61 | + if (Google_CacheParser::isResponseCacheable($request)) { |
|
62 | + Google_Client::$cache->set($request->getCacheKey(), $request); |
|
63 | + return true; |
|
64 | + } |
|
65 | 65 | |
66 | - return false; |
|
66 | + return false; |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | /** |
@@ -73,11 +73,11 @@ discard block |
||
73 | 73 | * false if the operation was unsuccessful. |
74 | 74 | */ |
75 | 75 | protected function getCachedRequest(Google_HttpRequest $request) { |
76 | - if (false == Google_CacheParser::isRequestCacheable($request)) { |
|
77 | - false; |
|
78 | - } |
|
76 | + if (false == Google_CacheParser::isRequestCacheable($request)) { |
|
77 | + false; |
|
78 | + } |
|
79 | 79 | |
80 | - return Google_Client::$cache->get($request->getCacheKey()); |
|
80 | + return Google_Client::$cache->get($request->getCacheKey()); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | /** |
@@ -87,28 +87,28 @@ discard block |
||
87 | 87 | * @return Google_HttpRequest Processed request with the enclosed entity. |
88 | 88 | */ |
89 | 89 | protected function processEntityRequest(Google_HttpRequest $request) { |
90 | - $postBody = $request->getPostBody(); |
|
91 | - $contentType = $request->getRequestHeader("content-type"); |
|
92 | - |
|
93 | - // Set the default content-type as application/x-www-form-urlencoded. |
|
94 | - if (false == $contentType) { |
|
95 | - $contentType = self::FORM_URLENCODED; |
|
96 | - $request->setRequestHeaders(array('content-type' => $contentType)); |
|
97 | - } |
|
98 | - |
|
99 | - // Force the payload to match the content-type asserted in the header. |
|
100 | - if ($contentType == self::FORM_URLENCODED && is_array($postBody)) { |
|
101 | - $postBody = http_build_query($postBody, '', '&'); |
|
102 | - $request->setPostBody($postBody); |
|
103 | - } |
|
104 | - |
|
105 | - // Make sure the content-length header is set. |
|
106 | - if (!$postBody || is_string($postBody)) { |
|
107 | - $postsLength = strlen($postBody); |
|
108 | - $request->setRequestHeaders(array('content-length' => $postsLength)); |
|
109 | - } |
|
110 | - |
|
111 | - return $request; |
|
90 | + $postBody = $request->getPostBody(); |
|
91 | + $contentType = $request->getRequestHeader("content-type"); |
|
92 | + |
|
93 | + // Set the default content-type as application/x-www-form-urlencoded. |
|
94 | + if (false == $contentType) { |
|
95 | + $contentType = self::FORM_URLENCODED; |
|
96 | + $request->setRequestHeaders(array('content-type' => $contentType)); |
|
97 | + } |
|
98 | + |
|
99 | + // Force the payload to match the content-type asserted in the header. |
|
100 | + if ($contentType == self::FORM_URLENCODED && is_array($postBody)) { |
|
101 | + $postBody = http_build_query($postBody, '', '&'); |
|
102 | + $request->setPostBody($postBody); |
|
103 | + } |
|
104 | + |
|
105 | + // Make sure the content-length header is set. |
|
106 | + if (!$postBody || is_string($postBody)) { |
|
107 | + $postsLength = strlen($postBody); |
|
108 | + $request->setRequestHeaders(array('content-length' => $postsLength)); |
|
109 | + } |
|
110 | + |
|
111 | + return $request; |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | /** |
@@ -120,21 +120,21 @@ discard block |
||
120 | 120 | * still current and can be re-used. |
121 | 121 | */ |
122 | 122 | protected function checkMustRevaliadateCachedRequest($cached, $request) { |
123 | - if (Google_CacheParser::mustRevalidate($cached)) { |
|
124 | - $addHeaders = array(); |
|
125 | - if ($cached->getResponseHeader('etag')) { |
|
126 | - // [13.3.4] If an entity tag has been provided by the origin server, |
|
127 | - // we must use that entity tag in any cache-conditional request. |
|
128 | - $addHeaders['If-None-Match'] = $cached->getResponseHeader('etag'); |
|
129 | - } elseif ($cached->getResponseHeader('date')) { |
|
130 | - $addHeaders['If-Modified-Since'] = $cached->getResponseHeader('date'); |
|
131 | - } |
|
132 | - |
|
133 | - $request->setRequestHeaders($addHeaders); |
|
134 | - return true; |
|
135 | - } else { |
|
136 | - return false; |
|
137 | - } |
|
123 | + if (Google_CacheParser::mustRevalidate($cached)) { |
|
124 | + $addHeaders = array(); |
|
125 | + if ($cached->getResponseHeader('etag')) { |
|
126 | + // [13.3.4] If an entity tag has been provided by the origin server, |
|
127 | + // we must use that entity tag in any cache-conditional request. |
|
128 | + $addHeaders['If-None-Match'] = $cached->getResponseHeader('etag'); |
|
129 | + } elseif ($cached->getResponseHeader('date')) { |
|
130 | + $addHeaders['If-Modified-Since'] = $cached->getResponseHeader('date'); |
|
131 | + } |
|
132 | + |
|
133 | + $request->setRequestHeaders($addHeaders); |
|
134 | + return true; |
|
135 | + } else { |
|
136 | + return false; |
|
137 | + } |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | /** |
@@ -143,19 +143,19 @@ discard block |
||
143 | 143 | * @param mixed Associative array of response headers from the last request. |
144 | 144 | */ |
145 | 145 | protected function updateCachedRequest($cached, $responseHeaders) { |
146 | - if (isset($responseHeaders['connection'])) { |
|
147 | - $hopByHop = array_merge( |
|
148 | - self::$HOP_BY_HOP, |
|
149 | - explode(',', $responseHeaders['connection']) |
|
150 | - ); |
|
151 | - |
|
152 | - $endToEnd = array(); |
|
153 | - foreach($hopByHop as $key) { |
|
154 | - if (isset($responseHeaders[$key])) { |
|
155 | - $endToEnd[$key] = $responseHeaders[$key]; |
|
156 | - } |
|
157 | - } |
|
158 | - $cached->setResponseHeaders($endToEnd); |
|
159 | - } |
|
146 | + if (isset($responseHeaders['connection'])) { |
|
147 | + $hopByHop = array_merge( |
|
148 | + self::$HOP_BY_HOP, |
|
149 | + explode(',', $responseHeaders['connection']) |
|
150 | + ); |
|
151 | + |
|
152 | + $endToEnd = array(); |
|
153 | + foreach($hopByHop as $key) { |
|
154 | + if (isset($responseHeaders[$key])) { |
|
155 | + $endToEnd[$key] = $responseHeaders[$key]; |
|
156 | + } |
|
157 | + } |
|
158 | + $cached->setResponseHeaders($endToEnd); |
|
159 | + } |
|
160 | 160 | } |
161 | 161 | } |
@@ -15,10 +15,10 @@ discard block |
||
15 | 15 | * limitations under the License. |
16 | 16 | */ |
17 | 17 | |
18 | -require_once GA_API_Path. 'io/Google_HttpRequest.php'; |
|
19 | -require_once GA_API_Path. 'io/Google_HttpStreamIO.php'; |
|
20 | -require_once GA_API_Path. 'io/Google_CurlIO.php'; |
|
21 | -require_once GA_API_Path. 'io/Google_REST.php'; |
|
18 | +require_once GA_API_Path.'io/Google_HttpRequest.php'; |
|
19 | +require_once GA_API_Path.'io/Google_HttpStreamIO.php'; |
|
20 | +require_once GA_API_Path.'io/Google_CurlIO.php'; |
|
21 | +require_once GA_API_Path.'io/Google_REST.php'; |
|
22 | 22 | |
23 | 23 | /** |
24 | 24 | * Abstract IO class |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | ); |
151 | 151 | |
152 | 152 | $endToEnd = array(); |
153 | - foreach($hopByHop as $key) { |
|
153 | + foreach ($hopByHop as $key) { |
|
154 | 154 | if (isset($responseHeaders[$key])) { |
155 | 155 | $endToEnd[$key] = $responseHeaders[$key]; |
156 | 156 | } |
@@ -32,11 +32,11 @@ discard block |
||
32 | 32 | * invalid or malformed post body, invalid url) |
33 | 33 | */ |
34 | 34 | static public function execute(Google_HttpRequest $req) { |
35 | - $httpRequest = Google_Client::$io->makeRequest($req); |
|
36 | - $decodedResponse = self::decodeHttpResponse($httpRequest); |
|
37 | - $ret = isset($decodedResponse['data']) |
|
38 | - ? $decodedResponse['data'] : $decodedResponse; |
|
39 | - return $ret; |
|
35 | + $httpRequest = Google_Client::$io->makeRequest($req); |
|
36 | + $decodedResponse = self::decodeHttpResponse($httpRequest); |
|
37 | + $ret = isset($decodedResponse['data']) |
|
38 | + ? $decodedResponse['data'] : $decodedResponse; |
|
39 | + return $ret; |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | |
@@ -48,32 +48,32 @@ discard block |
||
48 | 48 | * @return mixed|null |
49 | 49 | */ |
50 | 50 | public static function decodeHttpResponse($response) { |
51 | - $code = $response->getResponseHttpCode(); |
|
52 | - $body = $response->getResponseBody(); |
|
53 | - $decoded = null; |
|
51 | + $code = $response->getResponseHttpCode(); |
|
52 | + $body = $response->getResponseBody(); |
|
53 | + $decoded = null; |
|
54 | 54 | |
55 | - if ((intVal($code)) >= 300) { |
|
56 | - $decoded = json_decode($body, true); |
|
57 | - $err = 'Error calling ' . $response->getRequestMethod() . ' ' . $response->getUrl(); |
|
58 | - if ($decoded != null && isset($decoded['error']['message']) && isset($decoded['error']['code'])) { |
|
59 | - // if we're getting a json encoded error definition, use that instead of the raw response |
|
60 | - // body for improved readability |
|
61 | - $err .= ": ({$decoded['error']['code']}) {$decoded['error']['message']}"; |
|
62 | - } else { |
|
63 | - $err .= ": ($code) $body"; |
|
64 | - } |
|
55 | + if ((intVal($code)) >= 300) { |
|
56 | + $decoded = json_decode($body, true); |
|
57 | + $err = 'Error calling ' . $response->getRequestMethod() . ' ' . $response->getUrl(); |
|
58 | + if ($decoded != null && isset($decoded['error']['message']) && isset($decoded['error']['code'])) { |
|
59 | + // if we're getting a json encoded error definition, use that instead of the raw response |
|
60 | + // body for improved readability |
|
61 | + $err .= ": ({$decoded['error']['code']}) {$decoded['error']['message']}"; |
|
62 | + } else { |
|
63 | + $err .= ": ($code) $body"; |
|
64 | + } |
|
65 | 65 | |
66 | - throw new Google_ServiceException($err, $code, null, $decoded['error']['errors']); |
|
67 | - } |
|
66 | + throw new Google_ServiceException($err, $code, null, $decoded['error']['errors']); |
|
67 | + } |
|
68 | 68 | |
69 | - // Only attempt to decode the response, if the response code wasn't (204) 'no content' |
|
70 | - if ($code != '204') { |
|
71 | - $decoded = json_decode($body, true); |
|
72 | - if ($decoded === null || $decoded === "") { |
|
73 | - throw new Google_ServiceException("Invalid json in service response: $body"); |
|
74 | - } |
|
75 | - } |
|
76 | - return $decoded; |
|
69 | + // Only attempt to decode the response, if the response code wasn't (204) 'no content' |
|
70 | + if ($code != '204') { |
|
71 | + $decoded = json_decode($body, true); |
|
72 | + if ($decoded === null || $decoded === "") { |
|
73 | + throw new Google_ServiceException("Invalid json in service response: $body"); |
|
74 | + } |
|
75 | + } |
|
76 | + return $decoded; |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | /** |
@@ -86,43 +86,43 @@ discard block |
||
86 | 86 | * @return string $requestUrl |
87 | 87 | */ |
88 | 88 | static function createRequestUri($servicePath, $restPath, $params) { |
89 | - $requestUrl = $servicePath . $restPath; |
|
90 | - $uriTemplateVars = array(); |
|
91 | - $queryVars = array(); |
|
92 | - foreach ($params as $paramName => $paramSpec) { |
|
93 | - // Discovery v1.0 puts the canonical location under the 'location' field. |
|
94 | - if (! isset($paramSpec['location'])) { |
|
95 | - $paramSpec['location'] = $paramSpec['restParameterType']; |
|
96 | - } |
|
89 | + $requestUrl = $servicePath . $restPath; |
|
90 | + $uriTemplateVars = array(); |
|
91 | + $queryVars = array(); |
|
92 | + foreach ($params as $paramName => $paramSpec) { |
|
93 | + // Discovery v1.0 puts the canonical location under the 'location' field. |
|
94 | + if (! isset($paramSpec['location'])) { |
|
95 | + $paramSpec['location'] = $paramSpec['restParameterType']; |
|
96 | + } |
|
97 | 97 | |
98 | - if ($paramSpec['type'] == 'boolean') { |
|
99 | - $paramSpec['value'] = ($paramSpec['value']) ? 'true' : 'false'; |
|
100 | - } |
|
101 | - if ($paramSpec['location'] == 'path') { |
|
102 | - $uriTemplateVars[$paramName] = $paramSpec['value']; |
|
103 | - } else { |
|
104 | - if (isset($paramSpec['repeated']) && is_array($paramSpec['value'])) { |
|
105 | - foreach ($paramSpec['value'] as $value) { |
|
106 | - $queryVars[] = $paramName . '=' . rawurlencode($value); |
|
107 | - } |
|
108 | - } else { |
|
109 | - $queryVars[] = $paramName . '=' . rawurlencode($paramSpec['value']); |
|
110 | - } |
|
111 | - } |
|
112 | - } |
|
98 | + if ($paramSpec['type'] == 'boolean') { |
|
99 | + $paramSpec['value'] = ($paramSpec['value']) ? 'true' : 'false'; |
|
100 | + } |
|
101 | + if ($paramSpec['location'] == 'path') { |
|
102 | + $uriTemplateVars[$paramName] = $paramSpec['value']; |
|
103 | + } else { |
|
104 | + if (isset($paramSpec['repeated']) && is_array($paramSpec['value'])) { |
|
105 | + foreach ($paramSpec['value'] as $value) { |
|
106 | + $queryVars[] = $paramName . '=' . rawurlencode($value); |
|
107 | + } |
|
108 | + } else { |
|
109 | + $queryVars[] = $paramName . '=' . rawurlencode($paramSpec['value']); |
|
110 | + } |
|
111 | + } |
|
112 | + } |
|
113 | 113 | |
114 | - if (count($uriTemplateVars)) { |
|
115 | - $uriTemplateParser = new URI_Template_Parser($requestUrl); |
|
116 | - $requestUrl = $uriTemplateParser->expand($uriTemplateVars); |
|
117 | - } |
|
118 | - //FIXME work around for the the uri template lib which url encodes |
|
119 | - // the @'s & confuses our servers. |
|
120 | - $requestUrl = str_replace('%40', '@', $requestUrl); |
|
114 | + if (count($uriTemplateVars)) { |
|
115 | + $uriTemplateParser = new URI_Template_Parser($requestUrl); |
|
116 | + $requestUrl = $uriTemplateParser->expand($uriTemplateVars); |
|
117 | + } |
|
118 | + //FIXME work around for the the uri template lib which url encodes |
|
119 | + // the @'s & confuses our servers. |
|
120 | + $requestUrl = str_replace('%40', '@', $requestUrl); |
|
121 | 121 | |
122 | - if (count($queryVars)) { |
|
123 | - $requestUrl .= '?' . implode($queryVars, '&'); |
|
124 | - } |
|
122 | + if (count($queryVars)) { |
|
123 | + $requestUrl .= '?' . implode($queryVars, '&'); |
|
124 | + } |
|
125 | 125 | |
126 | - return $requestUrl; |
|
126 | + return $requestUrl; |
|
127 | 127 | } |
128 | 128 | } |
@@ -54,8 +54,8 @@ discard block |
||
54 | 54 | |
55 | 55 | if ((intVal($code)) >= 300) { |
56 | 56 | $decoded = json_decode($body, true); |
57 | - $err = 'Error calling ' . $response->getRequestMethod() . ' ' . $response->getUrl(); |
|
58 | - if ($decoded != null && isset($decoded['error']['message']) && isset($decoded['error']['code'])) { |
|
57 | + $err = 'Error calling '.$response->getRequestMethod().' '.$response->getUrl(); |
|
58 | + if ($decoded != null && isset($decoded['error']['message']) && isset($decoded['error']['code'])) { |
|
59 | 59 | // if we're getting a json encoded error definition, use that instead of the raw response |
60 | 60 | // body for improved readability |
61 | 61 | $err .= ": ({$decoded['error']['code']}) {$decoded['error']['message']}"; |
@@ -86,12 +86,12 @@ discard block |
||
86 | 86 | * @return string $requestUrl |
87 | 87 | */ |
88 | 88 | static function createRequestUri($servicePath, $restPath, $params) { |
89 | - $requestUrl = $servicePath . $restPath; |
|
89 | + $requestUrl = $servicePath.$restPath; |
|
90 | 90 | $uriTemplateVars = array(); |
91 | 91 | $queryVars = array(); |
92 | 92 | foreach ($params as $paramName => $paramSpec) { |
93 | 93 | // Discovery v1.0 puts the canonical location under the 'location' field. |
94 | - if (! isset($paramSpec['location'])) { |
|
94 | + if (!isset($paramSpec['location'])) { |
|
95 | 95 | $paramSpec['location'] = $paramSpec['restParameterType']; |
96 | 96 | } |
97 | 97 | |
@@ -103,10 +103,10 @@ discard block |
||
103 | 103 | } else { |
104 | 104 | if (isset($paramSpec['repeated']) && is_array($paramSpec['value'])) { |
105 | 105 | foreach ($paramSpec['value'] as $value) { |
106 | - $queryVars[] = $paramName . '=' . rawurlencode($value); |
|
106 | + $queryVars[] = $paramName.'='.rawurlencode($value); |
|
107 | 107 | } |
108 | 108 | } else { |
109 | - $queryVars[] = $paramName . '=' . rawurlencode($paramSpec['value']); |
|
109 | + $queryVars[] = $paramName.'='.rawurlencode($paramSpec['value']); |
|
110 | 110 | } |
111 | 111 | } |
112 | 112 | } |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | $requestUrl = str_replace('%40', '@', $requestUrl); |
121 | 121 | |
122 | 122 | if (count($queryVars)) { |
123 | - $requestUrl .= '?' . implode($queryVars, '&'); |
|
123 | + $requestUrl .= '?'.implode($queryVars, '&'); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | return $requestUrl; |
@@ -27,26 +27,26 @@ discard block |
||
27 | 27 | class Google_CurlIO extends Google_IO { |
28 | 28 | private static $ENTITY_HTTP_METHODS = array("POST" => null, "PUT" => null); |
29 | 29 | private static $HOP_BY_HOP = array( |
30 | - 'connection', 'keep-alive', 'proxy-authenticate', 'proxy-authorization', |
|
31 | - 'te', 'trailers', 'transfer-encoding', 'upgrade'); |
|
30 | + 'connection', 'keep-alive', 'proxy-authenticate', 'proxy-authorization', |
|
31 | + 'te', 'trailers', 'transfer-encoding', 'upgrade'); |
|
32 | 32 | |
33 | 33 | private $curlParams = array ( |
34 | - CURLOPT_RETURNTRANSFER => true, |
|
35 | - CURLOPT_FOLLOWLOCATION => 0, |
|
36 | - CURLOPT_FAILONERROR => false, |
|
37 | - CURLOPT_SSL_VERIFYPEER => true, |
|
38 | - CURLOPT_HEADER => true, |
|
39 | - CURLOPT_VERBOSE => false, |
|
34 | + CURLOPT_RETURNTRANSFER => true, |
|
35 | + CURLOPT_FOLLOWLOCATION => 0, |
|
36 | + CURLOPT_FAILONERROR => false, |
|
37 | + CURLOPT_SSL_VERIFYPEER => true, |
|
38 | + CURLOPT_HEADER => true, |
|
39 | + CURLOPT_VERBOSE => false, |
|
40 | 40 | ); |
41 | 41 | |
42 | 42 | /** |
43 | 43 | * Check for cURL availability. |
44 | 44 | */ |
45 | 45 | public function __construct() { |
46 | - if (! function_exists('curl_init')) { |
|
47 | - throw new Exception( |
|
48 | - 'Google CurlIO client requires the CURL PHP extension'); |
|
49 | - } |
|
46 | + if (! function_exists('curl_init')) { |
|
47 | + throw new Exception( |
|
48 | + 'Google CurlIO client requires the CURL PHP extension'); |
|
49 | + } |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | /** |
@@ -60,8 +60,8 @@ discard block |
||
60 | 60 | * responseHttpCode, responseHeaders and responseBody. |
61 | 61 | */ |
62 | 62 | public function authenticatedRequest(Google_HttpRequest $request) { |
63 | - $request = Google_Client::$auth->sign($request); |
|
64 | - return $this->makeRequest($request); |
|
63 | + $request = Google_Client::$auth->sign($request); |
|
64 | + return $this->makeRequest($request); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | /** |
@@ -73,75 +73,75 @@ discard block |
||
73 | 73 | * @throws Google_IOException on curl or IO error |
74 | 74 | */ |
75 | 75 | public function makeRequest(Google_HttpRequest $request) { |
76 | - // First, check to see if we have a valid cached version. |
|
77 | - $cached = $this->getCachedRequest($request); |
|
78 | - if ($cached !== false) { |
|
79 | - if (!$this->checkMustRevaliadateCachedRequest($cached, $request)) { |
|
80 | - return $cached; |
|
81 | - } |
|
82 | - } |
|
83 | - |
|
84 | - if (array_key_exists($request->getRequestMethod(), |
|
85 | - self::$ENTITY_HTTP_METHODS)) { |
|
86 | - $request = $this->processEntityRequest($request); |
|
87 | - } |
|
88 | - |
|
89 | - $ch = curl_init(); |
|
90 | - curl_setopt_array($ch, $this->curlParams); |
|
91 | - curl_setopt($ch, CURLOPT_URL, $request->getUrl()); |
|
92 | - if ($request->getPostBody()) { |
|
93 | - curl_setopt($ch, CURLOPT_POSTFIELDS, $request->getPostBody()); |
|
94 | - } |
|
95 | - |
|
96 | - $requestHeaders = $request->getRequestHeaders(); |
|
97 | - if ($requestHeaders && is_array($requestHeaders)) { |
|
98 | - $parsed = array(); |
|
99 | - foreach ($requestHeaders as $k => $v) { |
|
100 | - $parsed[] = "$k: $v"; |
|
101 | - } |
|
102 | - curl_setopt($ch, CURLOPT_HTTPHEADER, $parsed); |
|
103 | - } |
|
104 | - |
|
105 | - curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $request->getRequestMethod()); |
|
106 | - curl_setopt($ch, CURLOPT_USERAGENT, $request->getUserAgent()); |
|
107 | - $respData = curl_exec($ch); |
|
108 | - |
|
109 | - // Retry if certificates are missing. |
|
110 | - if (curl_errno($ch) == CURLE_SSL_CACERT) { |
|
111 | - error_log('SSL certificate problem, verify that the CA cert is OK.' |
|
112 | - . ' Retrying with the CA cert bundle from google-api-php-client.'); |
|
113 | - curl_setopt($ch, CURLOPT_CAINFO, dirname(__FILE__) . '/cacerts.pem'); |
|
114 | - $respData = curl_exec($ch); |
|
115 | - } |
|
116 | - |
|
117 | - $respHeaderSize = curl_getinfo($ch, CURLINFO_HEADER_SIZE); |
|
118 | - $respHttpCode = (int) curl_getinfo($ch, CURLINFO_HTTP_CODE); |
|
119 | - $curlErrorNum = curl_errno($ch); |
|
120 | - $curlError = curl_error($ch); |
|
121 | - curl_close($ch); |
|
122 | - if ($curlErrorNum != CURLE_OK) { |
|
123 | - throw new Google_IOException("HTTP Error: ($respHttpCode) $curlError"); |
|
124 | - } |
|
125 | - |
|
126 | - // Parse out the raw response into usable bits |
|
127 | - list($responseHeaders, $responseBody) = |
|
128 | - self::parseHttpResponse($respData, $respHeaderSize); |
|
129 | - |
|
130 | - if ($respHttpCode == 304 && $cached) { |
|
131 | - // If the server responded NOT_MODIFIED, return the cached request. |
|
132 | - $this->updateCachedRequest($cached, $responseHeaders); |
|
133 | - return $cached; |
|
134 | - } |
|
135 | - |
|
136 | - // Fill in the apiHttpRequest with the response values |
|
137 | - $request->setResponseHttpCode($respHttpCode); |
|
138 | - $request->setResponseHeaders($responseHeaders); |
|
139 | - $request->setResponseBody($responseBody); |
|
140 | - // Store the request in cache (the function checks to see if the request |
|
141 | - // can actually be cached) |
|
142 | - $this->setCachedRequest($request); |
|
143 | - // And finally return it |
|
144 | - return $request; |
|
76 | + // First, check to see if we have a valid cached version. |
|
77 | + $cached = $this->getCachedRequest($request); |
|
78 | + if ($cached !== false) { |
|
79 | + if (!$this->checkMustRevaliadateCachedRequest($cached, $request)) { |
|
80 | + return $cached; |
|
81 | + } |
|
82 | + } |
|
83 | + |
|
84 | + if (array_key_exists($request->getRequestMethod(), |
|
85 | + self::$ENTITY_HTTP_METHODS)) { |
|
86 | + $request = $this->processEntityRequest($request); |
|
87 | + } |
|
88 | + |
|
89 | + $ch = curl_init(); |
|
90 | + curl_setopt_array($ch, $this->curlParams); |
|
91 | + curl_setopt($ch, CURLOPT_URL, $request->getUrl()); |
|
92 | + if ($request->getPostBody()) { |
|
93 | + curl_setopt($ch, CURLOPT_POSTFIELDS, $request->getPostBody()); |
|
94 | + } |
|
95 | + |
|
96 | + $requestHeaders = $request->getRequestHeaders(); |
|
97 | + if ($requestHeaders && is_array($requestHeaders)) { |
|
98 | + $parsed = array(); |
|
99 | + foreach ($requestHeaders as $k => $v) { |
|
100 | + $parsed[] = "$k: $v"; |
|
101 | + } |
|
102 | + curl_setopt($ch, CURLOPT_HTTPHEADER, $parsed); |
|
103 | + } |
|
104 | + |
|
105 | + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $request->getRequestMethod()); |
|
106 | + curl_setopt($ch, CURLOPT_USERAGENT, $request->getUserAgent()); |
|
107 | + $respData = curl_exec($ch); |
|
108 | + |
|
109 | + // Retry if certificates are missing. |
|
110 | + if (curl_errno($ch) == CURLE_SSL_CACERT) { |
|
111 | + error_log('SSL certificate problem, verify that the CA cert is OK.' |
|
112 | + . ' Retrying with the CA cert bundle from google-api-php-client.'); |
|
113 | + curl_setopt($ch, CURLOPT_CAINFO, dirname(__FILE__) . '/cacerts.pem'); |
|
114 | + $respData = curl_exec($ch); |
|
115 | + } |
|
116 | + |
|
117 | + $respHeaderSize = curl_getinfo($ch, CURLINFO_HEADER_SIZE); |
|
118 | + $respHttpCode = (int) curl_getinfo($ch, CURLINFO_HTTP_CODE); |
|
119 | + $curlErrorNum = curl_errno($ch); |
|
120 | + $curlError = curl_error($ch); |
|
121 | + curl_close($ch); |
|
122 | + if ($curlErrorNum != CURLE_OK) { |
|
123 | + throw new Google_IOException("HTTP Error: ($respHttpCode) $curlError"); |
|
124 | + } |
|
125 | + |
|
126 | + // Parse out the raw response into usable bits |
|
127 | + list($responseHeaders, $responseBody) = |
|
128 | + self::parseHttpResponse($respData, $respHeaderSize); |
|
129 | + |
|
130 | + if ($respHttpCode == 304 && $cached) { |
|
131 | + // If the server responded NOT_MODIFIED, return the cached request. |
|
132 | + $this->updateCachedRequest($cached, $responseHeaders); |
|
133 | + return $cached; |
|
134 | + } |
|
135 | + |
|
136 | + // Fill in the apiHttpRequest with the response values |
|
137 | + $request->setResponseHttpCode($respHttpCode); |
|
138 | + $request->setResponseHeaders($responseHeaders); |
|
139 | + $request->setResponseBody($responseBody); |
|
140 | + // Store the request in cache (the function checks to see if the request |
|
141 | + // can actually be cached) |
|
142 | + $this->setCachedRequest($request); |
|
143 | + // And finally return it |
|
144 | + return $request; |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | /** |
@@ -152,9 +152,9 @@ discard block |
||
152 | 152 | * @param array $optCurlParams Multiple options used by a cURL session. |
153 | 153 | */ |
154 | 154 | public function setOptions($optCurlParams) { |
155 | - foreach ($optCurlParams as $key => $val) { |
|
156 | - $this->curlParams[$key] = $val; |
|
157 | - } |
|
155 | + foreach ($optCurlParams as $key => $val) { |
|
156 | + $this->curlParams[$key] = $val; |
|
157 | + } |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | /** |
@@ -163,36 +163,36 @@ discard block |
||
163 | 163 | * @return array |
164 | 164 | */ |
165 | 165 | private static function parseHttpResponse($respData, $headerSize) { |
166 | - if (stripos($respData, parent::CONNECTION_ESTABLISHED) !== false) { |
|
167 | - $respData = str_ireplace(parent::CONNECTION_ESTABLISHED, '', $respData); |
|
168 | - } |
|
169 | - |
|
170 | - if ($headerSize) { |
|
171 | - $responseBody = substr($respData, $headerSize); |
|
172 | - $responseHeaders = substr($respData, 0, $headerSize); |
|
173 | - } else { |
|
174 | - list($responseHeaders, $responseBody) = explode("\r\n\r\n", $respData, 2); |
|
175 | - } |
|
176 | - |
|
177 | - $responseHeaders = self::parseResponseHeaders($responseHeaders); |
|
178 | - return array($responseHeaders, $responseBody); |
|
166 | + if (stripos($respData, parent::CONNECTION_ESTABLISHED) !== false) { |
|
167 | + $respData = str_ireplace(parent::CONNECTION_ESTABLISHED, '', $respData); |
|
168 | + } |
|
169 | + |
|
170 | + if ($headerSize) { |
|
171 | + $responseBody = substr($respData, $headerSize); |
|
172 | + $responseHeaders = substr($respData, 0, $headerSize); |
|
173 | + } else { |
|
174 | + list($responseHeaders, $responseBody) = explode("\r\n\r\n", $respData, 2); |
|
175 | + } |
|
176 | + |
|
177 | + $responseHeaders = self::parseResponseHeaders($responseHeaders); |
|
178 | + return array($responseHeaders, $responseBody); |
|
179 | 179 | } |
180 | 180 | |
181 | 181 | private static function parseResponseHeaders($rawHeaders) { |
182 | - $responseHeaders = array(); |
|
183 | - |
|
184 | - $responseHeaderLines = explode("\r\n", $rawHeaders); |
|
185 | - foreach ($responseHeaderLines as $headerLine) { |
|
186 | - if ($headerLine && strpos($headerLine, ':') !== false) { |
|
187 | - list($header, $value) = explode(': ', $headerLine, 2); |
|
188 | - $header = strtolower($header); |
|
189 | - if (isset($responseHeaders[$header])) { |
|
190 | - $responseHeaders[$header] .= "\n" . $value; |
|
191 | - } else { |
|
192 | - $responseHeaders[$header] = $value; |
|
193 | - } |
|
194 | - } |
|
195 | - } |
|
196 | - return $responseHeaders; |
|
182 | + $responseHeaders = array(); |
|
183 | + |
|
184 | + $responseHeaderLines = explode("\r\n", $rawHeaders); |
|
185 | + foreach ($responseHeaderLines as $headerLine) { |
|
186 | + if ($headerLine && strpos($headerLine, ':') !== false) { |
|
187 | + list($header, $value) = explode(': ', $headerLine, 2); |
|
188 | + $header = strtolower($header); |
|
189 | + if (isset($responseHeaders[$header])) { |
|
190 | + $responseHeaders[$header] .= "\n" . $value; |
|
191 | + } else { |
|
192 | + $responseHeaders[$header] = $value; |
|
193 | + } |
|
194 | + } |
|
195 | + } |
|
196 | + return $responseHeaders; |
|
197 | 197 | } |
198 | 198 | } |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | 'connection', 'keep-alive', 'proxy-authenticate', 'proxy-authorization', |
31 | 31 | 'te', 'trailers', 'transfer-encoding', 'upgrade'); |
32 | 32 | |
33 | - private $curlParams = array ( |
|
33 | + private $curlParams = array( |
|
34 | 34 | CURLOPT_RETURNTRANSFER => true, |
35 | 35 | CURLOPT_FOLLOWLOCATION => 0, |
36 | 36 | CURLOPT_FAILONERROR => false, |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | * Check for cURL availability. |
44 | 44 | */ |
45 | 45 | public function __construct() { |
46 | - if (! function_exists('curl_init')) { |
|
46 | + if (!function_exists('curl_init')) { |
|
47 | 47 | throw new Exception( |
48 | 48 | 'Google CurlIO client requires the CURL PHP extension'); |
49 | 49 | } |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | if (curl_errno($ch) == CURLE_SSL_CACERT) { |
111 | 111 | error_log('SSL certificate problem, verify that the CA cert is OK.' |
112 | 112 | . ' Retrying with the CA cert bundle from google-api-php-client.'); |
113 | - curl_setopt($ch, CURLOPT_CAINFO, dirname(__FILE__) . '/cacerts.pem'); |
|
113 | + curl_setopt($ch, CURLOPT_CAINFO, dirname(__FILE__).'/cacerts.pem'); |
|
114 | 114 | $respData = curl_exec($ch); |
115 | 115 | } |
116 | 116 | |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | list($header, $value) = explode(': ', $headerLine, 2); |
188 | 188 | $header = strtolower($header); |
189 | 189 | if (isset($responseHeaders[$header])) { |
190 | - $responseHeaders[$header] .= "\n" . $value; |
|
190 | + $responseHeaders[$header] .= "\n".$value; |
|
191 | 191 | } else { |
192 | 192 | $responseHeaders[$header] = $value; |
193 | 193 | } |
@@ -34,20 +34,20 @@ discard block |
||
34 | 34 | * False if the request is uncacheable. |
35 | 35 | */ |
36 | 36 | public static function isRequestCacheable (Google_HttpRequest $resp) { |
37 | - $method = $resp->getRequestMethod(); |
|
38 | - if (! in_array($method, self::$CACHEABLE_HTTP_METHODS)) { |
|
39 | - return false; |
|
40 | - } |
|
41 | - |
|
42 | - // Don't cache authorized requests/responses. |
|
43 | - // [rfc2616-14.8] When a shared cache receives a request containing an |
|
44 | - // Authorization field, it MUST NOT return the corresponding response |
|
45 | - // as a reply to any other request... |
|
46 | - if ($resp->getRequestHeader("authorization")) { |
|
47 | - return false; |
|
48 | - } |
|
49 | - |
|
50 | - return true; |
|
37 | + $method = $resp->getRequestMethod(); |
|
38 | + if (! in_array($method, self::$CACHEABLE_HTTP_METHODS)) { |
|
39 | + return false; |
|
40 | + } |
|
41 | + |
|
42 | + // Don't cache authorized requests/responses. |
|
43 | + // [rfc2616-14.8] When a shared cache receives a request containing an |
|
44 | + // Authorization field, it MUST NOT return the corresponding response |
|
45 | + // as a reply to any other request... |
|
46 | + if ($resp->getRequestHeader("authorization")) { |
|
47 | + return false; |
|
48 | + } |
|
49 | + |
|
50 | + return true; |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | /** |
@@ -59,48 +59,48 @@ discard block |
||
59 | 59 | * False if the response is un-cacheable. |
60 | 60 | */ |
61 | 61 | public static function isResponseCacheable (Google_HttpRequest $resp) { |
62 | - // First, check if the HTTP request was cacheable before inspecting the |
|
63 | - // HTTP response. |
|
64 | - if (false == self::isRequestCacheable($resp)) { |
|
65 | - return false; |
|
66 | - } |
|
67 | - |
|
68 | - $code = $resp->getResponseHttpCode(); |
|
69 | - if (! in_array($code, self::$CACHEABLE_STATUS_CODES)) { |
|
70 | - return false; |
|
71 | - } |
|
72 | - |
|
73 | - // The resource is uncacheable if the resource is already expired and |
|
74 | - // the resource doesn't have an ETag for revalidation. |
|
75 | - $etag = $resp->getResponseHeader("etag"); |
|
76 | - if (self::isExpired($resp) && $etag == false) { |
|
77 | - return false; |
|
78 | - } |
|
79 | - |
|
80 | - // [rfc2616-14.9.2] If [no-store is] sent in a response, a cache MUST NOT |
|
81 | - // store any part of either this response or the request that elicited it. |
|
82 | - $cacheControl = $resp->getParsedCacheControl(); |
|
83 | - if (isset($cacheControl['no-store'])) { |
|
84 | - return false; |
|
85 | - } |
|
86 | - |
|
87 | - // Pragma: no-cache is an http request directive, but is occasionally |
|
88 | - // used as a response header incorrectly. |
|
89 | - $pragma = $resp->getResponseHeader('pragma'); |
|
90 | - if ($pragma == 'no-cache' || strpos($pragma, 'no-cache') !== false) { |
|
91 | - return false; |
|
92 | - } |
|
93 | - |
|
94 | - // [rfc2616-14.44] Vary: * is extremely difficult to cache. "It implies that |
|
95 | - // a cache cannot determine from the request headers of a subsequent request |
|
96 | - // whether this response is the appropriate representation." |
|
97 | - // Given this, we deem responses with the Vary header as uncacheable. |
|
98 | - $vary = $resp->getResponseHeader('vary'); |
|
99 | - if ($vary) { |
|
100 | - return false; |
|
101 | - } |
|
102 | - |
|
103 | - return true; |
|
62 | + // First, check if the HTTP request was cacheable before inspecting the |
|
63 | + // HTTP response. |
|
64 | + if (false == self::isRequestCacheable($resp)) { |
|
65 | + return false; |
|
66 | + } |
|
67 | + |
|
68 | + $code = $resp->getResponseHttpCode(); |
|
69 | + if (! in_array($code, self::$CACHEABLE_STATUS_CODES)) { |
|
70 | + return false; |
|
71 | + } |
|
72 | + |
|
73 | + // The resource is uncacheable if the resource is already expired and |
|
74 | + // the resource doesn't have an ETag for revalidation. |
|
75 | + $etag = $resp->getResponseHeader("etag"); |
|
76 | + if (self::isExpired($resp) && $etag == false) { |
|
77 | + return false; |
|
78 | + } |
|
79 | + |
|
80 | + // [rfc2616-14.9.2] If [no-store is] sent in a response, a cache MUST NOT |
|
81 | + // store any part of either this response or the request that elicited it. |
|
82 | + $cacheControl = $resp->getParsedCacheControl(); |
|
83 | + if (isset($cacheControl['no-store'])) { |
|
84 | + return false; |
|
85 | + } |
|
86 | + |
|
87 | + // Pragma: no-cache is an http request directive, but is occasionally |
|
88 | + // used as a response header incorrectly. |
|
89 | + $pragma = $resp->getResponseHeader('pragma'); |
|
90 | + if ($pragma == 'no-cache' || strpos($pragma, 'no-cache') !== false) { |
|
91 | + return false; |
|
92 | + } |
|
93 | + |
|
94 | + // [rfc2616-14.44] Vary: * is extremely difficult to cache. "It implies that |
|
95 | + // a cache cannot determine from the request headers of a subsequent request |
|
96 | + // whether this response is the appropriate representation." |
|
97 | + // Given this, we deem responses with the Vary header as uncacheable. |
|
98 | + $vary = $resp->getResponseHeader('vary'); |
|
99 | + if ($vary) { |
|
100 | + return false; |
|
101 | + } |
|
102 | + |
|
103 | + return true; |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | /** |
@@ -110,52 +110,52 @@ discard block |
||
110 | 110 | * False if it is considered to be fresh. |
111 | 111 | */ |
112 | 112 | public static function isExpired(Google_HttpRequest $resp) { |
113 | - // HTTP/1.1 clients and caches MUST treat other invalid date formats, |
|
114 | - // especially including the value “0”, as in the past. |
|
115 | - $parsedExpires = false; |
|
116 | - $responseHeaders = $resp->getResponseHeaders(); |
|
117 | - if (isset($responseHeaders['expires'])) { |
|
118 | - $rawExpires = $responseHeaders['expires']; |
|
119 | - // Check for a malformed expires header first. |
|
120 | - if (empty($rawExpires) || (is_numeric($rawExpires) && $rawExpires <= 0)) { |
|
121 | - return true; |
|
122 | - } |
|
123 | - |
|
124 | - // See if we can parse the expires header. |
|
125 | - $parsedExpires = strtotime($rawExpires); |
|
126 | - if (false == $parsedExpires || $parsedExpires <= 0) { |
|
127 | - return true; |
|
128 | - } |
|
129 | - } |
|
130 | - |
|
131 | - // Calculate the freshness of an http response. |
|
132 | - $freshnessLifetime = false; |
|
133 | - $cacheControl = $resp->getParsedCacheControl(); |
|
134 | - if (isset($cacheControl['max-age'])) { |
|
135 | - $freshnessLifetime = $cacheControl['max-age']; |
|
136 | - } |
|
137 | - |
|
138 | - $rawDate = $resp->getResponseHeader('date'); |
|
139 | - $parsedDate = strtotime($rawDate); |
|
140 | - |
|
141 | - if (empty($rawDate) || false == $parsedDate) { |
|
142 | - $parsedDate = time(); |
|
143 | - } |
|
144 | - if (false == $freshnessLifetime && isset($responseHeaders['expires'])) { |
|
145 | - $freshnessLifetime = $parsedExpires - $parsedDate; |
|
146 | - } |
|
147 | - |
|
148 | - if (false == $freshnessLifetime) { |
|
149 | - return true; |
|
150 | - } |
|
151 | - |
|
152 | - // Calculate the age of an http response. |
|
153 | - $age = max(0, time() - $parsedDate); |
|
154 | - if (isset($responseHeaders['age'])) { |
|
155 | - $age = max($age, strtotime($responseHeaders['age'])); |
|
156 | - } |
|
157 | - |
|
158 | - return $freshnessLifetime <= $age; |
|
113 | + // HTTP/1.1 clients and caches MUST treat other invalid date formats, |
|
114 | + // especially including the value “0”, as in the past. |
|
115 | + $parsedExpires = false; |
|
116 | + $responseHeaders = $resp->getResponseHeaders(); |
|
117 | + if (isset($responseHeaders['expires'])) { |
|
118 | + $rawExpires = $responseHeaders['expires']; |
|
119 | + // Check for a malformed expires header first. |
|
120 | + if (empty($rawExpires) || (is_numeric($rawExpires) && $rawExpires <= 0)) { |
|
121 | + return true; |
|
122 | + } |
|
123 | + |
|
124 | + // See if we can parse the expires header. |
|
125 | + $parsedExpires = strtotime($rawExpires); |
|
126 | + if (false == $parsedExpires || $parsedExpires <= 0) { |
|
127 | + return true; |
|
128 | + } |
|
129 | + } |
|
130 | + |
|
131 | + // Calculate the freshness of an http response. |
|
132 | + $freshnessLifetime = false; |
|
133 | + $cacheControl = $resp->getParsedCacheControl(); |
|
134 | + if (isset($cacheControl['max-age'])) { |
|
135 | + $freshnessLifetime = $cacheControl['max-age']; |
|
136 | + } |
|
137 | + |
|
138 | + $rawDate = $resp->getResponseHeader('date'); |
|
139 | + $parsedDate = strtotime($rawDate); |
|
140 | + |
|
141 | + if (empty($rawDate) || false == $parsedDate) { |
|
142 | + $parsedDate = time(); |
|
143 | + } |
|
144 | + if (false == $freshnessLifetime && isset($responseHeaders['expires'])) { |
|
145 | + $freshnessLifetime = $parsedExpires - $parsedDate; |
|
146 | + } |
|
147 | + |
|
148 | + if (false == $freshnessLifetime) { |
|
149 | + return true; |
|
150 | + } |
|
151 | + |
|
152 | + // Calculate the age of an http response. |
|
153 | + $age = max(0, time() - $parsedDate); |
|
154 | + if (isset($responseHeaders['age'])) { |
|
155 | + $age = max($age, strtotime($responseHeaders['age'])); |
|
156 | + } |
|
157 | + |
|
158 | + return $freshnessLifetime <= $age; |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | /** |
@@ -165,9 +165,9 @@ discard block |
||
165 | 165 | * @return bool True if the entry is expired, else return false. |
166 | 166 | */ |
167 | 167 | public static function mustRevalidate(Google_HttpRequest $response) { |
168 | - // [13.3] When a cache has a stale entry that it would like to use as a |
|
169 | - // response to a client's request, it first has to check with the origin |
|
170 | - // server to see if its cached entry is still usable. |
|
171 | - return self::isExpired($response); |
|
168 | + // [13.3] When a cache has a stale entry that it would like to use as a |
|
169 | + // response to a client's request, it first has to check with the origin |
|
170 | + // server to see if its cached entry is still usable. |
|
171 | + return self::isExpired($response); |
|
172 | 172 | } |
173 | 173 | } |
174 | 174 | \ No newline at end of file |
@@ -33,9 +33,9 @@ discard block |
||
33 | 33 | * @return bool True if the request is cacheable. |
34 | 34 | * False if the request is uncacheable. |
35 | 35 | */ |
36 | - public static function isRequestCacheable (Google_HttpRequest $resp) { |
|
36 | + public static function isRequestCacheable(Google_HttpRequest $resp) { |
|
37 | 37 | $method = $resp->getRequestMethod(); |
38 | - if (! in_array($method, self::$CACHEABLE_HTTP_METHODS)) { |
|
38 | + if (!in_array($method, self::$CACHEABLE_HTTP_METHODS)) { |
|
39 | 39 | return false; |
40 | 40 | } |
41 | 41 | |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | * @return bool True if the response is cacheable. |
59 | 59 | * False if the response is un-cacheable. |
60 | 60 | */ |
61 | - public static function isResponseCacheable (Google_HttpRequest $resp) { |
|
61 | + public static function isResponseCacheable(Google_HttpRequest $resp) { |
|
62 | 62 | // First, check if the HTTP request was cacheable before inspecting the |
63 | 63 | // HTTP response. |
64 | 64 | if (false == self::isRequestCacheable($resp)) { |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | } |
67 | 67 | |
68 | 68 | $code = $resp->getResponseHttpCode(); |
69 | - if (! in_array($code, self::$CACHEABLE_STATUS_CODES)) { |
|
69 | + if (!in_array($code, self::$CACHEABLE_STATUS_CODES)) { |
|
70 | 70 | return false; |
71 | 71 | } |
72 | 72 |
@@ -26,85 +26,85 @@ |
||
26 | 26 | private $requests = array(); |
27 | 27 | |
28 | 28 | public function __construct($boundary = false) { |
29 | - $boundary = (false == $boundary) ? mt_rand() : $boundary; |
|
30 | - $this->boundary = str_replace('"', '', $boundary); |
|
29 | + $boundary = (false == $boundary) ? mt_rand() : $boundary; |
|
30 | + $this->boundary = str_replace('"', '', $boundary); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | public function add(Google_HttpRequest $request, $key = false) { |
34 | - if (false == $key) { |
|
35 | - $key = mt_rand(); |
|
36 | - } |
|
34 | + if (false == $key) { |
|
35 | + $key = mt_rand(); |
|
36 | + } |
|
37 | 37 | |
38 | - $this->requests[$key] = $request; |
|
38 | + $this->requests[$key] = $request; |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | public function execute() { |
42 | - $body = ''; |
|
42 | + $body = ''; |
|
43 | 43 | |
44 | - /** @var Google_HttpRequest $req */ |
|
45 | - foreach($this->requests as $key => $req) { |
|
46 | - $body .= "--{$this->boundary}\n"; |
|
47 | - $body .= $req->toBatchString($key) . "\n"; |
|
48 | - } |
|
44 | + /** @var Google_HttpRequest $req */ |
|
45 | + foreach($this->requests as $key => $req) { |
|
46 | + $body .= "--{$this->boundary}\n"; |
|
47 | + $body .= $req->toBatchString($key) . "\n"; |
|
48 | + } |
|
49 | 49 | |
50 | - $body = rtrim($body); |
|
51 | - $body .= "\n--{$this->boundary}--"; |
|
50 | + $body = rtrim($body); |
|
51 | + $body .= "\n--{$this->boundary}--"; |
|
52 | 52 | |
53 | - global $apiConfig; |
|
54 | - $url = $apiConfig['basePath'] . '/batch'; |
|
55 | - $httpRequest = new Google_HttpRequest($url, 'POST'); |
|
56 | - $httpRequest->setRequestHeaders(array( |
|
57 | - 'Content-Type' => 'multipart/mixed; boundary=' . $this->boundary)); |
|
53 | + global $apiConfig; |
|
54 | + $url = $apiConfig['basePath'] . '/batch'; |
|
55 | + $httpRequest = new Google_HttpRequest($url, 'POST'); |
|
56 | + $httpRequest->setRequestHeaders(array( |
|
57 | + 'Content-Type' => 'multipart/mixed; boundary=' . $this->boundary)); |
|
58 | 58 | |
59 | - $httpRequest->setPostBody($body); |
|
60 | - $response = Google_Client::$io->makeRequest($httpRequest); |
|
59 | + $httpRequest->setPostBody($body); |
|
60 | + $response = Google_Client::$io->makeRequest($httpRequest); |
|
61 | 61 | |
62 | - $response = $this->parseResponse($response); |
|
63 | - return $response; |
|
62 | + $response = $this->parseResponse($response); |
|
63 | + return $response; |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | public function parseResponse(Google_HttpRequest $response) { |
67 | - $contentType = $response->getResponseHeader('content-type'); |
|
68 | - $contentType = explode(';', $contentType); |
|
69 | - $boundary = false; |
|
70 | - foreach($contentType as $part) { |
|
71 | - $part = (explode('=', $part, 2)); |
|
72 | - if (isset($part[0]) && 'boundary' == trim($part[0])) { |
|
73 | - $boundary = $part[1]; |
|
74 | - } |
|
75 | - } |
|
76 | - |
|
77 | - $body = $response->getResponseBody(); |
|
78 | - if ($body) { |
|
79 | - $body = str_replace("--$boundary--", "--$boundary", $body); |
|
80 | - $parts = explode("--$boundary", $body); |
|
81 | - $responses = array(); |
|
82 | - |
|
83 | - foreach($parts as $part) { |
|
84 | - $part = trim($part); |
|
85 | - if (!empty($part)) { |
|
86 | - list($metaHeaders, $part) = explode("\r\n\r\n", $part, 2); |
|
87 | - $metaHeaders = Google_CurlIO::parseResponseHeaders($metaHeaders); |
|
88 | - |
|
89 | - $status = substr($part, 0, strpos($part, "\n")); |
|
90 | - $status = explode(" ", $status); |
|
91 | - $status = $status[1]; |
|
92 | - |
|
93 | - list($partHeaders, $partBody) = Google_CurlIO::parseHttpResponse($part, false); |
|
94 | - $response = new Google_HttpRequest(""); |
|
95 | - $response->setResponseHttpCode($status); |
|
96 | - $response->setResponseHeaders($partHeaders); |
|
97 | - $response->setResponseBody($partBody); |
|
98 | - $response = Google_REST::decodeHttpResponse($response); |
|
99 | - |
|
100 | - // Need content id. |
|
101 | - $responses[$metaHeaders['content-id']] = $response; |
|
102 | - } |
|
103 | - } |
|
104 | - |
|
105 | - return $responses; |
|
106 | - } |
|
107 | - |
|
108 | - return null; |
|
67 | + $contentType = $response->getResponseHeader('content-type'); |
|
68 | + $contentType = explode(';', $contentType); |
|
69 | + $boundary = false; |
|
70 | + foreach($contentType as $part) { |
|
71 | + $part = (explode('=', $part, 2)); |
|
72 | + if (isset($part[0]) && 'boundary' == trim($part[0])) { |
|
73 | + $boundary = $part[1]; |
|
74 | + } |
|
75 | + } |
|
76 | + |
|
77 | + $body = $response->getResponseBody(); |
|
78 | + if ($body) { |
|
79 | + $body = str_replace("--$boundary--", "--$boundary", $body); |
|
80 | + $parts = explode("--$boundary", $body); |
|
81 | + $responses = array(); |
|
82 | + |
|
83 | + foreach($parts as $part) { |
|
84 | + $part = trim($part); |
|
85 | + if (!empty($part)) { |
|
86 | + list($metaHeaders, $part) = explode("\r\n\r\n", $part, 2); |
|
87 | + $metaHeaders = Google_CurlIO::parseResponseHeaders($metaHeaders); |
|
88 | + |
|
89 | + $status = substr($part, 0, strpos($part, "\n")); |
|
90 | + $status = explode(" ", $status); |
|
91 | + $status = $status[1]; |
|
92 | + |
|
93 | + list($partHeaders, $partBody) = Google_CurlIO::parseHttpResponse($part, false); |
|
94 | + $response = new Google_HttpRequest(""); |
|
95 | + $response->setResponseHttpCode($status); |
|
96 | + $response->setResponseHeaders($partHeaders); |
|
97 | + $response->setResponseBody($partBody); |
|
98 | + $response = Google_REST::decodeHttpResponse($response); |
|
99 | + |
|
100 | + // Need content id. |
|
101 | + $responses[$metaHeaders['content-id']] = $response; |
|
102 | + } |
|
103 | + } |
|
104 | + |
|
105 | + return $responses; |
|
106 | + } |
|
107 | + |
|
108 | + return null; |
|
109 | 109 | } |
110 | 110 | } |
111 | 111 | \ No newline at end of file |
@@ -42,19 +42,19 @@ discard block |
||
42 | 42 | $body = ''; |
43 | 43 | |
44 | 44 | /** @var Google_HttpRequest $req */ |
45 | - foreach($this->requests as $key => $req) { |
|
45 | + foreach ($this->requests as $key => $req) { |
|
46 | 46 | $body .= "--{$this->boundary}\n"; |
47 | - $body .= $req->toBatchString($key) . "\n"; |
|
47 | + $body .= $req->toBatchString($key)."\n"; |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | $body = rtrim($body); |
51 | 51 | $body .= "\n--{$this->boundary}--"; |
52 | 52 | |
53 | 53 | global $apiConfig; |
54 | - $url = $apiConfig['basePath'] . '/batch'; |
|
54 | + $url = $apiConfig['basePath'].'/batch'; |
|
55 | 55 | $httpRequest = new Google_HttpRequest($url, 'POST'); |
56 | 56 | $httpRequest->setRequestHeaders(array( |
57 | - 'Content-Type' => 'multipart/mixed; boundary=' . $this->boundary)); |
|
57 | + 'Content-Type' => 'multipart/mixed; boundary='.$this->boundary)); |
|
58 | 58 | |
59 | 59 | $httpRequest->setPostBody($body); |
60 | 60 | $response = Google_Client::$io->makeRequest($httpRequest); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | $contentType = $response->getResponseHeader('content-type'); |
68 | 68 | $contentType = explode(';', $contentType); |
69 | 69 | $boundary = false; |
70 | - foreach($contentType as $part) { |
|
70 | + foreach ($contentType as $part) { |
|
71 | 71 | $part = (explode('=', $part, 2)); |
72 | 72 | if (isset($part[0]) && 'boundary' == trim($part[0])) { |
73 | 73 | $boundary = $part[1]; |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | $parts = explode("--$boundary", $body); |
81 | 81 | $responses = array(); |
82 | 82 | |
83 | - foreach($parts as $part) { |
|
83 | + foreach ($parts as $part) { |
|
84 | 84 | $part = trim($part); |
85 | 85 | if (!empty($part)) { |
86 | 86 | list($metaHeaders, $part) = explode("\r\n\r\n", $part, 2); |
@@ -7,232 +7,232 @@ discard block |
||
7 | 7 | */ |
8 | 8 | |
9 | 9 | function geodir_property_sale_custom_fields($post_type='gd_place',$package_id=''){ |
10 | - $fields = array(); |
|
11 | - $package = ($package_id=='') ? '' : array($package_id); |
|
12 | - |
|
13 | - // Salary |
|
14 | - $fields[] = array('listing_type' => $post_type, |
|
15 | - 'field_type' => 'text', |
|
16 | - 'data_type' => 'FLOAT', |
|
17 | - 'decimal_point' => '2', |
|
18 | - 'admin_title' => __('Salary', 'geodirectory'), |
|
19 | - 'site_title' => __('Salary', 'geodirectory'), |
|
20 | - 'admin_desc' => __('Enter the Salary in $ (no currency symbol) ie: 25000', 'geodirectory'), |
|
21 | - 'htmlvar_name' => 'salary', |
|
22 | - 'is_active' => true, |
|
23 | - 'for_admin_use' => false, |
|
24 | - 'default_value' => '', |
|
25 | - 'show_in' => '[detail],[listing]', |
|
26 | - 'is_required' => false, |
|
27 | - 'validation_pattern' => '\d+(\.\d{2})?', |
|
28 | - 'validation_msg' => 'Please enter number and decimal only ie: 100.50', |
|
29 | - 'required_msg' => '', |
|
30 | - 'field_icon' => 'fa fa-usd', |
|
31 | - 'css_class' => '', |
|
32 | - 'cat_sort' => true, |
|
33 | - 'cat_filter' => true, |
|
34 | - 'extra' => array( |
|
35 | - 'is_price' => 1, |
|
36 | - 'thousand_separator' => 'comma', |
|
37 | - 'decimal_separator' => 'period', |
|
38 | - 'decimal_display' => 'if', |
|
39 | - 'currency_symbol' => '$', |
|
40 | - 'currency_symbol_placement' => 'left' |
|
41 | - ) |
|
42 | - ); |
|
43 | - |
|
44 | - |
|
45 | - |
|
46 | - // Job Type |
|
47 | - $fields[] = array('listing_type' => $post_type, |
|
48 | - 'field_type' => 'select', |
|
49 | - 'data_type' => 'VARCHAR', |
|
50 | - 'admin_title' => __('Job Type', 'geodirectory'), |
|
51 | - 'site_title' => __('Job Type','geodirectory'), |
|
52 | - 'admin_desc' => __('Select the type of job.','geodirectory'), |
|
53 | - 'htmlvar_name' => 'job_type', |
|
54 | - 'is_active' => true, |
|
55 | - 'for_admin_use' => false, |
|
56 | - 'default_value' => '', |
|
57 | - 'show_in' => '[detail],[listing]', |
|
58 | - 'is_required' => true, |
|
59 | - 'option_values' => __('Select Type/,Freelance,Full Time,Internship,Part Time,Temporary,Other','geodirectory'), |
|
60 | - 'validation_pattern' => '', |
|
61 | - 'validation_msg' => '', |
|
62 | - 'required_msg' => '', |
|
63 | - 'field_icon' => 'fa fa-briefcase', |
|
64 | - 'css_class' => '', |
|
65 | - 'cat_sort' => true, |
|
66 | - 'cat_filter' => true |
|
67 | - ); |
|
68 | - |
|
69 | - // Job Sector |
|
70 | - $fields[] = array('listing_type' => $post_type, |
|
71 | - 'field_type' => 'select', |
|
72 | - 'data_type' => 'VARCHAR', |
|
73 | - 'admin_title' => __('Job Sector','geodirectory'), |
|
74 | - 'site_title' => __('Job Sector','geodirectory'), |
|
75 | - 'admin_desc' => __('Select the job sector.','geodirectory'), |
|
76 | - 'htmlvar_name' => 'job_sector', |
|
77 | - 'is_active' => true, |
|
78 | - 'for_admin_use' => false, |
|
79 | - 'default_value' => '', |
|
80 | - 'show_in' => '[detail]', |
|
81 | - 'is_required' => true, |
|
82 | - 'option_values' => __('Select Sector/,Private Sector,Public Sector,Agencies','geodirectory'), |
|
83 | - 'validation_pattern' => '', |
|
84 | - 'validation_msg' => '', |
|
85 | - 'required_msg' => '', |
|
86 | - 'field_icon' => 'fa fa-briefcase', |
|
87 | - 'css_class' => '', |
|
88 | - 'cat_sort' => true, |
|
89 | - 'cat_filter' => true |
|
90 | - ); |
|
91 | - |
|
92 | - // Required Experience |
|
93 | - $fields[] = array('listing_type' => $post_type, |
|
94 | - 'field_type' => 'select', |
|
95 | - 'data_type' => 'VARCHAR', |
|
96 | - 'admin_title' => __('Required Experience', 'geodirectory'), |
|
97 | - 'site_title' => __('Required Experience', 'geodirectory'), |
|
98 | - 'admin_desc' => __('Select the number of years required experience', 'geodirectory'), |
|
99 | - 'htmlvar_name' => 'job_experience', |
|
100 | - 'is_active' => true, |
|
101 | - 'for_admin_use' => false, |
|
102 | - 'default_value' => '', |
|
103 | - 'show_in' => '[detail],[listing]', |
|
104 | - 'is_required' => true, |
|
105 | - 'option_values' => __('Select Experience/,No Experience Required,1 Year,2 Years,3 Years,4 Years,5 Years,6 Years,7 Years,8 Years,9 Years,10+ Years','geodirectory'), |
|
106 | - 'validation_pattern' => '', |
|
107 | - 'validation_msg' => '', |
|
108 | - 'required_msg' => '', |
|
109 | - 'field_icon' => 'fa fa-life-ring', |
|
110 | - 'css_class' => '', |
|
111 | - 'cat_sort' => true, |
|
112 | - 'cat_filter' => true |
|
113 | - ); |
|
114 | - |
|
115 | - // Required Skills |
|
116 | - $fields[] = array('listing_type' => $post_type, |
|
117 | - 'field_type' => 'textarea', |
|
118 | - 'data_type' => 'TEXT', |
|
119 | - 'admin_title' => __('Required Skills', 'geodirectory'), |
|
120 | - 'site_title' => __('Required Skills', 'geodirectory'), |
|
121 | - 'admin_desc' => __('Enter the required skills for the job', 'geodirectory'), |
|
122 | - 'htmlvar_name' => 'property_area', |
|
123 | - 'is_active' => true, |
|
124 | - 'for_admin_use' => false, |
|
125 | - 'default_value' => '', |
|
126 | - 'show_in' => '[detail],[listing]', |
|
127 | - 'is_required' => false, |
|
128 | - 'validation_pattern' => '', |
|
129 | - 'validation_msg' => '', |
|
130 | - 'required_msg' => '', |
|
131 | - 'field_icon' => 'fa fa-area-chart', |
|
132 | - 'css_class' => '', |
|
133 | - 'cat_sort' => true, |
|
134 | - 'cat_filter' => true |
|
135 | - ); |
|
136 | - |
|
137 | - |
|
138 | - |
|
139 | - // Company details fieldset |
|
140 | - $fields[] = array('listing_type' => $post_type, |
|
141 | - 'field_type' => 'fieldset', |
|
142 | - 'data_type' => '', |
|
143 | - 'admin_title' => __('Company Details', 'geodirectory'), |
|
144 | - 'site_title' => __('Company Details', 'geodirectory'), |
|
145 | - 'admin_desc' => __('Enter your company details here', 'geodirectory'), |
|
146 | - 'htmlvar_name' => 'job_company_details', |
|
147 | - 'is_active' => true, |
|
148 | - 'for_admin_use' => false, |
|
149 | - 'show_in' => '[owntab]' |
|
150 | - |
|
151 | - ); |
|
152 | - |
|
153 | - // Company Name |
|
154 | - $fields[] = array('listing_type' => $post_type, |
|
155 | - 'field_type' => 'text', |
|
156 | - 'data_type' => 'VARCHAR', |
|
157 | - 'admin_title' => __('Company Name', 'geodirectory'), |
|
158 | - 'site_title' => __('Company Name', 'geodirectory'), |
|
159 | - 'admin_desc' => __('Enter your company name', 'geodirectory'), |
|
160 | - 'htmlvar_name' => 'job_company_name', |
|
161 | - 'is_active' => true, |
|
162 | - 'for_admin_use' => false, |
|
163 | - 'default_value' => '', |
|
164 | - 'show_in' => '[owntab]', |
|
165 | - 'is_required' => false, |
|
166 | - 'validation_pattern' => '', |
|
167 | - 'validation_msg' => '', |
|
168 | - 'required_msg' => '', |
|
169 | - 'field_icon' => 'fa fa-arrow-circle-right', |
|
170 | - 'css_class' => '', |
|
171 | - 'cat_sort' => false, |
|
172 | - 'cat_filter' => false |
|
173 | - ); |
|
174 | - |
|
175 | - // Company Logo |
|
176 | - $fields[] = array('listing_type' => $post_type, |
|
177 | - 'field_type' => 'file', |
|
178 | - 'data_type' => '', |
|
179 | - 'admin_title' => __('Company Logo', 'geodirectory'), |
|
180 | - 'site_title' => __('Company Logo', 'geodirectory'), |
|
181 | - 'admin_desc' => __('Enter your company Logo', 'geodirectory'), |
|
182 | - 'htmlvar_name' => 'job_company_logo', |
|
183 | - 'is_active' => true, |
|
184 | - 'for_admin_use' => false, |
|
185 | - 'default_value' => '', |
|
186 | - 'show_in' => '[owntab]', |
|
187 | - 'is_required' => false, |
|
188 | - 'validation_pattern' => '', |
|
189 | - 'validation_msg' => '', |
|
190 | - 'required_msg' => '', |
|
191 | - 'field_icon' => 'fa fa-arrow-circle-right', |
|
192 | - 'css_class' => '', |
|
193 | - 'cat_sort' => false, |
|
194 | - 'cat_filter' => false, |
|
195 | - 'extra' => array( |
|
196 | - 'gd_file_types' => 'jpg', |
|
197 | - 'gd_file_types' => 'jpeg', |
|
198 | - 'gd_file_types' => 'gif', |
|
199 | - 'gd_file_types' => 'png', |
|
200 | - ) |
|
201 | - ); |
|
202 | - |
|
203 | - // Company Url |
|
204 | - $fields[] = array('listing_type' => $post_type, |
|
205 | - 'field_type' => 'url', |
|
206 | - 'data_type' => 'VARCHAR', |
|
207 | - 'admin_title' => __('Company Url', 'geodirectory'), |
|
208 | - 'site_title' => __('Company Url', 'geodirectory'), |
|
209 | - 'admin_desc' => __('Enter your company Url', 'geodirectory'), |
|
210 | - 'htmlvar_name' => 'job_company_url', |
|
211 | - 'is_active' => true, |
|
212 | - 'for_admin_use' => false, |
|
213 | - 'default_value' => '', |
|
214 | - 'show_in' => '[owntab]', |
|
215 | - 'is_required' => false, |
|
216 | - 'validation_pattern' => '', |
|
217 | - 'validation_msg' => '', |
|
218 | - 'required_msg' => '', |
|
219 | - 'field_icon' => 'fa fa-arrow-circle-right', |
|
220 | - 'css_class' => '', |
|
221 | - 'cat_sort' => false, |
|
222 | - 'cat_filter' => false |
|
223 | - ); |
|
224 | - |
|
225 | - |
|
226 | - |
|
227 | - /** |
|
228 | - * Filter the array of default custom fields DB table data. |
|
229 | - * |
|
230 | - * @since 1.6.6 |
|
231 | - * @param string $fields The default custom fields as an array. |
|
232 | - */ |
|
233 | - $fields = apply_filters('geodir_property_sale_custom_fields', $fields); |
|
234 | - |
|
235 | - return $fields; |
|
10 | + $fields = array(); |
|
11 | + $package = ($package_id=='') ? '' : array($package_id); |
|
12 | + |
|
13 | + // Salary |
|
14 | + $fields[] = array('listing_type' => $post_type, |
|
15 | + 'field_type' => 'text', |
|
16 | + 'data_type' => 'FLOAT', |
|
17 | + 'decimal_point' => '2', |
|
18 | + 'admin_title' => __('Salary', 'geodirectory'), |
|
19 | + 'site_title' => __('Salary', 'geodirectory'), |
|
20 | + 'admin_desc' => __('Enter the Salary in $ (no currency symbol) ie: 25000', 'geodirectory'), |
|
21 | + 'htmlvar_name' => 'salary', |
|
22 | + 'is_active' => true, |
|
23 | + 'for_admin_use' => false, |
|
24 | + 'default_value' => '', |
|
25 | + 'show_in' => '[detail],[listing]', |
|
26 | + 'is_required' => false, |
|
27 | + 'validation_pattern' => '\d+(\.\d{2})?', |
|
28 | + 'validation_msg' => 'Please enter number and decimal only ie: 100.50', |
|
29 | + 'required_msg' => '', |
|
30 | + 'field_icon' => 'fa fa-usd', |
|
31 | + 'css_class' => '', |
|
32 | + 'cat_sort' => true, |
|
33 | + 'cat_filter' => true, |
|
34 | + 'extra' => array( |
|
35 | + 'is_price' => 1, |
|
36 | + 'thousand_separator' => 'comma', |
|
37 | + 'decimal_separator' => 'period', |
|
38 | + 'decimal_display' => 'if', |
|
39 | + 'currency_symbol' => '$', |
|
40 | + 'currency_symbol_placement' => 'left' |
|
41 | + ) |
|
42 | + ); |
|
43 | + |
|
44 | + |
|
45 | + |
|
46 | + // Job Type |
|
47 | + $fields[] = array('listing_type' => $post_type, |
|
48 | + 'field_type' => 'select', |
|
49 | + 'data_type' => 'VARCHAR', |
|
50 | + 'admin_title' => __('Job Type', 'geodirectory'), |
|
51 | + 'site_title' => __('Job Type','geodirectory'), |
|
52 | + 'admin_desc' => __('Select the type of job.','geodirectory'), |
|
53 | + 'htmlvar_name' => 'job_type', |
|
54 | + 'is_active' => true, |
|
55 | + 'for_admin_use' => false, |
|
56 | + 'default_value' => '', |
|
57 | + 'show_in' => '[detail],[listing]', |
|
58 | + 'is_required' => true, |
|
59 | + 'option_values' => __('Select Type/,Freelance,Full Time,Internship,Part Time,Temporary,Other','geodirectory'), |
|
60 | + 'validation_pattern' => '', |
|
61 | + 'validation_msg' => '', |
|
62 | + 'required_msg' => '', |
|
63 | + 'field_icon' => 'fa fa-briefcase', |
|
64 | + 'css_class' => '', |
|
65 | + 'cat_sort' => true, |
|
66 | + 'cat_filter' => true |
|
67 | + ); |
|
68 | + |
|
69 | + // Job Sector |
|
70 | + $fields[] = array('listing_type' => $post_type, |
|
71 | + 'field_type' => 'select', |
|
72 | + 'data_type' => 'VARCHAR', |
|
73 | + 'admin_title' => __('Job Sector','geodirectory'), |
|
74 | + 'site_title' => __('Job Sector','geodirectory'), |
|
75 | + 'admin_desc' => __('Select the job sector.','geodirectory'), |
|
76 | + 'htmlvar_name' => 'job_sector', |
|
77 | + 'is_active' => true, |
|
78 | + 'for_admin_use' => false, |
|
79 | + 'default_value' => '', |
|
80 | + 'show_in' => '[detail]', |
|
81 | + 'is_required' => true, |
|
82 | + 'option_values' => __('Select Sector/,Private Sector,Public Sector,Agencies','geodirectory'), |
|
83 | + 'validation_pattern' => '', |
|
84 | + 'validation_msg' => '', |
|
85 | + 'required_msg' => '', |
|
86 | + 'field_icon' => 'fa fa-briefcase', |
|
87 | + 'css_class' => '', |
|
88 | + 'cat_sort' => true, |
|
89 | + 'cat_filter' => true |
|
90 | + ); |
|
91 | + |
|
92 | + // Required Experience |
|
93 | + $fields[] = array('listing_type' => $post_type, |
|
94 | + 'field_type' => 'select', |
|
95 | + 'data_type' => 'VARCHAR', |
|
96 | + 'admin_title' => __('Required Experience', 'geodirectory'), |
|
97 | + 'site_title' => __('Required Experience', 'geodirectory'), |
|
98 | + 'admin_desc' => __('Select the number of years required experience', 'geodirectory'), |
|
99 | + 'htmlvar_name' => 'job_experience', |
|
100 | + 'is_active' => true, |
|
101 | + 'for_admin_use' => false, |
|
102 | + 'default_value' => '', |
|
103 | + 'show_in' => '[detail],[listing]', |
|
104 | + 'is_required' => true, |
|
105 | + 'option_values' => __('Select Experience/,No Experience Required,1 Year,2 Years,3 Years,4 Years,5 Years,6 Years,7 Years,8 Years,9 Years,10+ Years','geodirectory'), |
|
106 | + 'validation_pattern' => '', |
|
107 | + 'validation_msg' => '', |
|
108 | + 'required_msg' => '', |
|
109 | + 'field_icon' => 'fa fa-life-ring', |
|
110 | + 'css_class' => '', |
|
111 | + 'cat_sort' => true, |
|
112 | + 'cat_filter' => true |
|
113 | + ); |
|
114 | + |
|
115 | + // Required Skills |
|
116 | + $fields[] = array('listing_type' => $post_type, |
|
117 | + 'field_type' => 'textarea', |
|
118 | + 'data_type' => 'TEXT', |
|
119 | + 'admin_title' => __('Required Skills', 'geodirectory'), |
|
120 | + 'site_title' => __('Required Skills', 'geodirectory'), |
|
121 | + 'admin_desc' => __('Enter the required skills for the job', 'geodirectory'), |
|
122 | + 'htmlvar_name' => 'property_area', |
|
123 | + 'is_active' => true, |
|
124 | + 'for_admin_use' => false, |
|
125 | + 'default_value' => '', |
|
126 | + 'show_in' => '[detail],[listing]', |
|
127 | + 'is_required' => false, |
|
128 | + 'validation_pattern' => '', |
|
129 | + 'validation_msg' => '', |
|
130 | + 'required_msg' => '', |
|
131 | + 'field_icon' => 'fa fa-area-chart', |
|
132 | + 'css_class' => '', |
|
133 | + 'cat_sort' => true, |
|
134 | + 'cat_filter' => true |
|
135 | + ); |
|
136 | + |
|
137 | + |
|
138 | + |
|
139 | + // Company details fieldset |
|
140 | + $fields[] = array('listing_type' => $post_type, |
|
141 | + 'field_type' => 'fieldset', |
|
142 | + 'data_type' => '', |
|
143 | + 'admin_title' => __('Company Details', 'geodirectory'), |
|
144 | + 'site_title' => __('Company Details', 'geodirectory'), |
|
145 | + 'admin_desc' => __('Enter your company details here', 'geodirectory'), |
|
146 | + 'htmlvar_name' => 'job_company_details', |
|
147 | + 'is_active' => true, |
|
148 | + 'for_admin_use' => false, |
|
149 | + 'show_in' => '[owntab]' |
|
150 | + |
|
151 | + ); |
|
152 | + |
|
153 | + // Company Name |
|
154 | + $fields[] = array('listing_type' => $post_type, |
|
155 | + 'field_type' => 'text', |
|
156 | + 'data_type' => 'VARCHAR', |
|
157 | + 'admin_title' => __('Company Name', 'geodirectory'), |
|
158 | + 'site_title' => __('Company Name', 'geodirectory'), |
|
159 | + 'admin_desc' => __('Enter your company name', 'geodirectory'), |
|
160 | + 'htmlvar_name' => 'job_company_name', |
|
161 | + 'is_active' => true, |
|
162 | + 'for_admin_use' => false, |
|
163 | + 'default_value' => '', |
|
164 | + 'show_in' => '[owntab]', |
|
165 | + 'is_required' => false, |
|
166 | + 'validation_pattern' => '', |
|
167 | + 'validation_msg' => '', |
|
168 | + 'required_msg' => '', |
|
169 | + 'field_icon' => 'fa fa-arrow-circle-right', |
|
170 | + 'css_class' => '', |
|
171 | + 'cat_sort' => false, |
|
172 | + 'cat_filter' => false |
|
173 | + ); |
|
174 | + |
|
175 | + // Company Logo |
|
176 | + $fields[] = array('listing_type' => $post_type, |
|
177 | + 'field_type' => 'file', |
|
178 | + 'data_type' => '', |
|
179 | + 'admin_title' => __('Company Logo', 'geodirectory'), |
|
180 | + 'site_title' => __('Company Logo', 'geodirectory'), |
|
181 | + 'admin_desc' => __('Enter your company Logo', 'geodirectory'), |
|
182 | + 'htmlvar_name' => 'job_company_logo', |
|
183 | + 'is_active' => true, |
|
184 | + 'for_admin_use' => false, |
|
185 | + 'default_value' => '', |
|
186 | + 'show_in' => '[owntab]', |
|
187 | + 'is_required' => false, |
|
188 | + 'validation_pattern' => '', |
|
189 | + 'validation_msg' => '', |
|
190 | + 'required_msg' => '', |
|
191 | + 'field_icon' => 'fa fa-arrow-circle-right', |
|
192 | + 'css_class' => '', |
|
193 | + 'cat_sort' => false, |
|
194 | + 'cat_filter' => false, |
|
195 | + 'extra' => array( |
|
196 | + 'gd_file_types' => 'jpg', |
|
197 | + 'gd_file_types' => 'jpeg', |
|
198 | + 'gd_file_types' => 'gif', |
|
199 | + 'gd_file_types' => 'png', |
|
200 | + ) |
|
201 | + ); |
|
202 | + |
|
203 | + // Company Url |
|
204 | + $fields[] = array('listing_type' => $post_type, |
|
205 | + 'field_type' => 'url', |
|
206 | + 'data_type' => 'VARCHAR', |
|
207 | + 'admin_title' => __('Company Url', 'geodirectory'), |
|
208 | + 'site_title' => __('Company Url', 'geodirectory'), |
|
209 | + 'admin_desc' => __('Enter your company Url', 'geodirectory'), |
|
210 | + 'htmlvar_name' => 'job_company_url', |
|
211 | + 'is_active' => true, |
|
212 | + 'for_admin_use' => false, |
|
213 | + 'default_value' => '', |
|
214 | + 'show_in' => '[owntab]', |
|
215 | + 'is_required' => false, |
|
216 | + 'validation_pattern' => '', |
|
217 | + 'validation_msg' => '', |
|
218 | + 'required_msg' => '', |
|
219 | + 'field_icon' => 'fa fa-arrow-circle-right', |
|
220 | + 'css_class' => '', |
|
221 | + 'cat_sort' => false, |
|
222 | + 'cat_filter' => false |
|
223 | + ); |
|
224 | + |
|
225 | + |
|
226 | + |
|
227 | + /** |
|
228 | + * Filter the array of default custom fields DB table data. |
|
229 | + * |
|
230 | + * @since 1.6.6 |
|
231 | + * @param string $fields The default custom fields as an array. |
|
232 | + */ |
|
233 | + $fields = apply_filters('geodir_property_sale_custom_fields', $fields); |
|
234 | + |
|
235 | + return $fields; |
|
236 | 236 | } |
237 | 237 | |
238 | 238 | global $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2,$wpdb, $current_user,$dummy_post_index; |
@@ -242,36 +242,36 @@ discard block |
||
242 | 242 | $category_array = array('Apartments', 'Houses', 'Commercial', 'Land'); |
243 | 243 | |
244 | 244 | if($dummy_post_index==1){ |
245 | - // add the dummy categories |
|
246 | - geodir_dummy_data_taxonomies($post_type,$category_array ); |
|
245 | + // add the dummy categories |
|
246 | + geodir_dummy_data_taxonomies($post_type,$category_array ); |
|
247 | 247 | |
248 | - // add the dummy custom fields |
|
249 | - $fields = geodir_property_sale_custom_fields($post_type); |
|
250 | - geodir_create_dummy_fields($fields); |
|
251 | - update_option($post_type.'_dummy_data_type','property_sale'); |
|
248 | + // add the dummy custom fields |
|
249 | + $fields = geodir_property_sale_custom_fields($post_type); |
|
250 | + geodir_create_dummy_fields($fields); |
|
251 | + update_option($post_type.'_dummy_data_type','property_sale'); |
|
252 | 252 | } |
253 | 253 | |
254 | 254 | if (geodir_dummy_folder_exists()) |
255 | - $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy"; |
|
255 | + $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy"; |
|
256 | 256 | else |
257 | - $dummy_image_url = 'http://www.wpgeodirectory.com/dummy'; |
|
257 | + $dummy_image_url = 'http://www.wpgeodirectory.com/dummy'; |
|
258 | 258 | |
259 | 259 | $dummy_image_url = apply_filters('place_dummy_image_url', $dummy_image_url); |
260 | 260 | |
261 | 261 | switch ($dummy_post_index) { |
262 | 262 | |
263 | - case(1): |
|
264 | - $image_array[] = "$dummy_image_url/ps/psf1.jpg"; |
|
265 | - $image_array[] = "$dummy_image_url/ps/psl1.jpg"; |
|
266 | - $image_array[] = "$dummy_image_url/ps/psb1.jpg"; |
|
267 | - $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
268 | - $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
263 | + case(1): |
|
264 | + $image_array[] = "$dummy_image_url/ps/psf1.jpg"; |
|
265 | + $image_array[] = "$dummy_image_url/ps/psl1.jpg"; |
|
266 | + $image_array[] = "$dummy_image_url/ps/psb1.jpg"; |
|
267 | + $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
268 | + $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
269 | 269 | |
270 | 270 | |
271 | - $post_info[] = array( |
|
272 | - "listing_type" => $post_type, |
|
273 | - "post_title" => 'Eastern Lodge', |
|
274 | - "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec non augue ultrices, vulputate nulla at, consectetur ante. Quisque neque mi, vulputate quis nulla a, sollicitudin fringilla leo. Nam dictum id neque eu imperdiet. Curabitur ligula turpis, malesuada at lobortis commodo, vulputate volutpat arcu. Duis bibendum blandit aliquam. In ipsum diam, tristique ut bibendum vel, lobortis non tellus. Nulla ultricies, ante vitae placerat auctor, nisi quam blandit enim, sit amet aliquam est diam id urna. Suspendisse eget nibh volutpat, malesuada enim sed, egestas massa. |
|
271 | + $post_info[] = array( |
|
272 | + "listing_type" => $post_type, |
|
273 | + "post_title" => 'Eastern Lodge', |
|
274 | + "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec non augue ultrices, vulputate nulla at, consectetur ante. Quisque neque mi, vulputate quis nulla a, sollicitudin fringilla leo. Nam dictum id neque eu imperdiet. Curabitur ligula turpis, malesuada at lobortis commodo, vulputate volutpat arcu. Duis bibendum blandit aliquam. In ipsum diam, tristique ut bibendum vel, lobortis non tellus. Nulla ultricies, ante vitae placerat auctor, nisi quam blandit enim, sit amet aliquam est diam id urna. Suspendisse eget nibh volutpat, malesuada enim sed, egestas massa. |
|
275 | 275 | |
276 | 276 | Aliquam ut odio ullamcorper, posuere enim sed, venenatis tortor. Donec justo elit, aliquam sed cursus sed, semper eget libero. Mauris consequat lorem sed fringilla tincidunt. Phasellus suscipit velit et elit tristique, ac commodo metus scelerisque. Vivamus finibus ipsum placerat pulvinar aliquet. Maecenas augue orci, blandit at nibh pharetra, condimentum congue ligula. Duis non ante sagittis odio convallis lacinia in quis sapien. |
277 | 277 | |
@@ -280,42 +280,42 @@ discard block |
||
280 | 280 | Vestibulum tristique quam eget bibendum pulvinar. Mauris sit amet magna ut arcu rutrum pellentesque feugiat et ipsum. Proin porta quam sed risus accumsan pharetra. Nulla quis semper nisl. Nulla facilisi. Nulla facilisi. Pellentesque euismod sollicitudin lacus vel ultricies. Vestibulum ut sem ut nulla ultricies convallis in at mi. Nunc vitae nibh arcu. Maecenas nunc enim, tempus a rhoncus eget, pellentesque ut erat. |
281 | 281 | |
282 | 282 | Suspendisse interdum accumsan magna et tempor. Suspendisse scelerisque at lorem sit amet faucibus. Aenean quis consectetur enim. Duis aliquet tristique tempus. Suspendisse id ullamcorper mauris. Aliquam in libero eu justo porttitor pulvinar. Nulla semper placerat lectus. Nulla mollis suscipit lacus, a blandit purus cursus non. Maecenas id tellus mi. Pellentesque sollicitudin nibh eget magna scelerisque consequat. Aliquam convallis orci arcu, et euismod dui cursus et. Donec nec pellentesque nulla, ac pretium massa. In gravida bibendum ornare.', |
283 | - "post_images" => $image_array, |
|
284 | - "post_category" => array($post_type.'category' => array($category_array[1])), |
|
285 | - "post_tags" => array('Tags', 'Sample Tags'), |
|
286 | - "geodir_video" => '', |
|
287 | - "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
288 | - "geodir_contact" => '(111) 677-4444', |
|
289 | - "geodir_email" => '[email protected]', |
|
290 | - "geodir_website" => 'http://example.com/', |
|
291 | - "geodir_twitter" => 'http://example.com/', |
|
292 | - "geodir_facebook" => 'http://example.com/', |
|
293 | - "geodir_price" => '350000', |
|
294 | - "geodir_property_status" => 'For Sale', |
|
295 | - 'geodir_property_furnishing' => 'Furnished', |
|
296 | - 'geodir_property_type' => 'Detached house', |
|
297 | - 'geodir_property_bedrooms' => '3', |
|
298 | - 'geodir_property_bathrooms' => '2', |
|
299 | - 'geodir_property_area' => '1850', |
|
300 | - 'geodir_property_features' => 'Gas Central Heating,Triple Glazing,Front Garden,Private driveway,Fireplace', |
|
301 | - "post_dummy" => '1' |
|
302 | - ); |
|
303 | - |
|
304 | - |
|
305 | - break; |
|
306 | - case 2: |
|
307 | - $image_array = array(); |
|
308 | - $post_meta = array(); |
|
309 | - $image_array[] = "$dummy_image_url/ps/psf2.jpg"; |
|
310 | - $image_array[] = "$dummy_image_url/ps/psl2.jpg"; |
|
311 | - $image_array[] = "$dummy_image_url/ps/psb2.jpg"; |
|
312 | - $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
313 | - $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
314 | - |
|
315 | - $post_info[] = array( |
|
316 | - "listing_type" => $post_type, |
|
317 | - "post_title" => 'Daisy Street', |
|
318 | - "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna. |
|
283 | + "post_images" => $image_array, |
|
284 | + "post_category" => array($post_type.'category' => array($category_array[1])), |
|
285 | + "post_tags" => array('Tags', 'Sample Tags'), |
|
286 | + "geodir_video" => '', |
|
287 | + "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
288 | + "geodir_contact" => '(111) 677-4444', |
|
289 | + "geodir_email" => '[email protected]', |
|
290 | + "geodir_website" => 'http://example.com/', |
|
291 | + "geodir_twitter" => 'http://example.com/', |
|
292 | + "geodir_facebook" => 'http://example.com/', |
|
293 | + "geodir_price" => '350000', |
|
294 | + "geodir_property_status" => 'For Sale', |
|
295 | + 'geodir_property_furnishing' => 'Furnished', |
|
296 | + 'geodir_property_type' => 'Detached house', |
|
297 | + 'geodir_property_bedrooms' => '3', |
|
298 | + 'geodir_property_bathrooms' => '2', |
|
299 | + 'geodir_property_area' => '1850', |
|
300 | + 'geodir_property_features' => 'Gas Central Heating,Triple Glazing,Front Garden,Private driveway,Fireplace', |
|
301 | + "post_dummy" => '1' |
|
302 | + ); |
|
303 | + |
|
304 | + |
|
305 | + break; |
|
306 | + case 2: |
|
307 | + $image_array = array(); |
|
308 | + $post_meta = array(); |
|
309 | + $image_array[] = "$dummy_image_url/ps/psf2.jpg"; |
|
310 | + $image_array[] = "$dummy_image_url/ps/psl2.jpg"; |
|
311 | + $image_array[] = "$dummy_image_url/ps/psb2.jpg"; |
|
312 | + $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
313 | + $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
314 | + |
|
315 | + $post_info[] = array( |
|
316 | + "listing_type" => $post_type, |
|
317 | + "post_title" => 'Daisy Street', |
|
318 | + "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna. |
|
319 | 319 | |
320 | 320 | Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel. |
321 | 321 | |
@@ -325,42 +325,42 @@ discard block |
||
325 | 325 | |
326 | 326 | Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.', |
327 | 327 | |
328 | - "post_images" => $image_array, |
|
329 | - "post_category" => array($post_type.'category' => array($category_array[1])), |
|
330 | - "post_tags" => array('Garage'), |
|
331 | - "geodir_video" => '', |
|
332 | - "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
333 | - "geodir_contact" => '(222) 777-1111', |
|
334 | - "geodir_email" => '[email protected]', |
|
335 | - "geodir_website" => 'http://example.com/', |
|
336 | - "geodir_twitter" => 'http://example.com/', |
|
337 | - "geodir_facebook" => 'http://example.com/', |
|
338 | - "geodir_price" => '230000', |
|
339 | - "geodir_property_status" => 'Sold', |
|
340 | - 'geodir_property_furnishing' => 'Unfurnished', |
|
341 | - 'geodir_property_type' => 'Detached house', |
|
342 | - 'geodir_property_bedrooms' => '5', |
|
343 | - 'geodir_property_bathrooms' => '3', |
|
344 | - 'geodir_property_area' => '2650', |
|
345 | - 'geodir_property_features' => 'Select Features/,Oil Central Heating,Front Garden,Garage,Private driveway,Fireplace', |
|
346 | - "post_dummy" => '1' |
|
347 | - ); |
|
348 | - |
|
349 | - break; |
|
350 | - |
|
351 | - case 3: |
|
352 | - $image_array = array(); |
|
353 | - $post_meta = array(); |
|
354 | - $image_array[] = "$dummy_image_url/ps/psf3.jpg"; |
|
355 | - $image_array[] = "$dummy_image_url/ps/psl3.jpg"; |
|
356 | - $image_array[] = "$dummy_image_url/ps/psb3.jpg"; |
|
357 | - $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
358 | - $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
359 | - |
|
360 | - $post_info[] = array( |
|
361 | - "listing_type" => $post_type, |
|
362 | - "post_title" => 'Northbay House', |
|
363 | - "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna. |
|
328 | + "post_images" => $image_array, |
|
329 | + "post_category" => array($post_type.'category' => array($category_array[1])), |
|
330 | + "post_tags" => array('Garage'), |
|
331 | + "geodir_video" => '', |
|
332 | + "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
333 | + "geodir_contact" => '(222) 777-1111', |
|
334 | + "geodir_email" => '[email protected]', |
|
335 | + "geodir_website" => 'http://example.com/', |
|
336 | + "geodir_twitter" => 'http://example.com/', |
|
337 | + "geodir_facebook" => 'http://example.com/', |
|
338 | + "geodir_price" => '230000', |
|
339 | + "geodir_property_status" => 'Sold', |
|
340 | + 'geodir_property_furnishing' => 'Unfurnished', |
|
341 | + 'geodir_property_type' => 'Detached house', |
|
342 | + 'geodir_property_bedrooms' => '5', |
|
343 | + 'geodir_property_bathrooms' => '3', |
|
344 | + 'geodir_property_area' => '2650', |
|
345 | + 'geodir_property_features' => 'Select Features/,Oil Central Heating,Front Garden,Garage,Private driveway,Fireplace', |
|
346 | + "post_dummy" => '1' |
|
347 | + ); |
|
348 | + |
|
349 | + break; |
|
350 | + |
|
351 | + case 3: |
|
352 | + $image_array = array(); |
|
353 | + $post_meta = array(); |
|
354 | + $image_array[] = "$dummy_image_url/ps/psf3.jpg"; |
|
355 | + $image_array[] = "$dummy_image_url/ps/psl3.jpg"; |
|
356 | + $image_array[] = "$dummy_image_url/ps/psb3.jpg"; |
|
357 | + $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
358 | + $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
359 | + |
|
360 | + $post_info[] = array( |
|
361 | + "listing_type" => $post_type, |
|
362 | + "post_title" => 'Northbay House', |
|
363 | + "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna. |
|
364 | 364 | |
365 | 365 | Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel. |
366 | 366 | |
@@ -370,43 +370,43 @@ discard block |
||
370 | 370 | |
371 | 371 | Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.', |
372 | 372 | |
373 | - "post_images" => $image_array, |
|
374 | - "post_category" => array($post_type.'category' => array($category_array[1])), |
|
375 | - "post_tags" => array('Tags', 'Sample Tags'), |
|
376 | - "geodir_video" => '', |
|
377 | - "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
378 | - "geodir_contact" => '(222) 777-1111', |
|
379 | - "geodir_email" => '[email protected]', |
|
380 | - "geodir_website" => 'http://example.com/', |
|
381 | - "geodir_twitter" => 'http://example.com/', |
|
382 | - "geodir_facebook" => 'http://example.com/', |
|
383 | - "geodir_price" => '260000', |
|
384 | - "geodir_property_status" => 'Under Offer', |
|
385 | - 'geodir_property_furnishing' => 'Unfurnished', |
|
386 | - 'geodir_property_type' => 'Detached house', |
|
387 | - 'geodir_property_bedrooms' => '6', |
|
388 | - 'geodir_property_bathrooms' => '6', |
|
389 | - 'geodir_property_area' => '1650', |
|
390 | - 'geodir_property_features' => 'Select Features/,Gas Central Heating,Triple Glazing,Off Road Parking,Fireplace', |
|
391 | - "post_dummy" => '1' |
|
392 | - ); |
|
393 | - |
|
394 | - break; |
|
395 | - |
|
396 | - |
|
397 | - case 4: |
|
398 | - $image_array = array(); |
|
399 | - $post_meta = array(); |
|
400 | - $image_array[] = "$dummy_image_url/ps/psf4.jpg"; |
|
401 | - $image_array[] = "$dummy_image_url/ps/psl4.jpg"; |
|
402 | - $image_array[] = "$dummy_image_url/ps/psb4.jpg"; |
|
403 | - $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
404 | - $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
405 | - |
|
406 | - $post_info[] = array( |
|
407 | - "listing_type" => $post_type, |
|
408 | - "post_title" => 'Jesmond Mansion', |
|
409 | - "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna. |
|
373 | + "post_images" => $image_array, |
|
374 | + "post_category" => array($post_type.'category' => array($category_array[1])), |
|
375 | + "post_tags" => array('Tags', 'Sample Tags'), |
|
376 | + "geodir_video" => '', |
|
377 | + "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
378 | + "geodir_contact" => '(222) 777-1111', |
|
379 | + "geodir_email" => '[email protected]', |
|
380 | + "geodir_website" => 'http://example.com/', |
|
381 | + "geodir_twitter" => 'http://example.com/', |
|
382 | + "geodir_facebook" => 'http://example.com/', |
|
383 | + "geodir_price" => '260000', |
|
384 | + "geodir_property_status" => 'Under Offer', |
|
385 | + 'geodir_property_furnishing' => 'Unfurnished', |
|
386 | + 'geodir_property_type' => 'Detached house', |
|
387 | + 'geodir_property_bedrooms' => '6', |
|
388 | + 'geodir_property_bathrooms' => '6', |
|
389 | + 'geodir_property_area' => '1650', |
|
390 | + 'geodir_property_features' => 'Select Features/,Gas Central Heating,Triple Glazing,Off Road Parking,Fireplace', |
|
391 | + "post_dummy" => '1' |
|
392 | + ); |
|
393 | + |
|
394 | + break; |
|
395 | + |
|
396 | + |
|
397 | + case 4: |
|
398 | + $image_array = array(); |
|
399 | + $post_meta = array(); |
|
400 | + $image_array[] = "$dummy_image_url/ps/psf4.jpg"; |
|
401 | + $image_array[] = "$dummy_image_url/ps/psl4.jpg"; |
|
402 | + $image_array[] = "$dummy_image_url/ps/psb4.jpg"; |
|
403 | + $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
404 | + $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
405 | + |
|
406 | + $post_info[] = array( |
|
407 | + "listing_type" => $post_type, |
|
408 | + "post_title" => 'Jesmond Mansion', |
|
409 | + "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna. |
|
410 | 410 | |
411 | 411 | Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel. |
412 | 412 | |
@@ -416,42 +416,42 @@ discard block |
||
416 | 416 | |
417 | 417 | Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.', |
418 | 418 | |
419 | - "post_images" => $image_array, |
|
420 | - "post_category" => array($post_type.'category' => array($category_array[1])), |
|
421 | - "post_tags" => array('Tags', 'Sample Tags'), |
|
422 | - "geodir_video" => '', |
|
423 | - "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
424 | - "geodir_contact" => '(222) 777-1111', |
|
425 | - "geodir_email" => '[email protected]', |
|
426 | - "geodir_website" => 'http://example.com/', |
|
427 | - "geodir_twitter" => 'http://example.com/', |
|
428 | - "geodir_facebook" => 'http://example.com/', |
|
429 | - "geodir_price" => '2300000', |
|
430 | - "geodir_property_status" => 'Under Offer', |
|
431 | - 'geodir_property_furnishing' => 'Partially furnished', |
|
432 | - 'geodir_property_type' => 'Detached house', |
|
433 | - 'geodir_property_bedrooms' => '10', |
|
434 | - 'geodir_property_bathrooms' => '7', |
|
435 | - 'geodir_property_area' => '6600', |
|
436 | - 'geodir_property_features' => 'Select Features/,Oil Central Heating,Double Glazing,Front Garden,Garage,Private driveway,Fireplace', |
|
437 | - "post_dummy" => '1' |
|
438 | - ); |
|
439 | - |
|
440 | - break; |
|
441 | - |
|
442 | - case 5: |
|
443 | - $image_array = array(); |
|
444 | - $post_meta = array(); |
|
445 | - $image_array[] = "$dummy_image_url/ps/psf5.jpg"; |
|
446 | - $image_array[] = "$dummy_image_url/ps/psl5.jpg"; |
|
447 | - $image_array[] = "$dummy_image_url/ps/psb5.jpg"; |
|
448 | - $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
449 | - $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
450 | - |
|
451 | - $post_info[] = array( |
|
452 | - "listing_type" => $post_type, |
|
453 | - "post_title" => 'Springfield Lodge', |
|
454 | - "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna. |
|
419 | + "post_images" => $image_array, |
|
420 | + "post_category" => array($post_type.'category' => array($category_array[1])), |
|
421 | + "post_tags" => array('Tags', 'Sample Tags'), |
|
422 | + "geodir_video" => '', |
|
423 | + "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
424 | + "geodir_contact" => '(222) 777-1111', |
|
425 | + "geodir_email" => '[email protected]', |
|
426 | + "geodir_website" => 'http://example.com/', |
|
427 | + "geodir_twitter" => 'http://example.com/', |
|
428 | + "geodir_facebook" => 'http://example.com/', |
|
429 | + "geodir_price" => '2300000', |
|
430 | + "geodir_property_status" => 'Under Offer', |
|
431 | + 'geodir_property_furnishing' => 'Partially furnished', |
|
432 | + 'geodir_property_type' => 'Detached house', |
|
433 | + 'geodir_property_bedrooms' => '10', |
|
434 | + 'geodir_property_bathrooms' => '7', |
|
435 | + 'geodir_property_area' => '6600', |
|
436 | + 'geodir_property_features' => 'Select Features/,Oil Central Heating,Double Glazing,Front Garden,Garage,Private driveway,Fireplace', |
|
437 | + "post_dummy" => '1' |
|
438 | + ); |
|
439 | + |
|
440 | + break; |
|
441 | + |
|
442 | + case 5: |
|
443 | + $image_array = array(); |
|
444 | + $post_meta = array(); |
|
445 | + $image_array[] = "$dummy_image_url/ps/psf5.jpg"; |
|
446 | + $image_array[] = "$dummy_image_url/ps/psl5.jpg"; |
|
447 | + $image_array[] = "$dummy_image_url/ps/psb5.jpg"; |
|
448 | + $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
449 | + $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
450 | + |
|
451 | + $post_info[] = array( |
|
452 | + "listing_type" => $post_type, |
|
453 | + "post_title" => 'Springfield Lodge', |
|
454 | + "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna. |
|
455 | 455 | |
456 | 456 | Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel. |
457 | 457 | |
@@ -461,42 +461,42 @@ discard block |
||
461 | 461 | |
462 | 462 | Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.', |
463 | 463 | |
464 | - "post_images" => $image_array, |
|
465 | - "post_category" => array($post_type.'category' => array($category_array[1])), |
|
466 | - "post_tags" => array('Tags', 'Sample Tags'), |
|
467 | - "geodir_video" => '', |
|
468 | - "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
469 | - "geodir_contact" => '(222) 777-1111', |
|
470 | - "geodir_email" => '[email protected]', |
|
471 | - "geodir_website" => 'http://example.com/', |
|
472 | - "geodir_twitter" => 'http://example.com/', |
|
473 | - "geodir_facebook" => 'http://example.com/', |
|
474 | - "geodir_price" => '330000', |
|
475 | - "geodir_property_status" => 'For Sale', |
|
476 | - 'geodir_property_furnishing' => 'Optional', |
|
477 | - 'geodir_property_type' => 'Detached house', |
|
478 | - 'geodir_property_bedrooms' => '4', |
|
479 | - 'geodir_property_bathrooms' => '3', |
|
480 | - 'geodir_property_area' => '3700', |
|
481 | - 'geodir_property_features' => 'Select Features/,Oil Central Heating,Double Glazing,Front Garden', |
|
482 | - "post_dummy" => '1' |
|
483 | - ); |
|
484 | - |
|
485 | - break; |
|
486 | - |
|
487 | - case 6: |
|
488 | - $image_array = array(); |
|
489 | - $post_meta = array(); |
|
490 | - $image_array[] = "$dummy_image_url/ps/psf6.jpg"; |
|
491 | - $image_array[] = "$dummy_image_url/ps/psl6.jpg"; |
|
492 | - $image_array[] = "$dummy_image_url/ps/psb5.jpg"; |
|
493 | - $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
494 | - $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
495 | - |
|
496 | - $post_info[] = array( |
|
497 | - "listing_type" => $post_type, |
|
498 | - "post_title" => 'Forrest Park', |
|
499 | - "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna. |
|
464 | + "post_images" => $image_array, |
|
465 | + "post_category" => array($post_type.'category' => array($category_array[1])), |
|
466 | + "post_tags" => array('Tags', 'Sample Tags'), |
|
467 | + "geodir_video" => '', |
|
468 | + "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
469 | + "geodir_contact" => '(222) 777-1111', |
|
470 | + "geodir_email" => '[email protected]', |
|
471 | + "geodir_website" => 'http://example.com/', |
|
472 | + "geodir_twitter" => 'http://example.com/', |
|
473 | + "geodir_facebook" => 'http://example.com/', |
|
474 | + "geodir_price" => '330000', |
|
475 | + "geodir_property_status" => 'For Sale', |
|
476 | + 'geodir_property_furnishing' => 'Optional', |
|
477 | + 'geodir_property_type' => 'Detached house', |
|
478 | + 'geodir_property_bedrooms' => '4', |
|
479 | + 'geodir_property_bathrooms' => '3', |
|
480 | + 'geodir_property_area' => '3700', |
|
481 | + 'geodir_property_features' => 'Select Features/,Oil Central Heating,Double Glazing,Front Garden', |
|
482 | + "post_dummy" => '1' |
|
483 | + ); |
|
484 | + |
|
485 | + break; |
|
486 | + |
|
487 | + case 6: |
|
488 | + $image_array = array(); |
|
489 | + $post_meta = array(); |
|
490 | + $image_array[] = "$dummy_image_url/ps/psf6.jpg"; |
|
491 | + $image_array[] = "$dummy_image_url/ps/psl6.jpg"; |
|
492 | + $image_array[] = "$dummy_image_url/ps/psb5.jpg"; |
|
493 | + $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
494 | + $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
495 | + |
|
496 | + $post_info[] = array( |
|
497 | + "listing_type" => $post_type, |
|
498 | + "post_title" => 'Forrest Park', |
|
499 | + "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna. |
|
500 | 500 | |
501 | 501 | Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel. |
502 | 502 | |
@@ -506,42 +506,42 @@ discard block |
||
506 | 506 | |
507 | 507 | Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.', |
508 | 508 | |
509 | - "post_images" => $image_array, |
|
510 | - "post_category" => array($post_type.'category' => array($category_array[1])), |
|
511 | - "post_tags" => array('Tags', 'Sample Tags'), |
|
512 | - "geodir_video" => '', |
|
513 | - "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
514 | - "geodir_contact" => '(222) 777-1111', |
|
515 | - "geodir_email" => '[email protected]', |
|
516 | - "geodir_website" => 'http://example.com/', |
|
517 | - "geodir_twitter" => 'http://example.com/', |
|
518 | - "geodir_facebook" => 'http://example.com/', |
|
519 | - "geodir_price" => '530000', |
|
520 | - "geodir_property_status" => 'For Sale', |
|
521 | - 'geodir_property_furnishing' => 'Unfurnished', |
|
522 | - 'geodir_property_type' => 'Detached house', |
|
523 | - 'geodir_property_bedrooms' => '5', |
|
524 | - 'geodir_property_bathrooms' => '4', |
|
525 | - 'geodir_property_area' => '2250', |
|
526 | - 'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Front Garden,Private driveway', |
|
527 | - "post_dummy" => '1' |
|
528 | - ); |
|
529 | - |
|
530 | - break; |
|
531 | - |
|
532 | - case 7: |
|
533 | - $image_array = array(); |
|
534 | - $post_meta = array(); |
|
535 | - $image_array[] = "$dummy_image_url/ps/psf7.jpg"; |
|
536 | - $image_array[] = "$dummy_image_url/ps/psl4.jpg"; |
|
537 | - $image_array[] = "$dummy_image_url/ps/psb4.jpg"; |
|
538 | - $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
539 | - $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
540 | - |
|
541 | - $post_info[] = array( |
|
542 | - "listing_type" => $post_type, |
|
543 | - "post_title" => 'Fraser Suites', |
|
544 | - "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna. |
|
509 | + "post_images" => $image_array, |
|
510 | + "post_category" => array($post_type.'category' => array($category_array[1])), |
|
511 | + "post_tags" => array('Tags', 'Sample Tags'), |
|
512 | + "geodir_video" => '', |
|
513 | + "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
514 | + "geodir_contact" => '(222) 777-1111', |
|
515 | + "geodir_email" => '[email protected]', |
|
516 | + "geodir_website" => 'http://example.com/', |
|
517 | + "geodir_twitter" => 'http://example.com/', |
|
518 | + "geodir_facebook" => 'http://example.com/', |
|
519 | + "geodir_price" => '530000', |
|
520 | + "geodir_property_status" => 'For Sale', |
|
521 | + 'geodir_property_furnishing' => 'Unfurnished', |
|
522 | + 'geodir_property_type' => 'Detached house', |
|
523 | + 'geodir_property_bedrooms' => '5', |
|
524 | + 'geodir_property_bathrooms' => '4', |
|
525 | + 'geodir_property_area' => '2250', |
|
526 | + 'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Front Garden,Private driveway', |
|
527 | + "post_dummy" => '1' |
|
528 | + ); |
|
529 | + |
|
530 | + break; |
|
531 | + |
|
532 | + case 7: |
|
533 | + $image_array = array(); |
|
534 | + $post_meta = array(); |
|
535 | + $image_array[] = "$dummy_image_url/ps/psf7.jpg"; |
|
536 | + $image_array[] = "$dummy_image_url/ps/psl4.jpg"; |
|
537 | + $image_array[] = "$dummy_image_url/ps/psb4.jpg"; |
|
538 | + $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
539 | + $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
540 | + |
|
541 | + $post_info[] = array( |
|
542 | + "listing_type" => $post_type, |
|
543 | + "post_title" => 'Fraser Suites', |
|
544 | + "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna. |
|
545 | 545 | |
546 | 546 | Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel. |
547 | 547 | |
@@ -551,42 +551,42 @@ discard block |
||
551 | 551 | |
552 | 552 | Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.', |
553 | 553 | |
554 | - "post_images" => $image_array, |
|
555 | - "post_category" => array($post_type.'category' => array($category_array[0])), |
|
556 | - "post_tags" => array('Tags', 'Sample Tags'), |
|
557 | - "geodir_video" => '', |
|
558 | - "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
559 | - "geodir_contact" => '(222) 777-1111', |
|
560 | - "geodir_email" => '[email protected]', |
|
561 | - "geodir_website" => 'http://example.com/', |
|
562 | - "geodir_twitter" => 'http://example.com/', |
|
563 | - "geodir_facebook" => 'http://example.com/', |
|
564 | - "geodir_price" => '245000', |
|
565 | - "geodir_property_status" => 'For Sale', |
|
566 | - 'geodir_property_furnishing' => 'Unfurnished', |
|
567 | - 'geodir_property_type' => 'Apartment', |
|
568 | - 'geodir_property_bedrooms' => '3', |
|
569 | - 'geodir_property_bathrooms' => '2', |
|
570 | - 'geodir_property_area' => '1250', |
|
571 | - 'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing', |
|
572 | - "post_dummy" => '1' |
|
573 | - ); |
|
574 | - |
|
575 | - break; |
|
576 | - |
|
577 | - case 8: |
|
578 | - $image_array = array(); |
|
579 | - $post_meta = array(); |
|
580 | - $image_array[] = "$dummy_image_url/ps/psf8.jpg"; |
|
581 | - $image_array[] = "$dummy_image_url/ps/psl2.jpg"; |
|
582 | - $image_array[] = "$dummy_image_url/ps/psb2.jpg"; |
|
583 | - $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
584 | - $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
585 | - |
|
586 | - $post_info[] = array( |
|
587 | - "listing_type" => $post_type, |
|
588 | - "post_title" => 'Richmore Apartments', |
|
589 | - "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna. |
|
554 | + "post_images" => $image_array, |
|
555 | + "post_category" => array($post_type.'category' => array($category_array[0])), |
|
556 | + "post_tags" => array('Tags', 'Sample Tags'), |
|
557 | + "geodir_video" => '', |
|
558 | + "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
559 | + "geodir_contact" => '(222) 777-1111', |
|
560 | + "geodir_email" => '[email protected]', |
|
561 | + "geodir_website" => 'http://example.com/', |
|
562 | + "geodir_twitter" => 'http://example.com/', |
|
563 | + "geodir_facebook" => 'http://example.com/', |
|
564 | + "geodir_price" => '245000', |
|
565 | + "geodir_property_status" => 'For Sale', |
|
566 | + 'geodir_property_furnishing' => 'Unfurnished', |
|
567 | + 'geodir_property_type' => 'Apartment', |
|
568 | + 'geodir_property_bedrooms' => '3', |
|
569 | + 'geodir_property_bathrooms' => '2', |
|
570 | + 'geodir_property_area' => '1250', |
|
571 | + 'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing', |
|
572 | + "post_dummy" => '1' |
|
573 | + ); |
|
574 | + |
|
575 | + break; |
|
576 | + |
|
577 | + case 8: |
|
578 | + $image_array = array(); |
|
579 | + $post_meta = array(); |
|
580 | + $image_array[] = "$dummy_image_url/ps/psf8.jpg"; |
|
581 | + $image_array[] = "$dummy_image_url/ps/psl2.jpg"; |
|
582 | + $image_array[] = "$dummy_image_url/ps/psb2.jpg"; |
|
583 | + $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
584 | + $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
585 | + |
|
586 | + $post_info[] = array( |
|
587 | + "listing_type" => $post_type, |
|
588 | + "post_title" => 'Richmore Apartments', |
|
589 | + "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna. |
|
590 | 590 | |
591 | 591 | Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel. |
592 | 592 | |
@@ -596,43 +596,43 @@ discard block |
||
596 | 596 | |
597 | 597 | Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.', |
598 | 598 | |
599 | - "post_images" => $image_array, |
|
600 | - "post_category" => array($post_type.'category' => array($category_array[0])), |
|
601 | - "post_tags" => array('Tags', 'Sample Tags'), |
|
602 | - "geodir_video" => '', |
|
603 | - "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
604 | - "geodir_contact" => '(222) 777-1111', |
|
605 | - "geodir_email" => '[email protected]', |
|
606 | - "geodir_website" => 'http://example.com/', |
|
607 | - "geodir_twitter" => 'http://example.com/', |
|
608 | - "geodir_facebook" => 'http://example.com/', |
|
609 | - "geodir_price" => '395000', |
|
610 | - "geodir_property_status" => 'For Sale', |
|
611 | - 'geodir_property_furnishing' => 'Unfurnished', |
|
612 | - 'geodir_property_type' => 'Apartment', |
|
613 | - 'geodir_property_bedrooms' => '2', |
|
614 | - 'geodir_property_bathrooms' => '2', |
|
615 | - 'geodir_property_area' => '1750', |
|
616 | - 'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Garage', |
|
617 | - "post_dummy" => '1' |
|
618 | - ); |
|
619 | - |
|
620 | - break; |
|
621 | - |
|
622 | - |
|
623 | - case 9: |
|
624 | - $image_array = array(); |
|
625 | - $post_meta = array(); |
|
626 | - $image_array[] = "$dummy_image_url/ps/psf9.jpg"; |
|
627 | - $image_array[] = "$dummy_image_url/ps/psc9.jpg"; |
|
628 | - $image_array[] = "$dummy_image_url/ps/psb2.jpg"; |
|
629 | - $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
630 | - $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
631 | - |
|
632 | - $post_info[] = array( |
|
633 | - "listing_type" => $post_type, |
|
634 | - "post_title" => 'Hotel Alpina', |
|
635 | - "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna. |
|
599 | + "post_images" => $image_array, |
|
600 | + "post_category" => array($post_type.'category' => array($category_array[0])), |
|
601 | + "post_tags" => array('Tags', 'Sample Tags'), |
|
602 | + "geodir_video" => '', |
|
603 | + "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
604 | + "geodir_contact" => '(222) 777-1111', |
|
605 | + "geodir_email" => '[email protected]', |
|
606 | + "geodir_website" => 'http://example.com/', |
|
607 | + "geodir_twitter" => 'http://example.com/', |
|
608 | + "geodir_facebook" => 'http://example.com/', |
|
609 | + "geodir_price" => '395000', |
|
610 | + "geodir_property_status" => 'For Sale', |
|
611 | + 'geodir_property_furnishing' => 'Unfurnished', |
|
612 | + 'geodir_property_type' => 'Apartment', |
|
613 | + 'geodir_property_bedrooms' => '2', |
|
614 | + 'geodir_property_bathrooms' => '2', |
|
615 | + 'geodir_property_area' => '1750', |
|
616 | + 'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Garage', |
|
617 | + "post_dummy" => '1' |
|
618 | + ); |
|
619 | + |
|
620 | + break; |
|
621 | + |
|
622 | + |
|
623 | + case 9: |
|
624 | + $image_array = array(); |
|
625 | + $post_meta = array(); |
|
626 | + $image_array[] = "$dummy_image_url/ps/psf9.jpg"; |
|
627 | + $image_array[] = "$dummy_image_url/ps/psc9.jpg"; |
|
628 | + $image_array[] = "$dummy_image_url/ps/psb2.jpg"; |
|
629 | + $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
630 | + $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
631 | + |
|
632 | + $post_info[] = array( |
|
633 | + "listing_type" => $post_type, |
|
634 | + "post_title" => 'Hotel Alpina', |
|
635 | + "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna. |
|
636 | 636 | |
637 | 637 | Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel. |
638 | 638 | |
@@ -642,39 +642,39 @@ discard block |
||
642 | 642 | |
643 | 643 | Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.', |
644 | 644 | |
645 | - "post_images" => $image_array, |
|
646 | - "post_category" => array($post_type.'category' => array($category_array[2])), |
|
647 | - "post_tags" => array('Tags', 'Sample Tags'), |
|
648 | - "geodir_video" => '', |
|
649 | - "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
650 | - "geodir_contact" => '(222) 777-1111', |
|
651 | - "geodir_email" => '[email protected]', |
|
652 | - "geodir_website" => 'http://example.com/', |
|
653 | - "geodir_twitter" => 'http://example.com/', |
|
654 | - "geodir_facebook" => 'http://example.com/', |
|
655 | - "geodir_price" => '12500000', |
|
656 | - "geodir_property_status" => 'For Sale', |
|
657 | - 'geodir_property_furnishing' => 'Furnished', |
|
658 | - 'geodir_property_type' => 'Hotel', |
|
659 | - 'geodir_property_bedrooms' => '120', |
|
660 | - 'geodir_property_bathrooms' => '133', |
|
661 | - 'geodir_property_area' => '35000', |
|
662 | - 'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Garage', |
|
663 | - "post_dummy" => '1' |
|
664 | - ); |
|
665 | - |
|
666 | - break; |
|
667 | - |
|
668 | - case 10: |
|
669 | - $image_array = array(); |
|
670 | - $post_meta = array(); |
|
671 | - $image_array[] = "$dummy_image_url/ps/psf10.jpg"; |
|
672 | - $image_array[] = "$dummy_image_url/ps/psf102.jpg"; |
|
673 | - |
|
674 | - $post_info[] = array( |
|
675 | - "listing_type" => $post_type, |
|
676 | - "post_title" => 'Development Land', |
|
677 | - "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna. |
|
645 | + "post_images" => $image_array, |
|
646 | + "post_category" => array($post_type.'category' => array($category_array[2])), |
|
647 | + "post_tags" => array('Tags', 'Sample Tags'), |
|
648 | + "geodir_video" => '', |
|
649 | + "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
650 | + "geodir_contact" => '(222) 777-1111', |
|
651 | + "geodir_email" => '[email protected]', |
|
652 | + "geodir_website" => 'http://example.com/', |
|
653 | + "geodir_twitter" => 'http://example.com/', |
|
654 | + "geodir_facebook" => 'http://example.com/', |
|
655 | + "geodir_price" => '12500000', |
|
656 | + "geodir_property_status" => 'For Sale', |
|
657 | + 'geodir_property_furnishing' => 'Furnished', |
|
658 | + 'geodir_property_type' => 'Hotel', |
|
659 | + 'geodir_property_bedrooms' => '120', |
|
660 | + 'geodir_property_bathrooms' => '133', |
|
661 | + 'geodir_property_area' => '35000', |
|
662 | + 'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Garage', |
|
663 | + "post_dummy" => '1' |
|
664 | + ); |
|
665 | + |
|
666 | + break; |
|
667 | + |
|
668 | + case 10: |
|
669 | + $image_array = array(); |
|
670 | + $post_meta = array(); |
|
671 | + $image_array[] = "$dummy_image_url/ps/psf10.jpg"; |
|
672 | + $image_array[] = "$dummy_image_url/ps/psf102.jpg"; |
|
673 | + |
|
674 | + $post_info[] = array( |
|
675 | + "listing_type" => $post_type, |
|
676 | + "post_title" => 'Development Land', |
|
677 | + "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna. |
|
678 | 678 | |
679 | 679 | Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel. |
680 | 680 | |
@@ -684,93 +684,93 @@ discard block |
||
684 | 684 | |
685 | 685 | Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.', |
686 | 686 | |
687 | - "post_images" => $image_array, |
|
688 | - "post_category" => array($post_type.'category' => array($category_array[3])), |
|
689 | - "post_tags" => array('Tags', 'Sample Tags'), |
|
690 | - "geodir_video" => '', |
|
691 | - "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
692 | - "geodir_contact" => '(222) 777-1111', |
|
693 | - "geodir_email" => '[email protected]', |
|
694 | - "geodir_website" => 'http://example.com/', |
|
695 | - "geodir_twitter" => 'http://example.com/', |
|
696 | - "geodir_facebook" => 'http://example.com/', |
|
697 | - "geodir_price" => '80000', |
|
698 | - "geodir_property_status" => 'For Sale', |
|
699 | - 'geodir_property_furnishing' => '', |
|
700 | - 'geodir_property_type' => 'Land', |
|
701 | - 'geodir_property_bedrooms' => '', |
|
702 | - 'geodir_property_bathrooms' => '', |
|
703 | - 'geodir_property_area' => '250000', |
|
704 | - 'geodir_property_features' => '', |
|
705 | - "post_dummy" => '1' |
|
706 | - ); |
|
707 | - |
|
708 | - break; |
|
687 | + "post_images" => $image_array, |
|
688 | + "post_category" => array($post_type.'category' => array($category_array[3])), |
|
689 | + "post_tags" => array('Tags', 'Sample Tags'), |
|
690 | + "geodir_video" => '', |
|
691 | + "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
692 | + "geodir_contact" => '(222) 777-1111', |
|
693 | + "geodir_email" => '[email protected]', |
|
694 | + "geodir_website" => 'http://example.com/', |
|
695 | + "geodir_twitter" => 'http://example.com/', |
|
696 | + "geodir_facebook" => 'http://example.com/', |
|
697 | + "geodir_price" => '80000', |
|
698 | + "geodir_property_status" => 'For Sale', |
|
699 | + 'geodir_property_furnishing' => '', |
|
700 | + 'geodir_property_type' => 'Land', |
|
701 | + 'geodir_property_bedrooms' => '', |
|
702 | + 'geodir_property_bathrooms' => '', |
|
703 | + 'geodir_property_area' => '250000', |
|
704 | + 'geodir_property_features' => '', |
|
705 | + "post_dummy" => '1' |
|
706 | + ); |
|
707 | + |
|
708 | + break; |
|
709 | 709 | |
710 | 710 | } // end of switch |
711 | 711 | |
712 | 712 | foreach ($post_info as $post_info) { |
713 | - $default_location = geodir_get_default_location(); |
|
714 | - if ($city_bound_lat1 > $city_bound_lat2) |
|
715 | - $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat1, $city_bound_lat2), geodir_random_float($city_bound_lat2, $city_bound_lat1)); |
|
716 | - else |
|
717 | - $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat2, $city_bound_lat1), geodir_random_float($city_bound_lat1, $city_bound_lat2)); |
|
713 | + $default_location = geodir_get_default_location(); |
|
714 | + if ($city_bound_lat1 > $city_bound_lat2) |
|
715 | + $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat1, $city_bound_lat2), geodir_random_float($city_bound_lat2, $city_bound_lat1)); |
|
716 | + else |
|
717 | + $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat2, $city_bound_lat1), geodir_random_float($city_bound_lat1, $city_bound_lat2)); |
|
718 | 718 | |
719 | 719 | |
720 | - if ($city_bound_lng1 > $city_bound_lng2) |
|
721 | - $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng1, $city_bound_lng2), geodir_random_float($city_bound_lng2, $city_bound_lng1)); |
|
722 | - else |
|
723 | - $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng2, $city_bound_lng1), geodir_random_float($city_bound_lng1, $city_bound_lng2)); |
|
720 | + if ($city_bound_lng1 > $city_bound_lng2) |
|
721 | + $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng1, $city_bound_lng2), geodir_random_float($city_bound_lng2, $city_bound_lng1)); |
|
722 | + else |
|
723 | + $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng2, $city_bound_lng1), geodir_random_float($city_bound_lng1, $city_bound_lng2)); |
|
724 | 724 | |
725 | - $load_map = get_option('geodir_load_map'); |
|
725 | + $load_map = get_option('geodir_load_map'); |
|
726 | 726 | |
727 | - if ($load_map == 'osm') { |
|
728 | - $post_address = geodir_get_osm_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude); |
|
729 | - } else { |
|
730 | - $post_address = geodir_get_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude); |
|
731 | - } |
|
732 | - |
|
733 | - $postal_code = ''; |
|
734 | - if (!empty($post_address)) { |
|
735 | - if ($load_map == 'osm') { |
|
736 | - $address = !empty($post_address->formatted_address) ? $post_address->formatted_address : ''; |
|
737 | - $postal_code = !empty($post_address->address->postcode) ? $post_address->address->postcode : ''; |
|
738 | - } else { |
|
739 | - $addresses = array(); |
|
740 | - $addresses_default = array(); |
|
727 | + if ($load_map == 'osm') { |
|
728 | + $post_address = geodir_get_osm_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude); |
|
729 | + } else { |
|
730 | + $post_address = geodir_get_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude); |
|
731 | + } |
|
732 | + |
|
733 | + $postal_code = ''; |
|
734 | + if (!empty($post_address)) { |
|
735 | + if ($load_map == 'osm') { |
|
736 | + $address = !empty($post_address->formatted_address) ? $post_address->formatted_address : ''; |
|
737 | + $postal_code = !empty($post_address->address->postcode) ? $post_address->address->postcode : ''; |
|
738 | + } else { |
|
739 | + $addresses = array(); |
|
740 | + $addresses_default = array(); |
|
741 | 741 | |
742 | - foreach ($post_address as $add_key => $add_value) { |
|
743 | - if ($add_key < 2 && !empty($add_value->long_name)) { |
|
744 | - $addresses_default[] = $add_value->long_name; |
|
745 | - } |
|
746 | - if ($add_value->types[0] == 'postal_code') { |
|
747 | - $postal_code = $add_value->long_name; |
|
748 | - } |
|
749 | - if ($add_value->types[0] == 'street_number') { |
|
750 | - $addresses[] = $add_value->long_name; |
|
751 | - } |
|
752 | - if ($add_value->types[0] == 'route') { |
|
753 | - $addresses[] = $add_value->long_name; |
|
754 | - } |
|
755 | - if ($add_value->types[0] == 'neighborhood') { |
|
756 | - $addresses[] = $add_value->long_name; |
|
757 | - } |
|
758 | - if ($add_value->types[0] == 'sublocality') { |
|
759 | - $addresses[] = $add_value->long_name; |
|
760 | - } |
|
761 | - } |
|
762 | - $address = !empty($addresses) ? implode(', ', $addresses) : (!empty($addresses_default) ? implode(', ', $addresses_default) : ''); |
|
763 | - } |
|
764 | - |
|
765 | - $post_info['post_address'] = !empty($address) ? $address : $default_location->city; |
|
766 | - $post_info['post_city'] = $default_location->city; |
|
767 | - $post_info['post_region'] = $default_location->region; |
|
768 | - $post_info['post_country'] = $default_location->country; |
|
769 | - $post_info['post_zip'] = $postal_code; |
|
770 | - $post_info['post_latitude'] = $dummy_post_latitude; |
|
771 | - $post_info['post_longitude'] = $dummy_post_longitude; |
|
772 | - } |
|
742 | + foreach ($post_address as $add_key => $add_value) { |
|
743 | + if ($add_key < 2 && !empty($add_value->long_name)) { |
|
744 | + $addresses_default[] = $add_value->long_name; |
|
745 | + } |
|
746 | + if ($add_value->types[0] == 'postal_code') { |
|
747 | + $postal_code = $add_value->long_name; |
|
748 | + } |
|
749 | + if ($add_value->types[0] == 'street_number') { |
|
750 | + $addresses[] = $add_value->long_name; |
|
751 | + } |
|
752 | + if ($add_value->types[0] == 'route') { |
|
753 | + $addresses[] = $add_value->long_name; |
|
754 | + } |
|
755 | + if ($add_value->types[0] == 'neighborhood') { |
|
756 | + $addresses[] = $add_value->long_name; |
|
757 | + } |
|
758 | + if ($add_value->types[0] == 'sublocality') { |
|
759 | + $addresses[] = $add_value->long_name; |
|
760 | + } |
|
761 | + } |
|
762 | + $address = !empty($addresses) ? implode(', ', $addresses) : (!empty($addresses_default) ? implode(', ', $addresses_default) : ''); |
|
763 | + } |
|
764 | + |
|
765 | + $post_info['post_address'] = !empty($address) ? $address : $default_location->city; |
|
766 | + $post_info['post_city'] = $default_location->city; |
|
767 | + $post_info['post_region'] = $default_location->region; |
|
768 | + $post_info['post_country'] = $default_location->country; |
|
769 | + $post_info['post_zip'] = $postal_code; |
|
770 | + $post_info['post_latitude'] = $dummy_post_latitude; |
|
771 | + $post_info['post_longitude'] = $dummy_post_longitude; |
|
772 | + } |
|
773 | 773 | |
774 | - geodir_save_listing($post_info, true); |
|
775 | - echo 1; |
|
774 | + geodir_save_listing($post_info, true); |
|
775 | + echo 1; |
|
776 | 776 | } |
@@ -6,9 +6,9 @@ discard block |
||
6 | 6 | * @package GeoDirectory |
7 | 7 | */ |
8 | 8 | |
9 | -function geodir_property_sale_custom_fields($post_type='gd_place',$package_id=''){ |
|
9 | +function geodir_property_sale_custom_fields($post_type = 'gd_place', $package_id = '') { |
|
10 | 10 | $fields = array(); |
11 | - $package = ($package_id=='') ? '' : array($package_id); |
|
11 | + $package = ($package_id == '') ? '' : array($package_id); |
|
12 | 12 | |
13 | 13 | // Salary |
14 | 14 | $fields[] = array('listing_type' => $post_type, |
@@ -48,15 +48,15 @@ discard block |
||
48 | 48 | 'field_type' => 'select', |
49 | 49 | 'data_type' => 'VARCHAR', |
50 | 50 | 'admin_title' => __('Job Type', 'geodirectory'), |
51 | - 'site_title' => __('Job Type','geodirectory'), |
|
52 | - 'admin_desc' => __('Select the type of job.','geodirectory'), |
|
51 | + 'site_title' => __('Job Type', 'geodirectory'), |
|
52 | + 'admin_desc' => __('Select the type of job.', 'geodirectory'), |
|
53 | 53 | 'htmlvar_name' => 'job_type', |
54 | 54 | 'is_active' => true, |
55 | 55 | 'for_admin_use' => false, |
56 | 56 | 'default_value' => '', |
57 | 57 | 'show_in' => '[detail],[listing]', |
58 | 58 | 'is_required' => true, |
59 | - 'option_values' => __('Select Type/,Freelance,Full Time,Internship,Part Time,Temporary,Other','geodirectory'), |
|
59 | + 'option_values' => __('Select Type/,Freelance,Full Time,Internship,Part Time,Temporary,Other', 'geodirectory'), |
|
60 | 60 | 'validation_pattern' => '', |
61 | 61 | 'validation_msg' => '', |
62 | 62 | 'required_msg' => '', |
@@ -70,16 +70,16 @@ discard block |
||
70 | 70 | $fields[] = array('listing_type' => $post_type, |
71 | 71 | 'field_type' => 'select', |
72 | 72 | 'data_type' => 'VARCHAR', |
73 | - 'admin_title' => __('Job Sector','geodirectory'), |
|
74 | - 'site_title' => __('Job Sector','geodirectory'), |
|
75 | - 'admin_desc' => __('Select the job sector.','geodirectory'), |
|
73 | + 'admin_title' => __('Job Sector', 'geodirectory'), |
|
74 | + 'site_title' => __('Job Sector', 'geodirectory'), |
|
75 | + 'admin_desc' => __('Select the job sector.', 'geodirectory'), |
|
76 | 76 | 'htmlvar_name' => 'job_sector', |
77 | 77 | 'is_active' => true, |
78 | 78 | 'for_admin_use' => false, |
79 | 79 | 'default_value' => '', |
80 | 80 | 'show_in' => '[detail]', |
81 | 81 | 'is_required' => true, |
82 | - 'option_values' => __('Select Sector/,Private Sector,Public Sector,Agencies','geodirectory'), |
|
82 | + 'option_values' => __('Select Sector/,Private Sector,Public Sector,Agencies', 'geodirectory'), |
|
83 | 83 | 'validation_pattern' => '', |
84 | 84 | 'validation_msg' => '', |
85 | 85 | 'required_msg' => '', |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | 'default_value' => '', |
103 | 103 | 'show_in' => '[detail],[listing]', |
104 | 104 | 'is_required' => true, |
105 | - 'option_values' => __('Select Experience/,No Experience Required,1 Year,2 Years,3 Years,4 Years,5 Years,6 Years,7 Years,8 Years,9 Years,10+ Years','geodirectory'), |
|
105 | + 'option_values' => __('Select Experience/,No Experience Required,1 Year,2 Years,3 Years,4 Years,5 Years,6 Years,7 Years,8 Years,9 Years,10+ Years', 'geodirectory'), |
|
106 | 106 | 'validation_pattern' => '', |
107 | 107 | 'validation_msg' => '', |
108 | 108 | 'required_msg' => '', |
@@ -235,24 +235,24 @@ discard block |
||
235 | 235 | return $fields; |
236 | 236 | } |
237 | 237 | |
238 | -global $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2,$wpdb, $current_user,$dummy_post_index; |
|
238 | +global $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2, $wpdb, $current_user, $dummy_post_index; |
|
239 | 239 | $post_info = array(); |
240 | 240 | $image_array = array(); |
241 | 241 | $post_meta = array(); |
242 | 242 | $category_array = array('Apartments', 'Houses', 'Commercial', 'Land'); |
243 | 243 | |
244 | -if($dummy_post_index==1){ |
|
244 | +if ($dummy_post_index == 1) { |
|
245 | 245 | // add the dummy categories |
246 | - geodir_dummy_data_taxonomies($post_type,$category_array ); |
|
246 | + geodir_dummy_data_taxonomies($post_type, $category_array); |
|
247 | 247 | |
248 | 248 | // add the dummy custom fields |
249 | 249 | $fields = geodir_property_sale_custom_fields($post_type); |
250 | 250 | geodir_create_dummy_fields($fields); |
251 | - update_option($post_type.'_dummy_data_type','property_sale'); |
|
251 | + update_option($post_type.'_dummy_data_type', 'property_sale'); |
|
252 | 252 | } |
253 | 253 | |
254 | 254 | if (geodir_dummy_folder_exists()) |
255 | - $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy"; |
|
255 | + $dummy_image_url = geodir_plugin_url()."/geodirectory-admin/dummy"; |
|
256 | 256 | else |
257 | 257 | $dummy_image_url = 'http://www.wpgeodirectory.com/dummy'; |
258 | 258 |
@@ -17,10 +17,11 @@ discard block |
||
17 | 17 | update_option($post_type.'_dummy_data_type','standard_places'); |
18 | 18 | } |
19 | 19 | |
20 | -if (geodir_dummy_folder_exists()) |
|
20 | +if (geodir_dummy_folder_exists()) { |
|
21 | 21 | $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy"; |
22 | -else |
|
22 | +} else { |
|
23 | 23 | $dummy_image_url = 'http://www.wpgeodirectory.com/dummy'; |
24 | +} |
|
24 | 25 | |
25 | 26 | $dummy_image_url = apply_filters('place_dummy_image_url', $dummy_image_url); |
26 | 27 | |
@@ -1815,16 +1816,18 @@ discard block |
||
1815 | 1816 | echo '###4.1'; |
1816 | 1817 | foreach ($post_info as $post_info) {echo '###5'; |
1817 | 1818 | $default_location = geodir_get_default_location(); |
1818 | - if ($city_bound_lat1 > $city_bound_lat2) |
|
1819 | - $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat1, $city_bound_lat2), geodir_random_float($city_bound_lat2, $city_bound_lat1)); |
|
1820 | - else |
|
1821 | - $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat2, $city_bound_lat1), geodir_random_float($city_bound_lat1, $city_bound_lat2)); |
|
1819 | + if ($city_bound_lat1 > $city_bound_lat2) { |
|
1820 | + $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat1, $city_bound_lat2), geodir_random_float($city_bound_lat2, $city_bound_lat1)); |
|
1821 | + } else { |
|
1822 | + $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat2, $city_bound_lat1), geodir_random_float($city_bound_lat1, $city_bound_lat2)); |
|
1823 | + } |
|
1822 | 1824 | |
1823 | 1825 | |
1824 | - if ($city_bound_lng1 > $city_bound_lng2) |
|
1825 | - $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng1, $city_bound_lng2), geodir_random_float($city_bound_lng2, $city_bound_lng1)); |
|
1826 | - else |
|
1827 | - $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng2, $city_bound_lng1), geodir_random_float($city_bound_lng1, $city_bound_lng2)); |
|
1826 | + if ($city_bound_lng1 > $city_bound_lng2) { |
|
1827 | + $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng1, $city_bound_lng2), geodir_random_float($city_bound_lng2, $city_bound_lng1)); |
|
1828 | + } else { |
|
1829 | + $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng2, $city_bound_lng1), geodir_random_float($city_bound_lng1, $city_bound_lng2)); |
|
1830 | + } |
|
1828 | 1831 | |
1829 | 1832 | $load_map = get_option('geodir_load_map'); |
1830 | 1833 |
@@ -16,22 +16,22 @@ discard block |
||
16 | 16 | */ |
17 | 17 | function geodir_on_wp_loaded() |
18 | 18 | { |
19 | - /** |
|
20 | - * Called on the wp_loaded WP hook and used to send the send inquiry and send to friend forms. |
|
21 | - * |
|
22 | - * @since 1.0.0 |
|
23 | - */ |
|
24 | - do_action('giodir_handle_request_plugins_loaded'); |
|
25 | - global $wpdb; |
|
19 | + /** |
|
20 | + * Called on the wp_loaded WP hook and used to send the send inquiry and send to friend forms. |
|
21 | + * |
|
22 | + * @since 1.0.0 |
|
23 | + */ |
|
24 | + do_action('giodir_handle_request_plugins_loaded'); |
|
25 | + global $wpdb; |
|
26 | 26 | |
27 | 27 | |
28 | - if (isset($_POST['sendact']) && $_POST['sendact'] == 'send_inqury') { |
|
29 | - geodir_send_inquiry($_REQUEST); // function in custom_functions.php |
|
28 | + if (isset($_POST['sendact']) && $_POST['sendact'] == 'send_inqury') { |
|
29 | + geodir_send_inquiry($_REQUEST); // function in custom_functions.php |
|
30 | 30 | |
31 | - } elseif (isset($_POST['sendact']) && $_POST['sendact'] == 'email_frnd') { |
|
32 | - geodir_send_friend($_REQUEST); // function in custom_functions.php |
|
31 | + } elseif (isset($_POST['sendact']) && $_POST['sendact'] == 'email_frnd') { |
|
32 | + geodir_send_friend($_REQUEST); // function in custom_functions.php |
|
33 | 33 | |
34 | - } |
|
34 | + } |
|
35 | 35 | |
36 | 36 | } |
37 | 37 | |
@@ -44,9 +44,9 @@ discard block |
||
44 | 44 | */ |
45 | 45 | function geodir_on_wp() |
46 | 46 | { |
47 | - if(geodir_is_page('login')) { |
|
48 | - geodir_user_signup(); |
|
49 | - } |
|
47 | + if(geodir_is_page('login')) { |
|
48 | + geodir_user_signup(); |
|
49 | + } |
|
50 | 50 | |
51 | 51 | } |
52 | 52 | |
@@ -59,32 +59,32 @@ discard block |
||
59 | 59 | */ |
60 | 60 | function geodir_on_init() |
61 | 61 | { |
62 | - /** |
|
63 | - * Called on the wp_init WP hook at the start of the geodir_on_init() function. |
|
64 | - * |
|
65 | - * @since 1.0.0 |
|
66 | - */ |
|
67 | - do_action('giodir_handle_request'); |
|
68 | - global $wpdb; |
|
62 | + /** |
|
63 | + * Called on the wp_init WP hook at the start of the geodir_on_init() function. |
|
64 | + * |
|
65 | + * @since 1.0.0 |
|
66 | + */ |
|
67 | + do_action('giodir_handle_request'); |
|
68 | + global $wpdb; |
|
69 | 69 | |
70 | 70 | |
71 | 71 | |
72 | 72 | |
73 | - if (get_option('geodir_allow_wpadmin') == '0' && is_user_logged_in() && !current_user_can('manage_options') && !class_exists('BuddyPress')) { |
|
74 | - show_admin_bar(false); |
|
75 | - } |
|
73 | + if (get_option('geodir_allow_wpadmin') == '0' && is_user_logged_in() && !current_user_can('manage_options') && !class_exists('BuddyPress')) { |
|
74 | + show_admin_bar(false); |
|
75 | + } |
|
76 | 76 | |
77 | 77 | |
78 | - if (isset($_REQUEST['ptype']) && $_REQUEST['ptype'] == 'get_markers') { |
|
79 | - /** |
|
80 | - * Contains map marker functions. |
|
81 | - * |
|
82 | - * @since 1.0.0 |
|
83 | - * @package GeoDirectory |
|
84 | - */ |
|
85 | - include_once(geodir_plugin_path() . '/geodirectory-functions/map-functions/get_markers.php'); |
|
86 | - die; |
|
87 | - } |
|
78 | + if (isset($_REQUEST['ptype']) && $_REQUEST['ptype'] == 'get_markers') { |
|
79 | + /** |
|
80 | + * Contains map marker functions. |
|
81 | + * |
|
82 | + * @since 1.0.0 |
|
83 | + * @package GeoDirectory |
|
84 | + */ |
|
85 | + include_once(geodir_plugin_path() . '/geodirectory-functions/map-functions/get_markers.php'); |
|
86 | + die; |
|
87 | + } |
|
88 | 88 | |
89 | 89 | |
90 | 90 | |
@@ -104,290 +104,290 @@ discard block |
||
104 | 104 | * @todo check if nonce is required here and if so add one. |
105 | 105 | */ |
106 | 106 | function geodir_ajax_handler() { |
107 | - global $wpdb, $gd_session,$post; |
|
107 | + global $wpdb, $gd_session,$post; |
|
108 | 108 | |
109 | - if (isset($_REQUEST['gd_listing_view']) && $_REQUEST['gd_listing_view'] != '') { |
|
109 | + if (isset($_REQUEST['gd_listing_view']) && $_REQUEST['gd_listing_view'] != '') { |
|
110 | 110 | $gd_session->set('gd_listing_view', $_REQUEST['gd_listing_view']); |
111 | - echo '1'; |
|
112 | - } |
|
113 | - |
|
114 | - if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'category_ajax') { |
|
115 | - if (isset($_REQUEST['main_catid']) && isset($_REQUEST['cat_tax']) && isset($_REQUEST['exclude'])) |
|
116 | - geodir_addpost_categories_html($_REQUEST['cat_tax'], $_REQUEST['main_catid'], '', '', '', $_REQUEST['exclude']); |
|
117 | - else if (isset($_REQUEST['catpid']) && isset($_REQUEST['cat_tax'])) |
|
118 | - geodir_editpost_categories_html($_REQUEST['cat_tax'], $_REQUEST['catpid']); |
|
119 | - } |
|
120 | - |
|
121 | - if ((isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'admin_ajax') || isset($_REQUEST['create_field']) || isset($_REQUEST['sort_create_field'])) { |
|
122 | - if (current_user_can('manage_options')) { |
|
123 | - /** |
|
124 | - * Contains admin ajax handling functions. |
|
125 | - * |
|
126 | - * @since 1.0.0 |
|
127 | - * @package GeoDirectory |
|
128 | - */ |
|
129 | - include_once(geodir_plugin_path() . '/geodirectory-admin/geodir_admin_ajax.php'); |
|
130 | - } else { |
|
131 | - wp_redirect(geodir_login_url()); |
|
132 | - gd_die(); |
|
133 | - } |
|
134 | - } |
|
135 | - |
|
136 | - if (isset($_REQUEST['geodir_autofill']) && $_REQUEST['geodir_autofill'] != '' && isset($_REQUEST['_wpnonce'])) { |
|
137 | - if (current_user_can('manage_options')) { |
|
138 | - switch ($_REQUEST['geodir_autofill']): |
|
139 | - case "geodir_dummy_delete" : |
|
140 | - if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir_dummy_posts_insert_noncename')) |
|
141 | - return; |
|
142 | - |
|
143 | - $datatype = isset($_REQUEST['datatype']) ? sanitize_key($_REQUEST['datatype']) : ''; |
|
144 | - if (isset($_REQUEST['posttype'])) |
|
145 | - /** |
|
146 | - * Used to delete the dummy post data per post type. |
|
147 | - * |
|
148 | - * Uses dynamic hook, geodir_delete_dummy_posts_$_REQUEST['posttype']. |
|
149 | - * |
|
150 | - * @since 1.6.11 |
|
151 | - * @param string $posttype The post type to insert. |
|
152 | - * @param string $datatype The type of dummy data to insert. |
|
153 | - */ |
|
154 | - do_action('geodir_delete_dummy_posts' ,sanitize_key($_REQUEST['posttype']),$datatype); |
|
155 | - break; |
|
156 | - case "geodir_dummy_insert" : |
|
157 | - if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir_dummy_posts_insert_noncename')) |
|
158 | - return; |
|
159 | - |
|
160 | - global $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2; |
|
161 | - $city_bound_lat1 = $_REQUEST['city_bound_lat1']; |
|
162 | - $city_bound_lng1 = $_REQUEST['city_bound_lng1']; |
|
163 | - $city_bound_lat2 = $_REQUEST['city_bound_lat2']; |
|
164 | - $city_bound_lng2 = $_REQUEST['city_bound_lng2']; |
|
165 | - |
|
166 | - if (isset($_REQUEST['posttype'])){ |
|
167 | - /** |
|
168 | - * Used to insert the dummy post data per post type. |
|
169 | - * |
|
170 | - * Uses dynamic hook, geodir_insert_dummy_posts_$_REQUEST['posttype']. |
|
171 | - * |
|
172 | - * @since 1.6.11 |
|
173 | - * @param string $posttype The post type to insert. |
|
174 | - * @param string $datatype The type of dummy data to insert. |
|
175 | - * @param int $post_index The item number to insert. |
|
176 | - */ |
|
177 | - do_action('geodir_insert_dummy_posts',sanitize_key($_REQUEST['posttype']),sanitize_key($_REQUEST['datatype']),absint($_REQUEST['insert_dummy_post_index'])); |
|
178 | - } |
|
179 | - |
|
180 | - |
|
181 | - break; |
|
182 | - endswitch; |
|
183 | - } else { |
|
184 | - wp_redirect(geodir_login_url()); |
|
185 | - exit(); |
|
186 | - } |
|
187 | - } |
|
188 | - |
|
189 | - if (isset($_REQUEST['popuptype']) && $_REQUEST['popuptype'] != '' && isset($_REQUEST['post_id']) && $_REQUEST['post_id'] != '') { |
|
190 | - |
|
191 | - if ($_REQUEST['popuptype'] == 'b_send_inquiry' || $_REQUEST['popuptype'] == 'b_sendtofriend') { |
|
192 | - $template = locate_template(array("geodirectory/popup-forms.php")); |
|
193 | - if (!$template) { |
|
194 | - $template = geodir_plugin_path() . '/geodirectory-templates/popup-forms.php'; |
|
195 | - } |
|
196 | - require_once($template); |
|
197 | - } |
|
198 | - |
|
199 | - gd_die(); |
|
200 | - } |
|
201 | - |
|
202 | - /*if(isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'filter_ajax'){ |
|
111 | + echo '1'; |
|
112 | + } |
|
113 | + |
|
114 | + if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'category_ajax') { |
|
115 | + if (isset($_REQUEST['main_catid']) && isset($_REQUEST['cat_tax']) && isset($_REQUEST['exclude'])) |
|
116 | + geodir_addpost_categories_html($_REQUEST['cat_tax'], $_REQUEST['main_catid'], '', '', '', $_REQUEST['exclude']); |
|
117 | + else if (isset($_REQUEST['catpid']) && isset($_REQUEST['cat_tax'])) |
|
118 | + geodir_editpost_categories_html($_REQUEST['cat_tax'], $_REQUEST['catpid']); |
|
119 | + } |
|
120 | + |
|
121 | + if ((isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'admin_ajax') || isset($_REQUEST['create_field']) || isset($_REQUEST['sort_create_field'])) { |
|
122 | + if (current_user_can('manage_options')) { |
|
123 | + /** |
|
124 | + * Contains admin ajax handling functions. |
|
125 | + * |
|
126 | + * @since 1.0.0 |
|
127 | + * @package GeoDirectory |
|
128 | + */ |
|
129 | + include_once(geodir_plugin_path() . '/geodirectory-admin/geodir_admin_ajax.php'); |
|
130 | + } else { |
|
131 | + wp_redirect(geodir_login_url()); |
|
132 | + gd_die(); |
|
133 | + } |
|
134 | + } |
|
135 | + |
|
136 | + if (isset($_REQUEST['geodir_autofill']) && $_REQUEST['geodir_autofill'] != '' && isset($_REQUEST['_wpnonce'])) { |
|
137 | + if (current_user_can('manage_options')) { |
|
138 | + switch ($_REQUEST['geodir_autofill']): |
|
139 | + case "geodir_dummy_delete" : |
|
140 | + if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir_dummy_posts_insert_noncename')) |
|
141 | + return; |
|
142 | + |
|
143 | + $datatype = isset($_REQUEST['datatype']) ? sanitize_key($_REQUEST['datatype']) : ''; |
|
144 | + if (isset($_REQUEST['posttype'])) |
|
145 | + /** |
|
146 | + * Used to delete the dummy post data per post type. |
|
147 | + * |
|
148 | + * Uses dynamic hook, geodir_delete_dummy_posts_$_REQUEST['posttype']. |
|
149 | + * |
|
150 | + * @since 1.6.11 |
|
151 | + * @param string $posttype The post type to insert. |
|
152 | + * @param string $datatype The type of dummy data to insert. |
|
153 | + */ |
|
154 | + do_action('geodir_delete_dummy_posts' ,sanitize_key($_REQUEST['posttype']),$datatype); |
|
155 | + break; |
|
156 | + case "geodir_dummy_insert" : |
|
157 | + if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir_dummy_posts_insert_noncename')) |
|
158 | + return; |
|
159 | + |
|
160 | + global $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2; |
|
161 | + $city_bound_lat1 = $_REQUEST['city_bound_lat1']; |
|
162 | + $city_bound_lng1 = $_REQUEST['city_bound_lng1']; |
|
163 | + $city_bound_lat2 = $_REQUEST['city_bound_lat2']; |
|
164 | + $city_bound_lng2 = $_REQUEST['city_bound_lng2']; |
|
165 | + |
|
166 | + if (isset($_REQUEST['posttype'])){ |
|
167 | + /** |
|
168 | + * Used to insert the dummy post data per post type. |
|
169 | + * |
|
170 | + * Uses dynamic hook, geodir_insert_dummy_posts_$_REQUEST['posttype']. |
|
171 | + * |
|
172 | + * @since 1.6.11 |
|
173 | + * @param string $posttype The post type to insert. |
|
174 | + * @param string $datatype The type of dummy data to insert. |
|
175 | + * @param int $post_index The item number to insert. |
|
176 | + */ |
|
177 | + do_action('geodir_insert_dummy_posts',sanitize_key($_REQUEST['posttype']),sanitize_key($_REQUEST['datatype']),absint($_REQUEST['insert_dummy_post_index'])); |
|
178 | + } |
|
179 | + |
|
180 | + |
|
181 | + break; |
|
182 | + endswitch; |
|
183 | + } else { |
|
184 | + wp_redirect(geodir_login_url()); |
|
185 | + exit(); |
|
186 | + } |
|
187 | + } |
|
188 | + |
|
189 | + if (isset($_REQUEST['popuptype']) && $_REQUEST['popuptype'] != '' && isset($_REQUEST['post_id']) && $_REQUEST['post_id'] != '') { |
|
190 | + |
|
191 | + if ($_REQUEST['popuptype'] == 'b_send_inquiry' || $_REQUEST['popuptype'] == 'b_sendtofriend') { |
|
192 | + $template = locate_template(array("geodirectory/popup-forms.php")); |
|
193 | + if (!$template) { |
|
194 | + $template = geodir_plugin_path() . '/geodirectory-templates/popup-forms.php'; |
|
195 | + } |
|
196 | + require_once($template); |
|
197 | + } |
|
198 | + |
|
199 | + gd_die(); |
|
200 | + } |
|
201 | + |
|
202 | + /*if(isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'filter_ajax'){ |
|
203 | 203 | include_once ( geodir_plugin_path() . '/geodirectory-templates/advance-search-form.php'); |
204 | 204 | }*/ |
205 | 205 | |
206 | - if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'map_ajax') { |
|
207 | - /** |
|
208 | - * Contains map marker functions. |
|
209 | - * |
|
210 | - * @since 1.0.0 |
|
211 | - * @package GeoDirectory |
|
212 | - */ |
|
213 | - include_once(geodir_plugin_path() . '/geodirectory-functions/map-functions/get_markers.php'); |
|
214 | - } |
|
215 | - |
|
216 | - if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'favorite') { |
|
217 | - if (is_user_logged_in()) { |
|
218 | - switch ($_REQUEST['ajax_action']): |
|
219 | - case "add" : |
|
220 | - geodir_add_to_favorite((int)$_REQUEST['pid']); |
|
221 | - break; |
|
222 | - case "remove" : |
|
223 | - geodir_remove_from_favorite((int)$_REQUEST['pid']); |
|
224 | - break; |
|
225 | - endswitch; |
|
226 | - } else { |
|
227 | - wp_redirect(geodir_login_url()); |
|
228 | - exit(); |
|
229 | - } |
|
230 | - } |
|
231 | - |
|
232 | - if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'add_listing') { |
|
233 | - |
|
234 | - $is_current_user_owner = true; |
|
235 | - if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { |
|
236 | - $is_current_user_owner = geodir_listing_belong_to_current_user((int)$_REQUEST['pid']); |
|
237 | - } |
|
238 | - |
|
239 | - $request = $gd_session->get('listing'); |
|
240 | - |
|
241 | - if (is_user_logged_in() && $is_current_user_owner) { |
|
242 | - |
|
243 | - switch ($_REQUEST['ajax_action']): |
|
244 | - case "add": |
|
245 | - case "update": |
|
246 | - |
|
247 | - if (isset($request['geodir_spamblocker']) && $request['geodir_spamblocker'] == '64' && isset($request['geodir_filled_by_spam_bot']) && $request['geodir_filled_by_spam_bot'] == '') { |
|
248 | - $last_id = geodir_save_listing(); |
|
249 | - |
|
250 | - if ($last_id) { |
|
251 | - //$redirect_to = get_permalink( $last_id ); |
|
252 | - $redirect_to = geodir_getlink(get_permalink(geodir_success_page_id()), array('pid' => $last_id)); |
|
253 | - |
|
254 | - } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { |
|
255 | - $redirect_to = get_permalink(geodir_add_listing_page_id()); |
|
256 | - $redirect_to = geodir_getlink($redirect_to, array('pid' => $post->pid), false); |
|
257 | - } else |
|
258 | - $redirect_to = get_permalink(geodir_add_listing_page_id()); |
|
259 | - |
|
260 | - wp_redirect($redirect_to); |
|
261 | - } else { |
|
262 | - $gd_session->un_set('listing'); |
|
263 | - wp_redirect(home_url()); |
|
264 | - } |
|
265 | - |
|
266 | - break; |
|
267 | - case "cancel" : |
|
268 | - |
|
269 | - $gd_session->un_set('listing'); |
|
270 | - |
|
271 | - if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '' && get_permalink($_REQUEST['pid'])) |
|
272 | - wp_redirect(get_permalink($_REQUEST['pid'])); |
|
273 | - else { |
|
274 | - geodir_remove_temp_images(); |
|
275 | - wp_redirect(geodir_getlink(get_permalink(geodir_add_listing_page_id()), array('listing_type' => $_REQUEST['listing_type']))); |
|
276 | - } |
|
277 | - |
|
278 | - break; |
|
279 | - |
|
280 | - case "publish" : |
|
281 | - |
|
282 | - if (isset($request['geodir_spamblocker']) && $request['geodir_spamblocker'] == '64' && isset($request['geodir_filled_by_spam_bot']) && $request['geodir_filled_by_spam_bot'] == '') { |
|
283 | - |
|
284 | - if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { |
|
285 | - $new_post = array(); |
|
286 | - $new_post['ID'] = $_REQUEST['pid']; |
|
287 | - |
|
288 | - $lastid = wp_update_post($new_post); |
|
289 | - |
|
290 | - $gd_session->un_set('listing'); |
|
291 | - wp_redirect(get_permalink($lastid)); |
|
292 | - } else { |
|
293 | - $last_id = geodir_save_listing(); |
|
294 | - |
|
295 | - if ($last_id) { |
|
296 | - //$redirect_to = get_permalink( $last_id ); |
|
297 | - $redirect_to = geodir_getlink(get_permalink(geodir_success_page_id()), array('pid' => $last_id)); |
|
298 | - } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { |
|
299 | - $redirect_to = get_permalink(geodir_add_listing_page_id()); |
|
300 | - $redirect_to = geodir_getlink($redirect_to, array('pid' => $post->pid), false); |
|
301 | - } else |
|
302 | - $redirect_to = get_permalink(geodir_add_listing_page_id()); |
|
303 | - |
|
304 | - $gd_session->un_set('listing'); |
|
305 | - wp_redirect($redirect_to); |
|
306 | - } |
|
307 | - } else { |
|
308 | - $gd_session->un_set('listing'); |
|
309 | - wp_redirect(home_url()); |
|
310 | - } |
|
311 | - |
|
312 | - break; |
|
313 | - case "delete" : |
|
314 | - if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { |
|
315 | - global $current_user; |
|
316 | - |
|
317 | - if (get_option('geodir_disable_perm_delete')) { |
|
318 | - $lastid = wp_trash_post($_REQUEST['pid']); |
|
319 | - } else { |
|
320 | - $lastid = wp_delete_post($_REQUEST['pid']); |
|
321 | - } |
|
322 | - |
|
323 | - if ($lastid && !is_wp_error($lastid)) |
|
324 | - wp_redirect($_SERVER['HTTP_REFERER']); |
|
325 | - |
|
326 | - //wp_redirect( geodir_getlink(get_author_posts_url($current_user->ID),array('geodir_dashbord'=>'true','stype'=>$post_type ),false) ); |
|
327 | - } |
|
328 | - break; |
|
329 | - endswitch; |
|
330 | - |
|
331 | - $gd_session->un_set('listing'); |
|
332 | - } else { |
|
333 | - $gd_session->un_set('listing'); |
|
334 | - wp_redirect(geodir_login_url()); |
|
335 | - exit(); |
|
336 | - } |
|
337 | - } |
|
338 | - |
|
339 | - if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'user_login') { |
|
340 | - /** |
|
341 | - * Contains registration and login functions. |
|
342 | - * @todo Fix the file path. |
|
343 | - * |
|
344 | - * @since 1.0.0 |
|
345 | - * @package GeoDirectory |
|
346 | - */ |
|
347 | - include_once(geodir_plugin_path() . '/geodirectory-functions/geodirectory_reg.php'); |
|
348 | - } |
|
349 | - |
|
350 | - if (isset($_REQUEST['ajax_action']) && $_REQUEST['ajax_action'] == 'geodir_get_term_list') { |
|
351 | - $args = array('taxonomy' => sanitize_text_field($_REQUEST['term'])); |
|
352 | - if (!empty($_REQUEST['parent_only'])) { |
|
353 | - $args['parent'] = 0; |
|
354 | - } |
|
355 | - $terms_o = get_terms($args); |
|
206 | + if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'map_ajax') { |
|
207 | + /** |
|
208 | + * Contains map marker functions. |
|
209 | + * |
|
210 | + * @since 1.0.0 |
|
211 | + * @package GeoDirectory |
|
212 | + */ |
|
213 | + include_once(geodir_plugin_path() . '/geodirectory-functions/map-functions/get_markers.php'); |
|
214 | + } |
|
215 | + |
|
216 | + if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'favorite') { |
|
217 | + if (is_user_logged_in()) { |
|
218 | + switch ($_REQUEST['ajax_action']): |
|
219 | + case "add" : |
|
220 | + geodir_add_to_favorite((int)$_REQUEST['pid']); |
|
221 | + break; |
|
222 | + case "remove" : |
|
223 | + geodir_remove_from_favorite((int)$_REQUEST['pid']); |
|
224 | + break; |
|
225 | + endswitch; |
|
226 | + } else { |
|
227 | + wp_redirect(geodir_login_url()); |
|
228 | + exit(); |
|
229 | + } |
|
230 | + } |
|
231 | + |
|
232 | + if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'add_listing') { |
|
233 | + |
|
234 | + $is_current_user_owner = true; |
|
235 | + if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { |
|
236 | + $is_current_user_owner = geodir_listing_belong_to_current_user((int)$_REQUEST['pid']); |
|
237 | + } |
|
238 | + |
|
239 | + $request = $gd_session->get('listing'); |
|
240 | + |
|
241 | + if (is_user_logged_in() && $is_current_user_owner) { |
|
242 | + |
|
243 | + switch ($_REQUEST['ajax_action']): |
|
244 | + case "add": |
|
245 | + case "update": |
|
246 | + |
|
247 | + if (isset($request['geodir_spamblocker']) && $request['geodir_spamblocker'] == '64' && isset($request['geodir_filled_by_spam_bot']) && $request['geodir_filled_by_spam_bot'] == '') { |
|
248 | + $last_id = geodir_save_listing(); |
|
249 | + |
|
250 | + if ($last_id) { |
|
251 | + //$redirect_to = get_permalink( $last_id ); |
|
252 | + $redirect_to = geodir_getlink(get_permalink(geodir_success_page_id()), array('pid' => $last_id)); |
|
253 | + |
|
254 | + } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { |
|
255 | + $redirect_to = get_permalink(geodir_add_listing_page_id()); |
|
256 | + $redirect_to = geodir_getlink($redirect_to, array('pid' => $post->pid), false); |
|
257 | + } else |
|
258 | + $redirect_to = get_permalink(geodir_add_listing_page_id()); |
|
259 | + |
|
260 | + wp_redirect($redirect_to); |
|
261 | + } else { |
|
262 | + $gd_session->un_set('listing'); |
|
263 | + wp_redirect(home_url()); |
|
264 | + } |
|
265 | + |
|
266 | + break; |
|
267 | + case "cancel" : |
|
268 | + |
|
269 | + $gd_session->un_set('listing'); |
|
270 | + |
|
271 | + if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '' && get_permalink($_REQUEST['pid'])) |
|
272 | + wp_redirect(get_permalink($_REQUEST['pid'])); |
|
273 | + else { |
|
274 | + geodir_remove_temp_images(); |
|
275 | + wp_redirect(geodir_getlink(get_permalink(geodir_add_listing_page_id()), array('listing_type' => $_REQUEST['listing_type']))); |
|
276 | + } |
|
277 | + |
|
278 | + break; |
|
279 | + |
|
280 | + case "publish" : |
|
281 | + |
|
282 | + if (isset($request['geodir_spamblocker']) && $request['geodir_spamblocker'] == '64' && isset($request['geodir_filled_by_spam_bot']) && $request['geodir_filled_by_spam_bot'] == '') { |
|
283 | + |
|
284 | + if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { |
|
285 | + $new_post = array(); |
|
286 | + $new_post['ID'] = $_REQUEST['pid']; |
|
287 | + |
|
288 | + $lastid = wp_update_post($new_post); |
|
289 | + |
|
290 | + $gd_session->un_set('listing'); |
|
291 | + wp_redirect(get_permalink($lastid)); |
|
292 | + } else { |
|
293 | + $last_id = geodir_save_listing(); |
|
294 | + |
|
295 | + if ($last_id) { |
|
296 | + //$redirect_to = get_permalink( $last_id ); |
|
297 | + $redirect_to = geodir_getlink(get_permalink(geodir_success_page_id()), array('pid' => $last_id)); |
|
298 | + } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { |
|
299 | + $redirect_to = get_permalink(geodir_add_listing_page_id()); |
|
300 | + $redirect_to = geodir_getlink($redirect_to, array('pid' => $post->pid), false); |
|
301 | + } else |
|
302 | + $redirect_to = get_permalink(geodir_add_listing_page_id()); |
|
303 | + |
|
304 | + $gd_session->un_set('listing'); |
|
305 | + wp_redirect($redirect_to); |
|
306 | + } |
|
307 | + } else { |
|
308 | + $gd_session->un_set('listing'); |
|
309 | + wp_redirect(home_url()); |
|
310 | + } |
|
311 | + |
|
312 | + break; |
|
313 | + case "delete" : |
|
314 | + if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { |
|
315 | + global $current_user; |
|
316 | + |
|
317 | + if (get_option('geodir_disable_perm_delete')) { |
|
318 | + $lastid = wp_trash_post($_REQUEST['pid']); |
|
319 | + } else { |
|
320 | + $lastid = wp_delete_post($_REQUEST['pid']); |
|
321 | + } |
|
322 | + |
|
323 | + if ($lastid && !is_wp_error($lastid)) |
|
324 | + wp_redirect($_SERVER['HTTP_REFERER']); |
|
325 | + |
|
326 | + //wp_redirect( geodir_getlink(get_author_posts_url($current_user->ID),array('geodir_dashbord'=>'true','stype'=>$post_type ),false) ); |
|
327 | + } |
|
328 | + break; |
|
329 | + endswitch; |
|
330 | + |
|
331 | + $gd_session->un_set('listing'); |
|
332 | + } else { |
|
333 | + $gd_session->un_set('listing'); |
|
334 | + wp_redirect(geodir_login_url()); |
|
335 | + exit(); |
|
336 | + } |
|
337 | + } |
|
338 | + |
|
339 | + if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'user_login') { |
|
340 | + /** |
|
341 | + * Contains registration and login functions. |
|
342 | + * @todo Fix the file path. |
|
343 | + * |
|
344 | + * @since 1.0.0 |
|
345 | + * @package GeoDirectory |
|
346 | + */ |
|
347 | + include_once(geodir_plugin_path() . '/geodirectory-functions/geodirectory_reg.php'); |
|
348 | + } |
|
349 | + |
|
350 | + if (isset($_REQUEST['ajax_action']) && $_REQUEST['ajax_action'] == 'geodir_get_term_list') { |
|
351 | + $args = array('taxonomy' => sanitize_text_field($_REQUEST['term'])); |
|
352 | + if (!empty($_REQUEST['parent_only'])) { |
|
353 | + $args['parent'] = 0; |
|
354 | + } |
|
355 | + $terms_o = get_terms($args); |
|
356 | 356 | |
357 | - // Skip terms which has no listing |
|
358 | - if (!empty($terms_o)) { |
|
359 | - $filter_terms = array(); |
|
357 | + // Skip terms which has no listing |
|
358 | + if (!empty($terms_o)) { |
|
359 | + $filter_terms = array(); |
|
360 | 360 | |
361 | - foreach ($terms_o as $term) { |
|
362 | - if (isset($term->count) && $term->count > 0) { |
|
363 | - $filter_terms[] = $term; |
|
364 | - } |
|
365 | - } |
|
366 | - $terms_o = $filter_terms; |
|
367 | - } |
|
361 | + foreach ($terms_o as $term) { |
|
362 | + if (isset($term->count) && $term->count > 0) { |
|
363 | + $filter_terms[] = $term; |
|
364 | + } |
|
365 | + } |
|
366 | + $terms_o = $filter_terms; |
|
367 | + } |
|
368 | 368 | |
369 | - $terms = geodir_sort_terms($terms_o, 'count'); |
|
370 | - geodir_helper_cat_list_output($terms, intval($_REQUEST['limit'])); |
|
371 | - exit(); |
|
372 | - } |
|
369 | + $terms = geodir_sort_terms($terms_o, 'count'); |
|
370 | + geodir_helper_cat_list_output($terms, intval($_REQUEST['limit'])); |
|
371 | + exit(); |
|
372 | + } |
|
373 | 373 | |
374 | - gd_die(); |
|
374 | + gd_die(); |
|
375 | 375 | } |
376 | 376 | |
377 | 377 | |
378 | 378 | function geodir_show_ga_stats(){ |
379 | - if (isset($_REQUEST['ga_start'])) { |
|
380 | - $ga_start = $_REQUEST['ga_start']; |
|
381 | - } else { |
|
382 | - $ga_start = ''; |
|
383 | - } |
|
384 | - if (isset($_REQUEST['ga_end'])) { |
|
385 | - $ga_end = $_REQUEST['ga_end']; |
|
386 | - } else { |
|
387 | - $ga_end = ''; |
|
388 | - } |
|
389 | - geodir_getGoogleAnalytics($_REQUEST['ga_page'], $ga_start, $ga_end); |
|
390 | - die; |
|
379 | + if (isset($_REQUEST['ga_start'])) { |
|
380 | + $ga_start = $_REQUEST['ga_start']; |
|
381 | + } else { |
|
382 | + $ga_start = ''; |
|
383 | + } |
|
384 | + if (isset($_REQUEST['ga_end'])) { |
|
385 | + $ga_end = $_REQUEST['ga_end']; |
|
386 | + } else { |
|
387 | + $ga_end = ''; |
|
388 | + } |
|
389 | + geodir_getGoogleAnalytics($_REQUEST['ga_page'], $ga_start, $ga_end); |
|
390 | + die; |
|
391 | 391 | } |
392 | 392 | add_action( 'wp_ajax_gdga', 'geodir_show_ga_stats' ); |
393 | 393 | add_action( 'wp_ajax_nopriv_gdga', 'geodir_show_ga_stats' ); |
394 | 394 | \ No newline at end of file |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | */ |
45 | 45 | function geodir_on_wp() |
46 | 46 | { |
47 | - if(geodir_is_page('login')) { |
|
47 | + if (geodir_is_page('login')) { |
|
48 | 48 | geodir_user_signup(); |
49 | 49 | } |
50 | 50 | |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | * @since 1.0.0 |
83 | 83 | * @package GeoDirectory |
84 | 84 | */ |
85 | - include_once(geodir_plugin_path() . '/geodirectory-functions/map-functions/get_markers.php'); |
|
85 | + include_once(geodir_plugin_path().'/geodirectory-functions/map-functions/get_markers.php'); |
|
86 | 86 | die; |
87 | 87 | } |
88 | 88 | |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | * @todo check if nonce is required here and if so add one. |
105 | 105 | */ |
106 | 106 | function geodir_ajax_handler() { |
107 | - global $wpdb, $gd_session,$post; |
|
107 | + global $wpdb, $gd_session, $post; |
|
108 | 108 | |
109 | 109 | if (isset($_REQUEST['gd_listing_view']) && $_REQUEST['gd_listing_view'] != '') { |
110 | 110 | $gd_session->set('gd_listing_view', $_REQUEST['gd_listing_view']); |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | * @since 1.0.0 |
127 | 127 | * @package GeoDirectory |
128 | 128 | */ |
129 | - include_once(geodir_plugin_path() . '/geodirectory-admin/geodir_admin_ajax.php'); |
|
129 | + include_once(geodir_plugin_path().'/geodirectory-admin/geodir_admin_ajax.php'); |
|
130 | 130 | } else { |
131 | 131 | wp_redirect(geodir_login_url()); |
132 | 132 | gd_die(); |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | * @param string $posttype The post type to insert. |
152 | 152 | * @param string $datatype The type of dummy data to insert. |
153 | 153 | */ |
154 | - do_action('geodir_delete_dummy_posts' ,sanitize_key($_REQUEST['posttype']),$datatype); |
|
154 | + do_action('geodir_delete_dummy_posts', sanitize_key($_REQUEST['posttype']), $datatype); |
|
155 | 155 | break; |
156 | 156 | case "geodir_dummy_insert" : |
157 | 157 | if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir_dummy_posts_insert_noncename')) |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | $city_bound_lat2 = $_REQUEST['city_bound_lat2']; |
164 | 164 | $city_bound_lng2 = $_REQUEST['city_bound_lng2']; |
165 | 165 | |
166 | - if (isset($_REQUEST['posttype'])){ |
|
166 | + if (isset($_REQUEST['posttype'])) { |
|
167 | 167 | /** |
168 | 168 | * Used to insert the dummy post data per post type. |
169 | 169 | * |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | * @param string $datatype The type of dummy data to insert. |
175 | 175 | * @param int $post_index The item number to insert. |
176 | 176 | */ |
177 | - do_action('geodir_insert_dummy_posts',sanitize_key($_REQUEST['posttype']),sanitize_key($_REQUEST['datatype']),absint($_REQUEST['insert_dummy_post_index'])); |
|
177 | + do_action('geodir_insert_dummy_posts', sanitize_key($_REQUEST['posttype']), sanitize_key($_REQUEST['datatype']), absint($_REQUEST['insert_dummy_post_index'])); |
|
178 | 178 | } |
179 | 179 | |
180 | 180 | |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | if ($_REQUEST['popuptype'] == 'b_send_inquiry' || $_REQUEST['popuptype'] == 'b_sendtofriend') { |
192 | 192 | $template = locate_template(array("geodirectory/popup-forms.php")); |
193 | 193 | if (!$template) { |
194 | - $template = geodir_plugin_path() . '/geodirectory-templates/popup-forms.php'; |
|
194 | + $template = geodir_plugin_path().'/geodirectory-templates/popup-forms.php'; |
|
195 | 195 | } |
196 | 196 | require_once($template); |
197 | 197 | } |
@@ -210,17 +210,17 @@ discard block |
||
210 | 210 | * @since 1.0.0 |
211 | 211 | * @package GeoDirectory |
212 | 212 | */ |
213 | - include_once(geodir_plugin_path() . '/geodirectory-functions/map-functions/get_markers.php'); |
|
213 | + include_once(geodir_plugin_path().'/geodirectory-functions/map-functions/get_markers.php'); |
|
214 | 214 | } |
215 | 215 | |
216 | 216 | if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'favorite') { |
217 | 217 | if (is_user_logged_in()) { |
218 | 218 | switch ($_REQUEST['ajax_action']): |
219 | 219 | case "add" : |
220 | - geodir_add_to_favorite((int)$_REQUEST['pid']); |
|
220 | + geodir_add_to_favorite((int) $_REQUEST['pid']); |
|
221 | 221 | break; |
222 | 222 | case "remove" : |
223 | - geodir_remove_from_favorite((int)$_REQUEST['pid']); |
|
223 | + geodir_remove_from_favorite((int) $_REQUEST['pid']); |
|
224 | 224 | break; |
225 | 225 | endswitch; |
226 | 226 | } else { |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | |
234 | 234 | $is_current_user_owner = true; |
235 | 235 | if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { |
236 | - $is_current_user_owner = geodir_listing_belong_to_current_user((int)$_REQUEST['pid']); |
|
236 | + $is_current_user_owner = geodir_listing_belong_to_current_user((int) $_REQUEST['pid']); |
|
237 | 237 | } |
238 | 238 | |
239 | 239 | $request = $gd_session->get('listing'); |
@@ -344,7 +344,7 @@ discard block |
||
344 | 344 | * @since 1.0.0 |
345 | 345 | * @package GeoDirectory |
346 | 346 | */ |
347 | - include_once(geodir_plugin_path() . '/geodirectory-functions/geodirectory_reg.php'); |
|
347 | + include_once(geodir_plugin_path().'/geodirectory-functions/geodirectory_reg.php'); |
|
348 | 348 | } |
349 | 349 | |
350 | 350 | if (isset($_REQUEST['ajax_action']) && $_REQUEST['ajax_action'] == 'geodir_get_term_list') { |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | } |
376 | 376 | |
377 | 377 | |
378 | -function geodir_show_ga_stats(){ |
|
378 | +function geodir_show_ga_stats() { |
|
379 | 379 | if (isset($_REQUEST['ga_start'])) { |
380 | 380 | $ga_start = $_REQUEST['ga_start']; |
381 | 381 | } else { |
@@ -389,5 +389,5 @@ discard block |
||
389 | 389 | geodir_getGoogleAnalytics($_REQUEST['ga_page'], $ga_start, $ga_end); |
390 | 390 | die; |
391 | 391 | } |
392 | -add_action( 'wp_ajax_gdga', 'geodir_show_ga_stats' ); |
|
393 | -add_action( 'wp_ajax_nopriv_gdga', 'geodir_show_ga_stats' ); |
|
394 | 392 | \ No newline at end of file |
393 | +add_action('wp_ajax_gdga', 'geodir_show_ga_stats'); |
|
394 | +add_action('wp_ajax_nopriv_gdga', 'geodir_show_ga_stats'); |
|
395 | 395 | \ No newline at end of file |
@@ -112,10 +112,11 @@ discard block |
||
112 | 112 | } |
113 | 113 | |
114 | 114 | if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'category_ajax') { |
115 | - if (isset($_REQUEST['main_catid']) && isset($_REQUEST['cat_tax']) && isset($_REQUEST['exclude'])) |
|
116 | - geodir_addpost_categories_html($_REQUEST['cat_tax'], $_REQUEST['main_catid'], '', '', '', $_REQUEST['exclude']); |
|
117 | - else if (isset($_REQUEST['catpid']) && isset($_REQUEST['cat_tax'])) |
|
118 | - geodir_editpost_categories_html($_REQUEST['cat_tax'], $_REQUEST['catpid']); |
|
115 | + if (isset($_REQUEST['main_catid']) && isset($_REQUEST['cat_tax']) && isset($_REQUEST['exclude'])) { |
|
116 | + geodir_addpost_categories_html($_REQUEST['cat_tax'], $_REQUEST['main_catid'], '', '', '', $_REQUEST['exclude']); |
|
117 | + } else if (isset($_REQUEST['catpid']) && isset($_REQUEST['cat_tax'])) { |
|
118 | + geodir_editpost_categories_html($_REQUEST['cat_tax'], $_REQUEST['catpid']); |
|
119 | + } |
|
119 | 120 | } |
120 | 121 | |
121 | 122 | if ((isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'admin_ajax') || isset($_REQUEST['create_field']) || isset($_REQUEST['sort_create_field'])) { |
@@ -137,12 +138,13 @@ discard block |
||
137 | 138 | if (current_user_can('manage_options')) { |
138 | 139 | switch ($_REQUEST['geodir_autofill']): |
139 | 140 | case "geodir_dummy_delete" : |
140 | - if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir_dummy_posts_insert_noncename')) |
|
141 | - return; |
|
141 | + if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir_dummy_posts_insert_noncename')) { |
|
142 | + return; |
|
143 | + } |
|
142 | 144 | |
143 | 145 | $datatype = isset($_REQUEST['datatype']) ? sanitize_key($_REQUEST['datatype']) : ''; |
144 | - if (isset($_REQUEST['posttype'])) |
|
145 | - /** |
|
146 | + if (isset($_REQUEST['posttype'])) { |
|
147 | + /** |
|
146 | 148 | * Used to delete the dummy post data per post type. |
147 | 149 | * |
148 | 150 | * Uses dynamic hook, geodir_delete_dummy_posts_$_REQUEST['posttype']. |
@@ -151,11 +153,13 @@ discard block |
||
151 | 153 | * @param string $posttype The post type to insert. |
152 | 154 | * @param string $datatype The type of dummy data to insert. |
153 | 155 | */ |
154 | - do_action('geodir_delete_dummy_posts' ,sanitize_key($_REQUEST['posttype']),$datatype); |
|
156 | + do_action('geodir_delete_dummy_posts' ,sanitize_key($_REQUEST['posttype']),$datatype); |
|
157 | + } |
|
155 | 158 | break; |
156 | 159 | case "geodir_dummy_insert" : |
157 | - if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir_dummy_posts_insert_noncename')) |
|
158 | - return; |
|
160 | + if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir_dummy_posts_insert_noncename')) { |
|
161 | + return; |
|
162 | + } |
|
159 | 163 | |
160 | 164 | global $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2; |
161 | 165 | $city_bound_lat1 = $_REQUEST['city_bound_lat1']; |
@@ -254,8 +258,9 @@ discard block |
||
254 | 258 | } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { |
255 | 259 | $redirect_to = get_permalink(geodir_add_listing_page_id()); |
256 | 260 | $redirect_to = geodir_getlink($redirect_to, array('pid' => $post->pid), false); |
257 | - } else |
|
258 | - $redirect_to = get_permalink(geodir_add_listing_page_id()); |
|
261 | + } else { |
|
262 | + $redirect_to = get_permalink(geodir_add_listing_page_id()); |
|
263 | + } |
|
259 | 264 | |
260 | 265 | wp_redirect($redirect_to); |
261 | 266 | } else { |
@@ -268,9 +273,9 @@ discard block |
||
268 | 273 | |
269 | 274 | $gd_session->un_set('listing'); |
270 | 275 | |
271 | - if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '' && get_permalink($_REQUEST['pid'])) |
|
272 | - wp_redirect(get_permalink($_REQUEST['pid'])); |
|
273 | - else { |
|
276 | + if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '' && get_permalink($_REQUEST['pid'])) { |
|
277 | + wp_redirect(get_permalink($_REQUEST['pid'])); |
|
278 | + } else { |
|
274 | 279 | geodir_remove_temp_images(); |
275 | 280 | wp_redirect(geodir_getlink(get_permalink(geodir_add_listing_page_id()), array('listing_type' => $_REQUEST['listing_type']))); |
276 | 281 | } |
@@ -298,8 +303,9 @@ discard block |
||
298 | 303 | } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { |
299 | 304 | $redirect_to = get_permalink(geodir_add_listing_page_id()); |
300 | 305 | $redirect_to = geodir_getlink($redirect_to, array('pid' => $post->pid), false); |
301 | - } else |
|
302 | - $redirect_to = get_permalink(geodir_add_listing_page_id()); |
|
306 | + } else { |
|
307 | + $redirect_to = get_permalink(geodir_add_listing_page_id()); |
|
308 | + } |
|
303 | 309 | |
304 | 310 | $gd_session->un_set('listing'); |
305 | 311 | wp_redirect($redirect_to); |
@@ -320,8 +326,9 @@ discard block |
||
320 | 326 | $lastid = wp_delete_post($_REQUEST['pid']); |
321 | 327 | } |
322 | 328 | |
323 | - if ($lastid && !is_wp_error($lastid)) |
|
324 | - wp_redirect($_SERVER['HTTP_REFERER']); |
|
329 | + if ($lastid && !is_wp_error($lastid)) { |
|
330 | + wp_redirect($_SERVER['HTTP_REFERER']); |
|
331 | + } |
|
325 | 332 | |
326 | 333 | //wp_redirect( geodir_getlink(get_author_posts_url($current_user->ID),array('geodir_dashbord'=>'true','stype'=>$post_type ),false) ); |
327 | 334 | } |