@@ -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,256 +7,256 @@ 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 | - // price |
|
| 14 | - $fields[] = array('listing_type' => $post_type, |
|
| 15 | - 'field_type' => 'text', |
|
| 16 | - 'data_type' => 'FLOAT', |
|
| 17 | - 'decimal_point' => '2', |
|
| 18 | - 'admin_title' => __('Price', 'geodirectory'), |
|
| 19 | - 'site_title' => __('Price', 'geodirectory'), |
|
| 20 | - 'admin_desc' => __('Enter the price in $ (no currency symbol)', 'geodirectory'), |
|
| 21 | - 'htmlvar_name' => 'price', |
|
| 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 | - // property status |
|
| 45 | - $fields[] = array('listing_type' => $post_type, |
|
| 46 | - 'data_type' => 'VARCHAR', |
|
| 47 | - 'field_type' => 'select', |
|
| 48 | - 'field_type_key' => 'property_status', |
|
| 49 | - 'is_active' => 1, |
|
| 50 | - 'for_admin_use' => 0, |
|
| 51 | - 'is_default' => 0, |
|
| 52 | - 'admin_title' => __('Property Status', 'geodirectory'), |
|
| 53 | - 'admin_desc' => __('Enter the status of the property.', 'geodirectory'), |
|
| 54 | - 'site_title' => __('Property Status', 'geodirectory'), |
|
| 55 | - 'htmlvar_name' => 'property_status', |
|
| 56 | - 'default_value' => '', |
|
| 57 | - 'is_required' => '1', |
|
| 58 | - 'required_msg' => '', |
|
| 59 | - 'show_in' => '[detail],[listing]', |
|
| 60 | - 'show_on_pkg' => $package, |
|
| 61 | - 'option_values' => 'Select Status/,For Sale,Sold,Under Offer', |
|
| 62 | - 'field_icon' => 'fa fa-home', |
|
| 63 | - 'css_class' => '', |
|
| 64 | - 'cat_sort' => 1, |
|
| 65 | - 'cat_filter' => 1, |
|
| 66 | - ); |
|
| 67 | - |
|
| 68 | - // property furnishing |
|
| 69 | - $fields[] = array('listing_type' => $post_type, |
|
| 70 | - 'field_type' => 'select', |
|
| 71 | - 'data_type' => 'VARCHAR', |
|
| 72 | - 'admin_title' => __('Furnishing', 'geodirectory'), |
|
| 73 | - 'site_title' => __('Furnishing', 'geodirectory'), |
|
| 74 | - 'admin_desc' => __('Enter the furnishing status of the property.', 'geodirectory'), |
|
| 75 | - 'htmlvar_name' => 'property_furnishing', |
|
| 76 | - 'is_active' => true, |
|
| 77 | - 'for_admin_use' => false, |
|
| 78 | - 'default_value' => '', |
|
| 79 | - 'show_in' => '[detail],[listing]', |
|
| 80 | - 'is_required' => true, |
|
| 81 | - 'option_values' => __('Select Status/,Unfurnished,Furnished,Partially furnished,Optional','geodirectory'), |
|
| 82 | - 'validation_pattern' => '', |
|
| 83 | - 'validation_msg' => '', |
|
| 84 | - 'required_msg' => '', |
|
| 85 | - 'field_icon' => 'fa fa-th-large', |
|
| 86 | - 'css_class' => '', |
|
| 87 | - 'cat_sort' => true, |
|
| 88 | - 'cat_filter' => true |
|
| 89 | - ); |
|
| 90 | - |
|
| 91 | - // property type |
|
| 92 | - $fields[] = array('listing_type' => $post_type, |
|
| 93 | - 'field_type' => 'select', |
|
| 94 | - 'data_type' => 'VARCHAR', |
|
| 95 | - 'admin_title' => __('Property Type', 'geodirectory'), |
|
| 96 | - 'site_title' => __('Property Type', 'geodirectory'), |
|
| 97 | - 'admin_desc' => __('Select the property type.', 'geodirectory'), |
|
| 98 | - 'htmlvar_name' => 'property_type', |
|
| 99 | - 'is_active' => true, |
|
| 100 | - 'for_admin_use' => false, |
|
| 101 | - 'default_value' => '', |
|
| 102 | - 'show_in' => '[detail],[listing]', |
|
| 103 | - 'is_required' => true, |
|
| 104 | - 'option_values' => __('Select Type/,Detached house,Semi-detached house,Apartment,Bungalow,Semi-detached bungalow,Chalet,Town House,End-terrace house,Terrace house,Cottage,Hotel,Land','geodirectory'), |
|
| 105 | - 'validation_pattern' => '', |
|
| 106 | - 'validation_msg' => '', |
|
| 107 | - 'required_msg' => '', |
|
| 108 | - 'field_icon' => 'fa fa-home', |
|
| 109 | - 'css_class' => '', |
|
| 110 | - 'cat_sort' => true, |
|
| 111 | - 'cat_filter' => true |
|
| 112 | - ); |
|
| 113 | - |
|
| 114 | - // property bedrooms |
|
| 115 | - $fields[] = array('listing_type' => $post_type, |
|
| 116 | - 'field_type' => 'select', |
|
| 117 | - 'data_type' => 'VARCHAR', |
|
| 118 | - 'admin_title' => __('Property Bedrooms', 'geodirectory'), |
|
| 119 | - 'site_title' => __('Bedrooms', 'geodirectory'), |
|
| 120 | - 'admin_desc' => __('Select the number of bedrooms', 'geodirectory'), |
|
| 121 | - 'htmlvar_name' => 'property_bedrooms', |
|
| 122 | - 'is_active' => true, |
|
| 123 | - 'for_admin_use' => false, |
|
| 124 | - 'default_value' => '', |
|
| 125 | - 'show_in' => '[detail],[listing]', |
|
| 126 | - 'is_required' => true, |
|
| 127 | - 'option_values' => __('Select Bedrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'), |
|
| 128 | - 'validation_pattern' => '', |
|
| 129 | - 'validation_msg' => '', |
|
| 130 | - 'required_msg' => '', |
|
| 131 | - 'field_icon' => 'fa fa-bed', |
|
| 132 | - 'css_class' => '', |
|
| 133 | - 'cat_sort' => true, |
|
| 134 | - 'cat_filter' => true |
|
| 135 | - ); |
|
| 136 | - |
|
| 137 | - // property bathrooms |
|
| 138 | - $fields[] = array('listing_type' => $post_type, |
|
| 139 | - 'field_type' => 'select', |
|
| 140 | - 'data_type' => 'VARCHAR', |
|
| 141 | - 'admin_title' => __('Property Bathrooms', 'geodirectory'), |
|
| 142 | - 'site_title' => __('Bathrooms', 'geodirectory'), |
|
| 143 | - 'admin_desc' => __('Select the number of bathrooms', 'geodirectory'), |
|
| 144 | - 'htmlvar_name' => 'property_bathrooms', |
|
| 145 | - 'is_active' => true, |
|
| 146 | - 'for_admin_use' => false, |
|
| 147 | - 'default_value' => '', |
|
| 148 | - 'show_in' => '[detail],[listing]', |
|
| 149 | - 'is_required' => true, |
|
| 150 | - 'option_values' => __('Select Bathrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'), |
|
| 151 | - 'validation_pattern' => '', |
|
| 152 | - 'validation_msg' => '', |
|
| 153 | - 'required_msg' => '', |
|
| 154 | - 'field_icon' => 'fa fa-bold', |
|
| 155 | - 'css_class' => '', |
|
| 156 | - 'cat_sort' => true, |
|
| 157 | - 'cat_filter' => true |
|
| 158 | - ); |
|
| 159 | - |
|
| 160 | - // property area |
|
| 161 | - $fields[] = array('listing_type' => $post_type, |
|
| 162 | - 'field_type' => 'text', |
|
| 163 | - 'data_type' => 'FLOAT', |
|
| 164 | - 'admin_title' => __('Property Area', 'geodirectory'), |
|
| 165 | - 'site_title' => __('Area (Sq Ft)', 'geodirectory'), |
|
| 166 | - 'admin_desc' => __('Enter the Sq Ft value for the property', 'geodirectory'), |
|
| 167 | - 'htmlvar_name' => 'property_area', |
|
| 168 | - 'is_active' => true, |
|
| 169 | - 'for_admin_use' => false, |
|
| 170 | - 'default_value' => '', |
|
| 171 | - 'show_in' => '[detail],[listing]', |
|
| 172 | - 'is_required' => false, |
|
| 173 | - 'validation_pattern' => '\d+(\.\d{2})?', |
|
| 174 | - 'validation_msg' => 'Please enter the property area in numbers only: 1500', |
|
| 175 | - 'required_msg' => '', |
|
| 176 | - 'field_icon' => 'fa fa-area-chart', |
|
| 177 | - 'css_class' => '', |
|
| 178 | - 'cat_sort' => true, |
|
| 179 | - 'cat_filter' => true |
|
| 180 | - ); |
|
| 181 | - |
|
| 182 | - // property features |
|
| 183 | - $fields[] = array('listing_type' => $post_type, |
|
| 184 | - 'field_type' => 'multiselect', |
|
| 185 | - 'data_type' => 'VARCHAR', |
|
| 186 | - 'admin_title' => __('Property Features', 'geodirectory'), |
|
| 187 | - 'site_title' => __('Features', 'geodirectory'), |
|
| 188 | - 'admin_desc' => __('Select the property features.', 'geodirectory'), |
|
| 189 | - 'htmlvar_name' => 'property_features', |
|
| 190 | - 'is_active' => true, |
|
| 191 | - 'for_admin_use' => false, |
|
| 192 | - 'default_value' => '', |
|
| 193 | - 'show_in' => '[detail],[listing]', |
|
| 194 | - 'is_required' => true, |
|
| 195 | - 'option_values' => __('Select Features/,Gas Central Heating,Oil Central Heating,Double Glazing,Triple Glazing,Front Garden,Garage,Private driveway,Off Road Parking,Fireplace','geodirectory'), |
|
| 196 | - 'validation_pattern' => '', |
|
| 197 | - 'validation_msg' => '', |
|
| 198 | - 'required_msg' => '', |
|
| 199 | - 'field_icon' => 'fa fa-plus-square', |
|
| 200 | - 'css_class' => 'gd-comma-list', |
|
| 201 | - 'cat_sort' => true, |
|
| 202 | - 'cat_filter' => true |
|
| 203 | - ); |
|
| 204 | - |
|
| 205 | - |
|
| 206 | - |
|
| 207 | - /** |
|
| 208 | - * Filter the array of default custom fields DB table data. |
|
| 209 | - * |
|
| 210 | - * @since 1.6.6 |
|
| 211 | - * @param string $fields The default custom fields as an array. |
|
| 212 | - */ |
|
| 213 | - $fields = apply_filters('geodir_property_sale_custom_fields', $fields); |
|
| 214 | - |
|
| 215 | - return $fields; |
|
| 10 | + $fields = array(); |
|
| 11 | + $package = ($package_id=='') ? '' : array($package_id); |
|
| 12 | + |
|
| 13 | + // price |
|
| 14 | + $fields[] = array('listing_type' => $post_type, |
|
| 15 | + 'field_type' => 'text', |
|
| 16 | + 'data_type' => 'FLOAT', |
|
| 17 | + 'decimal_point' => '2', |
|
| 18 | + 'admin_title' => __('Price', 'geodirectory'), |
|
| 19 | + 'site_title' => __('Price', 'geodirectory'), |
|
| 20 | + 'admin_desc' => __('Enter the price in $ (no currency symbol)', 'geodirectory'), |
|
| 21 | + 'htmlvar_name' => 'price', |
|
| 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 | + // property status |
|
| 45 | + $fields[] = array('listing_type' => $post_type, |
|
| 46 | + 'data_type' => 'VARCHAR', |
|
| 47 | + 'field_type' => 'select', |
|
| 48 | + 'field_type_key' => 'property_status', |
|
| 49 | + 'is_active' => 1, |
|
| 50 | + 'for_admin_use' => 0, |
|
| 51 | + 'is_default' => 0, |
|
| 52 | + 'admin_title' => __('Property Status', 'geodirectory'), |
|
| 53 | + 'admin_desc' => __('Enter the status of the property.', 'geodirectory'), |
|
| 54 | + 'site_title' => __('Property Status', 'geodirectory'), |
|
| 55 | + 'htmlvar_name' => 'property_status', |
|
| 56 | + 'default_value' => '', |
|
| 57 | + 'is_required' => '1', |
|
| 58 | + 'required_msg' => '', |
|
| 59 | + 'show_in' => '[detail],[listing]', |
|
| 60 | + 'show_on_pkg' => $package, |
|
| 61 | + 'option_values' => 'Select Status/,For Sale,Sold,Under Offer', |
|
| 62 | + 'field_icon' => 'fa fa-home', |
|
| 63 | + 'css_class' => '', |
|
| 64 | + 'cat_sort' => 1, |
|
| 65 | + 'cat_filter' => 1, |
|
| 66 | + ); |
|
| 67 | + |
|
| 68 | + // property furnishing |
|
| 69 | + $fields[] = array('listing_type' => $post_type, |
|
| 70 | + 'field_type' => 'select', |
|
| 71 | + 'data_type' => 'VARCHAR', |
|
| 72 | + 'admin_title' => __('Furnishing', 'geodirectory'), |
|
| 73 | + 'site_title' => __('Furnishing', 'geodirectory'), |
|
| 74 | + 'admin_desc' => __('Enter the furnishing status of the property.', 'geodirectory'), |
|
| 75 | + 'htmlvar_name' => 'property_furnishing', |
|
| 76 | + 'is_active' => true, |
|
| 77 | + 'for_admin_use' => false, |
|
| 78 | + 'default_value' => '', |
|
| 79 | + 'show_in' => '[detail],[listing]', |
|
| 80 | + 'is_required' => true, |
|
| 81 | + 'option_values' => __('Select Status/,Unfurnished,Furnished,Partially furnished,Optional','geodirectory'), |
|
| 82 | + 'validation_pattern' => '', |
|
| 83 | + 'validation_msg' => '', |
|
| 84 | + 'required_msg' => '', |
|
| 85 | + 'field_icon' => 'fa fa-th-large', |
|
| 86 | + 'css_class' => '', |
|
| 87 | + 'cat_sort' => true, |
|
| 88 | + 'cat_filter' => true |
|
| 89 | + ); |
|
| 90 | + |
|
| 91 | + // property type |
|
| 92 | + $fields[] = array('listing_type' => $post_type, |
|
| 93 | + 'field_type' => 'select', |
|
| 94 | + 'data_type' => 'VARCHAR', |
|
| 95 | + 'admin_title' => __('Property Type', 'geodirectory'), |
|
| 96 | + 'site_title' => __('Property Type', 'geodirectory'), |
|
| 97 | + 'admin_desc' => __('Select the property type.', 'geodirectory'), |
|
| 98 | + 'htmlvar_name' => 'property_type', |
|
| 99 | + 'is_active' => true, |
|
| 100 | + 'for_admin_use' => false, |
|
| 101 | + 'default_value' => '', |
|
| 102 | + 'show_in' => '[detail],[listing]', |
|
| 103 | + 'is_required' => true, |
|
| 104 | + 'option_values' => __('Select Type/,Detached house,Semi-detached house,Apartment,Bungalow,Semi-detached bungalow,Chalet,Town House,End-terrace house,Terrace house,Cottage,Hotel,Land','geodirectory'), |
|
| 105 | + 'validation_pattern' => '', |
|
| 106 | + 'validation_msg' => '', |
|
| 107 | + 'required_msg' => '', |
|
| 108 | + 'field_icon' => 'fa fa-home', |
|
| 109 | + 'css_class' => '', |
|
| 110 | + 'cat_sort' => true, |
|
| 111 | + 'cat_filter' => true |
|
| 112 | + ); |
|
| 113 | + |
|
| 114 | + // property bedrooms |
|
| 115 | + $fields[] = array('listing_type' => $post_type, |
|
| 116 | + 'field_type' => 'select', |
|
| 117 | + 'data_type' => 'VARCHAR', |
|
| 118 | + 'admin_title' => __('Property Bedrooms', 'geodirectory'), |
|
| 119 | + 'site_title' => __('Bedrooms', 'geodirectory'), |
|
| 120 | + 'admin_desc' => __('Select the number of bedrooms', 'geodirectory'), |
|
| 121 | + 'htmlvar_name' => 'property_bedrooms', |
|
| 122 | + 'is_active' => true, |
|
| 123 | + 'for_admin_use' => false, |
|
| 124 | + 'default_value' => '', |
|
| 125 | + 'show_in' => '[detail],[listing]', |
|
| 126 | + 'is_required' => true, |
|
| 127 | + 'option_values' => __('Select Bedrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'), |
|
| 128 | + 'validation_pattern' => '', |
|
| 129 | + 'validation_msg' => '', |
|
| 130 | + 'required_msg' => '', |
|
| 131 | + 'field_icon' => 'fa fa-bed', |
|
| 132 | + 'css_class' => '', |
|
| 133 | + 'cat_sort' => true, |
|
| 134 | + 'cat_filter' => true |
|
| 135 | + ); |
|
| 136 | + |
|
| 137 | + // property bathrooms |
|
| 138 | + $fields[] = array('listing_type' => $post_type, |
|
| 139 | + 'field_type' => 'select', |
|
| 140 | + 'data_type' => 'VARCHAR', |
|
| 141 | + 'admin_title' => __('Property Bathrooms', 'geodirectory'), |
|
| 142 | + 'site_title' => __('Bathrooms', 'geodirectory'), |
|
| 143 | + 'admin_desc' => __('Select the number of bathrooms', 'geodirectory'), |
|
| 144 | + 'htmlvar_name' => 'property_bathrooms', |
|
| 145 | + 'is_active' => true, |
|
| 146 | + 'for_admin_use' => false, |
|
| 147 | + 'default_value' => '', |
|
| 148 | + 'show_in' => '[detail],[listing]', |
|
| 149 | + 'is_required' => true, |
|
| 150 | + 'option_values' => __('Select Bathrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'), |
|
| 151 | + 'validation_pattern' => '', |
|
| 152 | + 'validation_msg' => '', |
|
| 153 | + 'required_msg' => '', |
|
| 154 | + 'field_icon' => 'fa fa-bold', |
|
| 155 | + 'css_class' => '', |
|
| 156 | + 'cat_sort' => true, |
|
| 157 | + 'cat_filter' => true |
|
| 158 | + ); |
|
| 159 | + |
|
| 160 | + // property area |
|
| 161 | + $fields[] = array('listing_type' => $post_type, |
|
| 162 | + 'field_type' => 'text', |
|
| 163 | + 'data_type' => 'FLOAT', |
|
| 164 | + 'admin_title' => __('Property Area', 'geodirectory'), |
|
| 165 | + 'site_title' => __('Area (Sq Ft)', 'geodirectory'), |
|
| 166 | + 'admin_desc' => __('Enter the Sq Ft value for the property', 'geodirectory'), |
|
| 167 | + 'htmlvar_name' => 'property_area', |
|
| 168 | + 'is_active' => true, |
|
| 169 | + 'for_admin_use' => false, |
|
| 170 | + 'default_value' => '', |
|
| 171 | + 'show_in' => '[detail],[listing]', |
|
| 172 | + 'is_required' => false, |
|
| 173 | + 'validation_pattern' => '\d+(\.\d{2})?', |
|
| 174 | + 'validation_msg' => 'Please enter the property area in numbers only: 1500', |
|
| 175 | + 'required_msg' => '', |
|
| 176 | + 'field_icon' => 'fa fa-area-chart', |
|
| 177 | + 'css_class' => '', |
|
| 178 | + 'cat_sort' => true, |
|
| 179 | + 'cat_filter' => true |
|
| 180 | + ); |
|
| 181 | + |
|
| 182 | + // property features |
|
| 183 | + $fields[] = array('listing_type' => $post_type, |
|
| 184 | + 'field_type' => 'multiselect', |
|
| 185 | + 'data_type' => 'VARCHAR', |
|
| 186 | + 'admin_title' => __('Property Features', 'geodirectory'), |
|
| 187 | + 'site_title' => __('Features', 'geodirectory'), |
|
| 188 | + 'admin_desc' => __('Select the property features.', 'geodirectory'), |
|
| 189 | + 'htmlvar_name' => 'property_features', |
|
| 190 | + 'is_active' => true, |
|
| 191 | + 'for_admin_use' => false, |
|
| 192 | + 'default_value' => '', |
|
| 193 | + 'show_in' => '[detail],[listing]', |
|
| 194 | + 'is_required' => true, |
|
| 195 | + 'option_values' => __('Select Features/,Gas Central Heating,Oil Central Heating,Double Glazing,Triple Glazing,Front Garden,Garage,Private driveway,Off Road Parking,Fireplace','geodirectory'), |
|
| 196 | + 'validation_pattern' => '', |
|
| 197 | + 'validation_msg' => '', |
|
| 198 | + 'required_msg' => '', |
|
| 199 | + 'field_icon' => 'fa fa-plus-square', |
|
| 200 | + 'css_class' => 'gd-comma-list', |
|
| 201 | + 'cat_sort' => true, |
|
| 202 | + 'cat_filter' => true |
|
| 203 | + ); |
|
| 204 | + |
|
| 205 | + |
|
| 206 | + |
|
| 207 | + /** |
|
| 208 | + * Filter the array of default custom fields DB table data. |
|
| 209 | + * |
|
| 210 | + * @since 1.6.6 |
|
| 211 | + * @param string $fields The default custom fields as an array. |
|
| 212 | + */ |
|
| 213 | + $fields = apply_filters('geodir_property_sale_custom_fields', $fields); |
|
| 214 | + |
|
| 215 | + return $fields; |
|
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | function geodir_property_sale_custom_fields_advanced_search($post_type='gd_place') { |
| 219 | 219 | |
| 220 | 220 | |
| 221 | - $fields = array(); |
|
| 222 | - |
|
| 223 | - // price range |
|
| 224 | - $fields[] = array( |
|
| 225 | - 'create_field' => true, |
|
| 226 | - 'listing_type' => $post_type, |
|
| 227 | - 'field_type' => 'text', |
|
| 228 | - 'data_type' => 'RANGE', |
|
| 229 | - 'is_active' => 1, |
|
| 230 | - 'site_field_title' => 'Price', |
|
| 231 | - 'field_data_type' => 'FLOAT', |
|
| 232 | - 'main_search' => 1, |
|
| 233 | - 'main_search_priority' => 15, |
|
| 234 | - 'data_type_change' => 'SELECT', |
|
| 235 | - 'search_condition_select' => 'SINGLE', |
|
| 236 | - 'search_min_value' => '50000', |
|
| 237 | - 'search_max_value' => '1000000', |
|
| 238 | - 'search_diff_value' => '100000', |
|
| 239 | - 'first_search_value' => '0', |
|
| 240 | - 'first_search_text' => '', |
|
| 241 | - 'last_search_text' => '', |
|
| 242 | - 'search_condition' => 'SELECT', |
|
| 243 | - 'site_htmlvar_name' => 'geodir_price', |
|
| 244 | - 'htmlvar_name' => 'geodir_price', |
|
| 245 | - 'field_title' => 'geodir_price', |
|
| 246 | - 'expand_custom_value' => '', |
|
| 247 | - 'front_search_title' => 'Price Range', |
|
| 248 | - 'field_desc' => '' |
|
| 249 | - ); |
|
| 250 | - |
|
| 251 | - /** |
|
| 252 | - * Filter the array of advanced search fields DB table data. |
|
| 253 | - * |
|
| 254 | - * @since 1.6.6 |
|
| 255 | - * @param string $fields The default custom fields as an array. |
|
| 256 | - */ |
|
| 257 | - $fields = apply_filters('geodir_property_sale_custom_fields_advanced_search', $fields); |
|
| 258 | - |
|
| 259 | - return $fields; |
|
| 221 | + $fields = array(); |
|
| 222 | + |
|
| 223 | + // price range |
|
| 224 | + $fields[] = array( |
|
| 225 | + 'create_field' => true, |
|
| 226 | + 'listing_type' => $post_type, |
|
| 227 | + 'field_type' => 'text', |
|
| 228 | + 'data_type' => 'RANGE', |
|
| 229 | + 'is_active' => 1, |
|
| 230 | + 'site_field_title' => 'Price', |
|
| 231 | + 'field_data_type' => 'FLOAT', |
|
| 232 | + 'main_search' => 1, |
|
| 233 | + 'main_search_priority' => 15, |
|
| 234 | + 'data_type_change' => 'SELECT', |
|
| 235 | + 'search_condition_select' => 'SINGLE', |
|
| 236 | + 'search_min_value' => '50000', |
|
| 237 | + 'search_max_value' => '1000000', |
|
| 238 | + 'search_diff_value' => '100000', |
|
| 239 | + 'first_search_value' => '0', |
|
| 240 | + 'first_search_text' => '', |
|
| 241 | + 'last_search_text' => '', |
|
| 242 | + 'search_condition' => 'SELECT', |
|
| 243 | + 'site_htmlvar_name' => 'geodir_price', |
|
| 244 | + 'htmlvar_name' => 'geodir_price', |
|
| 245 | + 'field_title' => 'geodir_price', |
|
| 246 | + 'expand_custom_value' => '', |
|
| 247 | + 'front_search_title' => 'Price Range', |
|
| 248 | + 'field_desc' => '' |
|
| 249 | + ); |
|
| 250 | + |
|
| 251 | + /** |
|
| 252 | + * Filter the array of advanced search fields DB table data. |
|
| 253 | + * |
|
| 254 | + * @since 1.6.6 |
|
| 255 | + * @param string $fields The default custom fields as an array. |
|
| 256 | + */ |
|
| 257 | + $fields = apply_filters('geodir_property_sale_custom_fields_advanced_search', $fields); |
|
| 258 | + |
|
| 259 | + return $fields; |
|
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | global $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2,$wpdb, $current_user,$dummy_post_index; |
@@ -266,46 +266,46 @@ discard block |
||
| 266 | 266 | $category_array = array('Apartments', 'Houses', 'Commercial', 'Land'); |
| 267 | 267 | |
| 268 | 268 | if($dummy_post_index==1){ |
| 269 | - // add the dummy categories |
|
| 270 | - geodir_dummy_data_taxonomies($post_type,$category_array ); |
|
| 271 | - |
|
| 272 | - // add the dummy custom fields |
|
| 273 | - $fields = geodir_property_sale_custom_fields($post_type); |
|
| 274 | - geodir_create_dummy_fields($fields); |
|
| 275 | - |
|
| 276 | - // update the type currently installed |
|
| 277 | - update_option($post_type.'_dummy_data_type','property_sale'); |
|
| 278 | - |
|
| 279 | - // add the advanced search fields |
|
| 280 | - if (defined('GEODIRADVANCESEARCH_VERSION')){ |
|
| 281 | - $search_fields = geodir_property_sale_custom_fields_advanced_search($post_type); |
|
| 282 | - foreach($search_fields as $sfield){ |
|
| 283 | - geodir_custom_advance_search_field_save( $sfield ); |
|
| 284 | - } |
|
| 285 | - } |
|
| 269 | + // add the dummy categories |
|
| 270 | + geodir_dummy_data_taxonomies($post_type,$category_array ); |
|
| 271 | + |
|
| 272 | + // add the dummy custom fields |
|
| 273 | + $fields = geodir_property_sale_custom_fields($post_type); |
|
| 274 | + geodir_create_dummy_fields($fields); |
|
| 275 | + |
|
| 276 | + // update the type currently installed |
|
| 277 | + update_option($post_type.'_dummy_data_type','property_sale'); |
|
| 278 | + |
|
| 279 | + // add the advanced search fields |
|
| 280 | + if (defined('GEODIRADVANCESEARCH_VERSION')){ |
|
| 281 | + $search_fields = geodir_property_sale_custom_fields_advanced_search($post_type); |
|
| 282 | + foreach($search_fields as $sfield){ |
|
| 283 | + geodir_custom_advance_search_field_save( $sfield ); |
|
| 284 | + } |
|
| 285 | + } |
|
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 | if (geodir_dummy_folder_exists()) |
| 289 | - $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy"; |
|
| 289 | + $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy"; |
|
| 290 | 290 | else |
| 291 | - $dummy_image_url = 'http://www.wpgeodirectory.com/dummy'; |
|
| 291 | + $dummy_image_url = 'http://www.wpgeodirectory.com/dummy'; |
|
| 292 | 292 | |
| 293 | 293 | $dummy_image_url = apply_filters('place_dummy_image_url', $dummy_image_url); |
| 294 | 294 | |
| 295 | 295 | switch ($dummy_post_index) { |
| 296 | 296 | |
| 297 | - case(1): |
|
| 298 | - $image_array[] = "$dummy_image_url/ps/psf1.jpg"; |
|
| 299 | - $image_array[] = "$dummy_image_url/ps/psl1.jpg"; |
|
| 300 | - $image_array[] = "$dummy_image_url/ps/psb1.jpg"; |
|
| 301 | - $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 302 | - $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 297 | + case(1): |
|
| 298 | + $image_array[] = "$dummy_image_url/ps/psf1.jpg"; |
|
| 299 | + $image_array[] = "$dummy_image_url/ps/psl1.jpg"; |
|
| 300 | + $image_array[] = "$dummy_image_url/ps/psb1.jpg"; |
|
| 301 | + $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 302 | + $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 303 | 303 | |
| 304 | 304 | |
| 305 | - $post_info[] = array( |
|
| 306 | - "listing_type" => $post_type, |
|
| 307 | - "post_title" => 'Eastern Lodge', |
|
| 308 | - "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. |
|
| 305 | + $post_info[] = array( |
|
| 306 | + "listing_type" => $post_type, |
|
| 307 | + "post_title" => 'Eastern Lodge', |
|
| 308 | + "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. |
|
| 309 | 309 | |
| 310 | 310 | 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. |
| 311 | 311 | |
@@ -314,42 +314,42 @@ discard block |
||
| 314 | 314 | 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. |
| 315 | 315 | |
| 316 | 316 | 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.', |
| 317 | - "post_images" => $image_array, |
|
| 318 | - "post_category" => array($post_type.'category' => array($category_array[1])), |
|
| 319 | - "post_tags" => array('Tags', 'Sample Tags'), |
|
| 320 | - "geodir_video" => '', |
|
| 321 | - "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 322 | - "geodir_contact" => '(111) 677-4444', |
|
| 323 | - "geodir_email" => '[email protected]', |
|
| 324 | - "geodir_website" => 'http://example.com/', |
|
| 325 | - "geodir_twitter" => 'http://example.com/', |
|
| 326 | - "geodir_facebook" => 'http://example.com/', |
|
| 327 | - "geodir_price" => '350000', |
|
| 328 | - "geodir_property_status" => 'For Sale', |
|
| 329 | - 'geodir_property_furnishing' => 'Furnished', |
|
| 330 | - 'geodir_property_type' => 'Detached house', |
|
| 331 | - 'geodir_property_bedrooms' => '3', |
|
| 332 | - 'geodir_property_bathrooms' => '2', |
|
| 333 | - 'geodir_property_area' => '1850', |
|
| 334 | - 'geodir_property_features' => 'Gas Central Heating,Triple Glazing,Front Garden,Private driveway,Fireplace', |
|
| 335 | - "post_dummy" => '1' |
|
| 336 | - ); |
|
| 337 | - |
|
| 338 | - |
|
| 339 | - break; |
|
| 340 | - case 2: |
|
| 341 | - $image_array = array(); |
|
| 342 | - $post_meta = array(); |
|
| 343 | - $image_array[] = "$dummy_image_url/ps/psf2.jpg"; |
|
| 344 | - $image_array[] = "$dummy_image_url/ps/psl2.jpg"; |
|
| 345 | - $image_array[] = "$dummy_image_url/ps/psb2.jpg"; |
|
| 346 | - $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 347 | - $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 348 | - |
|
| 349 | - $post_info[] = array( |
|
| 350 | - "listing_type" => $post_type, |
|
| 351 | - "post_title" => 'Daisy Street', |
|
| 352 | - "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. |
|
| 317 | + "post_images" => $image_array, |
|
| 318 | + "post_category" => array($post_type.'category' => array($category_array[1])), |
|
| 319 | + "post_tags" => array('Tags', 'Sample Tags'), |
|
| 320 | + "geodir_video" => '', |
|
| 321 | + "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 322 | + "geodir_contact" => '(111) 677-4444', |
|
| 323 | + "geodir_email" => '[email protected]', |
|
| 324 | + "geodir_website" => 'http://example.com/', |
|
| 325 | + "geodir_twitter" => 'http://example.com/', |
|
| 326 | + "geodir_facebook" => 'http://example.com/', |
|
| 327 | + "geodir_price" => '350000', |
|
| 328 | + "geodir_property_status" => 'For Sale', |
|
| 329 | + 'geodir_property_furnishing' => 'Furnished', |
|
| 330 | + 'geodir_property_type' => 'Detached house', |
|
| 331 | + 'geodir_property_bedrooms' => '3', |
|
| 332 | + 'geodir_property_bathrooms' => '2', |
|
| 333 | + 'geodir_property_area' => '1850', |
|
| 334 | + 'geodir_property_features' => 'Gas Central Heating,Triple Glazing,Front Garden,Private driveway,Fireplace', |
|
| 335 | + "post_dummy" => '1' |
|
| 336 | + ); |
|
| 337 | + |
|
| 338 | + |
|
| 339 | + break; |
|
| 340 | + case 2: |
|
| 341 | + $image_array = array(); |
|
| 342 | + $post_meta = array(); |
|
| 343 | + $image_array[] = "$dummy_image_url/ps/psf2.jpg"; |
|
| 344 | + $image_array[] = "$dummy_image_url/ps/psl2.jpg"; |
|
| 345 | + $image_array[] = "$dummy_image_url/ps/psb2.jpg"; |
|
| 346 | + $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 347 | + $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 348 | + |
|
| 349 | + $post_info[] = array( |
|
| 350 | + "listing_type" => $post_type, |
|
| 351 | + "post_title" => 'Daisy Street', |
|
| 352 | + "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. |
|
| 353 | 353 | |
| 354 | 354 | 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. |
| 355 | 355 | |
@@ -359,42 +359,42 @@ discard block |
||
| 359 | 359 | |
| 360 | 360 | 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.', |
| 361 | 361 | |
| 362 | - "post_images" => $image_array, |
|
| 363 | - "post_category" => array($post_type.'category' => array($category_array[1])), |
|
| 364 | - "post_tags" => array('Garage'), |
|
| 365 | - "geodir_video" => '', |
|
| 366 | - "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 367 | - "geodir_contact" => '(222) 777-1111', |
|
| 368 | - "geodir_email" => '[email protected]', |
|
| 369 | - "geodir_website" => 'http://example.com/', |
|
| 370 | - "geodir_twitter" => 'http://example.com/', |
|
| 371 | - "geodir_facebook" => 'http://example.com/', |
|
| 372 | - "geodir_price" => '230000', |
|
| 373 | - "geodir_property_status" => 'Sold', |
|
| 374 | - 'geodir_property_furnishing' => 'Unfurnished', |
|
| 375 | - 'geodir_property_type' => 'Detached house', |
|
| 376 | - 'geodir_property_bedrooms' => '5', |
|
| 377 | - 'geodir_property_bathrooms' => '3', |
|
| 378 | - 'geodir_property_area' => '2650', |
|
| 379 | - 'geodir_property_features' => 'Select Features/,Oil Central Heating,Front Garden,Garage,Private driveway,Fireplace', |
|
| 380 | - "post_dummy" => '1' |
|
| 381 | - ); |
|
| 382 | - |
|
| 383 | - break; |
|
| 384 | - |
|
| 385 | - case 3: |
|
| 386 | - $image_array = array(); |
|
| 387 | - $post_meta = array(); |
|
| 388 | - $image_array[] = "$dummy_image_url/ps/psf3.jpg"; |
|
| 389 | - $image_array[] = "$dummy_image_url/ps/psl3.jpg"; |
|
| 390 | - $image_array[] = "$dummy_image_url/ps/psb3.jpg"; |
|
| 391 | - $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 392 | - $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 393 | - |
|
| 394 | - $post_info[] = array( |
|
| 395 | - "listing_type" => $post_type, |
|
| 396 | - "post_title" => 'Northbay House', |
|
| 397 | - "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. |
|
| 362 | + "post_images" => $image_array, |
|
| 363 | + "post_category" => array($post_type.'category' => array($category_array[1])), |
|
| 364 | + "post_tags" => array('Garage'), |
|
| 365 | + "geodir_video" => '', |
|
| 366 | + "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 367 | + "geodir_contact" => '(222) 777-1111', |
|
| 368 | + "geodir_email" => '[email protected]', |
|
| 369 | + "geodir_website" => 'http://example.com/', |
|
| 370 | + "geodir_twitter" => 'http://example.com/', |
|
| 371 | + "geodir_facebook" => 'http://example.com/', |
|
| 372 | + "geodir_price" => '230000', |
|
| 373 | + "geodir_property_status" => 'Sold', |
|
| 374 | + 'geodir_property_furnishing' => 'Unfurnished', |
|
| 375 | + 'geodir_property_type' => 'Detached house', |
|
| 376 | + 'geodir_property_bedrooms' => '5', |
|
| 377 | + 'geodir_property_bathrooms' => '3', |
|
| 378 | + 'geodir_property_area' => '2650', |
|
| 379 | + 'geodir_property_features' => 'Select Features/,Oil Central Heating,Front Garden,Garage,Private driveway,Fireplace', |
|
| 380 | + "post_dummy" => '1' |
|
| 381 | + ); |
|
| 382 | + |
|
| 383 | + break; |
|
| 384 | + |
|
| 385 | + case 3: |
|
| 386 | + $image_array = array(); |
|
| 387 | + $post_meta = array(); |
|
| 388 | + $image_array[] = "$dummy_image_url/ps/psf3.jpg"; |
|
| 389 | + $image_array[] = "$dummy_image_url/ps/psl3.jpg"; |
|
| 390 | + $image_array[] = "$dummy_image_url/ps/psb3.jpg"; |
|
| 391 | + $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 392 | + $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 393 | + |
|
| 394 | + $post_info[] = array( |
|
| 395 | + "listing_type" => $post_type, |
|
| 396 | + "post_title" => 'Northbay House', |
|
| 397 | + "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. |
|
| 398 | 398 | |
| 399 | 399 | 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. |
| 400 | 400 | |
@@ -404,43 +404,43 @@ discard block |
||
| 404 | 404 | |
| 405 | 405 | 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.', |
| 406 | 406 | |
| 407 | - "post_images" => $image_array, |
|
| 408 | - "post_category" => array($post_type.'category' => array($category_array[1])), |
|
| 409 | - "post_tags" => array('Tags', 'Sample Tags'), |
|
| 410 | - "geodir_video" => '', |
|
| 411 | - "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 412 | - "geodir_contact" => '(222) 777-1111', |
|
| 413 | - "geodir_email" => '[email protected]', |
|
| 414 | - "geodir_website" => 'http://example.com/', |
|
| 415 | - "geodir_twitter" => 'http://example.com/', |
|
| 416 | - "geodir_facebook" => 'http://example.com/', |
|
| 417 | - "geodir_price" => '260000', |
|
| 418 | - "geodir_property_status" => 'Under Offer', |
|
| 419 | - 'geodir_property_furnishing' => 'Unfurnished', |
|
| 420 | - 'geodir_property_type' => 'Detached house', |
|
| 421 | - 'geodir_property_bedrooms' => '6', |
|
| 422 | - 'geodir_property_bathrooms' => '6', |
|
| 423 | - 'geodir_property_area' => '1650', |
|
| 424 | - 'geodir_property_features' => 'Select Features/,Gas Central Heating,Triple Glazing,Off Road Parking,Fireplace', |
|
| 425 | - "post_dummy" => '1' |
|
| 426 | - ); |
|
| 427 | - |
|
| 428 | - break; |
|
| 429 | - |
|
| 430 | - |
|
| 431 | - case 4: |
|
| 432 | - $image_array = array(); |
|
| 433 | - $post_meta = array(); |
|
| 434 | - $image_array[] = "$dummy_image_url/ps/psf4.jpg"; |
|
| 435 | - $image_array[] = "$dummy_image_url/ps/psl4.jpg"; |
|
| 436 | - $image_array[] = "$dummy_image_url/ps/psb4.jpg"; |
|
| 437 | - $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 438 | - $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 439 | - |
|
| 440 | - $post_info[] = array( |
|
| 441 | - "listing_type" => $post_type, |
|
| 442 | - "post_title" => 'Jesmond Mansion', |
|
| 443 | - "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. |
|
| 407 | + "post_images" => $image_array, |
|
| 408 | + "post_category" => array($post_type.'category' => array($category_array[1])), |
|
| 409 | + "post_tags" => array('Tags', 'Sample Tags'), |
|
| 410 | + "geodir_video" => '', |
|
| 411 | + "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 412 | + "geodir_contact" => '(222) 777-1111', |
|
| 413 | + "geodir_email" => '[email protected]', |
|
| 414 | + "geodir_website" => 'http://example.com/', |
|
| 415 | + "geodir_twitter" => 'http://example.com/', |
|
| 416 | + "geodir_facebook" => 'http://example.com/', |
|
| 417 | + "geodir_price" => '260000', |
|
| 418 | + "geodir_property_status" => 'Under Offer', |
|
| 419 | + 'geodir_property_furnishing' => 'Unfurnished', |
|
| 420 | + 'geodir_property_type' => 'Detached house', |
|
| 421 | + 'geodir_property_bedrooms' => '6', |
|
| 422 | + 'geodir_property_bathrooms' => '6', |
|
| 423 | + 'geodir_property_area' => '1650', |
|
| 424 | + 'geodir_property_features' => 'Select Features/,Gas Central Heating,Triple Glazing,Off Road Parking,Fireplace', |
|
| 425 | + "post_dummy" => '1' |
|
| 426 | + ); |
|
| 427 | + |
|
| 428 | + break; |
|
| 429 | + |
|
| 430 | + |
|
| 431 | + case 4: |
|
| 432 | + $image_array = array(); |
|
| 433 | + $post_meta = array(); |
|
| 434 | + $image_array[] = "$dummy_image_url/ps/psf4.jpg"; |
|
| 435 | + $image_array[] = "$dummy_image_url/ps/psl4.jpg"; |
|
| 436 | + $image_array[] = "$dummy_image_url/ps/psb4.jpg"; |
|
| 437 | + $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 438 | + $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 439 | + |
|
| 440 | + $post_info[] = array( |
|
| 441 | + "listing_type" => $post_type, |
|
| 442 | + "post_title" => 'Jesmond Mansion', |
|
| 443 | + "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. |
|
| 444 | 444 | |
| 445 | 445 | 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. |
| 446 | 446 | |
@@ -450,42 +450,42 @@ discard block |
||
| 450 | 450 | |
| 451 | 451 | 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.', |
| 452 | 452 | |
| 453 | - "post_images" => $image_array, |
|
| 454 | - "post_category" => array($post_type.'category' => array($category_array[1])), |
|
| 455 | - "post_tags" => array('Tags', 'Sample Tags'), |
|
| 456 | - "geodir_video" => '', |
|
| 457 | - "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 458 | - "geodir_contact" => '(222) 777-1111', |
|
| 459 | - "geodir_email" => '[email protected]', |
|
| 460 | - "geodir_website" => 'http://example.com/', |
|
| 461 | - "geodir_twitter" => 'http://example.com/', |
|
| 462 | - "geodir_facebook" => 'http://example.com/', |
|
| 463 | - "geodir_price" => '2300000', |
|
| 464 | - "geodir_property_status" => 'Under Offer', |
|
| 465 | - 'geodir_property_furnishing' => 'Partially furnished', |
|
| 466 | - 'geodir_property_type' => 'Detached house', |
|
| 467 | - 'geodir_property_bedrooms' => '10', |
|
| 468 | - 'geodir_property_bathrooms' => '7', |
|
| 469 | - 'geodir_property_area' => '6600', |
|
| 470 | - 'geodir_property_features' => 'Select Features/,Oil Central Heating,Double Glazing,Front Garden,Garage,Private driveway,Fireplace', |
|
| 471 | - "post_dummy" => '1' |
|
| 472 | - ); |
|
| 473 | - |
|
| 474 | - break; |
|
| 475 | - |
|
| 476 | - case 5: |
|
| 477 | - $image_array = array(); |
|
| 478 | - $post_meta = array(); |
|
| 479 | - $image_array[] = "$dummy_image_url/ps/psf5.jpg"; |
|
| 480 | - $image_array[] = "$dummy_image_url/ps/psl5.jpg"; |
|
| 481 | - $image_array[] = "$dummy_image_url/ps/psb5.jpg"; |
|
| 482 | - $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 483 | - $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 484 | - |
|
| 485 | - $post_info[] = array( |
|
| 486 | - "listing_type" => $post_type, |
|
| 487 | - "post_title" => 'Springfield Lodge', |
|
| 488 | - "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. |
|
| 453 | + "post_images" => $image_array, |
|
| 454 | + "post_category" => array($post_type.'category' => array($category_array[1])), |
|
| 455 | + "post_tags" => array('Tags', 'Sample Tags'), |
|
| 456 | + "geodir_video" => '', |
|
| 457 | + "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 458 | + "geodir_contact" => '(222) 777-1111', |
|
| 459 | + "geodir_email" => '[email protected]', |
|
| 460 | + "geodir_website" => 'http://example.com/', |
|
| 461 | + "geodir_twitter" => 'http://example.com/', |
|
| 462 | + "geodir_facebook" => 'http://example.com/', |
|
| 463 | + "geodir_price" => '2300000', |
|
| 464 | + "geodir_property_status" => 'Under Offer', |
|
| 465 | + 'geodir_property_furnishing' => 'Partially furnished', |
|
| 466 | + 'geodir_property_type' => 'Detached house', |
|
| 467 | + 'geodir_property_bedrooms' => '10', |
|
| 468 | + 'geodir_property_bathrooms' => '7', |
|
| 469 | + 'geodir_property_area' => '6600', |
|
| 470 | + 'geodir_property_features' => 'Select Features/,Oil Central Heating,Double Glazing,Front Garden,Garage,Private driveway,Fireplace', |
|
| 471 | + "post_dummy" => '1' |
|
| 472 | + ); |
|
| 473 | + |
|
| 474 | + break; |
|
| 475 | + |
|
| 476 | + case 5: |
|
| 477 | + $image_array = array(); |
|
| 478 | + $post_meta = array(); |
|
| 479 | + $image_array[] = "$dummy_image_url/ps/psf5.jpg"; |
|
| 480 | + $image_array[] = "$dummy_image_url/ps/psl5.jpg"; |
|
| 481 | + $image_array[] = "$dummy_image_url/ps/psb5.jpg"; |
|
| 482 | + $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 483 | + $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 484 | + |
|
| 485 | + $post_info[] = array( |
|
| 486 | + "listing_type" => $post_type, |
|
| 487 | + "post_title" => 'Springfield Lodge', |
|
| 488 | + "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. |
|
| 489 | 489 | |
| 490 | 490 | 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. |
| 491 | 491 | |
@@ -495,42 +495,42 @@ discard block |
||
| 495 | 495 | |
| 496 | 496 | 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.', |
| 497 | 497 | |
| 498 | - "post_images" => $image_array, |
|
| 499 | - "post_category" => array($post_type.'category' => array($category_array[1])), |
|
| 500 | - "post_tags" => array('Tags', 'Sample Tags'), |
|
| 501 | - "geodir_video" => '', |
|
| 502 | - "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 503 | - "geodir_contact" => '(222) 777-1111', |
|
| 504 | - "geodir_email" => '[email protected]', |
|
| 505 | - "geodir_website" => 'http://example.com/', |
|
| 506 | - "geodir_twitter" => 'http://example.com/', |
|
| 507 | - "geodir_facebook" => 'http://example.com/', |
|
| 508 | - "geodir_price" => '330000', |
|
| 509 | - "geodir_property_status" => 'For Sale', |
|
| 510 | - 'geodir_property_furnishing' => 'Optional', |
|
| 511 | - 'geodir_property_type' => 'Detached house', |
|
| 512 | - 'geodir_property_bedrooms' => '4', |
|
| 513 | - 'geodir_property_bathrooms' => '3', |
|
| 514 | - 'geodir_property_area' => '3700', |
|
| 515 | - 'geodir_property_features' => 'Select Features/,Oil Central Heating,Double Glazing,Front Garden', |
|
| 516 | - "post_dummy" => '1' |
|
| 517 | - ); |
|
| 518 | - |
|
| 519 | - break; |
|
| 520 | - |
|
| 521 | - case 6: |
|
| 522 | - $image_array = array(); |
|
| 523 | - $post_meta = array(); |
|
| 524 | - $image_array[] = "$dummy_image_url/ps/psf6.jpg"; |
|
| 525 | - $image_array[] = "$dummy_image_url/ps/psl6.jpg"; |
|
| 526 | - $image_array[] = "$dummy_image_url/ps/psb5.jpg"; |
|
| 527 | - $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 528 | - $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 529 | - |
|
| 530 | - $post_info[] = array( |
|
| 531 | - "listing_type" => $post_type, |
|
| 532 | - "post_title" => 'Forrest Park', |
|
| 533 | - "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. |
|
| 498 | + "post_images" => $image_array, |
|
| 499 | + "post_category" => array($post_type.'category' => array($category_array[1])), |
|
| 500 | + "post_tags" => array('Tags', 'Sample Tags'), |
|
| 501 | + "geodir_video" => '', |
|
| 502 | + "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 503 | + "geodir_contact" => '(222) 777-1111', |
|
| 504 | + "geodir_email" => '[email protected]', |
|
| 505 | + "geodir_website" => 'http://example.com/', |
|
| 506 | + "geodir_twitter" => 'http://example.com/', |
|
| 507 | + "geodir_facebook" => 'http://example.com/', |
|
| 508 | + "geodir_price" => '330000', |
|
| 509 | + "geodir_property_status" => 'For Sale', |
|
| 510 | + 'geodir_property_furnishing' => 'Optional', |
|
| 511 | + 'geodir_property_type' => 'Detached house', |
|
| 512 | + 'geodir_property_bedrooms' => '4', |
|
| 513 | + 'geodir_property_bathrooms' => '3', |
|
| 514 | + 'geodir_property_area' => '3700', |
|
| 515 | + 'geodir_property_features' => 'Select Features/,Oil Central Heating,Double Glazing,Front Garden', |
|
| 516 | + "post_dummy" => '1' |
|
| 517 | + ); |
|
| 518 | + |
|
| 519 | + break; |
|
| 520 | + |
|
| 521 | + case 6: |
|
| 522 | + $image_array = array(); |
|
| 523 | + $post_meta = array(); |
|
| 524 | + $image_array[] = "$dummy_image_url/ps/psf6.jpg"; |
|
| 525 | + $image_array[] = "$dummy_image_url/ps/psl6.jpg"; |
|
| 526 | + $image_array[] = "$dummy_image_url/ps/psb5.jpg"; |
|
| 527 | + $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 528 | + $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 529 | + |
|
| 530 | + $post_info[] = array( |
|
| 531 | + "listing_type" => $post_type, |
|
| 532 | + "post_title" => 'Forrest Park', |
|
| 533 | + "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. |
|
| 534 | 534 | |
| 535 | 535 | 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. |
| 536 | 536 | |
@@ -540,42 +540,42 @@ discard block |
||
| 540 | 540 | |
| 541 | 541 | 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.', |
| 542 | 542 | |
| 543 | - "post_images" => $image_array, |
|
| 544 | - "post_category" => array($post_type.'category' => array($category_array[1])), |
|
| 545 | - "post_tags" => array('Tags', 'Sample Tags'), |
|
| 546 | - "geodir_video" => '', |
|
| 547 | - "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 548 | - "geodir_contact" => '(222) 777-1111', |
|
| 549 | - "geodir_email" => '[email protected]', |
|
| 550 | - "geodir_website" => 'http://example.com/', |
|
| 551 | - "geodir_twitter" => 'http://example.com/', |
|
| 552 | - "geodir_facebook" => 'http://example.com/', |
|
| 553 | - "geodir_price" => '530000', |
|
| 554 | - "geodir_property_status" => 'For Sale', |
|
| 555 | - 'geodir_property_furnishing' => 'Unfurnished', |
|
| 556 | - 'geodir_property_type' => 'Detached house', |
|
| 557 | - 'geodir_property_bedrooms' => '5', |
|
| 558 | - 'geodir_property_bathrooms' => '4', |
|
| 559 | - 'geodir_property_area' => '2250', |
|
| 560 | - 'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Front Garden,Private driveway', |
|
| 561 | - "post_dummy" => '1' |
|
| 562 | - ); |
|
| 563 | - |
|
| 564 | - break; |
|
| 565 | - |
|
| 566 | - case 7: |
|
| 567 | - $image_array = array(); |
|
| 568 | - $post_meta = array(); |
|
| 569 | - $image_array[] = "$dummy_image_url/ps/psf7.jpg"; |
|
| 570 | - $image_array[] = "$dummy_image_url/ps/psl4.jpg"; |
|
| 571 | - $image_array[] = "$dummy_image_url/ps/psb4.jpg"; |
|
| 572 | - $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 573 | - $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 574 | - |
|
| 575 | - $post_info[] = array( |
|
| 576 | - "listing_type" => $post_type, |
|
| 577 | - "post_title" => 'Fraser Suites', |
|
| 578 | - "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. |
|
| 543 | + "post_images" => $image_array, |
|
| 544 | + "post_category" => array($post_type.'category' => array($category_array[1])), |
|
| 545 | + "post_tags" => array('Tags', 'Sample Tags'), |
|
| 546 | + "geodir_video" => '', |
|
| 547 | + "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 548 | + "geodir_contact" => '(222) 777-1111', |
|
| 549 | + "geodir_email" => '[email protected]', |
|
| 550 | + "geodir_website" => 'http://example.com/', |
|
| 551 | + "geodir_twitter" => 'http://example.com/', |
|
| 552 | + "geodir_facebook" => 'http://example.com/', |
|
| 553 | + "geodir_price" => '530000', |
|
| 554 | + "geodir_property_status" => 'For Sale', |
|
| 555 | + 'geodir_property_furnishing' => 'Unfurnished', |
|
| 556 | + 'geodir_property_type' => 'Detached house', |
|
| 557 | + 'geodir_property_bedrooms' => '5', |
|
| 558 | + 'geodir_property_bathrooms' => '4', |
|
| 559 | + 'geodir_property_area' => '2250', |
|
| 560 | + 'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Front Garden,Private driveway', |
|
| 561 | + "post_dummy" => '1' |
|
| 562 | + ); |
|
| 563 | + |
|
| 564 | + break; |
|
| 565 | + |
|
| 566 | + case 7: |
|
| 567 | + $image_array = array(); |
|
| 568 | + $post_meta = array(); |
|
| 569 | + $image_array[] = "$dummy_image_url/ps/psf7.jpg"; |
|
| 570 | + $image_array[] = "$dummy_image_url/ps/psl4.jpg"; |
|
| 571 | + $image_array[] = "$dummy_image_url/ps/psb4.jpg"; |
|
| 572 | + $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 573 | + $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 574 | + |
|
| 575 | + $post_info[] = array( |
|
| 576 | + "listing_type" => $post_type, |
|
| 577 | + "post_title" => 'Fraser Suites', |
|
| 578 | + "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. |
|
| 579 | 579 | |
| 580 | 580 | 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. |
| 581 | 581 | |
@@ -585,42 +585,42 @@ discard block |
||
| 585 | 585 | |
| 586 | 586 | 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.', |
| 587 | 587 | |
| 588 | - "post_images" => $image_array, |
|
| 589 | - "post_category" => array($post_type.'category' => array($category_array[0])), |
|
| 590 | - "post_tags" => array('Tags', 'Sample Tags'), |
|
| 591 | - "geodir_video" => '', |
|
| 592 | - "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 593 | - "geodir_contact" => '(222) 777-1111', |
|
| 594 | - "geodir_email" => '[email protected]', |
|
| 595 | - "geodir_website" => 'http://example.com/', |
|
| 596 | - "geodir_twitter" => 'http://example.com/', |
|
| 597 | - "geodir_facebook" => 'http://example.com/', |
|
| 598 | - "geodir_price" => '245000', |
|
| 599 | - "geodir_property_status" => 'For Sale', |
|
| 600 | - 'geodir_property_furnishing' => 'Unfurnished', |
|
| 601 | - 'geodir_property_type' => 'Apartment', |
|
| 602 | - 'geodir_property_bedrooms' => '3', |
|
| 603 | - 'geodir_property_bathrooms' => '2', |
|
| 604 | - 'geodir_property_area' => '1250', |
|
| 605 | - 'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing', |
|
| 606 | - "post_dummy" => '1' |
|
| 607 | - ); |
|
| 608 | - |
|
| 609 | - break; |
|
| 610 | - |
|
| 611 | - case 8: |
|
| 612 | - $image_array = array(); |
|
| 613 | - $post_meta = array(); |
|
| 614 | - $image_array[] = "$dummy_image_url/ps/psf8.jpg"; |
|
| 615 | - $image_array[] = "$dummy_image_url/ps/psl2.jpg"; |
|
| 616 | - $image_array[] = "$dummy_image_url/ps/psb2.jpg"; |
|
| 617 | - $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 618 | - $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 619 | - |
|
| 620 | - $post_info[] = array( |
|
| 621 | - "listing_type" => $post_type, |
|
| 622 | - "post_title" => 'Richmore Apartments', |
|
| 623 | - "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. |
|
| 588 | + "post_images" => $image_array, |
|
| 589 | + "post_category" => array($post_type.'category' => array($category_array[0])), |
|
| 590 | + "post_tags" => array('Tags', 'Sample Tags'), |
|
| 591 | + "geodir_video" => '', |
|
| 592 | + "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 593 | + "geodir_contact" => '(222) 777-1111', |
|
| 594 | + "geodir_email" => '[email protected]', |
|
| 595 | + "geodir_website" => 'http://example.com/', |
|
| 596 | + "geodir_twitter" => 'http://example.com/', |
|
| 597 | + "geodir_facebook" => 'http://example.com/', |
|
| 598 | + "geodir_price" => '245000', |
|
| 599 | + "geodir_property_status" => 'For Sale', |
|
| 600 | + 'geodir_property_furnishing' => 'Unfurnished', |
|
| 601 | + 'geodir_property_type' => 'Apartment', |
|
| 602 | + 'geodir_property_bedrooms' => '3', |
|
| 603 | + 'geodir_property_bathrooms' => '2', |
|
| 604 | + 'geodir_property_area' => '1250', |
|
| 605 | + 'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing', |
|
| 606 | + "post_dummy" => '1' |
|
| 607 | + ); |
|
| 608 | + |
|
| 609 | + break; |
|
| 610 | + |
|
| 611 | + case 8: |
|
| 612 | + $image_array = array(); |
|
| 613 | + $post_meta = array(); |
|
| 614 | + $image_array[] = "$dummy_image_url/ps/psf8.jpg"; |
|
| 615 | + $image_array[] = "$dummy_image_url/ps/psl2.jpg"; |
|
| 616 | + $image_array[] = "$dummy_image_url/ps/psb2.jpg"; |
|
| 617 | + $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 618 | + $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 619 | + |
|
| 620 | + $post_info[] = array( |
|
| 621 | + "listing_type" => $post_type, |
|
| 622 | + "post_title" => 'Richmore Apartments', |
|
| 623 | + "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. |
|
| 624 | 624 | |
| 625 | 625 | 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. |
| 626 | 626 | |
@@ -630,43 +630,43 @@ discard block |
||
| 630 | 630 | |
| 631 | 631 | 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.', |
| 632 | 632 | |
| 633 | - "post_images" => $image_array, |
|
| 634 | - "post_category" => array($post_type.'category' => array($category_array[0])), |
|
| 635 | - "post_tags" => array('Tags', 'Sample Tags'), |
|
| 636 | - "geodir_video" => '', |
|
| 637 | - "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 638 | - "geodir_contact" => '(222) 777-1111', |
|
| 639 | - "geodir_email" => '[email protected]', |
|
| 640 | - "geodir_website" => 'http://example.com/', |
|
| 641 | - "geodir_twitter" => 'http://example.com/', |
|
| 642 | - "geodir_facebook" => 'http://example.com/', |
|
| 643 | - "geodir_price" => '395000', |
|
| 644 | - "geodir_property_status" => 'For Sale', |
|
| 645 | - 'geodir_property_furnishing' => 'Unfurnished', |
|
| 646 | - 'geodir_property_type' => 'Apartment', |
|
| 647 | - 'geodir_property_bedrooms' => '2', |
|
| 648 | - 'geodir_property_bathrooms' => '2', |
|
| 649 | - 'geodir_property_area' => '1750', |
|
| 650 | - 'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Garage', |
|
| 651 | - "post_dummy" => '1' |
|
| 652 | - ); |
|
| 653 | - |
|
| 654 | - break; |
|
| 655 | - |
|
| 656 | - |
|
| 657 | - case 9: |
|
| 658 | - $image_array = array(); |
|
| 659 | - $post_meta = array(); |
|
| 660 | - $image_array[] = "$dummy_image_url/ps/psf9.jpg"; |
|
| 661 | - $image_array[] = "$dummy_image_url/ps/psc9.jpg"; |
|
| 662 | - $image_array[] = "$dummy_image_url/ps/psb2.jpg"; |
|
| 663 | - $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 664 | - $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 665 | - |
|
| 666 | - $post_info[] = array( |
|
| 667 | - "listing_type" => $post_type, |
|
| 668 | - "post_title" => 'Hotel Alpina', |
|
| 669 | - "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. |
|
| 633 | + "post_images" => $image_array, |
|
| 634 | + "post_category" => array($post_type.'category' => array($category_array[0])), |
|
| 635 | + "post_tags" => array('Tags', 'Sample Tags'), |
|
| 636 | + "geodir_video" => '', |
|
| 637 | + "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 638 | + "geodir_contact" => '(222) 777-1111', |
|
| 639 | + "geodir_email" => '[email protected]', |
|
| 640 | + "geodir_website" => 'http://example.com/', |
|
| 641 | + "geodir_twitter" => 'http://example.com/', |
|
| 642 | + "geodir_facebook" => 'http://example.com/', |
|
| 643 | + "geodir_price" => '395000', |
|
| 644 | + "geodir_property_status" => 'For Sale', |
|
| 645 | + 'geodir_property_furnishing' => 'Unfurnished', |
|
| 646 | + 'geodir_property_type' => 'Apartment', |
|
| 647 | + 'geodir_property_bedrooms' => '2', |
|
| 648 | + 'geodir_property_bathrooms' => '2', |
|
| 649 | + 'geodir_property_area' => '1750', |
|
| 650 | + 'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Garage', |
|
| 651 | + "post_dummy" => '1' |
|
| 652 | + ); |
|
| 653 | + |
|
| 654 | + break; |
|
| 655 | + |
|
| 656 | + |
|
| 657 | + case 9: |
|
| 658 | + $image_array = array(); |
|
| 659 | + $post_meta = array(); |
|
| 660 | + $image_array[] = "$dummy_image_url/ps/psf9.jpg"; |
|
| 661 | + $image_array[] = "$dummy_image_url/ps/psc9.jpg"; |
|
| 662 | + $image_array[] = "$dummy_image_url/ps/psb2.jpg"; |
|
| 663 | + $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 664 | + $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 665 | + |
|
| 666 | + $post_info[] = array( |
|
| 667 | + "listing_type" => $post_type, |
|
| 668 | + "post_title" => 'Hotel Alpina', |
|
| 669 | + "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. |
|
| 670 | 670 | |
| 671 | 671 | 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. |
| 672 | 672 | |
@@ -676,39 +676,39 @@ discard block |
||
| 676 | 676 | |
| 677 | 677 | 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.', |
| 678 | 678 | |
| 679 | - "post_images" => $image_array, |
|
| 680 | - "post_category" => array($post_type.'category' => array($category_array[2])), |
|
| 681 | - "post_tags" => array('Tags', 'Sample Tags'), |
|
| 682 | - "geodir_video" => '', |
|
| 683 | - "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 684 | - "geodir_contact" => '(222) 777-1111', |
|
| 685 | - "geodir_email" => '[email protected]', |
|
| 686 | - "geodir_website" => 'http://example.com/', |
|
| 687 | - "geodir_twitter" => 'http://example.com/', |
|
| 688 | - "geodir_facebook" => 'http://example.com/', |
|
| 689 | - "geodir_price" => '12500000', |
|
| 690 | - "geodir_property_status" => 'For Sale', |
|
| 691 | - 'geodir_property_furnishing' => 'Furnished', |
|
| 692 | - 'geodir_property_type' => 'Hotel', |
|
| 693 | - 'geodir_property_bedrooms' => '120', |
|
| 694 | - 'geodir_property_bathrooms' => '133', |
|
| 695 | - 'geodir_property_area' => '35000', |
|
| 696 | - 'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Garage', |
|
| 697 | - "post_dummy" => '1' |
|
| 698 | - ); |
|
| 699 | - |
|
| 700 | - break; |
|
| 701 | - |
|
| 702 | - case 10: |
|
| 703 | - $image_array = array(); |
|
| 704 | - $post_meta = array(); |
|
| 705 | - $image_array[] = "$dummy_image_url/ps/psf10.jpg"; |
|
| 706 | - $image_array[] = "$dummy_image_url/ps/psf102.jpg"; |
|
| 707 | - |
|
| 708 | - $post_info[] = array( |
|
| 709 | - "listing_type" => $post_type, |
|
| 710 | - "post_title" => 'Development Land', |
|
| 711 | - "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. |
|
| 679 | + "post_images" => $image_array, |
|
| 680 | + "post_category" => array($post_type.'category' => array($category_array[2])), |
|
| 681 | + "post_tags" => array('Tags', 'Sample Tags'), |
|
| 682 | + "geodir_video" => '', |
|
| 683 | + "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 684 | + "geodir_contact" => '(222) 777-1111', |
|
| 685 | + "geodir_email" => '[email protected]', |
|
| 686 | + "geodir_website" => 'http://example.com/', |
|
| 687 | + "geodir_twitter" => 'http://example.com/', |
|
| 688 | + "geodir_facebook" => 'http://example.com/', |
|
| 689 | + "geodir_price" => '12500000', |
|
| 690 | + "geodir_property_status" => 'For Sale', |
|
| 691 | + 'geodir_property_furnishing' => 'Furnished', |
|
| 692 | + 'geodir_property_type' => 'Hotel', |
|
| 693 | + 'geodir_property_bedrooms' => '120', |
|
| 694 | + 'geodir_property_bathrooms' => '133', |
|
| 695 | + 'geodir_property_area' => '35000', |
|
| 696 | + 'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Garage', |
|
| 697 | + "post_dummy" => '1' |
|
| 698 | + ); |
|
| 699 | + |
|
| 700 | + break; |
|
| 701 | + |
|
| 702 | + case 10: |
|
| 703 | + $image_array = array(); |
|
| 704 | + $post_meta = array(); |
|
| 705 | + $image_array[] = "$dummy_image_url/ps/psf10.jpg"; |
|
| 706 | + $image_array[] = "$dummy_image_url/ps/psf102.jpg"; |
|
| 707 | + |
|
| 708 | + $post_info[] = array( |
|
| 709 | + "listing_type" => $post_type, |
|
| 710 | + "post_title" => 'Development Land', |
|
| 711 | + "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. |
|
| 712 | 712 | |
| 713 | 713 | 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. |
| 714 | 714 | |
@@ -718,93 +718,93 @@ discard block |
||
| 718 | 718 | |
| 719 | 719 | 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.', |
| 720 | 720 | |
| 721 | - "post_images" => $image_array, |
|
| 722 | - "post_category" => array($post_type.'category' => array($category_array[3])), |
|
| 723 | - "post_tags" => array('Tags', 'Sample Tags'), |
|
| 724 | - "geodir_video" => '', |
|
| 725 | - "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 726 | - "geodir_contact" => '(222) 777-1111', |
|
| 727 | - "geodir_email" => '[email protected]', |
|
| 728 | - "geodir_website" => 'http://example.com/', |
|
| 729 | - "geodir_twitter" => 'http://example.com/', |
|
| 730 | - "geodir_facebook" => 'http://example.com/', |
|
| 731 | - "geodir_price" => '80000', |
|
| 732 | - "geodir_property_status" => 'For Sale', |
|
| 733 | - 'geodir_property_furnishing' => '', |
|
| 734 | - 'geodir_property_type' => 'Land', |
|
| 735 | - 'geodir_property_bedrooms' => '', |
|
| 736 | - 'geodir_property_bathrooms' => '', |
|
| 737 | - 'geodir_property_area' => '250000', |
|
| 738 | - 'geodir_property_features' => '', |
|
| 739 | - "post_dummy" => '1' |
|
| 740 | - ); |
|
| 741 | - |
|
| 742 | - break; |
|
| 721 | + "post_images" => $image_array, |
|
| 722 | + "post_category" => array($post_type.'category' => array($category_array[3])), |
|
| 723 | + "post_tags" => array('Tags', 'Sample Tags'), |
|
| 724 | + "geodir_video" => '', |
|
| 725 | + "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 726 | + "geodir_contact" => '(222) 777-1111', |
|
| 727 | + "geodir_email" => '[email protected]', |
|
| 728 | + "geodir_website" => 'http://example.com/', |
|
| 729 | + "geodir_twitter" => 'http://example.com/', |
|
| 730 | + "geodir_facebook" => 'http://example.com/', |
|
| 731 | + "geodir_price" => '80000', |
|
| 732 | + "geodir_property_status" => 'For Sale', |
|
| 733 | + 'geodir_property_furnishing' => '', |
|
| 734 | + 'geodir_property_type' => 'Land', |
|
| 735 | + 'geodir_property_bedrooms' => '', |
|
| 736 | + 'geodir_property_bathrooms' => '', |
|
| 737 | + 'geodir_property_area' => '250000', |
|
| 738 | + 'geodir_property_features' => '', |
|
| 739 | + "post_dummy" => '1' |
|
| 740 | + ); |
|
| 741 | + |
|
| 742 | + break; |
|
| 743 | 743 | |
| 744 | 744 | } // end of switch |
| 745 | 745 | |
| 746 | 746 | foreach ($post_info as $post_info) { |
| 747 | - $default_location = geodir_get_default_location(); |
|
| 748 | - if ($city_bound_lat1 > $city_bound_lat2) |
|
| 749 | - $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat1, $city_bound_lat2), geodir_random_float($city_bound_lat2, $city_bound_lat1)); |
|
| 750 | - else |
|
| 751 | - $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat2, $city_bound_lat1), geodir_random_float($city_bound_lat1, $city_bound_lat2)); |
|
| 747 | + $default_location = geodir_get_default_location(); |
|
| 748 | + if ($city_bound_lat1 > $city_bound_lat2) |
|
| 749 | + $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat1, $city_bound_lat2), geodir_random_float($city_bound_lat2, $city_bound_lat1)); |
|
| 750 | + else |
|
| 751 | + $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat2, $city_bound_lat1), geodir_random_float($city_bound_lat1, $city_bound_lat2)); |
|
| 752 | 752 | |
| 753 | 753 | |
| 754 | - if ($city_bound_lng1 > $city_bound_lng2) |
|
| 755 | - $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng1, $city_bound_lng2), geodir_random_float($city_bound_lng2, $city_bound_lng1)); |
|
| 756 | - else |
|
| 757 | - $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng2, $city_bound_lng1), geodir_random_float($city_bound_lng1, $city_bound_lng2)); |
|
| 754 | + if ($city_bound_lng1 > $city_bound_lng2) |
|
| 755 | + $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng1, $city_bound_lng2), geodir_random_float($city_bound_lng2, $city_bound_lng1)); |
|
| 756 | + else |
|
| 757 | + $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng2, $city_bound_lng1), geodir_random_float($city_bound_lng1, $city_bound_lng2)); |
|
| 758 | 758 | |
| 759 | - $load_map = get_option('geodir_load_map'); |
|
| 759 | + $load_map = get_option('geodir_load_map'); |
|
| 760 | 760 | |
| 761 | - if ($load_map == 'osm') { |
|
| 762 | - $post_address = geodir_get_osm_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude); |
|
| 763 | - } else { |
|
| 764 | - $post_address = geodir_get_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude); |
|
| 765 | - } |
|
| 766 | - |
|
| 767 | - $postal_code = ''; |
|
| 768 | - if (!empty($post_address)) { |
|
| 769 | - if ($load_map == 'osm') { |
|
| 770 | - $address = !empty($post_address->formatted_address) ? $post_address->formatted_address : ''; |
|
| 771 | - $postal_code = !empty($post_address->address->postcode) ? $post_address->address->postcode : ''; |
|
| 772 | - } else { |
|
| 773 | - $addresses = array(); |
|
| 774 | - $addresses_default = array(); |
|
| 761 | + if ($load_map == 'osm') { |
|
| 762 | + $post_address = geodir_get_osm_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude); |
|
| 763 | + } else { |
|
| 764 | + $post_address = geodir_get_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude); |
|
| 765 | + } |
|
| 766 | + |
|
| 767 | + $postal_code = ''; |
|
| 768 | + if (!empty($post_address)) { |
|
| 769 | + if ($load_map == 'osm') { |
|
| 770 | + $address = !empty($post_address->formatted_address) ? $post_address->formatted_address : ''; |
|
| 771 | + $postal_code = !empty($post_address->address->postcode) ? $post_address->address->postcode : ''; |
|
| 772 | + } else { |
|
| 773 | + $addresses = array(); |
|
| 774 | + $addresses_default = array(); |
|
| 775 | 775 | |
| 776 | - foreach ($post_address as $add_key => $add_value) { |
|
| 777 | - if ($add_key < 2 && !empty($add_value->long_name)) { |
|
| 778 | - $addresses_default[] = $add_value->long_name; |
|
| 779 | - } |
|
| 780 | - if ($add_value->types[0] == 'postal_code') { |
|
| 781 | - $postal_code = $add_value->long_name; |
|
| 782 | - } |
|
| 783 | - if ($add_value->types[0] == 'street_number') { |
|
| 784 | - $addresses[] = $add_value->long_name; |
|
| 785 | - } |
|
| 786 | - if ($add_value->types[0] == 'route') { |
|
| 787 | - $addresses[] = $add_value->long_name; |
|
| 788 | - } |
|
| 789 | - if ($add_value->types[0] == 'neighborhood') { |
|
| 790 | - $addresses[] = $add_value->long_name; |
|
| 791 | - } |
|
| 792 | - if ($add_value->types[0] == 'sublocality') { |
|
| 793 | - $addresses[] = $add_value->long_name; |
|
| 794 | - } |
|
| 795 | - } |
|
| 796 | - $address = !empty($addresses) ? implode(', ', $addresses) : (!empty($addresses_default) ? implode(', ', $addresses_default) : ''); |
|
| 797 | - } |
|
| 798 | - |
|
| 799 | - $post_info['post_address'] = !empty($address) ? $address : $default_location->city; |
|
| 800 | - $post_info['post_city'] = $default_location->city; |
|
| 801 | - $post_info['post_region'] = $default_location->region; |
|
| 802 | - $post_info['post_country'] = $default_location->country; |
|
| 803 | - $post_info['post_zip'] = $postal_code; |
|
| 804 | - $post_info['post_latitude'] = $dummy_post_latitude; |
|
| 805 | - $post_info['post_longitude'] = $dummy_post_longitude; |
|
| 806 | - } |
|
| 776 | + foreach ($post_address as $add_key => $add_value) { |
|
| 777 | + if ($add_key < 2 && !empty($add_value->long_name)) { |
|
| 778 | + $addresses_default[] = $add_value->long_name; |
|
| 779 | + } |
|
| 780 | + if ($add_value->types[0] == 'postal_code') { |
|
| 781 | + $postal_code = $add_value->long_name; |
|
| 782 | + } |
|
| 783 | + if ($add_value->types[0] == 'street_number') { |
|
| 784 | + $addresses[] = $add_value->long_name; |
|
| 785 | + } |
|
| 786 | + if ($add_value->types[0] == 'route') { |
|
| 787 | + $addresses[] = $add_value->long_name; |
|
| 788 | + } |
|
| 789 | + if ($add_value->types[0] == 'neighborhood') { |
|
| 790 | + $addresses[] = $add_value->long_name; |
|
| 791 | + } |
|
| 792 | + if ($add_value->types[0] == 'sublocality') { |
|
| 793 | + $addresses[] = $add_value->long_name; |
|
| 794 | + } |
|
| 795 | + } |
|
| 796 | + $address = !empty($addresses) ? implode(', ', $addresses) : (!empty($addresses_default) ? implode(', ', $addresses_default) : ''); |
|
| 797 | + } |
|
| 798 | + |
|
| 799 | + $post_info['post_address'] = !empty($address) ? $address : $default_location->city; |
|
| 800 | + $post_info['post_city'] = $default_location->city; |
|
| 801 | + $post_info['post_region'] = $default_location->region; |
|
| 802 | + $post_info['post_country'] = $default_location->country; |
|
| 803 | + $post_info['post_zip'] = $postal_code; |
|
| 804 | + $post_info['post_latitude'] = $dummy_post_latitude; |
|
| 805 | + $post_info['post_longitude'] = $dummy_post_longitude; |
|
| 806 | + } |
|
| 807 | 807 | |
| 808 | - geodir_save_listing($post_info, true); |
|
| 809 | - echo 1; |
|
| 808 | + geodir_save_listing($post_info, true); |
|
| 809 | + echo 1; |
|
| 810 | 810 | } |
@@ -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 | // price |
| 14 | 14 | $fields[] = array('listing_type' => $post_type, |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | 'default_value' => '', |
| 79 | 79 | 'show_in' => '[detail],[listing]', |
| 80 | 80 | 'is_required' => true, |
| 81 | - 'option_values' => __('Select Status/,Unfurnished,Furnished,Partially furnished,Optional','geodirectory'), |
|
| 81 | + 'option_values' => __('Select Status/,Unfurnished,Furnished,Partially furnished,Optional', 'geodirectory'), |
|
| 82 | 82 | 'validation_pattern' => '', |
| 83 | 83 | 'validation_msg' => '', |
| 84 | 84 | 'required_msg' => '', |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | 'default_value' => '', |
| 102 | 102 | 'show_in' => '[detail],[listing]', |
| 103 | 103 | 'is_required' => true, |
| 104 | - 'option_values' => __('Select Type/,Detached house,Semi-detached house,Apartment,Bungalow,Semi-detached bungalow,Chalet,Town House,End-terrace house,Terrace house,Cottage,Hotel,Land','geodirectory'), |
|
| 104 | + 'option_values' => __('Select Type/,Detached house,Semi-detached house,Apartment,Bungalow,Semi-detached bungalow,Chalet,Town House,End-terrace house,Terrace house,Cottage,Hotel,Land', 'geodirectory'), |
|
| 105 | 105 | 'validation_pattern' => '', |
| 106 | 106 | 'validation_msg' => '', |
| 107 | 107 | 'required_msg' => '', |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | 'default_value' => '', |
| 125 | 125 | 'show_in' => '[detail],[listing]', |
| 126 | 126 | 'is_required' => true, |
| 127 | - 'option_values' => __('Select Bedrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'), |
|
| 127 | + 'option_values' => __('Select Bedrooms/,1,2,3,4,5,6,7,8,9,10', 'geodirectory'), |
|
| 128 | 128 | 'validation_pattern' => '', |
| 129 | 129 | 'validation_msg' => '', |
| 130 | 130 | 'required_msg' => '', |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | 'default_value' => '', |
| 148 | 148 | 'show_in' => '[detail],[listing]', |
| 149 | 149 | 'is_required' => true, |
| 150 | - 'option_values' => __('Select Bathrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'), |
|
| 150 | + 'option_values' => __('Select Bathrooms/,1,2,3,4,5,6,7,8,9,10', 'geodirectory'), |
|
| 151 | 151 | 'validation_pattern' => '', |
| 152 | 152 | 'validation_msg' => '', |
| 153 | 153 | 'required_msg' => '', |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | 'default_value' => '', |
| 193 | 193 | 'show_in' => '[detail],[listing]', |
| 194 | 194 | 'is_required' => true, |
| 195 | - 'option_values' => __('Select Features/,Gas Central Heating,Oil Central Heating,Double Glazing,Triple Glazing,Front Garden,Garage,Private driveway,Off Road Parking,Fireplace','geodirectory'), |
|
| 195 | + 'option_values' => __('Select Features/,Gas Central Heating,Oil Central Heating,Double Glazing,Triple Glazing,Front Garden,Garage,Private driveway,Off Road Parking,Fireplace', 'geodirectory'), |
|
| 196 | 196 | 'validation_pattern' => '', |
| 197 | 197 | 'validation_msg' => '', |
| 198 | 198 | 'required_msg' => '', |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | return $fields; |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | -function geodir_property_sale_custom_fields_advanced_search($post_type='gd_place') { |
|
| 218 | +function geodir_property_sale_custom_fields_advanced_search($post_type = 'gd_place') { |
|
| 219 | 219 | |
| 220 | 220 | |
| 221 | 221 | $fields = array(); |
@@ -259,34 +259,34 @@ discard block |
||
| 259 | 259 | return $fields; |
| 260 | 260 | } |
| 261 | 261 | |
| 262 | -global $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2,$wpdb, $current_user,$dummy_post_index; |
|
| 262 | +global $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2, $wpdb, $current_user, $dummy_post_index; |
|
| 263 | 263 | $post_info = array(); |
| 264 | 264 | $image_array = array(); |
| 265 | 265 | $post_meta = array(); |
| 266 | 266 | $category_array = array('Apartments', 'Houses', 'Commercial', 'Land'); |
| 267 | 267 | |
| 268 | -if($dummy_post_index==1){ |
|
| 268 | +if ($dummy_post_index == 1) { |
|
| 269 | 269 | // add the dummy categories |
| 270 | - geodir_dummy_data_taxonomies($post_type,$category_array ); |
|
| 270 | + geodir_dummy_data_taxonomies($post_type, $category_array); |
|
| 271 | 271 | |
| 272 | 272 | // add the dummy custom fields |
| 273 | 273 | $fields = geodir_property_sale_custom_fields($post_type); |
| 274 | 274 | geodir_create_dummy_fields($fields); |
| 275 | 275 | |
| 276 | 276 | // update the type currently installed |
| 277 | - update_option($post_type.'_dummy_data_type','property_sale'); |
|
| 277 | + update_option($post_type.'_dummy_data_type', 'property_sale'); |
|
| 278 | 278 | |
| 279 | 279 | // add the advanced search fields |
| 280 | - if (defined('GEODIRADVANCESEARCH_VERSION')){ |
|
| 280 | + if (defined('GEODIRADVANCESEARCH_VERSION')) { |
|
| 281 | 281 | $search_fields = geodir_property_sale_custom_fields_advanced_search($post_type); |
| 282 | - foreach($search_fields as $sfield){ |
|
| 283 | - geodir_custom_advance_search_field_save( $sfield ); |
|
| 282 | + foreach ($search_fields as $sfield) { |
|
| 283 | + geodir_custom_advance_search_field_save($sfield); |
|
| 284 | 284 | } |
| 285 | 285 | } |
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 | if (geodir_dummy_folder_exists()) |
| 289 | - $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy"; |
|
| 289 | + $dummy_image_url = geodir_plugin_url()."/geodirectory-admin/dummy"; |
|
| 290 | 290 | else |
| 291 | 291 | $dummy_image_url = 'http://www.wpgeodirectory.com/dummy'; |
| 292 | 292 | |
@@ -7,371 +7,371 @@ discard block |
||
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | 9 | function geodir_property_rent_custom_fields($post_type='gd_place',$package_id=''){ |
| 10 | - $fields = array(); |
|
| 11 | - $package = ($package_id=='') ? '' : array($package_id); |
|
| 12 | - |
|
| 13 | - // price |
|
| 14 | - $fields[] = array('listing_type' => $post_type, |
|
| 15 | - 'field_type' => 'text', |
|
| 16 | - 'data_type' => 'FLOAT', |
|
| 17 | - 'decimal_point' => '2', |
|
| 18 | - 'admin_title' => __('Price', 'geodirectory'), |
|
| 19 | - 'site_title' => __('Price', 'geodirectory'), |
|
| 20 | - 'admin_desc' => __('Enter the price per calendar month (PCM)in $ (no currency symbol)', 'geodirectory'), |
|
| 21 | - 'htmlvar_name' => 'price', |
|
| 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 | - // property status |
|
| 45 | - $fields[] = array('listing_type' => $post_type, |
|
| 46 | - 'data_type' => 'VARCHAR', |
|
| 47 | - 'field_type' => 'select', |
|
| 48 | - 'field_type_key' => 'property_status', |
|
| 49 | - 'is_active' => 1, |
|
| 50 | - 'for_admin_use' => 0, |
|
| 51 | - 'is_default' => 0, |
|
| 52 | - 'admin_title' => __('Property Status', 'geodirectory'), |
|
| 53 | - 'admin_desc' => __('Enter the status of the property.', 'geodirectory'), |
|
| 54 | - 'site_title' => __('Property Status', 'geodirectory'), |
|
| 55 | - 'htmlvar_name' => 'property_status', |
|
| 56 | - 'default_value' => '', |
|
| 57 | - 'is_required' => '1', |
|
| 58 | - 'required_msg' => '', |
|
| 59 | - 'show_in' => '[detail],[listing]', |
|
| 60 | - 'show_on_pkg' => $package, |
|
| 61 | - 'option_values' => 'Select Status/,For Rent,Let,Under Offer', |
|
| 62 | - 'field_icon' => 'fa fa-home', |
|
| 63 | - 'css_class' => '', |
|
| 64 | - 'cat_sort' => 1, |
|
| 65 | - 'cat_filter' => 1, |
|
| 66 | - ); |
|
| 67 | - |
|
| 68 | - // property furnishing |
|
| 69 | - $fields[] = array('listing_type' => $post_type, |
|
| 70 | - 'field_type' => 'select', |
|
| 71 | - 'data_type' => 'VARCHAR', |
|
| 72 | - 'admin_title' => __('Furnishing', 'geodirectory'), |
|
| 73 | - 'site_title' => __('Furnishing', 'geodirectory'), |
|
| 74 | - 'admin_desc' => __('Enter the furnishing status of the property.', 'geodirectory'), |
|
| 75 | - 'htmlvar_name' => 'property_furnishing', |
|
| 76 | - 'is_active' => true, |
|
| 77 | - 'for_admin_use' => false, |
|
| 78 | - 'default_value' => '', |
|
| 79 | - 'show_in' => '[detail],[listing]', |
|
| 80 | - 'is_required' => true, |
|
| 81 | - 'option_values' => __('Select Status/,Unfurnished,Furnished,Partially furnished,Optional','geodirectory'), |
|
| 82 | - 'validation_pattern' => '', |
|
| 83 | - 'validation_msg' => '', |
|
| 84 | - 'required_msg' => '', |
|
| 85 | - 'field_icon' => 'fa fa-th-large', |
|
| 86 | - 'css_class' => '', |
|
| 87 | - 'cat_sort' => true, |
|
| 88 | - 'cat_filter' => true |
|
| 89 | - ); |
|
| 90 | - |
|
| 91 | - // property type |
|
| 92 | - $fields[] = array('listing_type' => $post_type, |
|
| 93 | - 'field_type' => 'select', |
|
| 94 | - 'data_type' => 'VARCHAR', |
|
| 95 | - 'admin_title' => __('Property Type', 'geodirectory'), |
|
| 96 | - 'site_title' => __('Property Type', 'geodirectory'), |
|
| 97 | - 'admin_desc' => __('Select the property type.', 'geodirectory'), |
|
| 98 | - 'htmlvar_name' => 'property_type', |
|
| 99 | - 'is_active' => true, |
|
| 100 | - 'for_admin_use' => false, |
|
| 101 | - 'default_value' => '', |
|
| 102 | - 'show_in' => '[detail],[listing]', |
|
| 103 | - 'is_required' => true, |
|
| 104 | - 'option_values' => __('Select Type/,Detached house,Semi-detached house,Apartment,Bungalow,Semi-detached bungalow,Chalet,Town House,End-terrace house,Terrace house,Cottage,Hotel,Land','geodirectory'), |
|
| 105 | - 'validation_pattern' => '', |
|
| 106 | - 'validation_msg' => '', |
|
| 107 | - 'required_msg' => '', |
|
| 108 | - 'field_icon' => 'fa fa-home', |
|
| 109 | - 'css_class' => '', |
|
| 110 | - 'cat_sort' => true, |
|
| 111 | - 'cat_filter' => true |
|
| 112 | - ); |
|
| 113 | - |
|
| 114 | - // property bedrooms |
|
| 115 | - $fields[] = array('listing_type' => $post_type, |
|
| 116 | - 'field_type' => 'select', |
|
| 117 | - 'data_type' => 'VARCHAR', |
|
| 118 | - 'admin_title' => __('Property Bedrooms', 'geodirectory'), |
|
| 119 | - 'site_title' => __('Bedrooms', 'geodirectory'), |
|
| 120 | - 'admin_desc' => __('Select the number of bedrooms', 'geodirectory'), |
|
| 121 | - 'htmlvar_name' => 'property_bedrooms', |
|
| 122 | - 'is_active' => true, |
|
| 123 | - 'for_admin_use' => false, |
|
| 124 | - 'default_value' => '', |
|
| 125 | - 'show_in' => '[detail],[listing]', |
|
| 126 | - 'is_required' => true, |
|
| 127 | - 'option_values' => __('Select Bedrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'), |
|
| 128 | - 'validation_pattern' => '', |
|
| 129 | - 'validation_msg' => '', |
|
| 130 | - 'required_msg' => '', |
|
| 131 | - 'field_icon' => 'fa fa-bed', |
|
| 132 | - 'css_class' => '', |
|
| 133 | - 'cat_sort' => true, |
|
| 134 | - 'cat_filter' => true |
|
| 135 | - ); |
|
| 136 | - |
|
| 137 | - // property bathrooms |
|
| 138 | - $fields[] = array('listing_type' => $post_type, |
|
| 139 | - 'field_type' => 'select', |
|
| 140 | - 'data_type' => 'VARCHAR', |
|
| 141 | - 'admin_title' => __('Property Bathrooms', 'geodirectory'), |
|
| 142 | - 'site_title' => __('Bathrooms', 'geodirectory'), |
|
| 143 | - 'admin_desc' => __('Select the number of bathrooms', 'geodirectory'), |
|
| 144 | - 'htmlvar_name' => 'property_bathrooms', |
|
| 145 | - 'is_active' => true, |
|
| 146 | - 'for_admin_use' => false, |
|
| 147 | - 'default_value' => '', |
|
| 148 | - 'show_in' => '[detail],[listing]', |
|
| 149 | - 'is_required' => true, |
|
| 150 | - 'option_values' => __('Select Bathrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'), |
|
| 151 | - 'validation_pattern' => '', |
|
| 152 | - 'validation_msg' => '', |
|
| 153 | - 'required_msg' => '', |
|
| 154 | - 'field_icon' => 'fa fa-bold', |
|
| 155 | - 'css_class' => '', |
|
| 156 | - 'cat_sort' => true, |
|
| 157 | - 'cat_filter' => true |
|
| 158 | - ); |
|
| 159 | - |
|
| 160 | - // property area |
|
| 161 | - $fields[] = array('listing_type' => $post_type, |
|
| 162 | - 'field_type' => 'text', |
|
| 163 | - 'data_type' => 'FLOAT', |
|
| 164 | - 'admin_title' => __('Property Area', 'geodirectory'), |
|
| 165 | - 'site_title' => __('Area (Sq Ft)', 'geodirectory'), |
|
| 166 | - 'admin_desc' => __('Enter the Sq Ft value for the property', 'geodirectory'), |
|
| 167 | - 'htmlvar_name' => 'property_area', |
|
| 168 | - 'is_active' => true, |
|
| 169 | - 'for_admin_use' => false, |
|
| 170 | - 'default_value' => '', |
|
| 171 | - 'show_in' => '[detail],[listing]', |
|
| 172 | - 'is_required' => false, |
|
| 173 | - 'validation_pattern' => '\d+(\.\d{2})?', |
|
| 174 | - 'validation_msg' => 'Please enter the property area in numbers only: 1500', |
|
| 175 | - 'required_msg' => '', |
|
| 176 | - 'field_icon' => 'fa fa-area-chart', |
|
| 177 | - 'css_class' => '', |
|
| 178 | - 'cat_sort' => true, |
|
| 179 | - 'cat_filter' => true |
|
| 180 | - ); |
|
| 181 | - |
|
| 182 | - // property features |
|
| 183 | - $fields[] = array('listing_type' => $post_type, |
|
| 184 | - 'field_type' => 'multiselect', |
|
| 185 | - 'data_type' => 'VARCHAR', |
|
| 186 | - 'admin_title' => __('Property Features', 'geodirectory'), |
|
| 187 | - 'site_title' => __('Features', 'geodirectory'), |
|
| 188 | - 'admin_desc' => __('Select the property features.', 'geodirectory'), |
|
| 189 | - 'htmlvar_name' => 'property_features', |
|
| 190 | - 'is_active' => true, |
|
| 191 | - 'for_admin_use' => false, |
|
| 192 | - 'default_value' => '', |
|
| 193 | - 'show_in' => '[detail],[listing]', |
|
| 194 | - 'is_required' => true, |
|
| 195 | - 'option_values' => __('Select Features/,Gas Central Heating,Oil Central Heating,Double Glazing,Triple Glazing,Front Garden,Garage,Private driveway,Off Road Parking,Fireplace','geodirectory'), |
|
| 196 | - 'validation_pattern' => '', |
|
| 197 | - 'validation_msg' => '', |
|
| 198 | - 'required_msg' => '', |
|
| 199 | - 'field_icon' => 'fa fa-plus-square', |
|
| 200 | - 'css_class' => 'gd-comma-list', |
|
| 201 | - 'cat_sort' => true, |
|
| 202 | - 'cat_filter' => true |
|
| 203 | - ); |
|
| 204 | - |
|
| 205 | - |
|
| 206 | - |
|
| 207 | - /** |
|
| 208 | - * Filter the array of default custom fields DB table data. |
|
| 209 | - * |
|
| 210 | - * @since 1.6.6 |
|
| 211 | - * @param string $fields The default custom fields as an array. |
|
| 212 | - */ |
|
| 213 | - $fields = apply_filters('geodir_property_rent_custom_fields', $fields); |
|
| 214 | - |
|
| 215 | - return $fields; |
|
| 10 | + $fields = array(); |
|
| 11 | + $package = ($package_id=='') ? '' : array($package_id); |
|
| 12 | + |
|
| 13 | + // price |
|
| 14 | + $fields[] = array('listing_type' => $post_type, |
|
| 15 | + 'field_type' => 'text', |
|
| 16 | + 'data_type' => 'FLOAT', |
|
| 17 | + 'decimal_point' => '2', |
|
| 18 | + 'admin_title' => __('Price', 'geodirectory'), |
|
| 19 | + 'site_title' => __('Price', 'geodirectory'), |
|
| 20 | + 'admin_desc' => __('Enter the price per calendar month (PCM)in $ (no currency symbol)', 'geodirectory'), |
|
| 21 | + 'htmlvar_name' => 'price', |
|
| 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 | + // property status |
|
| 45 | + $fields[] = array('listing_type' => $post_type, |
|
| 46 | + 'data_type' => 'VARCHAR', |
|
| 47 | + 'field_type' => 'select', |
|
| 48 | + 'field_type_key' => 'property_status', |
|
| 49 | + 'is_active' => 1, |
|
| 50 | + 'for_admin_use' => 0, |
|
| 51 | + 'is_default' => 0, |
|
| 52 | + 'admin_title' => __('Property Status', 'geodirectory'), |
|
| 53 | + 'admin_desc' => __('Enter the status of the property.', 'geodirectory'), |
|
| 54 | + 'site_title' => __('Property Status', 'geodirectory'), |
|
| 55 | + 'htmlvar_name' => 'property_status', |
|
| 56 | + 'default_value' => '', |
|
| 57 | + 'is_required' => '1', |
|
| 58 | + 'required_msg' => '', |
|
| 59 | + 'show_in' => '[detail],[listing]', |
|
| 60 | + 'show_on_pkg' => $package, |
|
| 61 | + 'option_values' => 'Select Status/,For Rent,Let,Under Offer', |
|
| 62 | + 'field_icon' => 'fa fa-home', |
|
| 63 | + 'css_class' => '', |
|
| 64 | + 'cat_sort' => 1, |
|
| 65 | + 'cat_filter' => 1, |
|
| 66 | + ); |
|
| 67 | + |
|
| 68 | + // property furnishing |
|
| 69 | + $fields[] = array('listing_type' => $post_type, |
|
| 70 | + 'field_type' => 'select', |
|
| 71 | + 'data_type' => 'VARCHAR', |
|
| 72 | + 'admin_title' => __('Furnishing', 'geodirectory'), |
|
| 73 | + 'site_title' => __('Furnishing', 'geodirectory'), |
|
| 74 | + 'admin_desc' => __('Enter the furnishing status of the property.', 'geodirectory'), |
|
| 75 | + 'htmlvar_name' => 'property_furnishing', |
|
| 76 | + 'is_active' => true, |
|
| 77 | + 'for_admin_use' => false, |
|
| 78 | + 'default_value' => '', |
|
| 79 | + 'show_in' => '[detail],[listing]', |
|
| 80 | + 'is_required' => true, |
|
| 81 | + 'option_values' => __('Select Status/,Unfurnished,Furnished,Partially furnished,Optional','geodirectory'), |
|
| 82 | + 'validation_pattern' => '', |
|
| 83 | + 'validation_msg' => '', |
|
| 84 | + 'required_msg' => '', |
|
| 85 | + 'field_icon' => 'fa fa-th-large', |
|
| 86 | + 'css_class' => '', |
|
| 87 | + 'cat_sort' => true, |
|
| 88 | + 'cat_filter' => true |
|
| 89 | + ); |
|
| 90 | + |
|
| 91 | + // property type |
|
| 92 | + $fields[] = array('listing_type' => $post_type, |
|
| 93 | + 'field_type' => 'select', |
|
| 94 | + 'data_type' => 'VARCHAR', |
|
| 95 | + 'admin_title' => __('Property Type', 'geodirectory'), |
|
| 96 | + 'site_title' => __('Property Type', 'geodirectory'), |
|
| 97 | + 'admin_desc' => __('Select the property type.', 'geodirectory'), |
|
| 98 | + 'htmlvar_name' => 'property_type', |
|
| 99 | + 'is_active' => true, |
|
| 100 | + 'for_admin_use' => false, |
|
| 101 | + 'default_value' => '', |
|
| 102 | + 'show_in' => '[detail],[listing]', |
|
| 103 | + 'is_required' => true, |
|
| 104 | + 'option_values' => __('Select Type/,Detached house,Semi-detached house,Apartment,Bungalow,Semi-detached bungalow,Chalet,Town House,End-terrace house,Terrace house,Cottage,Hotel,Land','geodirectory'), |
|
| 105 | + 'validation_pattern' => '', |
|
| 106 | + 'validation_msg' => '', |
|
| 107 | + 'required_msg' => '', |
|
| 108 | + 'field_icon' => 'fa fa-home', |
|
| 109 | + 'css_class' => '', |
|
| 110 | + 'cat_sort' => true, |
|
| 111 | + 'cat_filter' => true |
|
| 112 | + ); |
|
| 113 | + |
|
| 114 | + // property bedrooms |
|
| 115 | + $fields[] = array('listing_type' => $post_type, |
|
| 116 | + 'field_type' => 'select', |
|
| 117 | + 'data_type' => 'VARCHAR', |
|
| 118 | + 'admin_title' => __('Property Bedrooms', 'geodirectory'), |
|
| 119 | + 'site_title' => __('Bedrooms', 'geodirectory'), |
|
| 120 | + 'admin_desc' => __('Select the number of bedrooms', 'geodirectory'), |
|
| 121 | + 'htmlvar_name' => 'property_bedrooms', |
|
| 122 | + 'is_active' => true, |
|
| 123 | + 'for_admin_use' => false, |
|
| 124 | + 'default_value' => '', |
|
| 125 | + 'show_in' => '[detail],[listing]', |
|
| 126 | + 'is_required' => true, |
|
| 127 | + 'option_values' => __('Select Bedrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'), |
|
| 128 | + 'validation_pattern' => '', |
|
| 129 | + 'validation_msg' => '', |
|
| 130 | + 'required_msg' => '', |
|
| 131 | + 'field_icon' => 'fa fa-bed', |
|
| 132 | + 'css_class' => '', |
|
| 133 | + 'cat_sort' => true, |
|
| 134 | + 'cat_filter' => true |
|
| 135 | + ); |
|
| 136 | + |
|
| 137 | + // property bathrooms |
|
| 138 | + $fields[] = array('listing_type' => $post_type, |
|
| 139 | + 'field_type' => 'select', |
|
| 140 | + 'data_type' => 'VARCHAR', |
|
| 141 | + 'admin_title' => __('Property Bathrooms', 'geodirectory'), |
|
| 142 | + 'site_title' => __('Bathrooms', 'geodirectory'), |
|
| 143 | + 'admin_desc' => __('Select the number of bathrooms', 'geodirectory'), |
|
| 144 | + 'htmlvar_name' => 'property_bathrooms', |
|
| 145 | + 'is_active' => true, |
|
| 146 | + 'for_admin_use' => false, |
|
| 147 | + 'default_value' => '', |
|
| 148 | + 'show_in' => '[detail],[listing]', |
|
| 149 | + 'is_required' => true, |
|
| 150 | + 'option_values' => __('Select Bathrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'), |
|
| 151 | + 'validation_pattern' => '', |
|
| 152 | + 'validation_msg' => '', |
|
| 153 | + 'required_msg' => '', |
|
| 154 | + 'field_icon' => 'fa fa-bold', |
|
| 155 | + 'css_class' => '', |
|
| 156 | + 'cat_sort' => true, |
|
| 157 | + 'cat_filter' => true |
|
| 158 | + ); |
|
| 159 | + |
|
| 160 | + // property area |
|
| 161 | + $fields[] = array('listing_type' => $post_type, |
|
| 162 | + 'field_type' => 'text', |
|
| 163 | + 'data_type' => 'FLOAT', |
|
| 164 | + 'admin_title' => __('Property Area', 'geodirectory'), |
|
| 165 | + 'site_title' => __('Area (Sq Ft)', 'geodirectory'), |
|
| 166 | + 'admin_desc' => __('Enter the Sq Ft value for the property', 'geodirectory'), |
|
| 167 | + 'htmlvar_name' => 'property_area', |
|
| 168 | + 'is_active' => true, |
|
| 169 | + 'for_admin_use' => false, |
|
| 170 | + 'default_value' => '', |
|
| 171 | + 'show_in' => '[detail],[listing]', |
|
| 172 | + 'is_required' => false, |
|
| 173 | + 'validation_pattern' => '\d+(\.\d{2})?', |
|
| 174 | + 'validation_msg' => 'Please enter the property area in numbers only: 1500', |
|
| 175 | + 'required_msg' => '', |
|
| 176 | + 'field_icon' => 'fa fa-area-chart', |
|
| 177 | + 'css_class' => '', |
|
| 178 | + 'cat_sort' => true, |
|
| 179 | + 'cat_filter' => true |
|
| 180 | + ); |
|
| 181 | + |
|
| 182 | + // property features |
|
| 183 | + $fields[] = array('listing_type' => $post_type, |
|
| 184 | + 'field_type' => 'multiselect', |
|
| 185 | + 'data_type' => 'VARCHAR', |
|
| 186 | + 'admin_title' => __('Property Features', 'geodirectory'), |
|
| 187 | + 'site_title' => __('Features', 'geodirectory'), |
|
| 188 | + 'admin_desc' => __('Select the property features.', 'geodirectory'), |
|
| 189 | + 'htmlvar_name' => 'property_features', |
|
| 190 | + 'is_active' => true, |
|
| 191 | + 'for_admin_use' => false, |
|
| 192 | + 'default_value' => '', |
|
| 193 | + 'show_in' => '[detail],[listing]', |
|
| 194 | + 'is_required' => true, |
|
| 195 | + 'option_values' => __('Select Features/,Gas Central Heating,Oil Central Heating,Double Glazing,Triple Glazing,Front Garden,Garage,Private driveway,Off Road Parking,Fireplace','geodirectory'), |
|
| 196 | + 'validation_pattern' => '', |
|
| 197 | + 'validation_msg' => '', |
|
| 198 | + 'required_msg' => '', |
|
| 199 | + 'field_icon' => 'fa fa-plus-square', |
|
| 200 | + 'css_class' => 'gd-comma-list', |
|
| 201 | + 'cat_sort' => true, |
|
| 202 | + 'cat_filter' => true |
|
| 203 | + ); |
|
| 204 | + |
|
| 205 | + |
|
| 206 | + |
|
| 207 | + /** |
|
| 208 | + * Filter the array of default custom fields DB table data. |
|
| 209 | + * |
|
| 210 | + * @since 1.6.6 |
|
| 211 | + * @param string $fields The default custom fields as an array. |
|
| 212 | + */ |
|
| 213 | + $fields = apply_filters('geodir_property_rent_custom_fields', $fields); |
|
| 214 | + |
|
| 215 | + return $fields; |
|
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | function geodir_property_rent_custom_fields_advanced_search($post_type='gd_place') { |
| 219 | 219 | |
| 220 | 220 | |
| 221 | - $fields = array(); |
|
| 222 | - |
|
| 223 | - // Price range |
|
| 224 | - $fields[] = array( |
|
| 225 | - 'create_field' => true, |
|
| 226 | - 'listing_type' => $post_type, |
|
| 227 | - 'field_type' => 'text', |
|
| 228 | - 'data_type' => 'RANGE', |
|
| 229 | - 'is_active' => 1, |
|
| 230 | - 'site_field_title' => 'Price', |
|
| 231 | - 'field_data_type' => 'FLOAT', |
|
| 232 | - 'main_search' => 1, |
|
| 233 | - 'main_search_priority' => 15, |
|
| 234 | - 'data_type_change' => 'SELECT', |
|
| 235 | - 'search_condition_select' => 'SINGLE', |
|
| 236 | - 'search_min_value' => '1000', |
|
| 237 | - 'search_max_value' => '10000', |
|
| 238 | - 'search_diff_value' => '1000', |
|
| 239 | - 'first_search_value' => '0', |
|
| 240 | - 'first_search_text' => '', |
|
| 241 | - 'last_search_text' => '', |
|
| 242 | - 'search_condition' => 'SELECT', |
|
| 243 | - 'site_htmlvar_name' => 'geodir_price', |
|
| 244 | - 'htmlvar_name' => 'geodir_price', |
|
| 245 | - 'field_title' => 'geodir_price', |
|
| 246 | - 'expand_custom_value' => '', |
|
| 247 | - 'front_search_title' => 'Price Range pm', |
|
| 248 | - 'field_desc' => '' |
|
| 249 | - ); |
|
| 250 | - |
|
| 251 | - // bedrooms |
|
| 252 | - $fields[] = array( |
|
| 253 | - 'create_field' => true, |
|
| 254 | - 'listing_type' => $post_type, |
|
| 255 | - 'field_type' => 'select', |
|
| 256 | - 'data_type' => 'SELECT', |
|
| 257 | - 'is_active' => 1, |
|
| 258 | - 'site_field_title' => 'Bedrooms', |
|
| 259 | - 'field_data_type' => 'VARCHAR', |
|
| 260 | - 'main_search' => 1, |
|
| 261 | - 'main_search_priority' => 16, |
|
| 262 | - 'search_condition' => 'SINGLE', |
|
| 263 | - 'site_htmlvar_name' => 'geodir_property_bedrooms', |
|
| 264 | - 'htmlvar_name' => 'geodir_property_bedrooms', |
|
| 265 | - 'field_title' => 'geodir_property_bedrooms', |
|
| 266 | - 'front_search_title' => 'Bedrooms', |
|
| 267 | - 'field_desc' => '' |
|
| 268 | - ); |
|
| 269 | - |
|
| 270 | - // Property type |
|
| 271 | - $fields[] = array( |
|
| 272 | - 'create_field' => true, |
|
| 273 | - 'listing_type' => $post_type, |
|
| 274 | - 'field_type' => 'select', |
|
| 275 | - 'data_type' => 'SELECT', |
|
| 276 | - 'is_active' => 1, |
|
| 277 | - 'site_field_title' => 'Property Type', |
|
| 278 | - 'field_data_type' => 'VARCHAR', |
|
| 279 | - 'main_search' => 0, |
|
| 280 | - //'main_search_priority' => 16, |
|
| 281 | - 'search_condition' => 'SINGLE', |
|
| 282 | - 'site_htmlvar_name' => 'geodir_property_type', |
|
| 283 | - 'htmlvar_name' => 'geodir_property_type', |
|
| 284 | - 'field_title' => 'geodir_property_type', |
|
| 285 | - 'front_search_title' => 'Property Type', |
|
| 286 | - 'field_desc' => '' |
|
| 287 | - ); |
|
| 288 | - |
|
| 289 | - // Property Bathrooms |
|
| 290 | - $fields[] = array( |
|
| 291 | - 'create_field' => true, |
|
| 292 | - 'listing_type' => $post_type, |
|
| 293 | - 'field_type' => 'select', |
|
| 294 | - 'data_type' => 'SELECT', |
|
| 295 | - 'is_active' => 1, |
|
| 296 | - 'site_field_title' => 'Bathrooms', |
|
| 297 | - 'field_data_type' => 'VARCHAR', |
|
| 298 | - 'main_search' => 0, |
|
| 299 | - //'main_search_priority' => 16, |
|
| 300 | - 'search_condition' => 'SINGLE', |
|
| 301 | - 'site_htmlvar_name' => 'geodir_property_bathrooms', |
|
| 302 | - 'htmlvar_name' => 'geodir_property_bathrooms', |
|
| 303 | - 'field_title' => 'geodir_property_bathrooms', |
|
| 304 | - 'front_search_title' => 'Bathrooms', |
|
| 305 | - 'field_desc' => '' |
|
| 306 | - ); |
|
| 307 | - |
|
| 308 | - // Property Furnishing |
|
| 309 | - $fields[] = array( |
|
| 310 | - 'create_field' => true, |
|
| 311 | - 'listing_type' => $post_type, |
|
| 312 | - 'field_type' => 'select', |
|
| 313 | - 'data_type' => 'SELECT', |
|
| 314 | - 'is_active' => 1, |
|
| 315 | - 'site_field_title' => 'Furnishing', |
|
| 316 | - 'field_data_type' => 'VARCHAR', |
|
| 317 | - 'main_search' => 0, |
|
| 318 | - //'main_search_priority' => 16, |
|
| 319 | - 'search_condition' => 'SINGLE', |
|
| 320 | - 'site_htmlvar_name' => 'geodir_property_furnishing', |
|
| 321 | - 'htmlvar_name' => 'geodir_property_furnishing', |
|
| 322 | - 'field_title' => 'geodir_property_furnishing', |
|
| 323 | - 'front_search_title' => 'Furnishing', |
|
| 324 | - 'field_desc' => '' |
|
| 325 | - ); |
|
| 326 | - |
|
| 327 | - // Property Status |
|
| 328 | - $fields[] = array( |
|
| 329 | - 'create_field' => true, |
|
| 330 | - 'listing_type' => $post_type, |
|
| 331 | - 'field_type' => 'select', |
|
| 332 | - 'data_type' => 'SELECT', |
|
| 333 | - 'is_active' => 1, |
|
| 334 | - 'site_field_title' => 'Property Status', |
|
| 335 | - 'field_data_type' => 'VARCHAR', |
|
| 336 | - 'main_search' => 0, |
|
| 337 | - //'main_search_priority' => 16, |
|
| 338 | - 'search_condition' => 'SINGLE', |
|
| 339 | - 'site_htmlvar_name' => 'geodir_property_status', |
|
| 340 | - 'htmlvar_name' => 'geodir_property_status', |
|
| 341 | - 'field_title' => 'geodir_property_status', |
|
| 342 | - 'front_search_title' => 'Property Status', |
|
| 343 | - 'field_desc' => '' |
|
| 344 | - ); |
|
| 345 | - |
|
| 346 | - // Property Status |
|
| 347 | - $fields[] = array( |
|
| 348 | - 'create_field' => true, |
|
| 349 | - 'listing_type' => $post_type, |
|
| 350 | - 'field_type' => 'select', |
|
| 351 | - 'data_type' => 'SELECT', |
|
| 352 | - 'is_active' => 1, |
|
| 353 | - 'site_field_title' => 'Property Status', |
|
| 354 | - 'field_data_type' => 'VARCHAR', |
|
| 355 | - 'main_search' => 0, |
|
| 356 | - //'main_search_priority' => 16, |
|
| 357 | - 'search_condition' => 'SINGLE', |
|
| 358 | - 'site_htmlvar_name' => 'geodir_property_status', |
|
| 359 | - 'htmlvar_name' => 'geodir_property_status', |
|
| 360 | - 'field_title' => 'geodir_property_status', |
|
| 361 | - 'front_search_title' => 'Property Status', |
|
| 362 | - 'field_desc' => '' |
|
| 363 | - ); |
|
| 364 | - |
|
| 365 | - |
|
| 366 | - /** |
|
| 367 | - * Filter the array of advanced search fields DB table data. |
|
| 368 | - * |
|
| 369 | - * @since 1.6.6 |
|
| 370 | - * @param string $fields The default custom fields as an array. |
|
| 371 | - */ |
|
| 372 | - $fields = apply_filters('geodir_property_rent_custom_fields_advanced_search', $fields); |
|
| 373 | - |
|
| 374 | - return $fields; |
|
| 221 | + $fields = array(); |
|
| 222 | + |
|
| 223 | + // Price range |
|
| 224 | + $fields[] = array( |
|
| 225 | + 'create_field' => true, |
|
| 226 | + 'listing_type' => $post_type, |
|
| 227 | + 'field_type' => 'text', |
|
| 228 | + 'data_type' => 'RANGE', |
|
| 229 | + 'is_active' => 1, |
|
| 230 | + 'site_field_title' => 'Price', |
|
| 231 | + 'field_data_type' => 'FLOAT', |
|
| 232 | + 'main_search' => 1, |
|
| 233 | + 'main_search_priority' => 15, |
|
| 234 | + 'data_type_change' => 'SELECT', |
|
| 235 | + 'search_condition_select' => 'SINGLE', |
|
| 236 | + 'search_min_value' => '1000', |
|
| 237 | + 'search_max_value' => '10000', |
|
| 238 | + 'search_diff_value' => '1000', |
|
| 239 | + 'first_search_value' => '0', |
|
| 240 | + 'first_search_text' => '', |
|
| 241 | + 'last_search_text' => '', |
|
| 242 | + 'search_condition' => 'SELECT', |
|
| 243 | + 'site_htmlvar_name' => 'geodir_price', |
|
| 244 | + 'htmlvar_name' => 'geodir_price', |
|
| 245 | + 'field_title' => 'geodir_price', |
|
| 246 | + 'expand_custom_value' => '', |
|
| 247 | + 'front_search_title' => 'Price Range pm', |
|
| 248 | + 'field_desc' => '' |
|
| 249 | + ); |
|
| 250 | + |
|
| 251 | + // bedrooms |
|
| 252 | + $fields[] = array( |
|
| 253 | + 'create_field' => true, |
|
| 254 | + 'listing_type' => $post_type, |
|
| 255 | + 'field_type' => 'select', |
|
| 256 | + 'data_type' => 'SELECT', |
|
| 257 | + 'is_active' => 1, |
|
| 258 | + 'site_field_title' => 'Bedrooms', |
|
| 259 | + 'field_data_type' => 'VARCHAR', |
|
| 260 | + 'main_search' => 1, |
|
| 261 | + 'main_search_priority' => 16, |
|
| 262 | + 'search_condition' => 'SINGLE', |
|
| 263 | + 'site_htmlvar_name' => 'geodir_property_bedrooms', |
|
| 264 | + 'htmlvar_name' => 'geodir_property_bedrooms', |
|
| 265 | + 'field_title' => 'geodir_property_bedrooms', |
|
| 266 | + 'front_search_title' => 'Bedrooms', |
|
| 267 | + 'field_desc' => '' |
|
| 268 | + ); |
|
| 269 | + |
|
| 270 | + // Property type |
|
| 271 | + $fields[] = array( |
|
| 272 | + 'create_field' => true, |
|
| 273 | + 'listing_type' => $post_type, |
|
| 274 | + 'field_type' => 'select', |
|
| 275 | + 'data_type' => 'SELECT', |
|
| 276 | + 'is_active' => 1, |
|
| 277 | + 'site_field_title' => 'Property Type', |
|
| 278 | + 'field_data_type' => 'VARCHAR', |
|
| 279 | + 'main_search' => 0, |
|
| 280 | + //'main_search_priority' => 16, |
|
| 281 | + 'search_condition' => 'SINGLE', |
|
| 282 | + 'site_htmlvar_name' => 'geodir_property_type', |
|
| 283 | + 'htmlvar_name' => 'geodir_property_type', |
|
| 284 | + 'field_title' => 'geodir_property_type', |
|
| 285 | + 'front_search_title' => 'Property Type', |
|
| 286 | + 'field_desc' => '' |
|
| 287 | + ); |
|
| 288 | + |
|
| 289 | + // Property Bathrooms |
|
| 290 | + $fields[] = array( |
|
| 291 | + 'create_field' => true, |
|
| 292 | + 'listing_type' => $post_type, |
|
| 293 | + 'field_type' => 'select', |
|
| 294 | + 'data_type' => 'SELECT', |
|
| 295 | + 'is_active' => 1, |
|
| 296 | + 'site_field_title' => 'Bathrooms', |
|
| 297 | + 'field_data_type' => 'VARCHAR', |
|
| 298 | + 'main_search' => 0, |
|
| 299 | + //'main_search_priority' => 16, |
|
| 300 | + 'search_condition' => 'SINGLE', |
|
| 301 | + 'site_htmlvar_name' => 'geodir_property_bathrooms', |
|
| 302 | + 'htmlvar_name' => 'geodir_property_bathrooms', |
|
| 303 | + 'field_title' => 'geodir_property_bathrooms', |
|
| 304 | + 'front_search_title' => 'Bathrooms', |
|
| 305 | + 'field_desc' => '' |
|
| 306 | + ); |
|
| 307 | + |
|
| 308 | + // Property Furnishing |
|
| 309 | + $fields[] = array( |
|
| 310 | + 'create_field' => true, |
|
| 311 | + 'listing_type' => $post_type, |
|
| 312 | + 'field_type' => 'select', |
|
| 313 | + 'data_type' => 'SELECT', |
|
| 314 | + 'is_active' => 1, |
|
| 315 | + 'site_field_title' => 'Furnishing', |
|
| 316 | + 'field_data_type' => 'VARCHAR', |
|
| 317 | + 'main_search' => 0, |
|
| 318 | + //'main_search_priority' => 16, |
|
| 319 | + 'search_condition' => 'SINGLE', |
|
| 320 | + 'site_htmlvar_name' => 'geodir_property_furnishing', |
|
| 321 | + 'htmlvar_name' => 'geodir_property_furnishing', |
|
| 322 | + 'field_title' => 'geodir_property_furnishing', |
|
| 323 | + 'front_search_title' => 'Furnishing', |
|
| 324 | + 'field_desc' => '' |
|
| 325 | + ); |
|
| 326 | + |
|
| 327 | + // Property Status |
|
| 328 | + $fields[] = array( |
|
| 329 | + 'create_field' => true, |
|
| 330 | + 'listing_type' => $post_type, |
|
| 331 | + 'field_type' => 'select', |
|
| 332 | + 'data_type' => 'SELECT', |
|
| 333 | + 'is_active' => 1, |
|
| 334 | + 'site_field_title' => 'Property Status', |
|
| 335 | + 'field_data_type' => 'VARCHAR', |
|
| 336 | + 'main_search' => 0, |
|
| 337 | + //'main_search_priority' => 16, |
|
| 338 | + 'search_condition' => 'SINGLE', |
|
| 339 | + 'site_htmlvar_name' => 'geodir_property_status', |
|
| 340 | + 'htmlvar_name' => 'geodir_property_status', |
|
| 341 | + 'field_title' => 'geodir_property_status', |
|
| 342 | + 'front_search_title' => 'Property Status', |
|
| 343 | + 'field_desc' => '' |
|
| 344 | + ); |
|
| 345 | + |
|
| 346 | + // Property Status |
|
| 347 | + $fields[] = array( |
|
| 348 | + 'create_field' => true, |
|
| 349 | + 'listing_type' => $post_type, |
|
| 350 | + 'field_type' => 'select', |
|
| 351 | + 'data_type' => 'SELECT', |
|
| 352 | + 'is_active' => 1, |
|
| 353 | + 'site_field_title' => 'Property Status', |
|
| 354 | + 'field_data_type' => 'VARCHAR', |
|
| 355 | + 'main_search' => 0, |
|
| 356 | + //'main_search_priority' => 16, |
|
| 357 | + 'search_condition' => 'SINGLE', |
|
| 358 | + 'site_htmlvar_name' => 'geodir_property_status', |
|
| 359 | + 'htmlvar_name' => 'geodir_property_status', |
|
| 360 | + 'field_title' => 'geodir_property_status', |
|
| 361 | + 'front_search_title' => 'Property Status', |
|
| 362 | + 'field_desc' => '' |
|
| 363 | + ); |
|
| 364 | + |
|
| 365 | + |
|
| 366 | + /** |
|
| 367 | + * Filter the array of advanced search fields DB table data. |
|
| 368 | + * |
|
| 369 | + * @since 1.6.6 |
|
| 370 | + * @param string $fields The default custom fields as an array. |
|
| 371 | + */ |
|
| 372 | + $fields = apply_filters('geodir_property_rent_custom_fields_advanced_search', $fields); |
|
| 373 | + |
|
| 374 | + return $fields; |
|
| 375 | 375 | } |
| 376 | 376 | |
| 377 | 377 | global $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2,$wpdb, $current_user,$dummy_post_index; |
@@ -381,46 +381,46 @@ discard block |
||
| 381 | 381 | $category_array = array('Apartments', 'Houses', 'Commercial', 'Land'); |
| 382 | 382 | |
| 383 | 383 | if($dummy_post_index==1){ |
| 384 | - // add the dummy categories |
|
| 385 | - geodir_dummy_data_taxonomies($post_type,$category_array ); |
|
| 386 | - |
|
| 387 | - // add the dummy custom fields |
|
| 388 | - $fields = geodir_property_rent_custom_fields($post_type); |
|
| 389 | - geodir_create_dummy_fields($fields); |
|
| 390 | - |
|
| 391 | - // update the type currently installed |
|
| 392 | - update_option($post_type.'_dummy_data_type','property_rent'); |
|
| 393 | - |
|
| 394 | - // add the advanced search fields |
|
| 395 | - if (defined('GEODIRADVANCESEARCH_VERSION')){ |
|
| 396 | - $search_fields = geodir_property_rent_custom_fields_advanced_search($post_type); |
|
| 397 | - foreach($search_fields as $sfield){ |
|
| 398 | - geodir_custom_advance_search_field_save( $sfield ); |
|
| 399 | - } |
|
| 400 | - } |
|
| 384 | + // add the dummy categories |
|
| 385 | + geodir_dummy_data_taxonomies($post_type,$category_array ); |
|
| 386 | + |
|
| 387 | + // add the dummy custom fields |
|
| 388 | + $fields = geodir_property_rent_custom_fields($post_type); |
|
| 389 | + geodir_create_dummy_fields($fields); |
|
| 390 | + |
|
| 391 | + // update the type currently installed |
|
| 392 | + update_option($post_type.'_dummy_data_type','property_rent'); |
|
| 393 | + |
|
| 394 | + // add the advanced search fields |
|
| 395 | + if (defined('GEODIRADVANCESEARCH_VERSION')){ |
|
| 396 | + $search_fields = geodir_property_rent_custom_fields_advanced_search($post_type); |
|
| 397 | + foreach($search_fields as $sfield){ |
|
| 398 | + geodir_custom_advance_search_field_save( $sfield ); |
|
| 399 | + } |
|
| 400 | + } |
|
| 401 | 401 | } |
| 402 | 402 | |
| 403 | 403 | if (geodir_dummy_folder_exists()) |
| 404 | - $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy"; |
|
| 404 | + $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy"; |
|
| 405 | 405 | else |
| 406 | - $dummy_image_url = 'http://www.wpgeodirectory.com/dummy'; |
|
| 406 | + $dummy_image_url = 'http://www.wpgeodirectory.com/dummy'; |
|
| 407 | 407 | |
| 408 | 408 | $dummy_image_url = apply_filters('place_dummy_image_url', $dummy_image_url); |
| 409 | 409 | |
| 410 | 410 | switch ($dummy_post_index) { |
| 411 | 411 | |
| 412 | - case(1): |
|
| 413 | - $image_array[] = "$dummy_image_url/ps/psf1.jpg"; |
|
| 414 | - $image_array[] = "$dummy_image_url/ps/psl1.jpg"; |
|
| 415 | - $image_array[] = "$dummy_image_url/ps/psb1.jpg"; |
|
| 416 | - $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 417 | - $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 412 | + case(1): |
|
| 413 | + $image_array[] = "$dummy_image_url/ps/psf1.jpg"; |
|
| 414 | + $image_array[] = "$dummy_image_url/ps/psl1.jpg"; |
|
| 415 | + $image_array[] = "$dummy_image_url/ps/psb1.jpg"; |
|
| 416 | + $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 417 | + $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 418 | 418 | |
| 419 | 419 | |
| 420 | - $post_info[] = array( |
|
| 421 | - "listing_type" => $post_type, |
|
| 422 | - "post_title" => 'Eastern Lodge', |
|
| 423 | - "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. |
|
| 420 | + $post_info[] = array( |
|
| 421 | + "listing_type" => $post_type, |
|
| 422 | + "post_title" => 'Eastern Lodge', |
|
| 423 | + "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. |
|
| 424 | 424 | |
| 425 | 425 | 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. |
| 426 | 426 | |
@@ -429,42 +429,42 @@ discard block |
||
| 429 | 429 | 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. |
| 430 | 430 | |
| 431 | 431 | 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.', |
| 432 | - "post_images" => $image_array, |
|
| 433 | - "post_category" => array($post_type.'category' => array($category_array[1])), |
|
| 434 | - "post_tags" => array('Tags', 'Sample Tags'), |
|
| 435 | - "geodir_video" => '', |
|
| 436 | - "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 437 | - "geodir_contact" => '(111) 677-4444', |
|
| 438 | - "geodir_email" => '[email protected]', |
|
| 439 | - "geodir_website" => 'http://example.com/', |
|
| 440 | - "geodir_twitter" => 'http://example.com/', |
|
| 441 | - "geodir_facebook" => 'http://example.com/', |
|
| 442 | - "geodir_price" => '1750', |
|
| 443 | - "geodir_property_status" => 'For Rent', |
|
| 444 | - 'geodir_property_furnishing' => 'Furnished', |
|
| 445 | - 'geodir_property_type' => 'Detached house', |
|
| 446 | - 'geodir_property_bedrooms' => '3', |
|
| 447 | - 'geodir_property_bathrooms' => '2', |
|
| 448 | - 'geodir_property_area' => '1850', |
|
| 449 | - 'geodir_property_features' => 'Gas Central Heating,Triple Glazing,Front Garden,Private driveway,Fireplace', |
|
| 450 | - "post_dummy" => '1' |
|
| 451 | - ); |
|
| 452 | - |
|
| 453 | - |
|
| 454 | - break; |
|
| 455 | - case 2: |
|
| 456 | - $image_array = array(); |
|
| 457 | - $post_meta = array(); |
|
| 458 | - $image_array[] = "$dummy_image_url/ps/psf2.jpg"; |
|
| 459 | - $image_array[] = "$dummy_image_url/ps/psl2.jpg"; |
|
| 460 | - $image_array[] = "$dummy_image_url/ps/psb2.jpg"; |
|
| 461 | - $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 462 | - $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 463 | - |
|
| 464 | - $post_info[] = array( |
|
| 465 | - "listing_type" => $post_type, |
|
| 466 | - "post_title" => 'Daisy Street', |
|
| 467 | - "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. |
|
| 432 | + "post_images" => $image_array, |
|
| 433 | + "post_category" => array($post_type.'category' => array($category_array[1])), |
|
| 434 | + "post_tags" => array('Tags', 'Sample Tags'), |
|
| 435 | + "geodir_video" => '', |
|
| 436 | + "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 437 | + "geodir_contact" => '(111) 677-4444', |
|
| 438 | + "geodir_email" => '[email protected]', |
|
| 439 | + "geodir_website" => 'http://example.com/', |
|
| 440 | + "geodir_twitter" => 'http://example.com/', |
|
| 441 | + "geodir_facebook" => 'http://example.com/', |
|
| 442 | + "geodir_price" => '1750', |
|
| 443 | + "geodir_property_status" => 'For Rent', |
|
| 444 | + 'geodir_property_furnishing' => 'Furnished', |
|
| 445 | + 'geodir_property_type' => 'Detached house', |
|
| 446 | + 'geodir_property_bedrooms' => '3', |
|
| 447 | + 'geodir_property_bathrooms' => '2', |
|
| 448 | + 'geodir_property_area' => '1850', |
|
| 449 | + 'geodir_property_features' => 'Gas Central Heating,Triple Glazing,Front Garden,Private driveway,Fireplace', |
|
| 450 | + "post_dummy" => '1' |
|
| 451 | + ); |
|
| 452 | + |
|
| 453 | + |
|
| 454 | + break; |
|
| 455 | + case 2: |
|
| 456 | + $image_array = array(); |
|
| 457 | + $post_meta = array(); |
|
| 458 | + $image_array[] = "$dummy_image_url/ps/psf2.jpg"; |
|
| 459 | + $image_array[] = "$dummy_image_url/ps/psl2.jpg"; |
|
| 460 | + $image_array[] = "$dummy_image_url/ps/psb2.jpg"; |
|
| 461 | + $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 462 | + $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 463 | + |
|
| 464 | + $post_info[] = array( |
|
| 465 | + "listing_type" => $post_type, |
|
| 466 | + "post_title" => 'Daisy Street', |
|
| 467 | + "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. |
|
| 468 | 468 | |
| 469 | 469 | 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. |
| 470 | 470 | |
@@ -474,42 +474,42 @@ discard block |
||
| 474 | 474 | |
| 475 | 475 | 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.', |
| 476 | 476 | |
| 477 | - "post_images" => $image_array, |
|
| 478 | - "post_category" => array($post_type.'category' => array($category_array[1])), |
|
| 479 | - "post_tags" => array('Garage'), |
|
| 480 | - "geodir_video" => '', |
|
| 481 | - "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 482 | - "geodir_contact" => '(222) 777-1111', |
|
| 483 | - "geodir_email" => '[email protected]', |
|
| 484 | - "geodir_website" => 'http://example.com/', |
|
| 485 | - "geodir_twitter" => 'http://example.com/', |
|
| 486 | - "geodir_facebook" => 'http://example.com/', |
|
| 487 | - "geodir_price" => '1150', |
|
| 488 | - "geodir_property_status" => 'Let', |
|
| 489 | - 'geodir_property_furnishing' => 'Unfurnished', |
|
| 490 | - 'geodir_property_type' => 'Detached house', |
|
| 491 | - 'geodir_property_bedrooms' => '5', |
|
| 492 | - 'geodir_property_bathrooms' => '3', |
|
| 493 | - 'geodir_property_area' => '2650', |
|
| 494 | - 'geodir_property_features' => 'Select Features/,Oil Central Heating,Front Garden,Garage,Private driveway,Fireplace', |
|
| 495 | - "post_dummy" => '1' |
|
| 496 | - ); |
|
| 497 | - |
|
| 498 | - break; |
|
| 499 | - |
|
| 500 | - case 3: |
|
| 501 | - $image_array = array(); |
|
| 502 | - $post_meta = array(); |
|
| 503 | - $image_array[] = "$dummy_image_url/ps/psf3.jpg"; |
|
| 504 | - $image_array[] = "$dummy_image_url/ps/psl3.jpg"; |
|
| 505 | - $image_array[] = "$dummy_image_url/ps/psb3.jpg"; |
|
| 506 | - $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 507 | - $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 508 | - |
|
| 509 | - $post_info[] = array( |
|
| 510 | - "listing_type" => $post_type, |
|
| 511 | - "post_title" => 'Northbay House', |
|
| 512 | - "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. |
|
| 477 | + "post_images" => $image_array, |
|
| 478 | + "post_category" => array($post_type.'category' => array($category_array[1])), |
|
| 479 | + "post_tags" => array('Garage'), |
|
| 480 | + "geodir_video" => '', |
|
| 481 | + "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 482 | + "geodir_contact" => '(222) 777-1111', |
|
| 483 | + "geodir_email" => '[email protected]', |
|
| 484 | + "geodir_website" => 'http://example.com/', |
|
| 485 | + "geodir_twitter" => 'http://example.com/', |
|
| 486 | + "geodir_facebook" => 'http://example.com/', |
|
| 487 | + "geodir_price" => '1150', |
|
| 488 | + "geodir_property_status" => 'Let', |
|
| 489 | + 'geodir_property_furnishing' => 'Unfurnished', |
|
| 490 | + 'geodir_property_type' => 'Detached house', |
|
| 491 | + 'geodir_property_bedrooms' => '5', |
|
| 492 | + 'geodir_property_bathrooms' => '3', |
|
| 493 | + 'geodir_property_area' => '2650', |
|
| 494 | + 'geodir_property_features' => 'Select Features/,Oil Central Heating,Front Garden,Garage,Private driveway,Fireplace', |
|
| 495 | + "post_dummy" => '1' |
|
| 496 | + ); |
|
| 497 | + |
|
| 498 | + break; |
|
| 499 | + |
|
| 500 | + case 3: |
|
| 501 | + $image_array = array(); |
|
| 502 | + $post_meta = array(); |
|
| 503 | + $image_array[] = "$dummy_image_url/ps/psf3.jpg"; |
|
| 504 | + $image_array[] = "$dummy_image_url/ps/psl3.jpg"; |
|
| 505 | + $image_array[] = "$dummy_image_url/ps/psb3.jpg"; |
|
| 506 | + $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 507 | + $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 508 | + |
|
| 509 | + $post_info[] = array( |
|
| 510 | + "listing_type" => $post_type, |
|
| 511 | + "post_title" => 'Northbay House', |
|
| 512 | + "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. |
|
| 513 | 513 | |
| 514 | 514 | 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. |
| 515 | 515 | |
@@ -519,43 +519,43 @@ discard block |
||
| 519 | 519 | |
| 520 | 520 | 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.', |
| 521 | 521 | |
| 522 | - "post_images" => $image_array, |
|
| 523 | - "post_category" => array($post_type.'category' => array($category_array[1])), |
|
| 524 | - "post_tags" => array('Tags', 'Sample Tags'), |
|
| 525 | - "geodir_video" => '', |
|
| 526 | - "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 527 | - "geodir_contact" => '(222) 777-1111', |
|
| 528 | - "geodir_email" => '[email protected]', |
|
| 529 | - "geodir_website" => 'http://example.com/', |
|
| 530 | - "geodir_twitter" => 'http://example.com/', |
|
| 531 | - "geodir_facebook" => 'http://example.com/', |
|
| 532 | - "geodir_price" => '1300', |
|
| 533 | - "geodir_property_status" => 'Under Offer', |
|
| 534 | - 'geodir_property_furnishing' => 'Unfurnished', |
|
| 535 | - 'geodir_property_type' => 'Detached house', |
|
| 536 | - 'geodir_property_bedrooms' => '6', |
|
| 537 | - 'geodir_property_bathrooms' => '6', |
|
| 538 | - 'geodir_property_area' => '1650', |
|
| 539 | - 'geodir_property_features' => 'Select Features/,Gas Central Heating,Triple Glazing,Off Road Parking,Fireplace', |
|
| 540 | - "post_dummy" => '1' |
|
| 541 | - ); |
|
| 542 | - |
|
| 543 | - break; |
|
| 544 | - |
|
| 545 | - |
|
| 546 | - case 4: |
|
| 547 | - $image_array = array(); |
|
| 548 | - $post_meta = array(); |
|
| 549 | - $image_array[] = "$dummy_image_url/ps/psf4.jpg"; |
|
| 550 | - $image_array[] = "$dummy_image_url/ps/psl4.jpg"; |
|
| 551 | - $image_array[] = "$dummy_image_url/ps/psb4.jpg"; |
|
| 552 | - $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 553 | - $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 554 | - |
|
| 555 | - $post_info[] = array( |
|
| 556 | - "listing_type" => $post_type, |
|
| 557 | - "post_title" => 'Jesmond Mansion', |
|
| 558 | - "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. |
|
| 522 | + "post_images" => $image_array, |
|
| 523 | + "post_category" => array($post_type.'category' => array($category_array[1])), |
|
| 524 | + "post_tags" => array('Tags', 'Sample Tags'), |
|
| 525 | + "geodir_video" => '', |
|
| 526 | + "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 527 | + "geodir_contact" => '(222) 777-1111', |
|
| 528 | + "geodir_email" => '[email protected]', |
|
| 529 | + "geodir_website" => 'http://example.com/', |
|
| 530 | + "geodir_twitter" => 'http://example.com/', |
|
| 531 | + "geodir_facebook" => 'http://example.com/', |
|
| 532 | + "geodir_price" => '1300', |
|
| 533 | + "geodir_property_status" => 'Under Offer', |
|
| 534 | + 'geodir_property_furnishing' => 'Unfurnished', |
|
| 535 | + 'geodir_property_type' => 'Detached house', |
|
| 536 | + 'geodir_property_bedrooms' => '6', |
|
| 537 | + 'geodir_property_bathrooms' => '6', |
|
| 538 | + 'geodir_property_area' => '1650', |
|
| 539 | + 'geodir_property_features' => 'Select Features/,Gas Central Heating,Triple Glazing,Off Road Parking,Fireplace', |
|
| 540 | + "post_dummy" => '1' |
|
| 541 | + ); |
|
| 542 | + |
|
| 543 | + break; |
|
| 544 | + |
|
| 545 | + |
|
| 546 | + case 4: |
|
| 547 | + $image_array = array(); |
|
| 548 | + $post_meta = array(); |
|
| 549 | + $image_array[] = "$dummy_image_url/ps/psf4.jpg"; |
|
| 550 | + $image_array[] = "$dummy_image_url/ps/psl4.jpg"; |
|
| 551 | + $image_array[] = "$dummy_image_url/ps/psb4.jpg"; |
|
| 552 | + $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 553 | + $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 554 | + |
|
| 555 | + $post_info[] = array( |
|
| 556 | + "listing_type" => $post_type, |
|
| 557 | + "post_title" => 'Jesmond Mansion', |
|
| 558 | + "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. |
|
| 559 | 559 | |
| 560 | 560 | 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. |
| 561 | 561 | |
@@ -565,42 +565,42 @@ discard block |
||
| 565 | 565 | |
| 566 | 566 | 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.', |
| 567 | 567 | |
| 568 | - "post_images" => $image_array, |
|
| 569 | - "post_category" => array($post_type.'category' => array($category_array[1])), |
|
| 570 | - "post_tags" => array('Tags', 'Sample Tags'), |
|
| 571 | - "geodir_video" => '', |
|
| 572 | - "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 573 | - "geodir_contact" => '(222) 777-1111', |
|
| 574 | - "geodir_email" => '[email protected]', |
|
| 575 | - "geodir_website" => 'http://example.com/', |
|
| 576 | - "geodir_twitter" => 'http://example.com/', |
|
| 577 | - "geodir_facebook" => 'http://example.com/', |
|
| 578 | - "geodir_price" => '13000', |
|
| 579 | - "geodir_property_status" => 'Under Offer', |
|
| 580 | - 'geodir_property_furnishing' => 'Partially furnished', |
|
| 581 | - 'geodir_property_type' => 'Detached house', |
|
| 582 | - 'geodir_property_bedrooms' => '10', |
|
| 583 | - 'geodir_property_bathrooms' => '7', |
|
| 584 | - 'geodir_property_area' => '6600', |
|
| 585 | - 'geodir_property_features' => 'Select Features/,Oil Central Heating,Double Glazing,Front Garden,Garage,Private driveway,Fireplace', |
|
| 586 | - "post_dummy" => '1' |
|
| 587 | - ); |
|
| 588 | - |
|
| 589 | - break; |
|
| 590 | - |
|
| 591 | - case 5: |
|
| 592 | - $image_array = array(); |
|
| 593 | - $post_meta = array(); |
|
| 594 | - $image_array[] = "$dummy_image_url/ps/psf5.jpg"; |
|
| 595 | - $image_array[] = "$dummy_image_url/ps/psl5.jpg"; |
|
| 596 | - $image_array[] = "$dummy_image_url/ps/psb5.jpg"; |
|
| 597 | - $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 598 | - $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 599 | - |
|
| 600 | - $post_info[] = array( |
|
| 601 | - "listing_type" => $post_type, |
|
| 602 | - "post_title" => 'Springfield Lodge', |
|
| 603 | - "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. |
|
| 568 | + "post_images" => $image_array, |
|
| 569 | + "post_category" => array($post_type.'category' => array($category_array[1])), |
|
| 570 | + "post_tags" => array('Tags', 'Sample Tags'), |
|
| 571 | + "geodir_video" => '', |
|
| 572 | + "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 573 | + "geodir_contact" => '(222) 777-1111', |
|
| 574 | + "geodir_email" => '[email protected]', |
|
| 575 | + "geodir_website" => 'http://example.com/', |
|
| 576 | + "geodir_twitter" => 'http://example.com/', |
|
| 577 | + "geodir_facebook" => 'http://example.com/', |
|
| 578 | + "geodir_price" => '13000', |
|
| 579 | + "geodir_property_status" => 'Under Offer', |
|
| 580 | + 'geodir_property_furnishing' => 'Partially furnished', |
|
| 581 | + 'geodir_property_type' => 'Detached house', |
|
| 582 | + 'geodir_property_bedrooms' => '10', |
|
| 583 | + 'geodir_property_bathrooms' => '7', |
|
| 584 | + 'geodir_property_area' => '6600', |
|
| 585 | + 'geodir_property_features' => 'Select Features/,Oil Central Heating,Double Glazing,Front Garden,Garage,Private driveway,Fireplace', |
|
| 586 | + "post_dummy" => '1' |
|
| 587 | + ); |
|
| 588 | + |
|
| 589 | + break; |
|
| 590 | + |
|
| 591 | + case 5: |
|
| 592 | + $image_array = array(); |
|
| 593 | + $post_meta = array(); |
|
| 594 | + $image_array[] = "$dummy_image_url/ps/psf5.jpg"; |
|
| 595 | + $image_array[] = "$dummy_image_url/ps/psl5.jpg"; |
|
| 596 | + $image_array[] = "$dummy_image_url/ps/psb5.jpg"; |
|
| 597 | + $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 598 | + $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 599 | + |
|
| 600 | + $post_info[] = array( |
|
| 601 | + "listing_type" => $post_type, |
|
| 602 | + "post_title" => 'Springfield Lodge', |
|
| 603 | + "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. |
|
| 604 | 604 | |
| 605 | 605 | 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. |
| 606 | 606 | |
@@ -610,42 +610,42 @@ discard block |
||
| 610 | 610 | |
| 611 | 611 | 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.', |
| 612 | 612 | |
| 613 | - "post_images" => $image_array, |
|
| 614 | - "post_category" => array($post_type.'category' => array($category_array[1])), |
|
| 615 | - "post_tags" => array('Tags', 'Sample Tags'), |
|
| 616 | - "geodir_video" => '', |
|
| 617 | - "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 618 | - "geodir_contact" => '(222) 777-1111', |
|
| 619 | - "geodir_email" => '[email protected]', |
|
| 620 | - "geodir_website" => 'http://example.com/', |
|
| 621 | - "geodir_twitter" => 'http://example.com/', |
|
| 622 | - "geodir_facebook" => 'http://example.com/', |
|
| 623 | - "geodir_price" => '1800', |
|
| 624 | - "geodir_property_status" => 'For Rent', |
|
| 625 | - 'geodir_property_furnishing' => 'Optional', |
|
| 626 | - 'geodir_property_type' => 'Detached house', |
|
| 627 | - 'geodir_property_bedrooms' => '4', |
|
| 628 | - 'geodir_property_bathrooms' => '3', |
|
| 629 | - 'geodir_property_area' => '3700', |
|
| 630 | - 'geodir_property_features' => 'Select Features/,Oil Central Heating,Double Glazing,Front Garden', |
|
| 631 | - "post_dummy" => '1' |
|
| 632 | - ); |
|
| 633 | - |
|
| 634 | - break; |
|
| 635 | - |
|
| 636 | - case 6: |
|
| 637 | - $image_array = array(); |
|
| 638 | - $post_meta = array(); |
|
| 639 | - $image_array[] = "$dummy_image_url/ps/psf6.jpg"; |
|
| 640 | - $image_array[] = "$dummy_image_url/ps/psl6.jpg"; |
|
| 641 | - $image_array[] = "$dummy_image_url/ps/psb5.jpg"; |
|
| 642 | - $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 643 | - $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 644 | - |
|
| 645 | - $post_info[] = array( |
|
| 646 | - "listing_type" => $post_type, |
|
| 647 | - "post_title" => 'Forrest Park', |
|
| 648 | - "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. |
|
| 613 | + "post_images" => $image_array, |
|
| 614 | + "post_category" => array($post_type.'category' => array($category_array[1])), |
|
| 615 | + "post_tags" => array('Tags', 'Sample Tags'), |
|
| 616 | + "geodir_video" => '', |
|
| 617 | + "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 618 | + "geodir_contact" => '(222) 777-1111', |
|
| 619 | + "geodir_email" => '[email protected]', |
|
| 620 | + "geodir_website" => 'http://example.com/', |
|
| 621 | + "geodir_twitter" => 'http://example.com/', |
|
| 622 | + "geodir_facebook" => 'http://example.com/', |
|
| 623 | + "geodir_price" => '1800', |
|
| 624 | + "geodir_property_status" => 'For Rent', |
|
| 625 | + 'geodir_property_furnishing' => 'Optional', |
|
| 626 | + 'geodir_property_type' => 'Detached house', |
|
| 627 | + 'geodir_property_bedrooms' => '4', |
|
| 628 | + 'geodir_property_bathrooms' => '3', |
|
| 629 | + 'geodir_property_area' => '3700', |
|
| 630 | + 'geodir_property_features' => 'Select Features/,Oil Central Heating,Double Glazing,Front Garden', |
|
| 631 | + "post_dummy" => '1' |
|
| 632 | + ); |
|
| 633 | + |
|
| 634 | + break; |
|
| 635 | + |
|
| 636 | + case 6: |
|
| 637 | + $image_array = array(); |
|
| 638 | + $post_meta = array(); |
|
| 639 | + $image_array[] = "$dummy_image_url/ps/psf6.jpg"; |
|
| 640 | + $image_array[] = "$dummy_image_url/ps/psl6.jpg"; |
|
| 641 | + $image_array[] = "$dummy_image_url/ps/psb5.jpg"; |
|
| 642 | + $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 643 | + $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 644 | + |
|
| 645 | + $post_info[] = array( |
|
| 646 | + "listing_type" => $post_type, |
|
| 647 | + "post_title" => 'Forrest Park', |
|
| 648 | + "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. |
|
| 649 | 649 | |
| 650 | 650 | 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. |
| 651 | 651 | |
@@ -655,42 +655,42 @@ discard block |
||
| 655 | 655 | |
| 656 | 656 | 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.', |
| 657 | 657 | |
| 658 | - "post_images" => $image_array, |
|
| 659 | - "post_category" => array($post_type.'category' => array($category_array[1])), |
|
| 660 | - "post_tags" => array('Tags', 'Sample Tags'), |
|
| 661 | - "geodir_video" => '', |
|
| 662 | - "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 663 | - "geodir_contact" => '(222) 777-1111', |
|
| 664 | - "geodir_email" => '[email protected]', |
|
| 665 | - "geodir_website" => 'http://example.com/', |
|
| 666 | - "geodir_twitter" => 'http://example.com/', |
|
| 667 | - "geodir_facebook" => 'http://example.com/', |
|
| 668 | - "geodir_price" => '2700', |
|
| 669 | - "geodir_property_status" => 'For Rent', |
|
| 670 | - 'geodir_property_furnishing' => 'Unfurnished', |
|
| 671 | - 'geodir_property_type' => 'Detached house', |
|
| 672 | - 'geodir_property_bedrooms' => '5', |
|
| 673 | - 'geodir_property_bathrooms' => '4', |
|
| 674 | - 'geodir_property_area' => '2250', |
|
| 675 | - 'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Front Garden,Private driveway', |
|
| 676 | - "post_dummy" => '1' |
|
| 677 | - ); |
|
| 678 | - |
|
| 679 | - break; |
|
| 680 | - |
|
| 681 | - case 7: |
|
| 682 | - $image_array = array(); |
|
| 683 | - $post_meta = array(); |
|
| 684 | - $image_array[] = "$dummy_image_url/ps/psf7.jpg"; |
|
| 685 | - $image_array[] = "$dummy_image_url/ps/psl4.jpg"; |
|
| 686 | - $image_array[] = "$dummy_image_url/ps/psb4.jpg"; |
|
| 687 | - $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 688 | - $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 689 | - |
|
| 690 | - $post_info[] = array( |
|
| 691 | - "listing_type" => $post_type, |
|
| 692 | - "post_title" => 'Fraser Suites', |
|
| 693 | - "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. |
|
| 658 | + "post_images" => $image_array, |
|
| 659 | + "post_category" => array($post_type.'category' => array($category_array[1])), |
|
| 660 | + "post_tags" => array('Tags', 'Sample Tags'), |
|
| 661 | + "geodir_video" => '', |
|
| 662 | + "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 663 | + "geodir_contact" => '(222) 777-1111', |
|
| 664 | + "geodir_email" => '[email protected]', |
|
| 665 | + "geodir_website" => 'http://example.com/', |
|
| 666 | + "geodir_twitter" => 'http://example.com/', |
|
| 667 | + "geodir_facebook" => 'http://example.com/', |
|
| 668 | + "geodir_price" => '2700', |
|
| 669 | + "geodir_property_status" => 'For Rent', |
|
| 670 | + 'geodir_property_furnishing' => 'Unfurnished', |
|
| 671 | + 'geodir_property_type' => 'Detached house', |
|
| 672 | + 'geodir_property_bedrooms' => '5', |
|
| 673 | + 'geodir_property_bathrooms' => '4', |
|
| 674 | + 'geodir_property_area' => '2250', |
|
| 675 | + 'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Front Garden,Private driveway', |
|
| 676 | + "post_dummy" => '1' |
|
| 677 | + ); |
|
| 678 | + |
|
| 679 | + break; |
|
| 680 | + |
|
| 681 | + case 7: |
|
| 682 | + $image_array = array(); |
|
| 683 | + $post_meta = array(); |
|
| 684 | + $image_array[] = "$dummy_image_url/ps/psf7.jpg"; |
|
| 685 | + $image_array[] = "$dummy_image_url/ps/psl4.jpg"; |
|
| 686 | + $image_array[] = "$dummy_image_url/ps/psb4.jpg"; |
|
| 687 | + $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 688 | + $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 689 | + |
|
| 690 | + $post_info[] = array( |
|
| 691 | + "listing_type" => $post_type, |
|
| 692 | + "post_title" => 'Fraser Suites', |
|
| 693 | + "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. |
|
| 694 | 694 | |
| 695 | 695 | 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. |
| 696 | 696 | |
@@ -700,42 +700,42 @@ discard block |
||
| 700 | 700 | |
| 701 | 701 | 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.', |
| 702 | 702 | |
| 703 | - "post_images" => $image_array, |
|
| 704 | - "post_category" => array($post_type.'category' => array($category_array[0])), |
|
| 705 | - "post_tags" => array('Tags', 'Sample Tags'), |
|
| 706 | - "geodir_video" => '', |
|
| 707 | - "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 708 | - "geodir_contact" => '(222) 777-1111', |
|
| 709 | - "geodir_email" => '[email protected]', |
|
| 710 | - "geodir_website" => 'http://example.com/', |
|
| 711 | - "geodir_twitter" => 'http://example.com/', |
|
| 712 | - "geodir_facebook" => 'http://example.com/', |
|
| 713 | - "geodir_price" => '1450', |
|
| 714 | - "geodir_property_status" => 'For Rent', |
|
| 715 | - 'geodir_property_furnishing' => 'Unfurnished', |
|
| 716 | - 'geodir_property_type' => 'Apartment', |
|
| 717 | - 'geodir_property_bedrooms' => '3', |
|
| 718 | - 'geodir_property_bathrooms' => '2', |
|
| 719 | - 'geodir_property_area' => '1250', |
|
| 720 | - 'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing', |
|
| 721 | - "post_dummy" => '1' |
|
| 722 | - ); |
|
| 723 | - |
|
| 724 | - break; |
|
| 725 | - |
|
| 726 | - case 8: |
|
| 727 | - $image_array = array(); |
|
| 728 | - $post_meta = array(); |
|
| 729 | - $image_array[] = "$dummy_image_url/ps/psf8.jpg"; |
|
| 730 | - $image_array[] = "$dummy_image_url/ps/psl2.jpg"; |
|
| 731 | - $image_array[] = "$dummy_image_url/ps/psb2.jpg"; |
|
| 732 | - $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 733 | - $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 734 | - |
|
| 735 | - $post_info[] = array( |
|
| 736 | - "listing_type" => $post_type, |
|
| 737 | - "post_title" => 'Richmore Apartments', |
|
| 738 | - "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. |
|
| 703 | + "post_images" => $image_array, |
|
| 704 | + "post_category" => array($post_type.'category' => array($category_array[0])), |
|
| 705 | + "post_tags" => array('Tags', 'Sample Tags'), |
|
| 706 | + "geodir_video" => '', |
|
| 707 | + "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 708 | + "geodir_contact" => '(222) 777-1111', |
|
| 709 | + "geodir_email" => '[email protected]', |
|
| 710 | + "geodir_website" => 'http://example.com/', |
|
| 711 | + "geodir_twitter" => 'http://example.com/', |
|
| 712 | + "geodir_facebook" => 'http://example.com/', |
|
| 713 | + "geodir_price" => '1450', |
|
| 714 | + "geodir_property_status" => 'For Rent', |
|
| 715 | + 'geodir_property_furnishing' => 'Unfurnished', |
|
| 716 | + 'geodir_property_type' => 'Apartment', |
|
| 717 | + 'geodir_property_bedrooms' => '3', |
|
| 718 | + 'geodir_property_bathrooms' => '2', |
|
| 719 | + 'geodir_property_area' => '1250', |
|
| 720 | + 'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing', |
|
| 721 | + "post_dummy" => '1' |
|
| 722 | + ); |
|
| 723 | + |
|
| 724 | + break; |
|
| 725 | + |
|
| 726 | + case 8: |
|
| 727 | + $image_array = array(); |
|
| 728 | + $post_meta = array(); |
|
| 729 | + $image_array[] = "$dummy_image_url/ps/psf8.jpg"; |
|
| 730 | + $image_array[] = "$dummy_image_url/ps/psl2.jpg"; |
|
| 731 | + $image_array[] = "$dummy_image_url/ps/psb2.jpg"; |
|
| 732 | + $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 733 | + $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 734 | + |
|
| 735 | + $post_info[] = array( |
|
| 736 | + "listing_type" => $post_type, |
|
| 737 | + "post_title" => 'Richmore Apartments', |
|
| 738 | + "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. |
|
| 739 | 739 | |
| 740 | 740 | 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. |
| 741 | 741 | |
@@ -745,43 +745,43 @@ discard block |
||
| 745 | 745 | |
| 746 | 746 | 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.', |
| 747 | 747 | |
| 748 | - "post_images" => $image_array, |
|
| 749 | - "post_category" => array($post_type.'category' => array($category_array[0])), |
|
| 750 | - "post_tags" => array('Tags', 'Sample Tags'), |
|
| 751 | - "geodir_video" => '', |
|
| 752 | - "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 753 | - "geodir_contact" => '(222) 777-1111', |
|
| 754 | - "geodir_email" => '[email protected]', |
|
| 755 | - "geodir_website" => 'http://example.com/', |
|
| 756 | - "geodir_twitter" => 'http://example.com/', |
|
| 757 | - "geodir_facebook" => 'http://example.com/', |
|
| 758 | - "geodir_price" => '2000', |
|
| 759 | - "geodir_property_status" => 'For Rent', |
|
| 760 | - 'geodir_property_furnishing' => 'Unfurnished', |
|
| 761 | - 'geodir_property_type' => 'Apartment', |
|
| 762 | - 'geodir_property_bedrooms' => '2', |
|
| 763 | - 'geodir_property_bathrooms' => '2', |
|
| 764 | - 'geodir_property_area' => '1750', |
|
| 765 | - 'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Garage', |
|
| 766 | - "post_dummy" => '1' |
|
| 767 | - ); |
|
| 768 | - |
|
| 769 | - break; |
|
| 770 | - |
|
| 771 | - |
|
| 772 | - case 9: |
|
| 773 | - $image_array = array(); |
|
| 774 | - $post_meta = array(); |
|
| 775 | - $image_array[] = "$dummy_image_url/ps/psf9.jpg"; |
|
| 776 | - $image_array[] = "$dummy_image_url/ps/psc9.jpg"; |
|
| 777 | - $image_array[] = "$dummy_image_url/ps/psb2.jpg"; |
|
| 778 | - $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 779 | - $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 780 | - |
|
| 781 | - $post_info[] = array( |
|
| 782 | - "listing_type" => $post_type, |
|
| 783 | - "post_title" => 'Hotel Alpina', |
|
| 784 | - "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. |
|
| 748 | + "post_images" => $image_array, |
|
| 749 | + "post_category" => array($post_type.'category' => array($category_array[0])), |
|
| 750 | + "post_tags" => array('Tags', 'Sample Tags'), |
|
| 751 | + "geodir_video" => '', |
|
| 752 | + "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 753 | + "geodir_contact" => '(222) 777-1111', |
|
| 754 | + "geodir_email" => '[email protected]', |
|
| 755 | + "geodir_website" => 'http://example.com/', |
|
| 756 | + "geodir_twitter" => 'http://example.com/', |
|
| 757 | + "geodir_facebook" => 'http://example.com/', |
|
| 758 | + "geodir_price" => '2000', |
|
| 759 | + "geodir_property_status" => 'For Rent', |
|
| 760 | + 'geodir_property_furnishing' => 'Unfurnished', |
|
| 761 | + 'geodir_property_type' => 'Apartment', |
|
| 762 | + 'geodir_property_bedrooms' => '2', |
|
| 763 | + 'geodir_property_bathrooms' => '2', |
|
| 764 | + 'geodir_property_area' => '1750', |
|
| 765 | + 'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Garage', |
|
| 766 | + "post_dummy" => '1' |
|
| 767 | + ); |
|
| 768 | + |
|
| 769 | + break; |
|
| 770 | + |
|
| 771 | + |
|
| 772 | + case 9: |
|
| 773 | + $image_array = array(); |
|
| 774 | + $post_meta = array(); |
|
| 775 | + $image_array[] = "$dummy_image_url/ps/psf9.jpg"; |
|
| 776 | + $image_array[] = "$dummy_image_url/ps/psc9.jpg"; |
|
| 777 | + $image_array[] = "$dummy_image_url/ps/psb2.jpg"; |
|
| 778 | + $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 779 | + $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 780 | + |
|
| 781 | + $post_info[] = array( |
|
| 782 | + "listing_type" => $post_type, |
|
| 783 | + "post_title" => 'Hotel Alpina', |
|
| 784 | + "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. |
|
| 785 | 785 | |
| 786 | 786 | 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. |
| 787 | 787 | |
@@ -791,39 +791,39 @@ discard block |
||
| 791 | 791 | |
| 792 | 792 | 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.', |
| 793 | 793 | |
| 794 | - "post_images" => $image_array, |
|
| 795 | - "post_category" => array($post_type.'category' => array($category_array[2])), |
|
| 796 | - "post_tags" => array('Tags', 'Sample Tags'), |
|
| 797 | - "geodir_video" => '', |
|
| 798 | - "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 799 | - "geodir_contact" => '(222) 777-1111', |
|
| 800 | - "geodir_email" => '[email protected]', |
|
| 801 | - "geodir_website" => 'http://example.com/', |
|
| 802 | - "geodir_twitter" => 'http://example.com/', |
|
| 803 | - "geodir_facebook" => 'http://example.com/', |
|
| 804 | - "geodir_price" => '60000', |
|
| 805 | - "geodir_property_status" => 'For Rent', |
|
| 806 | - 'geodir_property_furnishing' => 'Furnished', |
|
| 807 | - 'geodir_property_type' => 'Hotel', |
|
| 808 | - 'geodir_property_bedrooms' => '120', |
|
| 809 | - 'geodir_property_bathrooms' => '133', |
|
| 810 | - 'geodir_property_area' => '35000', |
|
| 811 | - 'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Garage', |
|
| 812 | - "post_dummy" => '1' |
|
| 813 | - ); |
|
| 814 | - |
|
| 815 | - break; |
|
| 816 | - |
|
| 817 | - case 10: |
|
| 818 | - $image_array = array(); |
|
| 819 | - $post_meta = array(); |
|
| 820 | - $image_array[] = "$dummy_image_url/ps/psf10.jpg"; |
|
| 821 | - $image_array[] = "$dummy_image_url/ps/psf102.jpg"; |
|
| 822 | - |
|
| 823 | - $post_info[] = array( |
|
| 824 | - "listing_type" => $post_type, |
|
| 825 | - "post_title" => 'Development Land', |
|
| 826 | - "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. |
|
| 794 | + "post_images" => $image_array, |
|
| 795 | + "post_category" => array($post_type.'category' => array($category_array[2])), |
|
| 796 | + "post_tags" => array('Tags', 'Sample Tags'), |
|
| 797 | + "geodir_video" => '', |
|
| 798 | + "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 799 | + "geodir_contact" => '(222) 777-1111', |
|
| 800 | + "geodir_email" => '[email protected]', |
|
| 801 | + "geodir_website" => 'http://example.com/', |
|
| 802 | + "geodir_twitter" => 'http://example.com/', |
|
| 803 | + "geodir_facebook" => 'http://example.com/', |
|
| 804 | + "geodir_price" => '60000', |
|
| 805 | + "geodir_property_status" => 'For Rent', |
|
| 806 | + 'geodir_property_furnishing' => 'Furnished', |
|
| 807 | + 'geodir_property_type' => 'Hotel', |
|
| 808 | + 'geodir_property_bedrooms' => '120', |
|
| 809 | + 'geodir_property_bathrooms' => '133', |
|
| 810 | + 'geodir_property_area' => '35000', |
|
| 811 | + 'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Garage', |
|
| 812 | + "post_dummy" => '1' |
|
| 813 | + ); |
|
| 814 | + |
|
| 815 | + break; |
|
| 816 | + |
|
| 817 | + case 10: |
|
| 818 | + $image_array = array(); |
|
| 819 | + $post_meta = array(); |
|
| 820 | + $image_array[] = "$dummy_image_url/ps/psf10.jpg"; |
|
| 821 | + $image_array[] = "$dummy_image_url/ps/psf102.jpg"; |
|
| 822 | + |
|
| 823 | + $post_info[] = array( |
|
| 824 | + "listing_type" => $post_type, |
|
| 825 | + "post_title" => 'Development Land', |
|
| 826 | + "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. |
|
| 827 | 827 | |
| 828 | 828 | 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. |
| 829 | 829 | |
@@ -833,93 +833,93 @@ discard block |
||
| 833 | 833 | |
| 834 | 834 | 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.', |
| 835 | 835 | |
| 836 | - "post_images" => $image_array, |
|
| 837 | - "post_category" => array($post_type.'category' => array($category_array[3])), |
|
| 838 | - "post_tags" => array('Tags', 'Sample Tags'), |
|
| 839 | - "geodir_video" => '', |
|
| 840 | - "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 841 | - "geodir_contact" => '(222) 777-1111', |
|
| 842 | - "geodir_email" => '[email protected]', |
|
| 843 | - "geodir_website" => 'http://example.com/', |
|
| 844 | - "geodir_twitter" => 'http://example.com/', |
|
| 845 | - "geodir_facebook" => 'http://example.com/', |
|
| 846 | - "geodir_price" => '800', |
|
| 847 | - "geodir_property_status" => 'For Rent', |
|
| 848 | - 'geodir_property_furnishing' => '', |
|
| 849 | - 'geodir_property_type' => 'Land', |
|
| 850 | - 'geodir_property_bedrooms' => '', |
|
| 851 | - 'geodir_property_bathrooms' => '', |
|
| 852 | - 'geodir_property_area' => '250000', |
|
| 853 | - 'geodir_property_features' => '', |
|
| 854 | - "post_dummy" => '1' |
|
| 855 | - ); |
|
| 856 | - |
|
| 857 | - break; |
|
| 836 | + "post_images" => $image_array, |
|
| 837 | + "post_category" => array($post_type.'category' => array($category_array[3])), |
|
| 838 | + "post_tags" => array('Tags', 'Sample Tags'), |
|
| 839 | + "geodir_video" => '', |
|
| 840 | + "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 841 | + "geodir_contact" => '(222) 777-1111', |
|
| 842 | + "geodir_email" => '[email protected]', |
|
| 843 | + "geodir_website" => 'http://example.com/', |
|
| 844 | + "geodir_twitter" => 'http://example.com/', |
|
| 845 | + "geodir_facebook" => 'http://example.com/', |
|
| 846 | + "geodir_price" => '800', |
|
| 847 | + "geodir_property_status" => 'For Rent', |
|
| 848 | + 'geodir_property_furnishing' => '', |
|
| 849 | + 'geodir_property_type' => 'Land', |
|
| 850 | + 'geodir_property_bedrooms' => '', |
|
| 851 | + 'geodir_property_bathrooms' => '', |
|
| 852 | + 'geodir_property_area' => '250000', |
|
| 853 | + 'geodir_property_features' => '', |
|
| 854 | + "post_dummy" => '1' |
|
| 855 | + ); |
|
| 856 | + |
|
| 857 | + break; |
|
| 858 | 858 | |
| 859 | 859 | } // end of switch |
| 860 | 860 | |
| 861 | 861 | foreach ($post_info as $post_info) { |
| 862 | - $default_location = geodir_get_default_location(); |
|
| 863 | - if ($city_bound_lat1 > $city_bound_lat2) |
|
| 864 | - $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat1, $city_bound_lat2), geodir_random_float($city_bound_lat2, $city_bound_lat1)); |
|
| 865 | - else |
|
| 866 | - $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat2, $city_bound_lat1), geodir_random_float($city_bound_lat1, $city_bound_lat2)); |
|
| 862 | + $default_location = geodir_get_default_location(); |
|
| 863 | + if ($city_bound_lat1 > $city_bound_lat2) |
|
| 864 | + $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat1, $city_bound_lat2), geodir_random_float($city_bound_lat2, $city_bound_lat1)); |
|
| 865 | + else |
|
| 866 | + $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat2, $city_bound_lat1), geodir_random_float($city_bound_lat1, $city_bound_lat2)); |
|
| 867 | 867 | |
| 868 | 868 | |
| 869 | - if ($city_bound_lng1 > $city_bound_lng2) |
|
| 870 | - $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng1, $city_bound_lng2), geodir_random_float($city_bound_lng2, $city_bound_lng1)); |
|
| 871 | - else |
|
| 872 | - $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng2, $city_bound_lng1), geodir_random_float($city_bound_lng1, $city_bound_lng2)); |
|
| 869 | + if ($city_bound_lng1 > $city_bound_lng2) |
|
| 870 | + $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng1, $city_bound_lng2), geodir_random_float($city_bound_lng2, $city_bound_lng1)); |
|
| 871 | + else |
|
| 872 | + $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng2, $city_bound_lng1), geodir_random_float($city_bound_lng1, $city_bound_lng2)); |
|
| 873 | 873 | |
| 874 | - $load_map = get_option('geodir_load_map'); |
|
| 874 | + $load_map = get_option('geodir_load_map'); |
|
| 875 | 875 | |
| 876 | - if ($load_map == 'osm') { |
|
| 877 | - $post_address = geodir_get_osm_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude); |
|
| 878 | - } else { |
|
| 879 | - $post_address = geodir_get_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude); |
|
| 880 | - } |
|
| 881 | - |
|
| 882 | - $postal_code = ''; |
|
| 883 | - if (!empty($post_address)) { |
|
| 884 | - if ($load_map == 'osm') { |
|
| 885 | - $address = !empty($post_address->formatted_address) ? $post_address->formatted_address : ''; |
|
| 886 | - $postal_code = !empty($post_address->address->postcode) ? $post_address->address->postcode : ''; |
|
| 887 | - } else { |
|
| 888 | - $addresses = array(); |
|
| 889 | - $addresses_default = array(); |
|
| 876 | + if ($load_map == 'osm') { |
|
| 877 | + $post_address = geodir_get_osm_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude); |
|
| 878 | + } else { |
|
| 879 | + $post_address = geodir_get_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude); |
|
| 880 | + } |
|
| 881 | + |
|
| 882 | + $postal_code = ''; |
|
| 883 | + if (!empty($post_address)) { |
|
| 884 | + if ($load_map == 'osm') { |
|
| 885 | + $address = !empty($post_address->formatted_address) ? $post_address->formatted_address : ''; |
|
| 886 | + $postal_code = !empty($post_address->address->postcode) ? $post_address->address->postcode : ''; |
|
| 887 | + } else { |
|
| 888 | + $addresses = array(); |
|
| 889 | + $addresses_default = array(); |
|
| 890 | 890 | |
| 891 | - foreach ($post_address as $add_key => $add_value) { |
|
| 892 | - if ($add_key < 2 && !empty($add_value->long_name)) { |
|
| 893 | - $addresses_default[] = $add_value->long_name; |
|
| 894 | - } |
|
| 895 | - if ($add_value->types[0] == 'postal_code') { |
|
| 896 | - $postal_code = $add_value->long_name; |
|
| 897 | - } |
|
| 898 | - if ($add_value->types[0] == 'street_number') { |
|
| 899 | - $addresses[] = $add_value->long_name; |
|
| 900 | - } |
|
| 901 | - if ($add_value->types[0] == 'route') { |
|
| 902 | - $addresses[] = $add_value->long_name; |
|
| 903 | - } |
|
| 904 | - if ($add_value->types[0] == 'neighborhood') { |
|
| 905 | - $addresses[] = $add_value->long_name; |
|
| 906 | - } |
|
| 907 | - if ($add_value->types[0] == 'sublocality') { |
|
| 908 | - $addresses[] = $add_value->long_name; |
|
| 909 | - } |
|
| 910 | - } |
|
| 911 | - $address = !empty($addresses) ? implode(', ', $addresses) : (!empty($addresses_default) ? implode(', ', $addresses_default) : ''); |
|
| 912 | - } |
|
| 913 | - |
|
| 914 | - $post_info['post_address'] = !empty($address) ? $address : $default_location->city; |
|
| 915 | - $post_info['post_city'] = $default_location->city; |
|
| 916 | - $post_info['post_region'] = $default_location->region; |
|
| 917 | - $post_info['post_country'] = $default_location->country; |
|
| 918 | - $post_info['post_zip'] = $postal_code; |
|
| 919 | - $post_info['post_latitude'] = $dummy_post_latitude; |
|
| 920 | - $post_info['post_longitude'] = $dummy_post_longitude; |
|
| 921 | - } |
|
| 891 | + foreach ($post_address as $add_key => $add_value) { |
|
| 892 | + if ($add_key < 2 && !empty($add_value->long_name)) { |
|
| 893 | + $addresses_default[] = $add_value->long_name; |
|
| 894 | + } |
|
| 895 | + if ($add_value->types[0] == 'postal_code') { |
|
| 896 | + $postal_code = $add_value->long_name; |
|
| 897 | + } |
|
| 898 | + if ($add_value->types[0] == 'street_number') { |
|
| 899 | + $addresses[] = $add_value->long_name; |
|
| 900 | + } |
|
| 901 | + if ($add_value->types[0] == 'route') { |
|
| 902 | + $addresses[] = $add_value->long_name; |
|
| 903 | + } |
|
| 904 | + if ($add_value->types[0] == 'neighborhood') { |
|
| 905 | + $addresses[] = $add_value->long_name; |
|
| 906 | + } |
|
| 907 | + if ($add_value->types[0] == 'sublocality') { |
|
| 908 | + $addresses[] = $add_value->long_name; |
|
| 909 | + } |
|
| 910 | + } |
|
| 911 | + $address = !empty($addresses) ? implode(', ', $addresses) : (!empty($addresses_default) ? implode(', ', $addresses_default) : ''); |
|
| 912 | + } |
|
| 913 | + |
|
| 914 | + $post_info['post_address'] = !empty($address) ? $address : $default_location->city; |
|
| 915 | + $post_info['post_city'] = $default_location->city; |
|
| 916 | + $post_info['post_region'] = $default_location->region; |
|
| 917 | + $post_info['post_country'] = $default_location->country; |
|
| 918 | + $post_info['post_zip'] = $postal_code; |
|
| 919 | + $post_info['post_latitude'] = $dummy_post_latitude; |
|
| 920 | + $post_info['post_longitude'] = $dummy_post_longitude; |
|
| 921 | + } |
|
| 922 | 922 | |
| 923 | - geodir_save_listing($post_info, true); |
|
| 924 | - echo 1; |
|
| 923 | + geodir_save_listing($post_info, true); |
|
| 924 | + echo 1; |
|
| 925 | 925 | } |
@@ -6,9 +6,9 @@ discard block |
||
| 6 | 6 | * @package GeoDirectory |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | -function geodir_property_rent_custom_fields($post_type='gd_place',$package_id=''){ |
|
| 9 | +function geodir_property_rent_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 | // price |
| 14 | 14 | $fields[] = array('listing_type' => $post_type, |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | 'default_value' => '', |
| 79 | 79 | 'show_in' => '[detail],[listing]', |
| 80 | 80 | 'is_required' => true, |
| 81 | - 'option_values' => __('Select Status/,Unfurnished,Furnished,Partially furnished,Optional','geodirectory'), |
|
| 81 | + 'option_values' => __('Select Status/,Unfurnished,Furnished,Partially furnished,Optional', 'geodirectory'), |
|
| 82 | 82 | 'validation_pattern' => '', |
| 83 | 83 | 'validation_msg' => '', |
| 84 | 84 | 'required_msg' => '', |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | 'default_value' => '', |
| 102 | 102 | 'show_in' => '[detail],[listing]', |
| 103 | 103 | 'is_required' => true, |
| 104 | - 'option_values' => __('Select Type/,Detached house,Semi-detached house,Apartment,Bungalow,Semi-detached bungalow,Chalet,Town House,End-terrace house,Terrace house,Cottage,Hotel,Land','geodirectory'), |
|
| 104 | + 'option_values' => __('Select Type/,Detached house,Semi-detached house,Apartment,Bungalow,Semi-detached bungalow,Chalet,Town House,End-terrace house,Terrace house,Cottage,Hotel,Land', 'geodirectory'), |
|
| 105 | 105 | 'validation_pattern' => '', |
| 106 | 106 | 'validation_msg' => '', |
| 107 | 107 | 'required_msg' => '', |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | 'default_value' => '', |
| 125 | 125 | 'show_in' => '[detail],[listing]', |
| 126 | 126 | 'is_required' => true, |
| 127 | - 'option_values' => __('Select Bedrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'), |
|
| 127 | + 'option_values' => __('Select Bedrooms/,1,2,3,4,5,6,7,8,9,10', 'geodirectory'), |
|
| 128 | 128 | 'validation_pattern' => '', |
| 129 | 129 | 'validation_msg' => '', |
| 130 | 130 | 'required_msg' => '', |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | 'default_value' => '', |
| 148 | 148 | 'show_in' => '[detail],[listing]', |
| 149 | 149 | 'is_required' => true, |
| 150 | - 'option_values' => __('Select Bathrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'), |
|
| 150 | + 'option_values' => __('Select Bathrooms/,1,2,3,4,5,6,7,8,9,10', 'geodirectory'), |
|
| 151 | 151 | 'validation_pattern' => '', |
| 152 | 152 | 'validation_msg' => '', |
| 153 | 153 | 'required_msg' => '', |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | 'default_value' => '', |
| 193 | 193 | 'show_in' => '[detail],[listing]', |
| 194 | 194 | 'is_required' => true, |
| 195 | - 'option_values' => __('Select Features/,Gas Central Heating,Oil Central Heating,Double Glazing,Triple Glazing,Front Garden,Garage,Private driveway,Off Road Parking,Fireplace','geodirectory'), |
|
| 195 | + 'option_values' => __('Select Features/,Gas Central Heating,Oil Central Heating,Double Glazing,Triple Glazing,Front Garden,Garage,Private driveway,Off Road Parking,Fireplace', 'geodirectory'), |
|
| 196 | 196 | 'validation_pattern' => '', |
| 197 | 197 | 'validation_msg' => '', |
| 198 | 198 | 'required_msg' => '', |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | return $fields; |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | -function geodir_property_rent_custom_fields_advanced_search($post_type='gd_place') { |
|
| 218 | +function geodir_property_rent_custom_fields_advanced_search($post_type = 'gd_place') { |
|
| 219 | 219 | |
| 220 | 220 | |
| 221 | 221 | $fields = array(); |
@@ -374,34 +374,34 @@ discard block |
||
| 374 | 374 | return $fields; |
| 375 | 375 | } |
| 376 | 376 | |
| 377 | -global $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2,$wpdb, $current_user,$dummy_post_index; |
|
| 377 | +global $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2, $wpdb, $current_user, $dummy_post_index; |
|
| 378 | 378 | $post_info = array(); |
| 379 | 379 | $image_array = array(); |
| 380 | 380 | $post_meta = array(); |
| 381 | 381 | $category_array = array('Apartments', 'Houses', 'Commercial', 'Land'); |
| 382 | 382 | |
| 383 | -if($dummy_post_index==1){ |
|
| 383 | +if ($dummy_post_index == 1) { |
|
| 384 | 384 | // add the dummy categories |
| 385 | - geodir_dummy_data_taxonomies($post_type,$category_array ); |
|
| 385 | + geodir_dummy_data_taxonomies($post_type, $category_array); |
|
| 386 | 386 | |
| 387 | 387 | // add the dummy custom fields |
| 388 | 388 | $fields = geodir_property_rent_custom_fields($post_type); |
| 389 | 389 | geodir_create_dummy_fields($fields); |
| 390 | 390 | |
| 391 | 391 | // update the type currently installed |
| 392 | - update_option($post_type.'_dummy_data_type','property_rent'); |
|
| 392 | + update_option($post_type.'_dummy_data_type', 'property_rent'); |
|
| 393 | 393 | |
| 394 | 394 | // add the advanced search fields |
| 395 | - if (defined('GEODIRADVANCESEARCH_VERSION')){ |
|
| 395 | + if (defined('GEODIRADVANCESEARCH_VERSION')) { |
|
| 396 | 396 | $search_fields = geodir_property_rent_custom_fields_advanced_search($post_type); |
| 397 | - foreach($search_fields as $sfield){ |
|
| 398 | - geodir_custom_advance_search_field_save( $sfield ); |
|
| 397 | + foreach ($search_fields as $sfield) { |
|
| 398 | + geodir_custom_advance_search_field_save($sfield); |
|
| 399 | 399 | } |
| 400 | 400 | } |
| 401 | 401 | } |
| 402 | 402 | |
| 403 | 403 | if (geodir_dummy_folder_exists()) |
| 404 | - $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy"; |
|
| 404 | + $dummy_image_url = geodir_plugin_url()."/geodirectory-admin/dummy"; |
|
| 405 | 405 | else |
| 406 | 406 | $dummy_image_url = 'http://www.wpgeodirectory.com/dummy'; |
| 407 | 407 | |
@@ -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 | |
@@ -21,84 +21,84 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | function geodir_cf_checkbox($html,$location,$cf,$p=''){ |
| 23 | 23 | |
| 24 | - // check we have the post value |
|
| 25 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 26 | - else{ global $post;} |
|
| 27 | - |
|
| 28 | - if(!is_array($cf) && $cf!=''){ |
|
| 29 | - $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 30 | - if(!$cf){return NULL;} |
|
| 31 | - } |
|
| 32 | - |
|
| 33 | - $html_var = $cf['htmlvar_name']; |
|
| 34 | - |
|
| 35 | - // Check if there is a location specific filter. |
|
| 36 | - if(has_filter("geodir_custom_field_output_checkbox_loc_{$location}")){ |
|
| 37 | - /** |
|
| 38 | - * Filter the checkbox html by location. |
|
| 39 | - * |
|
| 40 | - * @param string $html The html to filter. |
|
| 41 | - * @param array $cf The custom field array. |
|
| 42 | - * @since 1.6.6 |
|
| 43 | - */ |
|
| 44 | - $html = apply_filters("geodir_custom_field_output_checkbox_loc_{$location}",$html,$cf); |
|
| 45 | - } |
|
| 46 | - |
|
| 47 | - // Check if there is a custom field specific filter. |
|
| 48 | - if(has_filter("geodir_custom_field_output_checkbox_var_{$html_var}")){ |
|
| 49 | - /** |
|
| 50 | - * Filter the checkbox html by individual custom field. |
|
| 51 | - * |
|
| 52 | - * @param string $html The html to filter. |
|
| 53 | - * @param string $location The location to output the html. |
|
| 54 | - * @param array $cf The custom field array. |
|
| 55 | - * @since 1.6.6 |
|
| 56 | - */ |
|
| 57 | - $html = apply_filters("geodir_custom_field_output_checkbox_var_{$html_var}",$html,$location,$cf); |
|
| 58 | - } |
|
| 59 | - |
|
| 60 | - // Check if there is a custom field key specific filter. |
|
| 61 | - if(has_filter("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}")){ |
|
| 62 | - /** |
|
| 63 | - * Filter the checkbox html by field type key. |
|
| 64 | - * |
|
| 65 | - * @param string $html The html to filter. |
|
| 66 | - * @param string $location The location to output the html. |
|
| 67 | - * @param array $cf The custom field array. |
|
| 68 | - * @since 1.6.6 |
|
| 69 | - */ |
|
| 70 | - $html = apply_filters("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 71 | - } |
|
| 72 | - |
|
| 73 | - // If not html then we run the standard output. |
|
| 74 | - if(empty($html)){ |
|
| 75 | - |
|
| 76 | - if ( (int) $post->{$html_var} == 1 ): |
|
| 77 | - |
|
| 78 | - if ( $post->{$html_var} == '1' ): |
|
| 79 | - $html_val = __( 'Yes', 'geodirectory' ); |
|
| 80 | - else: |
|
| 81 | - $html_val = __( 'No', 'geodirectory' ); |
|
| 82 | - endif; |
|
| 83 | - |
|
| 84 | - $field_icon = geodir_field_icon_proccess($cf); |
|
| 85 | - if (strpos($field_icon, 'http') !== false) { |
|
| 86 | - $field_icon_af = ''; |
|
| 87 | - } elseif ($field_icon == '') { |
|
| 88 | - $field_icon_af = ''; |
|
| 89 | - } else { |
|
| 90 | - $field_icon_af = $field_icon; |
|
| 91 | - $field_icon = ''; |
|
| 92 | - } |
|
| 93 | - |
|
| 94 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-checkbox" style="' . $field_icon . '">' . $field_icon_af; |
|
| 95 | - $html .= ( trim( $cf['site_title'] ) ) ? __( $cf['site_title'], 'geodirectory' ) . ': ' : ''; |
|
| 96 | - $html .= '</span>' . $html_val . '</div>'; |
|
| 97 | - endif; |
|
| 98 | - |
|
| 99 | - } |
|
| 100 | - |
|
| 101 | - return $html; |
|
| 24 | + // check we have the post value |
|
| 25 | + if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 26 | + else{ global $post;} |
|
| 27 | + |
|
| 28 | + if(!is_array($cf) && $cf!=''){ |
|
| 29 | + $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 30 | + if(!$cf){return NULL;} |
|
| 31 | + } |
|
| 32 | + |
|
| 33 | + $html_var = $cf['htmlvar_name']; |
|
| 34 | + |
|
| 35 | + // Check if there is a location specific filter. |
|
| 36 | + if(has_filter("geodir_custom_field_output_checkbox_loc_{$location}")){ |
|
| 37 | + /** |
|
| 38 | + * Filter the checkbox html by location. |
|
| 39 | + * |
|
| 40 | + * @param string $html The html to filter. |
|
| 41 | + * @param array $cf The custom field array. |
|
| 42 | + * @since 1.6.6 |
|
| 43 | + */ |
|
| 44 | + $html = apply_filters("geodir_custom_field_output_checkbox_loc_{$location}",$html,$cf); |
|
| 45 | + } |
|
| 46 | + |
|
| 47 | + // Check if there is a custom field specific filter. |
|
| 48 | + if(has_filter("geodir_custom_field_output_checkbox_var_{$html_var}")){ |
|
| 49 | + /** |
|
| 50 | + * Filter the checkbox html by individual custom field. |
|
| 51 | + * |
|
| 52 | + * @param string $html The html to filter. |
|
| 53 | + * @param string $location The location to output the html. |
|
| 54 | + * @param array $cf The custom field array. |
|
| 55 | + * @since 1.6.6 |
|
| 56 | + */ |
|
| 57 | + $html = apply_filters("geodir_custom_field_output_checkbox_var_{$html_var}",$html,$location,$cf); |
|
| 58 | + } |
|
| 59 | + |
|
| 60 | + // Check if there is a custom field key specific filter. |
|
| 61 | + if(has_filter("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}")){ |
|
| 62 | + /** |
|
| 63 | + * Filter the checkbox html by field type key. |
|
| 64 | + * |
|
| 65 | + * @param string $html The html to filter. |
|
| 66 | + * @param string $location The location to output the html. |
|
| 67 | + * @param array $cf The custom field array. |
|
| 68 | + * @since 1.6.6 |
|
| 69 | + */ |
|
| 70 | + $html = apply_filters("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 71 | + } |
|
| 72 | + |
|
| 73 | + // If not html then we run the standard output. |
|
| 74 | + if(empty($html)){ |
|
| 75 | + |
|
| 76 | + if ( (int) $post->{$html_var} == 1 ): |
|
| 77 | + |
|
| 78 | + if ( $post->{$html_var} == '1' ): |
|
| 79 | + $html_val = __( 'Yes', 'geodirectory' ); |
|
| 80 | + else: |
|
| 81 | + $html_val = __( 'No', 'geodirectory' ); |
|
| 82 | + endif; |
|
| 83 | + |
|
| 84 | + $field_icon = geodir_field_icon_proccess($cf); |
|
| 85 | + if (strpos($field_icon, 'http') !== false) { |
|
| 86 | + $field_icon_af = ''; |
|
| 87 | + } elseif ($field_icon == '') { |
|
| 88 | + $field_icon_af = ''; |
|
| 89 | + } else { |
|
| 90 | + $field_icon_af = $field_icon; |
|
| 91 | + $field_icon = ''; |
|
| 92 | + } |
|
| 93 | + |
|
| 94 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-checkbox" style="' . $field_icon . '">' . $field_icon_af; |
|
| 95 | + $html .= ( trim( $cf['site_title'] ) ) ? __( $cf['site_title'], 'geodirectory' ) . ': ' : ''; |
|
| 96 | + $html .= '</span>' . $html_val . '</div>'; |
|
| 97 | + endif; |
|
| 98 | + |
|
| 99 | + } |
|
| 100 | + |
|
| 101 | + return $html; |
|
| 102 | 102 | } |
| 103 | 103 | add_filter('geodir_custom_field_output_checkbox','geodir_cf_checkbox',10,3); |
| 104 | 104 | |
@@ -115,71 +115,71 @@ discard block |
||
| 115 | 115 | */ |
| 116 | 116 | function geodir_cf_fieldset($html,$location,$cf,$p=''){ |
| 117 | 117 | |
| 118 | - // check we have the post value |
|
| 119 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 120 | - else{ global $post;} |
|
| 121 | - |
|
| 122 | - if(!is_array($cf) && $cf!=''){ |
|
| 123 | - $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 124 | - if(!$cf){return NULL;} |
|
| 125 | - } |
|
| 126 | - |
|
| 127 | - $html_var = $cf['htmlvar_name']; |
|
| 128 | - |
|
| 129 | - // Check if there is a location specific filter. |
|
| 130 | - if(has_filter("geodir_custom_field_output_fieldset_loc_{$location}")){ |
|
| 131 | - /** |
|
| 132 | - * Filter the fieldset html by location. |
|
| 133 | - * |
|
| 134 | - * @param string $html The html to filter. |
|
| 135 | - * @param array $cf The custom field array. |
|
| 136 | - * @since 1.6.6 |
|
| 137 | - */ |
|
| 138 | - $html = apply_filters("geodir_custom_field_output_fieldset_loc_{$location}",$html,$cf); |
|
| 139 | - } |
|
| 140 | - |
|
| 141 | - // Check if there is a custom field specific filter. |
|
| 142 | - if(has_filter("geodir_custom_field_output_fieldset_var_{$html_var}")){ |
|
| 143 | - /** |
|
| 144 | - * Filter the fieldset html by individual custom field. |
|
| 145 | - * |
|
| 146 | - * @param string $html The html to filter. |
|
| 147 | - * @param string $location The location to output the html. |
|
| 148 | - * @param array $cf The custom field array. |
|
| 149 | - * @since 1.6.6 |
|
| 150 | - */ |
|
| 151 | - $html = apply_filters("geodir_custom_field_output_fieldset_var_{$html_var}",$html,$location,$cf); |
|
| 152 | - } |
|
| 153 | - |
|
| 154 | - // Check if there is a custom field key specific filter. |
|
| 155 | - if(has_filter("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}")){ |
|
| 156 | - /** |
|
| 157 | - * Filter the fieldset html by field type key. |
|
| 158 | - * |
|
| 159 | - * @param string $html The html to filter. |
|
| 160 | - * @param string $location The location to output the html. |
|
| 161 | - * @param array $cf The custom field array. |
|
| 162 | - * @since 1.6.6 |
|
| 163 | - */ |
|
| 164 | - $html = apply_filters("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 165 | - } |
|
| 166 | - |
|
| 167 | - // If not html then we run the standard output. |
|
| 168 | - if(empty($html)){ |
|
| 169 | - |
|
| 170 | - global $field_set_start; |
|
| 171 | - $fieldset_class = 'fieldset-'.sanitize_title_with_dashes($cf['site_title']); |
|
| 172 | - |
|
| 173 | - if ($field_set_start == 1) { |
|
| 174 | - $html = ''; |
|
| 175 | - } else { |
|
| 176 | - $html = '<h2 class="'.$fieldset_class.'">'. __($cf['site_title'], 'geodirectory') . '</h2>'; |
|
| 177 | - //$field_set_start = 1; |
|
| 178 | - } |
|
| 179 | - |
|
| 180 | - } |
|
| 181 | - |
|
| 182 | - return $html; |
|
| 118 | + // check we have the post value |
|
| 119 | + if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 120 | + else{ global $post;} |
|
| 121 | + |
|
| 122 | + if(!is_array($cf) && $cf!=''){ |
|
| 123 | + $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 124 | + if(!$cf){return NULL;} |
|
| 125 | + } |
|
| 126 | + |
|
| 127 | + $html_var = $cf['htmlvar_name']; |
|
| 128 | + |
|
| 129 | + // Check if there is a location specific filter. |
|
| 130 | + if(has_filter("geodir_custom_field_output_fieldset_loc_{$location}")){ |
|
| 131 | + /** |
|
| 132 | + * Filter the fieldset html by location. |
|
| 133 | + * |
|
| 134 | + * @param string $html The html to filter. |
|
| 135 | + * @param array $cf The custom field array. |
|
| 136 | + * @since 1.6.6 |
|
| 137 | + */ |
|
| 138 | + $html = apply_filters("geodir_custom_field_output_fieldset_loc_{$location}",$html,$cf); |
|
| 139 | + } |
|
| 140 | + |
|
| 141 | + // Check if there is a custom field specific filter. |
|
| 142 | + if(has_filter("geodir_custom_field_output_fieldset_var_{$html_var}")){ |
|
| 143 | + /** |
|
| 144 | + * Filter the fieldset html by individual custom field. |
|
| 145 | + * |
|
| 146 | + * @param string $html The html to filter. |
|
| 147 | + * @param string $location The location to output the html. |
|
| 148 | + * @param array $cf The custom field array. |
|
| 149 | + * @since 1.6.6 |
|
| 150 | + */ |
|
| 151 | + $html = apply_filters("geodir_custom_field_output_fieldset_var_{$html_var}",$html,$location,$cf); |
|
| 152 | + } |
|
| 153 | + |
|
| 154 | + // Check if there is a custom field key specific filter. |
|
| 155 | + if(has_filter("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}")){ |
|
| 156 | + /** |
|
| 157 | + * Filter the fieldset html by field type key. |
|
| 158 | + * |
|
| 159 | + * @param string $html The html to filter. |
|
| 160 | + * @param string $location The location to output the html. |
|
| 161 | + * @param array $cf The custom field array. |
|
| 162 | + * @since 1.6.6 |
|
| 163 | + */ |
|
| 164 | + $html = apply_filters("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 165 | + } |
|
| 166 | + |
|
| 167 | + // If not html then we run the standard output. |
|
| 168 | + if(empty($html)){ |
|
| 169 | + |
|
| 170 | + global $field_set_start; |
|
| 171 | + $fieldset_class = 'fieldset-'.sanitize_title_with_dashes($cf['site_title']); |
|
| 172 | + |
|
| 173 | + if ($field_set_start == 1) { |
|
| 174 | + $html = ''; |
|
| 175 | + } else { |
|
| 176 | + $html = '<h2 class="'.$fieldset_class.'">'. __($cf['site_title'], 'geodirectory') . '</h2>'; |
|
| 177 | + //$field_set_start = 1; |
|
| 178 | + } |
|
| 179 | + |
|
| 180 | + } |
|
| 181 | + |
|
| 182 | + return $html; |
|
| 183 | 183 | } |
| 184 | 184 | add_filter('geodir_custom_field_output_fieldset','geodir_cf_fieldset',10,3); |
| 185 | 185 | |
@@ -196,106 +196,106 @@ discard block |
||
| 196 | 196 | */ |
| 197 | 197 | function geodir_cf_url($html,$location,$cf,$p=''){ |
| 198 | 198 | |
| 199 | - // check we have the post value |
|
| 200 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 201 | - else{ global $post;} |
|
| 202 | - |
|
| 203 | - if(!is_array($cf) && $cf!=''){ |
|
| 204 | - $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 205 | - if(!$cf){return NULL;} |
|
| 206 | - } |
|
| 207 | - |
|
| 208 | - $html_var = $cf['htmlvar_name']; |
|
| 209 | - |
|
| 210 | - // Check if there is a location specific filter. |
|
| 211 | - if(has_filter("geodir_custom_field_output_url_loc_{$location}")){ |
|
| 212 | - /** |
|
| 213 | - * Filter the url html by location. |
|
| 214 | - * |
|
| 215 | - * @param string $html The html to filter. |
|
| 216 | - * @param array $cf The custom field array. |
|
| 217 | - * @since 1.6.6 |
|
| 218 | - */ |
|
| 219 | - $html = apply_filters("geodir_custom_field_output_url_loc_{$location}",$html,$cf); |
|
| 220 | - } |
|
| 221 | - |
|
| 222 | - // Check if there is a custom field specific filter. |
|
| 223 | - if(has_filter("geodir_custom_field_output_url_var_{$html_var}")){ |
|
| 224 | - /** |
|
| 225 | - * Filter the url html by individual custom field. |
|
| 226 | - * |
|
| 227 | - * @param string $html The html to filter. |
|
| 228 | - * @param string $location The location to output the html. |
|
| 229 | - * @param array $cf The custom field array. |
|
| 230 | - * @since 1.6.6 |
|
| 231 | - */ |
|
| 232 | - $html = apply_filters("geodir_custom_field_output_url_var_{$html_var}",$html,$location,$cf); |
|
| 233 | - } |
|
| 234 | - |
|
| 235 | - // Check if there is a custom field key specific filter. |
|
| 236 | - if(has_filter("geodir_custom_field_output_url_key_{$cf['field_type_key']}")){ |
|
| 237 | - /** |
|
| 238 | - * Filter the url html by field type key. |
|
| 239 | - * |
|
| 240 | - * @param string $html The html to filter. |
|
| 241 | - * @param string $location The location to output the html. |
|
| 242 | - * @param array $cf The custom field array. |
|
| 243 | - * @since 1.6.6 |
|
| 244 | - */ |
|
| 245 | - $html = apply_filters("geodir_custom_field_output_url_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 246 | - } |
|
| 247 | - |
|
| 248 | - // If not html then we run the standard output. |
|
| 249 | - if(empty($html)){ |
|
| 250 | - |
|
| 251 | - if ($post->{$cf['htmlvar_name']}): |
|
| 252 | - |
|
| 253 | - $field_icon = geodir_field_icon_proccess($cf); |
|
| 254 | - if (strpos($field_icon, 'http') !== false) { |
|
| 255 | - $field_icon_af = ''; |
|
| 256 | - } elseif ($field_icon == '') { |
|
| 257 | - |
|
| 258 | - if ($cf['name'] == 'geodir_facebook') { |
|
| 259 | - $field_icon_af = '<i class="fa fa-facebook-square"></i>'; |
|
| 260 | - } elseif ($cf['name'] == 'geodir_twitter') { |
|
| 261 | - $field_icon_af = '<i class="fa fa-twitter-square"></i>'; |
|
| 262 | - } else { |
|
| 263 | - $field_icon_af = '<i class="fa fa-link"></i>'; |
|
| 264 | - } |
|
| 265 | - |
|
| 266 | - } else { |
|
| 267 | - $field_icon_af = $field_icon; |
|
| 268 | - $field_icon = ''; |
|
| 269 | - } |
|
| 270 | - |
|
| 271 | - $a_url = geodir_parse_custom_field_url($post->{$cf['htmlvar_name']}); |
|
| 272 | - |
|
| 273 | - |
|
| 274 | - $website = !empty($a_url['url']) ? $a_url['url'] : ''; |
|
| 275 | - $title = !empty($a_url['label']) ? $a_url['label'] : $cf['site_title']; |
|
| 276 | - if(!empty($cf['default_value'])){$title = $cf['default_value'];} |
|
| 277 | - $title = $title != '' ? __(stripslashes($title), 'geodirectory') : ''; |
|
| 278 | - |
|
| 279 | - |
|
| 280 | - |
|
| 281 | - // all search engines that use the nofollow value exclude links that use it from their ranking calculation |
|
| 282 | - $rel = strpos($website, get_site_url()) !== false ? '' : 'rel="nofollow"'; |
|
| 283 | - /** |
|
| 284 | - * Filter custom field website name. |
|
| 285 | - * |
|
| 286 | - * @since 1.0.0 |
|
| 287 | - * |
|
| 288 | - * @param string $title Website Title. |
|
| 289 | - * @param string $website Website URL. |
|
| 290 | - * @param int $post->ID Post ID. |
|
| 291 | - */ |
|
| 292 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '"><span class="geodir-i-website" style="' . $field_icon . '">' . $field_icon_af . '<a href="' . $website . '" target="_blank" ' . $rel . ' ><strong>' . apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID) . '</strong></a></span></div>'; |
|
| 293 | - |
|
| 294 | - endif; |
|
| 295 | - |
|
| 296 | - } |
|
| 297 | - |
|
| 298 | - return $html; |
|
| 199 | + // check we have the post value |
|
| 200 | + if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 201 | + else{ global $post;} |
|
| 202 | + |
|
| 203 | + if(!is_array($cf) && $cf!=''){ |
|
| 204 | + $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 205 | + if(!$cf){return NULL;} |
|
| 206 | + } |
|
| 207 | + |
|
| 208 | + $html_var = $cf['htmlvar_name']; |
|
| 209 | + |
|
| 210 | + // Check if there is a location specific filter. |
|
| 211 | + if(has_filter("geodir_custom_field_output_url_loc_{$location}")){ |
|
| 212 | + /** |
|
| 213 | + * Filter the url html by location. |
|
| 214 | + * |
|
| 215 | + * @param string $html The html to filter. |
|
| 216 | + * @param array $cf The custom field array. |
|
| 217 | + * @since 1.6.6 |
|
| 218 | + */ |
|
| 219 | + $html = apply_filters("geodir_custom_field_output_url_loc_{$location}",$html,$cf); |
|
| 220 | + } |
|
| 221 | + |
|
| 222 | + // Check if there is a custom field specific filter. |
|
| 223 | + if(has_filter("geodir_custom_field_output_url_var_{$html_var}")){ |
|
| 224 | + /** |
|
| 225 | + * Filter the url html by individual custom field. |
|
| 226 | + * |
|
| 227 | + * @param string $html The html to filter. |
|
| 228 | + * @param string $location The location to output the html. |
|
| 229 | + * @param array $cf The custom field array. |
|
| 230 | + * @since 1.6.6 |
|
| 231 | + */ |
|
| 232 | + $html = apply_filters("geodir_custom_field_output_url_var_{$html_var}",$html,$location,$cf); |
|
| 233 | + } |
|
| 234 | + |
|
| 235 | + // Check if there is a custom field key specific filter. |
|
| 236 | + if(has_filter("geodir_custom_field_output_url_key_{$cf['field_type_key']}")){ |
|
| 237 | + /** |
|
| 238 | + * Filter the url html by field type key. |
|
| 239 | + * |
|
| 240 | + * @param string $html The html to filter. |
|
| 241 | + * @param string $location The location to output the html. |
|
| 242 | + * @param array $cf The custom field array. |
|
| 243 | + * @since 1.6.6 |
|
| 244 | + */ |
|
| 245 | + $html = apply_filters("geodir_custom_field_output_url_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 246 | + } |
|
| 247 | + |
|
| 248 | + // If not html then we run the standard output. |
|
| 249 | + if(empty($html)){ |
|
| 250 | + |
|
| 251 | + if ($post->{$cf['htmlvar_name']}): |
|
| 252 | + |
|
| 253 | + $field_icon = geodir_field_icon_proccess($cf); |
|
| 254 | + if (strpos($field_icon, 'http') !== false) { |
|
| 255 | + $field_icon_af = ''; |
|
| 256 | + } elseif ($field_icon == '') { |
|
| 257 | + |
|
| 258 | + if ($cf['name'] == 'geodir_facebook') { |
|
| 259 | + $field_icon_af = '<i class="fa fa-facebook-square"></i>'; |
|
| 260 | + } elseif ($cf['name'] == 'geodir_twitter') { |
|
| 261 | + $field_icon_af = '<i class="fa fa-twitter-square"></i>'; |
|
| 262 | + } else { |
|
| 263 | + $field_icon_af = '<i class="fa fa-link"></i>'; |
|
| 264 | + } |
|
| 265 | + |
|
| 266 | + } else { |
|
| 267 | + $field_icon_af = $field_icon; |
|
| 268 | + $field_icon = ''; |
|
| 269 | + } |
|
| 270 | + |
|
| 271 | + $a_url = geodir_parse_custom_field_url($post->{$cf['htmlvar_name']}); |
|
| 272 | + |
|
| 273 | + |
|
| 274 | + $website = !empty($a_url['url']) ? $a_url['url'] : ''; |
|
| 275 | + $title = !empty($a_url['label']) ? $a_url['label'] : $cf['site_title']; |
|
| 276 | + if(!empty($cf['default_value'])){$title = $cf['default_value'];} |
|
| 277 | + $title = $title != '' ? __(stripslashes($title), 'geodirectory') : ''; |
|
| 278 | + |
|
| 279 | + |
|
| 280 | + |
|
| 281 | + // all search engines that use the nofollow value exclude links that use it from their ranking calculation |
|
| 282 | + $rel = strpos($website, get_site_url()) !== false ? '' : 'rel="nofollow"'; |
|
| 283 | + /** |
|
| 284 | + * Filter custom field website name. |
|
| 285 | + * |
|
| 286 | + * @since 1.0.0 |
|
| 287 | + * |
|
| 288 | + * @param string $title Website Title. |
|
| 289 | + * @param string $website Website URL. |
|
| 290 | + * @param int $post->ID Post ID. |
|
| 291 | + */ |
|
| 292 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '"><span class="geodir-i-website" style="' . $field_icon . '">' . $field_icon_af . '<a href="' . $website . '" target="_blank" ' . $rel . ' ><strong>' . apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID) . '</strong></a></span></div>'; |
|
| 293 | + |
|
| 294 | + endif; |
|
| 295 | + |
|
| 296 | + } |
|
| 297 | + |
|
| 298 | + return $html; |
|
| 299 | 299 | } |
| 300 | 300 | add_filter('geodir_custom_field_output_url','geodir_cf_url',10,3); |
| 301 | 301 | |
@@ -312,80 +312,80 @@ discard block |
||
| 312 | 312 | */ |
| 313 | 313 | function geodir_cf_phone($html,$location,$cf,$p=''){ |
| 314 | 314 | |
| 315 | - // check we have the post value |
|
| 316 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 317 | - else{ global $post;} |
|
| 318 | - |
|
| 319 | - if(!is_array($cf) && $cf!=''){ |
|
| 320 | - $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 321 | - if(!$cf){return NULL;} |
|
| 322 | - } |
|
| 323 | - |
|
| 324 | - $html_var = $cf['htmlvar_name']; |
|
| 325 | - |
|
| 326 | - // Check if there is a location specific filter. |
|
| 327 | - if(has_filter("geodir_custom_field_output_phone_loc_{$location}")){ |
|
| 328 | - /** |
|
| 329 | - * Filter the phone html by location. |
|
| 330 | - * |
|
| 331 | - * @param string $html The html to filter. |
|
| 332 | - * @param array $cf The custom field array. |
|
| 333 | - * @since 1.6.6 |
|
| 334 | - */ |
|
| 335 | - $html = apply_filters("geodir_custom_field_output_phone_loc_{$location}",$html,$cf); |
|
| 336 | - } |
|
| 337 | - |
|
| 338 | - // Check if there is a custom field specific filter. |
|
| 339 | - if(has_filter("geodir_custom_field_output_phone_var_{$html_var}")){ |
|
| 340 | - /** |
|
| 341 | - * Filter the phone html by individual custom field. |
|
| 342 | - * |
|
| 343 | - * @param string $html The html to filter. |
|
| 344 | - * @param string $location The location to output the html. |
|
| 345 | - * @param array $cf The custom field array. |
|
| 346 | - * @since 1.6.6 |
|
| 347 | - */ |
|
| 348 | - $html = apply_filters("geodir_custom_field_output_phone_var_{$html_var}",$html,$location,$cf); |
|
| 349 | - } |
|
| 350 | - |
|
| 351 | - // Check if there is a custom field key specific filter. |
|
| 352 | - if(has_filter("geodir_custom_field_output_phone_key_{$cf['field_type_key']}")){ |
|
| 353 | - /** |
|
| 354 | - * Filter the phone html by field type key. |
|
| 355 | - * |
|
| 356 | - * @param string $html The html to filter. |
|
| 357 | - * @param string $location The location to output the html. |
|
| 358 | - * @param array $cf The custom field array. |
|
| 359 | - * @since 1.6.6 |
|
| 360 | - */ |
|
| 361 | - $html = apply_filters("geodir_custom_field_output_phone_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 362 | - } |
|
| 363 | - |
|
| 364 | - // If not html then we run the standard output. |
|
| 365 | - if(empty($html)){ |
|
| 366 | - |
|
| 367 | - if ($post->{$cf['htmlvar_name']}): |
|
| 368 | - |
|
| 369 | - $field_icon = geodir_field_icon_proccess($cf); |
|
| 370 | - if (strpos($field_icon, 'http') !== false) { |
|
| 371 | - $field_icon_af = ''; |
|
| 372 | - } elseif ($field_icon == '') { |
|
| 373 | - $field_icon_af = '<i class="fa fa-phone"></i>'; |
|
| 374 | - } else { |
|
| 375 | - $field_icon_af = $field_icon; |
|
| 376 | - $field_icon = ''; |
|
| 377 | - } |
|
| 378 | - |
|
| 379 | - |
|
| 380 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-contact" style="' . $field_icon . '">' . $field_icon_af . |
|
| 381 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ' '; |
|
| 382 | - $html .= '</span><a href="tel:' . preg_replace('/[^0-9+]/', '', $post->{$cf['htmlvar_name']}) . '">' . $post->{$cf['htmlvar_name']} . '</a></div>'; |
|
| 383 | - |
|
| 384 | - endif; |
|
| 385 | - |
|
| 386 | - } |
|
| 387 | - |
|
| 388 | - return $html; |
|
| 315 | + // check we have the post value |
|
| 316 | + if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 317 | + else{ global $post;} |
|
| 318 | + |
|
| 319 | + if(!is_array($cf) && $cf!=''){ |
|
| 320 | + $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 321 | + if(!$cf){return NULL;} |
|
| 322 | + } |
|
| 323 | + |
|
| 324 | + $html_var = $cf['htmlvar_name']; |
|
| 325 | + |
|
| 326 | + // Check if there is a location specific filter. |
|
| 327 | + if(has_filter("geodir_custom_field_output_phone_loc_{$location}")){ |
|
| 328 | + /** |
|
| 329 | + * Filter the phone html by location. |
|
| 330 | + * |
|
| 331 | + * @param string $html The html to filter. |
|
| 332 | + * @param array $cf The custom field array. |
|
| 333 | + * @since 1.6.6 |
|
| 334 | + */ |
|
| 335 | + $html = apply_filters("geodir_custom_field_output_phone_loc_{$location}",$html,$cf); |
|
| 336 | + } |
|
| 337 | + |
|
| 338 | + // Check if there is a custom field specific filter. |
|
| 339 | + if(has_filter("geodir_custom_field_output_phone_var_{$html_var}")){ |
|
| 340 | + /** |
|
| 341 | + * Filter the phone html by individual custom field. |
|
| 342 | + * |
|
| 343 | + * @param string $html The html to filter. |
|
| 344 | + * @param string $location The location to output the html. |
|
| 345 | + * @param array $cf The custom field array. |
|
| 346 | + * @since 1.6.6 |
|
| 347 | + */ |
|
| 348 | + $html = apply_filters("geodir_custom_field_output_phone_var_{$html_var}",$html,$location,$cf); |
|
| 349 | + } |
|
| 350 | + |
|
| 351 | + // Check if there is a custom field key specific filter. |
|
| 352 | + if(has_filter("geodir_custom_field_output_phone_key_{$cf['field_type_key']}")){ |
|
| 353 | + /** |
|
| 354 | + * Filter the phone html by field type key. |
|
| 355 | + * |
|
| 356 | + * @param string $html The html to filter. |
|
| 357 | + * @param string $location The location to output the html. |
|
| 358 | + * @param array $cf The custom field array. |
|
| 359 | + * @since 1.6.6 |
|
| 360 | + */ |
|
| 361 | + $html = apply_filters("geodir_custom_field_output_phone_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 362 | + } |
|
| 363 | + |
|
| 364 | + // If not html then we run the standard output. |
|
| 365 | + if(empty($html)){ |
|
| 366 | + |
|
| 367 | + if ($post->{$cf['htmlvar_name']}): |
|
| 368 | + |
|
| 369 | + $field_icon = geodir_field_icon_proccess($cf); |
|
| 370 | + if (strpos($field_icon, 'http') !== false) { |
|
| 371 | + $field_icon_af = ''; |
|
| 372 | + } elseif ($field_icon == '') { |
|
| 373 | + $field_icon_af = '<i class="fa fa-phone"></i>'; |
|
| 374 | + } else { |
|
| 375 | + $field_icon_af = $field_icon; |
|
| 376 | + $field_icon = ''; |
|
| 377 | + } |
|
| 378 | + |
|
| 379 | + |
|
| 380 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-contact" style="' . $field_icon . '">' . $field_icon_af . |
|
| 381 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ' '; |
|
| 382 | + $html .= '</span><a href="tel:' . preg_replace('/[^0-9+]/', '', $post->{$cf['htmlvar_name']}) . '">' . $post->{$cf['htmlvar_name']} . '</a></div>'; |
|
| 383 | + |
|
| 384 | + endif; |
|
| 385 | + |
|
| 386 | + } |
|
| 387 | + |
|
| 388 | + return $html; |
|
| 389 | 389 | } |
| 390 | 390 | add_filter('geodir_custom_field_output_phone','geodir_cf_phone',10,3); |
| 391 | 391 | |
@@ -402,85 +402,85 @@ discard block |
||
| 402 | 402 | */ |
| 403 | 403 | function geodir_cf_time($html,$location,$cf,$p=''){ |
| 404 | 404 | |
| 405 | - // check we have the post value |
|
| 406 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 407 | - else{ global $post;} |
|
| 408 | - |
|
| 409 | - if(!is_array($cf) && $cf!=''){ |
|
| 410 | - $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 411 | - if(!$cf){return NULL;} |
|
| 412 | - } |
|
| 413 | - |
|
| 414 | - $html_var = $cf['htmlvar_name']; |
|
| 415 | - |
|
| 416 | - // Check if there is a location specific filter. |
|
| 417 | - if(has_filter("geodir_custom_field_output_time_loc_{$location}")){ |
|
| 418 | - /** |
|
| 419 | - * Filter the time html by location. |
|
| 420 | - * |
|
| 421 | - * @param string $html The html to filter. |
|
| 422 | - * @param array $cf The custom field array. |
|
| 423 | - * @since 1.6.6 |
|
| 424 | - */ |
|
| 425 | - $html = apply_filters("geodir_custom_field_output_time_loc_{$location}",$html,$cf); |
|
| 426 | - } |
|
| 427 | - |
|
| 428 | - // Check if there is a custom field specific filter. |
|
| 429 | - if(has_filter("geodir_custom_field_output_time_var_{$html_var}")){ |
|
| 430 | - /** |
|
| 431 | - * Filter the time html by individual custom field. |
|
| 432 | - * |
|
| 433 | - * @param string $html The html to filter. |
|
| 434 | - * @param string $location The location to output the html. |
|
| 435 | - * @param array $cf The custom field array. |
|
| 436 | - * @since 1.6.6 |
|
| 437 | - */ |
|
| 438 | - $html = apply_filters("geodir_custom_field_output_time_var_{$html_var}",$html,$location,$cf); |
|
| 439 | - } |
|
| 440 | - |
|
| 441 | - // Check if there is a custom field key specific filter. |
|
| 442 | - if(has_filter("geodir_custom_field_output_time_key_{$cf['field_type_key']}")){ |
|
| 443 | - /** |
|
| 444 | - * Filter the time html by field type key. |
|
| 445 | - * |
|
| 446 | - * @param string $html The html to filter. |
|
| 447 | - * @param string $location The location to output the html. |
|
| 448 | - * @param array $cf The custom field array. |
|
| 449 | - * @since 1.6.6 |
|
| 450 | - */ |
|
| 451 | - $html = apply_filters("geodir_custom_field_output_time_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 452 | - } |
|
| 453 | - |
|
| 454 | - // If not html then we run the standard output. |
|
| 455 | - if(empty($html)){ |
|
| 456 | - |
|
| 457 | - if ($post->{$cf['htmlvar_name']}): |
|
| 458 | - |
|
| 459 | - $value = ''; |
|
| 460 | - if ($post->{$cf['htmlvar_name']} != '') |
|
| 461 | - //$value = date('h:i',strtotime($post->{$cf['htmlvar_name']})); |
|
| 462 | - $value = date(get_option('time_format'), strtotime($post->{$cf['htmlvar_name']})); |
|
| 463 | - |
|
| 464 | - $field_icon = geodir_field_icon_proccess($cf); |
|
| 465 | - if (strpos($field_icon, 'http') !== false) { |
|
| 466 | - $field_icon_af = ''; |
|
| 467 | - } elseif ($field_icon == '') { |
|
| 468 | - $field_icon_af = '<i class="fa fa-clock-o"></i>'; |
|
| 469 | - } else { |
|
| 470 | - $field_icon_af = $field_icon; |
|
| 471 | - $field_icon = ''; |
|
| 472 | - } |
|
| 473 | - |
|
| 474 | - |
|
| 475 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-time" style="' . $field_icon . '">' . $field_icon_af; |
|
| 476 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ' '; |
|
| 477 | - $html .= '</span>' . $value . '</div>'; |
|
| 478 | - |
|
| 479 | - endif; |
|
| 480 | - |
|
| 481 | - } |
|
| 482 | - |
|
| 483 | - return $html; |
|
| 405 | + // check we have the post value |
|
| 406 | + if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 407 | + else{ global $post;} |
|
| 408 | + |
|
| 409 | + if(!is_array($cf) && $cf!=''){ |
|
| 410 | + $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 411 | + if(!$cf){return NULL;} |
|
| 412 | + } |
|
| 413 | + |
|
| 414 | + $html_var = $cf['htmlvar_name']; |
|
| 415 | + |
|
| 416 | + // Check if there is a location specific filter. |
|
| 417 | + if(has_filter("geodir_custom_field_output_time_loc_{$location}")){ |
|
| 418 | + /** |
|
| 419 | + * Filter the time html by location. |
|
| 420 | + * |
|
| 421 | + * @param string $html The html to filter. |
|
| 422 | + * @param array $cf The custom field array. |
|
| 423 | + * @since 1.6.6 |
|
| 424 | + */ |
|
| 425 | + $html = apply_filters("geodir_custom_field_output_time_loc_{$location}",$html,$cf); |
|
| 426 | + } |
|
| 427 | + |
|
| 428 | + // Check if there is a custom field specific filter. |
|
| 429 | + if(has_filter("geodir_custom_field_output_time_var_{$html_var}")){ |
|
| 430 | + /** |
|
| 431 | + * Filter the time html by individual custom field. |
|
| 432 | + * |
|
| 433 | + * @param string $html The html to filter. |
|
| 434 | + * @param string $location The location to output the html. |
|
| 435 | + * @param array $cf The custom field array. |
|
| 436 | + * @since 1.6.6 |
|
| 437 | + */ |
|
| 438 | + $html = apply_filters("geodir_custom_field_output_time_var_{$html_var}",$html,$location,$cf); |
|
| 439 | + } |
|
| 440 | + |
|
| 441 | + // Check if there is a custom field key specific filter. |
|
| 442 | + if(has_filter("geodir_custom_field_output_time_key_{$cf['field_type_key']}")){ |
|
| 443 | + /** |
|
| 444 | + * Filter the time html by field type key. |
|
| 445 | + * |
|
| 446 | + * @param string $html The html to filter. |
|
| 447 | + * @param string $location The location to output the html. |
|
| 448 | + * @param array $cf The custom field array. |
|
| 449 | + * @since 1.6.6 |
|
| 450 | + */ |
|
| 451 | + $html = apply_filters("geodir_custom_field_output_time_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 452 | + } |
|
| 453 | + |
|
| 454 | + // If not html then we run the standard output. |
|
| 455 | + if(empty($html)){ |
|
| 456 | + |
|
| 457 | + if ($post->{$cf['htmlvar_name']}): |
|
| 458 | + |
|
| 459 | + $value = ''; |
|
| 460 | + if ($post->{$cf['htmlvar_name']} != '') |
|
| 461 | + //$value = date('h:i',strtotime($post->{$cf['htmlvar_name']})); |
|
| 462 | + $value = date(get_option('time_format'), strtotime($post->{$cf['htmlvar_name']})); |
|
| 463 | + |
|
| 464 | + $field_icon = geodir_field_icon_proccess($cf); |
|
| 465 | + if (strpos($field_icon, 'http') !== false) { |
|
| 466 | + $field_icon_af = ''; |
|
| 467 | + } elseif ($field_icon == '') { |
|
| 468 | + $field_icon_af = '<i class="fa fa-clock-o"></i>'; |
|
| 469 | + } else { |
|
| 470 | + $field_icon_af = $field_icon; |
|
| 471 | + $field_icon = ''; |
|
| 472 | + } |
|
| 473 | + |
|
| 474 | + |
|
| 475 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-time" style="' . $field_icon . '">' . $field_icon_af; |
|
| 476 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ' '; |
|
| 477 | + $html .= '</span>' . $value . '</div>'; |
|
| 478 | + |
|
| 479 | + endif; |
|
| 480 | + |
|
| 481 | + } |
|
| 482 | + |
|
| 483 | + return $html; |
|
| 484 | 484 | } |
| 485 | 485 | add_filter('geodir_custom_field_output_time','geodir_cf_time',10,3); |
| 486 | 486 | |
@@ -496,111 +496,111 @@ discard block |
||
| 496 | 496 | * @return string The html to output for the custom field. |
| 497 | 497 | */ |
| 498 | 498 | function geodir_cf_datepicker($html,$location,$cf,$p=''){ |
| 499 | - global $preview; |
|
| 500 | - // check we have the post value |
|
| 501 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 502 | - else{ global $post;} |
|
| 503 | - |
|
| 504 | - if(!is_array($cf) && $cf!=''){ |
|
| 505 | - $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 506 | - if(!$cf){return NULL;} |
|
| 507 | - } |
|
| 508 | - |
|
| 509 | - $html_var = $cf['htmlvar_name']; |
|
| 510 | - |
|
| 511 | - // Check if there is a location specific filter. |
|
| 512 | - if(has_filter("geodir_custom_field_output_datepicker_loc_{$location}")){ |
|
| 513 | - /** |
|
| 514 | - * Filter the datepicker html by location. |
|
| 515 | - * |
|
| 516 | - * @param string $html The html to filter. |
|
| 517 | - * @param array $cf The custom field array. |
|
| 518 | - * @since 1.6.6 |
|
| 519 | - */ |
|
| 520 | - $html = apply_filters("geodir_custom_field_output_datepicker_loc_{$location}",$html,$cf); |
|
| 521 | - } |
|
| 522 | - |
|
| 523 | - // Check if there is a custom field specific filter. |
|
| 524 | - if(has_filter("geodir_custom_field_output_datepicker_var_{$html_var}")){ |
|
| 525 | - /** |
|
| 526 | - * Filter the datepicker html by individual custom field. |
|
| 527 | - * |
|
| 528 | - * @param string $html The html to filter. |
|
| 529 | - * @param string $location The location to output the html. |
|
| 530 | - * @param array $cf The custom field array. |
|
| 531 | - * @since 1.6.6 |
|
| 532 | - */ |
|
| 533 | - $html = apply_filters("geodir_custom_field_output_datepicker_var_{$html_var}",$html,$location,$cf); |
|
| 534 | - } |
|
| 535 | - |
|
| 536 | - // Check if there is a custom field key specific filter. |
|
| 537 | - if(has_filter("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}")){ |
|
| 538 | - /** |
|
| 539 | - * Filter the datepicker html by field type key. |
|
| 540 | - * |
|
| 541 | - * @param string $html The html to filter. |
|
| 542 | - * @param string $location The location to output the html. |
|
| 543 | - * @param array $cf The custom field array. |
|
| 544 | - * @since 1.6.6 |
|
| 545 | - */ |
|
| 546 | - $html = apply_filters("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 547 | - } |
|
| 548 | - |
|
| 549 | - // If not html then we run the standard output. |
|
| 550 | - if(empty($html)){ |
|
| 551 | - |
|
| 552 | - if ($post->{$cf['htmlvar_name']}): |
|
| 553 | - |
|
| 554 | - $date_format = geodir_default_date_format(); |
|
| 555 | - if ($cf['extra_fields'] != '') { |
|
| 556 | - $date_format = stripslashes_deep(unserialize($cf['extra_fields'])); |
|
| 557 | - $date_format = $date_format['date_format']; |
|
| 558 | - } |
|
| 559 | - // check if we need to change the format or not |
|
| 560 | - $date_format_len = strlen(str_replace(' ', '', $date_format)); |
|
| 561 | - if($date_format_len>5){// if greater then 4 then it's the old style format. |
|
| 562 | - |
|
| 563 | - $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format |
|
| 564 | - $replace = array('d','j','l','m','n','F','Y');//PHP date format |
|
| 565 | - |
|
| 566 | - $date_format = str_replace($search, $replace, $date_format); |
|
| 567 | - |
|
| 568 | - $post_htmlvar_value = ($date_format == 'd/m/Y' || $date_format == 'j/n/Y' ) ? str_replace('/', '-', $post->{$cf['htmlvar_name']}) : $post->{$cf['htmlvar_name']}; // PHP doesn't work well with dd/mm/yyyy format |
|
| 569 | - }else{ |
|
| 570 | - $post_htmlvar_value = $post->{$cf['htmlvar_name']}; |
|
| 571 | - } |
|
| 572 | - |
|
| 573 | - if ($post->{$cf['htmlvar_name']} != '' && $post->{$cf['htmlvar_name']}!="0000-00-00") { |
|
| 574 | - $date_format_from = $preview ? $date_format : 'Y-m-d'; |
|
| 575 | - $value = geodir_date($post_htmlvar_value, $date_format, $date_format_from); // save as sql format Y-m-d |
|
| 576 | - //$post_htmlvar_value = strpos($post_htmlvar_value, '/') !== false ? str_replace('/', '-', $post_htmlvar_value) : $post_htmlvar_value; |
|
| 577 | - //$value = date_i18n($date_format, strtotime($post_htmlvar_value)); |
|
| 578 | - }else{ |
|
| 579 | - return ''; |
|
| 580 | - } |
|
| 581 | - |
|
| 582 | - $field_icon = geodir_field_icon_proccess($cf); |
|
| 583 | - |
|
| 584 | - if (strpos($field_icon, 'http') !== false) { |
|
| 585 | - $field_icon_af = ''; |
|
| 586 | - } elseif ($field_icon == '') { |
|
| 587 | - $field_icon_af = '<i class="fa fa-calendar"></i>'; |
|
| 588 | - } else { |
|
| 589 | - $field_icon_af = $field_icon; |
|
| 590 | - $field_icon = ''; |
|
| 591 | - } |
|
| 592 | - |
|
| 593 | - |
|
| 594 | - |
|
| 595 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-datepicker" style="' . $field_icon . '">' . $field_icon_af; |
|
| 596 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 597 | - $html .= '</span>' . $value . '</div>'; |
|
| 598 | - |
|
| 599 | - endif; |
|
| 600 | - |
|
| 601 | - } |
|
| 602 | - |
|
| 603 | - return $html; |
|
| 499 | + global $preview; |
|
| 500 | + // check we have the post value |
|
| 501 | + if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 502 | + else{ global $post;} |
|
| 503 | + |
|
| 504 | + if(!is_array($cf) && $cf!=''){ |
|
| 505 | + $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 506 | + if(!$cf){return NULL;} |
|
| 507 | + } |
|
| 508 | + |
|
| 509 | + $html_var = $cf['htmlvar_name']; |
|
| 510 | + |
|
| 511 | + // Check if there is a location specific filter. |
|
| 512 | + if(has_filter("geodir_custom_field_output_datepicker_loc_{$location}")){ |
|
| 513 | + /** |
|
| 514 | + * Filter the datepicker html by location. |
|
| 515 | + * |
|
| 516 | + * @param string $html The html to filter. |
|
| 517 | + * @param array $cf The custom field array. |
|
| 518 | + * @since 1.6.6 |
|
| 519 | + */ |
|
| 520 | + $html = apply_filters("geodir_custom_field_output_datepicker_loc_{$location}",$html,$cf); |
|
| 521 | + } |
|
| 522 | + |
|
| 523 | + // Check if there is a custom field specific filter. |
|
| 524 | + if(has_filter("geodir_custom_field_output_datepicker_var_{$html_var}")){ |
|
| 525 | + /** |
|
| 526 | + * Filter the datepicker html by individual custom field. |
|
| 527 | + * |
|
| 528 | + * @param string $html The html to filter. |
|
| 529 | + * @param string $location The location to output the html. |
|
| 530 | + * @param array $cf The custom field array. |
|
| 531 | + * @since 1.6.6 |
|
| 532 | + */ |
|
| 533 | + $html = apply_filters("geodir_custom_field_output_datepicker_var_{$html_var}",$html,$location,$cf); |
|
| 534 | + } |
|
| 535 | + |
|
| 536 | + // Check if there is a custom field key specific filter. |
|
| 537 | + if(has_filter("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}")){ |
|
| 538 | + /** |
|
| 539 | + * Filter the datepicker html by field type key. |
|
| 540 | + * |
|
| 541 | + * @param string $html The html to filter. |
|
| 542 | + * @param string $location The location to output the html. |
|
| 543 | + * @param array $cf The custom field array. |
|
| 544 | + * @since 1.6.6 |
|
| 545 | + */ |
|
| 546 | + $html = apply_filters("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 547 | + } |
|
| 548 | + |
|
| 549 | + // If not html then we run the standard output. |
|
| 550 | + if(empty($html)){ |
|
| 551 | + |
|
| 552 | + if ($post->{$cf['htmlvar_name']}): |
|
| 553 | + |
|
| 554 | + $date_format = geodir_default_date_format(); |
|
| 555 | + if ($cf['extra_fields'] != '') { |
|
| 556 | + $date_format = stripslashes_deep(unserialize($cf['extra_fields'])); |
|
| 557 | + $date_format = $date_format['date_format']; |
|
| 558 | + } |
|
| 559 | + // check if we need to change the format or not |
|
| 560 | + $date_format_len = strlen(str_replace(' ', '', $date_format)); |
|
| 561 | + if($date_format_len>5){// if greater then 4 then it's the old style format. |
|
| 562 | + |
|
| 563 | + $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format |
|
| 564 | + $replace = array('d','j','l','m','n','F','Y');//PHP date format |
|
| 565 | + |
|
| 566 | + $date_format = str_replace($search, $replace, $date_format); |
|
| 567 | + |
|
| 568 | + $post_htmlvar_value = ($date_format == 'd/m/Y' || $date_format == 'j/n/Y' ) ? str_replace('/', '-', $post->{$cf['htmlvar_name']}) : $post->{$cf['htmlvar_name']}; // PHP doesn't work well with dd/mm/yyyy format |
|
| 569 | + }else{ |
|
| 570 | + $post_htmlvar_value = $post->{$cf['htmlvar_name']}; |
|
| 571 | + } |
|
| 572 | + |
|
| 573 | + if ($post->{$cf['htmlvar_name']} != '' && $post->{$cf['htmlvar_name']}!="0000-00-00") { |
|
| 574 | + $date_format_from = $preview ? $date_format : 'Y-m-d'; |
|
| 575 | + $value = geodir_date($post_htmlvar_value, $date_format, $date_format_from); // save as sql format Y-m-d |
|
| 576 | + //$post_htmlvar_value = strpos($post_htmlvar_value, '/') !== false ? str_replace('/', '-', $post_htmlvar_value) : $post_htmlvar_value; |
|
| 577 | + //$value = date_i18n($date_format, strtotime($post_htmlvar_value)); |
|
| 578 | + }else{ |
|
| 579 | + return ''; |
|
| 580 | + } |
|
| 581 | + |
|
| 582 | + $field_icon = geodir_field_icon_proccess($cf); |
|
| 583 | + |
|
| 584 | + if (strpos($field_icon, 'http') !== false) { |
|
| 585 | + $field_icon_af = ''; |
|
| 586 | + } elseif ($field_icon == '') { |
|
| 587 | + $field_icon_af = '<i class="fa fa-calendar"></i>'; |
|
| 588 | + } else { |
|
| 589 | + $field_icon_af = $field_icon; |
|
| 590 | + $field_icon = ''; |
|
| 591 | + } |
|
| 592 | + |
|
| 593 | + |
|
| 594 | + |
|
| 595 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-datepicker" style="' . $field_icon . '">' . $field_icon_af; |
|
| 596 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 597 | + $html .= '</span>' . $value . '</div>'; |
|
| 598 | + |
|
| 599 | + endif; |
|
| 600 | + |
|
| 601 | + } |
|
| 602 | + |
|
| 603 | + return $html; |
|
| 604 | 604 | } |
| 605 | 605 | add_filter('geodir_custom_field_output_datepicker','geodir_cf_datepicker',10,3); |
| 606 | 606 | |
@@ -617,97 +617,97 @@ discard block |
||
| 617 | 617 | */ |
| 618 | 618 | function geodir_cf_text($html,$location,$cf,$p=''){ |
| 619 | 619 | |
| 620 | - // check we have the post value |
|
| 621 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 622 | - else{ global $post;} |
|
| 623 | - |
|
| 624 | - if(!is_array($cf) && $cf!=''){ |
|
| 625 | - $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 626 | - if(!$cf){return NULL;} |
|
| 627 | - } |
|
| 628 | - |
|
| 629 | - $html_var = $cf['htmlvar_name']; |
|
| 630 | - |
|
| 631 | - // Check if there is a location specific filter. |
|
| 632 | - if(has_filter("geodir_custom_field_output_text_loc_{$location}")){ |
|
| 633 | - /** |
|
| 634 | - * Filter the text html by location. |
|
| 635 | - * |
|
| 636 | - * @param string $html The html to filter. |
|
| 637 | - * @param array $cf The custom field array. |
|
| 638 | - * @since 1.6.6 |
|
| 639 | - */ |
|
| 640 | - $html = apply_filters("geodir_custom_field_output_text_loc_{$location}",$html,$cf); |
|
| 641 | - } |
|
| 642 | - |
|
| 643 | - // Check if there is a custom field specific filter. |
|
| 644 | - if(has_filter("geodir_custom_field_output_text_var_{$html_var}")){ |
|
| 645 | - /** |
|
| 646 | - * Filter the text html by individual custom field. |
|
| 647 | - * |
|
| 648 | - * @param string $html The html to filter. |
|
| 649 | - * @param string $location The location to output the html. |
|
| 650 | - * @param array $cf The custom field array. |
|
| 651 | - * @since 1.6.6 |
|
| 652 | - */ |
|
| 653 | - $html = apply_filters("geodir_custom_field_output_text_var_{$html_var}",$html,$location,$cf); |
|
| 654 | - } |
|
| 655 | - |
|
| 656 | - // Check if there is a custom field key specific filter. |
|
| 657 | - if(has_filter("geodir_custom_field_output_text_key_{$cf['field_type_key']}")){ |
|
| 658 | - /** |
|
| 659 | - * Filter the text html by field type key. |
|
| 660 | - * |
|
| 661 | - * @param string $html The html to filter. |
|
| 662 | - * @param string $location The location to output the html. |
|
| 663 | - * @param array $cf The custom field array. |
|
| 664 | - * @since 1.6.6 |
|
| 665 | - */ |
|
| 666 | - $html = apply_filters("geodir_custom_field_output_text_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 667 | - } |
|
| 620 | + // check we have the post value |
|
| 621 | + if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 622 | + else{ global $post;} |
|
| 623 | + |
|
| 624 | + if(!is_array($cf) && $cf!=''){ |
|
| 625 | + $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 626 | + if(!$cf){return NULL;} |
|
| 627 | + } |
|
| 628 | + |
|
| 629 | + $html_var = $cf['htmlvar_name']; |
|
| 630 | + |
|
| 631 | + // Check if there is a location specific filter. |
|
| 632 | + if(has_filter("geodir_custom_field_output_text_loc_{$location}")){ |
|
| 633 | + /** |
|
| 634 | + * Filter the text html by location. |
|
| 635 | + * |
|
| 636 | + * @param string $html The html to filter. |
|
| 637 | + * @param array $cf The custom field array. |
|
| 638 | + * @since 1.6.6 |
|
| 639 | + */ |
|
| 640 | + $html = apply_filters("geodir_custom_field_output_text_loc_{$location}",$html,$cf); |
|
| 641 | + } |
|
| 642 | + |
|
| 643 | + // Check if there is a custom field specific filter. |
|
| 644 | + if(has_filter("geodir_custom_field_output_text_var_{$html_var}")){ |
|
| 645 | + /** |
|
| 646 | + * Filter the text html by individual custom field. |
|
| 647 | + * |
|
| 648 | + * @param string $html The html to filter. |
|
| 649 | + * @param string $location The location to output the html. |
|
| 650 | + * @param array $cf The custom field array. |
|
| 651 | + * @since 1.6.6 |
|
| 652 | + */ |
|
| 653 | + $html = apply_filters("geodir_custom_field_output_text_var_{$html_var}",$html,$location,$cf); |
|
| 654 | + } |
|
| 655 | + |
|
| 656 | + // Check if there is a custom field key specific filter. |
|
| 657 | + if(has_filter("geodir_custom_field_output_text_key_{$cf['field_type_key']}")){ |
|
| 658 | + /** |
|
| 659 | + * Filter the text html by field type key. |
|
| 660 | + * |
|
| 661 | + * @param string $html The html to filter. |
|
| 662 | + * @param string $location The location to output the html. |
|
| 663 | + * @param array $cf The custom field array. |
|
| 664 | + * @since 1.6.6 |
|
| 665 | + */ |
|
| 666 | + $html = apply_filters("geodir_custom_field_output_text_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 667 | + } |
|
| 668 | 668 | |
| 669 | 669 | |
| 670 | 670 | |
| 671 | - // If not html then we run the standard output. |
|
| 672 | - if(empty($html)){ |
|
| 671 | + // If not html then we run the standard output. |
|
| 672 | + if(empty($html)){ |
|
| 673 | 673 | |
| 674 | - if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != '' ): |
|
| 674 | + if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != '' ): |
|
| 675 | 675 | |
| 676 | - $class = ($cf['htmlvar_name'] == 'geodir_timing') ? "geodir-i-time" : "geodir-i-text"; |
|
| 676 | + $class = ($cf['htmlvar_name'] == 'geodir_timing') ? "geodir-i-time" : "geodir-i-text"; |
|
| 677 | 677 | |
| 678 | - $field_icon = geodir_field_icon_proccess($cf); |
|
| 679 | - if (strpos($field_icon, 'http') !== false) { |
|
| 680 | - $field_icon_af = ''; |
|
| 681 | - } elseif ($field_icon == '') { |
|
| 682 | - $field_icon_af = ($cf['htmlvar_name'] == 'geodir_timing') ? '<i class="fa fa-clock-o"></i>' : ""; |
|
| 683 | - } else { |
|
| 684 | - $field_icon_af = $field_icon; |
|
| 685 | - $field_icon = ''; |
|
| 686 | - } |
|
| 678 | + $field_icon = geodir_field_icon_proccess($cf); |
|
| 679 | + if (strpos($field_icon, 'http') !== false) { |
|
| 680 | + $field_icon_af = ''; |
|
| 681 | + } elseif ($field_icon == '') { |
|
| 682 | + $field_icon_af = ($cf['htmlvar_name'] == 'geodir_timing') ? '<i class="fa fa-clock-o"></i>' : ""; |
|
| 683 | + } else { |
|
| 684 | + $field_icon_af = $field_icon; |
|
| 685 | + $field_icon = ''; |
|
| 686 | + } |
|
| 687 | 687 | |
| 688 | 688 | |
| 689 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="'.$class.'" style="' . $field_icon . '">' . $field_icon_af; |
|
| 690 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 691 | - $html .= '</span>'; |
|
| 689 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="'.$class.'" style="' . $field_icon . '">' . $field_icon_af; |
|
| 690 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 691 | + $html .= '</span>'; |
|
| 692 | 692 | |
| 693 | - $value = $post->{$cf['htmlvar_name']}; |
|
| 694 | - if(isset($cf['data_type']) && ($cf['data_type']=='INT' || $cf['data_type']=='FLOAT') && isset($cf['extra_fields']) && $cf['extra_fields']){ |
|
| 695 | - $extra_fields = stripslashes_deep(maybe_unserialize($cf['extra_fields'])); |
|
| 696 | - if(isset($extra_fields['is_price']) && $extra_fields['is_price']){ |
|
| 697 | - if(!$value>0){return '';}// dont output blank prices |
|
| 698 | - $value = geodir_currency_format_number($value,$cf); |
|
| 699 | - } |
|
| 700 | - } |
|
| 693 | + $value = $post->{$cf['htmlvar_name']}; |
|
| 694 | + if(isset($cf['data_type']) && ($cf['data_type']=='INT' || $cf['data_type']=='FLOAT') && isset($cf['extra_fields']) && $cf['extra_fields']){ |
|
| 695 | + $extra_fields = stripslashes_deep(maybe_unserialize($cf['extra_fields'])); |
|
| 696 | + if(isset($extra_fields['is_price']) && $extra_fields['is_price']){ |
|
| 697 | + if(!$value>0){return '';}// dont output blank prices |
|
| 698 | + $value = geodir_currency_format_number($value,$cf); |
|
| 699 | + } |
|
| 700 | + } |
|
| 701 | 701 | |
| 702 | 702 | |
| 703 | - $html .= $value; |
|
| 704 | - $html .= '</div>'; |
|
| 703 | + $html .= $value; |
|
| 704 | + $html .= '</div>'; |
|
| 705 | 705 | |
| 706 | - endif; |
|
| 706 | + endif; |
|
| 707 | 707 | |
| 708 | - } |
|
| 708 | + } |
|
| 709 | 709 | |
| 710 | - return $html; |
|
| 710 | + return $html; |
|
| 711 | 711 | } |
| 712 | 712 | add_filter('geodir_custom_field_output_text','geodir_cf_text',10,3); |
| 713 | 713 | |
@@ -724,98 +724,98 @@ discard block |
||
| 724 | 724 | */ |
| 725 | 725 | function geodir_cf_radio($html,$location,$cf,$p=''){ |
| 726 | 726 | |
| 727 | - // check we have the post value |
|
| 728 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 729 | - else{ global $post;} |
|
| 730 | - |
|
| 731 | - if(!is_array($cf) && $cf!=''){ |
|
| 732 | - $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 733 | - if(!$cf){return NULL;} |
|
| 734 | - } |
|
| 735 | - |
|
| 736 | - $html_var = $cf['htmlvar_name']; |
|
| 737 | - |
|
| 738 | - // Check if there is a location specific filter. |
|
| 739 | - if(has_filter("geodir_custom_field_output_radio_loc_{$location}")){ |
|
| 740 | - /** |
|
| 741 | - * Filter the radio html by location. |
|
| 742 | - * |
|
| 743 | - * @param string $html The html to filter. |
|
| 744 | - * @param array $cf The custom field array. |
|
| 745 | - * @since 1.6.6 |
|
| 746 | - */ |
|
| 747 | - $html = apply_filters("geodir_custom_field_output_radio_loc_{$location}",$html,$cf); |
|
| 748 | - } |
|
| 749 | - |
|
| 750 | - // Check if there is a custom field specific filter. |
|
| 751 | - if(has_filter("geodir_custom_field_output_radio_var_{$html_var}")){ |
|
| 752 | - /** |
|
| 753 | - * Filter the radio html by individual custom field. |
|
| 754 | - * |
|
| 755 | - * @param string $html The html to filter. |
|
| 756 | - * @param string $location The location to output the html. |
|
| 757 | - * @param array $cf The custom field array. |
|
| 758 | - * @since 1.6.6 |
|
| 759 | - */ |
|
| 760 | - $html = apply_filters("geodir_custom_field_output_radio_var_{$html_var}",$html,$location,$cf); |
|
| 761 | - } |
|
| 762 | - |
|
| 763 | - // Check if there is a custom field key specific filter. |
|
| 764 | - if(has_filter("geodir_custom_field_output_radio_key_{$cf['field_type_key']}")){ |
|
| 765 | - /** |
|
| 766 | - * Filter the radio html by field type key. |
|
| 767 | - * |
|
| 768 | - * @param string $html The html to filter. |
|
| 769 | - * @param string $location The location to output the html. |
|
| 770 | - * @param array $cf The custom field array. |
|
| 771 | - * @since 1.6.6 |
|
| 772 | - */ |
|
| 773 | - $html = apply_filters("geodir_custom_field_output_radio_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 774 | - } |
|
| 775 | - |
|
| 776 | - // If not html then we run the standard output. |
|
| 777 | - if(empty($html)){ |
|
| 778 | - |
|
| 779 | - $html_val = isset($post->{$cf['htmlvar_name']}) ? __($post->{$cf['htmlvar_name']}, 'geodirectory') : ''; |
|
| 780 | - if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != ''): |
|
| 781 | - |
|
| 782 | - if ($post->{$cf['htmlvar_name']} == 'f' || $post->{$cf['htmlvar_name']} == '0') { |
|
| 783 | - $html_val = __('No', 'geodirectory'); |
|
| 784 | - } else if ($post->{$cf['htmlvar_name']} == 't' || $post->{$cf['htmlvar_name']} == '1') { |
|
| 785 | - $html_val = __('Yes', 'geodirectory'); |
|
| 786 | - } else { |
|
| 787 | - if (!empty($cf['option_values'])) { |
|
| 788 | - $cf_option_values = geodir_string_values_to_options(stripslashes_deep($cf['option_values']), true); |
|
| 789 | - |
|
| 790 | - if (!empty($cf_option_values)) { |
|
| 791 | - foreach ($cf_option_values as $cf_option_value) { |
|
| 792 | - if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->{$cf['htmlvar_name']}) { |
|
| 793 | - $html_val = $cf_option_value['label']; |
|
| 794 | - } |
|
| 795 | - } |
|
| 796 | - } |
|
| 797 | - } |
|
| 798 | - } |
|
| 799 | - |
|
| 800 | - $field_icon = geodir_field_icon_proccess($cf); |
|
| 801 | - if (strpos($field_icon, 'http') !== false) { |
|
| 802 | - $field_icon_af = ''; |
|
| 803 | - } elseif ($field_icon == '') { |
|
| 804 | - $field_icon_af = ''; |
|
| 805 | - } else { |
|
| 806 | - $field_icon_af = $field_icon; |
|
| 807 | - $field_icon = ''; |
|
| 808 | - } |
|
| 809 | - |
|
| 810 | - |
|
| 811 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-radio" style="' . $field_icon . '">' . $field_icon_af; |
|
| 812 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 813 | - $html .= '</span>' . $html_val . '</div>'; |
|
| 814 | - endif; |
|
| 815 | - |
|
| 816 | - } |
|
| 817 | - |
|
| 818 | - return $html; |
|
| 727 | + // check we have the post value |
|
| 728 | + if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 729 | + else{ global $post;} |
|
| 730 | + |
|
| 731 | + if(!is_array($cf) && $cf!=''){ |
|
| 732 | + $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 733 | + if(!$cf){return NULL;} |
|
| 734 | + } |
|
| 735 | + |
|
| 736 | + $html_var = $cf['htmlvar_name']; |
|
| 737 | + |
|
| 738 | + // Check if there is a location specific filter. |
|
| 739 | + if(has_filter("geodir_custom_field_output_radio_loc_{$location}")){ |
|
| 740 | + /** |
|
| 741 | + * Filter the radio html by location. |
|
| 742 | + * |
|
| 743 | + * @param string $html The html to filter. |
|
| 744 | + * @param array $cf The custom field array. |
|
| 745 | + * @since 1.6.6 |
|
| 746 | + */ |
|
| 747 | + $html = apply_filters("geodir_custom_field_output_radio_loc_{$location}",$html,$cf); |
|
| 748 | + } |
|
| 749 | + |
|
| 750 | + // Check if there is a custom field specific filter. |
|
| 751 | + if(has_filter("geodir_custom_field_output_radio_var_{$html_var}")){ |
|
| 752 | + /** |
|
| 753 | + * Filter the radio html by individual custom field. |
|
| 754 | + * |
|
| 755 | + * @param string $html The html to filter. |
|
| 756 | + * @param string $location The location to output the html. |
|
| 757 | + * @param array $cf The custom field array. |
|
| 758 | + * @since 1.6.6 |
|
| 759 | + */ |
|
| 760 | + $html = apply_filters("geodir_custom_field_output_radio_var_{$html_var}",$html,$location,$cf); |
|
| 761 | + } |
|
| 762 | + |
|
| 763 | + // Check if there is a custom field key specific filter. |
|
| 764 | + if(has_filter("geodir_custom_field_output_radio_key_{$cf['field_type_key']}")){ |
|
| 765 | + /** |
|
| 766 | + * Filter the radio html by field type key. |
|
| 767 | + * |
|
| 768 | + * @param string $html The html to filter. |
|
| 769 | + * @param string $location The location to output the html. |
|
| 770 | + * @param array $cf The custom field array. |
|
| 771 | + * @since 1.6.6 |
|
| 772 | + */ |
|
| 773 | + $html = apply_filters("geodir_custom_field_output_radio_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 774 | + } |
|
| 775 | + |
|
| 776 | + // If not html then we run the standard output. |
|
| 777 | + if(empty($html)){ |
|
| 778 | + |
|
| 779 | + $html_val = isset($post->{$cf['htmlvar_name']}) ? __($post->{$cf['htmlvar_name']}, 'geodirectory') : ''; |
|
| 780 | + if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != ''): |
|
| 781 | + |
|
| 782 | + if ($post->{$cf['htmlvar_name']} == 'f' || $post->{$cf['htmlvar_name']} == '0') { |
|
| 783 | + $html_val = __('No', 'geodirectory'); |
|
| 784 | + } else if ($post->{$cf['htmlvar_name']} == 't' || $post->{$cf['htmlvar_name']} == '1') { |
|
| 785 | + $html_val = __('Yes', 'geodirectory'); |
|
| 786 | + } else { |
|
| 787 | + if (!empty($cf['option_values'])) { |
|
| 788 | + $cf_option_values = geodir_string_values_to_options(stripslashes_deep($cf['option_values']), true); |
|
| 789 | + |
|
| 790 | + if (!empty($cf_option_values)) { |
|
| 791 | + foreach ($cf_option_values as $cf_option_value) { |
|
| 792 | + if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->{$cf['htmlvar_name']}) { |
|
| 793 | + $html_val = $cf_option_value['label']; |
|
| 794 | + } |
|
| 795 | + } |
|
| 796 | + } |
|
| 797 | + } |
|
| 798 | + } |
|
| 799 | + |
|
| 800 | + $field_icon = geodir_field_icon_proccess($cf); |
|
| 801 | + if (strpos($field_icon, 'http') !== false) { |
|
| 802 | + $field_icon_af = ''; |
|
| 803 | + } elseif ($field_icon == '') { |
|
| 804 | + $field_icon_af = ''; |
|
| 805 | + } else { |
|
| 806 | + $field_icon_af = $field_icon; |
|
| 807 | + $field_icon = ''; |
|
| 808 | + } |
|
| 809 | + |
|
| 810 | + |
|
| 811 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-radio" style="' . $field_icon . '">' . $field_icon_af; |
|
| 812 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 813 | + $html .= '</span>' . $html_val . '</div>'; |
|
| 814 | + endif; |
|
| 815 | + |
|
| 816 | + } |
|
| 817 | + |
|
| 818 | + return $html; |
|
| 819 | 819 | } |
| 820 | 820 | add_filter('geodir_custom_field_output_radio','geodir_cf_radio',10,3); |
| 821 | 821 | |
@@ -832,92 +832,92 @@ discard block |
||
| 832 | 832 | */ |
| 833 | 833 | function geodir_cf_select($html,$location,$cf,$p=''){ |
| 834 | 834 | |
| 835 | - // check we have the post value |
|
| 836 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 837 | - else{ global $post;} |
|
| 838 | - |
|
| 839 | - if(!is_array($cf) && $cf!=''){ |
|
| 840 | - $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 841 | - if(!$cf){return NULL;} |
|
| 842 | - } |
|
| 843 | - |
|
| 844 | - $html_var = $cf['htmlvar_name']; |
|
| 845 | - |
|
| 846 | - // Check if there is a location specific filter. |
|
| 847 | - if(has_filter("geodir_custom_field_output_select_loc_{$location}")){ |
|
| 848 | - /** |
|
| 849 | - * Filter the select html by location. |
|
| 850 | - * |
|
| 851 | - * @param string $html The html to filter. |
|
| 852 | - * @param array $cf The custom field array. |
|
| 853 | - * @since 1.6.6 |
|
| 854 | - */ |
|
| 855 | - $html = apply_filters("geodir_custom_field_output_select_loc_{$location}",$html,$cf); |
|
| 856 | - } |
|
| 857 | - |
|
| 858 | - // Check if there is a custom field specific filter. |
|
| 859 | - if(has_filter("geodir_custom_field_output_select_var_{$html_var}")){ |
|
| 860 | - /** |
|
| 861 | - * Filter the select html by individual custom field. |
|
| 862 | - * |
|
| 863 | - * @param string $html The html to filter. |
|
| 864 | - * @param string $location The location to output the html. |
|
| 865 | - * @param array $cf The custom field array. |
|
| 866 | - * @since 1.6.6 |
|
| 867 | - */ |
|
| 868 | - $html = apply_filters("geodir_custom_field_output_select_var_{$html_var}",$html,$location,$cf); |
|
| 869 | - } |
|
| 870 | - |
|
| 871 | - // Check if there is a custom field key specific filter. |
|
| 872 | - if(has_filter("geodir_custom_field_output_select_key_{$cf['field_type_key']}")){ |
|
| 873 | - /** |
|
| 874 | - * Filter the select html by field type key. |
|
| 875 | - * |
|
| 876 | - * @param string $html The html to filter. |
|
| 877 | - * @param string $location The location to output the html. |
|
| 878 | - * @param array $cf The custom field array. |
|
| 879 | - * @since 1.6.6 |
|
| 880 | - */ |
|
| 881 | - $html = apply_filters("geodir_custom_field_output_select_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 882 | - } |
|
| 883 | - |
|
| 884 | - // If not html then we run the standard output. |
|
| 885 | - if(empty($html)){ |
|
| 886 | - |
|
| 887 | - if ($post->{$cf['htmlvar_name']}): |
|
| 888 | - $field_value = __($post->{$cf['htmlvar_name']}, 'geodirectory'); |
|
| 889 | - |
|
| 890 | - if (!empty($cf['option_values'])) { |
|
| 891 | - $cf_option_values = geodir_string_values_to_options(stripslashes_deep($cf['option_values']), true); |
|
| 892 | - |
|
| 893 | - if (!empty($cf_option_values)) { |
|
| 894 | - foreach ($cf_option_values as $cf_option_value) { |
|
| 895 | - if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->{$cf['htmlvar_name']}) { |
|
| 896 | - //$field_value = $cf_option_value['label']; // no longer needed here. |
|
| 897 | - } |
|
| 898 | - } |
|
| 899 | - } |
|
| 900 | - } |
|
| 901 | - |
|
| 902 | - $field_icon = geodir_field_icon_proccess($cf); |
|
| 903 | - if (strpos($field_icon, 'http') !== false) { |
|
| 904 | - $field_icon_af = ''; |
|
| 905 | - } elseif ($field_icon == '') { |
|
| 906 | - $field_icon_af = ''; |
|
| 907 | - } else { |
|
| 908 | - $field_icon_af = $field_icon; |
|
| 909 | - $field_icon = ''; |
|
| 910 | - } |
|
| 911 | - |
|
| 912 | - |
|
| 913 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af; |
|
| 914 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 915 | - $html .= '</span>' . $field_value . '</div>'; |
|
| 916 | - endif; |
|
| 917 | - |
|
| 918 | - } |
|
| 919 | - |
|
| 920 | - return $html; |
|
| 835 | + // check we have the post value |
|
| 836 | + if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 837 | + else{ global $post;} |
|
| 838 | + |
|
| 839 | + if(!is_array($cf) && $cf!=''){ |
|
| 840 | + $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 841 | + if(!$cf){return NULL;} |
|
| 842 | + } |
|
| 843 | + |
|
| 844 | + $html_var = $cf['htmlvar_name']; |
|
| 845 | + |
|
| 846 | + // Check if there is a location specific filter. |
|
| 847 | + if(has_filter("geodir_custom_field_output_select_loc_{$location}")){ |
|
| 848 | + /** |
|
| 849 | + * Filter the select html by location. |
|
| 850 | + * |
|
| 851 | + * @param string $html The html to filter. |
|
| 852 | + * @param array $cf The custom field array. |
|
| 853 | + * @since 1.6.6 |
|
| 854 | + */ |
|
| 855 | + $html = apply_filters("geodir_custom_field_output_select_loc_{$location}",$html,$cf); |
|
| 856 | + } |
|
| 857 | + |
|
| 858 | + // Check if there is a custom field specific filter. |
|
| 859 | + if(has_filter("geodir_custom_field_output_select_var_{$html_var}")){ |
|
| 860 | + /** |
|
| 861 | + * Filter the select html by individual custom field. |
|
| 862 | + * |
|
| 863 | + * @param string $html The html to filter. |
|
| 864 | + * @param string $location The location to output the html. |
|
| 865 | + * @param array $cf The custom field array. |
|
| 866 | + * @since 1.6.6 |
|
| 867 | + */ |
|
| 868 | + $html = apply_filters("geodir_custom_field_output_select_var_{$html_var}",$html,$location,$cf); |
|
| 869 | + } |
|
| 870 | + |
|
| 871 | + // Check if there is a custom field key specific filter. |
|
| 872 | + if(has_filter("geodir_custom_field_output_select_key_{$cf['field_type_key']}")){ |
|
| 873 | + /** |
|
| 874 | + * Filter the select html by field type key. |
|
| 875 | + * |
|
| 876 | + * @param string $html The html to filter. |
|
| 877 | + * @param string $location The location to output the html. |
|
| 878 | + * @param array $cf The custom field array. |
|
| 879 | + * @since 1.6.6 |
|
| 880 | + */ |
|
| 881 | + $html = apply_filters("geodir_custom_field_output_select_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 882 | + } |
|
| 883 | + |
|
| 884 | + // If not html then we run the standard output. |
|
| 885 | + if(empty($html)){ |
|
| 886 | + |
|
| 887 | + if ($post->{$cf['htmlvar_name']}): |
|
| 888 | + $field_value = __($post->{$cf['htmlvar_name']}, 'geodirectory'); |
|
| 889 | + |
|
| 890 | + if (!empty($cf['option_values'])) { |
|
| 891 | + $cf_option_values = geodir_string_values_to_options(stripslashes_deep($cf['option_values']), true); |
|
| 892 | + |
|
| 893 | + if (!empty($cf_option_values)) { |
|
| 894 | + foreach ($cf_option_values as $cf_option_value) { |
|
| 895 | + if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->{$cf['htmlvar_name']}) { |
|
| 896 | + //$field_value = $cf_option_value['label']; // no longer needed here. |
|
| 897 | + } |
|
| 898 | + } |
|
| 899 | + } |
|
| 900 | + } |
|
| 901 | + |
|
| 902 | + $field_icon = geodir_field_icon_proccess($cf); |
|
| 903 | + if (strpos($field_icon, 'http') !== false) { |
|
| 904 | + $field_icon_af = ''; |
|
| 905 | + } elseif ($field_icon == '') { |
|
| 906 | + $field_icon_af = ''; |
|
| 907 | + } else { |
|
| 908 | + $field_icon_af = $field_icon; |
|
| 909 | + $field_icon = ''; |
|
| 910 | + } |
|
| 911 | + |
|
| 912 | + |
|
| 913 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af; |
|
| 914 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 915 | + $html .= '</span>' . $field_value . '</div>'; |
|
| 916 | + endif; |
|
| 917 | + |
|
| 918 | + } |
|
| 919 | + |
|
| 920 | + return $html; |
|
| 921 | 921 | } |
| 922 | 922 | add_filter('geodir_custom_field_output_select','geodir_cf_select',10,3); |
| 923 | 923 | |
@@ -934,117 +934,117 @@ discard block |
||
| 934 | 934 | */ |
| 935 | 935 | function geodir_cf_multiselect($html,$location,$cf,$p=''){ |
| 936 | 936 | |
| 937 | - // check we have the post value |
|
| 938 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 939 | - else{ global $post;} |
|
| 940 | - |
|
| 941 | - if(!is_array($cf) && $cf!=''){ |
|
| 942 | - $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 943 | - if(!$cf){return NULL;} |
|
| 944 | - } |
|
| 945 | - |
|
| 946 | - $html_var = $cf['htmlvar_name']; |
|
| 947 | - |
|
| 948 | - // Check if there is a location specific filter. |
|
| 949 | - if(has_filter("geodir_custom_field_output_multiselect_loc_{$location}")){ |
|
| 950 | - /** |
|
| 951 | - * Filter the multiselect html by location. |
|
| 952 | - * |
|
| 953 | - * @param string $html The html to filter. |
|
| 954 | - * @param array $cf The custom field array. |
|
| 955 | - * @since 1.6.6 |
|
| 956 | - */ |
|
| 957 | - $html = apply_filters("geodir_custom_field_output_multiselect_loc_{$location}",$html,$cf); |
|
| 958 | - } |
|
| 959 | - |
|
| 960 | - // Check if there is a custom field specific filter. |
|
| 961 | - if(has_filter("geodir_custom_field_output_multiselect_var_{$html_var}")){ |
|
| 962 | - /** |
|
| 963 | - * Filter the multiselect html by individual custom field. |
|
| 964 | - * |
|
| 965 | - * @param string $html The html to filter. |
|
| 966 | - * @param string $location The location to output the html. |
|
| 967 | - * @param array $cf The custom field array. |
|
| 968 | - * @since 1.6.6 |
|
| 969 | - */ |
|
| 970 | - $html = apply_filters("geodir_custom_field_output_multiselect_var_{$html_var}",$html,$location,$cf); |
|
| 971 | - } |
|
| 972 | - |
|
| 973 | - // Check if there is a custom field key specific filter. |
|
| 974 | - if(has_filter("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}")){ |
|
| 975 | - /** |
|
| 976 | - * Filter the multiselect html by field type key. |
|
| 977 | - * |
|
| 978 | - * @param string $html The html to filter. |
|
| 979 | - * @param string $location The location to output the html. |
|
| 980 | - * @param array $cf The custom field array. |
|
| 981 | - * @since 1.6.6 |
|
| 982 | - */ |
|
| 983 | - $html = apply_filters("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 984 | - } |
|
| 985 | - |
|
| 986 | - // If not html then we run the standard output. |
|
| 987 | - if(empty($html)){ |
|
| 988 | - |
|
| 989 | - |
|
| 990 | - if (!empty($post->{$cf['htmlvar_name']})): |
|
| 991 | - |
|
| 992 | - if (is_array($post->{$cf['htmlvar_name']})) { |
|
| 993 | - $post->{$cf['htmlvar_name']} = implode(', ', $post->{$cf['htmlvar_name']}); |
|
| 994 | - } |
|
| 995 | - |
|
| 996 | - $field_icon = geodir_field_icon_proccess($cf); |
|
| 997 | - if (strpos($field_icon, 'http') !== false) { |
|
| 998 | - $field_icon_af = ''; |
|
| 999 | - } elseif ($field_icon == '') { |
|
| 1000 | - $field_icon_af = ''; |
|
| 1001 | - } else { |
|
| 1002 | - $field_icon_af = $field_icon; |
|
| 1003 | - $field_icon = ''; |
|
| 1004 | - } |
|
| 1005 | - |
|
| 1006 | - $field_values = explode(',', trim($post->{$cf['htmlvar_name']}, ",")); |
|
| 1007 | - |
|
| 1008 | - if(is_array($field_values)){ |
|
| 1009 | - $field_values = array_map('trim', $field_values); |
|
| 1010 | - } |
|
| 1011 | - |
|
| 1012 | - $option_values = array(); |
|
| 1013 | - if (!empty($cf['option_values'])) { |
|
| 1014 | - $cf_option_values = geodir_string_values_to_options(stripslashes_deep($cf['option_values']), true); |
|
| 1015 | - |
|
| 1016 | - if (!empty($cf_option_values)) { |
|
| 1017 | - foreach ($cf_option_values as $cf_option_value) { |
|
| 1018 | - if (isset($cf_option_value['value']) && in_array($cf_option_value['value'], $field_values)) { |
|
| 1019 | - $option_values[] = $cf_option_value['label']; |
|
| 1020 | - } |
|
| 1021 | - } |
|
| 1022 | - } |
|
| 1023 | - } |
|
| 1024 | - |
|
| 1025 | - |
|
| 1026 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af; |
|
| 1027 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 1028 | - $html .= '</span>'; |
|
| 1029 | - |
|
| 1030 | - if (count($option_values) > 1) { |
|
| 1031 | - $html .= '<ul>'; |
|
| 1032 | - |
|
| 1033 | - foreach ($option_values as $val) { |
|
| 1034 | - $html .= '<li>' . $val . '</li>'; |
|
| 1035 | - } |
|
| 1036 | - |
|
| 1037 | - $html .= '</ul>'; |
|
| 1038 | - } else { |
|
| 1039 | - $html .= $post->{$cf['htmlvar_name']}; |
|
| 1040 | - } |
|
| 1041 | - |
|
| 1042 | - $html .= '</div>'; |
|
| 1043 | - endif; |
|
| 1044 | - |
|
| 1045 | - } |
|
| 1046 | - |
|
| 1047 | - return $html; |
|
| 937 | + // check we have the post value |
|
| 938 | + if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 939 | + else{ global $post;} |
|
| 940 | + |
|
| 941 | + if(!is_array($cf) && $cf!=''){ |
|
| 942 | + $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 943 | + if(!$cf){return NULL;} |
|
| 944 | + } |
|
| 945 | + |
|
| 946 | + $html_var = $cf['htmlvar_name']; |
|
| 947 | + |
|
| 948 | + // Check if there is a location specific filter. |
|
| 949 | + if(has_filter("geodir_custom_field_output_multiselect_loc_{$location}")){ |
|
| 950 | + /** |
|
| 951 | + * Filter the multiselect html by location. |
|
| 952 | + * |
|
| 953 | + * @param string $html The html to filter. |
|
| 954 | + * @param array $cf The custom field array. |
|
| 955 | + * @since 1.6.6 |
|
| 956 | + */ |
|
| 957 | + $html = apply_filters("geodir_custom_field_output_multiselect_loc_{$location}",$html,$cf); |
|
| 958 | + } |
|
| 959 | + |
|
| 960 | + // Check if there is a custom field specific filter. |
|
| 961 | + if(has_filter("geodir_custom_field_output_multiselect_var_{$html_var}")){ |
|
| 962 | + /** |
|
| 963 | + * Filter the multiselect html by individual custom field. |
|
| 964 | + * |
|
| 965 | + * @param string $html The html to filter. |
|
| 966 | + * @param string $location The location to output the html. |
|
| 967 | + * @param array $cf The custom field array. |
|
| 968 | + * @since 1.6.6 |
|
| 969 | + */ |
|
| 970 | + $html = apply_filters("geodir_custom_field_output_multiselect_var_{$html_var}",$html,$location,$cf); |
|
| 971 | + } |
|
| 972 | + |
|
| 973 | + // Check if there is a custom field key specific filter. |
|
| 974 | + if(has_filter("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}")){ |
|
| 975 | + /** |
|
| 976 | + * Filter the multiselect html by field type key. |
|
| 977 | + * |
|
| 978 | + * @param string $html The html to filter. |
|
| 979 | + * @param string $location The location to output the html. |
|
| 980 | + * @param array $cf The custom field array. |
|
| 981 | + * @since 1.6.6 |
|
| 982 | + */ |
|
| 983 | + $html = apply_filters("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 984 | + } |
|
| 985 | + |
|
| 986 | + // If not html then we run the standard output. |
|
| 987 | + if(empty($html)){ |
|
| 988 | + |
|
| 989 | + |
|
| 990 | + if (!empty($post->{$cf['htmlvar_name']})): |
|
| 991 | + |
|
| 992 | + if (is_array($post->{$cf['htmlvar_name']})) { |
|
| 993 | + $post->{$cf['htmlvar_name']} = implode(', ', $post->{$cf['htmlvar_name']}); |
|
| 994 | + } |
|
| 995 | + |
|
| 996 | + $field_icon = geodir_field_icon_proccess($cf); |
|
| 997 | + if (strpos($field_icon, 'http') !== false) { |
|
| 998 | + $field_icon_af = ''; |
|
| 999 | + } elseif ($field_icon == '') { |
|
| 1000 | + $field_icon_af = ''; |
|
| 1001 | + } else { |
|
| 1002 | + $field_icon_af = $field_icon; |
|
| 1003 | + $field_icon = ''; |
|
| 1004 | + } |
|
| 1005 | + |
|
| 1006 | + $field_values = explode(',', trim($post->{$cf['htmlvar_name']}, ",")); |
|
| 1007 | + |
|
| 1008 | + if(is_array($field_values)){ |
|
| 1009 | + $field_values = array_map('trim', $field_values); |
|
| 1010 | + } |
|
| 1011 | + |
|
| 1012 | + $option_values = array(); |
|
| 1013 | + if (!empty($cf['option_values'])) { |
|
| 1014 | + $cf_option_values = geodir_string_values_to_options(stripslashes_deep($cf['option_values']), true); |
|
| 1015 | + |
|
| 1016 | + if (!empty($cf_option_values)) { |
|
| 1017 | + foreach ($cf_option_values as $cf_option_value) { |
|
| 1018 | + if (isset($cf_option_value['value']) && in_array($cf_option_value['value'], $field_values)) { |
|
| 1019 | + $option_values[] = $cf_option_value['label']; |
|
| 1020 | + } |
|
| 1021 | + } |
|
| 1022 | + } |
|
| 1023 | + } |
|
| 1024 | + |
|
| 1025 | + |
|
| 1026 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af; |
|
| 1027 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 1028 | + $html .= '</span>'; |
|
| 1029 | + |
|
| 1030 | + if (count($option_values) > 1) { |
|
| 1031 | + $html .= '<ul>'; |
|
| 1032 | + |
|
| 1033 | + foreach ($option_values as $val) { |
|
| 1034 | + $html .= '<li>' . $val . '</li>'; |
|
| 1035 | + } |
|
| 1036 | + |
|
| 1037 | + $html .= '</ul>'; |
|
| 1038 | + } else { |
|
| 1039 | + $html .= $post->{$cf['htmlvar_name']}; |
|
| 1040 | + } |
|
| 1041 | + |
|
| 1042 | + $html .= '</div>'; |
|
| 1043 | + endif; |
|
| 1044 | + |
|
| 1045 | + } |
|
| 1046 | + |
|
| 1047 | + return $html; |
|
| 1048 | 1048 | } |
| 1049 | 1049 | add_filter('geodir_custom_field_output_multiselect','geodir_cf_multiselect',10,3); |
| 1050 | 1050 | |
@@ -1061,153 +1061,153 @@ discard block |
||
| 1061 | 1061 | */ |
| 1062 | 1062 | function geodir_cf_email($html,$location,$cf,$p=''){ |
| 1063 | 1063 | |
| 1064 | - // check we have the post value |
|
| 1065 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 1066 | - else{ global $post;} |
|
| 1067 | - |
|
| 1068 | - if(!is_array($cf) && $cf!=''){ |
|
| 1069 | - $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 1070 | - if(!$cf){return NULL;} |
|
| 1071 | - } |
|
| 1072 | - |
|
| 1073 | - $html_var = $cf['htmlvar_name']; |
|
| 1074 | - |
|
| 1075 | - // Check if there is a location specific filter. |
|
| 1076 | - if(has_filter("geodir_custom_field_output_email_loc_{$location}")){ |
|
| 1077 | - /** |
|
| 1078 | - * Filter the email html by location. |
|
| 1079 | - * |
|
| 1080 | - * @param string $html The html to filter. |
|
| 1081 | - * @param array $cf The custom field array. |
|
| 1082 | - * @since 1.6.6 |
|
| 1083 | - */ |
|
| 1084 | - $html = apply_filters("geodir_custom_field_output_email_loc_{$location}",$html,$cf); |
|
| 1085 | - } |
|
| 1086 | - |
|
| 1087 | - // Check if there is a custom field specific filter. |
|
| 1088 | - if(has_filter("geodir_custom_field_output_email_var_{$html_var}")){ |
|
| 1089 | - /** |
|
| 1090 | - * Filter the email html by individual custom field. |
|
| 1091 | - * |
|
| 1092 | - * @param string $html The html to filter. |
|
| 1093 | - * @param string $location The location to output the html. |
|
| 1094 | - * @param array $cf The custom field array. |
|
| 1095 | - * @since 1.6.6 |
|
| 1096 | - */ |
|
| 1097 | - $html = apply_filters("geodir_custom_field_output_email_var_{$html_var}",$html,$location,$cf); |
|
| 1098 | - } |
|
| 1099 | - |
|
| 1100 | - // Check if there is a custom field key specific filter. |
|
| 1101 | - if(has_filter("geodir_custom_field_output_email_key_{$cf['field_type_key']}")){ |
|
| 1102 | - /** |
|
| 1103 | - * Filter the email html by field type key. |
|
| 1104 | - * |
|
| 1105 | - * @param string $html The html to filter. |
|
| 1106 | - * @param string $location The location to output the html. |
|
| 1107 | - * @param array $cf The custom field array. |
|
| 1108 | - * @since 1.6.6 |
|
| 1109 | - */ |
|
| 1110 | - $html = apply_filters("geodir_custom_field_output_email_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 1111 | - } |
|
| 1112 | - |
|
| 1113 | - // If not html then we run the standard output. |
|
| 1114 | - if(empty($html)){ |
|
| 1115 | - |
|
| 1116 | - global $preview; |
|
| 1117 | - if ($cf['htmlvar_name'] == 'geodir_email' && !(geodir_is_page('detail') || geodir_is_page('preview'))) { |
|
| 1118 | - return ''; // Remove Send Enquiry | Send To Friend from listings page |
|
| 1119 | - } |
|
| 1120 | - |
|
| 1121 | - $package_info = (array)geodir_post_package_info(array(), $post, $post->post_type); |
|
| 1122 | - |
|
| 1123 | - if ($cf['htmlvar_name'] == 'geodir_email' && ((isset($package_info['sendtofriend']) && $package_info['sendtofriend']) || $post->{$cf['htmlvar_name']})) { |
|
| 1124 | - global $send_to_friend; |
|
| 1125 | - $send_to_friend = true; |
|
| 1126 | - $b_send_inquiry = ''; |
|
| 1127 | - $b_sendtofriend = ''; |
|
| 1128 | - |
|
| 1129 | - $html = ''; |
|
| 1130 | - if (!$preview) { |
|
| 1131 | - $b_send_inquiry = 'b_send_inquiry'; |
|
| 1132 | - $b_sendtofriend = 'b_sendtofriend'; |
|
| 1133 | - $html = '<input type="hidden" name="geodir_popup_post_id" value="' . $post->ID . '" /><div class="geodir_display_popup_forms"></div>'; |
|
| 1134 | - } |
|
| 1135 | - |
|
| 1136 | - $field_icon = geodir_field_icon_proccess($cf); |
|
| 1137 | - if (strpos($field_icon, 'http') !== false) { |
|
| 1138 | - $field_icon_af = ''; |
|
| 1139 | - } elseif ($field_icon == '') { |
|
| 1140 | - $field_icon_af = '<i class="fa fa-envelope"></i>'; |
|
| 1141 | - } else { |
|
| 1142 | - $field_icon_af = $field_icon; |
|
| 1143 | - $field_icon = ''; |
|
| 1144 | - } |
|
| 1145 | - |
|
| 1146 | - $html .= '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af; |
|
| 1147 | - $seperator = ''; |
|
| 1148 | - if ($post->{$cf['htmlvar_name']}) { |
|
| 1149 | - $html .= '<a href="javascript:void(0);" class="' . $b_send_inquiry . '" >' . SEND_INQUIRY . '</a>'; |
|
| 1150 | - $seperator = ' | '; |
|
| 1151 | - } |
|
| 1152 | - |
|
| 1153 | - if (isset($package_info['sendtofriend']) && $package_info['sendtofriend']) { |
|
| 1154 | - $html .= $seperator . '<a href="javascript:void(0);" class="' . $b_sendtofriend . '">' . SEND_TO_FRIEND . '</a>'; |
|
| 1155 | - } |
|
| 1156 | - |
|
| 1157 | - $html .= '</span></div>'; |
|
| 1158 | - |
|
| 1159 | - |
|
| 1160 | - if (isset($_REQUEST['send_inquiry']) && $_REQUEST['send_inquiry'] == 'success') { |
|
| 1161 | - $html .= '<p class="sucess_msg">' . SEND_INQUIRY_SUCCESS . '</p>'; |
|
| 1162 | - } elseif (isset($_REQUEST['sendtofrnd']) && $_REQUEST['sendtofrnd'] == 'success') { |
|
| 1163 | - $html .= '<p class="sucess_msg">' . SEND_FRIEND_SUCCESS . '</p>'; |
|
| 1164 | - } elseif (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 'captch') { |
|
| 1165 | - $html .= '<p class="error_msg_fix">' . WRONG_CAPTCH_MSG . '</p>'; |
|
| 1166 | - } |
|
| 1167 | - |
|
| 1168 | - /*if(!$preview){require_once (geodir_plugin_path().'/geodirectory-templates/popup-forms.php');}*/ |
|
| 1169 | - |
|
| 1170 | - } else { |
|
| 1171 | - |
|
| 1172 | - if ($post->{$cf['htmlvar_name']}) { |
|
| 1173 | - |
|
| 1174 | - $field_icon = geodir_field_icon_proccess($cf); |
|
| 1175 | - if (strpos($field_icon, 'http') !== false) { |
|
| 1176 | - $field_icon_af = ''; |
|
| 1177 | - } elseif ($field_icon == '') { |
|
| 1178 | - $field_icon_af = '<i class="fa fa-envelope"></i>'; |
|
| 1179 | - } else { |
|
| 1180 | - $field_icon_af = $field_icon; |
|
| 1181 | - $field_icon = ''; |
|
| 1182 | - } |
|
| 1183 | - |
|
| 1184 | - |
|
| 1185 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af; |
|
| 1186 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 1187 | - $html .= '</span><span class="geodir-email-address-output">'; |
|
| 1188 | - $email = $post->{$cf['htmlvar_name']} ; |
|
| 1189 | - if($e_split = explode('@',$email)){ |
|
| 1190 | - /** |
|
| 1191 | - * Filter email custom field name output. |
|
| 1192 | - * |
|
| 1193 | - * @since 1.5.3 |
|
| 1194 | - * |
|
| 1195 | - * @param string $email The email string being output. |
|
| 1196 | - * @param array $cf Custom field variables array. |
|
| 1197 | - */ |
|
| 1198 | - $email_name = apply_filters('geodir_email_field_name_output',$email,$cf); |
|
| 1199 | - $html .= "<script>document.write('<a href=\"mailto:'+'$e_split[0]' + '@' + '$e_split[1]'+'\">$email_name</a>')</script>"; |
|
| 1200 | - }else{ |
|
| 1201 | - $html .= $email; |
|
| 1202 | - } |
|
| 1203 | - $html .= '</span></div>'; |
|
| 1204 | - } |
|
| 1205 | - |
|
| 1206 | - } |
|
| 1207 | - |
|
| 1208 | - } |
|
| 1209 | - |
|
| 1210 | - return $html; |
|
| 1064 | + // check we have the post value |
|
| 1065 | + if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 1066 | + else{ global $post;} |
|
| 1067 | + |
|
| 1068 | + if(!is_array($cf) && $cf!=''){ |
|
| 1069 | + $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 1070 | + if(!$cf){return NULL;} |
|
| 1071 | + } |
|
| 1072 | + |
|
| 1073 | + $html_var = $cf['htmlvar_name']; |
|
| 1074 | + |
|
| 1075 | + // Check if there is a location specific filter. |
|
| 1076 | + if(has_filter("geodir_custom_field_output_email_loc_{$location}")){ |
|
| 1077 | + /** |
|
| 1078 | + * Filter the email html by location. |
|
| 1079 | + * |
|
| 1080 | + * @param string $html The html to filter. |
|
| 1081 | + * @param array $cf The custom field array. |
|
| 1082 | + * @since 1.6.6 |
|
| 1083 | + */ |
|
| 1084 | + $html = apply_filters("geodir_custom_field_output_email_loc_{$location}",$html,$cf); |
|
| 1085 | + } |
|
| 1086 | + |
|
| 1087 | + // Check if there is a custom field specific filter. |
|
| 1088 | + if(has_filter("geodir_custom_field_output_email_var_{$html_var}")){ |
|
| 1089 | + /** |
|
| 1090 | + * Filter the email html by individual custom field. |
|
| 1091 | + * |
|
| 1092 | + * @param string $html The html to filter. |
|
| 1093 | + * @param string $location The location to output the html. |
|
| 1094 | + * @param array $cf The custom field array. |
|
| 1095 | + * @since 1.6.6 |
|
| 1096 | + */ |
|
| 1097 | + $html = apply_filters("geodir_custom_field_output_email_var_{$html_var}",$html,$location,$cf); |
|
| 1098 | + } |
|
| 1099 | + |
|
| 1100 | + // Check if there is a custom field key specific filter. |
|
| 1101 | + if(has_filter("geodir_custom_field_output_email_key_{$cf['field_type_key']}")){ |
|
| 1102 | + /** |
|
| 1103 | + * Filter the email html by field type key. |
|
| 1104 | + * |
|
| 1105 | + * @param string $html The html to filter. |
|
| 1106 | + * @param string $location The location to output the html. |
|
| 1107 | + * @param array $cf The custom field array. |
|
| 1108 | + * @since 1.6.6 |
|
| 1109 | + */ |
|
| 1110 | + $html = apply_filters("geodir_custom_field_output_email_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 1111 | + } |
|
| 1112 | + |
|
| 1113 | + // If not html then we run the standard output. |
|
| 1114 | + if(empty($html)){ |
|
| 1115 | + |
|
| 1116 | + global $preview; |
|
| 1117 | + if ($cf['htmlvar_name'] == 'geodir_email' && !(geodir_is_page('detail') || geodir_is_page('preview'))) { |
|
| 1118 | + return ''; // Remove Send Enquiry | Send To Friend from listings page |
|
| 1119 | + } |
|
| 1120 | + |
|
| 1121 | + $package_info = (array)geodir_post_package_info(array(), $post, $post->post_type); |
|
| 1122 | + |
|
| 1123 | + if ($cf['htmlvar_name'] == 'geodir_email' && ((isset($package_info['sendtofriend']) && $package_info['sendtofriend']) || $post->{$cf['htmlvar_name']})) { |
|
| 1124 | + global $send_to_friend; |
|
| 1125 | + $send_to_friend = true; |
|
| 1126 | + $b_send_inquiry = ''; |
|
| 1127 | + $b_sendtofriend = ''; |
|
| 1128 | + |
|
| 1129 | + $html = ''; |
|
| 1130 | + if (!$preview) { |
|
| 1131 | + $b_send_inquiry = 'b_send_inquiry'; |
|
| 1132 | + $b_sendtofriend = 'b_sendtofriend'; |
|
| 1133 | + $html = '<input type="hidden" name="geodir_popup_post_id" value="' . $post->ID . '" /><div class="geodir_display_popup_forms"></div>'; |
|
| 1134 | + } |
|
| 1135 | + |
|
| 1136 | + $field_icon = geodir_field_icon_proccess($cf); |
|
| 1137 | + if (strpos($field_icon, 'http') !== false) { |
|
| 1138 | + $field_icon_af = ''; |
|
| 1139 | + } elseif ($field_icon == '') { |
|
| 1140 | + $field_icon_af = '<i class="fa fa-envelope"></i>'; |
|
| 1141 | + } else { |
|
| 1142 | + $field_icon_af = $field_icon; |
|
| 1143 | + $field_icon = ''; |
|
| 1144 | + } |
|
| 1145 | + |
|
| 1146 | + $html .= '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af; |
|
| 1147 | + $seperator = ''; |
|
| 1148 | + if ($post->{$cf['htmlvar_name']}) { |
|
| 1149 | + $html .= '<a href="javascript:void(0);" class="' . $b_send_inquiry . '" >' . SEND_INQUIRY . '</a>'; |
|
| 1150 | + $seperator = ' | '; |
|
| 1151 | + } |
|
| 1152 | + |
|
| 1153 | + if (isset($package_info['sendtofriend']) && $package_info['sendtofriend']) { |
|
| 1154 | + $html .= $seperator . '<a href="javascript:void(0);" class="' . $b_sendtofriend . '">' . SEND_TO_FRIEND . '</a>'; |
|
| 1155 | + } |
|
| 1156 | + |
|
| 1157 | + $html .= '</span></div>'; |
|
| 1158 | + |
|
| 1159 | + |
|
| 1160 | + if (isset($_REQUEST['send_inquiry']) && $_REQUEST['send_inquiry'] == 'success') { |
|
| 1161 | + $html .= '<p class="sucess_msg">' . SEND_INQUIRY_SUCCESS . '</p>'; |
|
| 1162 | + } elseif (isset($_REQUEST['sendtofrnd']) && $_REQUEST['sendtofrnd'] == 'success') { |
|
| 1163 | + $html .= '<p class="sucess_msg">' . SEND_FRIEND_SUCCESS . '</p>'; |
|
| 1164 | + } elseif (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 'captch') { |
|
| 1165 | + $html .= '<p class="error_msg_fix">' . WRONG_CAPTCH_MSG . '</p>'; |
|
| 1166 | + } |
|
| 1167 | + |
|
| 1168 | + /*if(!$preview){require_once (geodir_plugin_path().'/geodirectory-templates/popup-forms.php');}*/ |
|
| 1169 | + |
|
| 1170 | + } else { |
|
| 1171 | + |
|
| 1172 | + if ($post->{$cf['htmlvar_name']}) { |
|
| 1173 | + |
|
| 1174 | + $field_icon = geodir_field_icon_proccess($cf); |
|
| 1175 | + if (strpos($field_icon, 'http') !== false) { |
|
| 1176 | + $field_icon_af = ''; |
|
| 1177 | + } elseif ($field_icon == '') { |
|
| 1178 | + $field_icon_af = '<i class="fa fa-envelope"></i>'; |
|
| 1179 | + } else { |
|
| 1180 | + $field_icon_af = $field_icon; |
|
| 1181 | + $field_icon = ''; |
|
| 1182 | + } |
|
| 1183 | + |
|
| 1184 | + |
|
| 1185 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af; |
|
| 1186 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 1187 | + $html .= '</span><span class="geodir-email-address-output">'; |
|
| 1188 | + $email = $post->{$cf['htmlvar_name']} ; |
|
| 1189 | + if($e_split = explode('@',$email)){ |
|
| 1190 | + /** |
|
| 1191 | + * Filter email custom field name output. |
|
| 1192 | + * |
|
| 1193 | + * @since 1.5.3 |
|
| 1194 | + * |
|
| 1195 | + * @param string $email The email string being output. |
|
| 1196 | + * @param array $cf Custom field variables array. |
|
| 1197 | + */ |
|
| 1198 | + $email_name = apply_filters('geodir_email_field_name_output',$email,$cf); |
|
| 1199 | + $html .= "<script>document.write('<a href=\"mailto:'+'$e_split[0]' + '@' + '$e_split[1]'+'\">$email_name</a>')</script>"; |
|
| 1200 | + }else{ |
|
| 1201 | + $html .= $email; |
|
| 1202 | + } |
|
| 1203 | + $html .= '</span></div>'; |
|
| 1204 | + } |
|
| 1205 | + |
|
| 1206 | + } |
|
| 1207 | + |
|
| 1208 | + } |
|
| 1209 | + |
|
| 1210 | + return $html; |
|
| 1211 | 1211 | } |
| 1212 | 1212 | add_filter('geodir_custom_field_output_email','geodir_cf_email',10,3); |
| 1213 | 1213 | |
@@ -1224,130 +1224,130 @@ discard block |
||
| 1224 | 1224 | */ |
| 1225 | 1225 | function geodir_cf_file($html,$location,$cf,$p=''){ |
| 1226 | 1226 | |
| 1227 | - // check we have the post value |
|
| 1228 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 1229 | - else{ global $post;} |
|
| 1230 | - |
|
| 1231 | - if(!is_array($cf) && $cf!=''){ |
|
| 1232 | - $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 1233 | - if(!$cf){return NULL;} |
|
| 1234 | - } |
|
| 1235 | - |
|
| 1236 | - $html_var = $cf['htmlvar_name']; |
|
| 1237 | - |
|
| 1238 | - // Check if there is a location specific filter. |
|
| 1239 | - if(has_filter("geodir_custom_field_output_file_loc_{$location}")){ |
|
| 1240 | - /** |
|
| 1241 | - * Filter the file html by location. |
|
| 1242 | - * |
|
| 1243 | - * @param string $html The html to filter. |
|
| 1244 | - * @param array $cf The custom field array. |
|
| 1245 | - * @since 1.6.6 |
|
| 1246 | - */ |
|
| 1247 | - $html = apply_filters("geodir_custom_field_output_file_loc_{$location}",$html,$cf); |
|
| 1248 | - } |
|
| 1249 | - |
|
| 1250 | - // Check if there is a custom field specific filter. |
|
| 1251 | - if(has_filter("geodir_custom_field_output_file_var_{$html_var}")){ |
|
| 1252 | - /** |
|
| 1253 | - * Filter the file html by individual custom field. |
|
| 1254 | - * |
|
| 1255 | - * @param string $html The html to filter. |
|
| 1256 | - * @param string $location The location to output the html. |
|
| 1257 | - * @param array $cf The custom field array. |
|
| 1258 | - * @since 1.6.6 |
|
| 1259 | - */ |
|
| 1260 | - $html = apply_filters("geodir_custom_field_output_file_var_{$html_var}",$html,$location,$cf); |
|
| 1261 | - } |
|
| 1262 | - |
|
| 1263 | - // Check if there is a custom field key specific filter. |
|
| 1264 | - if(has_filter("geodir_custom_field_output_file_key_{$cf['field_type_key']}")){ |
|
| 1265 | - /** |
|
| 1266 | - * Filter the file html by field type key. |
|
| 1267 | - * |
|
| 1268 | - * @param string $html The html to filter. |
|
| 1269 | - * @param string $location The location to output the html. |
|
| 1270 | - * @param array $cf The custom field array. |
|
| 1271 | - * @since 1.6.6 |
|
| 1272 | - */ |
|
| 1273 | - $html = apply_filters("geodir_custom_field_output_file_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 1274 | - } |
|
| 1275 | - |
|
| 1276 | - // If not html then we run the standard output. |
|
| 1277 | - if(empty($html)){ |
|
| 1278 | - |
|
| 1279 | - if (!empty($post->{$cf['htmlvar_name']})): |
|
| 1280 | - |
|
| 1281 | - $files = explode(",", $post->{$cf['htmlvar_name']}); |
|
| 1282 | - if (!empty($files)): |
|
| 1283 | - |
|
| 1284 | - $extra_fields = !empty($cf['extra_fields']) ? stripslashes_deep(maybe_unserialize($cf['extra_fields'])) : NULL; |
|
| 1285 | - $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types'] ) ? $extra_fields['gd_file_types'] : ''; |
|
| 1286 | - |
|
| 1287 | - $file_paths = ''; |
|
| 1288 | - foreach ($files as $file) { |
|
| 1289 | - if (!empty($file)) { |
|
| 1290 | - |
|
| 1291 | - // $filetype = wp_check_filetype($file); |
|
| 1292 | - |
|
| 1293 | - $image_name_arr = explode('/', $file); |
|
| 1294 | - $curr_img_dir = $image_name_arr[count($image_name_arr) - 2]; |
|
| 1295 | - $filename = end($image_name_arr); |
|
| 1296 | - $img_name_arr = explode('.', $filename); |
|
| 1297 | - |
|
| 1298 | - $arr_file_type = wp_check_filetype($filename); |
|
| 1299 | - if (empty($arr_file_type['ext']) || empty($arr_file_type['type'])) { |
|
| 1300 | - continue; |
|
| 1301 | - } |
|
| 1302 | - |
|
| 1303 | - $uploaded_file_type = $arr_file_type['type']; |
|
| 1304 | - $uploaded_file_ext = $arr_file_type['ext']; |
|
| 1305 | - |
|
| 1306 | - if (!empty($allowed_file_types) && !in_array($uploaded_file_ext, $allowed_file_types)) { |
|
| 1307 | - continue; // Invalid file type. |
|
| 1308 | - } |
|
| 1309 | - |
|
| 1310 | - //$allowed_file_types = array('application/pdf', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'text/csv', 'text/plain'); |
|
| 1311 | - $image_file_types = array('image/jpg', 'image/jpeg', 'image/gif', 'image/png', 'image/bmp', 'image/x-icon'); |
|
| 1312 | - |
|
| 1313 | - // If the uploaded file is image |
|
| 1314 | - if (in_array($uploaded_file_type, $image_file_types)) { |
|
| 1315 | - $file_paths .= '<div class="geodir-custom-post-gallery" class="clearfix">'; |
|
| 1316 | - $file_paths .= '<a href="'.$file.'">'; |
|
| 1317 | - $file_paths .= geodir_show_image(array('src' => $file), 'thumbnail', false, false); |
|
| 1318 | - $file_paths .= '</a>'; |
|
| 1319 | - //$file_paths .= '<img src="'.$file.'" />'; |
|
| 1320 | - $file_paths .= '</div>'; |
|
| 1321 | - } else { |
|
| 1322 | - $ext_path = '_' . $html_var . '_'; |
|
| 1323 | - $filename = explode($ext_path, $filename); |
|
| 1324 | - $file_paths .= '<a href="' . $file . '" target="_blank">' . $filename[count($filename) - 1] . '</a>'; |
|
| 1325 | - } |
|
| 1326 | - } |
|
| 1327 | - } |
|
| 1328 | - |
|
| 1329 | - $field_icon = geodir_field_icon_proccess($cf); |
|
| 1330 | - if (strpos($field_icon, 'http') !== false) { |
|
| 1331 | - $field_icon_af = ''; |
|
| 1332 | - } elseif ($field_icon == '') { |
|
| 1333 | - $field_icon_af = ''; |
|
| 1334 | - } else { |
|
| 1335 | - $field_icon_af = $field_icon; |
|
| 1336 | - $field_icon = ''; |
|
| 1337 | - } |
|
| 1338 | - |
|
| 1339 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' geodir-custom-file-box ' . $cf['htmlvar_name'] . '"><div class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af; |
|
| 1340 | - $html .= '<span style="display: inline-block; vertical-align: top; padding-right: 14px;">'; |
|
| 1341 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 1342 | - $html .= '</span>'; |
|
| 1343 | - $html .= $file_paths . '</div></div>'; |
|
| 1344 | - |
|
| 1345 | - endif; |
|
| 1346 | - endif; |
|
| 1347 | - |
|
| 1348 | - } |
|
| 1349 | - |
|
| 1350 | - return $html; |
|
| 1227 | + // check we have the post value |
|
| 1228 | + if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 1229 | + else{ global $post;} |
|
| 1230 | + |
|
| 1231 | + if(!is_array($cf) && $cf!=''){ |
|
| 1232 | + $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 1233 | + if(!$cf){return NULL;} |
|
| 1234 | + } |
|
| 1235 | + |
|
| 1236 | + $html_var = $cf['htmlvar_name']; |
|
| 1237 | + |
|
| 1238 | + // Check if there is a location specific filter. |
|
| 1239 | + if(has_filter("geodir_custom_field_output_file_loc_{$location}")){ |
|
| 1240 | + /** |
|
| 1241 | + * Filter the file html by location. |
|
| 1242 | + * |
|
| 1243 | + * @param string $html The html to filter. |
|
| 1244 | + * @param array $cf The custom field array. |
|
| 1245 | + * @since 1.6.6 |
|
| 1246 | + */ |
|
| 1247 | + $html = apply_filters("geodir_custom_field_output_file_loc_{$location}",$html,$cf); |
|
| 1248 | + } |
|
| 1249 | + |
|
| 1250 | + // Check if there is a custom field specific filter. |
|
| 1251 | + if(has_filter("geodir_custom_field_output_file_var_{$html_var}")){ |
|
| 1252 | + /** |
|
| 1253 | + * Filter the file html by individual custom field. |
|
| 1254 | + * |
|
| 1255 | + * @param string $html The html to filter. |
|
| 1256 | + * @param string $location The location to output the html. |
|
| 1257 | + * @param array $cf The custom field array. |
|
| 1258 | + * @since 1.6.6 |
|
| 1259 | + */ |
|
| 1260 | + $html = apply_filters("geodir_custom_field_output_file_var_{$html_var}",$html,$location,$cf); |
|
| 1261 | + } |
|
| 1262 | + |
|
| 1263 | + // Check if there is a custom field key specific filter. |
|
| 1264 | + if(has_filter("geodir_custom_field_output_file_key_{$cf['field_type_key']}")){ |
|
| 1265 | + /** |
|
| 1266 | + * Filter the file html by field type key. |
|
| 1267 | + * |
|
| 1268 | + * @param string $html The html to filter. |
|
| 1269 | + * @param string $location The location to output the html. |
|
| 1270 | + * @param array $cf The custom field array. |
|
| 1271 | + * @since 1.6.6 |
|
| 1272 | + */ |
|
| 1273 | + $html = apply_filters("geodir_custom_field_output_file_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 1274 | + } |
|
| 1275 | + |
|
| 1276 | + // If not html then we run the standard output. |
|
| 1277 | + if(empty($html)){ |
|
| 1278 | + |
|
| 1279 | + if (!empty($post->{$cf['htmlvar_name']})): |
|
| 1280 | + |
|
| 1281 | + $files = explode(",", $post->{$cf['htmlvar_name']}); |
|
| 1282 | + if (!empty($files)): |
|
| 1283 | + |
|
| 1284 | + $extra_fields = !empty($cf['extra_fields']) ? stripslashes_deep(maybe_unserialize($cf['extra_fields'])) : NULL; |
|
| 1285 | + $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types'] ) ? $extra_fields['gd_file_types'] : ''; |
|
| 1286 | + |
|
| 1287 | + $file_paths = ''; |
|
| 1288 | + foreach ($files as $file) { |
|
| 1289 | + if (!empty($file)) { |
|
| 1290 | + |
|
| 1291 | + // $filetype = wp_check_filetype($file); |
|
| 1292 | + |
|
| 1293 | + $image_name_arr = explode('/', $file); |
|
| 1294 | + $curr_img_dir = $image_name_arr[count($image_name_arr) - 2]; |
|
| 1295 | + $filename = end($image_name_arr); |
|
| 1296 | + $img_name_arr = explode('.', $filename); |
|
| 1297 | + |
|
| 1298 | + $arr_file_type = wp_check_filetype($filename); |
|
| 1299 | + if (empty($arr_file_type['ext']) || empty($arr_file_type['type'])) { |
|
| 1300 | + continue; |
|
| 1301 | + } |
|
| 1302 | + |
|
| 1303 | + $uploaded_file_type = $arr_file_type['type']; |
|
| 1304 | + $uploaded_file_ext = $arr_file_type['ext']; |
|
| 1305 | + |
|
| 1306 | + if (!empty($allowed_file_types) && !in_array($uploaded_file_ext, $allowed_file_types)) { |
|
| 1307 | + continue; // Invalid file type. |
|
| 1308 | + } |
|
| 1309 | + |
|
| 1310 | + //$allowed_file_types = array('application/pdf', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'text/csv', 'text/plain'); |
|
| 1311 | + $image_file_types = array('image/jpg', 'image/jpeg', 'image/gif', 'image/png', 'image/bmp', 'image/x-icon'); |
|
| 1312 | + |
|
| 1313 | + // If the uploaded file is image |
|
| 1314 | + if (in_array($uploaded_file_type, $image_file_types)) { |
|
| 1315 | + $file_paths .= '<div class="geodir-custom-post-gallery" class="clearfix">'; |
|
| 1316 | + $file_paths .= '<a href="'.$file.'">'; |
|
| 1317 | + $file_paths .= geodir_show_image(array('src' => $file), 'thumbnail', false, false); |
|
| 1318 | + $file_paths .= '</a>'; |
|
| 1319 | + //$file_paths .= '<img src="'.$file.'" />'; |
|
| 1320 | + $file_paths .= '</div>'; |
|
| 1321 | + } else { |
|
| 1322 | + $ext_path = '_' . $html_var . '_'; |
|
| 1323 | + $filename = explode($ext_path, $filename); |
|
| 1324 | + $file_paths .= '<a href="' . $file . '" target="_blank">' . $filename[count($filename) - 1] . '</a>'; |
|
| 1325 | + } |
|
| 1326 | + } |
|
| 1327 | + } |
|
| 1328 | + |
|
| 1329 | + $field_icon = geodir_field_icon_proccess($cf); |
|
| 1330 | + if (strpos($field_icon, 'http') !== false) { |
|
| 1331 | + $field_icon_af = ''; |
|
| 1332 | + } elseif ($field_icon == '') { |
|
| 1333 | + $field_icon_af = ''; |
|
| 1334 | + } else { |
|
| 1335 | + $field_icon_af = $field_icon; |
|
| 1336 | + $field_icon = ''; |
|
| 1337 | + } |
|
| 1338 | + |
|
| 1339 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' geodir-custom-file-box ' . $cf['htmlvar_name'] . '"><div class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af; |
|
| 1340 | + $html .= '<span style="display: inline-block; vertical-align: top; padding-right: 14px;">'; |
|
| 1341 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 1342 | + $html .= '</span>'; |
|
| 1343 | + $html .= $file_paths . '</div></div>'; |
|
| 1344 | + |
|
| 1345 | + endif; |
|
| 1346 | + endif; |
|
| 1347 | + |
|
| 1348 | + } |
|
| 1349 | + |
|
| 1350 | + return $html; |
|
| 1351 | 1351 | } |
| 1352 | 1352 | add_filter('geodir_custom_field_output_file','geodir_cf_file',10,3); |
| 1353 | 1353 | |
@@ -1365,80 +1365,80 @@ discard block |
||
| 1365 | 1365 | */ |
| 1366 | 1366 | function geodir_cf_textarea($html,$location,$cf,$p=''){ |
| 1367 | 1367 | |
| 1368 | - // check we have the post value |
|
| 1369 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 1370 | - else{ global $post;} |
|
| 1371 | - |
|
| 1372 | - if(!is_array($cf) && $cf!=''){ |
|
| 1373 | - $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 1374 | - if(!$cf){return NULL;} |
|
| 1375 | - } |
|
| 1376 | - |
|
| 1377 | - $html_var = $cf['htmlvar_name']; |
|
| 1378 | - |
|
| 1379 | - // Check if there is a location specific filter. |
|
| 1380 | - if(has_filter("geodir_custom_field_output_textarea_loc_{$location}")){ |
|
| 1381 | - /** |
|
| 1382 | - * Filter the textarea html by location. |
|
| 1383 | - * |
|
| 1384 | - * @param string $html The html to filter. |
|
| 1385 | - * @param array $cf The custom field array. |
|
| 1386 | - * @since 1.6.6 |
|
| 1387 | - */ |
|
| 1388 | - $html = apply_filters("geodir_custom_field_output_textarea_loc_{$location}",$html,$cf); |
|
| 1389 | - } |
|
| 1390 | - |
|
| 1391 | - // Check if there is a custom field specific filter. |
|
| 1392 | - if(has_filter("geodir_custom_field_output_textarea_var_{$html_var}")){ |
|
| 1393 | - /** |
|
| 1394 | - * Filter the textarea html by individual custom field. |
|
| 1395 | - * |
|
| 1396 | - * @param string $html The html to filter. |
|
| 1397 | - * @param string $location The location to output the html. |
|
| 1398 | - * @param array $cf The custom field array. |
|
| 1399 | - * @since 1.6.6 |
|
| 1400 | - */ |
|
| 1401 | - $html = apply_filters("geodir_custom_field_output_textarea_var_{$html_var}",$html,$location,$cf); |
|
| 1402 | - } |
|
| 1403 | - |
|
| 1404 | - // Check if there is a custom field key specific filter. |
|
| 1405 | - if(has_filter("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}")){ |
|
| 1406 | - /** |
|
| 1407 | - * Filter the textarea html by field type key. |
|
| 1408 | - * |
|
| 1409 | - * @param string $html The html to filter. |
|
| 1410 | - * @param string $location The location to output the html. |
|
| 1411 | - * @param array $cf The custom field array. |
|
| 1412 | - * @since 1.6.6 |
|
| 1413 | - */ |
|
| 1414 | - $html = apply_filters("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 1415 | - } |
|
| 1416 | - |
|
| 1417 | - // If not html then we run the standard output. |
|
| 1418 | - if(empty($html)){ |
|
| 1419 | - |
|
| 1420 | - if (!empty($post->{$cf['htmlvar_name']})) { |
|
| 1421 | - |
|
| 1422 | - $field_icon = geodir_field_icon_proccess($cf); |
|
| 1423 | - if (strpos($field_icon, 'http') !== false) { |
|
| 1424 | - $field_icon_af = ''; |
|
| 1425 | - } elseif ($field_icon == '') { |
|
| 1426 | - $field_icon_af = ''; |
|
| 1427 | - } else { |
|
| 1428 | - $field_icon_af = $field_icon; |
|
| 1429 | - $field_icon = ''; |
|
| 1430 | - } |
|
| 1431 | - |
|
| 1432 | - |
|
| 1433 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af; |
|
| 1434 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 1435 | - $html .= '</span>' . wpautop($post->{$cf['htmlvar_name']}) . '</div>'; |
|
| 1436 | - |
|
| 1437 | - } |
|
| 1438 | - |
|
| 1439 | - } |
|
| 1440 | - |
|
| 1441 | - return $html; |
|
| 1368 | + // check we have the post value |
|
| 1369 | + if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 1370 | + else{ global $post;} |
|
| 1371 | + |
|
| 1372 | + if(!is_array($cf) && $cf!=''){ |
|
| 1373 | + $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 1374 | + if(!$cf){return NULL;} |
|
| 1375 | + } |
|
| 1376 | + |
|
| 1377 | + $html_var = $cf['htmlvar_name']; |
|
| 1378 | + |
|
| 1379 | + // Check if there is a location specific filter. |
|
| 1380 | + if(has_filter("geodir_custom_field_output_textarea_loc_{$location}")){ |
|
| 1381 | + /** |
|
| 1382 | + * Filter the textarea html by location. |
|
| 1383 | + * |
|
| 1384 | + * @param string $html The html to filter. |
|
| 1385 | + * @param array $cf The custom field array. |
|
| 1386 | + * @since 1.6.6 |
|
| 1387 | + */ |
|
| 1388 | + $html = apply_filters("geodir_custom_field_output_textarea_loc_{$location}",$html,$cf); |
|
| 1389 | + } |
|
| 1390 | + |
|
| 1391 | + // Check if there is a custom field specific filter. |
|
| 1392 | + if(has_filter("geodir_custom_field_output_textarea_var_{$html_var}")){ |
|
| 1393 | + /** |
|
| 1394 | + * Filter the textarea html by individual custom field. |
|
| 1395 | + * |
|
| 1396 | + * @param string $html The html to filter. |
|
| 1397 | + * @param string $location The location to output the html. |
|
| 1398 | + * @param array $cf The custom field array. |
|
| 1399 | + * @since 1.6.6 |
|
| 1400 | + */ |
|
| 1401 | + $html = apply_filters("geodir_custom_field_output_textarea_var_{$html_var}",$html,$location,$cf); |
|
| 1402 | + } |
|
| 1403 | + |
|
| 1404 | + // Check if there is a custom field key specific filter. |
|
| 1405 | + if(has_filter("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}")){ |
|
| 1406 | + /** |
|
| 1407 | + * Filter the textarea html by field type key. |
|
| 1408 | + * |
|
| 1409 | + * @param string $html The html to filter. |
|
| 1410 | + * @param string $location The location to output the html. |
|
| 1411 | + * @param array $cf The custom field array. |
|
| 1412 | + * @since 1.6.6 |
|
| 1413 | + */ |
|
| 1414 | + $html = apply_filters("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 1415 | + } |
|
| 1416 | + |
|
| 1417 | + // If not html then we run the standard output. |
|
| 1418 | + if(empty($html)){ |
|
| 1419 | + |
|
| 1420 | + if (!empty($post->{$cf['htmlvar_name']})) { |
|
| 1421 | + |
|
| 1422 | + $field_icon = geodir_field_icon_proccess($cf); |
|
| 1423 | + if (strpos($field_icon, 'http') !== false) { |
|
| 1424 | + $field_icon_af = ''; |
|
| 1425 | + } elseif ($field_icon == '') { |
|
| 1426 | + $field_icon_af = ''; |
|
| 1427 | + } else { |
|
| 1428 | + $field_icon_af = $field_icon; |
|
| 1429 | + $field_icon = ''; |
|
| 1430 | + } |
|
| 1431 | + |
|
| 1432 | + |
|
| 1433 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af; |
|
| 1434 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 1435 | + $html .= '</span>' . wpautop($post->{$cf['htmlvar_name']}) . '</div>'; |
|
| 1436 | + |
|
| 1437 | + } |
|
| 1438 | + |
|
| 1439 | + } |
|
| 1440 | + |
|
| 1441 | + return $html; |
|
| 1442 | 1442 | } |
| 1443 | 1443 | add_filter('geodir_custom_field_output_textarea','geodir_cf_textarea',10,3); |
| 1444 | 1444 | |
@@ -1456,79 +1456,79 @@ discard block |
||
| 1456 | 1456 | */ |
| 1457 | 1457 | function geodir_cf_html($html,$location,$cf,$p=''){ |
| 1458 | 1458 | |
| 1459 | - // check we have the post value |
|
| 1460 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 1461 | - else{ global $post;} |
|
| 1462 | - |
|
| 1463 | - if(!is_array($cf) && $cf!=''){ |
|
| 1464 | - $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 1465 | - if(!$cf){return NULL;} |
|
| 1466 | - } |
|
| 1467 | - |
|
| 1468 | - $html_var = $cf['htmlvar_name']; |
|
| 1469 | - |
|
| 1470 | - // Check if there is a location specific filter. |
|
| 1471 | - if(has_filter("geodir_custom_field_output_html_loc_{$location}")){ |
|
| 1472 | - /** |
|
| 1473 | - * Filter the html html by location. |
|
| 1474 | - * |
|
| 1475 | - * @param string $html The html to filter. |
|
| 1476 | - * @param array $cf The custom field array. |
|
| 1477 | - * @since 1.6.6 |
|
| 1478 | - */ |
|
| 1479 | - $html = apply_filters("geodir_custom_field_output_html_loc_{$location}",$html,$cf); |
|
| 1480 | - } |
|
| 1481 | - |
|
| 1482 | - // Check if there is a custom field specific filter. |
|
| 1483 | - if(has_filter("geodir_custom_field_output_html_var_{$html_var}")){ |
|
| 1484 | - /** |
|
| 1485 | - * Filter the html html by individual custom field. |
|
| 1486 | - * |
|
| 1487 | - * @param string $html The html to filter. |
|
| 1488 | - * @param string $location The location to output the html. |
|
| 1489 | - * @param array $cf The custom field array. |
|
| 1490 | - * @since 1.6.6 |
|
| 1491 | - */ |
|
| 1492 | - $html = apply_filters("geodir_custom_field_output_html_var_{$html_var}",$html,$location,$cf); |
|
| 1493 | - } |
|
| 1494 | - |
|
| 1495 | - // Check if there is a custom field key specific filter. |
|
| 1496 | - if(has_filter("geodir_custom_field_output_html_key_{$cf['field_type_key']}")){ |
|
| 1497 | - /** |
|
| 1498 | - * Filter the html html by field type key. |
|
| 1499 | - * |
|
| 1500 | - * @param string $html The html to filter. |
|
| 1501 | - * @param string $location The location to output the html. |
|
| 1502 | - * @param array $cf The custom field array. |
|
| 1503 | - * @since 1.6.6 |
|
| 1504 | - */ |
|
| 1505 | - $html = apply_filters("geodir_custom_field_output_html_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 1506 | - } |
|
| 1507 | - |
|
| 1508 | - // If not html then we run the standard output. |
|
| 1509 | - if(empty($html)){ |
|
| 1510 | - |
|
| 1511 | - if (!empty($post->{$cf['htmlvar_name']})) { |
|
| 1512 | - |
|
| 1513 | - $field_icon = geodir_field_icon_proccess($cf); |
|
| 1514 | - if (strpos($field_icon, 'http') !== false) { |
|
| 1515 | - $field_icon_af = ''; |
|
| 1516 | - } elseif ($field_icon == '') { |
|
| 1517 | - $field_icon_af = ''; |
|
| 1518 | - } else { |
|
| 1519 | - $field_icon_af = $field_icon; |
|
| 1520 | - $field_icon = ''; |
|
| 1521 | - } |
|
| 1522 | - |
|
| 1523 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af; |
|
| 1524 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 1525 | - $html .= '</span>' . wpautop($post->{$cf['htmlvar_name']}) . '</div>'; |
|
| 1526 | - |
|
| 1527 | - } |
|
| 1528 | - |
|
| 1529 | - } |
|
| 1530 | - |
|
| 1531 | - return $html; |
|
| 1459 | + // check we have the post value |
|
| 1460 | + if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 1461 | + else{ global $post;} |
|
| 1462 | + |
|
| 1463 | + if(!is_array($cf) && $cf!=''){ |
|
| 1464 | + $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 1465 | + if(!$cf){return NULL;} |
|
| 1466 | + } |
|
| 1467 | + |
|
| 1468 | + $html_var = $cf['htmlvar_name']; |
|
| 1469 | + |
|
| 1470 | + // Check if there is a location specific filter. |
|
| 1471 | + if(has_filter("geodir_custom_field_output_html_loc_{$location}")){ |
|
| 1472 | + /** |
|
| 1473 | + * Filter the html html by location. |
|
| 1474 | + * |
|
| 1475 | + * @param string $html The html to filter. |
|
| 1476 | + * @param array $cf The custom field array. |
|
| 1477 | + * @since 1.6.6 |
|
| 1478 | + */ |
|
| 1479 | + $html = apply_filters("geodir_custom_field_output_html_loc_{$location}",$html,$cf); |
|
| 1480 | + } |
|
| 1481 | + |
|
| 1482 | + // Check if there is a custom field specific filter. |
|
| 1483 | + if(has_filter("geodir_custom_field_output_html_var_{$html_var}")){ |
|
| 1484 | + /** |
|
| 1485 | + * Filter the html html by individual custom field. |
|
| 1486 | + * |
|
| 1487 | + * @param string $html The html to filter. |
|
| 1488 | + * @param string $location The location to output the html. |
|
| 1489 | + * @param array $cf The custom field array. |
|
| 1490 | + * @since 1.6.6 |
|
| 1491 | + */ |
|
| 1492 | + $html = apply_filters("geodir_custom_field_output_html_var_{$html_var}",$html,$location,$cf); |
|
| 1493 | + } |
|
| 1494 | + |
|
| 1495 | + // Check if there is a custom field key specific filter. |
|
| 1496 | + if(has_filter("geodir_custom_field_output_html_key_{$cf['field_type_key']}")){ |
|
| 1497 | + /** |
|
| 1498 | + * Filter the html html by field type key. |
|
| 1499 | + * |
|
| 1500 | + * @param string $html The html to filter. |
|
| 1501 | + * @param string $location The location to output the html. |
|
| 1502 | + * @param array $cf The custom field array. |
|
| 1503 | + * @since 1.6.6 |
|
| 1504 | + */ |
|
| 1505 | + $html = apply_filters("geodir_custom_field_output_html_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 1506 | + } |
|
| 1507 | + |
|
| 1508 | + // If not html then we run the standard output. |
|
| 1509 | + if(empty($html)){ |
|
| 1510 | + |
|
| 1511 | + if (!empty($post->{$cf['htmlvar_name']})) { |
|
| 1512 | + |
|
| 1513 | + $field_icon = geodir_field_icon_proccess($cf); |
|
| 1514 | + if (strpos($field_icon, 'http') !== false) { |
|
| 1515 | + $field_icon_af = ''; |
|
| 1516 | + } elseif ($field_icon == '') { |
|
| 1517 | + $field_icon_af = ''; |
|
| 1518 | + } else { |
|
| 1519 | + $field_icon_af = $field_icon; |
|
| 1520 | + $field_icon = ''; |
|
| 1521 | + } |
|
| 1522 | + |
|
| 1523 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af; |
|
| 1524 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 1525 | + $html .= '</span>' . wpautop($post->{$cf['htmlvar_name']}) . '</div>'; |
|
| 1526 | + |
|
| 1527 | + } |
|
| 1528 | + |
|
| 1529 | + } |
|
| 1530 | + |
|
| 1531 | + return $html; |
|
| 1532 | 1532 | } |
| 1533 | 1533 | add_filter('geodir_custom_field_output_html','geodir_cf_html',10,3); |
| 1534 | 1534 | |
@@ -1546,113 +1546,113 @@ discard block |
||
| 1546 | 1546 | */ |
| 1547 | 1547 | function geodir_cf_taxonomy($html,$location,$cf,$p=''){ |
| 1548 | 1548 | |
| 1549 | - // check we have the post value |
|
| 1550 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 1551 | - else{ global $post;} |
|
| 1552 | - |
|
| 1553 | - if(!is_array($cf) && $cf!=''){ |
|
| 1554 | - $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 1555 | - if(!$cf){return NULL;} |
|
| 1556 | - } |
|
| 1557 | - |
|
| 1558 | - $html_var = $cf['htmlvar_name']; |
|
| 1559 | - |
|
| 1560 | - // Check if there is a location specific filter. |
|
| 1561 | - if(has_filter("geodir_custom_field_output_taxonomy_loc_{$location}")){ |
|
| 1562 | - /** |
|
| 1563 | - * Filter the taxonomy html by location. |
|
| 1564 | - * |
|
| 1565 | - * @param string $html The html to filter. |
|
| 1566 | - * @param array $cf The custom field array. |
|
| 1567 | - * @since 1.6.6 |
|
| 1568 | - */ |
|
| 1569 | - $html = apply_filters("geodir_custom_field_output_taxonomy_loc_{$location}",$html,$cf); |
|
| 1570 | - } |
|
| 1571 | - |
|
| 1572 | - // Check if there is a custom field specific filter. |
|
| 1573 | - if(has_filter("geodir_custom_field_output_taxonomy_var_{$html_var}")){ |
|
| 1574 | - /** |
|
| 1575 | - * Filter the taxonomy html by individual custom field. |
|
| 1576 | - * |
|
| 1577 | - * @param string $html The html to filter. |
|
| 1578 | - * @param string $location The location to output the html. |
|
| 1579 | - * @param array $cf The custom field array. |
|
| 1580 | - * @since 1.6.6 |
|
| 1581 | - */ |
|
| 1582 | - $html = apply_filters("geodir_custom_field_output_taxonomy_var_{$html_var}",$html,$location,$cf); |
|
| 1583 | - } |
|
| 1584 | - |
|
| 1585 | - // Check if there is a custom field key specific filter. |
|
| 1586 | - if(has_filter("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}")){ |
|
| 1587 | - /** |
|
| 1588 | - * Filter the taxonomy html by field type key. |
|
| 1589 | - * |
|
| 1590 | - * @param string $html The html to filter. |
|
| 1591 | - * @param string $location The location to output the html. |
|
| 1592 | - * @param array $cf The custom field array. |
|
| 1593 | - * @since 1.6.6 |
|
| 1594 | - */ |
|
| 1595 | - $html = apply_filters("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 1596 | - } |
|
| 1597 | - |
|
| 1598 | - // If not html then we run the standard output. |
|
| 1599 | - if(empty($html)){ |
|
| 1600 | - |
|
| 1601 | - if ($html_var == $post->post_type . 'category' && !empty($post->{$html_var})) { |
|
| 1602 | - $post_taxonomy = $post->post_type . 'category'; |
|
| 1603 | - $field_value = $post->{$html_var}; |
|
| 1604 | - $links = array(); |
|
| 1605 | - $terms = array(); |
|
| 1606 | - $termsOrdered = array(); |
|
| 1607 | - if (!is_array($field_value)) { |
|
| 1608 | - $field_value = explode(",", trim($field_value, ",")); |
|
| 1609 | - } |
|
| 1610 | - |
|
| 1611 | - $field_value = array_unique($field_value); |
|
| 1612 | - |
|
| 1613 | - if (!empty($field_value)) { |
|
| 1614 | - foreach ($field_value as $term) { |
|
| 1615 | - $term = trim($term); |
|
| 1616 | - |
|
| 1617 | - if ($term != '') { |
|
| 1618 | - $term = get_term_by('id', $term, $html_var); |
|
| 1619 | - if (is_object($term)) { |
|
| 1620 | - $links[] = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>" . $term->name . "</a>"; |
|
| 1621 | - $terms[] = $term; |
|
| 1622 | - } |
|
| 1623 | - } |
|
| 1624 | - } |
|
| 1625 | - if (!empty($links)) { |
|
| 1626 | - // order alphabetically |
|
| 1627 | - asort($links); |
|
| 1628 | - foreach (array_keys($links) as $key) { |
|
| 1629 | - $termsOrdered[$key] = $terms[$key]; |
|
| 1630 | - } |
|
| 1631 | - $terms = $termsOrdered; |
|
| 1632 | - } |
|
| 1633 | - } |
|
| 1634 | - $html_value = !empty($links) && !empty($terms) ? wp_sprintf('%l', $links, (object)$terms) : ''; |
|
| 1635 | - |
|
| 1636 | - if ($html_value != '') { |
|
| 1637 | - $field_icon = geodir_field_icon_proccess($cf); |
|
| 1638 | - if (strpos($field_icon, 'http') !== false) { |
|
| 1639 | - $field_icon_af = ''; |
|
| 1640 | - } else if ($field_icon == '') { |
|
| 1641 | - $field_icon_af = ''; |
|
| 1642 | - } else { |
|
| 1643 | - $field_icon_af = $field_icon; |
|
| 1644 | - $field_icon = ''; |
|
| 1645 | - } |
|
| 1646 | - |
|
| 1647 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $html_var . '" style="clear:both;"><span class="geodir-i-taxonomy geodir-i-category" style="' . $field_icon . '">' . $field_icon_af; |
|
| 1648 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 1649 | - $html .= '</span> ' . $html_value . '</div>'; |
|
| 1650 | - } |
|
| 1651 | - } |
|
| 1652 | - |
|
| 1653 | - } |
|
| 1654 | - |
|
| 1655 | - return $html; |
|
| 1549 | + // check we have the post value |
|
| 1550 | + if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 1551 | + else{ global $post;} |
|
| 1552 | + |
|
| 1553 | + if(!is_array($cf) && $cf!=''){ |
|
| 1554 | + $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 1555 | + if(!$cf){return NULL;} |
|
| 1556 | + } |
|
| 1557 | + |
|
| 1558 | + $html_var = $cf['htmlvar_name']; |
|
| 1559 | + |
|
| 1560 | + // Check if there is a location specific filter. |
|
| 1561 | + if(has_filter("geodir_custom_field_output_taxonomy_loc_{$location}")){ |
|
| 1562 | + /** |
|
| 1563 | + * Filter the taxonomy html by location. |
|
| 1564 | + * |
|
| 1565 | + * @param string $html The html to filter. |
|
| 1566 | + * @param array $cf The custom field array. |
|
| 1567 | + * @since 1.6.6 |
|
| 1568 | + */ |
|
| 1569 | + $html = apply_filters("geodir_custom_field_output_taxonomy_loc_{$location}",$html,$cf); |
|
| 1570 | + } |
|
| 1571 | + |
|
| 1572 | + // Check if there is a custom field specific filter. |
|
| 1573 | + if(has_filter("geodir_custom_field_output_taxonomy_var_{$html_var}")){ |
|
| 1574 | + /** |
|
| 1575 | + * Filter the taxonomy html by individual custom field. |
|
| 1576 | + * |
|
| 1577 | + * @param string $html The html to filter. |
|
| 1578 | + * @param string $location The location to output the html. |
|
| 1579 | + * @param array $cf The custom field array. |
|
| 1580 | + * @since 1.6.6 |
|
| 1581 | + */ |
|
| 1582 | + $html = apply_filters("geodir_custom_field_output_taxonomy_var_{$html_var}",$html,$location,$cf); |
|
| 1583 | + } |
|
| 1584 | + |
|
| 1585 | + // Check if there is a custom field key specific filter. |
|
| 1586 | + if(has_filter("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}")){ |
|
| 1587 | + /** |
|
| 1588 | + * Filter the taxonomy html by field type key. |
|
| 1589 | + * |
|
| 1590 | + * @param string $html The html to filter. |
|
| 1591 | + * @param string $location The location to output the html. |
|
| 1592 | + * @param array $cf The custom field array. |
|
| 1593 | + * @since 1.6.6 |
|
| 1594 | + */ |
|
| 1595 | + $html = apply_filters("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 1596 | + } |
|
| 1597 | + |
|
| 1598 | + // If not html then we run the standard output. |
|
| 1599 | + if(empty($html)){ |
|
| 1600 | + |
|
| 1601 | + if ($html_var == $post->post_type . 'category' && !empty($post->{$html_var})) { |
|
| 1602 | + $post_taxonomy = $post->post_type . 'category'; |
|
| 1603 | + $field_value = $post->{$html_var}; |
|
| 1604 | + $links = array(); |
|
| 1605 | + $terms = array(); |
|
| 1606 | + $termsOrdered = array(); |
|
| 1607 | + if (!is_array($field_value)) { |
|
| 1608 | + $field_value = explode(",", trim($field_value, ",")); |
|
| 1609 | + } |
|
| 1610 | + |
|
| 1611 | + $field_value = array_unique($field_value); |
|
| 1612 | + |
|
| 1613 | + if (!empty($field_value)) { |
|
| 1614 | + foreach ($field_value as $term) { |
|
| 1615 | + $term = trim($term); |
|
| 1616 | + |
|
| 1617 | + if ($term != '') { |
|
| 1618 | + $term = get_term_by('id', $term, $html_var); |
|
| 1619 | + if (is_object($term)) { |
|
| 1620 | + $links[] = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>" . $term->name . "</a>"; |
|
| 1621 | + $terms[] = $term; |
|
| 1622 | + } |
|
| 1623 | + } |
|
| 1624 | + } |
|
| 1625 | + if (!empty($links)) { |
|
| 1626 | + // order alphabetically |
|
| 1627 | + asort($links); |
|
| 1628 | + foreach (array_keys($links) as $key) { |
|
| 1629 | + $termsOrdered[$key] = $terms[$key]; |
|
| 1630 | + } |
|
| 1631 | + $terms = $termsOrdered; |
|
| 1632 | + } |
|
| 1633 | + } |
|
| 1634 | + $html_value = !empty($links) && !empty($terms) ? wp_sprintf('%l', $links, (object)$terms) : ''; |
|
| 1635 | + |
|
| 1636 | + if ($html_value != '') { |
|
| 1637 | + $field_icon = geodir_field_icon_proccess($cf); |
|
| 1638 | + if (strpos($field_icon, 'http') !== false) { |
|
| 1639 | + $field_icon_af = ''; |
|
| 1640 | + } else if ($field_icon == '') { |
|
| 1641 | + $field_icon_af = ''; |
|
| 1642 | + } else { |
|
| 1643 | + $field_icon_af = $field_icon; |
|
| 1644 | + $field_icon = ''; |
|
| 1645 | + } |
|
| 1646 | + |
|
| 1647 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $html_var . '" style="clear:both;"><span class="geodir-i-taxonomy geodir-i-category" style="' . $field_icon . '">' . $field_icon_af; |
|
| 1648 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 1649 | + $html .= '</span> ' . $html_value . '</div>'; |
|
| 1650 | + } |
|
| 1651 | + } |
|
| 1652 | + |
|
| 1653 | + } |
|
| 1654 | + |
|
| 1655 | + return $html; |
|
| 1656 | 1656 | } |
| 1657 | 1657 | add_filter('geodir_custom_field_output_taxonomy','geodir_cf_taxonomy',10,3); |
| 1658 | 1658 | |
@@ -1669,161 +1669,161 @@ discard block |
||
| 1669 | 1669 | */ |
| 1670 | 1670 | function geodir_cf_address($html,$location,$cf,$p=''){ |
| 1671 | 1671 | |
| 1672 | - // check we have the post value |
|
| 1673 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 1674 | - else{ global $post;} |
|
| 1675 | - |
|
| 1676 | - if(!is_array($cf) && $cf!=''){ |
|
| 1677 | - $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 1678 | - if(!$cf){return NULL;} |
|
| 1679 | - } |
|
| 1680 | - |
|
| 1681 | - $html_var = $cf['htmlvar_name']; |
|
| 1682 | - |
|
| 1683 | - // Check if there is a location specific filter. |
|
| 1684 | - if(has_filter("geodir_custom_field_output_address_loc_{$location}")){ |
|
| 1685 | - /** |
|
| 1686 | - * Filter the address html by location. |
|
| 1687 | - * |
|
| 1688 | - * @param string $html The html to filter. |
|
| 1689 | - * @param array $cf The custom field array. |
|
| 1690 | - * @since 1.6.6 |
|
| 1691 | - */ |
|
| 1692 | - $html = apply_filters("geodir_custom_field_output_address_loc_{$location}",$html,$cf); |
|
| 1693 | - } |
|
| 1694 | - |
|
| 1695 | - // Check if there is a custom field specific filter. |
|
| 1696 | - if(has_filter("geodir_custom_field_output_address_var_{$html_var}")){ |
|
| 1697 | - /** |
|
| 1698 | - * Filter the address html by individual custom field. |
|
| 1699 | - * |
|
| 1700 | - * @param string $html The html to filter. |
|
| 1701 | - * @param string $location The location to output the html. |
|
| 1702 | - * @param array $cf The custom field array. |
|
| 1703 | - * @since 1.6.6 |
|
| 1704 | - */ |
|
| 1705 | - $html = apply_filters("geodir_custom_field_output_address_var_{$html_var}",$html,$location,$cf); |
|
| 1706 | - } |
|
| 1707 | - |
|
| 1708 | - // Check if there is a custom field key specific filter. |
|
| 1709 | - if(has_filter("geodir_custom_field_output_address_key_{$cf['field_type_key']}")){ |
|
| 1710 | - /** |
|
| 1711 | - * Filter the address html by field type key. |
|
| 1712 | - * |
|
| 1713 | - * @param string $html The html to filter. |
|
| 1714 | - * @param string $location The location to output the html. |
|
| 1715 | - * @param array $cf The custom field array. |
|
| 1716 | - * @since 1.6.6 |
|
| 1717 | - */ |
|
| 1718 | - $html = apply_filters("geodir_custom_field_output_address_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 1719 | - } |
|
| 1720 | - |
|
| 1721 | - // If not html then we run the standard output. |
|
| 1722 | - if(empty($html)){ |
|
| 1723 | - |
|
| 1724 | - global $preview; |
|
| 1725 | - $html_var = $cf['htmlvar_name'] . '_address'; |
|
| 1726 | - |
|
| 1727 | - if ($cf['extra_fields']) { |
|
| 1728 | - |
|
| 1729 | - $extra_fields = stripslashes_deep(unserialize($cf['extra_fields'])); |
|
| 1730 | - |
|
| 1731 | - $addition_fields = ''; |
|
| 1732 | - |
|
| 1733 | - if (!empty($extra_fields)) { |
|
| 1734 | - |
|
| 1735 | - $show_city_in_address = false; |
|
| 1736 | - if (isset($extra_fields['show_city']) && $extra_fields['show_city']) { |
|
| 1737 | - $show_city_in_address = true; |
|
| 1738 | - } |
|
| 1739 | - /** |
|
| 1740 | - * Filter "show city in address" value. |
|
| 1741 | - * |
|
| 1742 | - * @since 1.0.0 |
|
| 1743 | - */ |
|
| 1744 | - $show_city_in_address = apply_filters('geodir_show_city_in_address', $show_city_in_address); |
|
| 1745 | - |
|
| 1746 | - |
|
| 1747 | - $show_region_in_address = false; |
|
| 1748 | - if (isset($extra_fields['show_region']) && $extra_fields['show_region']) { |
|
| 1749 | - $show_region_in_address = true; |
|
| 1750 | - } |
|
| 1751 | - /** |
|
| 1752 | - * Filter "show region in address" value. |
|
| 1753 | - * |
|
| 1754 | - * @since 1.6.6 |
|
| 1755 | - */ |
|
| 1756 | - $show_region_in_address = apply_filters('geodir_show_region_in_address', $show_region_in_address); |
|
| 1757 | - |
|
| 1758 | - $show_country_in_address = false; |
|
| 1759 | - if (isset($extra_fields['show_country']) && $extra_fields['show_country']) { |
|
| 1760 | - $show_country_in_address = true; |
|
| 1761 | - } |
|
| 1762 | - /** |
|
| 1763 | - * Filter "show country in address" value. |
|
| 1764 | - * |
|
| 1765 | - * @since 1.6.6 |
|
| 1766 | - */ |
|
| 1767 | - $show_country_in_address = apply_filters('geodir_show_country_in_address', $show_country_in_address); |
|
| 1768 | - |
|
| 1769 | - $show_zip_in_address = false; |
|
| 1770 | - if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) { |
|
| 1771 | - $show_zip_in_address = true; |
|
| 1772 | - } |
|
| 1773 | - /** |
|
| 1774 | - * Filter "show zip in address" value. |
|
| 1775 | - * |
|
| 1776 | - * @since 1.6.6 |
|
| 1777 | - */ |
|
| 1778 | - $show_zip_in_address = apply_filters('geodir_show_zip_in_address', $show_zip_in_address); |
|
| 1779 | - |
|
| 1780 | - |
|
| 1781 | - } |
|
| 1782 | - |
|
| 1783 | - } |
|
| 1784 | - |
|
| 1785 | - |
|
| 1786 | - if ($post->{$html_var}) { |
|
| 1787 | - |
|
| 1788 | - $field_icon = geodir_field_icon_proccess( $cf ); |
|
| 1789 | - if ( strpos( $field_icon, 'http' ) !== false ) { |
|
| 1790 | - $field_icon_af = ''; |
|
| 1791 | - } elseif ( $field_icon == '' ) { |
|
| 1792 | - $field_icon_af = '<i class="fa fa-home"></i>'; |
|
| 1793 | - } else { |
|
| 1794 | - $field_icon_af = $field_icon; |
|
| 1795 | - $field_icon = ''; |
|
| 1796 | - } |
|
| 1672 | + // check we have the post value |
|
| 1673 | + if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 1674 | + else{ global $post;} |
|
| 1675 | + |
|
| 1676 | + if(!is_array($cf) && $cf!=''){ |
|
| 1677 | + $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 1678 | + if(!$cf){return NULL;} |
|
| 1679 | + } |
|
| 1680 | + |
|
| 1681 | + $html_var = $cf['htmlvar_name']; |
|
| 1682 | + |
|
| 1683 | + // Check if there is a location specific filter. |
|
| 1684 | + if(has_filter("geodir_custom_field_output_address_loc_{$location}")){ |
|
| 1685 | + /** |
|
| 1686 | + * Filter the address html by location. |
|
| 1687 | + * |
|
| 1688 | + * @param string $html The html to filter. |
|
| 1689 | + * @param array $cf The custom field array. |
|
| 1690 | + * @since 1.6.6 |
|
| 1691 | + */ |
|
| 1692 | + $html = apply_filters("geodir_custom_field_output_address_loc_{$location}",$html,$cf); |
|
| 1693 | + } |
|
| 1694 | + |
|
| 1695 | + // Check if there is a custom field specific filter. |
|
| 1696 | + if(has_filter("geodir_custom_field_output_address_var_{$html_var}")){ |
|
| 1697 | + /** |
|
| 1698 | + * Filter the address html by individual custom field. |
|
| 1699 | + * |
|
| 1700 | + * @param string $html The html to filter. |
|
| 1701 | + * @param string $location The location to output the html. |
|
| 1702 | + * @param array $cf The custom field array. |
|
| 1703 | + * @since 1.6.6 |
|
| 1704 | + */ |
|
| 1705 | + $html = apply_filters("geodir_custom_field_output_address_var_{$html_var}",$html,$location,$cf); |
|
| 1706 | + } |
|
| 1707 | + |
|
| 1708 | + // Check if there is a custom field key specific filter. |
|
| 1709 | + if(has_filter("geodir_custom_field_output_address_key_{$cf['field_type_key']}")){ |
|
| 1710 | + /** |
|
| 1711 | + * Filter the address html by field type key. |
|
| 1712 | + * |
|
| 1713 | + * @param string $html The html to filter. |
|
| 1714 | + * @param string $location The location to output the html. |
|
| 1715 | + * @param array $cf The custom field array. |
|
| 1716 | + * @since 1.6.6 |
|
| 1717 | + */ |
|
| 1718 | + $html = apply_filters("geodir_custom_field_output_address_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 1719 | + } |
|
| 1720 | + |
|
| 1721 | + // If not html then we run the standard output. |
|
| 1722 | + if(empty($html)){ |
|
| 1723 | + |
|
| 1724 | + global $preview; |
|
| 1725 | + $html_var = $cf['htmlvar_name'] . '_address'; |
|
| 1726 | + |
|
| 1727 | + if ($cf['extra_fields']) { |
|
| 1728 | + |
|
| 1729 | + $extra_fields = stripslashes_deep(unserialize($cf['extra_fields'])); |
|
| 1730 | + |
|
| 1731 | + $addition_fields = ''; |
|
| 1732 | + |
|
| 1733 | + if (!empty($extra_fields)) { |
|
| 1734 | + |
|
| 1735 | + $show_city_in_address = false; |
|
| 1736 | + if (isset($extra_fields['show_city']) && $extra_fields['show_city']) { |
|
| 1737 | + $show_city_in_address = true; |
|
| 1738 | + } |
|
| 1739 | + /** |
|
| 1740 | + * Filter "show city in address" value. |
|
| 1741 | + * |
|
| 1742 | + * @since 1.0.0 |
|
| 1743 | + */ |
|
| 1744 | + $show_city_in_address = apply_filters('geodir_show_city_in_address', $show_city_in_address); |
|
| 1745 | + |
|
| 1746 | + |
|
| 1747 | + $show_region_in_address = false; |
|
| 1748 | + if (isset($extra_fields['show_region']) && $extra_fields['show_region']) { |
|
| 1749 | + $show_region_in_address = true; |
|
| 1750 | + } |
|
| 1751 | + /** |
|
| 1752 | + * Filter "show region in address" value. |
|
| 1753 | + * |
|
| 1754 | + * @since 1.6.6 |
|
| 1755 | + */ |
|
| 1756 | + $show_region_in_address = apply_filters('geodir_show_region_in_address', $show_region_in_address); |
|
| 1757 | + |
|
| 1758 | + $show_country_in_address = false; |
|
| 1759 | + if (isset($extra_fields['show_country']) && $extra_fields['show_country']) { |
|
| 1760 | + $show_country_in_address = true; |
|
| 1761 | + } |
|
| 1762 | + /** |
|
| 1763 | + * Filter "show country in address" value. |
|
| 1764 | + * |
|
| 1765 | + * @since 1.6.6 |
|
| 1766 | + */ |
|
| 1767 | + $show_country_in_address = apply_filters('geodir_show_country_in_address', $show_country_in_address); |
|
| 1768 | + |
|
| 1769 | + $show_zip_in_address = false; |
|
| 1770 | + if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) { |
|
| 1771 | + $show_zip_in_address = true; |
|
| 1772 | + } |
|
| 1773 | + /** |
|
| 1774 | + * Filter "show zip in address" value. |
|
| 1775 | + * |
|
| 1776 | + * @since 1.6.6 |
|
| 1777 | + */ |
|
| 1778 | + $show_zip_in_address = apply_filters('geodir_show_zip_in_address', $show_zip_in_address); |
|
| 1779 | + |
|
| 1780 | + |
|
| 1781 | + } |
|
| 1782 | + |
|
| 1783 | + } |
|
| 1784 | + |
|
| 1785 | + |
|
| 1786 | + if ($post->{$html_var}) { |
|
| 1787 | + |
|
| 1788 | + $field_icon = geodir_field_icon_proccess( $cf ); |
|
| 1789 | + if ( strpos( $field_icon, 'http' ) !== false ) { |
|
| 1790 | + $field_icon_af = ''; |
|
| 1791 | + } elseif ( $field_icon == '' ) { |
|
| 1792 | + $field_icon_af = '<i class="fa fa-home"></i>'; |
|
| 1793 | + } else { |
|
| 1794 | + $field_icon_af = $field_icon; |
|
| 1795 | + $field_icon = ''; |
|
| 1796 | + } |
|
| 1797 | 1797 | |
| 1798 | 1798 | |
| 1799 | 1799 | |
| 1800 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $html_var . '" style="clear:both;" itemscope itemtype="https://schema.org/PostalAddress">'; |
|
| 1801 | - $html .= '<span class="geodir-i-location" style="' . $field_icon . '">' . $field_icon_af; |
|
| 1802 | - $html .= ( trim( $cf['site_title'] ) ) ? __( $cf['site_title'], 'geodirectory' ) . ': ' : ' '; |
|
| 1803 | - $html .= '</span>'; |
|
| 1800 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $html_var . '" style="clear:both;" itemscope itemtype="https://schema.org/PostalAddress">'; |
|
| 1801 | + $html .= '<span class="geodir-i-location" style="' . $field_icon . '">' . $field_icon_af; |
|
| 1802 | + $html .= ( trim( $cf['site_title'] ) ) ? __( $cf['site_title'], 'geodirectory' ) . ': ' : ' '; |
|
| 1803 | + $html .= '</span>'; |
|
| 1804 | 1804 | |
| 1805 | - if ( isset($post->post_address) ) { |
|
| 1806 | - $html .= '<span itemprop="streetAddress">' . $post->post_address . '</span><br>'; |
|
| 1807 | - } |
|
| 1808 | - if ($show_city_in_address && isset( $post->post_city ) && $post->post_city ) { |
|
| 1809 | - $html .= '<span itemprop="addressLocality">' . $post->post_city . '</span><br>'; |
|
| 1810 | - } |
|
| 1811 | - if ($show_region_in_address && isset( $post->post_region ) && $post->post_region ) { |
|
| 1812 | - $html .= '<span itemprop="addressRegion">' . $post->post_region . '</span><br>'; |
|
| 1813 | - } |
|
| 1814 | - if ($show_zip_in_address && isset( $post->post_zip ) && $post->post_zip ) { |
|
| 1815 | - $html .= '<span itemprop="postalCode">' . $post->post_zip . '</span><br>'; |
|
| 1816 | - } |
|
| 1817 | - if ($show_country_in_address && isset( $post->post_country ) && $post->post_country ) { |
|
| 1818 | - $html .= '<span itemprop="addressCountry">' . __( $post->post_country, 'geodirectory' ) . '</span><br>'; |
|
| 1819 | - } |
|
| 1820 | - $html .= '</div>'; |
|
| 1805 | + if ( isset($post->post_address) ) { |
|
| 1806 | + $html .= '<span itemprop="streetAddress">' . $post->post_address . '</span><br>'; |
|
| 1807 | + } |
|
| 1808 | + if ($show_city_in_address && isset( $post->post_city ) && $post->post_city ) { |
|
| 1809 | + $html .= '<span itemprop="addressLocality">' . $post->post_city . '</span><br>'; |
|
| 1810 | + } |
|
| 1811 | + if ($show_region_in_address && isset( $post->post_region ) && $post->post_region ) { |
|
| 1812 | + $html .= '<span itemprop="addressRegion">' . $post->post_region . '</span><br>'; |
|
| 1813 | + } |
|
| 1814 | + if ($show_zip_in_address && isset( $post->post_zip ) && $post->post_zip ) { |
|
| 1815 | + $html .= '<span itemprop="postalCode">' . $post->post_zip . '</span><br>'; |
|
| 1816 | + } |
|
| 1817 | + if ($show_country_in_address && isset( $post->post_country ) && $post->post_country ) { |
|
| 1818 | + $html .= '<span itemprop="addressCountry">' . __( $post->post_country, 'geodirectory' ) . '</span><br>'; |
|
| 1819 | + } |
|
| 1820 | + $html .= '</div>'; |
|
| 1821 | 1821 | |
| 1822 | - } |
|
| 1822 | + } |
|
| 1823 | 1823 | |
| 1824 | - } |
|
| 1824 | + } |
|
| 1825 | 1825 | |
| 1826 | 1826 | |
| 1827 | - return $html; |
|
| 1827 | + return $html; |
|
| 1828 | 1828 | } |
| 1829 | 1829 | add_filter('geodir_custom_field_output_address','geodir_cf_address',10,3); |
| 1830 | 1830 | \ No newline at end of file |
@@ -19,21 +19,21 @@ discard block |
||
| 19 | 19 | * |
| 20 | 20 | * @return string The html to output for the custom field. |
| 21 | 21 | */ |
| 22 | -function geodir_cf_checkbox($html,$location,$cf,$p=''){ |
|
| 22 | +function geodir_cf_checkbox($html, $location, $cf, $p = '') { |
|
| 23 | 23 | |
| 24 | 24 | // check we have the post value |
| 25 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 26 | - else{ global $post;} |
|
| 25 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
| 26 | + else { global $post; } |
|
| 27 | 27 | |
| 28 | - if(!is_array($cf) && $cf!=''){ |
|
| 28 | + if (!is_array($cf) && $cf != '') { |
|
| 29 | 29 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
| 30 | - if(!$cf){return NULL;} |
|
| 30 | + if (!$cf) {return NULL; } |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | $html_var = $cf['htmlvar_name']; |
| 34 | 34 | |
| 35 | 35 | // Check if there is a location specific filter. |
| 36 | - if(has_filter("geodir_custom_field_output_checkbox_loc_{$location}")){ |
|
| 36 | + if (has_filter("geodir_custom_field_output_checkbox_loc_{$location}")) { |
|
| 37 | 37 | /** |
| 38 | 38 | * Filter the checkbox html by location. |
| 39 | 39 | * |
@@ -41,11 +41,11 @@ discard block |
||
| 41 | 41 | * @param array $cf The custom field array. |
| 42 | 42 | * @since 1.6.6 |
| 43 | 43 | */ |
| 44 | - $html = apply_filters("geodir_custom_field_output_checkbox_loc_{$location}",$html,$cf); |
|
| 44 | + $html = apply_filters("geodir_custom_field_output_checkbox_loc_{$location}", $html, $cf); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | // Check if there is a custom field specific filter. |
| 48 | - if(has_filter("geodir_custom_field_output_checkbox_var_{$html_var}")){ |
|
| 48 | + if (has_filter("geodir_custom_field_output_checkbox_var_{$html_var}")) { |
|
| 49 | 49 | /** |
| 50 | 50 | * Filter the checkbox html by individual custom field. |
| 51 | 51 | * |
@@ -54,11 +54,11 @@ discard block |
||
| 54 | 54 | * @param array $cf The custom field array. |
| 55 | 55 | * @since 1.6.6 |
| 56 | 56 | */ |
| 57 | - $html = apply_filters("geodir_custom_field_output_checkbox_var_{$html_var}",$html,$location,$cf); |
|
| 57 | + $html = apply_filters("geodir_custom_field_output_checkbox_var_{$html_var}", $html, $location, $cf); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | // Check if there is a custom field key specific filter. |
| 61 | - if(has_filter("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}")){ |
|
| 61 | + if (has_filter("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}")) { |
|
| 62 | 62 | /** |
| 63 | 63 | * Filter the checkbox html by field type key. |
| 64 | 64 | * |
@@ -67,18 +67,18 @@ discard block |
||
| 67 | 67 | * @param array $cf The custom field array. |
| 68 | 68 | * @since 1.6.6 |
| 69 | 69 | */ |
| 70 | - $html = apply_filters("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 70 | + $html = apply_filters("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | // If not html then we run the standard output. |
| 74 | - if(empty($html)){ |
|
| 74 | + if (empty($html)) { |
|
| 75 | 75 | |
| 76 | - if ( (int) $post->{$html_var} == 1 ): |
|
| 76 | + if ((int) $post->{$html_var} == 1): |
|
| 77 | 77 | |
| 78 | - if ( $post->{$html_var} == '1' ): |
|
| 79 | - $html_val = __( 'Yes', 'geodirectory' ); |
|
| 78 | + if ($post->{$html_var} == '1'): |
|
| 79 | + $html_val = __('Yes', 'geodirectory'); |
|
| 80 | 80 | else: |
| 81 | - $html_val = __( 'No', 'geodirectory' ); |
|
| 81 | + $html_val = __('No', 'geodirectory'); |
|
| 82 | 82 | endif; |
| 83 | 83 | |
| 84 | 84 | $field_icon = geodir_field_icon_proccess($cf); |
@@ -91,16 +91,16 @@ discard block |
||
| 91 | 91 | $field_icon = ''; |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-checkbox" style="' . $field_icon . '">' . $field_icon_af; |
|
| 95 | - $html .= ( trim( $cf['site_title'] ) ) ? __( $cf['site_title'], 'geodirectory' ) . ': ' : ''; |
|
| 96 | - $html .= '</span>' . $html_val . '</div>'; |
|
| 94 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-checkbox" style="'.$field_icon.'">'.$field_icon_af; |
|
| 95 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ''; |
|
| 96 | + $html .= '</span>'.$html_val.'</div>'; |
|
| 97 | 97 | endif; |
| 98 | 98 | |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | return $html; |
| 102 | 102 | } |
| 103 | -add_filter('geodir_custom_field_output_checkbox','geodir_cf_checkbox',10,3); |
|
| 103 | +add_filter('geodir_custom_field_output_checkbox', 'geodir_cf_checkbox', 10, 3); |
|
| 104 | 104 | |
| 105 | 105 | |
| 106 | 106 | /** |
@@ -113,21 +113,21 @@ discard block |
||
| 113 | 113 | * |
| 114 | 114 | * @return string The html to output for the custom field. |
| 115 | 115 | */ |
| 116 | -function geodir_cf_fieldset($html,$location,$cf,$p=''){ |
|
| 116 | +function geodir_cf_fieldset($html, $location, $cf, $p = '') { |
|
| 117 | 117 | |
| 118 | 118 | // check we have the post value |
| 119 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 120 | - else{ global $post;} |
|
| 119 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
| 120 | + else { global $post; } |
|
| 121 | 121 | |
| 122 | - if(!is_array($cf) && $cf!=''){ |
|
| 122 | + if (!is_array($cf) && $cf != '') { |
|
| 123 | 123 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
| 124 | - if(!$cf){return NULL;} |
|
| 124 | + if (!$cf) {return NULL; } |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | $html_var = $cf['htmlvar_name']; |
| 128 | 128 | |
| 129 | 129 | // Check if there is a location specific filter. |
| 130 | - if(has_filter("geodir_custom_field_output_fieldset_loc_{$location}")){ |
|
| 130 | + if (has_filter("geodir_custom_field_output_fieldset_loc_{$location}")) { |
|
| 131 | 131 | /** |
| 132 | 132 | * Filter the fieldset html by location. |
| 133 | 133 | * |
@@ -135,11 +135,11 @@ discard block |
||
| 135 | 135 | * @param array $cf The custom field array. |
| 136 | 136 | * @since 1.6.6 |
| 137 | 137 | */ |
| 138 | - $html = apply_filters("geodir_custom_field_output_fieldset_loc_{$location}",$html,$cf); |
|
| 138 | + $html = apply_filters("geodir_custom_field_output_fieldset_loc_{$location}", $html, $cf); |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | // Check if there is a custom field specific filter. |
| 142 | - if(has_filter("geodir_custom_field_output_fieldset_var_{$html_var}")){ |
|
| 142 | + if (has_filter("geodir_custom_field_output_fieldset_var_{$html_var}")) { |
|
| 143 | 143 | /** |
| 144 | 144 | * Filter the fieldset html by individual custom field. |
| 145 | 145 | * |
@@ -148,11 +148,11 @@ discard block |
||
| 148 | 148 | * @param array $cf The custom field array. |
| 149 | 149 | * @since 1.6.6 |
| 150 | 150 | */ |
| 151 | - $html = apply_filters("geodir_custom_field_output_fieldset_var_{$html_var}",$html,$location,$cf); |
|
| 151 | + $html = apply_filters("geodir_custom_field_output_fieldset_var_{$html_var}", $html, $location, $cf); |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | // Check if there is a custom field key specific filter. |
| 155 | - if(has_filter("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}")){ |
|
| 155 | + if (has_filter("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}")) { |
|
| 156 | 156 | /** |
| 157 | 157 | * Filter the fieldset html by field type key. |
| 158 | 158 | * |
@@ -161,11 +161,11 @@ discard block |
||
| 161 | 161 | * @param array $cf The custom field array. |
| 162 | 162 | * @since 1.6.6 |
| 163 | 163 | */ |
| 164 | - $html = apply_filters("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 164 | + $html = apply_filters("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | // If not html then we run the standard output. |
| 168 | - if(empty($html)){ |
|
| 168 | + if (empty($html)) { |
|
| 169 | 169 | |
| 170 | 170 | global $field_set_start; |
| 171 | 171 | $fieldset_class = 'fieldset-'.sanitize_title_with_dashes($cf['site_title']); |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | if ($field_set_start == 1) { |
| 174 | 174 | $html = ''; |
| 175 | 175 | } else { |
| 176 | - $html = '<h2 class="'.$fieldset_class.'">'. __($cf['site_title'], 'geodirectory') . '</h2>'; |
|
| 176 | + $html = '<h2 class="'.$fieldset_class.'">'.__($cf['site_title'], 'geodirectory').'</h2>'; |
|
| 177 | 177 | //$field_set_start = 1; |
| 178 | 178 | } |
| 179 | 179 | |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | |
| 182 | 182 | return $html; |
| 183 | 183 | } |
| 184 | -add_filter('geodir_custom_field_output_fieldset','geodir_cf_fieldset',10,3); |
|
| 184 | +add_filter('geodir_custom_field_output_fieldset', 'geodir_cf_fieldset', 10, 3); |
|
| 185 | 185 | |
| 186 | 186 | |
| 187 | 187 | /** |
@@ -194,21 +194,21 @@ discard block |
||
| 194 | 194 | * |
| 195 | 195 | * @return string The html to output for the custom field. |
| 196 | 196 | */ |
| 197 | -function geodir_cf_url($html,$location,$cf,$p=''){ |
|
| 197 | +function geodir_cf_url($html, $location, $cf, $p = '') { |
|
| 198 | 198 | |
| 199 | 199 | // check we have the post value |
| 200 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 201 | - else{ global $post;} |
|
| 200 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
| 201 | + else { global $post; } |
|
| 202 | 202 | |
| 203 | - if(!is_array($cf) && $cf!=''){ |
|
| 203 | + if (!is_array($cf) && $cf != '') { |
|
| 204 | 204 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
| 205 | - if(!$cf){return NULL;} |
|
| 205 | + if (!$cf) {return NULL; } |
|
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | $html_var = $cf['htmlvar_name']; |
| 209 | 209 | |
| 210 | 210 | // Check if there is a location specific filter. |
| 211 | - if(has_filter("geodir_custom_field_output_url_loc_{$location}")){ |
|
| 211 | + if (has_filter("geodir_custom_field_output_url_loc_{$location}")) { |
|
| 212 | 212 | /** |
| 213 | 213 | * Filter the url html by location. |
| 214 | 214 | * |
@@ -216,11 +216,11 @@ discard block |
||
| 216 | 216 | * @param array $cf The custom field array. |
| 217 | 217 | * @since 1.6.6 |
| 218 | 218 | */ |
| 219 | - $html = apply_filters("geodir_custom_field_output_url_loc_{$location}",$html,$cf); |
|
| 219 | + $html = apply_filters("geodir_custom_field_output_url_loc_{$location}", $html, $cf); |
|
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | // Check if there is a custom field specific filter. |
| 223 | - if(has_filter("geodir_custom_field_output_url_var_{$html_var}")){ |
|
| 223 | + if (has_filter("geodir_custom_field_output_url_var_{$html_var}")) { |
|
| 224 | 224 | /** |
| 225 | 225 | * Filter the url html by individual custom field. |
| 226 | 226 | * |
@@ -229,11 +229,11 @@ discard block |
||
| 229 | 229 | * @param array $cf The custom field array. |
| 230 | 230 | * @since 1.6.6 |
| 231 | 231 | */ |
| 232 | - $html = apply_filters("geodir_custom_field_output_url_var_{$html_var}",$html,$location,$cf); |
|
| 232 | + $html = apply_filters("geodir_custom_field_output_url_var_{$html_var}", $html, $location, $cf); |
|
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | // Check if there is a custom field key specific filter. |
| 236 | - if(has_filter("geodir_custom_field_output_url_key_{$cf['field_type_key']}")){ |
|
| 236 | + if (has_filter("geodir_custom_field_output_url_key_{$cf['field_type_key']}")) { |
|
| 237 | 237 | /** |
| 238 | 238 | * Filter the url html by field type key. |
| 239 | 239 | * |
@@ -242,11 +242,11 @@ discard block |
||
| 242 | 242 | * @param array $cf The custom field array. |
| 243 | 243 | * @since 1.6.6 |
| 244 | 244 | */ |
| 245 | - $html = apply_filters("geodir_custom_field_output_url_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 245 | + $html = apply_filters("geodir_custom_field_output_url_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
| 246 | 246 | } |
| 247 | 247 | |
| 248 | 248 | // If not html then we run the standard output. |
| 249 | - if(empty($html)){ |
|
| 249 | + if (empty($html)) { |
|
| 250 | 250 | |
| 251 | 251 | if ($post->{$cf['htmlvar_name']}): |
| 252 | 252 | |
@@ -273,7 +273,7 @@ discard block |
||
| 273 | 273 | |
| 274 | 274 | $website = !empty($a_url['url']) ? $a_url['url'] : ''; |
| 275 | 275 | $title = !empty($a_url['label']) ? $a_url['label'] : $cf['site_title']; |
| 276 | - if(!empty($cf['default_value'])){$title = $cf['default_value'];} |
|
| 276 | + if (!empty($cf['default_value'])) {$title = $cf['default_value']; } |
|
| 277 | 277 | $title = $title != '' ? __(stripslashes($title), 'geodirectory') : ''; |
| 278 | 278 | |
| 279 | 279 | |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | * @param string $website Website URL. |
| 290 | 290 | * @param int $post->ID Post ID. |
| 291 | 291 | */ |
| 292 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '"><span class="geodir-i-website" style="' . $field_icon . '">' . $field_icon_af . '<a href="' . $website . '" target="_blank" ' . $rel . ' ><strong>' . apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID) . '</strong></a></span></div>'; |
|
| 292 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'"><span class="geodir-i-website" style="'.$field_icon.'">'.$field_icon_af.'<a href="'.$website.'" target="_blank" '.$rel.' ><strong>'.apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID).'</strong></a></span></div>'; |
|
| 293 | 293 | |
| 294 | 294 | endif; |
| 295 | 295 | |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | |
| 298 | 298 | return $html; |
| 299 | 299 | } |
| 300 | -add_filter('geodir_custom_field_output_url','geodir_cf_url',10,3); |
|
| 300 | +add_filter('geodir_custom_field_output_url', 'geodir_cf_url', 10, 3); |
|
| 301 | 301 | |
| 302 | 302 | |
| 303 | 303 | /** |
@@ -310,21 +310,21 @@ discard block |
||
| 310 | 310 | * |
| 311 | 311 | * @return string The html to output for the custom field. |
| 312 | 312 | */ |
| 313 | -function geodir_cf_phone($html,$location,$cf,$p=''){ |
|
| 313 | +function geodir_cf_phone($html, $location, $cf, $p = '') { |
|
| 314 | 314 | |
| 315 | 315 | // check we have the post value |
| 316 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 317 | - else{ global $post;} |
|
| 316 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
| 317 | + else { global $post; } |
|
| 318 | 318 | |
| 319 | - if(!is_array($cf) && $cf!=''){ |
|
| 319 | + if (!is_array($cf) && $cf != '') { |
|
| 320 | 320 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
| 321 | - if(!$cf){return NULL;} |
|
| 321 | + if (!$cf) {return NULL; } |
|
| 322 | 322 | } |
| 323 | 323 | |
| 324 | 324 | $html_var = $cf['htmlvar_name']; |
| 325 | 325 | |
| 326 | 326 | // Check if there is a location specific filter. |
| 327 | - if(has_filter("geodir_custom_field_output_phone_loc_{$location}")){ |
|
| 327 | + if (has_filter("geodir_custom_field_output_phone_loc_{$location}")) { |
|
| 328 | 328 | /** |
| 329 | 329 | * Filter the phone html by location. |
| 330 | 330 | * |
@@ -332,11 +332,11 @@ discard block |
||
| 332 | 332 | * @param array $cf The custom field array. |
| 333 | 333 | * @since 1.6.6 |
| 334 | 334 | */ |
| 335 | - $html = apply_filters("geodir_custom_field_output_phone_loc_{$location}",$html,$cf); |
|
| 335 | + $html = apply_filters("geodir_custom_field_output_phone_loc_{$location}", $html, $cf); |
|
| 336 | 336 | } |
| 337 | 337 | |
| 338 | 338 | // Check if there is a custom field specific filter. |
| 339 | - if(has_filter("geodir_custom_field_output_phone_var_{$html_var}")){ |
|
| 339 | + if (has_filter("geodir_custom_field_output_phone_var_{$html_var}")) { |
|
| 340 | 340 | /** |
| 341 | 341 | * Filter the phone html by individual custom field. |
| 342 | 342 | * |
@@ -345,11 +345,11 @@ discard block |
||
| 345 | 345 | * @param array $cf The custom field array. |
| 346 | 346 | * @since 1.6.6 |
| 347 | 347 | */ |
| 348 | - $html = apply_filters("geodir_custom_field_output_phone_var_{$html_var}",$html,$location,$cf); |
|
| 348 | + $html = apply_filters("geodir_custom_field_output_phone_var_{$html_var}", $html, $location, $cf); |
|
| 349 | 349 | } |
| 350 | 350 | |
| 351 | 351 | // Check if there is a custom field key specific filter. |
| 352 | - if(has_filter("geodir_custom_field_output_phone_key_{$cf['field_type_key']}")){ |
|
| 352 | + if (has_filter("geodir_custom_field_output_phone_key_{$cf['field_type_key']}")) { |
|
| 353 | 353 | /** |
| 354 | 354 | * Filter the phone html by field type key. |
| 355 | 355 | * |
@@ -358,11 +358,11 @@ discard block |
||
| 358 | 358 | * @param array $cf The custom field array. |
| 359 | 359 | * @since 1.6.6 |
| 360 | 360 | */ |
| 361 | - $html = apply_filters("geodir_custom_field_output_phone_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 361 | + $html = apply_filters("geodir_custom_field_output_phone_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
| 362 | 362 | } |
| 363 | 363 | |
| 364 | 364 | // If not html then we run the standard output. |
| 365 | - if(empty($html)){ |
|
| 365 | + if (empty($html)) { |
|
| 366 | 366 | |
| 367 | 367 | if ($post->{$cf['htmlvar_name']}): |
| 368 | 368 | |
@@ -377,9 +377,9 @@ discard block |
||
| 377 | 377 | } |
| 378 | 378 | |
| 379 | 379 | |
| 380 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-contact" style="' . $field_icon . '">' . $field_icon_af . |
|
| 381 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ' '; |
|
| 382 | - $html .= '</span><a href="tel:' . preg_replace('/[^0-9+]/', '', $post->{$cf['htmlvar_name']}) . '">' . $post->{$cf['htmlvar_name']} . '</a></div>'; |
|
| 380 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-contact" style="'.$field_icon.'">'.$field_icon_af. |
|
| 381 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ' '; |
|
| 382 | + $html .= '</span><a href="tel:'.preg_replace('/[^0-9+]/', '', $post->{$cf['htmlvar_name']}).'">'.$post->{$cf['htmlvar_name']}.'</a></div>'; |
|
| 383 | 383 | |
| 384 | 384 | endif; |
| 385 | 385 | |
@@ -387,7 +387,7 @@ discard block |
||
| 387 | 387 | |
| 388 | 388 | return $html; |
| 389 | 389 | } |
| 390 | -add_filter('geodir_custom_field_output_phone','geodir_cf_phone',10,3); |
|
| 390 | +add_filter('geodir_custom_field_output_phone', 'geodir_cf_phone', 10, 3); |
|
| 391 | 391 | |
| 392 | 392 | |
| 393 | 393 | /** |
@@ -400,21 +400,21 @@ discard block |
||
| 400 | 400 | * |
| 401 | 401 | * @return string The html to output for the custom field. |
| 402 | 402 | */ |
| 403 | -function geodir_cf_time($html,$location,$cf,$p=''){ |
|
| 403 | +function geodir_cf_time($html, $location, $cf, $p = '') { |
|
| 404 | 404 | |
| 405 | 405 | // check we have the post value |
| 406 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 407 | - else{ global $post;} |
|
| 406 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
| 407 | + else { global $post; } |
|
| 408 | 408 | |
| 409 | - if(!is_array($cf) && $cf!=''){ |
|
| 409 | + if (!is_array($cf) && $cf != '') { |
|
| 410 | 410 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
| 411 | - if(!$cf){return NULL;} |
|
| 411 | + if (!$cf) {return NULL; } |
|
| 412 | 412 | } |
| 413 | 413 | |
| 414 | 414 | $html_var = $cf['htmlvar_name']; |
| 415 | 415 | |
| 416 | 416 | // Check if there is a location specific filter. |
| 417 | - if(has_filter("geodir_custom_field_output_time_loc_{$location}")){ |
|
| 417 | + if (has_filter("geodir_custom_field_output_time_loc_{$location}")) { |
|
| 418 | 418 | /** |
| 419 | 419 | * Filter the time html by location. |
| 420 | 420 | * |
@@ -422,11 +422,11 @@ discard block |
||
| 422 | 422 | * @param array $cf The custom field array. |
| 423 | 423 | * @since 1.6.6 |
| 424 | 424 | */ |
| 425 | - $html = apply_filters("geodir_custom_field_output_time_loc_{$location}",$html,$cf); |
|
| 425 | + $html = apply_filters("geodir_custom_field_output_time_loc_{$location}", $html, $cf); |
|
| 426 | 426 | } |
| 427 | 427 | |
| 428 | 428 | // Check if there is a custom field specific filter. |
| 429 | - if(has_filter("geodir_custom_field_output_time_var_{$html_var}")){ |
|
| 429 | + if (has_filter("geodir_custom_field_output_time_var_{$html_var}")) { |
|
| 430 | 430 | /** |
| 431 | 431 | * Filter the time html by individual custom field. |
| 432 | 432 | * |
@@ -435,11 +435,11 @@ discard block |
||
| 435 | 435 | * @param array $cf The custom field array. |
| 436 | 436 | * @since 1.6.6 |
| 437 | 437 | */ |
| 438 | - $html = apply_filters("geodir_custom_field_output_time_var_{$html_var}",$html,$location,$cf); |
|
| 438 | + $html = apply_filters("geodir_custom_field_output_time_var_{$html_var}", $html, $location, $cf); |
|
| 439 | 439 | } |
| 440 | 440 | |
| 441 | 441 | // Check if there is a custom field key specific filter. |
| 442 | - if(has_filter("geodir_custom_field_output_time_key_{$cf['field_type_key']}")){ |
|
| 442 | + if (has_filter("geodir_custom_field_output_time_key_{$cf['field_type_key']}")) { |
|
| 443 | 443 | /** |
| 444 | 444 | * Filter the time html by field type key. |
| 445 | 445 | * |
@@ -448,11 +448,11 @@ discard block |
||
| 448 | 448 | * @param array $cf The custom field array. |
| 449 | 449 | * @since 1.6.6 |
| 450 | 450 | */ |
| 451 | - $html = apply_filters("geodir_custom_field_output_time_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 451 | + $html = apply_filters("geodir_custom_field_output_time_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
| 452 | 452 | } |
| 453 | 453 | |
| 454 | 454 | // If not html then we run the standard output. |
| 455 | - if(empty($html)){ |
|
| 455 | + if (empty($html)) { |
|
| 456 | 456 | |
| 457 | 457 | if ($post->{$cf['htmlvar_name']}): |
| 458 | 458 | |
@@ -472,9 +472,9 @@ discard block |
||
| 472 | 472 | } |
| 473 | 473 | |
| 474 | 474 | |
| 475 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-time" style="' . $field_icon . '">' . $field_icon_af; |
|
| 476 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ' '; |
|
| 477 | - $html .= '</span>' . $value . '</div>'; |
|
| 475 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-time" style="'.$field_icon.'">'.$field_icon_af; |
|
| 476 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ' '; |
|
| 477 | + $html .= '</span>'.$value.'</div>'; |
|
| 478 | 478 | |
| 479 | 479 | endif; |
| 480 | 480 | |
@@ -482,7 +482,7 @@ discard block |
||
| 482 | 482 | |
| 483 | 483 | return $html; |
| 484 | 484 | } |
| 485 | -add_filter('geodir_custom_field_output_time','geodir_cf_time',10,3); |
|
| 485 | +add_filter('geodir_custom_field_output_time', 'geodir_cf_time', 10, 3); |
|
| 486 | 486 | |
| 487 | 487 | |
| 488 | 488 | /** |
@@ -495,21 +495,21 @@ discard block |
||
| 495 | 495 | * |
| 496 | 496 | * @return string The html to output for the custom field. |
| 497 | 497 | */ |
| 498 | -function geodir_cf_datepicker($html,$location,$cf,$p=''){ |
|
| 498 | +function geodir_cf_datepicker($html, $location, $cf, $p = '') { |
|
| 499 | 499 | global $preview; |
| 500 | 500 | // check we have the post value |
| 501 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 502 | - else{ global $post;} |
|
| 501 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
| 502 | + else { global $post; } |
|
| 503 | 503 | |
| 504 | - if(!is_array($cf) && $cf!=''){ |
|
| 504 | + if (!is_array($cf) && $cf != '') { |
|
| 505 | 505 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
| 506 | - if(!$cf){return NULL;} |
|
| 506 | + if (!$cf) {return NULL; } |
|
| 507 | 507 | } |
| 508 | 508 | |
| 509 | 509 | $html_var = $cf['htmlvar_name']; |
| 510 | 510 | |
| 511 | 511 | // Check if there is a location specific filter. |
| 512 | - if(has_filter("geodir_custom_field_output_datepicker_loc_{$location}")){ |
|
| 512 | + if (has_filter("geodir_custom_field_output_datepicker_loc_{$location}")) { |
|
| 513 | 513 | /** |
| 514 | 514 | * Filter the datepicker html by location. |
| 515 | 515 | * |
@@ -517,11 +517,11 @@ discard block |
||
| 517 | 517 | * @param array $cf The custom field array. |
| 518 | 518 | * @since 1.6.6 |
| 519 | 519 | */ |
| 520 | - $html = apply_filters("geodir_custom_field_output_datepicker_loc_{$location}",$html,$cf); |
|
| 520 | + $html = apply_filters("geodir_custom_field_output_datepicker_loc_{$location}", $html, $cf); |
|
| 521 | 521 | } |
| 522 | 522 | |
| 523 | 523 | // Check if there is a custom field specific filter. |
| 524 | - if(has_filter("geodir_custom_field_output_datepicker_var_{$html_var}")){ |
|
| 524 | + if (has_filter("geodir_custom_field_output_datepicker_var_{$html_var}")) { |
|
| 525 | 525 | /** |
| 526 | 526 | * Filter the datepicker html by individual custom field. |
| 527 | 527 | * |
@@ -530,11 +530,11 @@ discard block |
||
| 530 | 530 | * @param array $cf The custom field array. |
| 531 | 531 | * @since 1.6.6 |
| 532 | 532 | */ |
| 533 | - $html = apply_filters("geodir_custom_field_output_datepicker_var_{$html_var}",$html,$location,$cf); |
|
| 533 | + $html = apply_filters("geodir_custom_field_output_datepicker_var_{$html_var}", $html, $location, $cf); |
|
| 534 | 534 | } |
| 535 | 535 | |
| 536 | 536 | // Check if there is a custom field key specific filter. |
| 537 | - if(has_filter("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}")){ |
|
| 537 | + if (has_filter("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}")) { |
|
| 538 | 538 | /** |
| 539 | 539 | * Filter the datepicker html by field type key. |
| 540 | 540 | * |
@@ -543,11 +543,11 @@ discard block |
||
| 543 | 543 | * @param array $cf The custom field array. |
| 544 | 544 | * @since 1.6.6 |
| 545 | 545 | */ |
| 546 | - $html = apply_filters("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 546 | + $html = apply_filters("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
| 547 | 547 | } |
| 548 | 548 | |
| 549 | 549 | // If not html then we run the standard output. |
| 550 | - if(empty($html)){ |
|
| 550 | + if (empty($html)) { |
|
| 551 | 551 | |
| 552 | 552 | if ($post->{$cf['htmlvar_name']}): |
| 553 | 553 | |
@@ -558,24 +558,24 @@ discard block |
||
| 558 | 558 | } |
| 559 | 559 | // check if we need to change the format or not |
| 560 | 560 | $date_format_len = strlen(str_replace(' ', '', $date_format)); |
| 561 | - if($date_format_len>5){// if greater then 4 then it's the old style format. |
|
| 561 | + if ($date_format_len > 5) {// if greater then 4 then it's the old style format. |
|
| 562 | 562 | |
| 563 | - $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format |
|
| 564 | - $replace = array('d','j','l','m','n','F','Y');//PHP date format |
|
| 563 | + $search = array('dd', 'd', 'DD', 'mm', 'm', 'MM', 'yy'); //jQuery UI datepicker format |
|
| 564 | + $replace = array('d', 'j', 'l', 'm', 'n', 'F', 'Y'); //PHP date format |
|
| 565 | 565 | |
| 566 | 566 | $date_format = str_replace($search, $replace, $date_format); |
| 567 | 567 | |
| 568 | - $post_htmlvar_value = ($date_format == 'd/m/Y' || $date_format == 'j/n/Y' ) ? str_replace('/', '-', $post->{$cf['htmlvar_name']}) : $post->{$cf['htmlvar_name']}; // PHP doesn't work well with dd/mm/yyyy format |
|
| 569 | - }else{ |
|
| 568 | + $post_htmlvar_value = ($date_format == 'd/m/Y' || $date_format == 'j/n/Y') ? str_replace('/', '-', $post->{$cf['htmlvar_name']}) : $post->{$cf['htmlvar_name']}; // PHP doesn't work well with dd/mm/yyyy format |
|
| 569 | + } else { |
|
| 570 | 570 | $post_htmlvar_value = $post->{$cf['htmlvar_name']}; |
| 571 | 571 | } |
| 572 | 572 | |
| 573 | - if ($post->{$cf['htmlvar_name']} != '' && $post->{$cf['htmlvar_name']}!="0000-00-00") { |
|
| 573 | + if ($post->{$cf['htmlvar_name']} != '' && $post->{$cf['htmlvar_name']} != "0000-00-00") { |
|
| 574 | 574 | $date_format_from = $preview ? $date_format : 'Y-m-d'; |
| 575 | 575 | $value = geodir_date($post_htmlvar_value, $date_format, $date_format_from); // save as sql format Y-m-d |
| 576 | 576 | //$post_htmlvar_value = strpos($post_htmlvar_value, '/') !== false ? str_replace('/', '-', $post_htmlvar_value) : $post_htmlvar_value; |
| 577 | 577 | //$value = date_i18n($date_format, strtotime($post_htmlvar_value)); |
| 578 | - }else{ |
|
| 578 | + } else { |
|
| 579 | 579 | return ''; |
| 580 | 580 | } |
| 581 | 581 | |
@@ -592,9 +592,9 @@ discard block |
||
| 592 | 592 | |
| 593 | 593 | |
| 594 | 594 | |
| 595 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-datepicker" style="' . $field_icon . '">' . $field_icon_af; |
|
| 596 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 597 | - $html .= '</span>' . $value . '</div>'; |
|
| 595 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-datepicker" style="'.$field_icon.'">'.$field_icon_af; |
|
| 596 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ''; |
|
| 597 | + $html .= '</span>'.$value.'</div>'; |
|
| 598 | 598 | |
| 599 | 599 | endif; |
| 600 | 600 | |
@@ -602,7 +602,7 @@ discard block |
||
| 602 | 602 | |
| 603 | 603 | return $html; |
| 604 | 604 | } |
| 605 | -add_filter('geodir_custom_field_output_datepicker','geodir_cf_datepicker',10,3); |
|
| 605 | +add_filter('geodir_custom_field_output_datepicker', 'geodir_cf_datepicker', 10, 3); |
|
| 606 | 606 | |
| 607 | 607 | |
| 608 | 608 | /** |
@@ -615,21 +615,21 @@ discard block |
||
| 615 | 615 | * |
| 616 | 616 | * @return string The html to output for the custom field. |
| 617 | 617 | */ |
| 618 | -function geodir_cf_text($html,$location,$cf,$p=''){ |
|
| 618 | +function geodir_cf_text($html, $location, $cf, $p = '') { |
|
| 619 | 619 | |
| 620 | 620 | // check we have the post value |
| 621 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 622 | - else{ global $post;} |
|
| 621 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
| 622 | + else { global $post; } |
|
| 623 | 623 | |
| 624 | - if(!is_array($cf) && $cf!=''){ |
|
| 624 | + if (!is_array($cf) && $cf != '') { |
|
| 625 | 625 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
| 626 | - if(!$cf){return NULL;} |
|
| 626 | + if (!$cf) {return NULL; } |
|
| 627 | 627 | } |
| 628 | 628 | |
| 629 | 629 | $html_var = $cf['htmlvar_name']; |
| 630 | 630 | |
| 631 | 631 | // Check if there is a location specific filter. |
| 632 | - if(has_filter("geodir_custom_field_output_text_loc_{$location}")){ |
|
| 632 | + if (has_filter("geodir_custom_field_output_text_loc_{$location}")) { |
|
| 633 | 633 | /** |
| 634 | 634 | * Filter the text html by location. |
| 635 | 635 | * |
@@ -637,11 +637,11 @@ discard block |
||
| 637 | 637 | * @param array $cf The custom field array. |
| 638 | 638 | * @since 1.6.6 |
| 639 | 639 | */ |
| 640 | - $html = apply_filters("geodir_custom_field_output_text_loc_{$location}",$html,$cf); |
|
| 640 | + $html = apply_filters("geodir_custom_field_output_text_loc_{$location}", $html, $cf); |
|
| 641 | 641 | } |
| 642 | 642 | |
| 643 | 643 | // Check if there is a custom field specific filter. |
| 644 | - if(has_filter("geodir_custom_field_output_text_var_{$html_var}")){ |
|
| 644 | + if (has_filter("geodir_custom_field_output_text_var_{$html_var}")) { |
|
| 645 | 645 | /** |
| 646 | 646 | * Filter the text html by individual custom field. |
| 647 | 647 | * |
@@ -650,11 +650,11 @@ discard block |
||
| 650 | 650 | * @param array $cf The custom field array. |
| 651 | 651 | * @since 1.6.6 |
| 652 | 652 | */ |
| 653 | - $html = apply_filters("geodir_custom_field_output_text_var_{$html_var}",$html,$location,$cf); |
|
| 653 | + $html = apply_filters("geodir_custom_field_output_text_var_{$html_var}", $html, $location, $cf); |
|
| 654 | 654 | } |
| 655 | 655 | |
| 656 | 656 | // Check if there is a custom field key specific filter. |
| 657 | - if(has_filter("geodir_custom_field_output_text_key_{$cf['field_type_key']}")){ |
|
| 657 | + if (has_filter("geodir_custom_field_output_text_key_{$cf['field_type_key']}")) { |
|
| 658 | 658 | /** |
| 659 | 659 | * Filter the text html by field type key. |
| 660 | 660 | * |
@@ -663,15 +663,15 @@ discard block |
||
| 663 | 663 | * @param array $cf The custom field array. |
| 664 | 664 | * @since 1.6.6 |
| 665 | 665 | */ |
| 666 | - $html = apply_filters("geodir_custom_field_output_text_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 666 | + $html = apply_filters("geodir_custom_field_output_text_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
| 667 | 667 | } |
| 668 | 668 | |
| 669 | 669 | |
| 670 | 670 | |
| 671 | 671 | // If not html then we run the standard output. |
| 672 | - if(empty($html)){ |
|
| 672 | + if (empty($html)) { |
|
| 673 | 673 | |
| 674 | - if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != '' ): |
|
| 674 | + if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != ''): |
|
| 675 | 675 | |
| 676 | 676 | $class = ($cf['htmlvar_name'] == 'geodir_timing') ? "geodir-i-time" : "geodir-i-text"; |
| 677 | 677 | |
@@ -686,16 +686,16 @@ discard block |
||
| 686 | 686 | } |
| 687 | 687 | |
| 688 | 688 | |
| 689 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="'.$class.'" style="' . $field_icon . '">' . $field_icon_af; |
|
| 690 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 689 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="'.$class.'" style="'.$field_icon.'">'.$field_icon_af; |
|
| 690 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ''; |
|
| 691 | 691 | $html .= '</span>'; |
| 692 | 692 | |
| 693 | 693 | $value = $post->{$cf['htmlvar_name']}; |
| 694 | - if(isset($cf['data_type']) && ($cf['data_type']=='INT' || $cf['data_type']=='FLOAT') && isset($cf['extra_fields']) && $cf['extra_fields']){ |
|
| 694 | + if (isset($cf['data_type']) && ($cf['data_type'] == 'INT' || $cf['data_type'] == 'FLOAT') && isset($cf['extra_fields']) && $cf['extra_fields']) { |
|
| 695 | 695 | $extra_fields = stripslashes_deep(maybe_unserialize($cf['extra_fields'])); |
| 696 | - if(isset($extra_fields['is_price']) && $extra_fields['is_price']){ |
|
| 697 | - if(!$value>0){return '';}// dont output blank prices |
|
| 698 | - $value = geodir_currency_format_number($value,$cf); |
|
| 696 | + if (isset($extra_fields['is_price']) && $extra_fields['is_price']) { |
|
| 697 | + if (!$value > 0) {return ''; }// dont output blank prices |
|
| 698 | + $value = geodir_currency_format_number($value, $cf); |
|
| 699 | 699 | } |
| 700 | 700 | } |
| 701 | 701 | |
@@ -709,7 +709,7 @@ discard block |
||
| 709 | 709 | |
| 710 | 710 | return $html; |
| 711 | 711 | } |
| 712 | -add_filter('geodir_custom_field_output_text','geodir_cf_text',10,3); |
|
| 712 | +add_filter('geodir_custom_field_output_text', 'geodir_cf_text', 10, 3); |
|
| 713 | 713 | |
| 714 | 714 | |
| 715 | 715 | /** |
@@ -722,21 +722,21 @@ discard block |
||
| 722 | 722 | * |
| 723 | 723 | * @return string The html to output for the custom field. |
| 724 | 724 | */ |
| 725 | -function geodir_cf_radio($html,$location,$cf,$p=''){ |
|
| 725 | +function geodir_cf_radio($html, $location, $cf, $p = '') { |
|
| 726 | 726 | |
| 727 | 727 | // check we have the post value |
| 728 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 729 | - else{ global $post;} |
|
| 728 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
| 729 | + else { global $post; } |
|
| 730 | 730 | |
| 731 | - if(!is_array($cf) && $cf!=''){ |
|
| 731 | + if (!is_array($cf) && $cf != '') { |
|
| 732 | 732 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
| 733 | - if(!$cf){return NULL;} |
|
| 733 | + if (!$cf) {return NULL; } |
|
| 734 | 734 | } |
| 735 | 735 | |
| 736 | 736 | $html_var = $cf['htmlvar_name']; |
| 737 | 737 | |
| 738 | 738 | // Check if there is a location specific filter. |
| 739 | - if(has_filter("geodir_custom_field_output_radio_loc_{$location}")){ |
|
| 739 | + if (has_filter("geodir_custom_field_output_radio_loc_{$location}")) { |
|
| 740 | 740 | /** |
| 741 | 741 | * Filter the radio html by location. |
| 742 | 742 | * |
@@ -744,11 +744,11 @@ discard block |
||
| 744 | 744 | * @param array $cf The custom field array. |
| 745 | 745 | * @since 1.6.6 |
| 746 | 746 | */ |
| 747 | - $html = apply_filters("geodir_custom_field_output_radio_loc_{$location}",$html,$cf); |
|
| 747 | + $html = apply_filters("geodir_custom_field_output_radio_loc_{$location}", $html, $cf); |
|
| 748 | 748 | } |
| 749 | 749 | |
| 750 | 750 | // Check if there is a custom field specific filter. |
| 751 | - if(has_filter("geodir_custom_field_output_radio_var_{$html_var}")){ |
|
| 751 | + if (has_filter("geodir_custom_field_output_radio_var_{$html_var}")) { |
|
| 752 | 752 | /** |
| 753 | 753 | * Filter the radio html by individual custom field. |
| 754 | 754 | * |
@@ -757,11 +757,11 @@ discard block |
||
| 757 | 757 | * @param array $cf The custom field array. |
| 758 | 758 | * @since 1.6.6 |
| 759 | 759 | */ |
| 760 | - $html = apply_filters("geodir_custom_field_output_radio_var_{$html_var}",$html,$location,$cf); |
|
| 760 | + $html = apply_filters("geodir_custom_field_output_radio_var_{$html_var}", $html, $location, $cf); |
|
| 761 | 761 | } |
| 762 | 762 | |
| 763 | 763 | // Check if there is a custom field key specific filter. |
| 764 | - if(has_filter("geodir_custom_field_output_radio_key_{$cf['field_type_key']}")){ |
|
| 764 | + if (has_filter("geodir_custom_field_output_radio_key_{$cf['field_type_key']}")) { |
|
| 765 | 765 | /** |
| 766 | 766 | * Filter the radio html by field type key. |
| 767 | 767 | * |
@@ -770,11 +770,11 @@ discard block |
||
| 770 | 770 | * @param array $cf The custom field array. |
| 771 | 771 | * @since 1.6.6 |
| 772 | 772 | */ |
| 773 | - $html = apply_filters("geodir_custom_field_output_radio_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 773 | + $html = apply_filters("geodir_custom_field_output_radio_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
| 774 | 774 | } |
| 775 | 775 | |
| 776 | 776 | // If not html then we run the standard output. |
| 777 | - if(empty($html)){ |
|
| 777 | + if (empty($html)) { |
|
| 778 | 778 | |
| 779 | 779 | $html_val = isset($post->{$cf['htmlvar_name']}) ? __($post->{$cf['htmlvar_name']}, 'geodirectory') : ''; |
| 780 | 780 | if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != ''): |
@@ -808,16 +808,16 @@ discard block |
||
| 808 | 808 | } |
| 809 | 809 | |
| 810 | 810 | |
| 811 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-radio" style="' . $field_icon . '">' . $field_icon_af; |
|
| 812 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 813 | - $html .= '</span>' . $html_val . '</div>'; |
|
| 811 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-radio" style="'.$field_icon.'">'.$field_icon_af; |
|
| 812 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ''; |
|
| 813 | + $html .= '</span>'.$html_val.'</div>'; |
|
| 814 | 814 | endif; |
| 815 | 815 | |
| 816 | 816 | } |
| 817 | 817 | |
| 818 | 818 | return $html; |
| 819 | 819 | } |
| 820 | -add_filter('geodir_custom_field_output_radio','geodir_cf_radio',10,3); |
|
| 820 | +add_filter('geodir_custom_field_output_radio', 'geodir_cf_radio', 10, 3); |
|
| 821 | 821 | |
| 822 | 822 | |
| 823 | 823 | /** |
@@ -830,21 +830,21 @@ discard block |
||
| 830 | 830 | * |
| 831 | 831 | * @return string The html to output for the custom field. |
| 832 | 832 | */ |
| 833 | -function geodir_cf_select($html,$location,$cf,$p=''){ |
|
| 833 | +function geodir_cf_select($html, $location, $cf, $p = '') { |
|
| 834 | 834 | |
| 835 | 835 | // check we have the post value |
| 836 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 837 | - else{ global $post;} |
|
| 836 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
| 837 | + else { global $post; } |
|
| 838 | 838 | |
| 839 | - if(!is_array($cf) && $cf!=''){ |
|
| 839 | + if (!is_array($cf) && $cf != '') { |
|
| 840 | 840 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
| 841 | - if(!$cf){return NULL;} |
|
| 841 | + if (!$cf) {return NULL; } |
|
| 842 | 842 | } |
| 843 | 843 | |
| 844 | 844 | $html_var = $cf['htmlvar_name']; |
| 845 | 845 | |
| 846 | 846 | // Check if there is a location specific filter. |
| 847 | - if(has_filter("geodir_custom_field_output_select_loc_{$location}")){ |
|
| 847 | + if (has_filter("geodir_custom_field_output_select_loc_{$location}")) { |
|
| 848 | 848 | /** |
| 849 | 849 | * Filter the select html by location. |
| 850 | 850 | * |
@@ -852,11 +852,11 @@ discard block |
||
| 852 | 852 | * @param array $cf The custom field array. |
| 853 | 853 | * @since 1.6.6 |
| 854 | 854 | */ |
| 855 | - $html = apply_filters("geodir_custom_field_output_select_loc_{$location}",$html,$cf); |
|
| 855 | + $html = apply_filters("geodir_custom_field_output_select_loc_{$location}", $html, $cf); |
|
| 856 | 856 | } |
| 857 | 857 | |
| 858 | 858 | // Check if there is a custom field specific filter. |
| 859 | - if(has_filter("geodir_custom_field_output_select_var_{$html_var}")){ |
|
| 859 | + if (has_filter("geodir_custom_field_output_select_var_{$html_var}")) { |
|
| 860 | 860 | /** |
| 861 | 861 | * Filter the select html by individual custom field. |
| 862 | 862 | * |
@@ -865,11 +865,11 @@ discard block |
||
| 865 | 865 | * @param array $cf The custom field array. |
| 866 | 866 | * @since 1.6.6 |
| 867 | 867 | */ |
| 868 | - $html = apply_filters("geodir_custom_field_output_select_var_{$html_var}",$html,$location,$cf); |
|
| 868 | + $html = apply_filters("geodir_custom_field_output_select_var_{$html_var}", $html, $location, $cf); |
|
| 869 | 869 | } |
| 870 | 870 | |
| 871 | 871 | // Check if there is a custom field key specific filter. |
| 872 | - if(has_filter("geodir_custom_field_output_select_key_{$cf['field_type_key']}")){ |
|
| 872 | + if (has_filter("geodir_custom_field_output_select_key_{$cf['field_type_key']}")) { |
|
| 873 | 873 | /** |
| 874 | 874 | * Filter the select html by field type key. |
| 875 | 875 | * |
@@ -878,11 +878,11 @@ discard block |
||
| 878 | 878 | * @param array $cf The custom field array. |
| 879 | 879 | * @since 1.6.6 |
| 880 | 880 | */ |
| 881 | - $html = apply_filters("geodir_custom_field_output_select_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 881 | + $html = apply_filters("geodir_custom_field_output_select_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
| 882 | 882 | } |
| 883 | 883 | |
| 884 | 884 | // If not html then we run the standard output. |
| 885 | - if(empty($html)){ |
|
| 885 | + if (empty($html)) { |
|
| 886 | 886 | |
| 887 | 887 | if ($post->{$cf['htmlvar_name']}): |
| 888 | 888 | $field_value = __($post->{$cf['htmlvar_name']}, 'geodirectory'); |
@@ -910,16 +910,16 @@ discard block |
||
| 910 | 910 | } |
| 911 | 911 | |
| 912 | 912 | |
| 913 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af; |
|
| 914 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 915 | - $html .= '</span>' . $field_value . '</div>'; |
|
| 913 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-select" style="'.$field_icon.'">'.$field_icon_af; |
|
| 914 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ''; |
|
| 915 | + $html .= '</span>'.$field_value.'</div>'; |
|
| 916 | 916 | endif; |
| 917 | 917 | |
| 918 | 918 | } |
| 919 | 919 | |
| 920 | 920 | return $html; |
| 921 | 921 | } |
| 922 | -add_filter('geodir_custom_field_output_select','geodir_cf_select',10,3); |
|
| 922 | +add_filter('geodir_custom_field_output_select', 'geodir_cf_select', 10, 3); |
|
| 923 | 923 | |
| 924 | 924 | |
| 925 | 925 | /** |
@@ -932,21 +932,21 @@ discard block |
||
| 932 | 932 | * |
| 933 | 933 | * @return string The html to output for the custom field. |
| 934 | 934 | */ |
| 935 | -function geodir_cf_multiselect($html,$location,$cf,$p=''){ |
|
| 935 | +function geodir_cf_multiselect($html, $location, $cf, $p = '') { |
|
| 936 | 936 | |
| 937 | 937 | // check we have the post value |
| 938 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 939 | - else{ global $post;} |
|
| 938 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
| 939 | + else { global $post; } |
|
| 940 | 940 | |
| 941 | - if(!is_array($cf) && $cf!=''){ |
|
| 941 | + if (!is_array($cf) && $cf != '') { |
|
| 942 | 942 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
| 943 | - if(!$cf){return NULL;} |
|
| 943 | + if (!$cf) {return NULL; } |
|
| 944 | 944 | } |
| 945 | 945 | |
| 946 | 946 | $html_var = $cf['htmlvar_name']; |
| 947 | 947 | |
| 948 | 948 | // Check if there is a location specific filter. |
| 949 | - if(has_filter("geodir_custom_field_output_multiselect_loc_{$location}")){ |
|
| 949 | + if (has_filter("geodir_custom_field_output_multiselect_loc_{$location}")) { |
|
| 950 | 950 | /** |
| 951 | 951 | * Filter the multiselect html by location. |
| 952 | 952 | * |
@@ -954,11 +954,11 @@ discard block |
||
| 954 | 954 | * @param array $cf The custom field array. |
| 955 | 955 | * @since 1.6.6 |
| 956 | 956 | */ |
| 957 | - $html = apply_filters("geodir_custom_field_output_multiselect_loc_{$location}",$html,$cf); |
|
| 957 | + $html = apply_filters("geodir_custom_field_output_multiselect_loc_{$location}", $html, $cf); |
|
| 958 | 958 | } |
| 959 | 959 | |
| 960 | 960 | // Check if there is a custom field specific filter. |
| 961 | - if(has_filter("geodir_custom_field_output_multiselect_var_{$html_var}")){ |
|
| 961 | + if (has_filter("geodir_custom_field_output_multiselect_var_{$html_var}")) { |
|
| 962 | 962 | /** |
| 963 | 963 | * Filter the multiselect html by individual custom field. |
| 964 | 964 | * |
@@ -967,11 +967,11 @@ discard block |
||
| 967 | 967 | * @param array $cf The custom field array. |
| 968 | 968 | * @since 1.6.6 |
| 969 | 969 | */ |
| 970 | - $html = apply_filters("geodir_custom_field_output_multiselect_var_{$html_var}",$html,$location,$cf); |
|
| 970 | + $html = apply_filters("geodir_custom_field_output_multiselect_var_{$html_var}", $html, $location, $cf); |
|
| 971 | 971 | } |
| 972 | 972 | |
| 973 | 973 | // Check if there is a custom field key specific filter. |
| 974 | - if(has_filter("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}")){ |
|
| 974 | + if (has_filter("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}")) { |
|
| 975 | 975 | /** |
| 976 | 976 | * Filter the multiselect html by field type key. |
| 977 | 977 | * |
@@ -980,11 +980,11 @@ discard block |
||
| 980 | 980 | * @param array $cf The custom field array. |
| 981 | 981 | * @since 1.6.6 |
| 982 | 982 | */ |
| 983 | - $html = apply_filters("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 983 | + $html = apply_filters("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
| 984 | 984 | } |
| 985 | 985 | |
| 986 | 986 | // If not html then we run the standard output. |
| 987 | - if(empty($html)){ |
|
| 987 | + if (empty($html)) { |
|
| 988 | 988 | |
| 989 | 989 | |
| 990 | 990 | if (!empty($post->{$cf['htmlvar_name']})): |
@@ -1005,7 +1005,7 @@ discard block |
||
| 1005 | 1005 | |
| 1006 | 1006 | $field_values = explode(',', trim($post->{$cf['htmlvar_name']}, ",")); |
| 1007 | 1007 | |
| 1008 | - if(is_array($field_values)){ |
|
| 1008 | + if (is_array($field_values)) { |
|
| 1009 | 1009 | $field_values = array_map('trim', $field_values); |
| 1010 | 1010 | } |
| 1011 | 1011 | |
@@ -1023,15 +1023,15 @@ discard block |
||
| 1023 | 1023 | } |
| 1024 | 1024 | |
| 1025 | 1025 | |
| 1026 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af; |
|
| 1027 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 1026 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-select" style="'.$field_icon.'">'.$field_icon_af; |
|
| 1027 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ''; |
|
| 1028 | 1028 | $html .= '</span>'; |
| 1029 | 1029 | |
| 1030 | 1030 | if (count($option_values) > 1) { |
| 1031 | 1031 | $html .= '<ul>'; |
| 1032 | 1032 | |
| 1033 | 1033 | foreach ($option_values as $val) { |
| 1034 | - $html .= '<li>' . $val . '</li>'; |
|
| 1034 | + $html .= '<li>'.$val.'</li>'; |
|
| 1035 | 1035 | } |
| 1036 | 1036 | |
| 1037 | 1037 | $html .= '</ul>'; |
@@ -1046,7 +1046,7 @@ discard block |
||
| 1046 | 1046 | |
| 1047 | 1047 | return $html; |
| 1048 | 1048 | } |
| 1049 | -add_filter('geodir_custom_field_output_multiselect','geodir_cf_multiselect',10,3); |
|
| 1049 | +add_filter('geodir_custom_field_output_multiselect', 'geodir_cf_multiselect', 10, 3); |
|
| 1050 | 1050 | |
| 1051 | 1051 | |
| 1052 | 1052 | /** |
@@ -1059,21 +1059,21 @@ discard block |
||
| 1059 | 1059 | * |
| 1060 | 1060 | * @return string The html to output for the custom field. |
| 1061 | 1061 | */ |
| 1062 | -function geodir_cf_email($html,$location,$cf,$p=''){ |
|
| 1062 | +function geodir_cf_email($html, $location, $cf, $p = '') { |
|
| 1063 | 1063 | |
| 1064 | 1064 | // check we have the post value |
| 1065 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 1066 | - else{ global $post;} |
|
| 1065 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
| 1066 | + else { global $post; } |
|
| 1067 | 1067 | |
| 1068 | - if(!is_array($cf) && $cf!=''){ |
|
| 1068 | + if (!is_array($cf) && $cf != '') { |
|
| 1069 | 1069 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
| 1070 | - if(!$cf){return NULL;} |
|
| 1070 | + if (!$cf) {return NULL; } |
|
| 1071 | 1071 | } |
| 1072 | 1072 | |
| 1073 | 1073 | $html_var = $cf['htmlvar_name']; |
| 1074 | 1074 | |
| 1075 | 1075 | // Check if there is a location specific filter. |
| 1076 | - if(has_filter("geodir_custom_field_output_email_loc_{$location}")){ |
|
| 1076 | + if (has_filter("geodir_custom_field_output_email_loc_{$location}")) { |
|
| 1077 | 1077 | /** |
| 1078 | 1078 | * Filter the email html by location. |
| 1079 | 1079 | * |
@@ -1081,11 +1081,11 @@ discard block |
||
| 1081 | 1081 | * @param array $cf The custom field array. |
| 1082 | 1082 | * @since 1.6.6 |
| 1083 | 1083 | */ |
| 1084 | - $html = apply_filters("geodir_custom_field_output_email_loc_{$location}",$html,$cf); |
|
| 1084 | + $html = apply_filters("geodir_custom_field_output_email_loc_{$location}", $html, $cf); |
|
| 1085 | 1085 | } |
| 1086 | 1086 | |
| 1087 | 1087 | // Check if there is a custom field specific filter. |
| 1088 | - if(has_filter("geodir_custom_field_output_email_var_{$html_var}")){ |
|
| 1088 | + if (has_filter("geodir_custom_field_output_email_var_{$html_var}")) { |
|
| 1089 | 1089 | /** |
| 1090 | 1090 | * Filter the email html by individual custom field. |
| 1091 | 1091 | * |
@@ -1094,11 +1094,11 @@ discard block |
||
| 1094 | 1094 | * @param array $cf The custom field array. |
| 1095 | 1095 | * @since 1.6.6 |
| 1096 | 1096 | */ |
| 1097 | - $html = apply_filters("geodir_custom_field_output_email_var_{$html_var}",$html,$location,$cf); |
|
| 1097 | + $html = apply_filters("geodir_custom_field_output_email_var_{$html_var}", $html, $location, $cf); |
|
| 1098 | 1098 | } |
| 1099 | 1099 | |
| 1100 | 1100 | // Check if there is a custom field key specific filter. |
| 1101 | - if(has_filter("geodir_custom_field_output_email_key_{$cf['field_type_key']}")){ |
|
| 1101 | + if (has_filter("geodir_custom_field_output_email_key_{$cf['field_type_key']}")) { |
|
| 1102 | 1102 | /** |
| 1103 | 1103 | * Filter the email html by field type key. |
| 1104 | 1104 | * |
@@ -1107,18 +1107,18 @@ discard block |
||
| 1107 | 1107 | * @param array $cf The custom field array. |
| 1108 | 1108 | * @since 1.6.6 |
| 1109 | 1109 | */ |
| 1110 | - $html = apply_filters("geodir_custom_field_output_email_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 1110 | + $html = apply_filters("geodir_custom_field_output_email_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
| 1111 | 1111 | } |
| 1112 | 1112 | |
| 1113 | 1113 | // If not html then we run the standard output. |
| 1114 | - if(empty($html)){ |
|
| 1114 | + if (empty($html)) { |
|
| 1115 | 1115 | |
| 1116 | 1116 | global $preview; |
| 1117 | 1117 | if ($cf['htmlvar_name'] == 'geodir_email' && !(geodir_is_page('detail') || geodir_is_page('preview'))) { |
| 1118 | 1118 | return ''; // Remove Send Enquiry | Send To Friend from listings page |
| 1119 | 1119 | } |
| 1120 | 1120 | |
| 1121 | - $package_info = (array)geodir_post_package_info(array(), $post, $post->post_type); |
|
| 1121 | + $package_info = (array) geodir_post_package_info(array(), $post, $post->post_type); |
|
| 1122 | 1122 | |
| 1123 | 1123 | if ($cf['htmlvar_name'] == 'geodir_email' && ((isset($package_info['sendtofriend']) && $package_info['sendtofriend']) || $post->{$cf['htmlvar_name']})) { |
| 1124 | 1124 | global $send_to_friend; |
@@ -1130,7 +1130,7 @@ discard block |
||
| 1130 | 1130 | if (!$preview) { |
| 1131 | 1131 | $b_send_inquiry = 'b_send_inquiry'; |
| 1132 | 1132 | $b_sendtofriend = 'b_sendtofriend'; |
| 1133 | - $html = '<input type="hidden" name="geodir_popup_post_id" value="' . $post->ID . '" /><div class="geodir_display_popup_forms"></div>'; |
|
| 1133 | + $html = '<input type="hidden" name="geodir_popup_post_id" value="'.$post->ID.'" /><div class="geodir_display_popup_forms"></div>'; |
|
| 1134 | 1134 | } |
| 1135 | 1135 | |
| 1136 | 1136 | $field_icon = geodir_field_icon_proccess($cf); |
@@ -1143,26 +1143,26 @@ discard block |
||
| 1143 | 1143 | $field_icon = ''; |
| 1144 | 1144 | } |
| 1145 | 1145 | |
| 1146 | - $html .= '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af; |
|
| 1146 | + $html .= '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'"><span class="geodir-i-email" style="'.$field_icon.'">'.$field_icon_af; |
|
| 1147 | 1147 | $seperator = ''; |
| 1148 | 1148 | if ($post->{$cf['htmlvar_name']}) { |
| 1149 | - $html .= '<a href="javascript:void(0);" class="' . $b_send_inquiry . '" >' . SEND_INQUIRY . '</a>'; |
|
| 1149 | + $html .= '<a href="javascript:void(0);" class="'.$b_send_inquiry.'" >'.SEND_INQUIRY.'</a>'; |
|
| 1150 | 1150 | $seperator = ' | '; |
| 1151 | 1151 | } |
| 1152 | 1152 | |
| 1153 | 1153 | if (isset($package_info['sendtofriend']) && $package_info['sendtofriend']) { |
| 1154 | - $html .= $seperator . '<a href="javascript:void(0);" class="' . $b_sendtofriend . '">' . SEND_TO_FRIEND . '</a>'; |
|
| 1154 | + $html .= $seperator.'<a href="javascript:void(0);" class="'.$b_sendtofriend.'">'.SEND_TO_FRIEND.'</a>'; |
|
| 1155 | 1155 | } |
| 1156 | 1156 | |
| 1157 | 1157 | $html .= '</span></div>'; |
| 1158 | 1158 | |
| 1159 | 1159 | |
| 1160 | 1160 | if (isset($_REQUEST['send_inquiry']) && $_REQUEST['send_inquiry'] == 'success') { |
| 1161 | - $html .= '<p class="sucess_msg">' . SEND_INQUIRY_SUCCESS . '</p>'; |
|
| 1161 | + $html .= '<p class="sucess_msg">'.SEND_INQUIRY_SUCCESS.'</p>'; |
|
| 1162 | 1162 | } elseif (isset($_REQUEST['sendtofrnd']) && $_REQUEST['sendtofrnd'] == 'success') { |
| 1163 | - $html .= '<p class="sucess_msg">' . SEND_FRIEND_SUCCESS . '</p>'; |
|
| 1163 | + $html .= '<p class="sucess_msg">'.SEND_FRIEND_SUCCESS.'</p>'; |
|
| 1164 | 1164 | } elseif (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 'captch') { |
| 1165 | - $html .= '<p class="error_msg_fix">' . WRONG_CAPTCH_MSG . '</p>'; |
|
| 1165 | + $html .= '<p class="error_msg_fix">'.WRONG_CAPTCH_MSG.'</p>'; |
|
| 1166 | 1166 | } |
| 1167 | 1167 | |
| 1168 | 1168 | /*if(!$preview){require_once (geodir_plugin_path().'/geodirectory-templates/popup-forms.php');}*/ |
@@ -1182,11 +1182,11 @@ discard block |
||
| 1182 | 1182 | } |
| 1183 | 1183 | |
| 1184 | 1184 | |
| 1185 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af; |
|
| 1186 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 1185 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-email" style="'.$field_icon.'">'.$field_icon_af; |
|
| 1186 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ''; |
|
| 1187 | 1187 | $html .= '</span><span class="geodir-email-address-output">'; |
| 1188 | 1188 | $email = $post->{$cf['htmlvar_name']} ; |
| 1189 | - if($e_split = explode('@',$email)){ |
|
| 1189 | + if ($e_split = explode('@', $email)) { |
|
| 1190 | 1190 | /** |
| 1191 | 1191 | * Filter email custom field name output. |
| 1192 | 1192 | * |
@@ -1195,10 +1195,10 @@ discard block |
||
| 1195 | 1195 | * @param string $email The email string being output. |
| 1196 | 1196 | * @param array $cf Custom field variables array. |
| 1197 | 1197 | */ |
| 1198 | - $email_name = apply_filters('geodir_email_field_name_output',$email,$cf); |
|
| 1199 | - $html .= "<script>document.write('<a href=\"mailto:'+'$e_split[0]' + '@' + '$e_split[1]'+'\">$email_name</a>')</script>"; |
|
| 1200 | - }else{ |
|
| 1201 | - $html .= $email; |
|
| 1198 | + $email_name = apply_filters('geodir_email_field_name_output', $email, $cf); |
|
| 1199 | + $html .= "<script>document.write('<a href=\"mailto:'+'$e_split[0]' + '@' + '$e_split[1]'+'\">$email_name</a>')</script>"; |
|
| 1200 | + } else { |
|
| 1201 | + $html .= $email; |
|
| 1202 | 1202 | } |
| 1203 | 1203 | $html .= '</span></div>'; |
| 1204 | 1204 | } |
@@ -1209,7 +1209,7 @@ discard block |
||
| 1209 | 1209 | |
| 1210 | 1210 | return $html; |
| 1211 | 1211 | } |
| 1212 | -add_filter('geodir_custom_field_output_email','geodir_cf_email',10,3); |
|
| 1212 | +add_filter('geodir_custom_field_output_email', 'geodir_cf_email', 10, 3); |
|
| 1213 | 1213 | |
| 1214 | 1214 | |
| 1215 | 1215 | /** |
@@ -1222,21 +1222,21 @@ discard block |
||
| 1222 | 1222 | * |
| 1223 | 1223 | * @return string The html to output for the custom field. |
| 1224 | 1224 | */ |
| 1225 | -function geodir_cf_file($html,$location,$cf,$p=''){ |
|
| 1225 | +function geodir_cf_file($html, $location, $cf, $p = '') { |
|
| 1226 | 1226 | |
| 1227 | 1227 | // check we have the post value |
| 1228 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 1229 | - else{ global $post;} |
|
| 1228 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
| 1229 | + else { global $post; } |
|
| 1230 | 1230 | |
| 1231 | - if(!is_array($cf) && $cf!=''){ |
|
| 1231 | + if (!is_array($cf) && $cf != '') { |
|
| 1232 | 1232 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
| 1233 | - if(!$cf){return NULL;} |
|
| 1233 | + if (!$cf) {return NULL; } |
|
| 1234 | 1234 | } |
| 1235 | 1235 | |
| 1236 | 1236 | $html_var = $cf['htmlvar_name']; |
| 1237 | 1237 | |
| 1238 | 1238 | // Check if there is a location specific filter. |
| 1239 | - if(has_filter("geodir_custom_field_output_file_loc_{$location}")){ |
|
| 1239 | + if (has_filter("geodir_custom_field_output_file_loc_{$location}")) { |
|
| 1240 | 1240 | /** |
| 1241 | 1241 | * Filter the file html by location. |
| 1242 | 1242 | * |
@@ -1244,11 +1244,11 @@ discard block |
||
| 1244 | 1244 | * @param array $cf The custom field array. |
| 1245 | 1245 | * @since 1.6.6 |
| 1246 | 1246 | */ |
| 1247 | - $html = apply_filters("geodir_custom_field_output_file_loc_{$location}",$html,$cf); |
|
| 1247 | + $html = apply_filters("geodir_custom_field_output_file_loc_{$location}", $html, $cf); |
|
| 1248 | 1248 | } |
| 1249 | 1249 | |
| 1250 | 1250 | // Check if there is a custom field specific filter. |
| 1251 | - if(has_filter("geodir_custom_field_output_file_var_{$html_var}")){ |
|
| 1251 | + if (has_filter("geodir_custom_field_output_file_var_{$html_var}")) { |
|
| 1252 | 1252 | /** |
| 1253 | 1253 | * Filter the file html by individual custom field. |
| 1254 | 1254 | * |
@@ -1257,11 +1257,11 @@ discard block |
||
| 1257 | 1257 | * @param array $cf The custom field array. |
| 1258 | 1258 | * @since 1.6.6 |
| 1259 | 1259 | */ |
| 1260 | - $html = apply_filters("geodir_custom_field_output_file_var_{$html_var}",$html,$location,$cf); |
|
| 1260 | + $html = apply_filters("geodir_custom_field_output_file_var_{$html_var}", $html, $location, $cf); |
|
| 1261 | 1261 | } |
| 1262 | 1262 | |
| 1263 | 1263 | // Check if there is a custom field key specific filter. |
| 1264 | - if(has_filter("geodir_custom_field_output_file_key_{$cf['field_type_key']}")){ |
|
| 1264 | + if (has_filter("geodir_custom_field_output_file_key_{$cf['field_type_key']}")) { |
|
| 1265 | 1265 | /** |
| 1266 | 1266 | * Filter the file html by field type key. |
| 1267 | 1267 | * |
@@ -1270,11 +1270,11 @@ discard block |
||
| 1270 | 1270 | * @param array $cf The custom field array. |
| 1271 | 1271 | * @since 1.6.6 |
| 1272 | 1272 | */ |
| 1273 | - $html = apply_filters("geodir_custom_field_output_file_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 1273 | + $html = apply_filters("geodir_custom_field_output_file_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
| 1274 | 1274 | } |
| 1275 | 1275 | |
| 1276 | 1276 | // If not html then we run the standard output. |
| 1277 | - if(empty($html)){ |
|
| 1277 | + if (empty($html)) { |
|
| 1278 | 1278 | |
| 1279 | 1279 | if (!empty($post->{$cf['htmlvar_name']})): |
| 1280 | 1280 | |
@@ -1282,7 +1282,7 @@ discard block |
||
| 1282 | 1282 | if (!empty($files)): |
| 1283 | 1283 | |
| 1284 | 1284 | $extra_fields = !empty($cf['extra_fields']) ? stripslashes_deep(maybe_unserialize($cf['extra_fields'])) : NULL; |
| 1285 | - $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types'] ) ? $extra_fields['gd_file_types'] : ''; |
|
| 1285 | + $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types']) ? $extra_fields['gd_file_types'] : ''; |
|
| 1286 | 1286 | |
| 1287 | 1287 | $file_paths = ''; |
| 1288 | 1288 | foreach ($files as $file) { |
@@ -1319,9 +1319,9 @@ discard block |
||
| 1319 | 1319 | //$file_paths .= '<img src="'.$file.'" />'; |
| 1320 | 1320 | $file_paths .= '</div>'; |
| 1321 | 1321 | } else { |
| 1322 | - $ext_path = '_' . $html_var . '_'; |
|
| 1322 | + $ext_path = '_'.$html_var.'_'; |
|
| 1323 | 1323 | $filename = explode($ext_path, $filename); |
| 1324 | - $file_paths .= '<a href="' . $file . '" target="_blank">' . $filename[count($filename) - 1] . '</a>'; |
|
| 1324 | + $file_paths .= '<a href="'.$file.'" target="_blank">'.$filename[count($filename) - 1].'</a>'; |
|
| 1325 | 1325 | } |
| 1326 | 1326 | } |
| 1327 | 1327 | } |
@@ -1336,11 +1336,11 @@ discard block |
||
| 1336 | 1336 | $field_icon = ''; |
| 1337 | 1337 | } |
| 1338 | 1338 | |
| 1339 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' geodir-custom-file-box ' . $cf['htmlvar_name'] . '"><div class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af; |
|
| 1339 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' geodir-custom-file-box '.$cf['htmlvar_name'].'"><div class="geodir-i-select" style="'.$field_icon.'">'.$field_icon_af; |
|
| 1340 | 1340 | $html .= '<span style="display: inline-block; vertical-align: top; padding-right: 14px;">'; |
| 1341 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 1341 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ''; |
|
| 1342 | 1342 | $html .= '</span>'; |
| 1343 | - $html .= $file_paths . '</div></div>'; |
|
| 1343 | + $html .= $file_paths.'</div></div>'; |
|
| 1344 | 1344 | |
| 1345 | 1345 | endif; |
| 1346 | 1346 | endif; |
@@ -1349,7 +1349,7 @@ discard block |
||
| 1349 | 1349 | |
| 1350 | 1350 | return $html; |
| 1351 | 1351 | } |
| 1352 | -add_filter('geodir_custom_field_output_file','geodir_cf_file',10,3); |
|
| 1352 | +add_filter('geodir_custom_field_output_file', 'geodir_cf_file', 10, 3); |
|
| 1353 | 1353 | |
| 1354 | 1354 | |
| 1355 | 1355 | |
@@ -1363,21 +1363,21 @@ discard block |
||
| 1363 | 1363 | * |
| 1364 | 1364 | * @return string The html to output for the custom field. |
| 1365 | 1365 | */ |
| 1366 | -function geodir_cf_textarea($html,$location,$cf,$p=''){ |
|
| 1366 | +function geodir_cf_textarea($html, $location, $cf, $p = '') { |
|
| 1367 | 1367 | |
| 1368 | 1368 | // check we have the post value |
| 1369 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 1370 | - else{ global $post;} |
|
| 1369 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
| 1370 | + else { global $post; } |
|
| 1371 | 1371 | |
| 1372 | - if(!is_array($cf) && $cf!=''){ |
|
| 1372 | + if (!is_array($cf) && $cf != '') { |
|
| 1373 | 1373 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
| 1374 | - if(!$cf){return NULL;} |
|
| 1374 | + if (!$cf) {return NULL; } |
|
| 1375 | 1375 | } |
| 1376 | 1376 | |
| 1377 | 1377 | $html_var = $cf['htmlvar_name']; |
| 1378 | 1378 | |
| 1379 | 1379 | // Check if there is a location specific filter. |
| 1380 | - if(has_filter("geodir_custom_field_output_textarea_loc_{$location}")){ |
|
| 1380 | + if (has_filter("geodir_custom_field_output_textarea_loc_{$location}")) { |
|
| 1381 | 1381 | /** |
| 1382 | 1382 | * Filter the textarea html by location. |
| 1383 | 1383 | * |
@@ -1385,11 +1385,11 @@ discard block |
||
| 1385 | 1385 | * @param array $cf The custom field array. |
| 1386 | 1386 | * @since 1.6.6 |
| 1387 | 1387 | */ |
| 1388 | - $html = apply_filters("geodir_custom_field_output_textarea_loc_{$location}",$html,$cf); |
|
| 1388 | + $html = apply_filters("geodir_custom_field_output_textarea_loc_{$location}", $html, $cf); |
|
| 1389 | 1389 | } |
| 1390 | 1390 | |
| 1391 | 1391 | // Check if there is a custom field specific filter. |
| 1392 | - if(has_filter("geodir_custom_field_output_textarea_var_{$html_var}")){ |
|
| 1392 | + if (has_filter("geodir_custom_field_output_textarea_var_{$html_var}")) { |
|
| 1393 | 1393 | /** |
| 1394 | 1394 | * Filter the textarea html by individual custom field. |
| 1395 | 1395 | * |
@@ -1398,11 +1398,11 @@ discard block |
||
| 1398 | 1398 | * @param array $cf The custom field array. |
| 1399 | 1399 | * @since 1.6.6 |
| 1400 | 1400 | */ |
| 1401 | - $html = apply_filters("geodir_custom_field_output_textarea_var_{$html_var}",$html,$location,$cf); |
|
| 1401 | + $html = apply_filters("geodir_custom_field_output_textarea_var_{$html_var}", $html, $location, $cf); |
|
| 1402 | 1402 | } |
| 1403 | 1403 | |
| 1404 | 1404 | // Check if there is a custom field key specific filter. |
| 1405 | - if(has_filter("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}")){ |
|
| 1405 | + if (has_filter("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}")) { |
|
| 1406 | 1406 | /** |
| 1407 | 1407 | * Filter the textarea html by field type key. |
| 1408 | 1408 | * |
@@ -1411,11 +1411,11 @@ discard block |
||
| 1411 | 1411 | * @param array $cf The custom field array. |
| 1412 | 1412 | * @since 1.6.6 |
| 1413 | 1413 | */ |
| 1414 | - $html = apply_filters("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 1414 | + $html = apply_filters("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
| 1415 | 1415 | } |
| 1416 | 1416 | |
| 1417 | 1417 | // If not html then we run the standard output. |
| 1418 | - if(empty($html)){ |
|
| 1418 | + if (empty($html)) { |
|
| 1419 | 1419 | |
| 1420 | 1420 | if (!empty($post->{$cf['htmlvar_name']})) { |
| 1421 | 1421 | |
@@ -1430,9 +1430,9 @@ discard block |
||
| 1430 | 1430 | } |
| 1431 | 1431 | |
| 1432 | 1432 | |
| 1433 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af; |
|
| 1434 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 1435 | - $html .= '</span>' . wpautop($post->{$cf['htmlvar_name']}) . '</div>'; |
|
| 1433 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-text" style="'.$field_icon.'">'.$field_icon_af; |
|
| 1434 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ''; |
|
| 1435 | + $html .= '</span>'.wpautop($post->{$cf['htmlvar_name']}).'</div>'; |
|
| 1436 | 1436 | |
| 1437 | 1437 | } |
| 1438 | 1438 | |
@@ -1440,7 +1440,7 @@ discard block |
||
| 1440 | 1440 | |
| 1441 | 1441 | return $html; |
| 1442 | 1442 | } |
| 1443 | -add_filter('geodir_custom_field_output_textarea','geodir_cf_textarea',10,3); |
|
| 1443 | +add_filter('geodir_custom_field_output_textarea', 'geodir_cf_textarea', 10, 3); |
|
| 1444 | 1444 | |
| 1445 | 1445 | |
| 1446 | 1446 | |
@@ -1454,21 +1454,21 @@ discard block |
||
| 1454 | 1454 | * |
| 1455 | 1455 | * @return string The html to output for the custom field. |
| 1456 | 1456 | */ |
| 1457 | -function geodir_cf_html($html,$location,$cf,$p=''){ |
|
| 1457 | +function geodir_cf_html($html, $location, $cf, $p = '') { |
|
| 1458 | 1458 | |
| 1459 | 1459 | // check we have the post value |
| 1460 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 1461 | - else{ global $post;} |
|
| 1460 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
| 1461 | + else { global $post; } |
|
| 1462 | 1462 | |
| 1463 | - if(!is_array($cf) && $cf!=''){ |
|
| 1463 | + if (!is_array($cf) && $cf != '') { |
|
| 1464 | 1464 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
| 1465 | - if(!$cf){return NULL;} |
|
| 1465 | + if (!$cf) {return NULL; } |
|
| 1466 | 1466 | } |
| 1467 | 1467 | |
| 1468 | 1468 | $html_var = $cf['htmlvar_name']; |
| 1469 | 1469 | |
| 1470 | 1470 | // Check if there is a location specific filter. |
| 1471 | - if(has_filter("geodir_custom_field_output_html_loc_{$location}")){ |
|
| 1471 | + if (has_filter("geodir_custom_field_output_html_loc_{$location}")) { |
|
| 1472 | 1472 | /** |
| 1473 | 1473 | * Filter the html html by location. |
| 1474 | 1474 | * |
@@ -1476,11 +1476,11 @@ discard block |
||
| 1476 | 1476 | * @param array $cf The custom field array. |
| 1477 | 1477 | * @since 1.6.6 |
| 1478 | 1478 | */ |
| 1479 | - $html = apply_filters("geodir_custom_field_output_html_loc_{$location}",$html,$cf); |
|
| 1479 | + $html = apply_filters("geodir_custom_field_output_html_loc_{$location}", $html, $cf); |
|
| 1480 | 1480 | } |
| 1481 | 1481 | |
| 1482 | 1482 | // Check if there is a custom field specific filter. |
| 1483 | - if(has_filter("geodir_custom_field_output_html_var_{$html_var}")){ |
|
| 1483 | + if (has_filter("geodir_custom_field_output_html_var_{$html_var}")) { |
|
| 1484 | 1484 | /** |
| 1485 | 1485 | * Filter the html html by individual custom field. |
| 1486 | 1486 | * |
@@ -1489,11 +1489,11 @@ discard block |
||
| 1489 | 1489 | * @param array $cf The custom field array. |
| 1490 | 1490 | * @since 1.6.6 |
| 1491 | 1491 | */ |
| 1492 | - $html = apply_filters("geodir_custom_field_output_html_var_{$html_var}",$html,$location,$cf); |
|
| 1492 | + $html = apply_filters("geodir_custom_field_output_html_var_{$html_var}", $html, $location, $cf); |
|
| 1493 | 1493 | } |
| 1494 | 1494 | |
| 1495 | 1495 | // Check if there is a custom field key specific filter. |
| 1496 | - if(has_filter("geodir_custom_field_output_html_key_{$cf['field_type_key']}")){ |
|
| 1496 | + if (has_filter("geodir_custom_field_output_html_key_{$cf['field_type_key']}")) { |
|
| 1497 | 1497 | /** |
| 1498 | 1498 | * Filter the html html by field type key. |
| 1499 | 1499 | * |
@@ -1502,11 +1502,11 @@ discard block |
||
| 1502 | 1502 | * @param array $cf The custom field array. |
| 1503 | 1503 | * @since 1.6.6 |
| 1504 | 1504 | */ |
| 1505 | - $html = apply_filters("geodir_custom_field_output_html_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 1505 | + $html = apply_filters("geodir_custom_field_output_html_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
| 1506 | 1506 | } |
| 1507 | 1507 | |
| 1508 | 1508 | // If not html then we run the standard output. |
| 1509 | - if(empty($html)){ |
|
| 1509 | + if (empty($html)) { |
|
| 1510 | 1510 | |
| 1511 | 1511 | if (!empty($post->{$cf['htmlvar_name']})) { |
| 1512 | 1512 | |
@@ -1520,9 +1520,9 @@ discard block |
||
| 1520 | 1520 | $field_icon = ''; |
| 1521 | 1521 | } |
| 1522 | 1522 | |
| 1523 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af; |
|
| 1524 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 1525 | - $html .= '</span>' . wpautop($post->{$cf['htmlvar_name']}) . '</div>'; |
|
| 1523 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-text" style="'.$field_icon.'">'.$field_icon_af; |
|
| 1524 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ''; |
|
| 1525 | + $html .= '</span>'.wpautop($post->{$cf['htmlvar_name']}).'</div>'; |
|
| 1526 | 1526 | |
| 1527 | 1527 | } |
| 1528 | 1528 | |
@@ -1530,7 +1530,7 @@ discard block |
||
| 1530 | 1530 | |
| 1531 | 1531 | return $html; |
| 1532 | 1532 | } |
| 1533 | -add_filter('geodir_custom_field_output_html','geodir_cf_html',10,3); |
|
| 1533 | +add_filter('geodir_custom_field_output_html', 'geodir_cf_html', 10, 3); |
|
| 1534 | 1534 | |
| 1535 | 1535 | |
| 1536 | 1536 | |
@@ -1544,21 +1544,21 @@ discard block |
||
| 1544 | 1544 | * |
| 1545 | 1545 | * @return string The html to output for the custom field. |
| 1546 | 1546 | */ |
| 1547 | -function geodir_cf_taxonomy($html,$location,$cf,$p=''){ |
|
| 1547 | +function geodir_cf_taxonomy($html, $location, $cf, $p = '') { |
|
| 1548 | 1548 | |
| 1549 | 1549 | // check we have the post value |
| 1550 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 1551 | - else{ global $post;} |
|
| 1550 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
| 1551 | + else { global $post; } |
|
| 1552 | 1552 | |
| 1553 | - if(!is_array($cf) && $cf!=''){ |
|
| 1553 | + if (!is_array($cf) && $cf != '') { |
|
| 1554 | 1554 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
| 1555 | - if(!$cf){return NULL;} |
|
| 1555 | + if (!$cf) {return NULL; } |
|
| 1556 | 1556 | } |
| 1557 | 1557 | |
| 1558 | 1558 | $html_var = $cf['htmlvar_name']; |
| 1559 | 1559 | |
| 1560 | 1560 | // Check if there is a location specific filter. |
| 1561 | - if(has_filter("geodir_custom_field_output_taxonomy_loc_{$location}")){ |
|
| 1561 | + if (has_filter("geodir_custom_field_output_taxonomy_loc_{$location}")) { |
|
| 1562 | 1562 | /** |
| 1563 | 1563 | * Filter the taxonomy html by location. |
| 1564 | 1564 | * |
@@ -1566,11 +1566,11 @@ discard block |
||
| 1566 | 1566 | * @param array $cf The custom field array. |
| 1567 | 1567 | * @since 1.6.6 |
| 1568 | 1568 | */ |
| 1569 | - $html = apply_filters("geodir_custom_field_output_taxonomy_loc_{$location}",$html,$cf); |
|
| 1569 | + $html = apply_filters("geodir_custom_field_output_taxonomy_loc_{$location}", $html, $cf); |
|
| 1570 | 1570 | } |
| 1571 | 1571 | |
| 1572 | 1572 | // Check if there is a custom field specific filter. |
| 1573 | - if(has_filter("geodir_custom_field_output_taxonomy_var_{$html_var}")){ |
|
| 1573 | + if (has_filter("geodir_custom_field_output_taxonomy_var_{$html_var}")) { |
|
| 1574 | 1574 | /** |
| 1575 | 1575 | * Filter the taxonomy html by individual custom field. |
| 1576 | 1576 | * |
@@ -1579,11 +1579,11 @@ discard block |
||
| 1579 | 1579 | * @param array $cf The custom field array. |
| 1580 | 1580 | * @since 1.6.6 |
| 1581 | 1581 | */ |
| 1582 | - $html = apply_filters("geodir_custom_field_output_taxonomy_var_{$html_var}",$html,$location,$cf); |
|
| 1582 | + $html = apply_filters("geodir_custom_field_output_taxonomy_var_{$html_var}", $html, $location, $cf); |
|
| 1583 | 1583 | } |
| 1584 | 1584 | |
| 1585 | 1585 | // Check if there is a custom field key specific filter. |
| 1586 | - if(has_filter("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}")){ |
|
| 1586 | + if (has_filter("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}")) { |
|
| 1587 | 1587 | /** |
| 1588 | 1588 | * Filter the taxonomy html by field type key. |
| 1589 | 1589 | * |
@@ -1592,14 +1592,14 @@ discard block |
||
| 1592 | 1592 | * @param array $cf The custom field array. |
| 1593 | 1593 | * @since 1.6.6 |
| 1594 | 1594 | */ |
| 1595 | - $html = apply_filters("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 1595 | + $html = apply_filters("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
| 1596 | 1596 | } |
| 1597 | 1597 | |
| 1598 | 1598 | // If not html then we run the standard output. |
| 1599 | - if(empty($html)){ |
|
| 1599 | + if (empty($html)) { |
|
| 1600 | 1600 | |
| 1601 | - if ($html_var == $post->post_type . 'category' && !empty($post->{$html_var})) { |
|
| 1602 | - $post_taxonomy = $post->post_type . 'category'; |
|
| 1601 | + if ($html_var == $post->post_type.'category' && !empty($post->{$html_var})) { |
|
| 1602 | + $post_taxonomy = $post->post_type.'category'; |
|
| 1603 | 1603 | $field_value = $post->{$html_var}; |
| 1604 | 1604 | $links = array(); |
| 1605 | 1605 | $terms = array(); |
@@ -1617,7 +1617,7 @@ discard block |
||
| 1617 | 1617 | if ($term != '') { |
| 1618 | 1618 | $term = get_term_by('id', $term, $html_var); |
| 1619 | 1619 | if (is_object($term)) { |
| 1620 | - $links[] = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>" . $term->name . "</a>"; |
|
| 1620 | + $links[] = "<a href='".esc_attr(get_term_link($term, $post_taxonomy))."'>".$term->name."</a>"; |
|
| 1621 | 1621 | $terms[] = $term; |
| 1622 | 1622 | } |
| 1623 | 1623 | } |
@@ -1631,7 +1631,7 @@ discard block |
||
| 1631 | 1631 | $terms = $termsOrdered; |
| 1632 | 1632 | } |
| 1633 | 1633 | } |
| 1634 | - $html_value = !empty($links) && !empty($terms) ? wp_sprintf('%l', $links, (object)$terms) : ''; |
|
| 1634 | + $html_value = !empty($links) && !empty($terms) ? wp_sprintf('%l', $links, (object) $terms) : ''; |
|
| 1635 | 1635 | |
| 1636 | 1636 | if ($html_value != '') { |
| 1637 | 1637 | $field_icon = geodir_field_icon_proccess($cf); |
@@ -1644,9 +1644,9 @@ discard block |
||
| 1644 | 1644 | $field_icon = ''; |
| 1645 | 1645 | } |
| 1646 | 1646 | |
| 1647 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $html_var . '" style="clear:both;"><span class="geodir-i-taxonomy geodir-i-category" style="' . $field_icon . '">' . $field_icon_af; |
|
| 1648 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 1649 | - $html .= '</span> ' . $html_value . '</div>'; |
|
| 1647 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$html_var.'" style="clear:both;"><span class="geodir-i-taxonomy geodir-i-category" style="'.$field_icon.'">'.$field_icon_af; |
|
| 1648 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ''; |
|
| 1649 | + $html .= '</span> '.$html_value.'</div>'; |
|
| 1650 | 1650 | } |
| 1651 | 1651 | } |
| 1652 | 1652 | |
@@ -1654,7 +1654,7 @@ discard block |
||
| 1654 | 1654 | |
| 1655 | 1655 | return $html; |
| 1656 | 1656 | } |
| 1657 | -add_filter('geodir_custom_field_output_taxonomy','geodir_cf_taxonomy',10,3); |
|
| 1657 | +add_filter('geodir_custom_field_output_taxonomy', 'geodir_cf_taxonomy', 10, 3); |
|
| 1658 | 1658 | |
| 1659 | 1659 | |
| 1660 | 1660 | /** |
@@ -1667,21 +1667,21 @@ discard block |
||
| 1667 | 1667 | * |
| 1668 | 1668 | * @return string The html to output for the custom field. |
| 1669 | 1669 | */ |
| 1670 | -function geodir_cf_address($html,$location,$cf,$p=''){ |
|
| 1670 | +function geodir_cf_address($html, $location, $cf, $p = '') { |
|
| 1671 | 1671 | |
| 1672 | 1672 | // check we have the post value |
| 1673 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 1674 | - else{ global $post;} |
|
| 1673 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
| 1674 | + else { global $post; } |
|
| 1675 | 1675 | |
| 1676 | - if(!is_array($cf) && $cf!=''){ |
|
| 1676 | + if (!is_array($cf) && $cf != '') { |
|
| 1677 | 1677 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
| 1678 | - if(!$cf){return NULL;} |
|
| 1678 | + if (!$cf) {return NULL; } |
|
| 1679 | 1679 | } |
| 1680 | 1680 | |
| 1681 | 1681 | $html_var = $cf['htmlvar_name']; |
| 1682 | 1682 | |
| 1683 | 1683 | // Check if there is a location specific filter. |
| 1684 | - if(has_filter("geodir_custom_field_output_address_loc_{$location}")){ |
|
| 1684 | + if (has_filter("geodir_custom_field_output_address_loc_{$location}")) { |
|
| 1685 | 1685 | /** |
| 1686 | 1686 | * Filter the address html by location. |
| 1687 | 1687 | * |
@@ -1689,11 +1689,11 @@ discard block |
||
| 1689 | 1689 | * @param array $cf The custom field array. |
| 1690 | 1690 | * @since 1.6.6 |
| 1691 | 1691 | */ |
| 1692 | - $html = apply_filters("geodir_custom_field_output_address_loc_{$location}",$html,$cf); |
|
| 1692 | + $html = apply_filters("geodir_custom_field_output_address_loc_{$location}", $html, $cf); |
|
| 1693 | 1693 | } |
| 1694 | 1694 | |
| 1695 | 1695 | // Check if there is a custom field specific filter. |
| 1696 | - if(has_filter("geodir_custom_field_output_address_var_{$html_var}")){ |
|
| 1696 | + if (has_filter("geodir_custom_field_output_address_var_{$html_var}")) { |
|
| 1697 | 1697 | /** |
| 1698 | 1698 | * Filter the address html by individual custom field. |
| 1699 | 1699 | * |
@@ -1702,11 +1702,11 @@ discard block |
||
| 1702 | 1702 | * @param array $cf The custom field array. |
| 1703 | 1703 | * @since 1.6.6 |
| 1704 | 1704 | */ |
| 1705 | - $html = apply_filters("geodir_custom_field_output_address_var_{$html_var}",$html,$location,$cf); |
|
| 1705 | + $html = apply_filters("geodir_custom_field_output_address_var_{$html_var}", $html, $location, $cf); |
|
| 1706 | 1706 | } |
| 1707 | 1707 | |
| 1708 | 1708 | // Check if there is a custom field key specific filter. |
| 1709 | - if(has_filter("geodir_custom_field_output_address_key_{$cf['field_type_key']}")){ |
|
| 1709 | + if (has_filter("geodir_custom_field_output_address_key_{$cf['field_type_key']}")) { |
|
| 1710 | 1710 | /** |
| 1711 | 1711 | * Filter the address html by field type key. |
| 1712 | 1712 | * |
@@ -1715,14 +1715,14 @@ discard block |
||
| 1715 | 1715 | * @param array $cf The custom field array. |
| 1716 | 1716 | * @since 1.6.6 |
| 1717 | 1717 | */ |
| 1718 | - $html = apply_filters("geodir_custom_field_output_address_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 1718 | + $html = apply_filters("geodir_custom_field_output_address_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
| 1719 | 1719 | } |
| 1720 | 1720 | |
| 1721 | 1721 | // If not html then we run the standard output. |
| 1722 | - if(empty($html)){ |
|
| 1722 | + if (empty($html)) { |
|
| 1723 | 1723 | |
| 1724 | 1724 | global $preview; |
| 1725 | - $html_var = $cf['htmlvar_name'] . '_address'; |
|
| 1725 | + $html_var = $cf['htmlvar_name'].'_address'; |
|
| 1726 | 1726 | |
| 1727 | 1727 | if ($cf['extra_fields']) { |
| 1728 | 1728 | |
@@ -1785,10 +1785,10 @@ discard block |
||
| 1785 | 1785 | |
| 1786 | 1786 | if ($post->{$html_var}) { |
| 1787 | 1787 | |
| 1788 | - $field_icon = geodir_field_icon_proccess( $cf ); |
|
| 1789 | - if ( strpos( $field_icon, 'http' ) !== false ) { |
|
| 1788 | + $field_icon = geodir_field_icon_proccess($cf); |
|
| 1789 | + if (strpos($field_icon, 'http') !== false) { |
|
| 1790 | 1790 | $field_icon_af = ''; |
| 1791 | - } elseif ( $field_icon == '' ) { |
|
| 1791 | + } elseif ($field_icon == '') { |
|
| 1792 | 1792 | $field_icon_af = '<i class="fa fa-home"></i>'; |
| 1793 | 1793 | } else { |
| 1794 | 1794 | $field_icon_af = $field_icon; |
@@ -1797,25 +1797,25 @@ discard block |
||
| 1797 | 1797 | |
| 1798 | 1798 | |
| 1799 | 1799 | |
| 1800 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $html_var . '" style="clear:both;" itemscope itemtype="https://schema.org/PostalAddress">'; |
|
| 1801 | - $html .= '<span class="geodir-i-location" style="' . $field_icon . '">' . $field_icon_af; |
|
| 1802 | - $html .= ( trim( $cf['site_title'] ) ) ? __( $cf['site_title'], 'geodirectory' ) . ': ' : ' '; |
|
| 1800 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$html_var.'" style="clear:both;" itemscope itemtype="https://schema.org/PostalAddress">'; |
|
| 1801 | + $html .= '<span class="geodir-i-location" style="'.$field_icon.'">'.$field_icon_af; |
|
| 1802 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ' '; |
|
| 1803 | 1803 | $html .= '</span>'; |
| 1804 | 1804 | |
| 1805 | - if ( isset($post->post_address) ) { |
|
| 1806 | - $html .= '<span itemprop="streetAddress">' . $post->post_address . '</span><br>'; |
|
| 1805 | + if (isset($post->post_address)) { |
|
| 1806 | + $html .= '<span itemprop="streetAddress">'.$post->post_address.'</span><br>'; |
|
| 1807 | 1807 | } |
| 1808 | - if ($show_city_in_address && isset( $post->post_city ) && $post->post_city ) { |
|
| 1809 | - $html .= '<span itemprop="addressLocality">' . $post->post_city . '</span><br>'; |
|
| 1808 | + if ($show_city_in_address && isset($post->post_city) && $post->post_city) { |
|
| 1809 | + $html .= '<span itemprop="addressLocality">'.$post->post_city.'</span><br>'; |
|
| 1810 | 1810 | } |
| 1811 | - if ($show_region_in_address && isset( $post->post_region ) && $post->post_region ) { |
|
| 1812 | - $html .= '<span itemprop="addressRegion">' . $post->post_region . '</span><br>'; |
|
| 1811 | + if ($show_region_in_address && isset($post->post_region) && $post->post_region) { |
|
| 1812 | + $html .= '<span itemprop="addressRegion">'.$post->post_region.'</span><br>'; |
|
| 1813 | 1813 | } |
| 1814 | - if ($show_zip_in_address && isset( $post->post_zip ) && $post->post_zip ) { |
|
| 1815 | - $html .= '<span itemprop="postalCode">' . $post->post_zip . '</span><br>'; |
|
| 1814 | + if ($show_zip_in_address && isset($post->post_zip) && $post->post_zip) { |
|
| 1815 | + $html .= '<span itemprop="postalCode">'.$post->post_zip.'</span><br>'; |
|
| 1816 | 1816 | } |
| 1817 | - if ($show_country_in_address && isset( $post->post_country ) && $post->post_country ) { |
|
| 1818 | - $html .= '<span itemprop="addressCountry">' . __( $post->post_country, 'geodirectory' ) . '</span><br>'; |
|
| 1817 | + if ($show_country_in_address && isset($post->post_country) && $post->post_country) { |
|
| 1818 | + $html .= '<span itemprop="addressCountry">'.__($post->post_country, 'geodirectory').'</span><br>'; |
|
| 1819 | 1819 | } |
| 1820 | 1820 | $html .= '</div>'; |
| 1821 | 1821 | |
@@ -1826,4 +1826,4 @@ discard block |
||
| 1826 | 1826 | |
| 1827 | 1827 | return $html; |
| 1828 | 1828 | } |
| 1829 | -add_filter('geodir_custom_field_output_address','geodir_cf_address',10,3); |
|
| 1830 | 1829 | \ No newline at end of file |
| 1830 | +add_filter('geodir_custom_field_output_address', 'geodir_cf_address', 10, 3); |
|
| 1831 | 1831 | \ No newline at end of file |
@@ -17,370 +17,370 @@ discard block |
||
| 17 | 17 | */ |
| 18 | 18 | function geodir_custom_fields_predefined($post_type=''){ |
| 19 | 19 | |
| 20 | - $custom_fields = array(); |
|
| 21 | - |
|
| 22 | - |
|
| 23 | - // price |
|
| 24 | - $custom_fields['price'] = array( // The key value should be unique and not contain any spaces. |
|
| 25 | - 'field_type' => 'text', |
|
| 26 | - 'class' => 'gd-price', |
|
| 27 | - 'icon' => 'fa fa-usd', |
|
| 28 | - 'name' => __('Price', 'geodirectory'), |
|
| 29 | - 'description' => __('Adds a input for a price field. This will let you filter and sort by price.', 'geodirectory'), |
|
| 30 | - 'defaults' => array( |
|
| 31 | - 'data_type' => 'FLOAT', |
|
| 32 | - 'decimal_point' => '2', |
|
| 33 | - 'admin_title' => 'Price', |
|
| 34 | - 'site_title' => 'Price', |
|
| 35 | - 'admin_desc' => 'Enter the price in $ (no currency symbol)', |
|
| 36 | - 'htmlvar_name' => 'price', |
|
| 37 | - 'is_active' => true, |
|
| 38 | - 'for_admin_use' => false, |
|
| 39 | - 'default_value' => '', |
|
| 40 | - 'show_in' => '[detail],[listing]', |
|
| 41 | - 'is_required' => false, |
|
| 42 | - 'validation_pattern' => '\d+(\.\d{2})?', |
|
| 43 | - 'validation_msg' => 'Please enter number and decimal only ie: 100.50', |
|
| 44 | - 'required_msg' => '', |
|
| 45 | - 'field_icon' => 'fa fa-usd', |
|
| 46 | - 'css_class' => '', |
|
| 47 | - 'cat_sort' => true, |
|
| 48 | - 'cat_filter' => true, |
|
| 49 | - 'extra_fields' => array( |
|
| 50 | - 'is_price' => 1, |
|
| 51 | - 'thousand_separator' => 'comma', |
|
| 52 | - 'decimal_separator' => 'period', |
|
| 53 | - 'decimal_display' => 'if', |
|
| 54 | - 'currency_symbol' => '$', |
|
| 55 | - 'currency_symbol_placement' => 'left' |
|
| 56 | - ) |
|
| 57 | - ) |
|
| 58 | - ); |
|
| 59 | - |
|
| 60 | - // property status |
|
| 61 | - $custom_fields['property_status'] = array( // The key value should be unique and not contain any spaces. |
|
| 62 | - 'field_type' => 'select', |
|
| 63 | - 'class' => 'gd-property-status', |
|
| 64 | - 'icon' => 'fa fa-home', |
|
| 65 | - 'name' => __('Property Status', 'geodirectory'), |
|
| 66 | - 'description' => __('Adds a select input to be able to set the status of a property ie: For Sale, For Rent', 'geodirectory'), |
|
| 67 | - 'defaults' => array( |
|
| 68 | - 'data_type' => 'VARCHAR', |
|
| 69 | - 'admin_title' => 'Property Status', |
|
| 70 | - 'site_title' => 'Property Status', |
|
| 71 | - 'admin_desc' => 'Enter the status of the property.', |
|
| 72 | - 'htmlvar_name' => 'property_status', |
|
| 73 | - 'is_active' => true, |
|
| 74 | - 'for_admin_use' => false, |
|
| 75 | - 'default_value' => '', |
|
| 76 | - 'show_in' => '[detail],[listing]', |
|
| 77 | - 'is_required' => true, |
|
| 78 | - 'option_values' => __('Select Status/,For Sale,For Rent,Sold,Let','geodirectory'), |
|
| 79 | - 'validation_pattern' => '', |
|
| 80 | - 'validation_msg' => '', |
|
| 81 | - 'required_msg' => '', |
|
| 82 | - 'field_icon' => 'fa fa-home', |
|
| 83 | - 'css_class' => '', |
|
| 84 | - 'cat_sort' => true, |
|
| 85 | - 'cat_filter' => true |
|
| 86 | - ) |
|
| 87 | - ); |
|
| 88 | - |
|
| 89 | - // property furnishing |
|
| 90 | - $custom_fields['property_furnishing'] = array( // The key value should be unique and not contain any spaces. |
|
| 91 | - 'field_type' => 'select', |
|
| 92 | - 'class' => 'gd-property-furnishing', |
|
| 93 | - 'icon' => 'fa fa-home', |
|
| 94 | - 'name' => __('Property Furnishing', 'geodirectory'), |
|
| 95 | - 'description' => __('Adds a select input to be able to set the furnishing status of a property ie: Unfurnished, Furnished', 'geodirectory'), |
|
| 96 | - 'defaults' => array( |
|
| 97 | - 'data_type' => 'VARCHAR', |
|
| 98 | - 'admin_title' => 'Furnishing', |
|
| 99 | - 'site_title' => 'Furnishing', |
|
| 100 | - 'admin_desc' => 'Enter the furnishing status of the property.', |
|
| 101 | - 'htmlvar_name' => 'property_furnishing', |
|
| 102 | - 'is_active' => true, |
|
| 103 | - 'for_admin_use' => false, |
|
| 104 | - 'default_value' => '', |
|
| 105 | - 'show_in' => '[detail],[listing]', |
|
| 106 | - 'is_required' => true, |
|
| 107 | - 'option_values' => __('Select Status/,Unfurnished,Furnished,Partially furnished,Optional','geodirectory'), |
|
| 108 | - 'validation_pattern' => '', |
|
| 109 | - 'validation_msg' => '', |
|
| 110 | - 'required_msg' => '', |
|
| 111 | - 'field_icon' => 'fa fa-th-large', |
|
| 112 | - 'css_class' => '', |
|
| 113 | - 'cat_sort' => true, |
|
| 114 | - 'cat_filter' => true |
|
| 115 | - ) |
|
| 116 | - ); |
|
| 117 | - |
|
| 118 | - // property type |
|
| 119 | - $custom_fields['property_type'] = array( // The key value should be unique and not contain any spaces. |
|
| 120 | - 'field_type' => 'select', |
|
| 121 | - 'class' => 'gd-property-type', |
|
| 122 | - 'icon' => 'fa fa-home', |
|
| 123 | - 'name' => __('Property Type', 'geodirectory'), |
|
| 124 | - 'description' => __('Adds a select input for the property type ie: Detached house, Apartment', 'geodirectory'), |
|
| 125 | - 'defaults' => array( |
|
| 126 | - 'data_type' => 'VARCHAR', |
|
| 127 | - 'admin_title' => 'Property Type', |
|
| 128 | - 'site_title' => 'Property Type', |
|
| 129 | - 'admin_desc' => 'Select the property type.', |
|
| 130 | - 'htmlvar_name' => 'property_type', |
|
| 131 | - 'is_active' => true, |
|
| 132 | - 'for_admin_use' => false, |
|
| 133 | - 'default_value' => '', |
|
| 134 | - 'show_in' => '[detail],[listing]', |
|
| 135 | - 'is_required' => true, |
|
| 136 | - 'option_values' => __('Select Type/,Detached house,Semi-detached house,Apartment,Bungalow,Semi-detached bungalow,Chalet,Town House,End-terrace house,Terrace house,Cottage','geodirectory'), |
|
| 137 | - 'validation_pattern' => '', |
|
| 138 | - 'validation_msg' => '', |
|
| 139 | - 'required_msg' => '', |
|
| 140 | - 'field_icon' => 'fa fa-home', |
|
| 141 | - 'css_class' => '', |
|
| 142 | - 'cat_sort' => true, |
|
| 143 | - 'cat_filter' => true |
|
| 144 | - ) |
|
| 145 | - ); |
|
| 146 | - |
|
| 147 | - // property bedrooms |
|
| 148 | - $custom_fields['property_bedrooms'] = array( // The key value should be unique and not contain any spaces. |
|
| 149 | - 'field_type' => 'select', |
|
| 150 | - 'class' => 'gd-property-bedrooms', |
|
| 151 | - 'icon' => 'fa fa-home', |
|
| 152 | - 'name' => __('Property Bedrooms', 'geodirectory'), |
|
| 153 | - 'description' => __('Adds a select input for the number of bedrooms.', 'geodirectory'), |
|
| 154 | - 'defaults' => array( |
|
| 155 | - 'data_type' => 'VARCHAR', |
|
| 156 | - 'admin_title' => 'Property Bedrooms', |
|
| 157 | - 'site_title' => 'Bedrooms', |
|
| 158 | - 'admin_desc' => 'Select the number of bedrooms', |
|
| 159 | - 'htmlvar_name' => 'property_bedrooms', |
|
| 160 | - 'is_active' => true, |
|
| 161 | - 'for_admin_use' => false, |
|
| 162 | - 'default_value' => '', |
|
| 163 | - 'show_in' => '[detail],[listing]', |
|
| 164 | - 'is_required' => true, |
|
| 165 | - 'option_values' => __('Select Bedrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'), |
|
| 166 | - 'validation_pattern' => '', |
|
| 167 | - 'validation_msg' => '', |
|
| 168 | - 'required_msg' => '', |
|
| 169 | - 'field_icon' => 'fa fa-bed', |
|
| 170 | - 'css_class' => '', |
|
| 171 | - 'cat_sort' => true, |
|
| 172 | - 'cat_filter' => true |
|
| 173 | - ) |
|
| 174 | - ); |
|
| 175 | - |
|
| 176 | - // property bathrooms |
|
| 177 | - $custom_fields['property_bathrooms'] = array( // The key value should be unique and not contain any spaces. |
|
| 178 | - 'field_type' => 'select', |
|
| 179 | - 'class' => 'gd-property-bathrooms', |
|
| 180 | - 'icon' => 'fa fa-home', |
|
| 181 | - 'name' => __('Property Bathrooms', 'geodirectory'), |
|
| 182 | - 'description' => __('Adds a select input for the number of bathrooms.', 'geodirectory'), |
|
| 183 | - 'defaults' => array( |
|
| 184 | - 'data_type' => 'VARCHAR', |
|
| 185 | - 'admin_title' => 'Property Bathrooms', |
|
| 186 | - 'site_title' => 'Bathrooms', |
|
| 187 | - 'admin_desc' => 'Select the number of bathrooms', |
|
| 188 | - 'htmlvar_name' => 'property_bathrooms', |
|
| 189 | - 'is_active' => true, |
|
| 190 | - 'for_admin_use' => false, |
|
| 191 | - 'default_value' => '', |
|
| 192 | - 'show_in' => '[detail],[listing]', |
|
| 193 | - 'is_required' => true, |
|
| 194 | - 'option_values' => __('Select Bathrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'), |
|
| 195 | - 'validation_pattern' => '', |
|
| 196 | - 'validation_msg' => '', |
|
| 197 | - 'required_msg' => '', |
|
| 198 | - 'field_icon' => 'fa fa-bold', |
|
| 199 | - 'css_class' => '', |
|
| 200 | - 'cat_sort' => true, |
|
| 201 | - 'cat_filter' => true |
|
| 202 | - ) |
|
| 203 | - ); |
|
| 204 | - |
|
| 205 | - // property area |
|
| 206 | - $custom_fields['property_area'] = array( // The key value should be unique and not contain any spaces. |
|
| 207 | - 'field_type' => 'text', |
|
| 208 | - 'class' => 'gd-area', |
|
| 209 | - 'icon' => 'fa fa-home', |
|
| 210 | - 'name' => __('Property Area', 'geodirectory'), |
|
| 211 | - 'description' => __('Adds a input for the property area.', 'geodirectory'), |
|
| 212 | - 'defaults' => array( |
|
| 213 | - 'data_type' => 'FLOAT', |
|
| 214 | - 'admin_title' => 'Property Area', |
|
| 215 | - 'site_title' => 'Area (Sq Ft)', |
|
| 216 | - 'admin_desc' => 'Enter the Sq Ft value for the property', |
|
| 217 | - 'htmlvar_name' => 'property_area', |
|
| 218 | - 'is_active' => true, |
|
| 219 | - 'for_admin_use' => false, |
|
| 220 | - 'default_value' => '', |
|
| 221 | - 'show_in' => '[detail],[listing]', |
|
| 222 | - 'is_required' => false, |
|
| 223 | - 'validation_pattern' => '\d+(\.\d{2})?', |
|
| 224 | - 'validation_msg' => 'Please enter the property area in numbers only: 1500', |
|
| 225 | - 'required_msg' => '', |
|
| 226 | - 'field_icon' => 'fa fa-area-chart', |
|
| 227 | - 'css_class' => '', |
|
| 228 | - 'cat_sort' => true, |
|
| 229 | - 'cat_filter' => true |
|
| 230 | - ) |
|
| 231 | - ); |
|
| 232 | - |
|
| 233 | - // property features |
|
| 234 | - $custom_fields['property_features'] = array( // The key value should be unique and not contain any spaces. |
|
| 235 | - 'field_type' => 'multiselect', |
|
| 236 | - 'class' => 'gd-property-features', |
|
| 237 | - 'icon' => 'fa fa-home', |
|
| 238 | - 'name' => __('Property Features', 'geodirectory'), |
|
| 239 | - 'description' => __('Adds a select input for the property features.', 'geodirectory'), |
|
| 240 | - 'defaults' => array( |
|
| 241 | - 'data_type' => 'VARCHAR', |
|
| 242 | - 'admin_title' => 'Property Features', |
|
| 243 | - 'site_title' => 'Features', |
|
| 244 | - 'admin_desc' => 'Select the property features.', |
|
| 245 | - 'htmlvar_name' => 'property_features', |
|
| 246 | - 'is_active' => true, |
|
| 247 | - 'for_admin_use' => false, |
|
| 248 | - 'default_value' => '', |
|
| 249 | - 'show_in' => '[detail],[listing]', |
|
| 250 | - 'is_required' => true, |
|
| 251 | - 'option_values' => __('Select Features/,Gas Central Heating,Oil Central Heating,Double Glazing,Triple Glazing,Front Garden,Garage,Private driveway,Off Road Parking,Fireplace','geodirectory'), |
|
| 252 | - 'validation_pattern' => '', |
|
| 253 | - 'validation_msg' => '', |
|
| 254 | - 'required_msg' => '', |
|
| 255 | - 'field_icon' => 'fa fa-plus-square', |
|
| 256 | - 'css_class' => '', |
|
| 257 | - 'cat_sort' => true, |
|
| 258 | - 'cat_filter' => true |
|
| 259 | - ) |
|
| 260 | - ); |
|
| 261 | - |
|
| 262 | - // Twitter feed |
|
| 263 | - $custom_fields['twitter_feed'] = array( // The key value should be unique and not contain any spaces. |
|
| 264 | - 'field_type' => 'text', |
|
| 265 | - 'class' => 'gd-twitter', |
|
| 266 | - 'icon' => 'fa fa-twitter', |
|
| 267 | - 'name' => __('Twitter feed', 'geodirectory'), |
|
| 268 | - 'description' => __('Adds a input for twitter username and outputs feed.', 'geodirectory'), |
|
| 269 | - 'defaults' => array( |
|
| 270 | - 'data_type' => 'VARCHAR', |
|
| 271 | - 'admin_title' => 'Twitter', |
|
| 272 | - 'site_title' => 'Twitter', |
|
| 273 | - 'admin_desc' => 'Enter your Twitter username', |
|
| 274 | - 'htmlvar_name' => 'twitterusername', |
|
| 275 | - 'is_active' => true, |
|
| 276 | - 'for_admin_use' => false, |
|
| 277 | - 'default_value' => '', |
|
| 278 | - 'show_in' => '[detail],[owntab]', |
|
| 279 | - 'is_required' => false, |
|
| 280 | - 'validation_pattern' => '^[A-Za-z0-9_]{1,32}$', |
|
| 281 | - 'validation_msg' => 'Please enter a valid twitter username.', |
|
| 282 | - 'required_msg' => '', |
|
| 283 | - 'field_icon' => 'fa fa-twitter', |
|
| 284 | - 'css_class' => '', |
|
| 285 | - 'cat_sort' => false, |
|
| 286 | - 'cat_filter' => false |
|
| 287 | - ) |
|
| 288 | - ); |
|
| 289 | - |
|
| 290 | - // Get directions link |
|
| 291 | - $custom_fields['get_directions'] = array( // The key value should be unique and not contain any spaces. |
|
| 292 | - 'field_type' => 'text', |
|
| 293 | - 'class' => 'gd-get-directions', |
|
| 294 | - 'icon' => 'fa fa-location-arrow', |
|
| 295 | - 'name' => __('Get Directions Link', 'geodirectory'), |
|
| 296 | - 'description' => __('Adds a input for twitter username and outputs feed.', 'geodirectory'), |
|
| 297 | - 'defaults' => array( |
|
| 298 | - 'data_type' => 'VARCHAR', |
|
| 299 | - 'admin_title' => 'Get Directions', |
|
| 300 | - 'site_title' => 'Get Directions', |
|
| 301 | - 'admin_desc' => '', |
|
| 302 | - 'htmlvar_name' => 'get_directions', |
|
| 303 | - 'is_active' => true, |
|
| 304 | - 'for_admin_use' => true, |
|
| 305 | - 'default_value' => 'Get Directions', |
|
| 306 | - 'show_in' => '[detail],[listing]', |
|
| 307 | - 'is_required' => false, |
|
| 308 | - 'validation_pattern' => '', |
|
| 309 | - 'validation_msg' => '', |
|
| 310 | - 'required_msg' => '', |
|
| 311 | - 'field_icon' => 'fa fa-location-arrow', |
|
| 312 | - 'css_class' => '', |
|
| 313 | - 'cat_sort' => false, |
|
| 314 | - 'cat_filter' => false |
|
| 315 | - ) |
|
| 316 | - ); |
|
| 317 | - |
|
| 318 | - |
|
| 319 | - // JOB TYPE CF |
|
| 320 | - |
|
| 321 | - // job type |
|
| 322 | - $custom_fields['job_type'] = array( // The key value should be unique and not contain any spaces. |
|
| 323 | - 'field_type' => 'select', |
|
| 324 | - 'class' => 'gd-job-type', |
|
| 325 | - 'icon' => 'fa fa-briefcase', |
|
| 326 | - 'name' => __('Job Type', 'geodirectory'), |
|
| 327 | - 'description' => __('Adds a select input to be able to set the type of a job ie: Full Time, Part Time', 'geodirectory'), |
|
| 328 | - 'defaults' => array( |
|
| 329 | - 'data_type' => 'VARCHAR', |
|
| 330 | - 'admin_title' => __('Job Type', 'geodirectory'), |
|
| 331 | - 'site_title' => __('Job Type','geodirectory'), |
|
| 332 | - 'admin_desc' => __('Select the type of job.','geodirectory'), |
|
| 333 | - 'htmlvar_name' => 'job_type', |
|
| 334 | - 'is_active' => true, |
|
| 335 | - 'for_admin_use' => false, |
|
| 336 | - 'default_value' => '', |
|
| 337 | - 'show_in' => '[detail],[listing]', |
|
| 338 | - 'is_required' => true, |
|
| 339 | - 'option_values' => __('Select Type/,Freelance,Full Time,Internship,Part Time,Temporary,Other','geodirectory'), |
|
| 340 | - 'validation_pattern' => '', |
|
| 341 | - 'validation_msg' => '', |
|
| 342 | - 'required_msg' => '', |
|
| 343 | - 'field_icon' => 'fa fa-briefcase', |
|
| 344 | - 'css_class' => '', |
|
| 345 | - 'cat_sort' => true, |
|
| 346 | - 'cat_filter' => true |
|
| 347 | - ) |
|
| 348 | - ); |
|
| 349 | - |
|
| 350 | - // job sector |
|
| 351 | - $custom_fields['job_sector'] = array( // The key value should be unique and not contain any spaces. |
|
| 352 | - 'field_type' => 'select', |
|
| 353 | - 'class' => 'gd-job-type', |
|
| 354 | - 'icon' => 'fa fa-briefcase', |
|
| 355 | - 'name' => __('Job Sector', 'geodirectory'), |
|
| 356 | - 'description' => __('Adds a select input to be able to set the type of a job Sector ie: Private Sector,Public Sector', 'geodirectory'), |
|
| 357 | - 'defaults' => array( |
|
| 358 | - 'data_type' => 'VARCHAR', |
|
| 359 | - 'admin_title' => __('Job Sector','geodirectory'), |
|
| 360 | - 'site_title' => __('Job Sector','geodirectory'), |
|
| 361 | - 'admin_desc' => __('Select the job sector.','geodirectory'), |
|
| 362 | - 'htmlvar_name' => 'job_sector', |
|
| 363 | - 'is_active' => true, |
|
| 364 | - 'for_admin_use' => false, |
|
| 365 | - 'default_value' => '', |
|
| 366 | - 'show_in' => '[detail]', |
|
| 367 | - 'is_required' => true, |
|
| 368 | - 'option_values' => __('Select Sector/,Private Sector,Public Sector,Agencies','geodirectory'), |
|
| 369 | - 'validation_pattern' => '', |
|
| 370 | - 'validation_msg' => '', |
|
| 371 | - 'required_msg' => '', |
|
| 372 | - 'field_icon' => 'fa fa-briefcase', |
|
| 373 | - 'css_class' => '', |
|
| 374 | - 'cat_sort' => true, |
|
| 375 | - 'cat_filter' => true |
|
| 376 | - ) |
|
| 377 | - ); |
|
| 378 | - |
|
| 379 | - |
|
| 380 | - /** |
|
| 381 | - * @see `geodir_custom_fields` |
|
| 382 | - */ |
|
| 383 | - return apply_filters('geodir_custom_fields_predefined',$custom_fields,$post_type); |
|
| 20 | + $custom_fields = array(); |
|
| 21 | + |
|
| 22 | + |
|
| 23 | + // price |
|
| 24 | + $custom_fields['price'] = array( // The key value should be unique and not contain any spaces. |
|
| 25 | + 'field_type' => 'text', |
|
| 26 | + 'class' => 'gd-price', |
|
| 27 | + 'icon' => 'fa fa-usd', |
|
| 28 | + 'name' => __('Price', 'geodirectory'), |
|
| 29 | + 'description' => __('Adds a input for a price field. This will let you filter and sort by price.', 'geodirectory'), |
|
| 30 | + 'defaults' => array( |
|
| 31 | + 'data_type' => 'FLOAT', |
|
| 32 | + 'decimal_point' => '2', |
|
| 33 | + 'admin_title' => 'Price', |
|
| 34 | + 'site_title' => 'Price', |
|
| 35 | + 'admin_desc' => 'Enter the price in $ (no currency symbol)', |
|
| 36 | + 'htmlvar_name' => 'price', |
|
| 37 | + 'is_active' => true, |
|
| 38 | + 'for_admin_use' => false, |
|
| 39 | + 'default_value' => '', |
|
| 40 | + 'show_in' => '[detail],[listing]', |
|
| 41 | + 'is_required' => false, |
|
| 42 | + 'validation_pattern' => '\d+(\.\d{2})?', |
|
| 43 | + 'validation_msg' => 'Please enter number and decimal only ie: 100.50', |
|
| 44 | + 'required_msg' => '', |
|
| 45 | + 'field_icon' => 'fa fa-usd', |
|
| 46 | + 'css_class' => '', |
|
| 47 | + 'cat_sort' => true, |
|
| 48 | + 'cat_filter' => true, |
|
| 49 | + 'extra_fields' => array( |
|
| 50 | + 'is_price' => 1, |
|
| 51 | + 'thousand_separator' => 'comma', |
|
| 52 | + 'decimal_separator' => 'period', |
|
| 53 | + 'decimal_display' => 'if', |
|
| 54 | + 'currency_symbol' => '$', |
|
| 55 | + 'currency_symbol_placement' => 'left' |
|
| 56 | + ) |
|
| 57 | + ) |
|
| 58 | + ); |
|
| 59 | + |
|
| 60 | + // property status |
|
| 61 | + $custom_fields['property_status'] = array( // The key value should be unique and not contain any spaces. |
|
| 62 | + 'field_type' => 'select', |
|
| 63 | + 'class' => 'gd-property-status', |
|
| 64 | + 'icon' => 'fa fa-home', |
|
| 65 | + 'name' => __('Property Status', 'geodirectory'), |
|
| 66 | + 'description' => __('Adds a select input to be able to set the status of a property ie: For Sale, For Rent', 'geodirectory'), |
|
| 67 | + 'defaults' => array( |
|
| 68 | + 'data_type' => 'VARCHAR', |
|
| 69 | + 'admin_title' => 'Property Status', |
|
| 70 | + 'site_title' => 'Property Status', |
|
| 71 | + 'admin_desc' => 'Enter the status of the property.', |
|
| 72 | + 'htmlvar_name' => 'property_status', |
|
| 73 | + 'is_active' => true, |
|
| 74 | + 'for_admin_use' => false, |
|
| 75 | + 'default_value' => '', |
|
| 76 | + 'show_in' => '[detail],[listing]', |
|
| 77 | + 'is_required' => true, |
|
| 78 | + 'option_values' => __('Select Status/,For Sale,For Rent,Sold,Let','geodirectory'), |
|
| 79 | + 'validation_pattern' => '', |
|
| 80 | + 'validation_msg' => '', |
|
| 81 | + 'required_msg' => '', |
|
| 82 | + 'field_icon' => 'fa fa-home', |
|
| 83 | + 'css_class' => '', |
|
| 84 | + 'cat_sort' => true, |
|
| 85 | + 'cat_filter' => true |
|
| 86 | + ) |
|
| 87 | + ); |
|
| 88 | + |
|
| 89 | + // property furnishing |
|
| 90 | + $custom_fields['property_furnishing'] = array( // The key value should be unique and not contain any spaces. |
|
| 91 | + 'field_type' => 'select', |
|
| 92 | + 'class' => 'gd-property-furnishing', |
|
| 93 | + 'icon' => 'fa fa-home', |
|
| 94 | + 'name' => __('Property Furnishing', 'geodirectory'), |
|
| 95 | + 'description' => __('Adds a select input to be able to set the furnishing status of a property ie: Unfurnished, Furnished', 'geodirectory'), |
|
| 96 | + 'defaults' => array( |
|
| 97 | + 'data_type' => 'VARCHAR', |
|
| 98 | + 'admin_title' => 'Furnishing', |
|
| 99 | + 'site_title' => 'Furnishing', |
|
| 100 | + 'admin_desc' => 'Enter the furnishing status of the property.', |
|
| 101 | + 'htmlvar_name' => 'property_furnishing', |
|
| 102 | + 'is_active' => true, |
|
| 103 | + 'for_admin_use' => false, |
|
| 104 | + 'default_value' => '', |
|
| 105 | + 'show_in' => '[detail],[listing]', |
|
| 106 | + 'is_required' => true, |
|
| 107 | + 'option_values' => __('Select Status/,Unfurnished,Furnished,Partially furnished,Optional','geodirectory'), |
|
| 108 | + 'validation_pattern' => '', |
|
| 109 | + 'validation_msg' => '', |
|
| 110 | + 'required_msg' => '', |
|
| 111 | + 'field_icon' => 'fa fa-th-large', |
|
| 112 | + 'css_class' => '', |
|
| 113 | + 'cat_sort' => true, |
|
| 114 | + 'cat_filter' => true |
|
| 115 | + ) |
|
| 116 | + ); |
|
| 117 | + |
|
| 118 | + // property type |
|
| 119 | + $custom_fields['property_type'] = array( // The key value should be unique and not contain any spaces. |
|
| 120 | + 'field_type' => 'select', |
|
| 121 | + 'class' => 'gd-property-type', |
|
| 122 | + 'icon' => 'fa fa-home', |
|
| 123 | + 'name' => __('Property Type', 'geodirectory'), |
|
| 124 | + 'description' => __('Adds a select input for the property type ie: Detached house, Apartment', 'geodirectory'), |
|
| 125 | + 'defaults' => array( |
|
| 126 | + 'data_type' => 'VARCHAR', |
|
| 127 | + 'admin_title' => 'Property Type', |
|
| 128 | + 'site_title' => 'Property Type', |
|
| 129 | + 'admin_desc' => 'Select the property type.', |
|
| 130 | + 'htmlvar_name' => 'property_type', |
|
| 131 | + 'is_active' => true, |
|
| 132 | + 'for_admin_use' => false, |
|
| 133 | + 'default_value' => '', |
|
| 134 | + 'show_in' => '[detail],[listing]', |
|
| 135 | + 'is_required' => true, |
|
| 136 | + 'option_values' => __('Select Type/,Detached house,Semi-detached house,Apartment,Bungalow,Semi-detached bungalow,Chalet,Town House,End-terrace house,Terrace house,Cottage','geodirectory'), |
|
| 137 | + 'validation_pattern' => '', |
|
| 138 | + 'validation_msg' => '', |
|
| 139 | + 'required_msg' => '', |
|
| 140 | + 'field_icon' => 'fa fa-home', |
|
| 141 | + 'css_class' => '', |
|
| 142 | + 'cat_sort' => true, |
|
| 143 | + 'cat_filter' => true |
|
| 144 | + ) |
|
| 145 | + ); |
|
| 146 | + |
|
| 147 | + // property bedrooms |
|
| 148 | + $custom_fields['property_bedrooms'] = array( // The key value should be unique and not contain any spaces. |
|
| 149 | + 'field_type' => 'select', |
|
| 150 | + 'class' => 'gd-property-bedrooms', |
|
| 151 | + 'icon' => 'fa fa-home', |
|
| 152 | + 'name' => __('Property Bedrooms', 'geodirectory'), |
|
| 153 | + 'description' => __('Adds a select input for the number of bedrooms.', 'geodirectory'), |
|
| 154 | + 'defaults' => array( |
|
| 155 | + 'data_type' => 'VARCHAR', |
|
| 156 | + 'admin_title' => 'Property Bedrooms', |
|
| 157 | + 'site_title' => 'Bedrooms', |
|
| 158 | + 'admin_desc' => 'Select the number of bedrooms', |
|
| 159 | + 'htmlvar_name' => 'property_bedrooms', |
|
| 160 | + 'is_active' => true, |
|
| 161 | + 'for_admin_use' => false, |
|
| 162 | + 'default_value' => '', |
|
| 163 | + 'show_in' => '[detail],[listing]', |
|
| 164 | + 'is_required' => true, |
|
| 165 | + 'option_values' => __('Select Bedrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'), |
|
| 166 | + 'validation_pattern' => '', |
|
| 167 | + 'validation_msg' => '', |
|
| 168 | + 'required_msg' => '', |
|
| 169 | + 'field_icon' => 'fa fa-bed', |
|
| 170 | + 'css_class' => '', |
|
| 171 | + 'cat_sort' => true, |
|
| 172 | + 'cat_filter' => true |
|
| 173 | + ) |
|
| 174 | + ); |
|
| 175 | + |
|
| 176 | + // property bathrooms |
|
| 177 | + $custom_fields['property_bathrooms'] = array( // The key value should be unique and not contain any spaces. |
|
| 178 | + 'field_type' => 'select', |
|
| 179 | + 'class' => 'gd-property-bathrooms', |
|
| 180 | + 'icon' => 'fa fa-home', |
|
| 181 | + 'name' => __('Property Bathrooms', 'geodirectory'), |
|
| 182 | + 'description' => __('Adds a select input for the number of bathrooms.', 'geodirectory'), |
|
| 183 | + 'defaults' => array( |
|
| 184 | + 'data_type' => 'VARCHAR', |
|
| 185 | + 'admin_title' => 'Property Bathrooms', |
|
| 186 | + 'site_title' => 'Bathrooms', |
|
| 187 | + 'admin_desc' => 'Select the number of bathrooms', |
|
| 188 | + 'htmlvar_name' => 'property_bathrooms', |
|
| 189 | + 'is_active' => true, |
|
| 190 | + 'for_admin_use' => false, |
|
| 191 | + 'default_value' => '', |
|
| 192 | + 'show_in' => '[detail],[listing]', |
|
| 193 | + 'is_required' => true, |
|
| 194 | + 'option_values' => __('Select Bathrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'), |
|
| 195 | + 'validation_pattern' => '', |
|
| 196 | + 'validation_msg' => '', |
|
| 197 | + 'required_msg' => '', |
|
| 198 | + 'field_icon' => 'fa fa-bold', |
|
| 199 | + 'css_class' => '', |
|
| 200 | + 'cat_sort' => true, |
|
| 201 | + 'cat_filter' => true |
|
| 202 | + ) |
|
| 203 | + ); |
|
| 204 | + |
|
| 205 | + // property area |
|
| 206 | + $custom_fields['property_area'] = array( // The key value should be unique and not contain any spaces. |
|
| 207 | + 'field_type' => 'text', |
|
| 208 | + 'class' => 'gd-area', |
|
| 209 | + 'icon' => 'fa fa-home', |
|
| 210 | + 'name' => __('Property Area', 'geodirectory'), |
|
| 211 | + 'description' => __('Adds a input for the property area.', 'geodirectory'), |
|
| 212 | + 'defaults' => array( |
|
| 213 | + 'data_type' => 'FLOAT', |
|
| 214 | + 'admin_title' => 'Property Area', |
|
| 215 | + 'site_title' => 'Area (Sq Ft)', |
|
| 216 | + 'admin_desc' => 'Enter the Sq Ft value for the property', |
|
| 217 | + 'htmlvar_name' => 'property_area', |
|
| 218 | + 'is_active' => true, |
|
| 219 | + 'for_admin_use' => false, |
|
| 220 | + 'default_value' => '', |
|
| 221 | + 'show_in' => '[detail],[listing]', |
|
| 222 | + 'is_required' => false, |
|
| 223 | + 'validation_pattern' => '\d+(\.\d{2})?', |
|
| 224 | + 'validation_msg' => 'Please enter the property area in numbers only: 1500', |
|
| 225 | + 'required_msg' => '', |
|
| 226 | + 'field_icon' => 'fa fa-area-chart', |
|
| 227 | + 'css_class' => '', |
|
| 228 | + 'cat_sort' => true, |
|
| 229 | + 'cat_filter' => true |
|
| 230 | + ) |
|
| 231 | + ); |
|
| 232 | + |
|
| 233 | + // property features |
|
| 234 | + $custom_fields['property_features'] = array( // The key value should be unique and not contain any spaces. |
|
| 235 | + 'field_type' => 'multiselect', |
|
| 236 | + 'class' => 'gd-property-features', |
|
| 237 | + 'icon' => 'fa fa-home', |
|
| 238 | + 'name' => __('Property Features', 'geodirectory'), |
|
| 239 | + 'description' => __('Adds a select input for the property features.', 'geodirectory'), |
|
| 240 | + 'defaults' => array( |
|
| 241 | + 'data_type' => 'VARCHAR', |
|
| 242 | + 'admin_title' => 'Property Features', |
|
| 243 | + 'site_title' => 'Features', |
|
| 244 | + 'admin_desc' => 'Select the property features.', |
|
| 245 | + 'htmlvar_name' => 'property_features', |
|
| 246 | + 'is_active' => true, |
|
| 247 | + 'for_admin_use' => false, |
|
| 248 | + 'default_value' => '', |
|
| 249 | + 'show_in' => '[detail],[listing]', |
|
| 250 | + 'is_required' => true, |
|
| 251 | + 'option_values' => __('Select Features/,Gas Central Heating,Oil Central Heating,Double Glazing,Triple Glazing,Front Garden,Garage,Private driveway,Off Road Parking,Fireplace','geodirectory'), |
|
| 252 | + 'validation_pattern' => '', |
|
| 253 | + 'validation_msg' => '', |
|
| 254 | + 'required_msg' => '', |
|
| 255 | + 'field_icon' => 'fa fa-plus-square', |
|
| 256 | + 'css_class' => '', |
|
| 257 | + 'cat_sort' => true, |
|
| 258 | + 'cat_filter' => true |
|
| 259 | + ) |
|
| 260 | + ); |
|
| 261 | + |
|
| 262 | + // Twitter feed |
|
| 263 | + $custom_fields['twitter_feed'] = array( // The key value should be unique and not contain any spaces. |
|
| 264 | + 'field_type' => 'text', |
|
| 265 | + 'class' => 'gd-twitter', |
|
| 266 | + 'icon' => 'fa fa-twitter', |
|
| 267 | + 'name' => __('Twitter feed', 'geodirectory'), |
|
| 268 | + 'description' => __('Adds a input for twitter username and outputs feed.', 'geodirectory'), |
|
| 269 | + 'defaults' => array( |
|
| 270 | + 'data_type' => 'VARCHAR', |
|
| 271 | + 'admin_title' => 'Twitter', |
|
| 272 | + 'site_title' => 'Twitter', |
|
| 273 | + 'admin_desc' => 'Enter your Twitter username', |
|
| 274 | + 'htmlvar_name' => 'twitterusername', |
|
| 275 | + 'is_active' => true, |
|
| 276 | + 'for_admin_use' => false, |
|
| 277 | + 'default_value' => '', |
|
| 278 | + 'show_in' => '[detail],[owntab]', |
|
| 279 | + 'is_required' => false, |
|
| 280 | + 'validation_pattern' => '^[A-Za-z0-9_]{1,32}$', |
|
| 281 | + 'validation_msg' => 'Please enter a valid twitter username.', |
|
| 282 | + 'required_msg' => '', |
|
| 283 | + 'field_icon' => 'fa fa-twitter', |
|
| 284 | + 'css_class' => '', |
|
| 285 | + 'cat_sort' => false, |
|
| 286 | + 'cat_filter' => false |
|
| 287 | + ) |
|
| 288 | + ); |
|
| 289 | + |
|
| 290 | + // Get directions link |
|
| 291 | + $custom_fields['get_directions'] = array( // The key value should be unique and not contain any spaces. |
|
| 292 | + 'field_type' => 'text', |
|
| 293 | + 'class' => 'gd-get-directions', |
|
| 294 | + 'icon' => 'fa fa-location-arrow', |
|
| 295 | + 'name' => __('Get Directions Link', 'geodirectory'), |
|
| 296 | + 'description' => __('Adds a input for twitter username and outputs feed.', 'geodirectory'), |
|
| 297 | + 'defaults' => array( |
|
| 298 | + 'data_type' => 'VARCHAR', |
|
| 299 | + 'admin_title' => 'Get Directions', |
|
| 300 | + 'site_title' => 'Get Directions', |
|
| 301 | + 'admin_desc' => '', |
|
| 302 | + 'htmlvar_name' => 'get_directions', |
|
| 303 | + 'is_active' => true, |
|
| 304 | + 'for_admin_use' => true, |
|
| 305 | + 'default_value' => 'Get Directions', |
|
| 306 | + 'show_in' => '[detail],[listing]', |
|
| 307 | + 'is_required' => false, |
|
| 308 | + 'validation_pattern' => '', |
|
| 309 | + 'validation_msg' => '', |
|
| 310 | + 'required_msg' => '', |
|
| 311 | + 'field_icon' => 'fa fa-location-arrow', |
|
| 312 | + 'css_class' => '', |
|
| 313 | + 'cat_sort' => false, |
|
| 314 | + 'cat_filter' => false |
|
| 315 | + ) |
|
| 316 | + ); |
|
| 317 | + |
|
| 318 | + |
|
| 319 | + // JOB TYPE CF |
|
| 320 | + |
|
| 321 | + // job type |
|
| 322 | + $custom_fields['job_type'] = array( // The key value should be unique and not contain any spaces. |
|
| 323 | + 'field_type' => 'select', |
|
| 324 | + 'class' => 'gd-job-type', |
|
| 325 | + 'icon' => 'fa fa-briefcase', |
|
| 326 | + 'name' => __('Job Type', 'geodirectory'), |
|
| 327 | + 'description' => __('Adds a select input to be able to set the type of a job ie: Full Time, Part Time', 'geodirectory'), |
|
| 328 | + 'defaults' => array( |
|
| 329 | + 'data_type' => 'VARCHAR', |
|
| 330 | + 'admin_title' => __('Job Type', 'geodirectory'), |
|
| 331 | + 'site_title' => __('Job Type','geodirectory'), |
|
| 332 | + 'admin_desc' => __('Select the type of job.','geodirectory'), |
|
| 333 | + 'htmlvar_name' => 'job_type', |
|
| 334 | + 'is_active' => true, |
|
| 335 | + 'for_admin_use' => false, |
|
| 336 | + 'default_value' => '', |
|
| 337 | + 'show_in' => '[detail],[listing]', |
|
| 338 | + 'is_required' => true, |
|
| 339 | + 'option_values' => __('Select Type/,Freelance,Full Time,Internship,Part Time,Temporary,Other','geodirectory'), |
|
| 340 | + 'validation_pattern' => '', |
|
| 341 | + 'validation_msg' => '', |
|
| 342 | + 'required_msg' => '', |
|
| 343 | + 'field_icon' => 'fa fa-briefcase', |
|
| 344 | + 'css_class' => '', |
|
| 345 | + 'cat_sort' => true, |
|
| 346 | + 'cat_filter' => true |
|
| 347 | + ) |
|
| 348 | + ); |
|
| 349 | + |
|
| 350 | + // job sector |
|
| 351 | + $custom_fields['job_sector'] = array( // The key value should be unique and not contain any spaces. |
|
| 352 | + 'field_type' => 'select', |
|
| 353 | + 'class' => 'gd-job-type', |
|
| 354 | + 'icon' => 'fa fa-briefcase', |
|
| 355 | + 'name' => __('Job Sector', 'geodirectory'), |
|
| 356 | + 'description' => __('Adds a select input to be able to set the type of a job Sector ie: Private Sector,Public Sector', 'geodirectory'), |
|
| 357 | + 'defaults' => array( |
|
| 358 | + 'data_type' => 'VARCHAR', |
|
| 359 | + 'admin_title' => __('Job Sector','geodirectory'), |
|
| 360 | + 'site_title' => __('Job Sector','geodirectory'), |
|
| 361 | + 'admin_desc' => __('Select the job sector.','geodirectory'), |
|
| 362 | + 'htmlvar_name' => 'job_sector', |
|
| 363 | + 'is_active' => true, |
|
| 364 | + 'for_admin_use' => false, |
|
| 365 | + 'default_value' => '', |
|
| 366 | + 'show_in' => '[detail]', |
|
| 367 | + 'is_required' => true, |
|
| 368 | + 'option_values' => __('Select Sector/,Private Sector,Public Sector,Agencies','geodirectory'), |
|
| 369 | + 'validation_pattern' => '', |
|
| 370 | + 'validation_msg' => '', |
|
| 371 | + 'required_msg' => '', |
|
| 372 | + 'field_icon' => 'fa fa-briefcase', |
|
| 373 | + 'css_class' => '', |
|
| 374 | + 'cat_sort' => true, |
|
| 375 | + 'cat_filter' => true |
|
| 376 | + ) |
|
| 377 | + ); |
|
| 378 | + |
|
| 379 | + |
|
| 380 | + /** |
|
| 381 | + * @see `geodir_custom_fields` |
|
| 382 | + */ |
|
| 383 | + return apply_filters('geodir_custom_fields_predefined',$custom_fields,$post_type); |
|
| 384 | 384 | } |
| 385 | 385 | |
| 386 | 386 | |
@@ -395,32 +395,32 @@ discard block |
||
| 395 | 395 | * @return string The html to output. |
| 396 | 396 | */ |
| 397 | 397 | function geodir_predefined_custom_field_output_twitter_feed($html,$location,$cf){ |
| 398 | - global $post; |
|
| 398 | + global $post; |
|
| 399 | 399 | |
| 400 | 400 | |
| 401 | - if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != '' ): |
|
| 401 | + if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != '' ): |
|
| 402 | 402 | |
| 403 | - $class = ($cf['htmlvar_name'] == 'geodir_timing') ? "geodir-i-time" : "geodir-i-text"; |
|
| 403 | + $class = ($cf['htmlvar_name'] == 'geodir_timing') ? "geodir-i-time" : "geodir-i-text"; |
|
| 404 | 404 | |
| 405 | - $field_icon = geodir_field_icon_proccess($cf); |
|
| 406 | - if (strpos($field_icon, 'http') !== false) { |
|
| 407 | - $field_icon_af = ''; |
|
| 408 | - } elseif ($field_icon == '') { |
|
| 409 | - $field_icon_af = ($cf['htmlvar_name'] == 'geodir_timing') ? '<i class="fa fa-clock-o"></i>' : ""; |
|
| 410 | - } else { |
|
| 411 | - $field_icon_af = $field_icon; |
|
| 412 | - $field_icon = ''; |
|
| 413 | - } |
|
| 405 | + $field_icon = geodir_field_icon_proccess($cf); |
|
| 406 | + if (strpos($field_icon, 'http') !== false) { |
|
| 407 | + $field_icon_af = ''; |
|
| 408 | + } elseif ($field_icon == '') { |
|
| 409 | + $field_icon_af = ($cf['htmlvar_name'] == 'geodir_timing') ? '<i class="fa fa-clock-o"></i>' : ""; |
|
| 410 | + } else { |
|
| 411 | + $field_icon_af = $field_icon; |
|
| 412 | + $field_icon = ''; |
|
| 413 | + } |
|
| 414 | 414 | |
| 415 | 415 | |
| 416 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;">'; |
|
| 416 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;">'; |
|
| 417 | 417 | |
| 418 | - $html .= '<a class="twitter-timeline" data-height="600" data-dnt="true" href="https://twitter.com/'.$post->{$cf['htmlvar_name']}.'">Tweets by '.$post->{$cf['htmlvar_name']}.'</a> <script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>'; |
|
| 419 | - $html .= '</div>'; |
|
| 418 | + $html .= '<a class="twitter-timeline" data-height="600" data-dnt="true" href="https://twitter.com/'.$post->{$cf['htmlvar_name']}.'">Tweets by '.$post->{$cf['htmlvar_name']}.'</a> <script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>'; |
|
| 419 | + $html .= '</div>'; |
|
| 420 | 420 | |
| 421 | - endif; |
|
| 421 | + endif; |
|
| 422 | 422 | |
| 423 | - return $html; |
|
| 423 | + return $html; |
|
| 424 | 424 | } |
| 425 | 425 | add_filter('geodir_custom_field_output_text_key_twitter_feed','geodir_predefined_custom_field_output_twitter_feed',10,3); |
| 426 | 426 | |
@@ -435,36 +435,36 @@ discard block |
||
| 435 | 435 | * @return string The html to output. |
| 436 | 436 | */ |
| 437 | 437 | function geodir_predefined_custom_field_output_get_directions($html,$location,$cf) { |
| 438 | - global $post; |
|
| 438 | + global $post; |
|
| 439 | 439 | |
| 440 | 440 | |
| 441 | - if ( isset( $post->{$cf['htmlvar_name']} ) && $post->{$cf['htmlvar_name']} != '' && isset( $post->post_latitude ) && $post->post_latitude ){ |
|
| 441 | + if ( isset( $post->{$cf['htmlvar_name']} ) && $post->{$cf['htmlvar_name']} != '' && isset( $post->post_latitude ) && $post->post_latitude ){ |
|
| 442 | 442 | |
| 443 | - $field_icon = geodir_field_icon_proccess( $cf ); |
|
| 444 | - if ( strpos( $field_icon, 'http' ) !== false ) { |
|
| 445 | - $field_icon_af = ''; |
|
| 446 | - } elseif ( $field_icon == '' ) { |
|
| 447 | - $field_icon_af = '<i class="fa fa-location-arrow"></i>'; |
|
| 448 | - } else { |
|
| 449 | - $field_icon_af = $field_icon; |
|
| 450 | - $field_icon = ''; |
|
| 451 | - } |
|
| 443 | + $field_icon = geodir_field_icon_proccess( $cf ); |
|
| 444 | + if ( strpos( $field_icon, 'http' ) !== false ) { |
|
| 445 | + $field_icon_af = ''; |
|
| 446 | + } elseif ( $field_icon == '' ) { |
|
| 447 | + $field_icon_af = '<i class="fa fa-location-arrow"></i>'; |
|
| 448 | + } else { |
|
| 449 | + $field_icon_af = $field_icon; |
|
| 450 | + $field_icon = ''; |
|
| 451 | + } |
|
| 452 | 452 | |
| 453 | - $link_text = isset( $post->{$cf['default_value']} ) ? $post->{$cf['default_value']} : __( 'Get Directions', 'geodirectory' ); |
|
| 453 | + $link_text = isset( $post->{$cf['default_value']} ) ? $post->{$cf['default_value']} : __( 'Get Directions', 'geodirectory' ); |
|
| 454 | 454 | |
| 455 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;">'; |
|
| 455 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;">'; |
|
| 456 | 456 | |
| 457 | - if(isset( $cf['field_icon'] ) && $cf['field_icon']){ |
|
| 458 | - $html .= $field_icon_af; |
|
| 459 | - } |
|
| 457 | + if(isset( $cf['field_icon'] ) && $cf['field_icon']){ |
|
| 458 | + $html .= $field_icon_af; |
|
| 459 | + } |
|
| 460 | 460 | |
| 461 | - $html .= '<a href="https://www.google.com/maps/dir//\'' . $post->post_latitude . ',' . $post->post_longitude . '\'/" target="_blank" >' . $link_text . '</a>'; |
|
| 462 | - $html .= '</div>'; |
|
| 461 | + $html .= '<a href="https://www.google.com/maps/dir//\'' . $post->post_latitude . ',' . $post->post_longitude . '\'/" target="_blank" >' . $link_text . '</a>'; |
|
| 462 | + $html .= '</div>'; |
|
| 463 | 463 | |
| 464 | - }else{ |
|
| 465 | - $html =''; |
|
| 466 | - } |
|
| 464 | + }else{ |
|
| 465 | + $html =''; |
|
| 466 | + } |
|
| 467 | 467 | |
| 468 | - return $html; |
|
| 468 | + return $html; |
|
| 469 | 469 | } |
| 470 | 470 | add_filter('geodir_custom_field_output_text_key_get_directions','geodir_predefined_custom_field_output_get_directions',10,3); |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | * @package GeoDirectory |
| 16 | 16 | * @see `geodir_custom_field_save` for array details. |
| 17 | 17 | */ |
| 18 | -function geodir_custom_fields_predefined($post_type=''){ |
|
| 18 | +function geodir_custom_fields_predefined($post_type = '') { |
|
| 19 | 19 | |
| 20 | 20 | $custom_fields = array(); |
| 21 | 21 | |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | 'default_value' => '', |
| 76 | 76 | 'show_in' => '[detail],[listing]', |
| 77 | 77 | 'is_required' => true, |
| 78 | - 'option_values' => __('Select Status/,For Sale,For Rent,Sold,Let','geodirectory'), |
|
| 78 | + 'option_values' => __('Select Status/,For Sale,For Rent,Sold,Let', 'geodirectory'), |
|
| 79 | 79 | 'validation_pattern' => '', |
| 80 | 80 | 'validation_msg' => '', |
| 81 | 81 | 'required_msg' => '', |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | 'default_value' => '', |
| 105 | 105 | 'show_in' => '[detail],[listing]', |
| 106 | 106 | 'is_required' => true, |
| 107 | - 'option_values' => __('Select Status/,Unfurnished,Furnished,Partially furnished,Optional','geodirectory'), |
|
| 107 | + 'option_values' => __('Select Status/,Unfurnished,Furnished,Partially furnished,Optional', 'geodirectory'), |
|
| 108 | 108 | 'validation_pattern' => '', |
| 109 | 109 | 'validation_msg' => '', |
| 110 | 110 | 'required_msg' => '', |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | 'default_value' => '', |
| 134 | 134 | 'show_in' => '[detail],[listing]', |
| 135 | 135 | 'is_required' => true, |
| 136 | - 'option_values' => __('Select Type/,Detached house,Semi-detached house,Apartment,Bungalow,Semi-detached bungalow,Chalet,Town House,End-terrace house,Terrace house,Cottage','geodirectory'), |
|
| 136 | + 'option_values' => __('Select Type/,Detached house,Semi-detached house,Apartment,Bungalow,Semi-detached bungalow,Chalet,Town House,End-terrace house,Terrace house,Cottage', 'geodirectory'), |
|
| 137 | 137 | 'validation_pattern' => '', |
| 138 | 138 | 'validation_msg' => '', |
| 139 | 139 | 'required_msg' => '', |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | 'default_value' => '', |
| 163 | 163 | 'show_in' => '[detail],[listing]', |
| 164 | 164 | 'is_required' => true, |
| 165 | - 'option_values' => __('Select Bedrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'), |
|
| 165 | + 'option_values' => __('Select Bedrooms/,1,2,3,4,5,6,7,8,9,10', 'geodirectory'), |
|
| 166 | 166 | 'validation_pattern' => '', |
| 167 | 167 | 'validation_msg' => '', |
| 168 | 168 | 'required_msg' => '', |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | 'default_value' => '', |
| 192 | 192 | 'show_in' => '[detail],[listing]', |
| 193 | 193 | 'is_required' => true, |
| 194 | - 'option_values' => __('Select Bathrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'), |
|
| 194 | + 'option_values' => __('Select Bathrooms/,1,2,3,4,5,6,7,8,9,10', 'geodirectory'), |
|
| 195 | 195 | 'validation_pattern' => '', |
| 196 | 196 | 'validation_msg' => '', |
| 197 | 197 | 'required_msg' => '', |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | 'default_value' => '', |
| 249 | 249 | 'show_in' => '[detail],[listing]', |
| 250 | 250 | 'is_required' => true, |
| 251 | - 'option_values' => __('Select Features/,Gas Central Heating,Oil Central Heating,Double Glazing,Triple Glazing,Front Garden,Garage,Private driveway,Off Road Parking,Fireplace','geodirectory'), |
|
| 251 | + 'option_values' => __('Select Features/,Gas Central Heating,Oil Central Heating,Double Glazing,Triple Glazing,Front Garden,Garage,Private driveway,Off Road Parking,Fireplace', 'geodirectory'), |
|
| 252 | 252 | 'validation_pattern' => '', |
| 253 | 253 | 'validation_msg' => '', |
| 254 | 254 | 'required_msg' => '', |
@@ -328,15 +328,15 @@ discard block |
||
| 328 | 328 | 'defaults' => array( |
| 329 | 329 | 'data_type' => 'VARCHAR', |
| 330 | 330 | 'admin_title' => __('Job Type', 'geodirectory'), |
| 331 | - 'site_title' => __('Job Type','geodirectory'), |
|
| 332 | - 'admin_desc' => __('Select the type of job.','geodirectory'), |
|
| 331 | + 'site_title' => __('Job Type', 'geodirectory'), |
|
| 332 | + 'admin_desc' => __('Select the type of job.', 'geodirectory'), |
|
| 333 | 333 | 'htmlvar_name' => 'job_type', |
| 334 | 334 | 'is_active' => true, |
| 335 | 335 | 'for_admin_use' => false, |
| 336 | 336 | 'default_value' => '', |
| 337 | 337 | 'show_in' => '[detail],[listing]', |
| 338 | 338 | 'is_required' => true, |
| 339 | - 'option_values' => __('Select Type/,Freelance,Full Time,Internship,Part Time,Temporary,Other','geodirectory'), |
|
| 339 | + 'option_values' => __('Select Type/,Freelance,Full Time,Internship,Part Time,Temporary,Other', 'geodirectory'), |
|
| 340 | 340 | 'validation_pattern' => '', |
| 341 | 341 | 'validation_msg' => '', |
| 342 | 342 | 'required_msg' => '', |
@@ -356,16 +356,16 @@ discard block |
||
| 356 | 356 | 'description' => __('Adds a select input to be able to set the type of a job Sector ie: Private Sector,Public Sector', 'geodirectory'), |
| 357 | 357 | 'defaults' => array( |
| 358 | 358 | 'data_type' => 'VARCHAR', |
| 359 | - 'admin_title' => __('Job Sector','geodirectory'), |
|
| 360 | - 'site_title' => __('Job Sector','geodirectory'), |
|
| 361 | - 'admin_desc' => __('Select the job sector.','geodirectory'), |
|
| 359 | + 'admin_title' => __('Job Sector', 'geodirectory'), |
|
| 360 | + 'site_title' => __('Job Sector', 'geodirectory'), |
|
| 361 | + 'admin_desc' => __('Select the job sector.', 'geodirectory'), |
|
| 362 | 362 | 'htmlvar_name' => 'job_sector', |
| 363 | 363 | 'is_active' => true, |
| 364 | 364 | 'for_admin_use' => false, |
| 365 | 365 | 'default_value' => '', |
| 366 | 366 | 'show_in' => '[detail]', |
| 367 | 367 | 'is_required' => true, |
| 368 | - 'option_values' => __('Select Sector/,Private Sector,Public Sector,Agencies','geodirectory'), |
|
| 368 | + 'option_values' => __('Select Sector/,Private Sector,Public Sector,Agencies', 'geodirectory'), |
|
| 369 | 369 | 'validation_pattern' => '', |
| 370 | 370 | 'validation_msg' => '', |
| 371 | 371 | 'required_msg' => '', |
@@ -380,7 +380,7 @@ discard block |
||
| 380 | 380 | /** |
| 381 | 381 | * @see `geodir_custom_fields` |
| 382 | 382 | */ |
| 383 | - return apply_filters('geodir_custom_fields_predefined',$custom_fields,$post_type); |
|
| 383 | + return apply_filters('geodir_custom_fields_predefined', $custom_fields, $post_type); |
|
| 384 | 384 | } |
| 385 | 385 | |
| 386 | 386 | |
@@ -394,11 +394,11 @@ discard block |
||
| 394 | 394 | * @since 1.6.9 |
| 395 | 395 | * @return string The html to output. |
| 396 | 396 | */ |
| 397 | -function geodir_predefined_custom_field_output_twitter_feed($html,$location,$cf){ |
|
| 397 | +function geodir_predefined_custom_field_output_twitter_feed($html, $location, $cf) { |
|
| 398 | 398 | global $post; |
| 399 | 399 | |
| 400 | 400 | |
| 401 | - if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != '' ): |
|
| 401 | + if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != ''): |
|
| 402 | 402 | |
| 403 | 403 | $class = ($cf['htmlvar_name'] == 'geodir_timing') ? "geodir-i-time" : "geodir-i-text"; |
| 404 | 404 | |
@@ -413,7 +413,7 @@ discard block |
||
| 413 | 413 | } |
| 414 | 414 | |
| 415 | 415 | |
| 416 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;">'; |
|
| 416 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;">'; |
|
| 417 | 417 | |
| 418 | 418 | $html .= '<a class="twitter-timeline" data-height="600" data-dnt="true" href="https://twitter.com/'.$post->{$cf['htmlvar_name']}.'">Tweets by '.$post->{$cf['htmlvar_name']}.'</a> <script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>'; |
| 419 | 419 | $html .= '</div>'; |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | |
| 423 | 423 | return $html; |
| 424 | 424 | } |
| 425 | -add_filter('geodir_custom_field_output_text_key_twitter_feed','geodir_predefined_custom_field_output_twitter_feed',10,3); |
|
| 425 | +add_filter('geodir_custom_field_output_text_key_twitter_feed', 'geodir_predefined_custom_field_output_twitter_feed', 10, 3); |
|
| 426 | 426 | |
| 427 | 427 | /** |
| 428 | 428 | * Filter the get_directions custom field output to show a link. |
@@ -434,37 +434,37 @@ discard block |
||
| 434 | 434 | * @since 1.6.9 |
| 435 | 435 | * @return string The html to output. |
| 436 | 436 | */ |
| 437 | -function geodir_predefined_custom_field_output_get_directions($html,$location,$cf) { |
|
| 437 | +function geodir_predefined_custom_field_output_get_directions($html, $location, $cf) { |
|
| 438 | 438 | global $post; |
| 439 | 439 | |
| 440 | 440 | |
| 441 | - if ( isset( $post->{$cf['htmlvar_name']} ) && $post->{$cf['htmlvar_name']} != '' && isset( $post->post_latitude ) && $post->post_latitude ){ |
|
| 441 | + if (isset($post->{$cf['htmlvar_name']} ) && $post->{$cf['htmlvar_name']} != '' && isset($post->post_latitude) && $post->post_latitude) { |
|
| 442 | 442 | |
| 443 | - $field_icon = geodir_field_icon_proccess( $cf ); |
|
| 444 | - if ( strpos( $field_icon, 'http' ) !== false ) { |
|
| 443 | + $field_icon = geodir_field_icon_proccess($cf); |
|
| 444 | + if (strpos($field_icon, 'http') !== false) { |
|
| 445 | 445 | $field_icon_af = ''; |
| 446 | - } elseif ( $field_icon == '' ) { |
|
| 446 | + } elseif ($field_icon == '') { |
|
| 447 | 447 | $field_icon_af = '<i class="fa fa-location-arrow"></i>'; |
| 448 | 448 | } else { |
| 449 | 449 | $field_icon_af = $field_icon; |
| 450 | 450 | $field_icon = ''; |
| 451 | 451 | } |
| 452 | 452 | |
| 453 | - $link_text = isset( $post->{$cf['default_value']} ) ? $post->{$cf['default_value']} : __( 'Get Directions', 'geodirectory' ); |
|
| 453 | + $link_text = isset($post->{$cf['default_value']} ) ? $post->{$cf['default_value']} : __('Get Directions', 'geodirectory'); |
|
| 454 | 454 | |
| 455 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;">'; |
|
| 455 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;">'; |
|
| 456 | 456 | |
| 457 | - if(isset( $cf['field_icon'] ) && $cf['field_icon']){ |
|
| 457 | + if (isset($cf['field_icon']) && $cf['field_icon']) { |
|
| 458 | 458 | $html .= $field_icon_af; |
| 459 | 459 | } |
| 460 | 460 | |
| 461 | - $html .= '<a href="https://www.google.com/maps/dir//\'' . $post->post_latitude . ',' . $post->post_longitude . '\'/" target="_blank" >' . $link_text . '</a>'; |
|
| 461 | + $html .= '<a href="https://www.google.com/maps/dir//\''.$post->post_latitude.','.$post->post_longitude.'\'/" target="_blank" >'.$link_text.'</a>'; |
|
| 462 | 462 | $html .= '</div>'; |
| 463 | 463 | |
| 464 | - }else{ |
|
| 465 | - $html =''; |
|
| 464 | + } else { |
|
| 465 | + $html = ''; |
|
| 466 | 466 | } |
| 467 | 467 | |
| 468 | 468 | return $html; |
| 469 | 469 | } |
| 470 | -add_filter('geodir_custom_field_output_text_key_get_directions','geodir_predefined_custom_field_output_get_directions',10,3); |
|
| 470 | +add_filter('geodir_custom_field_output_text_key_get_directions', 'geodir_predefined_custom_field_output_get_directions', 10, 3); |
|
@@ -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,289 +104,289 @@ 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 | - if (isset($_REQUEST['posttype'])) |
|
| 144 | - /** |
|
| 145 | - * Used to delete the dummy post data per post type. |
|
| 146 | - * |
|
| 147 | - * Uses dynamic hook, geodir_delete_dummy_posts_$_REQUEST['posttype']. |
|
| 148 | - * |
|
| 149 | - * @since 1.6.11 |
|
| 150 | - * @param string $posttype The post type to insert. |
|
| 151 | - * @param string $datatype The type of dummy data to insert. |
|
| 152 | - */ |
|
| 153 | - do_action('geodir_delete_dummy_posts' ,sanitize_key($_REQUEST['posttype']),sanitize_key(['datatype']));
|
|
| 154 | - break; |
|
| 155 | - case "geodir_dummy_insert" : |
|
| 156 | - if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir_dummy_posts_insert_noncename')) |
|
| 157 | - return; |
|
| 158 | - |
|
| 159 | - global $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2; |
|
| 160 | - $city_bound_lat1 = $_REQUEST['city_bound_lat1']; |
|
| 161 | - $city_bound_lng1 = $_REQUEST['city_bound_lng1']; |
|
| 162 | - $city_bound_lat2 = $_REQUEST['city_bound_lat2']; |
|
| 163 | - $city_bound_lng2 = $_REQUEST['city_bound_lng2']; |
|
| 164 | - |
|
| 165 | - if (isset($_REQUEST['posttype'])){
|
|
| 166 | - /** |
|
| 167 | - * Used to insert the dummy post data per post type. |
|
| 168 | - * |
|
| 169 | - * Uses dynamic hook, geodir_insert_dummy_posts_$_REQUEST['posttype']. |
|
| 170 | - * |
|
| 171 | - * @since 1.6.11 |
|
| 172 | - * @param string $posttype The post type to insert. |
|
| 173 | - * @param string $datatype The type of dummy data to insert. |
|
| 174 | - * @param int $post_index The item number to insert. |
|
| 175 | - */ |
|
| 176 | - do_action('geodir_insert_dummy_posts',sanitize_key($_REQUEST['posttype']),sanitize_key($_REQUEST['datatype']),absint($_REQUEST['insert_dummy_post_index']));
|
|
| 177 | - } |
|
| 178 | - |
|
| 179 | - |
|
| 180 | - break; |
|
| 181 | - endswitch; |
|
| 182 | - } else {
|
|
| 183 | - wp_redirect(geodir_login_url()); |
|
| 184 | - exit(); |
|
| 185 | - } |
|
| 186 | - } |
|
| 187 | - |
|
| 188 | - if (isset($_REQUEST['popuptype']) && $_REQUEST['popuptype'] != '' && isset($_REQUEST['post_id']) && $_REQUEST['post_id'] != '') {
|
|
| 189 | - |
|
| 190 | - if ($_REQUEST['popuptype'] == 'b_send_inquiry' || $_REQUEST['popuptype'] == 'b_sendtofriend') {
|
|
| 191 | - $template = locate_template(array("geodirectory/popup-forms.php"));
|
|
| 192 | - if (!$template) {
|
|
| 193 | - $template = geodir_plugin_path() . '/geodirectory-templates/popup-forms.php'; |
|
| 194 | - } |
|
| 195 | - require_once($template); |
|
| 196 | - } |
|
| 197 | - |
|
| 198 | - gd_die(); |
|
| 199 | - } |
|
| 200 | - |
|
| 201 | - /*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 | + if (isset($_REQUEST['posttype'])) |
|
| 144 | + /** |
|
| 145 | + * Used to delete the dummy post data per post type. |
|
| 146 | + * |
|
| 147 | + * Uses dynamic hook, geodir_delete_dummy_posts_$_REQUEST['posttype']. |
|
| 148 | + * |
|
| 149 | + * @since 1.6.11 |
|
| 150 | + * @param string $posttype The post type to insert. |
|
| 151 | + * @param string $datatype The type of dummy data to insert. |
|
| 152 | + */ |
|
| 153 | + do_action('geodir_delete_dummy_posts' ,sanitize_key($_REQUEST['posttype']),sanitize_key(['datatype']));
|
|
| 154 | + break; |
|
| 155 | + case "geodir_dummy_insert" : |
|
| 156 | + if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir_dummy_posts_insert_noncename')) |
|
| 157 | + return; |
|
| 158 | + |
|
| 159 | + global $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2; |
|
| 160 | + $city_bound_lat1 = $_REQUEST['city_bound_lat1']; |
|
| 161 | + $city_bound_lng1 = $_REQUEST['city_bound_lng1']; |
|
| 162 | + $city_bound_lat2 = $_REQUEST['city_bound_lat2']; |
|
| 163 | + $city_bound_lng2 = $_REQUEST['city_bound_lng2']; |
|
| 164 | + |
|
| 165 | + if (isset($_REQUEST['posttype'])){
|
|
| 166 | + /** |
|
| 167 | + * Used to insert the dummy post data per post type. |
|
| 168 | + * |
|
| 169 | + * Uses dynamic hook, geodir_insert_dummy_posts_$_REQUEST['posttype']. |
|
| 170 | + * |
|
| 171 | + * @since 1.6.11 |
|
| 172 | + * @param string $posttype The post type to insert. |
|
| 173 | + * @param string $datatype The type of dummy data to insert. |
|
| 174 | + * @param int $post_index The item number to insert. |
|
| 175 | + */ |
|
| 176 | + do_action('geodir_insert_dummy_posts',sanitize_key($_REQUEST['posttype']),sanitize_key($_REQUEST['datatype']),absint($_REQUEST['insert_dummy_post_index']));
|
|
| 177 | + } |
|
| 178 | + |
|
| 179 | + |
|
| 180 | + break; |
|
| 181 | + endswitch; |
|
| 182 | + } else {
|
|
| 183 | + wp_redirect(geodir_login_url()); |
|
| 184 | + exit(); |
|
| 185 | + } |
|
| 186 | + } |
|
| 187 | + |
|
| 188 | + if (isset($_REQUEST['popuptype']) && $_REQUEST['popuptype'] != '' && isset($_REQUEST['post_id']) && $_REQUEST['post_id'] != '') {
|
|
| 189 | + |
|
| 190 | + if ($_REQUEST['popuptype'] == 'b_send_inquiry' || $_REQUEST['popuptype'] == 'b_sendtofriend') {
|
|
| 191 | + $template = locate_template(array("geodirectory/popup-forms.php"));
|
|
| 192 | + if (!$template) {
|
|
| 193 | + $template = geodir_plugin_path() . '/geodirectory-templates/popup-forms.php'; |
|
| 194 | + } |
|
| 195 | + require_once($template); |
|
| 196 | + } |
|
| 197 | + |
|
| 198 | + gd_die(); |
|
| 199 | + } |
|
| 200 | + |
|
| 201 | + /*if(isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'filter_ajax'){
|
|
| 202 | 202 | include_once ( geodir_plugin_path() . '/geodirectory-templates/advance-search-form.php'); |
| 203 | 203 | }*/ |
| 204 | 204 | |
| 205 | - if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'map_ajax') {
|
|
| 206 | - /** |
|
| 207 | - * Contains map marker functions. |
|
| 208 | - * |
|
| 209 | - * @since 1.0.0 |
|
| 210 | - * @package GeoDirectory |
|
| 211 | - */ |
|
| 212 | - include_once(geodir_plugin_path() . '/geodirectory-functions/map-functions/get_markers.php'); |
|
| 213 | - } |
|
| 214 | - |
|
| 215 | - if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'favorite') {
|
|
| 216 | - if (is_user_logged_in()) {
|
|
| 217 | - switch ($_REQUEST['ajax_action']): |
|
| 218 | - case "add" : |
|
| 219 | - geodir_add_to_favorite((int)$_REQUEST['pid']); |
|
| 220 | - break; |
|
| 221 | - case "remove" : |
|
| 222 | - geodir_remove_from_favorite((int)$_REQUEST['pid']); |
|
| 223 | - break; |
|
| 224 | - endswitch; |
|
| 225 | - } else {
|
|
| 226 | - wp_redirect(geodir_login_url()); |
|
| 227 | - exit(); |
|
| 228 | - } |
|
| 229 | - } |
|
| 230 | - |
|
| 231 | - if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'add_listing') {
|
|
| 232 | - |
|
| 233 | - $is_current_user_owner = true; |
|
| 234 | - if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 235 | - $is_current_user_owner = geodir_listing_belong_to_current_user((int)$_REQUEST['pid']); |
|
| 236 | - } |
|
| 237 | - |
|
| 238 | - $request = $gd_session->get('listing');
|
|
| 239 | - |
|
| 240 | - if (is_user_logged_in() && $is_current_user_owner) {
|
|
| 241 | - |
|
| 242 | - switch ($_REQUEST['ajax_action']): |
|
| 243 | - case "add": |
|
| 244 | - case "update": |
|
| 245 | - |
|
| 246 | - if (isset($request['geodir_spamblocker']) && $request['geodir_spamblocker'] == '64' && isset($request['geodir_filled_by_spam_bot']) && $request['geodir_filled_by_spam_bot'] == '') {
|
|
| 247 | - $last_id = geodir_save_listing(); |
|
| 248 | - |
|
| 249 | - if ($last_id) {
|
|
| 250 | - //$redirect_to = get_permalink( $last_id ); |
|
| 251 | - $redirect_to = geodir_getlink(get_permalink(geodir_success_page_id()), array('pid' => $last_id));
|
|
| 252 | - |
|
| 253 | - } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 254 | - $redirect_to = get_permalink(geodir_add_listing_page_id()); |
|
| 255 | - $redirect_to = geodir_getlink($redirect_to, array('pid' => $post->pid), false);
|
|
| 256 | - } else |
|
| 257 | - $redirect_to = get_permalink(geodir_add_listing_page_id()); |
|
| 258 | - |
|
| 259 | - wp_redirect($redirect_to); |
|
| 260 | - } else {
|
|
| 261 | - $gd_session->un_set('listing');
|
|
| 262 | - wp_redirect(home_url()); |
|
| 263 | - } |
|
| 264 | - |
|
| 265 | - break; |
|
| 266 | - case "cancel" : |
|
| 267 | - |
|
| 268 | - $gd_session->un_set('listing');
|
|
| 269 | - |
|
| 270 | - if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '' && get_permalink($_REQUEST['pid'])) |
|
| 271 | - wp_redirect(get_permalink($_REQUEST['pid'])); |
|
| 272 | - else {
|
|
| 273 | - geodir_remove_temp_images(); |
|
| 274 | - wp_redirect(geodir_getlink(get_permalink(geodir_add_listing_page_id()), array('listing_type' => $_REQUEST['listing_type'])));
|
|
| 275 | - } |
|
| 276 | - |
|
| 277 | - break; |
|
| 278 | - |
|
| 279 | - case "publish" : |
|
| 280 | - |
|
| 281 | - if (isset($request['geodir_spamblocker']) && $request['geodir_spamblocker'] == '64' && isset($request['geodir_filled_by_spam_bot']) && $request['geodir_filled_by_spam_bot'] == '') {
|
|
| 282 | - |
|
| 283 | - if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 284 | - $new_post = array(); |
|
| 285 | - $new_post['ID'] = $_REQUEST['pid']; |
|
| 286 | - |
|
| 287 | - $lastid = wp_update_post($new_post); |
|
| 288 | - |
|
| 289 | - $gd_session->un_set('listing');
|
|
| 290 | - wp_redirect(get_permalink($lastid)); |
|
| 291 | - } else {
|
|
| 292 | - $last_id = geodir_save_listing(); |
|
| 293 | - |
|
| 294 | - if ($last_id) {
|
|
| 295 | - //$redirect_to = get_permalink( $last_id ); |
|
| 296 | - $redirect_to = geodir_getlink(get_permalink(geodir_success_page_id()), array('pid' => $last_id));
|
|
| 297 | - } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 298 | - $redirect_to = get_permalink(geodir_add_listing_page_id()); |
|
| 299 | - $redirect_to = geodir_getlink($redirect_to, array('pid' => $post->pid), false);
|
|
| 300 | - } else |
|
| 301 | - $redirect_to = get_permalink(geodir_add_listing_page_id()); |
|
| 302 | - |
|
| 303 | - $gd_session->un_set('listing');
|
|
| 304 | - wp_redirect($redirect_to); |
|
| 305 | - } |
|
| 306 | - } else {
|
|
| 307 | - $gd_session->un_set('listing');
|
|
| 308 | - wp_redirect(home_url()); |
|
| 309 | - } |
|
| 310 | - |
|
| 311 | - break; |
|
| 312 | - case "delete" : |
|
| 313 | - if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 314 | - global $current_user; |
|
| 315 | - |
|
| 316 | - if (get_option('geodir_disable_perm_delete')) {
|
|
| 317 | - $lastid = wp_trash_post($_REQUEST['pid']); |
|
| 318 | - } else {
|
|
| 319 | - $lastid = wp_delete_post($_REQUEST['pid']); |
|
| 320 | - } |
|
| 321 | - |
|
| 322 | - if ($lastid && !is_wp_error($lastid)) |
|
| 323 | - wp_redirect($_SERVER['HTTP_REFERER']); |
|
| 324 | - |
|
| 325 | - //wp_redirect( geodir_getlink(get_author_posts_url($current_user->ID),array('geodir_dashbord'=>'true','stype'=>$post_type ),false) );
|
|
| 326 | - } |
|
| 327 | - break; |
|
| 328 | - endswitch; |
|
| 329 | - |
|
| 330 | - $gd_session->un_set('listing');
|
|
| 331 | - } else {
|
|
| 332 | - $gd_session->un_set('listing');
|
|
| 333 | - wp_redirect(geodir_login_url()); |
|
| 334 | - exit(); |
|
| 335 | - } |
|
| 336 | - } |
|
| 337 | - |
|
| 338 | - if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'user_login') {
|
|
| 339 | - /** |
|
| 340 | - * Contains registration and login functions. |
|
| 341 | - * @todo Fix the file path. |
|
| 342 | - * |
|
| 343 | - * @since 1.0.0 |
|
| 344 | - * @package GeoDirectory |
|
| 345 | - */ |
|
| 346 | - include_once(geodir_plugin_path() . '/geodirectory-functions/geodirectory_reg.php'); |
|
| 347 | - } |
|
| 348 | - |
|
| 349 | - if (isset($_REQUEST['ajax_action']) && $_REQUEST['ajax_action'] == 'geodir_get_term_list') {
|
|
| 350 | - $args = array('taxonomy' => sanitize_text_field($_REQUEST['term']));
|
|
| 351 | - if (!empty($_REQUEST['parent_only'])) {
|
|
| 352 | - $args['parent'] = 0; |
|
| 353 | - } |
|
| 354 | - $terms_o = get_terms($args); |
|
| 205 | + if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'map_ajax') {
|
|
| 206 | + /** |
|
| 207 | + * Contains map marker functions. |
|
| 208 | + * |
|
| 209 | + * @since 1.0.0 |
|
| 210 | + * @package GeoDirectory |
|
| 211 | + */ |
|
| 212 | + include_once(geodir_plugin_path() . '/geodirectory-functions/map-functions/get_markers.php'); |
|
| 213 | + } |
|
| 214 | + |
|
| 215 | + if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'favorite') {
|
|
| 216 | + if (is_user_logged_in()) {
|
|
| 217 | + switch ($_REQUEST['ajax_action']): |
|
| 218 | + case "add" : |
|
| 219 | + geodir_add_to_favorite((int)$_REQUEST['pid']); |
|
| 220 | + break; |
|
| 221 | + case "remove" : |
|
| 222 | + geodir_remove_from_favorite((int)$_REQUEST['pid']); |
|
| 223 | + break; |
|
| 224 | + endswitch; |
|
| 225 | + } else {
|
|
| 226 | + wp_redirect(geodir_login_url()); |
|
| 227 | + exit(); |
|
| 228 | + } |
|
| 229 | + } |
|
| 230 | + |
|
| 231 | + if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'add_listing') {
|
|
| 232 | + |
|
| 233 | + $is_current_user_owner = true; |
|
| 234 | + if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 235 | + $is_current_user_owner = geodir_listing_belong_to_current_user((int)$_REQUEST['pid']); |
|
| 236 | + } |
|
| 237 | + |
|
| 238 | + $request = $gd_session->get('listing');
|
|
| 239 | + |
|
| 240 | + if (is_user_logged_in() && $is_current_user_owner) {
|
|
| 241 | + |
|
| 242 | + switch ($_REQUEST['ajax_action']): |
|
| 243 | + case "add": |
|
| 244 | + case "update": |
|
| 245 | + |
|
| 246 | + if (isset($request['geodir_spamblocker']) && $request['geodir_spamblocker'] == '64' && isset($request['geodir_filled_by_spam_bot']) && $request['geodir_filled_by_spam_bot'] == '') {
|
|
| 247 | + $last_id = geodir_save_listing(); |
|
| 248 | + |
|
| 249 | + if ($last_id) {
|
|
| 250 | + //$redirect_to = get_permalink( $last_id ); |
|
| 251 | + $redirect_to = geodir_getlink(get_permalink(geodir_success_page_id()), array('pid' => $last_id));
|
|
| 252 | + |
|
| 253 | + } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 254 | + $redirect_to = get_permalink(geodir_add_listing_page_id()); |
|
| 255 | + $redirect_to = geodir_getlink($redirect_to, array('pid' => $post->pid), false);
|
|
| 256 | + } else |
|
| 257 | + $redirect_to = get_permalink(geodir_add_listing_page_id()); |
|
| 258 | + |
|
| 259 | + wp_redirect($redirect_to); |
|
| 260 | + } else {
|
|
| 261 | + $gd_session->un_set('listing');
|
|
| 262 | + wp_redirect(home_url()); |
|
| 263 | + } |
|
| 264 | + |
|
| 265 | + break; |
|
| 266 | + case "cancel" : |
|
| 267 | + |
|
| 268 | + $gd_session->un_set('listing');
|
|
| 269 | + |
|
| 270 | + if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '' && get_permalink($_REQUEST['pid'])) |
|
| 271 | + wp_redirect(get_permalink($_REQUEST['pid'])); |
|
| 272 | + else {
|
|
| 273 | + geodir_remove_temp_images(); |
|
| 274 | + wp_redirect(geodir_getlink(get_permalink(geodir_add_listing_page_id()), array('listing_type' => $_REQUEST['listing_type'])));
|
|
| 275 | + } |
|
| 276 | + |
|
| 277 | + break; |
|
| 278 | + |
|
| 279 | + case "publish" : |
|
| 280 | + |
|
| 281 | + if (isset($request['geodir_spamblocker']) && $request['geodir_spamblocker'] == '64' && isset($request['geodir_filled_by_spam_bot']) && $request['geodir_filled_by_spam_bot'] == '') {
|
|
| 282 | + |
|
| 283 | + if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 284 | + $new_post = array(); |
|
| 285 | + $new_post['ID'] = $_REQUEST['pid']; |
|
| 286 | + |
|
| 287 | + $lastid = wp_update_post($new_post); |
|
| 288 | + |
|
| 289 | + $gd_session->un_set('listing');
|
|
| 290 | + wp_redirect(get_permalink($lastid)); |
|
| 291 | + } else {
|
|
| 292 | + $last_id = geodir_save_listing(); |
|
| 293 | + |
|
| 294 | + if ($last_id) {
|
|
| 295 | + //$redirect_to = get_permalink( $last_id ); |
|
| 296 | + $redirect_to = geodir_getlink(get_permalink(geodir_success_page_id()), array('pid' => $last_id));
|
|
| 297 | + } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 298 | + $redirect_to = get_permalink(geodir_add_listing_page_id()); |
|
| 299 | + $redirect_to = geodir_getlink($redirect_to, array('pid' => $post->pid), false);
|
|
| 300 | + } else |
|
| 301 | + $redirect_to = get_permalink(geodir_add_listing_page_id()); |
|
| 302 | + |
|
| 303 | + $gd_session->un_set('listing');
|
|
| 304 | + wp_redirect($redirect_to); |
|
| 305 | + } |
|
| 306 | + } else {
|
|
| 307 | + $gd_session->un_set('listing');
|
|
| 308 | + wp_redirect(home_url()); |
|
| 309 | + } |
|
| 310 | + |
|
| 311 | + break; |
|
| 312 | + case "delete" : |
|
| 313 | + if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 314 | + global $current_user; |
|
| 315 | + |
|
| 316 | + if (get_option('geodir_disable_perm_delete')) {
|
|
| 317 | + $lastid = wp_trash_post($_REQUEST['pid']); |
|
| 318 | + } else {
|
|
| 319 | + $lastid = wp_delete_post($_REQUEST['pid']); |
|
| 320 | + } |
|
| 321 | + |
|
| 322 | + if ($lastid && !is_wp_error($lastid)) |
|
| 323 | + wp_redirect($_SERVER['HTTP_REFERER']); |
|
| 324 | + |
|
| 325 | + //wp_redirect( geodir_getlink(get_author_posts_url($current_user->ID),array('geodir_dashbord'=>'true','stype'=>$post_type ),false) );
|
|
| 326 | + } |
|
| 327 | + break; |
|
| 328 | + endswitch; |
|
| 329 | + |
|
| 330 | + $gd_session->un_set('listing');
|
|
| 331 | + } else {
|
|
| 332 | + $gd_session->un_set('listing');
|
|
| 333 | + wp_redirect(geodir_login_url()); |
|
| 334 | + exit(); |
|
| 335 | + } |
|
| 336 | + } |
|
| 337 | + |
|
| 338 | + if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'user_login') {
|
|
| 339 | + /** |
|
| 340 | + * Contains registration and login functions. |
|
| 341 | + * @todo Fix the file path. |
|
| 342 | + * |
|
| 343 | + * @since 1.0.0 |
|
| 344 | + * @package GeoDirectory |
|
| 345 | + */ |
|
| 346 | + include_once(geodir_plugin_path() . '/geodirectory-functions/geodirectory_reg.php'); |
|
| 347 | + } |
|
| 348 | + |
|
| 349 | + if (isset($_REQUEST['ajax_action']) && $_REQUEST['ajax_action'] == 'geodir_get_term_list') {
|
|
| 350 | + $args = array('taxonomy' => sanitize_text_field($_REQUEST['term']));
|
|
| 351 | + if (!empty($_REQUEST['parent_only'])) {
|
|
| 352 | + $args['parent'] = 0; |
|
| 353 | + } |
|
| 354 | + $terms_o = get_terms($args); |
|
| 355 | 355 | |
| 356 | - // Skip terms which has no listing |
|
| 357 | - if (!empty($terms_o)) {
|
|
| 358 | - $filter_terms = array(); |
|
| 356 | + // Skip terms which has no listing |
|
| 357 | + if (!empty($terms_o)) {
|
|
| 358 | + $filter_terms = array(); |
|
| 359 | 359 | |
| 360 | - foreach ($terms_o as $term) {
|
|
| 361 | - if (isset($term->count) && $term->count > 0) {
|
|
| 362 | - $filter_terms[] = $term; |
|
| 363 | - } |
|
| 364 | - } |
|
| 365 | - $terms_o = $filter_terms; |
|
| 366 | - } |
|
| 360 | + foreach ($terms_o as $term) {
|
|
| 361 | + if (isset($term->count) && $term->count > 0) {
|
|
| 362 | + $filter_terms[] = $term; |
|
| 363 | + } |
|
| 364 | + } |
|
| 365 | + $terms_o = $filter_terms; |
|
| 366 | + } |
|
| 367 | 367 | |
| 368 | - $terms = geodir_sort_terms($terms_o, 'count'); |
|
| 369 | - geodir_helper_cat_list_output($terms, intval($_REQUEST['limit'])); |
|
| 370 | - exit(); |
|
| 371 | - } |
|
| 368 | + $terms = geodir_sort_terms($terms_o, 'count'); |
|
| 369 | + geodir_helper_cat_list_output($terms, intval($_REQUEST['limit'])); |
|
| 370 | + exit(); |
|
| 371 | + } |
|
| 372 | 372 | |
| 373 | - gd_die(); |
|
| 373 | + gd_die(); |
|
| 374 | 374 | } |
| 375 | 375 | |
| 376 | 376 | |
| 377 | 377 | function geodir_show_ga_stats(){
|
| 378 | - if (isset($_REQUEST['ga_start'])) {
|
|
| 379 | - $ga_start = $_REQUEST['ga_start']; |
|
| 380 | - } else {
|
|
| 381 | - $ga_start = ''; |
|
| 382 | - } |
|
| 383 | - if (isset($_REQUEST['ga_end'])) {
|
|
| 384 | - $ga_end = $_REQUEST['ga_end']; |
|
| 385 | - } else {
|
|
| 386 | - $ga_end = ''; |
|
| 387 | - } |
|
| 388 | - geodir_getGoogleAnalytics($_REQUEST['ga_page'], $ga_start, $ga_end); |
|
| 389 | - die; |
|
| 378 | + if (isset($_REQUEST['ga_start'])) {
|
|
| 379 | + $ga_start = $_REQUEST['ga_start']; |
|
| 380 | + } else {
|
|
| 381 | + $ga_start = ''; |
|
| 382 | + } |
|
| 383 | + if (isset($_REQUEST['ga_end'])) {
|
|
| 384 | + $ga_end = $_REQUEST['ga_end']; |
|
| 385 | + } else {
|
|
| 386 | + $ga_end = ''; |
|
| 387 | + } |
|
| 388 | + geodir_getGoogleAnalytics($_REQUEST['ga_page'], $ga_start, $ga_end); |
|
| 389 | + die; |
|
| 390 | 390 | } |
| 391 | 391 | add_action( 'wp_ajax_gdga', 'geodir_show_ga_stats' ); |
| 392 | 392 | add_action( 'wp_ajax_nopriv_gdga', 'geodir_show_ga_stats' ); |
| 393 | 393 | \ 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(); |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | * @param string $posttype The post type to insert. |
| 151 | 151 | * @param string $datatype The type of dummy data to insert. |
| 152 | 152 | */ |
| 153 | - do_action('geodir_delete_dummy_posts' ,sanitize_key($_REQUEST['posttype']),sanitize_key(['datatype']));
|
|
| 153 | + do_action('geodir_delete_dummy_posts', sanitize_key($_REQUEST['posttype']), sanitize_key(['datatype']));
|
|
| 154 | 154 | break; |
| 155 | 155 | case "geodir_dummy_insert" : |
| 156 | 156 | if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir_dummy_posts_insert_noncename')) |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | $city_bound_lat2 = $_REQUEST['city_bound_lat2']; |
| 163 | 163 | $city_bound_lng2 = $_REQUEST['city_bound_lng2']; |
| 164 | 164 | |
| 165 | - if (isset($_REQUEST['posttype'])){
|
|
| 165 | + if (isset($_REQUEST['posttype'])) {
|
|
| 166 | 166 | /** |
| 167 | 167 | * Used to insert the dummy post data per post type. |
| 168 | 168 | * |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | * @param string $datatype The type of dummy data to insert. |
| 174 | 174 | * @param int $post_index The item number to insert. |
| 175 | 175 | */ |
| 176 | - do_action('geodir_insert_dummy_posts',sanitize_key($_REQUEST['posttype']),sanitize_key($_REQUEST['datatype']),absint($_REQUEST['insert_dummy_post_index']));
|
|
| 176 | + do_action('geodir_insert_dummy_posts', sanitize_key($_REQUEST['posttype']), sanitize_key($_REQUEST['datatype']), absint($_REQUEST['insert_dummy_post_index']));
|
|
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | if ($_REQUEST['popuptype'] == 'b_send_inquiry' || $_REQUEST['popuptype'] == 'b_sendtofriend') {
|
| 191 | 191 | $template = locate_template(array("geodirectory/popup-forms.php"));
|
| 192 | 192 | if (!$template) {
|
| 193 | - $template = geodir_plugin_path() . '/geodirectory-templates/popup-forms.php'; |
|
| 193 | + $template = geodir_plugin_path().'/geodirectory-templates/popup-forms.php'; |
|
| 194 | 194 | } |
| 195 | 195 | require_once($template); |
| 196 | 196 | } |
@@ -209,17 +209,17 @@ discard block |
||
| 209 | 209 | * @since 1.0.0 |
| 210 | 210 | * @package GeoDirectory |
| 211 | 211 | */ |
| 212 | - include_once(geodir_plugin_path() . '/geodirectory-functions/map-functions/get_markers.php'); |
|
| 212 | + include_once(geodir_plugin_path().'/geodirectory-functions/map-functions/get_markers.php'); |
|
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'favorite') {
|
| 216 | 216 | if (is_user_logged_in()) {
|
| 217 | 217 | switch ($_REQUEST['ajax_action']): |
| 218 | 218 | case "add" : |
| 219 | - geodir_add_to_favorite((int)$_REQUEST['pid']); |
|
| 219 | + geodir_add_to_favorite((int) $_REQUEST['pid']); |
|
| 220 | 220 | break; |
| 221 | 221 | case "remove" : |
| 222 | - geodir_remove_from_favorite((int)$_REQUEST['pid']); |
|
| 222 | + geodir_remove_from_favorite((int) $_REQUEST['pid']); |
|
| 223 | 223 | break; |
| 224 | 224 | endswitch; |
| 225 | 225 | } else {
|
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | |
| 233 | 233 | $is_current_user_owner = true; |
| 234 | 234 | if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
| 235 | - $is_current_user_owner = geodir_listing_belong_to_current_user((int)$_REQUEST['pid']); |
|
| 235 | + $is_current_user_owner = geodir_listing_belong_to_current_user((int) $_REQUEST['pid']); |
|
| 236 | 236 | } |
| 237 | 237 | |
| 238 | 238 | $request = $gd_session->get('listing');
|
@@ -343,7 +343,7 @@ discard block |
||
| 343 | 343 | * @since 1.0.0 |
| 344 | 344 | * @package GeoDirectory |
| 345 | 345 | */ |
| 346 | - include_once(geodir_plugin_path() . '/geodirectory-functions/geodirectory_reg.php'); |
|
| 346 | + include_once(geodir_plugin_path().'/geodirectory-functions/geodirectory_reg.php'); |
|
| 347 | 347 | } |
| 348 | 348 | |
| 349 | 349 | if (isset($_REQUEST['ajax_action']) && $_REQUEST['ajax_action'] == 'geodir_get_term_list') {
|
@@ -374,7 +374,7 @@ discard block |
||
| 374 | 374 | } |
| 375 | 375 | |
| 376 | 376 | |
| 377 | -function geodir_show_ga_stats(){
|
|
| 377 | +function geodir_show_ga_stats() {
|
|
| 378 | 378 | if (isset($_REQUEST['ga_start'])) {
|
| 379 | 379 | $ga_start = $_REQUEST['ga_start']; |
| 380 | 380 | } else {
|
@@ -388,5 +388,5 @@ discard block |
||
| 388 | 388 | geodir_getGoogleAnalytics($_REQUEST['ga_page'], $ga_start, $ga_end); |
| 389 | 389 | die; |
| 390 | 390 | } |
| 391 | -add_action( 'wp_ajax_gdga', 'geodir_show_ga_stats' ); |
|
| 392 | -add_action( 'wp_ajax_nopriv_gdga', 'geodir_show_ga_stats' ); |
|
| 393 | 391 | \ No newline at end of file |
| 392 | +add_action('wp_ajax_gdga', 'geodir_show_ga_stats');
|
|
| 393 | +add_action('wp_ajax_nopriv_gdga', 'geodir_show_ga_stats'); |
|
| 394 | 394 | \ No newline at end of file |
@@ -20,480 +20,480 @@ discard block |
||
| 20 | 20 | function geodir_set_postcat_structure($post_id, $taxonomy, $default_cat = '', $category_str = '') |
| 21 | 21 | {
|
| 22 | 22 | |
| 23 | - $post_cat_ids = geodir_get_post_meta($post_id, $taxonomy); |
|
| 24 | - if (!empty($post_cat_ids)) |
|
| 25 | - $post_cat_array = explode(",", trim($post_cat_ids, ","));
|
|
| 26 | - |
|
| 27 | - if (!isset($default_cat) || empty($default_cat)) {
|
|
| 28 | - $default_cat = isset($post_cat_array[0]) ? $post_cat_array[0] : ''; |
|
| 29 | - }else{
|
|
| 30 | - if(!is_int($default_cat)){
|
|
| 31 | - $category = get_term_by('name', $default_cat, $taxonomy);
|
|
| 32 | - if(isset($category->term_id)){
|
|
| 33 | - $default_cat = $category->term_id; |
|
| 34 | - } |
|
| 35 | - } |
|
| 23 | + $post_cat_ids = geodir_get_post_meta($post_id, $taxonomy); |
|
| 24 | + if (!empty($post_cat_ids)) |
|
| 25 | + $post_cat_array = explode(",", trim($post_cat_ids, ","));
|
|
| 26 | + |
|
| 27 | + if (!isset($default_cat) || empty($default_cat)) {
|
|
| 28 | + $default_cat = isset($post_cat_array[0]) ? $post_cat_array[0] : ''; |
|
| 29 | + }else{
|
|
| 30 | + if(!is_int($default_cat)){
|
|
| 31 | + $category = get_term_by('name', $default_cat, $taxonomy);
|
|
| 32 | + if(isset($category->term_id)){
|
|
| 33 | + $default_cat = $category->term_id; |
|
| 34 | + } |
|
| 35 | + } |
|
| 36 | 36 | |
| 37 | - } |
|
| 37 | + } |
|
| 38 | 38 | |
| 39 | 39 | |
| 40 | - geodir_save_post_meta($post_id, 'default_category', $default_cat); |
|
| 40 | + geodir_save_post_meta($post_id, 'default_category', $default_cat); |
|
| 41 | 41 | |
| 42 | - if (isset($category_str) && empty($category_str)) {
|
|
| 42 | + if (isset($category_str) && empty($category_str)) {
|
|
| 43 | 43 | |
| 44 | - $post_cat_str = ''; |
|
| 45 | - $post_categories = array(); |
|
| 46 | - if (isset($post_cat_array) && is_array($post_cat_array) && !empty($post_cat_array)) {
|
|
| 47 | - $post_cat_str = implode(",y:#", $post_cat_array);
|
|
| 48 | - $post_cat_str .= ",y:"; |
|
| 49 | - $post_cat_str = substr_replace($post_cat_str, ',y,d:', strpos($post_cat_str, ',y:'), strlen(',y:'));
|
|
| 50 | - } |
|
| 51 | - $post_categories[$taxonomy] = $post_cat_str; |
|
| 52 | - $category_str = $post_categories; |
|
| 53 | - } |
|
| 44 | + $post_cat_str = ''; |
|
| 45 | + $post_categories = array(); |
|
| 46 | + if (isset($post_cat_array) && is_array($post_cat_array) && !empty($post_cat_array)) {
|
|
| 47 | + $post_cat_str = implode(",y:#", $post_cat_array);
|
|
| 48 | + $post_cat_str .= ",y:"; |
|
| 49 | + $post_cat_str = substr_replace($post_cat_str, ',y,d:', strpos($post_cat_str, ',y:'), strlen(',y:'));
|
|
| 50 | + } |
|
| 51 | + $post_categories[$taxonomy] = $post_cat_str; |
|
| 52 | + $category_str = $post_categories; |
|
| 53 | + } |
|
| 54 | 54 | |
| 55 | - $change_cat_str = $category_str[$taxonomy]; |
|
| 55 | + $change_cat_str = $category_str[$taxonomy]; |
|
| 56 | 56 | |
| 57 | - $default_pos = strpos($change_cat_str, 'd:'); |
|
| 57 | + $default_pos = strpos($change_cat_str, 'd:'); |
|
| 58 | 58 | |
| 59 | - if ($default_pos === false) {
|
|
| 59 | + if ($default_pos === false) {
|
|
| 60 | 60 | |
| 61 | - $change_cat_str = str_replace($default_cat . ',y:', $default_cat . ',y,d:', $change_cat_str); |
|
| 61 | + $change_cat_str = str_replace($default_cat . ',y:', $default_cat . ',y,d:', $change_cat_str); |
|
| 62 | 62 | |
| 63 | - } |
|
| 63 | + } |
|
| 64 | 64 | |
| 65 | - $category_str[$taxonomy] = $change_cat_str; |
|
| 65 | + $category_str[$taxonomy] = $change_cat_str; |
|
| 66 | 66 | |
| 67 | - update_post_meta($post_id, 'post_categories', $category_str); |
|
| 67 | + update_post_meta($post_id, 'post_categories', $category_str); |
|
| 68 | 68 | |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | |
| 72 | 72 | if (!function_exists('geodir_save_listing')) {
|
| 73 | - /** |
|
| 74 | - * Saves listing in the database using given information. |
|
| 75 | - * |
|
| 76 | - * @since 1.0.0 |
|
| 77 | - * @since 1.5.4 New parameter $wp_error added. |
|
| 78 | - * @package GeoDirectory |
|
| 79 | - * @global object $wpdb WordPress Database object. |
|
| 80 | - * @global object $post The current post object. |
|
| 81 | - * @global object $current_user Current user object. |
|
| 73 | + /** |
|
| 74 | + * Saves listing in the database using given information. |
|
| 75 | + * |
|
| 76 | + * @since 1.0.0 |
|
| 77 | + * @since 1.5.4 New parameter $wp_error added. |
|
| 78 | + * @package GeoDirectory |
|
| 79 | + * @global object $wpdb WordPress Database object. |
|
| 80 | + * @global object $post The current post object. |
|
| 81 | + * @global object $current_user Current user object. |
|
| 82 | 82 | * @global object $gd_session GeoDirectory Session object. |
| 83 | - * @param array $request_info {
|
|
| 84 | - * Array of request info arguments. |
|
| 85 | - * |
|
| 86 | - * @type string $action Ajax action name. |
|
| 87 | - * @type string $geodir_ajax Ajax type. |
|
| 88 | - * @type string $ajax_action Ajax action. |
|
| 89 | - * @type string $listing_type Listing type. |
|
| 90 | - * @type string $pid Default Post ID. |
|
| 91 | - * @type string $preview Todo Desc needed. |
|
| 92 | - * @type string $add_listing_page_id Add listing page ID. |
|
| 93 | - * @type string $post_title Listing title. |
|
| 94 | - * @type string $post_desc Listing Description. |
|
| 95 | - * @type string $post_tags Listing tags. |
|
| 96 | - * @type array $cat_limit Category limit. |
|
| 97 | - * @type array $post_category Category IDs. |
|
| 98 | - * @type array $post_category_str Category string. |
|
| 99 | - * @type string $post_default_category Default category ID. |
|
| 100 | - * @type string $post_address Listing address. |
|
| 101 | - * @type string $geodir_location_add_listing_country_val Add listing country value. |
|
| 102 | - * @type string $post_country Listing country. |
|
| 103 | - * @type string $geodir_location_add_listing_region_val Add listing region value. |
|
| 104 | - * @type string $post_region Listing region. |
|
| 105 | - * @type string $geodir_location_add_listing_city_val Add listing city value. |
|
| 106 | - * @type string $post_city Listing city. |
|
| 107 | - * @type string $post_zip Listing zip. |
|
| 108 | - * @type string $post_latitude Listing latitude. |
|
| 109 | - * @type string $post_longitude Listing longitude. |
|
| 110 | - * @type string $post_mapview Listing mapview. Default "ROADMAP". |
|
| 111 | - * @type string $post_mapzoom Listing mapzoom Default "9". |
|
| 112 | - * @type string $geodir_timing Business timing info. |
|
| 113 | - * @type string $geodir_contact Contact number. |
|
| 114 | - * @type string $geodir_email Business contact email. |
|
| 115 | - * @type string $geodir_website Business website. |
|
| 116 | - * @type string $geodir_twitter Twitter link. |
|
| 117 | - * @type string $geodir_facebook Facebook link. |
|
| 118 | - * @type string $geodir_video Video link. |
|
| 119 | - * @type string $geodir_special_offers Speacial offers. |
|
| 120 | - * @type string $post_images Post image urls. |
|
| 121 | - * @type string $post_imagesimage_limit Post images limit. |
|
| 122 | - * @type string $post_imagestotImg Todo Desc needed. |
|
| 123 | - * @type string $geodir_accept_term_condition Has accepted terms and conditions?. |
|
| 124 | - * @type string $geodir_spamblocker Todo Desc needed. |
|
| 125 | - * @type string $geodir_filled_by_spam_bot Todo Desc needed. |
|
| 126 | - * |
|
| 127 | - * } |
|
| 128 | - * @param bool $dummy Optional. Is this a dummy listing? Default false. |
|
| 129 | - * @param bool $wp_error Optional. Allow return of WP_Error on failure. Default false. |
|
| 130 | - * @return int|string|WP_Error Created post id or WP_Error on failure. |
|
| 131 | - */ |
|
| 132 | - function geodir_save_listing($request_info = array(), $dummy = false, $wp_error = false) |
|
| 133 | - {
|
|
| 134 | - global $wpdb, $current_user, $gd_session; |
|
| 135 | - |
|
| 136 | - $last_post_id = ''; |
|
| 137 | - |
|
| 138 | - if ($gd_session->get('listing') && !$dummy) {
|
|
| 139 | - $request_info = array(); |
|
| 140 | - $request_session = $gd_session->get('listing');
|
|
| 141 | - $request_info = array_merge($_REQUEST, $request_session); |
|
| 142 | - } else if (!$gd_session->get('listing') && !$dummy) {
|
|
| 143 | - global $post; |
|
| 144 | - $request_info['pid'] = !empty($post->ID) ? $post->ID : (!empty($request_info['post_id']) ? $request_info['post_id'] : NULL); |
|
| 145 | - $request_info['post_title'] = $request_info['post_title']; |
|
| 146 | - $request_info['listing_type'] = $post->post_type; |
|
| 147 | - $request_info['post_desc'] = $request_info['content']; |
|
| 148 | - } else if (!$dummy) {
|
|
| 149 | - return false; |
|
| 150 | - } |
|
| 151 | - |
|
| 152 | - /** |
|
| 153 | - * Filter the request_info array. |
|
| 154 | - * |
|
| 155 | - * You can use this filter to modify request_info array. |
|
| 156 | - * |
|
| 157 | - * @since 1.0.0 |
|
| 158 | - * @package GeoDirectory |
|
| 159 | - * @param array $request_info See {@see geodir_save_listing()} for accepted args.
|
|
| 160 | - */ |
|
| 161 | - $request_info = apply_filters('geodir_action_get_request_info', $request_info);
|
|
| 162 | - |
|
| 163 | - // Check if we need to save post location as new location |
|
| 164 | - $location_result = geodir_get_default_location(); |
|
| 165 | - |
|
| 166 | - if ($location_result->location_id > 0) {
|
|
| 167 | - if (isset($request_info['post_city']) && isset($request_info['post_region'])) {
|
|
| 168 | - $request_info['post_location'] = array( |
|
| 169 | - 'city' => $request_info['post_city'], |
|
| 170 | - 'region' => isset($request_info['post_region']) ? $request_info['post_region'] : '', |
|
| 171 | - 'country' => isset($request_info['post_country']) ? $request_info['post_country'] : '', |
|
| 172 | - 'geo_lat' => isset($request_info['post_latitude']) ? $request_info['post_latitude'] : '', |
|
| 173 | - 'geo_lng' => isset($request_info['post_longitude']) ? $request_info['post_longitude'] : '' |
|
| 174 | - ); |
|
| 175 | - |
|
| 176 | - $post_location_info = $request_info['post_location']; |
|
| 177 | - |
|
| 178 | - if ($location_id = geodir_add_new_location($post_location_info)) {
|
|
| 179 | - $post_location_id = $location_id; |
|
| 180 | - } |
|
| 181 | - } else {
|
|
| 182 | - $post_location_id = $location_result->location_id; |
|
| 183 | - } |
|
| 184 | - } else {
|
|
| 185 | - $post_location_id = $location_result->location_id; |
|
| 186 | - } |
|
| 187 | - |
|
| 188 | - if ($dummy) {
|
|
| 189 | - $post_status = 'publish'; |
|
| 190 | - } else {
|
|
| 191 | - $post_status = geodir_new_post_default_status(); |
|
| 192 | - } |
|
| 193 | - |
|
| 194 | - if (isset($request_info['pid']) && $request_info['pid'] != '') {
|
|
| 195 | - $post_status = get_post_status($request_info['pid']); |
|
| 196 | - } |
|
| 197 | - |
|
| 198 | - /* fix change of slug on every title edit */ |
|
| 199 | - if (!isset($request_info['post_name'])) {
|
|
| 200 | - $request_info['post_name'] = $request_info['post_title']; |
|
| 201 | - |
|
| 202 | - if (!empty($request_info['pid'])) {
|
|
| 203 | - $post_info = get_post($request_info['pid']); |
|
| 204 | - |
|
| 205 | - if (!empty($post_info) && isset($post_info->post_name)) {
|
|
| 206 | - $request_info['post_name'] = $post_info->post_name; |
|
| 207 | - } |
|
| 208 | - } |
|
| 209 | - } |
|
| 210 | - |
|
| 211 | - $post = array( |
|
| 212 | - 'post_content' => $request_info['post_desc'], |
|
| 213 | - 'post_status' => $post_status, |
|
| 214 | - 'post_title' => $request_info['post_title'], |
|
| 215 | - 'post_name' => $request_info['post_name'], |
|
| 216 | - 'post_type' => $request_info['listing_type'] |
|
| 217 | - ); |
|
| 218 | - |
|
| 219 | - /** |
|
| 220 | - * Called before a listing is saved to the database. |
|
| 221 | - * |
|
| 222 | - * @since 1.0.0 |
|
| 223 | - * @param object $post The post object. |
|
| 224 | - */ |
|
| 225 | - do_action_ref_array('geodir_before_save_listing', $post);
|
|
| 83 | + * @param array $request_info {
|
|
| 84 | + * Array of request info arguments. |
|
| 85 | + * |
|
| 86 | + * @type string $action Ajax action name. |
|
| 87 | + * @type string $geodir_ajax Ajax type. |
|
| 88 | + * @type string $ajax_action Ajax action. |
|
| 89 | + * @type string $listing_type Listing type. |
|
| 90 | + * @type string $pid Default Post ID. |
|
| 91 | + * @type string $preview Todo Desc needed. |
|
| 92 | + * @type string $add_listing_page_id Add listing page ID. |
|
| 93 | + * @type string $post_title Listing title. |
|
| 94 | + * @type string $post_desc Listing Description. |
|
| 95 | + * @type string $post_tags Listing tags. |
|
| 96 | + * @type array $cat_limit Category limit. |
|
| 97 | + * @type array $post_category Category IDs. |
|
| 98 | + * @type array $post_category_str Category string. |
|
| 99 | + * @type string $post_default_category Default category ID. |
|
| 100 | + * @type string $post_address Listing address. |
|
| 101 | + * @type string $geodir_location_add_listing_country_val Add listing country value. |
|
| 102 | + * @type string $post_country Listing country. |
|
| 103 | + * @type string $geodir_location_add_listing_region_val Add listing region value. |
|
| 104 | + * @type string $post_region Listing region. |
|
| 105 | + * @type string $geodir_location_add_listing_city_val Add listing city value. |
|
| 106 | + * @type string $post_city Listing city. |
|
| 107 | + * @type string $post_zip Listing zip. |
|
| 108 | + * @type string $post_latitude Listing latitude. |
|
| 109 | + * @type string $post_longitude Listing longitude. |
|
| 110 | + * @type string $post_mapview Listing mapview. Default "ROADMAP". |
|
| 111 | + * @type string $post_mapzoom Listing mapzoom Default "9". |
|
| 112 | + * @type string $geodir_timing Business timing info. |
|
| 113 | + * @type string $geodir_contact Contact number. |
|
| 114 | + * @type string $geodir_email Business contact email. |
|
| 115 | + * @type string $geodir_website Business website. |
|
| 116 | + * @type string $geodir_twitter Twitter link. |
|
| 117 | + * @type string $geodir_facebook Facebook link. |
|
| 118 | + * @type string $geodir_video Video link. |
|
| 119 | + * @type string $geodir_special_offers Speacial offers. |
|
| 120 | + * @type string $post_images Post image urls. |
|
| 121 | + * @type string $post_imagesimage_limit Post images limit. |
|
| 122 | + * @type string $post_imagestotImg Todo Desc needed. |
|
| 123 | + * @type string $geodir_accept_term_condition Has accepted terms and conditions?. |
|
| 124 | + * @type string $geodir_spamblocker Todo Desc needed. |
|
| 125 | + * @type string $geodir_filled_by_spam_bot Todo Desc needed. |
|
| 126 | + * |
|
| 127 | + * } |
|
| 128 | + * @param bool $dummy Optional. Is this a dummy listing? Default false. |
|
| 129 | + * @param bool $wp_error Optional. Allow return of WP_Error on failure. Default false. |
|
| 130 | + * @return int|string|WP_Error Created post id or WP_Error on failure. |
|
| 131 | + */ |
|
| 132 | + function geodir_save_listing($request_info = array(), $dummy = false, $wp_error = false) |
|
| 133 | + {
|
|
| 134 | + global $wpdb, $current_user, $gd_session; |
|
| 135 | + |
|
| 136 | + $last_post_id = ''; |
|
| 137 | + |
|
| 138 | + if ($gd_session->get('listing') && !$dummy) {
|
|
| 139 | + $request_info = array(); |
|
| 140 | + $request_session = $gd_session->get('listing');
|
|
| 141 | + $request_info = array_merge($_REQUEST, $request_session); |
|
| 142 | + } else if (!$gd_session->get('listing') && !$dummy) {
|
|
| 143 | + global $post; |
|
| 144 | + $request_info['pid'] = !empty($post->ID) ? $post->ID : (!empty($request_info['post_id']) ? $request_info['post_id'] : NULL); |
|
| 145 | + $request_info['post_title'] = $request_info['post_title']; |
|
| 146 | + $request_info['listing_type'] = $post->post_type; |
|
| 147 | + $request_info['post_desc'] = $request_info['content']; |
|
| 148 | + } else if (!$dummy) {
|
|
| 149 | + return false; |
|
| 150 | + } |
|
| 151 | + |
|
| 152 | + /** |
|
| 153 | + * Filter the request_info array. |
|
| 154 | + * |
|
| 155 | + * You can use this filter to modify request_info array. |
|
| 156 | + * |
|
| 157 | + * @since 1.0.0 |
|
| 158 | + * @package GeoDirectory |
|
| 159 | + * @param array $request_info See {@see geodir_save_listing()} for accepted args.
|
|
| 160 | + */ |
|
| 161 | + $request_info = apply_filters('geodir_action_get_request_info', $request_info);
|
|
| 162 | + |
|
| 163 | + // Check if we need to save post location as new location |
|
| 164 | + $location_result = geodir_get_default_location(); |
|
| 165 | + |
|
| 166 | + if ($location_result->location_id > 0) {
|
|
| 167 | + if (isset($request_info['post_city']) && isset($request_info['post_region'])) {
|
|
| 168 | + $request_info['post_location'] = array( |
|
| 169 | + 'city' => $request_info['post_city'], |
|
| 170 | + 'region' => isset($request_info['post_region']) ? $request_info['post_region'] : '', |
|
| 171 | + 'country' => isset($request_info['post_country']) ? $request_info['post_country'] : '', |
|
| 172 | + 'geo_lat' => isset($request_info['post_latitude']) ? $request_info['post_latitude'] : '', |
|
| 173 | + 'geo_lng' => isset($request_info['post_longitude']) ? $request_info['post_longitude'] : '' |
|
| 174 | + ); |
|
| 175 | + |
|
| 176 | + $post_location_info = $request_info['post_location']; |
|
| 177 | + |
|
| 178 | + if ($location_id = geodir_add_new_location($post_location_info)) {
|
|
| 179 | + $post_location_id = $location_id; |
|
| 180 | + } |
|
| 181 | + } else {
|
|
| 182 | + $post_location_id = $location_result->location_id; |
|
| 183 | + } |
|
| 184 | + } else {
|
|
| 185 | + $post_location_id = $location_result->location_id; |
|
| 186 | + } |
|
| 226 | 187 | |
| 227 | - $send_post_submit_mail = false; |
|
| 188 | + if ($dummy) {
|
|
| 189 | + $post_status = 'publish'; |
|
| 190 | + } else {
|
|
| 191 | + $post_status = geodir_new_post_default_status(); |
|
| 192 | + } |
|
| 228 | 193 | |
| 229 | - // unhook this function so it doesn't loop infinitely |
|
| 230 | - remove_action('save_post', 'geodir_post_information_save',10,2);
|
|
| 194 | + if (isset($request_info['pid']) && $request_info['pid'] != '') {
|
|
| 195 | + $post_status = get_post_status($request_info['pid']); |
|
| 196 | + } |
|
| 231 | 197 | |
| 232 | - if (isset($request_info['pid']) && $request_info['pid'] != '') {
|
|
| 233 | - $post['ID'] = $request_info['pid']; |
|
| 198 | + /* fix change of slug on every title edit */ |
|
| 199 | + if (!isset($request_info['post_name'])) {
|
|
| 200 | + $request_info['post_name'] = $request_info['post_title']; |
|
| 234 | 201 | |
| 235 | - $last_post_id = wp_update_post($post, $wp_error); |
|
| 236 | - } else {
|
|
| 237 | - $last_post_id = wp_insert_post($post, $wp_error); |
|
| 202 | + if (!empty($request_info['pid'])) {
|
|
| 203 | + $post_info = get_post($request_info['pid']); |
|
| 238 | 204 | |
| 239 | - if (!$dummy && $last_post_id) {
|
|
| 240 | - $send_post_submit_mail = true; // we move post_submit email from here so the rest of the variables are added to the db first(was breaking permalink in email) |
|
| 241 | - //geodir_sendEmail('','',$current_user->user_email,$current_user->display_name,'','',$request_info,'post_submit',$last_post_id,$current_user->ID);
|
|
| 242 | - } |
|
| 243 | - } |
|
| 205 | + if (!empty($post_info) && isset($post_info->post_name)) {
|
|
| 206 | + $request_info['post_name'] = $post_info->post_name; |
|
| 207 | + } |
|
| 208 | + } |
|
| 209 | + } |
|
| 210 | + |
|
| 211 | + $post = array( |
|
| 212 | + 'post_content' => $request_info['post_desc'], |
|
| 213 | + 'post_status' => $post_status, |
|
| 214 | + 'post_title' => $request_info['post_title'], |
|
| 215 | + 'post_name' => $request_info['post_name'], |
|
| 216 | + 'post_type' => $request_info['listing_type'] |
|
| 217 | + ); |
|
| 218 | + |
|
| 219 | + /** |
|
| 220 | + * Called before a listing is saved to the database. |
|
| 221 | + * |
|
| 222 | + * @since 1.0.0 |
|
| 223 | + * @param object $post The post object. |
|
| 224 | + */ |
|
| 225 | + do_action_ref_array('geodir_before_save_listing', $post);
|
|
| 226 | + |
|
| 227 | + $send_post_submit_mail = false; |
|
| 228 | + |
|
| 229 | + // unhook this function so it doesn't loop infinitely |
|
| 230 | + remove_action('save_post', 'geodir_post_information_save',10,2);
|
|
| 231 | + |
|
| 232 | + if (isset($request_info['pid']) && $request_info['pid'] != '') {
|
|
| 233 | + $post['ID'] = $request_info['pid']; |
|
| 234 | + |
|
| 235 | + $last_post_id = wp_update_post($post, $wp_error); |
|
| 236 | + } else {
|
|
| 237 | + $last_post_id = wp_insert_post($post, $wp_error); |
|
| 238 | + |
|
| 239 | + if (!$dummy && $last_post_id) {
|
|
| 240 | + $send_post_submit_mail = true; // we move post_submit email from here so the rest of the variables are added to the db first(was breaking permalink in email) |
|
| 241 | + //geodir_sendEmail('','',$current_user->user_email,$current_user->display_name,'','',$request_info,'post_submit',$last_post_id,$current_user->ID);
|
|
| 242 | + } |
|
| 243 | + } |
|
| 244 | 244 | |
| 245 | - if ($wp_error && is_wp_error($last_post_id)) {
|
|
| 246 | - return $last_post_id; // Return WP_Error on save failure. |
|
| 247 | - } |
|
| 245 | + if ($wp_error && is_wp_error($last_post_id)) {
|
|
| 246 | + return $last_post_id; // Return WP_Error on save failure. |
|
| 247 | + } |
|
| 248 | 248 | |
| 249 | - if (!$last_post_id) {
|
|
| 250 | - return false; // Save failure. |
|
| 251 | - } |
|
| 249 | + if (!$last_post_id) {
|
|
| 250 | + return false; // Save failure. |
|
| 251 | + } |
|
| 252 | 252 | |
| 253 | - // re-hook this function |
|
| 254 | - add_action('save_post', 'geodir_post_information_save',10,2);
|
|
| 253 | + // re-hook this function |
|
| 254 | + add_action('save_post', 'geodir_post_information_save',10,2);
|
|
| 255 | 255 | |
| 256 | - $post_tags = ''; |
|
| 257 | - if (!isset($request_info['post_tags'])) {
|
|
| 256 | + $post_tags = ''; |
|
| 257 | + if (!isset($request_info['post_tags'])) {
|
|
| 258 | 258 | |
| 259 | - $post_type = $request_info['listing_type']; |
|
| 260 | - $post_tags = implode(",", wp_get_object_terms($last_post_id, $post_type . '_tags', array('fields' => 'names')));
|
|
| 259 | + $post_type = $request_info['listing_type']; |
|
| 260 | + $post_tags = implode(",", wp_get_object_terms($last_post_id, $post_type . '_tags', array('fields' => 'names')));
|
|
| 261 | 261 | |
| 262 | - } |
|
| 262 | + } |
|
| 263 | 263 | |
| 264 | - $gd_post_info = array( |
|
| 265 | - "post_title" => $request_info['post_title'], |
|
| 266 | - "post_tags" => isset($request_info['post_tags']) ? $request_info['post_tags'] : $post_tags, |
|
| 267 | - "post_status" => $post_status, |
|
| 268 | - "post_location_id" => $post_location_id, |
|
| 269 | - "claimed" => isset($request_info['claimed']) ? $request_info['claimed'] : '', |
|
| 270 | - "businesses" => isset($request_info['a_businesses']) ? $request_info['a_businesses'] : '', |
|
| 271 | - "submit_time" => time(), |
|
| 272 | - "submit_ip" => $_SERVER['REMOTE_ADDR'], |
|
| 273 | - ); |
|
| 264 | + $gd_post_info = array( |
|
| 265 | + "post_title" => $request_info['post_title'], |
|
| 266 | + "post_tags" => isset($request_info['post_tags']) ? $request_info['post_tags'] : $post_tags, |
|
| 267 | + "post_status" => $post_status, |
|
| 268 | + "post_location_id" => $post_location_id, |
|
| 269 | + "claimed" => isset($request_info['claimed']) ? $request_info['claimed'] : '', |
|
| 270 | + "businesses" => isset($request_info['a_businesses']) ? $request_info['a_businesses'] : '', |
|
| 271 | + "submit_time" => time(), |
|
| 272 | + "submit_ip" => $_SERVER['REMOTE_ADDR'], |
|
| 273 | + ); |
|
| 274 | 274 | |
| 275 | - $payment_info = array(); |
|
| 276 | - $package_info = array(); |
|
| 275 | + $payment_info = array(); |
|
| 276 | + $package_info = array(); |
|
| 277 | 277 | |
| 278 | - $package_info = (array)geodir_post_package_info($package_info, $post); |
|
| 278 | + $package_info = (array)geodir_post_package_info($package_info, $post); |
|
| 279 | 279 | |
| 280 | - $post_package_id = geodir_get_post_meta($last_post_id, 'package_id'); |
|
| 280 | + $post_package_id = geodir_get_post_meta($last_post_id, 'package_id'); |
|
| 281 | 281 | |
| 282 | - if (!empty($package_info) && !$post_package_id) {
|
|
| 283 | - if (isset($package_info['days']) && $package_info['days'] != 0) {
|
|
| 284 | - $payment_info['expire_date'] = date('Y-m-d', strtotime("+" . $package_info['days'] . " days"));
|
|
| 285 | - } else {
|
|
| 286 | - $payment_info['expire_date'] = 'Never'; |
|
| 287 | - } |
|
| 282 | + if (!empty($package_info) && !$post_package_id) {
|
|
| 283 | + if (isset($package_info['days']) && $package_info['days'] != 0) {
|
|
| 284 | + $payment_info['expire_date'] = date('Y-m-d', strtotime("+" . $package_info['days'] . " days"));
|
|
| 285 | + } else {
|
|
| 286 | + $payment_info['expire_date'] = 'Never'; |
|
| 287 | + } |
|
| 288 | 288 | |
| 289 | - $payment_info['package_id'] = $package_info['pid']; |
|
| 290 | - $payment_info['alive_days'] = $package_info['days']; |
|
| 291 | - $payment_info['is_featured'] = $package_info['is_featured']; |
|
| 289 | + $payment_info['package_id'] = $package_info['pid']; |
|
| 290 | + $payment_info['alive_days'] = $package_info['days']; |
|
| 291 | + $payment_info['is_featured'] = $package_info['is_featured']; |
|
| 292 | 292 | |
| 293 | - $gd_post_info = array_merge($gd_post_info, $payment_info); |
|
| 294 | - } |
|
| 293 | + $gd_post_info = array_merge($gd_post_info, $payment_info); |
|
| 294 | + } |
|
| 295 | 295 | |
| 296 | - $custom_metaboxes = geodir_post_custom_fields('', 'all', $request_info['listing_type']);
|
|
| 296 | + $custom_metaboxes = geodir_post_custom_fields('', 'all', $request_info['listing_type']);
|
|
| 297 | 297 | |
| 298 | - foreach ($custom_metaboxes as $key => $val): |
|
| 298 | + foreach ($custom_metaboxes as $key => $val): |
|
| 299 | 299 | |
| 300 | - $name = $val['name']; |
|
| 301 | - $type = $val['type']; |
|
| 302 | - $extrafields = $val['extra_fields']; |
|
| 300 | + $name = $val['name']; |
|
| 301 | + $type = $val['type']; |
|
| 302 | + $extrafields = $val['extra_fields']; |
|
| 303 | 303 | |
| 304 | - if (trim($type) == 'address') {
|
|
| 305 | - $prefix = $name . '_'; |
|
| 306 | - $address = $prefix . 'address'; |
|
| 304 | + if (trim($type) == 'address') {
|
|
| 305 | + $prefix = $name . '_'; |
|
| 306 | + $address = $prefix . 'address'; |
|
| 307 | 307 | |
| 308 | - if (isset($request_info[$address]) && $request_info[$address] != '') {
|
|
| 309 | - $gd_post_info[$address] = wp_slash($request_info[$address]); |
|
| 310 | - } |
|
| 308 | + if (isset($request_info[$address]) && $request_info[$address] != '') {
|
|
| 309 | + $gd_post_info[$address] = wp_slash($request_info[$address]); |
|
| 310 | + } |
|
| 311 | 311 | |
| 312 | - if ($extrafields != '') {
|
|
| 313 | - $extrafields = unserialize($extrafields); |
|
| 312 | + if ($extrafields != '') {
|
|
| 313 | + $extrafields = unserialize($extrafields); |
|
| 314 | 314 | |
| 315 | 315 | |
| 316 | - if (!isset($request_info[$prefix . 'city']) || $request_info[$prefix . 'city'] == '') {
|
|
| 316 | + if (!isset($request_info[$prefix . 'city']) || $request_info[$prefix . 'city'] == '') {
|
|
| 317 | 317 | |
| 318 | - $location_result = geodir_get_default_location(); |
|
| 318 | + $location_result = geodir_get_default_location(); |
|
| 319 | 319 | |
| 320 | - $gd_post_info[$prefix . 'city'] = $location_result->city; |
|
| 321 | - $gd_post_info[$prefix . 'region'] = $location_result->region; |
|
| 322 | - $gd_post_info[$prefix . 'country'] = $location_result->country; |
|
| 320 | + $gd_post_info[$prefix . 'city'] = $location_result->city; |
|
| 321 | + $gd_post_info[$prefix . 'region'] = $location_result->region; |
|
| 322 | + $gd_post_info[$prefix . 'country'] = $location_result->country; |
|
| 323 | 323 | |
| 324 | - $gd_post_info['post_locations'] = '[' . $location_result->city_slug . '],[' . $location_result->region_slug . '],[' . $location_result->country_slug . ']'; // set all overall post location |
|
| 324 | + $gd_post_info['post_locations'] = '[' . $location_result->city_slug . '],[' . $location_result->region_slug . '],[' . $location_result->country_slug . ']'; // set all overall post location |
|
| 325 | 325 | |
| 326 | - } else {
|
|
| 326 | + } else {
|
|
| 327 | 327 | |
| 328 | - $gd_post_info[$prefix . 'city'] = $request_info[$prefix . 'city']; |
|
| 329 | - $gd_post_info[$prefix . 'region'] = $request_info[$prefix . 'region']; |
|
| 330 | - $gd_post_info[$prefix . 'country'] = $request_info[$prefix . 'country']; |
|
| 328 | + $gd_post_info[$prefix . 'city'] = $request_info[$prefix . 'city']; |
|
| 329 | + $gd_post_info[$prefix . 'region'] = $request_info[$prefix . 'region']; |
|
| 330 | + $gd_post_info[$prefix . 'country'] = $request_info[$prefix . 'country']; |
|
| 331 | 331 | |
| 332 | - //----------set post locations when import dummy data------- |
|
| 333 | - $location_result = geodir_get_default_location(); |
|
| 332 | + //----------set post locations when import dummy data------- |
|
| 333 | + $location_result = geodir_get_default_location(); |
|
| 334 | 334 | |
| 335 | - $gd_post_info['post_locations'] = '[' . $location_result->city_slug . '],[' . $location_result->region_slug . '],[' . $location_result->country_slug . ']'; // set all overall post location |
|
| 336 | - //----------------------------------------------------------------- |
|
| 335 | + $gd_post_info['post_locations'] = '[' . $location_result->city_slug . '],[' . $location_result->region_slug . '],[' . $location_result->country_slug . ']'; // set all overall post location |
|
| 336 | + //----------------------------------------------------------------- |
|
| 337 | 337 | |
| 338 | - } |
|
| 338 | + } |
|
| 339 | 339 | |
| 340 | 340 | |
| 341 | - if (isset($extrafields['show_zip']) && $extrafields['show_zip'] && isset($request_info[$prefix . 'zip'])) {
|
|
| 342 | - $gd_post_info[$prefix . 'zip'] = $request_info[$prefix . 'zip']; |
|
| 343 | - } |
|
| 341 | + if (isset($extrafields['show_zip']) && $extrafields['show_zip'] && isset($request_info[$prefix . 'zip'])) {
|
|
| 342 | + $gd_post_info[$prefix . 'zip'] = $request_info[$prefix . 'zip']; |
|
| 343 | + } |
|
| 344 | 344 | |
| 345 | 345 | |
| 346 | - if (isset($extrafields['show_map']) && $extrafields['show_map']) {
|
|
| 346 | + if (isset($extrafields['show_map']) && $extrafields['show_map']) {
|
|
| 347 | 347 | |
| 348 | - if (isset($request_info[$prefix . 'latitude']) && $request_info[$prefix . 'latitude'] != '') {
|
|
| 349 | - $gd_post_info[$prefix . 'latitude'] = $request_info[$prefix . 'latitude']; |
|
| 350 | - } |
|
| 348 | + if (isset($request_info[$prefix . 'latitude']) && $request_info[$prefix . 'latitude'] != '') {
|
|
| 349 | + $gd_post_info[$prefix . 'latitude'] = $request_info[$prefix . 'latitude']; |
|
| 350 | + } |
|
| 351 | 351 | |
| 352 | - if (isset($request_info[$prefix . 'longitude']) && $request_info[$prefix . 'longitude'] != '') {
|
|
| 353 | - $gd_post_info[$prefix . 'longitude'] = $request_info[$prefix . 'longitude']; |
|
| 354 | - } |
|
| 352 | + if (isset($request_info[$prefix . 'longitude']) && $request_info[$prefix . 'longitude'] != '') {
|
|
| 353 | + $gd_post_info[$prefix . 'longitude'] = $request_info[$prefix . 'longitude']; |
|
| 354 | + } |
|
| 355 | 355 | |
| 356 | - if (isset($request_info[$prefix . 'mapview']) && $request_info[$prefix . 'mapview'] != '') {
|
|
| 357 | - $gd_post_info[$prefix . 'mapview'] = $request_info[$prefix . 'mapview']; |
|
| 358 | - } |
|
| 356 | + if (isset($request_info[$prefix . 'mapview']) && $request_info[$prefix . 'mapview'] != '') {
|
|
| 357 | + $gd_post_info[$prefix . 'mapview'] = $request_info[$prefix . 'mapview']; |
|
| 358 | + } |
|
| 359 | 359 | |
| 360 | - if (isset($request_info[$prefix . 'mapzoom']) && $request_info[$prefix . 'mapzoom'] != '') {
|
|
| 361 | - $gd_post_info[$prefix . 'mapzoom'] = $request_info[$prefix . 'mapzoom']; |
|
| 362 | - } |
|
| 360 | + if (isset($request_info[$prefix . 'mapzoom']) && $request_info[$prefix . 'mapzoom'] != '') {
|
|
| 361 | + $gd_post_info[$prefix . 'mapzoom'] = $request_info[$prefix . 'mapzoom']; |
|
| 362 | + } |
|
| 363 | 363 | |
| 364 | - } |
|
| 364 | + } |
|
| 365 | 365 | |
| 366 | - // show lat lng |
|
| 367 | - if (isset($extrafields['show_latlng']) && $extrafields['show_latlng'] && isset($request_info[$prefix . 'latlng'])) {
|
|
| 368 | - $gd_post_info[$prefix . 'latlng'] = $request_info[$prefix . 'latlng']; |
|
| 369 | - } |
|
| 370 | - } |
|
| 366 | + // show lat lng |
|
| 367 | + if (isset($extrafields['show_latlng']) && $extrafields['show_latlng'] && isset($request_info[$prefix . 'latlng'])) {
|
|
| 368 | + $gd_post_info[$prefix . 'latlng'] = $request_info[$prefix . 'latlng']; |
|
| 369 | + } |
|
| 370 | + } |
|
| 371 | 371 | |
| 372 | - } elseif (trim($type) == 'file') {
|
|
| 373 | - if (isset($request_info[$name])) {
|
|
| 374 | - $request_files = array(); |
|
| 375 | - if ($request_info[$name] != '') |
|
| 376 | - $request_files = explode(",", $request_info[$name]);
|
|
| 372 | + } elseif (trim($type) == 'file') {
|
|
| 373 | + if (isset($request_info[$name])) {
|
|
| 374 | + $request_files = array(); |
|
| 375 | + if ($request_info[$name] != '') |
|
| 376 | + $request_files = explode(",", $request_info[$name]);
|
|
| 377 | 377 | |
| 378 | - $extrafields = $extrafields != '' ? maybe_unserialize($extrafields) : NULL; |
|
| 379 | - geodir_save_post_file_fields($last_post_id, $name, $request_files, $extrafields); |
|
| 378 | + $extrafields = $extrafields != '' ? maybe_unserialize($extrafields) : NULL; |
|
| 379 | + geodir_save_post_file_fields($last_post_id, $name, $request_files, $extrafields); |
|
| 380 | 380 | |
| 381 | - } |
|
| 382 | - } elseif (trim($type) == 'datepicker') {
|
|
| 383 | - $datetime = ''; |
|
| 384 | - if (isset($request_info[$name]) && $request_info[$name] != '') {
|
|
| 385 | - $date_format = geodir_default_date_format(); |
|
| 386 | - if (isset($val['extra_fields']) && $val['extra_fields'] != '') {
|
|
| 387 | - $extra_fields = unserialize($val['extra_fields']); |
|
| 388 | - $date_format = isset($extra_fields['date_format']) && $extra_fields['date_format'] != '' ? $extra_fields['date_format'] : $date_format; |
|
| 389 | - } |
|
| 381 | + } |
|
| 382 | + } elseif (trim($type) == 'datepicker') {
|
|
| 383 | + $datetime = ''; |
|
| 384 | + if (isset($request_info[$name]) && $request_info[$name] != '') {
|
|
| 385 | + $date_format = geodir_default_date_format(); |
|
| 386 | + if (isset($val['extra_fields']) && $val['extra_fields'] != '') {
|
|
| 387 | + $extra_fields = unserialize($val['extra_fields']); |
|
| 388 | + $date_format = isset($extra_fields['date_format']) && $extra_fields['date_format'] != '' ? $extra_fields['date_format'] : $date_format; |
|
| 389 | + } |
|
| 390 | 390 | |
| 391 | - // check if we need to change the format or not |
|
| 392 | - $date_format_len = strlen(str_replace(' ', '', $date_format));
|
|
| 393 | - if($date_format_len>5){// if greater then 5 then it's the old style format.
|
|
| 391 | + // check if we need to change the format or not |
|
| 392 | + $date_format_len = strlen(str_replace(' ', '', $date_format));
|
|
| 393 | + if($date_format_len>5){// if greater then 5 then it's the old style format.
|
|
| 394 | 394 | |
| 395 | - $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
|
|
| 396 | - $replace = array('d','j','l','m','n','F','Y');//PHP date format
|
|
| 395 | + $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
|
|
| 396 | + $replace = array('d','j','l','m','n','F','Y');//PHP date format
|
|
| 397 | 397 | |
| 398 | - $date_format = str_replace($search, $replace, $date_format); |
|
| 398 | + $date_format = str_replace($search, $replace, $date_format); |
|
| 399 | 399 | |
| 400 | - $post_htmlvar_value = $date_format == 'd/m/Y' ? str_replace('/', '-', $request_info[$name]) : $request_info[$name];
|
|
| 400 | + $post_htmlvar_value = $date_format == 'd/m/Y' ? str_replace('/', '-', $request_info[$name]) : $request_info[$name];
|
|
| 401 | 401 | |
| 402 | - }else{
|
|
| 403 | - $post_htmlvar_value = $request_info[$name]; |
|
| 404 | - } |
|
| 402 | + }else{
|
|
| 403 | + $post_htmlvar_value = $request_info[$name]; |
|
| 404 | + } |
|
| 405 | 405 | |
| 406 | - $post_htmlvar_value = geodir_date($post_htmlvar_value, 'Y-m-d', $date_format); // save as sql format Y-m-d |
|
| 407 | - $datetime = geodir_maybe_untranslate_date($post_htmlvar_value); // maybe untranslate date string if it was translated |
|
| 406 | + $post_htmlvar_value = geodir_date($post_htmlvar_value, 'Y-m-d', $date_format); // save as sql format Y-m-d |
|
| 407 | + $datetime = geodir_maybe_untranslate_date($post_htmlvar_value); // maybe untranslate date string if it was translated |
|
| 408 | 408 | |
| 409 | - //$datetime = date_i18n("Y-m-d", strtotime($post_htmlvar_value)); // save as sql format Y-m-d
|
|
| 409 | + //$datetime = date_i18n("Y-m-d", strtotime($post_htmlvar_value)); // save as sql format Y-m-d
|
|
| 410 | 410 | |
| 411 | - } |
|
| 412 | - $gd_post_info[$name] = $datetime; |
|
| 413 | - } else if ($type == 'multiselect') {
|
|
| 414 | - if (isset($request_info[$name])) {
|
|
| 415 | - $gd_post_info[$name] = $request_info[$name]; |
|
| 416 | - } else {
|
|
| 417 | - if (isset($request_info['gd_field_' . $name])) {
|
|
| 418 | - $gd_post_info[$name] = ''; /* fix de-select for multiselect */ |
|
| 419 | - } |
|
| 420 | - } |
|
| 421 | - } else if (isset($request_info[$name])) {
|
|
| 422 | - $gd_post_info[$name] = $request_info[$name]; |
|
| 423 | - } |
|
| 411 | + } |
|
| 412 | + $gd_post_info[$name] = $datetime; |
|
| 413 | + } else if ($type == 'multiselect') {
|
|
| 414 | + if (isset($request_info[$name])) {
|
|
| 415 | + $gd_post_info[$name] = $request_info[$name]; |
|
| 416 | + } else {
|
|
| 417 | + if (isset($request_info['gd_field_' . $name])) {
|
|
| 418 | + $gd_post_info[$name] = ''; /* fix de-select for multiselect */ |
|
| 419 | + } |
|
| 420 | + } |
|
| 421 | + } else if (isset($request_info[$name])) {
|
|
| 422 | + $gd_post_info[$name] = $request_info[$name]; |
|
| 423 | + } |
|
| 424 | 424 | |
| 425 | - endforeach; |
|
| 425 | + endforeach; |
|
| 426 | 426 | |
| 427 | - if (isset($request_info['post_dummy']) && $request_info['post_dummy'] != '') {
|
|
| 428 | - $gd_post_info['post_dummy'] = $request_info['post_dummy']; |
|
| 429 | - } |
|
| 427 | + if (isset($request_info['post_dummy']) && $request_info['post_dummy'] != '') {
|
|
| 428 | + $gd_post_info['post_dummy'] = $request_info['post_dummy']; |
|
| 429 | + } |
|
| 430 | 430 | |
| 431 | - // Save post detail info in detail table |
|
| 432 | - if (!empty($gd_post_info)) {
|
|
| 433 | - geodir_save_post_info($last_post_id, $gd_post_info); |
|
| 434 | - } |
|
| 431 | + // Save post detail info in detail table |
|
| 432 | + if (!empty($gd_post_info)) {
|
|
| 433 | + geodir_save_post_info($last_post_id, $gd_post_info); |
|
| 434 | + } |
|
| 435 | 435 | |
| 436 | 436 | |
| 437 | - // Set categories to the listing |
|
| 438 | - if (isset($request_info['post_category']) && !empty($request_info['post_category'])) {
|
|
| 439 | - $post_category = array(); |
|
| 437 | + // Set categories to the listing |
|
| 438 | + if (isset($request_info['post_category']) && !empty($request_info['post_category'])) {
|
|
| 439 | + $post_category = array(); |
|
| 440 | 440 | |
| 441 | - foreach ($request_info['post_category'] as $taxonomy => $cat) {
|
|
| 441 | + foreach ($request_info['post_category'] as $taxonomy => $cat) {
|
|
| 442 | 442 | |
| 443 | - if ($dummy) |
|
| 444 | - $post_category = $cat; |
|
| 445 | - else {
|
|
| 443 | + if ($dummy) |
|
| 444 | + $post_category = $cat; |
|
| 445 | + else {
|
|
| 446 | 446 | |
| 447 | - if (!is_array($cat) && strstr($cat, ',')) |
|
| 448 | - $cat = explode(',', $cat);
|
|
| 447 | + if (!is_array($cat) && strstr($cat, ',')) |
|
| 448 | + $cat = explode(',', $cat);
|
|
| 449 | 449 | |
| 450 | - if (!empty($cat) && is_array($cat)) |
|
| 451 | - $post_category = array_map('intval', $cat);
|
|
| 452 | - } |
|
| 450 | + if (!empty($cat) && is_array($cat)) |
|
| 451 | + $post_category = array_map('intval', $cat);
|
|
| 452 | + } |
|
| 453 | 453 | |
| 454 | - wp_set_object_terms($last_post_id, $post_category, $taxonomy); |
|
| 455 | - } |
|
| 454 | + wp_set_object_terms($last_post_id, $post_category, $taxonomy); |
|
| 455 | + } |
|
| 456 | 456 | |
| 457 | - $post_default_category = isset($request_info['post_default_category']) ? $request_info['post_default_category'] : ''; |
|
| 457 | + $post_default_category = isset($request_info['post_default_category']) ? $request_info['post_default_category'] : ''; |
|
| 458 | 458 | |
| 459 | - $post_category_str = isset($request_info['post_category_str']) ? $request_info['post_category_str'] : ''; |
|
| 460 | - geodir_set_postcat_structure($last_post_id, $taxonomy, $post_default_category, $post_category_str); |
|
| 459 | + $post_category_str = isset($request_info['post_category_str']) ? $request_info['post_category_str'] : ''; |
|
| 460 | + geodir_set_postcat_structure($last_post_id, $taxonomy, $post_default_category, $post_category_str); |
|
| 461 | 461 | |
| 462 | - } |
|
| 462 | + } |
|
| 463 | 463 | |
| 464 | - $post_tags = ''; |
|
| 465 | - // Set tags to the listing |
|
| 466 | - if (isset($request_info['post_tags']) && !is_array($request_info['post_tags']) && !empty($request_info['post_tags'])) {
|
|
| 467 | - $post_tags = explode(",", $request_info['post_tags']);
|
|
| 468 | - } elseif (isset($request_info['post_tags']) && is_array($request_info['post_tags'])) {
|
|
| 469 | - if ($dummy) |
|
| 470 | - $post_tags = $request_info['post_tags']; |
|
| 471 | - } else {
|
|
| 472 | - if ($dummy) |
|
| 473 | - $post_tags = array($request_info['post_title']); |
|
| 474 | - } |
|
| 464 | + $post_tags = ''; |
|
| 465 | + // Set tags to the listing |
|
| 466 | + if (isset($request_info['post_tags']) && !is_array($request_info['post_tags']) && !empty($request_info['post_tags'])) {
|
|
| 467 | + $post_tags = explode(",", $request_info['post_tags']);
|
|
| 468 | + } elseif (isset($request_info['post_tags']) && is_array($request_info['post_tags'])) {
|
|
| 469 | + if ($dummy) |
|
| 470 | + $post_tags = $request_info['post_tags']; |
|
| 471 | + } else {
|
|
| 472 | + if ($dummy) |
|
| 473 | + $post_tags = array($request_info['post_title']); |
|
| 474 | + } |
|
| 475 | 475 | |
| 476 | - if (is_array($post_tags)) {
|
|
| 477 | - $taxonomy = $request_info['listing_type'] . '_tags'; |
|
| 478 | - wp_set_object_terms($last_post_id, $post_tags, $taxonomy); |
|
| 479 | - } |
|
| 476 | + if (is_array($post_tags)) {
|
|
| 477 | + $taxonomy = $request_info['listing_type'] . '_tags'; |
|
| 478 | + wp_set_object_terms($last_post_id, $post_tags, $taxonomy); |
|
| 479 | + } |
|
| 480 | 480 | |
| 481 | 481 | |
| 482 | - // Insert attechment |
|
| 482 | + // Insert attechment |
|
| 483 | 483 | |
| 484 | - if (isset($request_info['post_images']) && !is_wp_error($last_post_id)) {
|
|
| 485 | - if (!$dummy) {
|
|
| 486 | - $tmpimgArr = trim($request_info['post_images'], ","); |
|
| 487 | - $tmpimgArr = explode(",", $tmpimgArr);
|
|
| 488 | - geodir_save_post_images($last_post_id, $tmpimgArr, $dummy); |
|
| 489 | - } else{
|
|
| 490 | - geodir_save_post_images($last_post_id, $request_info['post_images'], $dummy); |
|
| 491 | - } |
|
| 484 | + if (isset($request_info['post_images']) && !is_wp_error($last_post_id)) {
|
|
| 485 | + if (!$dummy) {
|
|
| 486 | + $tmpimgArr = trim($request_info['post_images'], ","); |
|
| 487 | + $tmpimgArr = explode(",", $tmpimgArr);
|
|
| 488 | + geodir_save_post_images($last_post_id, $tmpimgArr, $dummy); |
|
| 489 | + } else{
|
|
| 490 | + geodir_save_post_images($last_post_id, $request_info['post_images'], $dummy); |
|
| 491 | + } |
|
| 492 | 492 | |
| 493 | 493 | |
| 494 | - } elseif (!isset($request_info['post_images']) || $request_info['post_images'] == '') {
|
|
| 494 | + } elseif (!isset($request_info['post_images']) || $request_info['post_images'] == '') {
|
|
| 495 | 495 | |
| 496 | - /* Delete Attachments |
|
| 496 | + /* Delete Attachments |
|
| 497 | 497 | $postcurr_images = geodir_get_images($last_post_id); |
| 498 | 498 | |
| 499 | 499 | $wpdb->query( |
@@ -509,34 +509,34 @@ discard block |
||
| 509 | 509 | geodir_save_post_info($last_post_id, $gd_post_featured_img); |
| 510 | 510 | */ |
| 511 | 511 | |
| 512 | - } |
|
| 512 | + } |
|
| 513 | 513 | |
| 514 | - geodir_remove_temp_images(); |
|
| 515 | - geodir_set_wp_featured_image($last_post_id); |
|
| 514 | + geodir_remove_temp_images(); |
|
| 515 | + geodir_set_wp_featured_image($last_post_id); |
|
| 516 | 516 | |
| 517 | - /** |
|
| 518 | - * Called after a listing is saved to the database and before any email have been sent. |
|
| 519 | - * |
|
| 520 | - * @since 1.0.0 |
|
| 521 | - * @param int $last_post_id The saved post ID. |
|
| 522 | - * @param array $request_info The post details in an array. |
|
| 523 | - * @see 'geodir_after_save_listinginfo' |
|
| 524 | - */ |
|
| 525 | - do_action('geodir_after_save_listing', $last_post_id, $request_info);
|
|
| 517 | + /** |
|
| 518 | + * Called after a listing is saved to the database and before any email have been sent. |
|
| 519 | + * |
|
| 520 | + * @since 1.0.0 |
|
| 521 | + * @param int $last_post_id The saved post ID. |
|
| 522 | + * @param array $request_info The post details in an array. |
|
| 523 | + * @see 'geodir_after_save_listinginfo' |
|
| 524 | + */ |
|
| 525 | + do_action('geodir_after_save_listing', $last_post_id, $request_info);
|
|
| 526 | 526 | |
| 527 | - //die; |
|
| 527 | + //die; |
|
| 528 | 528 | |
| 529 | - if ($send_post_submit_mail) { // if new post send out email
|
|
| 530 | - $to_name = geodir_get_client_name($current_user->ID); |
|
| 531 | - geodir_sendEmail('', '', $current_user->user_email, $to_name, '', '', $request_info, 'post_submit', $last_post_id, $current_user->ID);
|
|
| 532 | - } |
|
| 533 | - /* |
|
| 529 | + if ($send_post_submit_mail) { // if new post send out email
|
|
| 530 | + $to_name = geodir_get_client_name($current_user->ID); |
|
| 531 | + geodir_sendEmail('', '', $current_user->user_email, $to_name, '', '', $request_info, 'post_submit', $last_post_id, $current_user->ID);
|
|
| 532 | + } |
|
| 533 | + /* |
|
| 534 | 534 | * Unset the session so we don't loop. |
| 535 | 535 | */ |
| 536 | - $gd_session->un_set('listing');
|
|
| 537 | - return $last_post_id; |
|
| 536 | + $gd_session->un_set('listing');
|
|
| 537 | + return $last_post_id; |
|
| 538 | 538 | |
| 539 | - } |
|
| 539 | + } |
|
| 540 | 540 | |
| 541 | 541 | } |
| 542 | 542 | |
@@ -555,594 +555,594 @@ discard block |
||
| 555 | 555 | function geodir_get_post_info($post_id = '') |
| 556 | 556 | {
|
| 557 | 557 | |
| 558 | - global $wpdb, $plugin_prefix, $post, $post_info; |
|
| 558 | + global $wpdb, $plugin_prefix, $post, $post_info; |
|
| 559 | 559 | |
| 560 | - if ($post_id == '' && !empty($post)) |
|
| 561 | - $post_id = $post->ID; |
|
| 560 | + if ($post_id == '' && !empty($post)) |
|
| 561 | + $post_id = $post->ID; |
|
| 562 | 562 | |
| 563 | - $post_type = get_post_type($post_id); |
|
| 563 | + $post_type = get_post_type($post_id); |
|
| 564 | 564 | |
| 565 | - $all_postypes = geodir_get_posttypes(); |
|
| 565 | + $all_postypes = geodir_get_posttypes(); |
|
| 566 | 566 | |
| 567 | - if (!in_array($post_type, $all_postypes)) |
|
| 568 | - return false; |
|
| 567 | + if (!in_array($post_type, $all_postypes)) |
|
| 568 | + return false; |
|
| 569 | 569 | |
| 570 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 570 | + $table = $plugin_prefix . $post_type . '_detail'; |
|
| 571 | 571 | |
| 572 | - /** |
|
| 573 | - * Apply Filter to change Post info |
|
| 574 | - * |
|
| 575 | - * You can use this filter to change Post info. |
|
| 576 | - * |
|
| 577 | - * @since 1.0.0 |
|
| 578 | - * @package GeoDirectory |
|
| 579 | - */ |
|
| 580 | - $query = apply_filters('geodir_post_info_query', "SELECT p.*,pd.* FROM " . $wpdb->posts . " p," . $table . " pd
|
|
| 572 | + /** |
|
| 573 | + * Apply Filter to change Post info |
|
| 574 | + * |
|
| 575 | + * You can use this filter to change Post info. |
|
| 576 | + * |
|
| 577 | + * @since 1.0.0 |
|
| 578 | + * @package GeoDirectory |
|
| 579 | + */ |
|
| 580 | + $query = apply_filters('geodir_post_info_query', "SELECT p.*,pd.* FROM " . $wpdb->posts . " p," . $table . " pd
|
|
| 581 | 581 | WHERE p.ID = pd.post_id |
| 582 | 582 | AND post_id = " . $post_id); |
| 583 | 583 | |
| 584 | - $post_detail = $wpdb->get_row($query); |
|
| 584 | + $post_detail = $wpdb->get_row($query); |
|
| 585 | 585 | |
| 586 | - return (!empty($post_detail)) ? $post_info = $post_detail : $post_info = false; |
|
| 586 | + return (!empty($post_detail)) ? $post_info = $post_detail : $post_info = false; |
|
| 587 | 587 | |
| 588 | 588 | } |
| 589 | 589 | |
| 590 | 590 | |
| 591 | 591 | if (!function_exists('geodir_save_post_info')) {
|
| 592 | - /** |
|
| 593 | - * Saves post detail info in detail table. |
|
| 594 | - * |
|
| 595 | - * @since 1.0.0 |
|
| 596 | - * @package GeoDirectory |
|
| 597 | - * @global object $wpdb WordPress Database object. |
|
| 598 | - * @global string $plugin_prefix Geodirectory plugin table prefix. |
|
| 599 | - * @param int $post_id The post ID. |
|
| 600 | - * @param array $postinfo_array {
|
|
| 601 | - * Post info that needs to be saved in detail table. |
|
| 602 | - * |
|
| 603 | - * @type string $post_title Listing title. |
|
| 604 | - * @type string $post_tags Listing tags. |
|
| 605 | - * @type string $post_status Listing post status. |
|
| 606 | - * @type string $post_location_id Listing location ID. |
|
| 607 | - * @type string $claimed Todo Desc needed. |
|
| 608 | - * @type string $businesses Todo Desc needed. |
|
| 609 | - * @type int $submit_time Submitted time in unix timestamp. |
|
| 610 | - * @type string $submit_ip Submitted IP. |
|
| 611 | - * @type string $expire_date Listing expiration date. |
|
| 612 | - * @type int $package_id Listing package ID. |
|
| 613 | - * @type int $alive_days Todo Desc needed. |
|
| 614 | - * @type int $is_featured Is this a featured listing?. |
|
| 615 | - * @type string $post_address Listing address. |
|
| 616 | - * @type string $post_city Listing city. |
|
| 617 | - * @type string $post_region Listing region. |
|
| 618 | - * @type string $post_country Listing country. |
|
| 619 | - * @type string $post_locations Listing locations. |
|
| 620 | - * @type string $post_zip Listing zip. |
|
| 621 | - * @type string $post_latitude Listing latitude. |
|
| 622 | - * @type string $post_longitude Listing longitude. |
|
| 623 | - * @type string $post_mapview Listing mapview. Default "ROADMAP". |
|
| 624 | - * @type string $post_mapzoom Listing mapzoom Default "9". |
|
| 625 | - * @type string $geodir_timing Business timing info. |
|
| 626 | - * @type string $geodir_contact Contact number. |
|
| 627 | - * @type string $geodir_email Business contact email. |
|
| 628 | - * @type string $geodir_website Business website. |
|
| 629 | - * @type string $geodir_twitter Twitter link. |
|
| 630 | - * @type string $geodir_facebook Facebook link. |
|
| 631 | - * @type string $geodir_video Video link. |
|
| 632 | - * @type string $geodir_special_offers Speacial offers. |
|
| 633 | - * |
|
| 634 | - * } |
|
| 635 | - * @return bool |
|
| 636 | - */ |
|
| 637 | - function geodir_save_post_info($post_id, $postinfo_array = array()) |
|
| 638 | - {
|
|
| 639 | - global $wpdb, $plugin_prefix; |
|
| 640 | - |
|
| 641 | - $post_type = get_post_type($post_id); |
|
| 642 | - |
|
| 643 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 644 | - |
|
| 645 | - /** |
|
| 646 | - * Filter to change Post info |
|
| 647 | - * |
|
| 648 | - * You can use this filter to change Post info. |
|
| 649 | - * |
|
| 650 | - * @since 1.0.0 |
|
| 651 | - * @package GeoDirectory |
|
| 652 | - * @param array $postinfo_array See {@see geodir_save_post_info()} for accepted args.
|
|
| 653 | - * @param int $post_id The post ID. |
|
| 654 | - */ |
|
| 655 | - $postmeta = apply_filters('geodir_listinginfo_request', $postinfo_array, $post_id);
|
|
| 592 | + /** |
|
| 593 | + * Saves post detail info in detail table. |
|
| 594 | + * |
|
| 595 | + * @since 1.0.0 |
|
| 596 | + * @package GeoDirectory |
|
| 597 | + * @global object $wpdb WordPress Database object. |
|
| 598 | + * @global string $plugin_prefix Geodirectory plugin table prefix. |
|
| 599 | + * @param int $post_id The post ID. |
|
| 600 | + * @param array $postinfo_array {
|
|
| 601 | + * Post info that needs to be saved in detail table. |
|
| 602 | + * |
|
| 603 | + * @type string $post_title Listing title. |
|
| 604 | + * @type string $post_tags Listing tags. |
|
| 605 | + * @type string $post_status Listing post status. |
|
| 606 | + * @type string $post_location_id Listing location ID. |
|
| 607 | + * @type string $claimed Todo Desc needed. |
|
| 608 | + * @type string $businesses Todo Desc needed. |
|
| 609 | + * @type int $submit_time Submitted time in unix timestamp. |
|
| 610 | + * @type string $submit_ip Submitted IP. |
|
| 611 | + * @type string $expire_date Listing expiration date. |
|
| 612 | + * @type int $package_id Listing package ID. |
|
| 613 | + * @type int $alive_days Todo Desc needed. |
|
| 614 | + * @type int $is_featured Is this a featured listing?. |
|
| 615 | + * @type string $post_address Listing address. |
|
| 616 | + * @type string $post_city Listing city. |
|
| 617 | + * @type string $post_region Listing region. |
|
| 618 | + * @type string $post_country Listing country. |
|
| 619 | + * @type string $post_locations Listing locations. |
|
| 620 | + * @type string $post_zip Listing zip. |
|
| 621 | + * @type string $post_latitude Listing latitude. |
|
| 622 | + * @type string $post_longitude Listing longitude. |
|
| 623 | + * @type string $post_mapview Listing mapview. Default "ROADMAP". |
|
| 624 | + * @type string $post_mapzoom Listing mapzoom Default "9". |
|
| 625 | + * @type string $geodir_timing Business timing info. |
|
| 626 | + * @type string $geodir_contact Contact number. |
|
| 627 | + * @type string $geodir_email Business contact email. |
|
| 628 | + * @type string $geodir_website Business website. |
|
| 629 | + * @type string $geodir_twitter Twitter link. |
|
| 630 | + * @type string $geodir_facebook Facebook link. |
|
| 631 | + * @type string $geodir_video Video link. |
|
| 632 | + * @type string $geodir_special_offers Speacial offers. |
|
| 633 | + * |
|
| 634 | + * } |
|
| 635 | + * @return bool |
|
| 636 | + */ |
|
| 637 | + function geodir_save_post_info($post_id, $postinfo_array = array()) |
|
| 638 | + {
|
|
| 639 | + global $wpdb, $plugin_prefix; |
|
| 640 | + |
|
| 641 | + $post_type = get_post_type($post_id); |
|
| 642 | + |
|
| 643 | + $table = $plugin_prefix . $post_type . '_detail'; |
|
| 644 | + |
|
| 645 | + /** |
|
| 646 | + * Filter to change Post info |
|
| 647 | + * |
|
| 648 | + * You can use this filter to change Post info. |
|
| 649 | + * |
|
| 650 | + * @since 1.0.0 |
|
| 651 | + * @package GeoDirectory |
|
| 652 | + * @param array $postinfo_array See {@see geodir_save_post_info()} for accepted args.
|
|
| 653 | + * @param int $post_id The post ID. |
|
| 654 | + */ |
|
| 655 | + $postmeta = apply_filters('geodir_listinginfo_request', $postinfo_array, $post_id);
|
|
| 656 | + |
|
| 657 | + if (!empty($postmeta) && $post_id) {
|
|
| 658 | + $post_meta_set_query = ''; |
|
| 659 | + |
|
| 660 | + foreach ($postmeta as $mkey => $mval) {
|
|
| 661 | + if (geodir_column_exist($table, $mkey)) {
|
|
| 662 | + if (is_array($mval)) {
|
|
| 663 | + $mval = implode(",", $mval);
|
|
| 664 | + } |
|
| 665 | + |
|
| 666 | + $post_meta_set_query .= $mkey . " = '" . addslashes_gpc($mval) . "', "; |
|
| 667 | + } |
|
| 668 | + } |
|
| 656 | 669 | |
| 657 | - if (!empty($postmeta) && $post_id) {
|
|
| 658 | - $post_meta_set_query = ''; |
|
| 670 | + $post_meta_set_query = trim($post_meta_set_query, ", "); |
|
| 671 | + |
|
| 672 | + if (empty($post_meta_set_query) || trim($post_meta_set_query) == '') {
|
|
| 673 | + return false; |
|
| 674 | + } |
|
| 659 | 675 | |
| 660 | - foreach ($postmeta as $mkey => $mval) {
|
|
| 661 | - if (geodir_column_exist($table, $mkey)) {
|
|
| 662 | - if (is_array($mval)) {
|
|
| 663 | - $mval = implode(",", $mval);
|
|
| 664 | - } |
|
| 676 | + $post_meta_set_query = str_replace('%', '%%', $post_meta_set_query);// escape %
|
|
| 665 | 677 | |
| 666 | - $post_meta_set_query .= $mkey . " = '" . addslashes_gpc($mval) . "', "; |
|
| 667 | - } |
|
| 668 | - } |
|
| 669 | 678 | |
| 670 | - $post_meta_set_query = trim($post_meta_set_query, ", "); |
|
| 671 | - |
|
| 672 | - if (empty($post_meta_set_query) || trim($post_meta_set_query) == '') {
|
|
| 673 | - return false; |
|
| 674 | - } |
|
| 679 | + /** |
|
| 680 | + * Called before saving the listing info. |
|
| 681 | + * |
|
| 682 | + * @since 1.0.0 |
|
| 683 | + * @package GeoDirectory |
|
| 684 | + * @param array $postinfo_array See {@see geodir_save_post_info()} for accepted args.
|
|
| 685 | + * @param int $post_id The post ID. |
|
| 686 | + */ |
|
| 687 | + do_action('geodir_before_save_listinginfo', $postinfo_array, $post_id);
|
|
| 675 | 688 | |
| 676 | - $post_meta_set_query = str_replace('%', '%%', $post_meta_set_query);// escape %
|
|
| 689 | + if ($wpdb->get_var($wpdb->prepare("SELECT post_id from " . $table . " where post_id = %d", array($post_id)))) {
|
|
| 677 | 690 | |
| 691 | + $wpdb->query( |
|
| 692 | + $wpdb->prepare( |
|
| 693 | + "UPDATE " . $table . " SET " . $post_meta_set_query . " where post_id =%d", |
|
| 694 | + array($post_id) |
|
| 695 | + ) |
|
| 696 | + ); |
|
| 678 | 697 | |
| 679 | - /** |
|
| 680 | - * Called before saving the listing info. |
|
| 681 | - * |
|
| 682 | - * @since 1.0.0 |
|
| 683 | - * @package GeoDirectory |
|
| 684 | - * @param array $postinfo_array See {@see geodir_save_post_info()} for accepted args.
|
|
| 685 | - * @param int $post_id The post ID. |
|
| 686 | - */ |
|
| 687 | - do_action('geodir_before_save_listinginfo', $postinfo_array, $post_id);
|
|
| 688 | 698 | |
| 689 | - if ($wpdb->get_var($wpdb->prepare("SELECT post_id from " . $table . " where post_id = %d", array($post_id)))) {
|
|
| 699 | + } else {
|
|
| 690 | 700 | |
| 691 | - $wpdb->query( |
|
| 692 | - $wpdb->prepare( |
|
| 693 | - "UPDATE " . $table . " SET " . $post_meta_set_query . " where post_id =%d", |
|
| 694 | - array($post_id) |
|
| 695 | - ) |
|
| 696 | - ); |
|
| 701 | + $wpdb->query( |
|
| 702 | + $wpdb->prepare( |
|
| 703 | + "INSERT INTO " . $table . " SET post_id = %d," . $post_meta_set_query, |
|
| 704 | + array($post_id) |
|
| 705 | + ) |
|
| 706 | + ); |
|
| 697 | 707 | |
| 708 | + } |
|
| 698 | 709 | |
| 699 | - } else {
|
|
| 710 | + /** |
|
| 711 | + * Called after saving the listing info. |
|
| 712 | + * |
|
| 713 | + * @since 1.0.0 |
|
| 714 | + * @package GeoDirectory |
|
| 715 | + * @param array $postinfo_array Post info that needs to be saved in detail table. |
|
| 716 | + * @param int $post_id The post ID. |
|
| 717 | + * @see 'geodir_after_save_listing' |
|
| 718 | + */ |
|
| 719 | + do_action('geodir_after_save_listinginfo', $postinfo_array, $post_id);
|
|
| 720 | + |
|
| 721 | + return true; |
|
| 722 | + } else |
|
| 723 | + return false; |
|
| 700 | 724 | |
| 701 | - $wpdb->query( |
|
| 702 | - $wpdb->prepare( |
|
| 703 | - "INSERT INTO " . $table . " SET post_id = %d," . $post_meta_set_query, |
|
| 704 | - array($post_id) |
|
| 705 | - ) |
|
| 706 | - ); |
|
| 725 | + } |
|
| 726 | +} |
|
| 707 | 727 | |
| 708 | - } |
|
| 709 | 728 | |
| 710 | - /** |
|
| 711 | - * Called after saving the listing info. |
|
| 712 | - * |
|
| 713 | - * @since 1.0.0 |
|
| 714 | - * @package GeoDirectory |
|
| 715 | - * @param array $postinfo_array Post info that needs to be saved in detail table. |
|
| 716 | - * @param int $post_id The post ID. |
|
| 717 | - * @see 'geodir_after_save_listing' |
|
| 718 | - */ |
|
| 719 | - do_action('geodir_after_save_listinginfo', $postinfo_array, $post_id);
|
|
| 729 | +if (!function_exists('geodir_save_post_meta')) {
|
|
| 730 | + /** |
|
| 731 | + * Save or update post custom fields. |
|
| 732 | + * |
|
| 733 | + * @since 1.0.0 |
|
| 734 | + * @package GeoDirectory |
|
| 735 | + * @global object $wpdb WordPress Database object. |
|
| 736 | + * @global string $plugin_prefix Geodirectory plugin table prefix. |
|
| 737 | + * @param int $post_id The post ID. |
|
| 738 | + * @param string $postmeta Detail table column name. |
|
| 739 | + * @param string $meta_value Detail table column value. |
|
| 740 | + * @return void|bool |
|
| 741 | + */ |
|
| 742 | + function geodir_save_post_meta($post_id, $postmeta = '', $meta_value = '') |
|
| 743 | + {
|
|
| 744 | + |
|
| 745 | + global $wpdb, $plugin_prefix; |
|
| 746 | + |
|
| 747 | + $post_type = get_post_type($post_id); |
|
| 748 | + |
|
| 749 | + $table = $plugin_prefix . $post_type . '_detail'; |
|
| 750 | + |
|
| 751 | + if ($postmeta != '' && geodir_column_exist($table, $postmeta) && $post_id) {
|
|
| 752 | + |
|
| 753 | + if (is_array($meta_value)) {
|
|
| 754 | + $meta_value = implode(",", $meta_value);
|
|
| 755 | + } |
|
| 720 | 756 | |
| 721 | - return true; |
|
| 722 | - } else |
|
| 723 | - return false; |
|
| 757 | + if ($wpdb->get_var($wpdb->prepare("SELECT post_id from " . $table . " where post_id = %d", array($post_id)))) {
|
|
| 724 | 758 | |
| 725 | - } |
|
| 726 | -} |
|
| 759 | + $wpdb->query( |
|
| 760 | + $wpdb->prepare( |
|
| 761 | + "UPDATE " . $table . " SET " . $postmeta . " = '" . $meta_value . "' where post_id =%d", |
|
| 762 | + array($post_id) |
|
| 763 | + ) |
|
| 764 | + ); |
|
| 727 | 765 | |
| 766 | + } else {
|
|
| 728 | 767 | |
| 729 | -if (!function_exists('geodir_save_post_meta')) {
|
|
| 730 | - /** |
|
| 731 | - * Save or update post custom fields. |
|
| 732 | - * |
|
| 733 | - * @since 1.0.0 |
|
| 734 | - * @package GeoDirectory |
|
| 735 | - * @global object $wpdb WordPress Database object. |
|
| 736 | - * @global string $plugin_prefix Geodirectory plugin table prefix. |
|
| 737 | - * @param int $post_id The post ID. |
|
| 738 | - * @param string $postmeta Detail table column name. |
|
| 739 | - * @param string $meta_value Detail table column value. |
|
| 740 | - * @return void|bool |
|
| 741 | - */ |
|
| 742 | - function geodir_save_post_meta($post_id, $postmeta = '', $meta_value = '') |
|
| 743 | - {
|
|
| 744 | - |
|
| 745 | - global $wpdb, $plugin_prefix; |
|
| 746 | - |
|
| 747 | - $post_type = get_post_type($post_id); |
|
| 748 | - |
|
| 749 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 750 | - |
|
| 751 | - if ($postmeta != '' && geodir_column_exist($table, $postmeta) && $post_id) {
|
|
| 752 | - |
|
| 753 | - if (is_array($meta_value)) {
|
|
| 754 | - $meta_value = implode(",", $meta_value);
|
|
| 755 | - } |
|
| 756 | - |
|
| 757 | - if ($wpdb->get_var($wpdb->prepare("SELECT post_id from " . $table . " where post_id = %d", array($post_id)))) {
|
|
| 758 | - |
|
| 759 | - $wpdb->query( |
|
| 760 | - $wpdb->prepare( |
|
| 761 | - "UPDATE " . $table . " SET " . $postmeta . " = '" . $meta_value . "' where post_id =%d", |
|
| 762 | - array($post_id) |
|
| 763 | - ) |
|
| 764 | - ); |
|
| 765 | - |
|
| 766 | - } else {
|
|
| 767 | - |
|
| 768 | - $wpdb->query( |
|
| 769 | - $wpdb->prepare( |
|
| 770 | - "INSERT INTO " . $table . " SET post_id = %d, " . $postmeta . " = '" . $meta_value . "'", |
|
| 771 | - array($post_id) |
|
| 772 | - ) |
|
| 773 | - ); |
|
| 774 | - } |
|
| 775 | - |
|
| 776 | - |
|
| 777 | - } else |
|
| 778 | - return false; |
|
| 779 | - } |
|
| 768 | + $wpdb->query( |
|
| 769 | + $wpdb->prepare( |
|
| 770 | + "INSERT INTO " . $table . " SET post_id = %d, " . $postmeta . " = '" . $meta_value . "'", |
|
| 771 | + array($post_id) |
|
| 772 | + ) |
|
| 773 | + ); |
|
| 774 | + } |
|
| 775 | + |
|
| 776 | + |
|
| 777 | + } else |
|
| 778 | + return false; |
|
| 779 | + } |
|
| 780 | 780 | } |
| 781 | 781 | |
| 782 | 782 | if (!function_exists('geodir_delete_post_meta')) {
|
| 783 | - /** |
|
| 784 | - * Delete post custom fields. |
|
| 785 | - * |
|
| 786 | - * @since 1.0.0 |
|
| 787 | - * @package GeoDirectory |
|
| 788 | - * @global object $wpdb WordPress Database object. |
|
| 789 | - * @global string $plugin_prefix Geodirectory plugin table prefix. |
|
| 790 | - * @param int $post_id The post ID. |
|
| 791 | - * @param string $postmeta Detail table column name. |
|
| 792 | - * @todo check if this is depreciated |
|
| 793 | - * @todo Fix unknown variable mval |
|
| 794 | - * @return bool |
|
| 795 | - */ |
|
| 796 | - function geodir_delete_post_meta($post_id, $postmeta) |
|
| 797 | - {
|
|
| 798 | - |
|
| 799 | - global $wpdb, $plugin_prefix; |
|
| 800 | - |
|
| 801 | - $post_type = get_post_type($post_id); |
|
| 802 | - |
|
| 803 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 804 | - |
|
| 805 | - if (is_array($postmeta) && !empty($postmeta) && $post_id) {
|
|
| 806 | - $post_meta_set_query = ''; |
|
| 807 | - |
|
| 808 | - foreach ($postmeta as $mkey) {
|
|
| 809 | - if ($mval != '') |
|
| 810 | - $post_meta_set_query .= $mkey . " = '', "; |
|
| 811 | - } |
|
| 812 | - |
|
| 813 | - $post_meta_set_query = trim($post_meta_set_query, ", "); |
|
| 783 | + /** |
|
| 784 | + * Delete post custom fields. |
|
| 785 | + * |
|
| 786 | + * @since 1.0.0 |
|
| 787 | + * @package GeoDirectory |
|
| 788 | + * @global object $wpdb WordPress Database object. |
|
| 789 | + * @global string $plugin_prefix Geodirectory plugin table prefix. |
|
| 790 | + * @param int $post_id The post ID. |
|
| 791 | + * @param string $postmeta Detail table column name. |
|
| 792 | + * @todo check if this is depreciated |
|
| 793 | + * @todo Fix unknown variable mval |
|
| 794 | + * @return bool |
|
| 795 | + */ |
|
| 796 | + function geodir_delete_post_meta($post_id, $postmeta) |
|
| 797 | + {
|
|
| 798 | + |
|
| 799 | + global $wpdb, $plugin_prefix; |
|
| 800 | + |
|
| 801 | + $post_type = get_post_type($post_id); |
|
| 802 | + |
|
| 803 | + $table = $plugin_prefix . $post_type . '_detail'; |
|
| 804 | + |
|
| 805 | + if (is_array($postmeta) && !empty($postmeta) && $post_id) {
|
|
| 806 | + $post_meta_set_query = ''; |
|
| 807 | + |
|
| 808 | + foreach ($postmeta as $mkey) {
|
|
| 809 | + if ($mval != '') |
|
| 810 | + $post_meta_set_query .= $mkey . " = '', "; |
|
| 811 | + } |
|
| 812 | + |
|
| 813 | + $post_meta_set_query = trim($post_meta_set_query, ", "); |
|
| 814 | 814 | |
| 815 | - if (empty($post_meta_set_query) || trim($post_meta_set_query) == '') {
|
|
| 816 | - return false; |
|
| 817 | - } |
|
| 818 | - |
|
| 819 | - if ($wpdb->get_var("SHOW COLUMNS FROM " . $table . " WHERE field = '" . $postmeta . "'") != '') {
|
|
| 820 | - |
|
| 821 | - $wpdb->query( |
|
| 822 | - $wpdb->prepare( |
|
| 823 | - "UPDATE " . $table . " SET " . $post_meta_set_query . " where post_id = %d", |
|
| 824 | - array($post_id) |
|
| 825 | - ) |
|
| 826 | - ); |
|
| 827 | - |
|
| 828 | - return true; |
|
| 829 | - } |
|
| 830 | - |
|
| 831 | - } elseif ($postmeta != '' && $post_id) {
|
|
| 832 | - if ($wpdb->get_var("SHOW COLUMNS FROM " . $table . " WHERE field = '" . $postmeta . "'") != '') {
|
|
| 833 | - |
|
| 834 | - $wpdb->query( |
|
| 835 | - $wpdb->prepare( |
|
| 836 | - "UPDATE " . $table . " SET " . $postmeta . "= '' where post_id = %d", |
|
| 837 | - array($post_id) |
|
| 838 | - ) |
|
| 839 | - ); |
|
| 840 | - |
|
| 841 | - return true; |
|
| 842 | - } |
|
| 843 | - |
|
| 844 | - } else |
|
| 845 | - return false; |
|
| 846 | - } |
|
| 815 | + if (empty($post_meta_set_query) || trim($post_meta_set_query) == '') {
|
|
| 816 | + return false; |
|
| 817 | + } |
|
| 818 | + |
|
| 819 | + if ($wpdb->get_var("SHOW COLUMNS FROM " . $table . " WHERE field = '" . $postmeta . "'") != '') {
|
|
| 820 | + |
|
| 821 | + $wpdb->query( |
|
| 822 | + $wpdb->prepare( |
|
| 823 | + "UPDATE " . $table . " SET " . $post_meta_set_query . " where post_id = %d", |
|
| 824 | + array($post_id) |
|
| 825 | + ) |
|
| 826 | + ); |
|
| 827 | + |
|
| 828 | + return true; |
|
| 829 | + } |
|
| 830 | + |
|
| 831 | + } elseif ($postmeta != '' && $post_id) {
|
|
| 832 | + if ($wpdb->get_var("SHOW COLUMNS FROM " . $table . " WHERE field = '" . $postmeta . "'") != '') {
|
|
| 833 | + |
|
| 834 | + $wpdb->query( |
|
| 835 | + $wpdb->prepare( |
|
| 836 | + "UPDATE " . $table . " SET " . $postmeta . "= '' where post_id = %d", |
|
| 837 | + array($post_id) |
|
| 838 | + ) |
|
| 839 | + ); |
|
| 840 | + |
|
| 841 | + return true; |
|
| 842 | + } |
|
| 843 | + |
|
| 844 | + } else |
|
| 845 | + return false; |
|
| 846 | + } |
|
| 847 | 847 | } |
| 848 | 848 | |
| 849 | 849 | |
| 850 | 850 | if (!function_exists('geodir_get_post_meta')) {
|
| 851 | - /** |
|
| 852 | - * Get post custom meta. |
|
| 853 | - * |
|
| 854 | - * @since 1.0.0 |
|
| 855 | - * @package GeoDirectory |
|
| 856 | - * @global object $wpdb WordPress Database object. |
|
| 857 | - * @global string $plugin_prefix Geodirectory plugin table prefix. |
|
| 858 | - * @param int $post_id The post ID. |
|
| 859 | - * @param string $meta_key The meta key to retrieve. |
|
| 860 | - * @param bool $single Optional. Whether to return a single value. Default false. |
|
| 861 | - * @todo single variable not yet implemented. |
|
| 862 | - * @return bool|mixed|null|string Will be an array if $single is false. Will be value of meta data field if $single is true. |
|
| 863 | - */ |
|
| 864 | - function geodir_get_post_meta($post_id, $meta_key, $single = false) |
|
| 865 | - {
|
|
| 866 | - if (!$post_id) {
|
|
| 867 | - return false; |
|
| 868 | - } |
|
| 869 | - global $wpdb, $plugin_prefix; |
|
| 870 | - |
|
| 871 | - $all_postypes = geodir_get_posttypes(); |
|
| 872 | - |
|
| 873 | - $post_type = get_post_type($post_id); |
|
| 874 | - |
|
| 875 | - if (!in_array($post_type, $all_postypes)) |
|
| 876 | - return false; |
|
| 877 | - |
|
| 878 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 879 | - |
|
| 880 | - if ($wpdb->get_var("SHOW COLUMNS FROM " . $table . " WHERE field = '" . $meta_key . "'") != '') {
|
|
| 881 | - $meta_value = $wpdb->get_var($wpdb->prepare("SELECT " . $meta_key . " from " . $table . " where post_id = %d", array($post_id)));
|
|
| 851 | + /** |
|
| 852 | + * Get post custom meta. |
|
| 853 | + * |
|
| 854 | + * @since 1.0.0 |
|
| 855 | + * @package GeoDirectory |
|
| 856 | + * @global object $wpdb WordPress Database object. |
|
| 857 | + * @global string $plugin_prefix Geodirectory plugin table prefix. |
|
| 858 | + * @param int $post_id The post ID. |
|
| 859 | + * @param string $meta_key The meta key to retrieve. |
|
| 860 | + * @param bool $single Optional. Whether to return a single value. Default false. |
|
| 861 | + * @todo single variable not yet implemented. |
|
| 862 | + * @return bool|mixed|null|string Will be an array if $single is false. Will be value of meta data field if $single is true. |
|
| 863 | + */ |
|
| 864 | + function geodir_get_post_meta($post_id, $meta_key, $single = false) |
|
| 865 | + {
|
|
| 866 | + if (!$post_id) {
|
|
| 867 | + return false; |
|
| 868 | + } |
|
| 869 | + global $wpdb, $plugin_prefix; |
|
| 870 | + |
|
| 871 | + $all_postypes = geodir_get_posttypes(); |
|
| 872 | + |
|
| 873 | + $post_type = get_post_type($post_id); |
|
| 874 | + |
|
| 875 | + if (!in_array($post_type, $all_postypes)) |
|
| 876 | + return false; |
|
| 877 | + |
|
| 878 | + $table = $plugin_prefix . $post_type . '_detail'; |
|
| 879 | + |
|
| 880 | + if ($wpdb->get_var("SHOW COLUMNS FROM " . $table . " WHERE field = '" . $meta_key . "'") != '') {
|
|
| 881 | + $meta_value = $wpdb->get_var($wpdb->prepare("SELECT " . $meta_key . " from " . $table . " where post_id = %d", array($post_id)));
|
|
| 882 | 882 | |
| 883 | - if ($meta_value && $meta_value !== '') {
|
|
| 884 | - return maybe_serialize($meta_value); |
|
| 885 | - } else |
|
| 886 | - return $meta_value; |
|
| 887 | - } else {
|
|
| 888 | - return false; |
|
| 889 | - } |
|
| 890 | - } |
|
| 883 | + if ($meta_value && $meta_value !== '') {
|
|
| 884 | + return maybe_serialize($meta_value); |
|
| 885 | + } else |
|
| 886 | + return $meta_value; |
|
| 887 | + } else {
|
|
| 888 | + return false; |
|
| 889 | + } |
|
| 890 | + } |
|
| 891 | 891 | } |
| 892 | 892 | |
| 893 | 893 | |
| 894 | 894 | if (!function_exists('geodir_save_post_images')) {
|
| 895 | - /** |
|
| 896 | - * Save post attachments. |
|
| 897 | - * |
|
| 898 | - * @since 1.0.0 |
|
| 899 | - * @package GeoDirectory |
|
| 900 | - * @global object $wpdb WordPress Database object. |
|
| 901 | - * @global string $plugin_prefix Geodirectory plugin table prefix. |
|
| 902 | - * @global object $current_user Current user object. |
|
| 903 | - * @param int $post_id The post ID. |
|
| 904 | - * @param array $post_image Post image urls as an array. |
|
| 905 | - * @param bool $dummy Optional. Is this a dummy listing? Default false. |
|
| 906 | - */ |
|
| 907 | - function geodir_save_post_images($post_id = 0, $post_image = array(), $dummy = false) |
|
| 908 | - {
|
|
| 909 | - |
|
| 895 | + /** |
|
| 896 | + * Save post attachments. |
|
| 897 | + * |
|
| 898 | + * @since 1.0.0 |
|
| 899 | + * @package GeoDirectory |
|
| 900 | + * @global object $wpdb WordPress Database object. |
|
| 901 | + * @global string $plugin_prefix Geodirectory plugin table prefix. |
|
| 902 | + * @global object $current_user Current user object. |
|
| 903 | + * @param int $post_id The post ID. |
|
| 904 | + * @param array $post_image Post image urls as an array. |
|
| 905 | + * @param bool $dummy Optional. Is this a dummy listing? Default false. |
|
| 906 | + */ |
|
| 907 | + function geodir_save_post_images($post_id = 0, $post_image = array(), $dummy = false) |
|
| 908 | + {
|
|
| 910 | 909 | |
| 911 | - global $wpdb, $plugin_prefix, $current_user; |
|
| 912 | 910 | |
| 913 | - $post_type = get_post_type($post_id); |
|
| 911 | + global $wpdb, $plugin_prefix, $current_user; |
|
| 914 | 912 | |
| 915 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 913 | + $post_type = get_post_type($post_id); |
|
| 916 | 914 | |
| 917 | - $post_images = geodir_get_images($post_id); |
|
| 915 | + $table = $plugin_prefix . $post_type . '_detail'; |
|
| 918 | 916 | |
| 919 | - $wpdb->query( |
|
| 920 | - $wpdb->prepare( |
|
| 921 | - "UPDATE " . $table . " SET featured_image = '' where post_id =%d", |
|
| 922 | - array($post_id) |
|
| 923 | - ) |
|
| 924 | - ); |
|
| 917 | + $post_images = geodir_get_images($post_id); |
|
| 925 | 918 | |
| 926 | - $invalid_files = $post_images; |
|
| 927 | - $valid_file_ids = array(); |
|
| 928 | - $valid_files_condition = ''; |
|
| 929 | - $geodir_uploaddir = ''; |
|
| 919 | + $wpdb->query( |
|
| 920 | + $wpdb->prepare( |
|
| 921 | + "UPDATE " . $table . " SET featured_image = '' where post_id =%d", |
|
| 922 | + array($post_id) |
|
| 923 | + ) |
|
| 924 | + ); |
|
| 930 | 925 | |
| 931 | - $remove_files = array(); |
|
| 926 | + $invalid_files = $post_images; |
|
| 927 | + $valid_file_ids = array(); |
|
| 928 | + $valid_files_condition = ''; |
|
| 929 | + $geodir_uploaddir = ''; |
|
| 932 | 930 | |
| 933 | - if (!empty($post_image)) {
|
|
| 931 | + $remove_files = array(); |
|
| 934 | 932 | |
| 935 | - $uploads = wp_upload_dir(); |
|
| 936 | - $uploads_dir = $uploads['path']; |
|
| 933 | + if (!empty($post_image)) {
|
|
| 937 | 934 | |
| 938 | - $geodir_uploadpath = $uploads['path']; |
|
| 939 | - $geodir_uploadurl = $uploads['url']; |
|
| 940 | - $sub_dir = isset($uploads['subdir']) ? $uploads['subdir'] : ''; |
|
| 935 | + $uploads = wp_upload_dir(); |
|
| 936 | + $uploads_dir = $uploads['path']; |
|
| 941 | 937 | |
| 942 | - $invalid_files = array(); |
|
| 943 | - $postcurr_images = array(); |
|
| 938 | + $geodir_uploadpath = $uploads['path']; |
|
| 939 | + $geodir_uploadurl = $uploads['url']; |
|
| 940 | + $sub_dir = isset($uploads['subdir']) ? $uploads['subdir'] : ''; |
|
| 944 | 941 | |
| 945 | - for ($m = 0; $m < count($post_image); $m++) {
|
|
| 946 | - $menu_order = $m + 1; |
|
| 942 | + $invalid_files = array(); |
|
| 943 | + $postcurr_images = array(); |
|
| 947 | 944 | |
| 948 | - $file_path = ''; |
|
| 949 | - /* --------- start ------- */ |
|
| 945 | + for ($m = 0; $m < count($post_image); $m++) {
|
|
| 946 | + $menu_order = $m + 1; |
|
| 950 | 947 | |
| 951 | - $split_img_path = explode(str_replace(array('http://','https://'),'',$uploads['baseurl']), str_replace(array('http://','https://'),'',$post_image[$m]));
|
|
| 948 | + $file_path = ''; |
|
| 949 | + /* --------- start ------- */ |
|
| 952 | 950 | |
| 953 | - $split_img_file_path = isset($split_img_path[1]) ? $split_img_path[1] : ''; |
|
| 951 | + $split_img_path = explode(str_replace(array('http://','https://'),'',$uploads['baseurl']), str_replace(array('http://','https://'),'',$post_image[$m]));
|
|
| 954 | 952 | |
| 953 | + $split_img_file_path = isset($split_img_path[1]) ? $split_img_path[1] : ''; |
|
| 955 | 954 | |
| 956 | - if (!$find_image = $wpdb->get_var($wpdb->prepare("SELECT ID FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE file=%s AND post_id = %d", array($split_img_file_path, $post_id)))) {
|
|
| 957 | 955 | |
| 958 | - /* --------- end ------- */ |
|
| 959 | - $curr_img_url = $post_image[$m]; |
|
| 956 | + if (!$find_image = $wpdb->get_var($wpdb->prepare("SELECT ID FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE file=%s AND post_id = %d", array($split_img_file_path, $post_id)))) {
|
|
| 960 | 957 | |
| 961 | - $image_name_arr = explode('/', $curr_img_url);
|
|
| 958 | + /* --------- end ------- */ |
|
| 959 | + $curr_img_url = $post_image[$m]; |
|
| 962 | 960 | |
| 963 | - $count_image_name_arr = count($image_name_arr) - 2; |
|
| 961 | + $image_name_arr = explode('/', $curr_img_url);
|
|
| 964 | 962 | |
| 965 | - $count_image_name_arr = ($count_image_name_arr >= 0) ? $count_image_name_arr : 0; |
|
| 963 | + $count_image_name_arr = count($image_name_arr) - 2; |
|
| 966 | 964 | |
| 967 | - $curr_img_dir = $image_name_arr[$count_image_name_arr]; |
|
| 965 | + $count_image_name_arr = ($count_image_name_arr >= 0) ? $count_image_name_arr : 0; |
|
| 968 | 966 | |
| 969 | - $filename = end($image_name_arr); |
|
| 970 | - if (strpos($filename, '?') !== false) {
|
|
| 971 | - list($filename) = explode('?', $filename);
|
|
| 972 | - } |
|
| 967 | + $curr_img_dir = $image_name_arr[$count_image_name_arr]; |
|
| 973 | 968 | |
| 974 | - $curr_img_dir = str_replace($uploads['baseurl'], "", $curr_img_url); |
|
| 975 | - $curr_img_dir = str_replace($filename, "", $curr_img_dir); |
|
| 969 | + $filename = end($image_name_arr); |
|
| 970 | + if (strpos($filename, '?') !== false) {
|
|
| 971 | + list($filename) = explode('?', $filename);
|
|
| 972 | + } |
|
| 976 | 973 | |
| 977 | - $img_name_arr = explode('.', $filename);
|
|
| 974 | + $curr_img_dir = str_replace($uploads['baseurl'], "", $curr_img_url); |
|
| 975 | + $curr_img_dir = str_replace($filename, "", $curr_img_dir); |
|
| 978 | 976 | |
| 979 | - $file_title = isset($img_name_arr[0]) ? $img_name_arr[0] : $filename; |
|
| 980 | - if (!empty($img_name_arr) && count($img_name_arr) > 2) {
|
|
| 981 | - $new_img_name_arr = $img_name_arr; |
|
| 982 | - if (isset($new_img_name_arr[count($img_name_arr) - 1])) {
|
|
| 983 | - unset($new_img_name_arr[count($img_name_arr) - 1]); |
|
| 984 | - $file_title = implode('.', $new_img_name_arr);
|
|
| 985 | - } |
|
| 986 | - } |
|
| 987 | - $file_title = sanitize_file_name($file_title); |
|
| 988 | - $file_name = sanitize_file_name($filename); |
|
| 977 | + $img_name_arr = explode('.', $filename);
|
|
| 989 | 978 | |
| 990 | - $arr_file_type = wp_check_filetype($filename); |
|
| 979 | + $file_title = isset($img_name_arr[0]) ? $img_name_arr[0] : $filename; |
|
| 980 | + if (!empty($img_name_arr) && count($img_name_arr) > 2) {
|
|
| 981 | + $new_img_name_arr = $img_name_arr; |
|
| 982 | + if (isset($new_img_name_arr[count($img_name_arr) - 1])) {
|
|
| 983 | + unset($new_img_name_arr[count($img_name_arr) - 1]); |
|
| 984 | + $file_title = implode('.', $new_img_name_arr);
|
|
| 985 | + } |
|
| 986 | + } |
|
| 987 | + $file_title = sanitize_file_name($file_title); |
|
| 988 | + $file_name = sanitize_file_name($filename); |
|
| 991 | 989 | |
| 992 | - $uploaded_file_type = $arr_file_type['type']; |
|
| 990 | + $arr_file_type = wp_check_filetype($filename); |
|
| 993 | 991 | |
| 994 | - // Set an array containing a list of acceptable formats |
|
| 995 | - $allowed_file_types = array('image/jpg', 'image/jpeg', 'image/gif', 'image/png');
|
|
| 992 | + $uploaded_file_type = $arr_file_type['type']; |
|
| 996 | 993 | |
| 997 | - // If the uploaded file is the right format |
|
| 998 | - if (in_array($uploaded_file_type, $allowed_file_types)) {
|
|
| 999 | - if (!function_exists('wp_handle_upload')) {
|
|
| 1000 | - require_once(ABSPATH . 'wp-admin/includes/file.php'); |
|
| 1001 | - } |
|
| 994 | + // Set an array containing a list of acceptable formats |
|
| 995 | + $allowed_file_types = array('image/jpg', 'image/jpeg', 'image/gif', 'image/png');
|
|
| 1002 | 996 | |
| 1003 | - if (!is_dir($geodir_uploadpath)) {
|
|
| 1004 | - mkdir($geodir_uploadpath); |
|
| 1005 | - } |
|
| 997 | + // If the uploaded file is the right format |
|
| 998 | + if (in_array($uploaded_file_type, $allowed_file_types)) {
|
|
| 999 | + if (!function_exists('wp_handle_upload')) {
|
|
| 1000 | + require_once(ABSPATH . 'wp-admin/includes/file.php'); |
|
| 1001 | + } |
|
| 1006 | 1002 | |
| 1007 | - $external_img = false; |
|
| 1008 | - if (strpos(str_replace(array('http://','https://'),'',$curr_img_url), str_replace(array('http://','https://'),'',$uploads['baseurl'])) !== false) {
|
|
| 1009 | - } else {
|
|
| 1010 | - $external_img = true; |
|
| 1011 | - } |
|
| 1003 | + if (!is_dir($geodir_uploadpath)) {
|
|
| 1004 | + mkdir($geodir_uploadpath); |
|
| 1005 | + } |
|
| 1012 | 1006 | |
| 1013 | - if ($dummy || $external_img) {
|
|
| 1014 | - $uploaded_file = array(); |
|
| 1015 | - $uploaded = (array)fetch_remote_file($curr_img_url); |
|
| 1007 | + $external_img = false; |
|
| 1008 | + if (strpos(str_replace(array('http://','https://'),'',$curr_img_url), str_replace(array('http://','https://'),'',$uploads['baseurl'])) !== false) {
|
|
| 1009 | + } else {
|
|
| 1010 | + $external_img = true; |
|
| 1011 | + } |
|
| 1016 | 1012 | |
| 1017 | - if (isset($uploaded['error']) && empty($uploaded['error'])) {
|
|
| 1018 | - $new_name = basename($uploaded['file']); |
|
| 1019 | - $uploaded_file = $uploaded; |
|
| 1020 | - }else{
|
|
| 1021 | - print_r($uploaded);exit; |
|
| 1022 | - } |
|
| 1023 | - $external_img = false; |
|
| 1024 | - } else {
|
|
| 1025 | - $new_name = $post_id . '_' . $file_name; |
|
| 1013 | + if ($dummy || $external_img) {
|
|
| 1014 | + $uploaded_file = array(); |
|
| 1015 | + $uploaded = (array)fetch_remote_file($curr_img_url); |
|
| 1026 | 1016 | |
| 1027 | - if ($curr_img_dir == $sub_dir) {
|
|
| 1028 | - $img_path = $geodir_uploadpath . '/' . $filename; |
|
| 1029 | - $img_url = $geodir_uploadurl . '/' . $filename; |
|
| 1030 | - } else {
|
|
| 1031 | - $img_path = $uploads_dir . '/temp_' . $current_user->data->ID . '/' . $filename; |
|
| 1032 | - $img_url = $uploads['url'] . '/temp_' . $current_user->data->ID . '/' . $filename; |
|
| 1033 | - } |
|
| 1017 | + if (isset($uploaded['error']) && empty($uploaded['error'])) {
|
|
| 1018 | + $new_name = basename($uploaded['file']); |
|
| 1019 | + $uploaded_file = $uploaded; |
|
| 1020 | + }else{
|
|
| 1021 | + print_r($uploaded);exit; |
|
| 1022 | + } |
|
| 1023 | + $external_img = false; |
|
| 1024 | + } else {
|
|
| 1025 | + $new_name = $post_id . '_' . $file_name; |
|
| 1034 | 1026 | |
| 1035 | - $uploaded_file = ''; |
|
| 1027 | + if ($curr_img_dir == $sub_dir) {
|
|
| 1028 | + $img_path = $geodir_uploadpath . '/' . $filename; |
|
| 1029 | + $img_url = $geodir_uploadurl . '/' . $filename; |
|
| 1030 | + } else {
|
|
| 1031 | + $img_path = $uploads_dir . '/temp_' . $current_user->data->ID . '/' . $filename; |
|
| 1032 | + $img_url = $uploads['url'] . '/temp_' . $current_user->data->ID . '/' . $filename; |
|
| 1033 | + } |
|
| 1036 | 1034 | |
| 1037 | - if (file_exists($img_path)) {
|
|
| 1038 | - $uploaded_file = copy($img_path, $geodir_uploadpath . '/' . $new_name); |
|
| 1039 | - $file_path = ''; |
|
| 1040 | - } else if (file_exists($uploads['basedir'] . $curr_img_dir . $filename)) {
|
|
| 1041 | - $uploaded_file = true; |
|
| 1042 | - $file_path = $curr_img_dir . '/' . $filename; |
|
| 1043 | - } |
|
| 1035 | + $uploaded_file = ''; |
|
| 1044 | 1036 | |
| 1045 | - if ($curr_img_dir != $geodir_uploaddir && file_exists($img_path)) |
|
| 1046 | - unlink($img_path); |
|
| 1047 | - } |
|
| 1037 | + if (file_exists($img_path)) {
|
|
| 1038 | + $uploaded_file = copy($img_path, $geodir_uploadpath . '/' . $new_name); |
|
| 1039 | + $file_path = ''; |
|
| 1040 | + } else if (file_exists($uploads['basedir'] . $curr_img_dir . $filename)) {
|
|
| 1041 | + $uploaded_file = true; |
|
| 1042 | + $file_path = $curr_img_dir . '/' . $filename; |
|
| 1043 | + } |
|
| 1048 | 1044 | |
| 1049 | - if (!empty($uploaded_file)) {
|
|
| 1050 | - if (!isset($file_path) || !$file_path) {
|
|
| 1051 | - $file_path = $sub_dir . '/' . $new_name; |
|
| 1052 | - } |
|
| 1045 | + if ($curr_img_dir != $geodir_uploaddir && file_exists($img_path)) |
|
| 1046 | + unlink($img_path); |
|
| 1047 | + } |
|
| 1053 | 1048 | |
| 1054 | - $postcurr_images[] = str_replace(array('http://','https://'),'',$uploads['baseurl'] . $file_path);
|
|
| 1049 | + if (!empty($uploaded_file)) {
|
|
| 1050 | + if (!isset($file_path) || !$file_path) {
|
|
| 1051 | + $file_path = $sub_dir . '/' . $new_name; |
|
| 1052 | + } |
|
| 1055 | 1053 | |
| 1056 | - if ($menu_order == 1) {
|
|
| 1054 | + $postcurr_images[] = str_replace(array('http://','https://'),'',$uploads['baseurl'] . $file_path);
|
|
| 1057 | 1055 | |
| 1058 | - $wpdb->query($wpdb->prepare("UPDATE " . $table . " SET featured_image = %s where post_id =%d", array($file_path, $post_id)));
|
|
| 1056 | + if ($menu_order == 1) {
|
|
| 1059 | 1057 | |
| 1060 | - } |
|
| 1058 | + $wpdb->query($wpdb->prepare("UPDATE " . $table . " SET featured_image = %s where post_id =%d", array($file_path, $post_id)));
|
|
| 1061 | 1059 | |
| 1062 | - // Set up options array to add this file as an attachment |
|
| 1063 | - $attachment = array(); |
|
| 1064 | - $attachment['post_id'] = $post_id; |
|
| 1065 | - $attachment['title'] = $file_title; |
|
| 1066 | - $attachment['content'] = ''; |
|
| 1067 | - $attachment['file'] = $file_path; |
|
| 1068 | - $attachment['mime_type'] = $uploaded_file_type; |
|
| 1069 | - $attachment['menu_order'] = $menu_order; |
|
| 1070 | - $attachment['is_featured'] = 0; |
|
| 1060 | + } |
|
| 1071 | 1061 | |
| 1072 | - $attachment_set = ''; |
|
| 1062 | + // Set up options array to add this file as an attachment |
|
| 1063 | + $attachment = array(); |
|
| 1064 | + $attachment['post_id'] = $post_id; |
|
| 1065 | + $attachment['title'] = $file_title; |
|
| 1066 | + $attachment['content'] = ''; |
|
| 1067 | + $attachment['file'] = $file_path; |
|
| 1068 | + $attachment['mime_type'] = $uploaded_file_type; |
|
| 1069 | + $attachment['menu_order'] = $menu_order; |
|
| 1070 | + $attachment['is_featured'] = 0; |
|
| 1073 | 1071 | |
| 1074 | - foreach ($attachment as $key => $val) {
|
|
| 1075 | - if ($val != '') |
|
| 1076 | - $attachment_set .= $key . " = '" . $val . "', "; |
|
| 1077 | - } |
|
| 1072 | + $attachment_set = ''; |
|
| 1078 | 1073 | |
| 1079 | - $attachment_set = trim($attachment_set, ", "); |
|
| 1074 | + foreach ($attachment as $key => $val) {
|
|
| 1075 | + if ($val != '') |
|
| 1076 | + $attachment_set .= $key . " = '" . $val . "', "; |
|
| 1077 | + } |
|
| 1080 | 1078 | |
| 1081 | - $wpdb->query("INSERT INTO " . GEODIR_ATTACHMENT_TABLE . " SET " . $attachment_set);
|
|
| 1079 | + $attachment_set = trim($attachment_set, ", "); |
|
| 1080 | + |
|
| 1081 | + $wpdb->query("INSERT INTO " . GEODIR_ATTACHMENT_TABLE . " SET " . $attachment_set);
|
|
| 1082 | 1082 | |
| 1083 | - $valid_file_ids[] = $wpdb->insert_id; |
|
| 1084 | - } |
|
| 1083 | + $valid_file_ids[] = $wpdb->insert_id; |
|
| 1084 | + } |
|
| 1085 | 1085 | |
| 1086 | - } |
|
| 1086 | + } |
|
| 1087 | 1087 | |
| 1088 | 1088 | |
| 1089 | - } else {
|
|
| 1090 | - $valid_file_ids[] = $find_image; |
|
| 1089 | + } else {
|
|
| 1090 | + $valid_file_ids[] = $find_image; |
|
| 1091 | 1091 | |
| 1092 | - $postcurr_images[] = str_replace(array('http://','https://'),'',$post_image[$m]);
|
|
| 1092 | + $postcurr_images[] = str_replace(array('http://','https://'),'',$post_image[$m]);
|
|
| 1093 | 1093 | |
| 1094 | - $wpdb->query( |
|
| 1095 | - $wpdb->prepare( |
|
| 1096 | - "UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order = %d where file =%s AND post_id =%d", |
|
| 1097 | - array($menu_order, $split_img_path[1], $post_id) |
|
| 1098 | - ) |
|
| 1099 | - ); |
|
| 1094 | + $wpdb->query( |
|
| 1095 | + $wpdb->prepare( |
|
| 1096 | + "UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order = %d where file =%s AND post_id =%d", |
|
| 1097 | + array($menu_order, $split_img_path[1], $post_id) |
|
| 1098 | + ) |
|
| 1099 | + ); |
|
| 1100 | 1100 | |
| 1101 | - if ($menu_order == 1) |
|
| 1102 | - $wpdb->query($wpdb->prepare("UPDATE " . $table . " SET featured_image = %s where post_id =%d", array($split_img_path[1], $post_id)));
|
|
| 1101 | + if ($menu_order == 1) |
|
| 1102 | + $wpdb->query($wpdb->prepare("UPDATE " . $table . " SET featured_image = %s where post_id =%d", array($split_img_path[1], $post_id)));
|
|
| 1103 | 1103 | |
| 1104 | - } |
|
| 1104 | + } |
|
| 1105 | 1105 | |
| 1106 | 1106 | |
| 1107 | - } |
|
| 1107 | + } |
|
| 1108 | 1108 | |
| 1109 | - if (!empty($valid_file_ids)) {
|
|
| 1109 | + if (!empty($valid_file_ids)) {
|
|
| 1110 | 1110 | |
| 1111 | - $remove_files = $valid_file_ids; |
|
| 1111 | + $remove_files = $valid_file_ids; |
|
| 1112 | 1112 | |
| 1113 | - $remove_files_length = count($remove_files); |
|
| 1114 | - $remove_files_format = array_fill(0, $remove_files_length, '%d'); |
|
| 1115 | - $format = implode(',', $remove_files_format);
|
|
| 1116 | - $valid_files_condition = " ID NOT IN ($format) AND "; |
|
| 1113 | + $remove_files_length = count($remove_files); |
|
| 1114 | + $remove_files_format = array_fill(0, $remove_files_length, '%d'); |
|
| 1115 | + $format = implode(',', $remove_files_format);
|
|
| 1116 | + $valid_files_condition = " ID NOT IN ($format) AND "; |
|
| 1117 | 1117 | |
| 1118 | - } |
|
| 1118 | + } |
|
| 1119 | 1119 | |
| 1120 | - //Get and remove all old images of post from database to set by new order |
|
| 1120 | + //Get and remove all old images of post from database to set by new order |
|
| 1121 | 1121 | |
| 1122 | - if (!empty($post_images)) {
|
|
| 1122 | + if (!empty($post_images)) {
|
|
| 1123 | 1123 | |
| 1124 | - foreach ($post_images as $img) {
|
|
| 1124 | + foreach ($post_images as $img) {
|
|
| 1125 | 1125 | |
| 1126 | - if (!in_array(str_replace(array('http://','https://'),'',$img->src), $postcurr_images)) {
|
|
| 1126 | + if (!in_array(str_replace(array('http://','https://'),'',$img->src), $postcurr_images)) {
|
|
| 1127 | 1127 | |
| 1128 | - $invalid_files[] = (object)array('src' => $img->src);
|
|
| 1128 | + $invalid_files[] = (object)array('src' => $img->src);
|
|
| 1129 | 1129 | |
| 1130 | - } |
|
| 1130 | + } |
|
| 1131 | 1131 | |
| 1132 | - } |
|
| 1132 | + } |
|
| 1133 | 1133 | |
| 1134 | - } |
|
| 1134 | + } |
|
| 1135 | 1135 | |
| 1136 | - $invalid_files = (object)$invalid_files; |
|
| 1137 | - } |
|
| 1136 | + $invalid_files = (object)$invalid_files; |
|
| 1137 | + } |
|
| 1138 | 1138 | |
| 1139 | - $remove_files[] = $post_id; |
|
| 1139 | + $remove_files[] = $post_id; |
|
| 1140 | 1140 | |
| 1141 | - $wpdb->query($wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE " . $valid_files_condition . " post_id = %d", $remove_files));
|
|
| 1141 | + $wpdb->query($wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE " . $valid_files_condition . " post_id = %d", $remove_files));
|
|
| 1142 | 1142 | |
| 1143 | - if (!empty($invalid_files)) |
|
| 1144 | - geodir_remove_attachments($invalid_files); |
|
| 1145 | - } |
|
| 1143 | + if (!empty($invalid_files)) |
|
| 1144 | + geodir_remove_attachments($invalid_files); |
|
| 1145 | + } |
|
| 1146 | 1146 | |
| 1147 | 1147 | } |
| 1148 | 1148 | |
@@ -1156,12 +1156,12 @@ discard block |
||
| 1156 | 1156 | function geodir_remove_temp_images() |
| 1157 | 1157 | {
|
| 1158 | 1158 | |
| 1159 | - global $current_user; |
|
| 1159 | + global $current_user; |
|
| 1160 | 1160 | |
| 1161 | - $uploads = wp_upload_dir(); |
|
| 1162 | - $uploads_dir = $uploads['path']; |
|
| 1161 | + $uploads = wp_upload_dir(); |
|
| 1162 | + $uploads_dir = $uploads['path']; |
|
| 1163 | 1163 | |
| 1164 | - /* if(is_dir($uploads_dir.'/temp_'.$current_user->data->ID)){
|
|
| 1164 | + /* if(is_dir($uploads_dir.'/temp_'.$current_user->data->ID)){
|
|
| 1165 | 1165 | |
| 1166 | 1166 | $dirPath = $uploads_dir.'/temp_'.$current_user->data->ID; |
| 1167 | 1167 | if (substr($dirPath, strlen($dirPath) - 1, 1) != '/') {
|
@@ -1178,8 +1178,8 @@ discard block |
||
| 1178 | 1178 | rmdir($dirPath); |
| 1179 | 1179 | } */ |
| 1180 | 1180 | |
| 1181 | - $dirname = $uploads_dir . '/temp_' . $current_user->ID; |
|
| 1182 | - geodir_delete_directory($dirname); |
|
| 1181 | + $dirname = $uploads_dir . '/temp_' . $current_user->ID; |
|
| 1182 | + geodir_delete_directory($dirname); |
|
| 1183 | 1183 | } |
| 1184 | 1184 | |
| 1185 | 1185 | |
@@ -1193,116 +1193,116 @@ discard block |
||
| 1193 | 1193 | */ |
| 1194 | 1194 | function geodir_delete_directory($dirname) |
| 1195 | 1195 | {
|
| 1196 | - $dir_handle = ''; |
|
| 1197 | - if (is_dir($dirname)) |
|
| 1198 | - $dir_handle = opendir($dirname); |
|
| 1199 | - if (!$dir_handle) |
|
| 1200 | - return false; |
|
| 1201 | - while ($file = readdir($dir_handle)) {
|
|
| 1202 | - if ($file != "." && $file != "..") {
|
|
| 1203 | - if (!is_dir($dirname . "/" . $file)) |
|
| 1204 | - unlink($dirname . "/" . $file); |
|
| 1205 | - else |
|
| 1206 | - geodir_delete_directory($dirname . '/' . $file); |
|
| 1207 | - } |
|
| 1208 | - } |
|
| 1209 | - closedir($dir_handle); |
|
| 1210 | - rmdir($dirname); |
|
| 1211 | - return true; |
|
| 1196 | + $dir_handle = ''; |
|
| 1197 | + if (is_dir($dirname)) |
|
| 1198 | + $dir_handle = opendir($dirname); |
|
| 1199 | + if (!$dir_handle) |
|
| 1200 | + return false; |
|
| 1201 | + while ($file = readdir($dir_handle)) {
|
|
| 1202 | + if ($file != "." && $file != "..") {
|
|
| 1203 | + if (!is_dir($dirname . "/" . $file)) |
|
| 1204 | + unlink($dirname . "/" . $file); |
|
| 1205 | + else |
|
| 1206 | + geodir_delete_directory($dirname . '/' . $file); |
|
| 1207 | + } |
|
| 1208 | + } |
|
| 1209 | + closedir($dir_handle); |
|
| 1210 | + rmdir($dirname); |
|
| 1211 | + return true; |
|
| 1212 | 1212 | |
| 1213 | 1213 | } |
| 1214 | 1214 | |
| 1215 | 1215 | |
| 1216 | 1216 | if (!function_exists('geodir_remove_attachments')) {
|
| 1217 | - /** |
|
| 1218 | - * Remove post attachments. |
|
| 1219 | - * |
|
| 1220 | - * @since 1.0.0 |
|
| 1221 | - * @package GeoDirectory |
|
| 1222 | - * @param array $postcurr_images Array of image objects. |
|
| 1223 | - */ |
|
| 1224 | - function geodir_remove_attachments($postcurr_images = array()) |
|
| 1225 | - {
|
|
| 1226 | - // Unlink all past images of post |
|
| 1227 | - if (!empty($postcurr_images)) {
|
|
| 1228 | - |
|
| 1229 | - $uploads = wp_upload_dir(); |
|
| 1230 | - $uploads_dir = $uploads['path']; |
|
| 1231 | - |
|
| 1232 | - foreach ($postcurr_images as $postimg) {
|
|
| 1233 | - $image_name_arr = explode('/', $postimg->src);
|
|
| 1234 | - $filename = end($image_name_arr); |
|
| 1235 | - if (file_exists($uploads_dir . '/' . $filename)) |
|
| 1236 | - unlink($uploads_dir . '/' . $filename); |
|
| 1237 | - } |
|
| 1238 | - |
|
| 1239 | - } // endif |
|
| 1240 | - // Unlink all past images of post end |
|
| 1241 | - } |
|
| 1217 | + /** |
|
| 1218 | + * Remove post attachments. |
|
| 1219 | + * |
|
| 1220 | + * @since 1.0.0 |
|
| 1221 | + * @package GeoDirectory |
|
| 1222 | + * @param array $postcurr_images Array of image objects. |
|
| 1223 | + */ |
|
| 1224 | + function geodir_remove_attachments($postcurr_images = array()) |
|
| 1225 | + {
|
|
| 1226 | + // Unlink all past images of post |
|
| 1227 | + if (!empty($postcurr_images)) {
|
|
| 1228 | + |
|
| 1229 | + $uploads = wp_upload_dir(); |
|
| 1230 | + $uploads_dir = $uploads['path']; |
|
| 1231 | + |
|
| 1232 | + foreach ($postcurr_images as $postimg) {
|
|
| 1233 | + $image_name_arr = explode('/', $postimg->src);
|
|
| 1234 | + $filename = end($image_name_arr); |
|
| 1235 | + if (file_exists($uploads_dir . '/' . $filename)) |
|
| 1236 | + unlink($uploads_dir . '/' . $filename); |
|
| 1237 | + } |
|
| 1238 | + |
|
| 1239 | + } // endif |
|
| 1240 | + // Unlink all past images of post end |
|
| 1241 | + } |
|
| 1242 | 1242 | } |
| 1243 | 1243 | |
| 1244 | 1244 | if (!function_exists('geodir_get_featured_image')) {
|
| 1245 | - /** |
|
| 1246 | - * Gets the post featured image. |
|
| 1247 | - * |
|
| 1248 | - * @since 1.0.0 |
|
| 1249 | - * @package GeoDirectory |
|
| 1250 | - * @global object $wpdb WordPress Database object. |
|
| 1251 | - * @global object $post The current post object. |
|
| 1252 | - * @global string $plugin_prefix Geodirectory plugin table prefix. |
|
| 1253 | - * @param int|string $post_id The post ID. |
|
| 1254 | - * @param string $size Optional. Thumbnail size. Default: thumbnail. |
|
| 1255 | - * @param bool $no_image Optional. Do you want to return the default image when no image is available? Default: false. |
|
| 1256 | - * @param bool|string $file Optional. The file path from which you want to get the image details. Default: false. |
|
| 1257 | - * @return bool|object Image details as an object. |
|
| 1258 | - */ |
|
| 1259 | - function geodir_get_featured_image($post_id = '', $size = '', $no_image = false, $file = false) |
|
| 1260 | - {
|
|
| 1261 | - |
|
| 1262 | - /*$img_arr['src'] = get_the_post_thumbnail_url( $post_id, 'medium');//medium/thumbnail |
|
| 1245 | + /** |
|
| 1246 | + * Gets the post featured image. |
|
| 1247 | + * |
|
| 1248 | + * @since 1.0.0 |
|
| 1249 | + * @package GeoDirectory |
|
| 1250 | + * @global object $wpdb WordPress Database object. |
|
| 1251 | + * @global object $post The current post object. |
|
| 1252 | + * @global string $plugin_prefix Geodirectory plugin table prefix. |
|
| 1253 | + * @param int|string $post_id The post ID. |
|
| 1254 | + * @param string $size Optional. Thumbnail size. Default: thumbnail. |
|
| 1255 | + * @param bool $no_image Optional. Do you want to return the default image when no image is available? Default: false. |
|
| 1256 | + * @param bool|string $file Optional. The file path from which you want to get the image details. Default: false. |
|
| 1257 | + * @return bool|object Image details as an object. |
|
| 1258 | + */ |
|
| 1259 | + function geodir_get_featured_image($post_id = '', $size = '', $no_image = false, $file = false) |
|
| 1260 | + {
|
|
| 1261 | + |
|
| 1262 | + /*$img_arr['src'] = get_the_post_thumbnail_url( $post_id, 'medium');//medium/thumbnail |
|
| 1263 | 1263 | $img_arr['path'] = ''; |
| 1264 | 1264 | $img_arr['width'] = ''; |
| 1265 | 1265 | $img_arr['height'] = ''; |
| 1266 | 1266 | $img_arr['title'] = ''; |
| 1267 | 1267 | return (object)$img_arr;*/ |
| 1268 | - global $wpdb, $plugin_prefix, $post; |
|
| 1268 | + global $wpdb, $plugin_prefix, $post; |
|
| 1269 | 1269 | |
| 1270 | - if (isset($post->ID) && isset($post->post_type) && $post->ID == $post_id) {
|
|
| 1271 | - $post_type = $post->post_type; |
|
| 1272 | - } else {
|
|
| 1273 | - $post_type = get_post_type($post_id); |
|
| 1274 | - } |
|
| 1270 | + if (isset($post->ID) && isset($post->post_type) && $post->ID == $post_id) {
|
|
| 1271 | + $post_type = $post->post_type; |
|
| 1272 | + } else {
|
|
| 1273 | + $post_type = get_post_type($post_id); |
|
| 1274 | + } |
|
| 1275 | 1275 | |
| 1276 | - if (!in_array($post_type, geodir_get_posttypes())) {
|
|
| 1277 | - return false;// if not a GD CPT return; |
|
| 1278 | - } |
|
| 1276 | + if (!in_array($post_type, geodir_get_posttypes())) {
|
|
| 1277 | + return false;// if not a GD CPT return; |
|
| 1278 | + } |
|
| 1279 | 1279 | |
| 1280 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 1280 | + $table = $plugin_prefix . $post_type . '_detail'; |
|
| 1281 | 1281 | |
| 1282 | - if (!$file) {
|
|
| 1283 | - if (isset($post->featured_image)) {
|
|
| 1284 | - $file = $post->featured_image; |
|
| 1285 | - } else {
|
|
| 1286 | - $file = $wpdb->get_var($wpdb->prepare("SELECT featured_image FROM " . $table . " WHERE post_id = %d", array($post_id)));
|
|
| 1287 | - } |
|
| 1288 | - } |
|
| 1282 | + if (!$file) {
|
|
| 1283 | + if (isset($post->featured_image)) {
|
|
| 1284 | + $file = $post->featured_image; |
|
| 1285 | + } else {
|
|
| 1286 | + $file = $wpdb->get_var($wpdb->prepare("SELECT featured_image FROM " . $table . " WHERE post_id = %d", array($post_id)));
|
|
| 1287 | + } |
|
| 1288 | + } |
|
| 1289 | 1289 | |
| 1290 | - if ($file != NULL && $file != '' && (($uploads = wp_upload_dir()) && false === $uploads['error'])) {
|
|
| 1291 | - $img_arr = array(); |
|
| 1290 | + if ($file != NULL && $file != '' && (($uploads = wp_upload_dir()) && false === $uploads['error'])) {
|
|
| 1291 | + $img_arr = array(); |
|
| 1292 | 1292 | |
| 1293 | - $file_info = pathinfo($file); |
|
| 1294 | - $sub_dir = ''; |
|
| 1295 | - if ($file_info['dirname'] != '.' && $file_info['dirname'] != '..') |
|
| 1296 | - $sub_dir = stripslashes_deep($file_info['dirname']); |
|
| 1293 | + $file_info = pathinfo($file); |
|
| 1294 | + $sub_dir = ''; |
|
| 1295 | + if ($file_info['dirname'] != '.' && $file_info['dirname'] != '..') |
|
| 1296 | + $sub_dir = stripslashes_deep($file_info['dirname']); |
|
| 1297 | 1297 | |
| 1298 | - $uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs |
|
| 1299 | - $uploads_baseurl = $uploads['baseurl']; |
|
| 1300 | - $uploads_path = $uploads['path']; |
|
| 1298 | + $uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs |
|
| 1299 | + $uploads_baseurl = $uploads['baseurl']; |
|
| 1300 | + $uploads_path = $uploads['path']; |
|
| 1301 | 1301 | |
| 1302 | - $file_name = $file_info['basename']; |
|
| 1302 | + $file_name = $file_info['basename']; |
|
| 1303 | 1303 | |
| 1304 | - $uploads_url = $uploads_baseurl . $sub_dir; |
|
| 1305 | - /* |
|
| 1304 | + $uploads_url = $uploads_baseurl . $sub_dir; |
|
| 1305 | + /* |
|
| 1306 | 1306 | * Allows the filter of image src for such things as CDN change. |
| 1307 | 1307 | * |
| 1308 | 1308 | * @since 1.5.7 |
@@ -1311,158 +1311,158 @@ discard block |
||
| 1311 | 1311 | * @param string $uploads_url The server upload directory url. |
| 1312 | 1312 | * @param string $uploads_baseurl The uploads dir base url. |
| 1313 | 1313 | */ |
| 1314 | - $img_arr['src'] = apply_filters('geodir_get_featured_image_src',$uploads_url . '/' . $file_name,$file_name,$uploads_url,$uploads_baseurl);
|
|
| 1315 | - $img_arr['path'] = $uploads_path . '/' . $file_name; |
|
| 1316 | - $width = 0; |
|
| 1317 | - $height = 0; |
|
| 1318 | - if (is_file($img_arr['path']) && file_exists($img_arr['path'])) {
|
|
| 1319 | - $imagesize = getimagesize($img_arr['path']); |
|
| 1320 | - $width = !empty($imagesize) && isset($imagesize[0]) ? $imagesize[0] : ''; |
|
| 1321 | - $height = !empty($imagesize) && isset($imagesize[1]) ? $imagesize[1] : ''; |
|
| 1322 | - } |
|
| 1323 | - $img_arr['width'] = $width; |
|
| 1324 | - $img_arr['height'] = $height; |
|
| 1325 | - $img_arr['title'] = ''; |
|
| 1326 | - } elseif ($post_images = geodir_get_images($post_id, $size, $no_image, 1)) {
|
|
| 1327 | - foreach ($post_images as $image) {
|
|
| 1328 | - return $image; |
|
| 1329 | - } |
|
| 1330 | - } else if ($no_image) {
|
|
| 1331 | - $img_arr = array(); |
|
| 1332 | - |
|
| 1333 | - $default_img = ''; |
|
| 1334 | - if (isset($post->default_category) && $post->default_category) {
|
|
| 1335 | - $default_cat = $post->default_category; |
|
| 1336 | - } else {
|
|
| 1337 | - $default_cat = geodir_get_post_meta($post_id, 'default_category', true); |
|
| 1338 | - } |
|
| 1339 | - |
|
| 1340 | - if ($default_catimg = geodir_get_default_catimage($default_cat, $post_type)) |
|
| 1341 | - $default_img = $default_catimg['src']; |
|
| 1342 | - elseif ($no_image) {
|
|
| 1343 | - $default_img = get_option('geodir_listing_no_img');
|
|
| 1344 | - } |
|
| 1345 | - |
|
| 1346 | - if (!empty($default_img)) {
|
|
| 1347 | - $uploads = wp_upload_dir(); // Array of key => value pairs |
|
| 1348 | - $uploads_baseurl = $uploads['baseurl']; |
|
| 1349 | - $uploads_path = $uploads['path']; |
|
| 1350 | - |
|
| 1351 | - $img_arr = array(); |
|
| 1352 | - |
|
| 1353 | - $file_info = pathinfo($default_img); |
|
| 1354 | - |
|
| 1355 | - $file_name = $file_info['basename']; |
|
| 1356 | - |
|
| 1357 | - $img_arr['src'] = $default_img; |
|
| 1358 | - $img_arr['path'] = $uploads_path . '/' . $file_name; |
|
| 1359 | - |
|
| 1360 | - $width = 0; |
|
| 1361 | - $height = 0; |
|
| 1362 | - if (is_file($img_arr['path']) && file_exists($img_arr['path'])) {
|
|
| 1363 | - $imagesize = getimagesize($img_arr['path']); |
|
| 1364 | - $width = !empty($imagesize) && isset($imagesize[0]) ? $imagesize[0] : ''; |
|
| 1365 | - $height = !empty($imagesize) && isset($imagesize[1]) ? $imagesize[1] : ''; |
|
| 1366 | - } |
|
| 1367 | - $img_arr['width'] = $width; |
|
| 1368 | - $img_arr['height'] = $height; |
|
| 1369 | - |
|
| 1370 | - $img_arr['title'] = ''; // add the title to the array |
|
| 1371 | - } |
|
| 1372 | - } |
|
| 1373 | - |
|
| 1374 | - if (!empty($img_arr)) |
|
| 1375 | - return (object)$img_arr;//return (object)array( 'src' => $file_url, 'path' => $file_path ); |
|
| 1376 | - else |
|
| 1377 | - return false; |
|
| 1378 | - } |
|
| 1314 | + $img_arr['src'] = apply_filters('geodir_get_featured_image_src',$uploads_url . '/' . $file_name,$file_name,$uploads_url,$uploads_baseurl);
|
|
| 1315 | + $img_arr['path'] = $uploads_path . '/' . $file_name; |
|
| 1316 | + $width = 0; |
|
| 1317 | + $height = 0; |
|
| 1318 | + if (is_file($img_arr['path']) && file_exists($img_arr['path'])) {
|
|
| 1319 | + $imagesize = getimagesize($img_arr['path']); |
|
| 1320 | + $width = !empty($imagesize) && isset($imagesize[0]) ? $imagesize[0] : ''; |
|
| 1321 | + $height = !empty($imagesize) && isset($imagesize[1]) ? $imagesize[1] : ''; |
|
| 1322 | + } |
|
| 1323 | + $img_arr['width'] = $width; |
|
| 1324 | + $img_arr['height'] = $height; |
|
| 1325 | + $img_arr['title'] = ''; |
|
| 1326 | + } elseif ($post_images = geodir_get_images($post_id, $size, $no_image, 1)) {
|
|
| 1327 | + foreach ($post_images as $image) {
|
|
| 1328 | + return $image; |
|
| 1329 | + } |
|
| 1330 | + } else if ($no_image) {
|
|
| 1331 | + $img_arr = array(); |
|
| 1332 | + |
|
| 1333 | + $default_img = ''; |
|
| 1334 | + if (isset($post->default_category) && $post->default_category) {
|
|
| 1335 | + $default_cat = $post->default_category; |
|
| 1336 | + } else {
|
|
| 1337 | + $default_cat = geodir_get_post_meta($post_id, 'default_category', true); |
|
| 1338 | + } |
|
| 1339 | + |
|
| 1340 | + if ($default_catimg = geodir_get_default_catimage($default_cat, $post_type)) |
|
| 1341 | + $default_img = $default_catimg['src']; |
|
| 1342 | + elseif ($no_image) {
|
|
| 1343 | + $default_img = get_option('geodir_listing_no_img');
|
|
| 1344 | + } |
|
| 1345 | + |
|
| 1346 | + if (!empty($default_img)) {
|
|
| 1347 | + $uploads = wp_upload_dir(); // Array of key => value pairs |
|
| 1348 | + $uploads_baseurl = $uploads['baseurl']; |
|
| 1349 | + $uploads_path = $uploads['path']; |
|
| 1350 | + |
|
| 1351 | + $img_arr = array(); |
|
| 1352 | + |
|
| 1353 | + $file_info = pathinfo($default_img); |
|
| 1354 | + |
|
| 1355 | + $file_name = $file_info['basename']; |
|
| 1356 | + |
|
| 1357 | + $img_arr['src'] = $default_img; |
|
| 1358 | + $img_arr['path'] = $uploads_path . '/' . $file_name; |
|
| 1359 | + |
|
| 1360 | + $width = 0; |
|
| 1361 | + $height = 0; |
|
| 1362 | + if (is_file($img_arr['path']) && file_exists($img_arr['path'])) {
|
|
| 1363 | + $imagesize = getimagesize($img_arr['path']); |
|
| 1364 | + $width = !empty($imagesize) && isset($imagesize[0]) ? $imagesize[0] : ''; |
|
| 1365 | + $height = !empty($imagesize) && isset($imagesize[1]) ? $imagesize[1] : ''; |
|
| 1366 | + } |
|
| 1367 | + $img_arr['width'] = $width; |
|
| 1368 | + $img_arr['height'] = $height; |
|
| 1369 | + |
|
| 1370 | + $img_arr['title'] = ''; // add the title to the array |
|
| 1371 | + } |
|
| 1372 | + } |
|
| 1373 | + |
|
| 1374 | + if (!empty($img_arr)) |
|
| 1375 | + return (object)$img_arr;//return (object)array( 'src' => $file_url, 'path' => $file_path ); |
|
| 1376 | + else |
|
| 1377 | + return false; |
|
| 1378 | + } |
|
| 1379 | 1379 | } |
| 1380 | 1380 | |
| 1381 | 1381 | if (!function_exists('geodir_show_featured_image')) {
|
| 1382 | - /** |
|
| 1383 | - * Gets the post featured image. |
|
| 1384 | - * |
|
| 1385 | - * @since 1.0.0 |
|
| 1386 | - * @package GeoDirectory |
|
| 1387 | - * @param int|string $post_id The post ID. |
|
| 1388 | - * @param string $size Optional. Thumbnail size. Default: thumbnail. |
|
| 1389 | - * @param bool $no_image Optional. Do you want to return the default image when no image is available? Default: false. |
|
| 1390 | - * @param bool $echo Optional. Do you want to print it instead of returning it? Default: true. |
|
| 1391 | - * @param bool|string $fimage Optional. The file path from which you want to get the image details. Default: false. |
|
| 1392 | - * @return bool|string Returns image html. |
|
| 1393 | - */ |
|
| 1394 | - function geodir_show_featured_image($post_id = '', $size = 'thumbnail', $no_image = false, $echo = true, $fimage = false) |
|
| 1395 | - {
|
|
| 1396 | - $image = geodir_get_featured_image($post_id, $size, $no_image, $fimage); |
|
| 1397 | - |
|
| 1398 | - $html = geodir_show_image($image, $size, $no_image, false); |
|
| 1399 | - |
|
| 1400 | - if (!empty($html) && $echo) {
|
|
| 1401 | - echo $html; |
|
| 1402 | - } elseif (!empty($html)) {
|
|
| 1403 | - return $html; |
|
| 1404 | - } else |
|
| 1405 | - return false; |
|
| 1406 | - } |
|
| 1382 | + /** |
|
| 1383 | + * Gets the post featured image. |
|
| 1384 | + * |
|
| 1385 | + * @since 1.0.0 |
|
| 1386 | + * @package GeoDirectory |
|
| 1387 | + * @param int|string $post_id The post ID. |
|
| 1388 | + * @param string $size Optional. Thumbnail size. Default: thumbnail. |
|
| 1389 | + * @param bool $no_image Optional. Do you want to return the default image when no image is available? Default: false. |
|
| 1390 | + * @param bool $echo Optional. Do you want to print it instead of returning it? Default: true. |
|
| 1391 | + * @param bool|string $fimage Optional. The file path from which you want to get the image details. Default: false. |
|
| 1392 | + * @return bool|string Returns image html. |
|
| 1393 | + */ |
|
| 1394 | + function geodir_show_featured_image($post_id = '', $size = 'thumbnail', $no_image = false, $echo = true, $fimage = false) |
|
| 1395 | + {
|
|
| 1396 | + $image = geodir_get_featured_image($post_id, $size, $no_image, $fimage); |
|
| 1397 | + |
|
| 1398 | + $html = geodir_show_image($image, $size, $no_image, false); |
|
| 1399 | + |
|
| 1400 | + if (!empty($html) && $echo) {
|
|
| 1401 | + echo $html; |
|
| 1402 | + } elseif (!empty($html)) {
|
|
| 1403 | + return $html; |
|
| 1404 | + } else |
|
| 1405 | + return false; |
|
| 1406 | + } |
|
| 1407 | 1407 | } |
| 1408 | 1408 | |
| 1409 | 1409 | if (!function_exists('geodir_get_images')) {
|
| 1410 | - /** |
|
| 1411 | - * Gets the post images. |
|
| 1412 | - * |
|
| 1413 | - * @since 1.0.0 |
|
| 1414 | - * @package GeoDirectory |
|
| 1415 | - * @global object $wpdb WordPress Database object. |
|
| 1416 | - * @param int $post_id The post ID. |
|
| 1417 | - * @param string $img_size Optional. Thumbnail size. |
|
| 1418 | - * @param bool $no_images Optional. Do you want to return the default image when no image is available? Default: false. |
|
| 1419 | - * @param bool $add_featured Optional. Do you want to include featured images too? Default: true. |
|
| 1420 | - * @param int|string $limit Optional. Number of images. |
|
| 1421 | - * @return array|bool Returns images as an array. Each item is an object. |
|
| 1422 | - */ |
|
| 1423 | - function geodir_get_images($post_id = 0, $img_size = '', $no_images = false, $add_featured = true, $limit = '') |
|
| 1424 | - {
|
|
| 1425 | - global $wpdb; |
|
| 1426 | - if ($limit) {
|
|
| 1427 | - $limit_q = " LIMIT $limit "; |
|
| 1428 | - } else {
|
|
| 1429 | - $limit_q = ''; |
|
| 1430 | - } |
|
| 1431 | - $not_featured = ''; |
|
| 1432 | - $sub_dir = ''; |
|
| 1433 | - if (!$add_featured) |
|
| 1434 | - $not_featured = " AND is_featured = 0 "; |
|
| 1435 | - |
|
| 1436 | - $arrImages = $wpdb->get_results( |
|
| 1437 | - $wpdb->prepare( |
|
| 1438 | - "SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE mime_type like %s AND post_id = %d" . $not_featured . " ORDER BY menu_order ASC, ID DESC $limit_q ", |
|
| 1439 | - array('%image%', $post_id)
|
|
| 1440 | - ) |
|
| 1441 | - ); |
|
| 1442 | - |
|
| 1443 | - $counter = 0; |
|
| 1444 | - $return_arr = array(); |
|
| 1445 | - |
|
| 1446 | - if (!empty($arrImages)) {
|
|
| 1447 | - foreach ($arrImages as $attechment) {
|
|
| 1448 | - |
|
| 1449 | - $img_arr = array(); |
|
| 1450 | - $img_arr['id'] = $attechment->ID; |
|
| 1451 | - $img_arr['user_id'] = isset($attechment->user_id) ? $attechment->user_id : 0; |
|
| 1452 | - |
|
| 1453 | - $file_info = pathinfo($attechment->file); |
|
| 1454 | - |
|
| 1455 | - if ($file_info['dirname'] != '.' && $file_info['dirname'] != '..') |
|
| 1456 | - $sub_dir = stripslashes_deep($file_info['dirname']); |
|
| 1457 | - |
|
| 1458 | - $uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs |
|
| 1459 | - $uploads_baseurl = $uploads['baseurl']; |
|
| 1460 | - $uploads_path = $uploads['path']; |
|
| 1461 | - |
|
| 1462 | - $file_name = $file_info['basename']; |
|
| 1463 | - |
|
| 1464 | - $uploads_url = $uploads_baseurl . $sub_dir; |
|
| 1465 | - /* |
|
| 1410 | + /** |
|
| 1411 | + * Gets the post images. |
|
| 1412 | + * |
|
| 1413 | + * @since 1.0.0 |
|
| 1414 | + * @package GeoDirectory |
|
| 1415 | + * @global object $wpdb WordPress Database object. |
|
| 1416 | + * @param int $post_id The post ID. |
|
| 1417 | + * @param string $img_size Optional. Thumbnail size. |
|
| 1418 | + * @param bool $no_images Optional. Do you want to return the default image when no image is available? Default: false. |
|
| 1419 | + * @param bool $add_featured Optional. Do you want to include featured images too? Default: true. |
|
| 1420 | + * @param int|string $limit Optional. Number of images. |
|
| 1421 | + * @return array|bool Returns images as an array. Each item is an object. |
|
| 1422 | + */ |
|
| 1423 | + function geodir_get_images($post_id = 0, $img_size = '', $no_images = false, $add_featured = true, $limit = '') |
|
| 1424 | + {
|
|
| 1425 | + global $wpdb; |
|
| 1426 | + if ($limit) {
|
|
| 1427 | + $limit_q = " LIMIT $limit "; |
|
| 1428 | + } else {
|
|
| 1429 | + $limit_q = ''; |
|
| 1430 | + } |
|
| 1431 | + $not_featured = ''; |
|
| 1432 | + $sub_dir = ''; |
|
| 1433 | + if (!$add_featured) |
|
| 1434 | + $not_featured = " AND is_featured = 0 "; |
|
| 1435 | + |
|
| 1436 | + $arrImages = $wpdb->get_results( |
|
| 1437 | + $wpdb->prepare( |
|
| 1438 | + "SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE mime_type like %s AND post_id = %d" . $not_featured . " ORDER BY menu_order ASC, ID DESC $limit_q ", |
|
| 1439 | + array('%image%', $post_id)
|
|
| 1440 | + ) |
|
| 1441 | + ); |
|
| 1442 | + |
|
| 1443 | + $counter = 0; |
|
| 1444 | + $return_arr = array(); |
|
| 1445 | + |
|
| 1446 | + if (!empty($arrImages)) {
|
|
| 1447 | + foreach ($arrImages as $attechment) {
|
|
| 1448 | + |
|
| 1449 | + $img_arr = array(); |
|
| 1450 | + $img_arr['id'] = $attechment->ID; |
|
| 1451 | + $img_arr['user_id'] = isset($attechment->user_id) ? $attechment->user_id : 0; |
|
| 1452 | + |
|
| 1453 | + $file_info = pathinfo($attechment->file); |
|
| 1454 | + |
|
| 1455 | + if ($file_info['dirname'] != '.' && $file_info['dirname'] != '..') |
|
| 1456 | + $sub_dir = stripslashes_deep($file_info['dirname']); |
|
| 1457 | + |
|
| 1458 | + $uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs |
|
| 1459 | + $uploads_baseurl = $uploads['baseurl']; |
|
| 1460 | + $uploads_path = $uploads['path']; |
|
| 1461 | + |
|
| 1462 | + $file_name = $file_info['basename']; |
|
| 1463 | + |
|
| 1464 | + $uploads_url = $uploads_baseurl . $sub_dir; |
|
| 1465 | + /* |
|
| 1466 | 1466 | * Allows the filter of image src for such things as CDN change. |
| 1467 | 1467 | * |
| 1468 | 1468 | * @since 1.5.7 |
@@ -1471,516 +1471,516 @@ discard block |
||
| 1471 | 1471 | * @param string $uploads_url The server upload directory url. |
| 1472 | 1472 | * @param string $uploads_baseurl The uploads dir base url. |
| 1473 | 1473 | */ |
| 1474 | - $img_arr['src'] = apply_filters('geodir_get_images_src',$uploads_url . '/' . $file_name,$file_name,$uploads_url,$uploads_baseurl);
|
|
| 1475 | - $img_arr['path'] = $uploads_path . '/' . $file_name; |
|
| 1476 | - $width = 0; |
|
| 1477 | - $height = 0; |
|
| 1478 | - if (is_file($img_arr['path']) && file_exists($img_arr['path'])) {
|
|
| 1479 | - $imagesize = getimagesize($img_arr['path']); |
|
| 1480 | - $width = !empty($imagesize) && isset($imagesize[0]) ? $imagesize[0] : ''; |
|
| 1481 | - $height = !empty($imagesize) && isset($imagesize[1]) ? $imagesize[1] : ''; |
|
| 1482 | - } |
|
| 1483 | - $img_arr['width'] = $width; |
|
| 1484 | - $img_arr['height'] = $height; |
|
| 1485 | - |
|
| 1486 | - $img_arr['file'] = $file_name; // add the title to the array |
|
| 1487 | - $img_arr['title'] = $attechment->title; // add the title to the array |
|
| 1488 | - $img_arr['caption'] = isset($attechment->caption) ? $attechment->caption : ''; // add the caption to the array |
|
| 1489 | - $img_arr['content'] = $attechment->content; // add the description to the array |
|
| 1490 | - $img_arr['is_approved'] = isset($attechment->is_approved) ? $attechment->is_approved : ''; // used for user image moderation. For backward compatibility Default value is 1. |
|
| 1491 | - |
|
| 1492 | - $return_arr[] = (object)$img_arr; |
|
| 1493 | - |
|
| 1494 | - $counter++; |
|
| 1495 | - } |
|
| 1496 | - return (object)$return_arr; |
|
| 1497 | - } else if ($no_images) {
|
|
| 1498 | - $default_img = ''; |
|
| 1499 | - $default_cat = geodir_get_post_meta($post_id, 'default_category', true); |
|
| 1500 | - $post_type = get_post_type($post_id); |
|
| 1501 | - if ($default_catimg = geodir_get_default_catimage($default_cat, $post_type)) |
|
| 1502 | - $default_img = $default_catimg['src']; |
|
| 1503 | - elseif ($no_images) {
|
|
| 1504 | - $default_img = get_option('geodir_listing_no_img');
|
|
| 1505 | - } |
|
| 1506 | - |
|
| 1507 | - if (!empty($default_img)) {
|
|
| 1508 | - $uploads = wp_upload_dir(); // Array of key => value pairs |
|
| 1474 | + $img_arr['src'] = apply_filters('geodir_get_images_src',$uploads_url . '/' . $file_name,$file_name,$uploads_url,$uploads_baseurl);
|
|
| 1475 | + $img_arr['path'] = $uploads_path . '/' . $file_name; |
|
| 1476 | + $width = 0; |
|
| 1477 | + $height = 0; |
|
| 1478 | + if (is_file($img_arr['path']) && file_exists($img_arr['path'])) {
|
|
| 1479 | + $imagesize = getimagesize($img_arr['path']); |
|
| 1480 | + $width = !empty($imagesize) && isset($imagesize[0]) ? $imagesize[0] : ''; |
|
| 1481 | + $height = !empty($imagesize) && isset($imagesize[1]) ? $imagesize[1] : ''; |
|
| 1482 | + } |
|
| 1483 | + $img_arr['width'] = $width; |
|
| 1484 | + $img_arr['height'] = $height; |
|
| 1485 | + |
|
| 1486 | + $img_arr['file'] = $file_name; // add the title to the array |
|
| 1487 | + $img_arr['title'] = $attechment->title; // add the title to the array |
|
| 1488 | + $img_arr['caption'] = isset($attechment->caption) ? $attechment->caption : ''; // add the caption to the array |
|
| 1489 | + $img_arr['content'] = $attechment->content; // add the description to the array |
|
| 1490 | + $img_arr['is_approved'] = isset($attechment->is_approved) ? $attechment->is_approved : ''; // used for user image moderation. For backward compatibility Default value is 1. |
|
| 1491 | + |
|
| 1492 | + $return_arr[] = (object)$img_arr; |
|
| 1493 | + |
|
| 1494 | + $counter++; |
|
| 1495 | + } |
|
| 1496 | + return (object)$return_arr; |
|
| 1497 | + } else if ($no_images) {
|
|
| 1498 | + $default_img = ''; |
|
| 1499 | + $default_cat = geodir_get_post_meta($post_id, 'default_category', true); |
|
| 1500 | + $post_type = get_post_type($post_id); |
|
| 1501 | + if ($default_catimg = geodir_get_default_catimage($default_cat, $post_type)) |
|
| 1502 | + $default_img = $default_catimg['src']; |
|
| 1503 | + elseif ($no_images) {
|
|
| 1504 | + $default_img = get_option('geodir_listing_no_img');
|
|
| 1505 | + } |
|
| 1506 | + |
|
| 1507 | + if (!empty($default_img)) {
|
|
| 1508 | + $uploads = wp_upload_dir(); // Array of key => value pairs |
|
| 1509 | 1509 | |
| 1510 | - $image_path = $default_img; |
|
| 1511 | - if (!path_is_absolute($image_path)) {
|
|
| 1512 | - $image_path = str_replace($uploads['baseurl'], $uploads['basedir'], $image_path); |
|
| 1513 | - } |
|
| 1514 | - |
|
| 1515 | - $file_info = pathinfo($default_img); |
|
| 1516 | - $file_name = $file_info['basename']; |
|
| 1517 | - |
|
| 1518 | - $width = ''; |
|
| 1519 | - $height = ''; |
|
| 1520 | - if (is_file($image_path) && file_exists($image_path)) {
|
|
| 1521 | - $imagesize = getimagesize($image_path); |
|
| 1522 | - $width = !empty($imagesize) && isset($imagesize[0]) ? $imagesize[0] : ''; |
|
| 1523 | - $height = !empty($imagesize) && isset($imagesize[1]) ? $imagesize[1] : ''; |
|
| 1524 | - } |
|
| 1510 | + $image_path = $default_img; |
|
| 1511 | + if (!path_is_absolute($image_path)) {
|
|
| 1512 | + $image_path = str_replace($uploads['baseurl'], $uploads['basedir'], $image_path); |
|
| 1513 | + } |
|
| 1514 | + |
|
| 1515 | + $file_info = pathinfo($default_img); |
|
| 1516 | + $file_name = $file_info['basename']; |
|
| 1517 | + |
|
| 1518 | + $width = ''; |
|
| 1519 | + $height = ''; |
|
| 1520 | + if (is_file($image_path) && file_exists($image_path)) {
|
|
| 1521 | + $imagesize = getimagesize($image_path); |
|
| 1522 | + $width = !empty($imagesize) && isset($imagesize[0]) ? $imagesize[0] : ''; |
|
| 1523 | + $height = !empty($imagesize) && isset($imagesize[1]) ? $imagesize[1] : ''; |
|
| 1524 | + } |
|
| 1525 | 1525 | |
| 1526 | - $img_arr = array(); |
|
| 1527 | - $img_arr['src'] = $default_img; |
|
| 1528 | - $img_arr['path'] = $image_path; |
|
| 1529 | - $img_arr['width'] = $width; |
|
| 1530 | - $img_arr['height'] = $height; |
|
| 1531 | - $img_arr['file'] = $file_name; // add the title to the array |
|
| 1532 | - $img_arr['title'] = $file_info['filename']; // add the title to the array |
|
| 1533 | - $img_arr['content'] = $file_info['filename']; // add the description to the array |
|
| 1534 | - |
|
| 1535 | - $return_arr[] = (object)$img_arr; |
|
| 1536 | - |
|
| 1537 | - return $return_arr; |
|
| 1538 | - } else |
|
| 1539 | - return false; |
|
| 1540 | - } |
|
| 1541 | - } |
|
| 1526 | + $img_arr = array(); |
|
| 1527 | + $img_arr['src'] = $default_img; |
|
| 1528 | + $img_arr['path'] = $image_path; |
|
| 1529 | + $img_arr['width'] = $width; |
|
| 1530 | + $img_arr['height'] = $height; |
|
| 1531 | + $img_arr['file'] = $file_name; // add the title to the array |
|
| 1532 | + $img_arr['title'] = $file_info['filename']; // add the title to the array |
|
| 1533 | + $img_arr['content'] = $file_info['filename']; // add the description to the array |
|
| 1534 | + |
|
| 1535 | + $return_arr[] = (object)$img_arr; |
|
| 1536 | + |
|
| 1537 | + return $return_arr; |
|
| 1538 | + } else |
|
| 1539 | + return false; |
|
| 1540 | + } |
|
| 1541 | + } |
|
| 1542 | 1542 | } |
| 1543 | 1543 | |
| 1544 | 1544 | if (!function_exists('geodir_show_image')) {
|
| 1545 | - /** |
|
| 1546 | - * Show image using image details. |
|
| 1547 | - * |
|
| 1548 | - * @since 1.0.0 |
|
| 1549 | - * @package GeoDirectory |
|
| 1550 | - * @param array|object $request Image info either as an array or object. |
|
| 1551 | - * @param string $size Optional. Thumbnail size. Default: thumbnail. |
|
| 1552 | - * @param bool $no_image Optional. Do you want to return the default image when no image is available? Default: false. |
|
| 1553 | - * @param bool $echo Optional. Do you want to print it instead of returning it? Default: true. |
|
| 1554 | - * @return bool|string Returns image html. |
|
| 1555 | - */ |
|
| 1556 | - function geodir_show_image($request = array(), $size = 'thumbnail', $no_image = false, $echo = true) |
|
| 1557 | - {
|
|
| 1558 | - $image = new stdClass(); |
|
| 1559 | - |
|
| 1560 | - $html = ''; |
|
| 1561 | - if (!empty($request)) {
|
|
| 1562 | - if (!is_object($request)){
|
|
| 1563 | - $request = (object)$request; |
|
| 1564 | - } |
|
| 1565 | - |
|
| 1566 | - if (isset($request->src) && !isset($request->path)) {
|
|
| 1567 | - $request->path = $request->src; |
|
| 1568 | - } |
|
| 1569 | - |
|
| 1570 | - /* |
|
| 1545 | + /** |
|
| 1546 | + * Show image using image details. |
|
| 1547 | + * |
|
| 1548 | + * @since 1.0.0 |
|
| 1549 | + * @package GeoDirectory |
|
| 1550 | + * @param array|object $request Image info either as an array or object. |
|
| 1551 | + * @param string $size Optional. Thumbnail size. Default: thumbnail. |
|
| 1552 | + * @param bool $no_image Optional. Do you want to return the default image when no image is available? Default: false. |
|
| 1553 | + * @param bool $echo Optional. Do you want to print it instead of returning it? Default: true. |
|
| 1554 | + * @return bool|string Returns image html. |
|
| 1555 | + */ |
|
| 1556 | + function geodir_show_image($request = array(), $size = 'thumbnail', $no_image = false, $echo = true) |
|
| 1557 | + {
|
|
| 1558 | + $image = new stdClass(); |
|
| 1559 | + |
|
| 1560 | + $html = ''; |
|
| 1561 | + if (!empty($request)) {
|
|
| 1562 | + if (!is_object($request)){
|
|
| 1563 | + $request = (object)$request; |
|
| 1564 | + } |
|
| 1565 | + |
|
| 1566 | + if (isset($request->src) && !isset($request->path)) {
|
|
| 1567 | + $request->path = $request->src; |
|
| 1568 | + } |
|
| 1569 | + |
|
| 1570 | + /* |
|
| 1571 | 1571 | * getimagesize() works faster from path than url so we try and get path if we can. |
| 1572 | 1572 | */ |
| 1573 | - $upload_dir = wp_upload_dir(); |
|
| 1574 | - $img_no_http = str_replace(array("http://", "https://"), "", $request->path);
|
|
| 1575 | - $upload_no_http = str_replace(array("http://", "https://"), "", $upload_dir['baseurl']);
|
|
| 1576 | - if (strpos($img_no_http, $upload_no_http) !== false) {
|
|
| 1577 | - $request->path = str_replace( $img_no_http,$upload_dir['basedir'], $request->path); |
|
| 1578 | - } |
|
| 1573 | + $upload_dir = wp_upload_dir(); |
|
| 1574 | + $img_no_http = str_replace(array("http://", "https://"), "", $request->path);
|
|
| 1575 | + $upload_no_http = str_replace(array("http://", "https://"), "", $upload_dir['baseurl']);
|
|
| 1576 | + if (strpos($img_no_http, $upload_no_http) !== false) {
|
|
| 1577 | + $request->path = str_replace( $img_no_http,$upload_dir['basedir'], $request->path); |
|
| 1578 | + } |
|
| 1579 | 1579 | |
| 1580 | - $width = 0; |
|
| 1581 | - $height = 0; |
|
| 1582 | - if (is_file($request->path) && file_exists($request->path)) {
|
|
| 1583 | - $imagesize = getimagesize($request->path); |
|
| 1584 | - $width = !empty($imagesize) && isset($imagesize[0]) ? $imagesize[0] : ''; |
|
| 1585 | - $height = !empty($imagesize) && isset($imagesize[1]) ? $imagesize[1] : ''; |
|
| 1586 | - } |
|
| 1587 | - |
|
| 1588 | - $image->src = $request->src; |
|
| 1589 | - $image->width = $width; |
|
| 1590 | - $image->height = $height; |
|
| 1591 | - |
|
| 1592 | - $max_size = (object)geodir_get_imagesize($size); |
|
| 1593 | - |
|
| 1594 | - if (!is_wp_error($max_size)) {
|
|
| 1595 | - if ($image->width) {
|
|
| 1596 | - if ($image->height >= $image->width) {
|
|
| 1597 | - $width_per = round(((($image->width * ($max_size->h / $image->height)) / $max_size->w) * 100), 2); |
|
| 1598 | - } else if ($image->width < ($max_size->h)) {
|
|
| 1599 | - $width_per = round((($image->width / $max_size->w) * 100), 2); |
|
| 1600 | - } else |
|
| 1601 | - $width_per = 100; |
|
| 1602 | - } |
|
| 1603 | - |
|
| 1604 | - if (is_admin() && !isset($_REQUEST['geodir_ajax'])){
|
|
| 1605 | - $html = '<div class="geodir_thumbnail"><img style="max-height:' . $max_size->h . 'px;" alt="place image" src="' . $image->src . '" /></div>'; |
|
| 1606 | - } else {
|
|
| 1607 | - if($size=='widget-thumb' || !get_option('geodir_lazy_load',1)){
|
|
| 1608 | - $html = '<div class="geodir_thumbnail" style="background-image:url(\'' . $image->src . '\');"></div>'; |
|
| 1609 | - }else{
|
|
| 1610 | - //$html = '<div class="geodir_thumbnail" style="background-image:url(\'' . $image->src . '\');"></div>'; |
|
| 1611 | - //$html = '<div data-src="'.$image->src.'" class="geodir_thumbnail" ></div>'; |
|
| 1612 | - $html = '<div data-src="'.str_replace(' ','%20',$image->src).'" class="geodir_thumbnail geodir_lazy_load_thumbnail" ></div>';
|
|
| 1613 | - |
|
| 1614 | - } |
|
| 1615 | - |
|
| 1616 | - } |
|
| 1617 | - } |
|
| 1618 | - } |
|
| 1619 | - |
|
| 1620 | - if (!empty($html) && $echo) {
|
|
| 1621 | - echo $html; |
|
| 1622 | - } elseif (!empty($html)) {
|
|
| 1623 | - return $html; |
|
| 1624 | - } else |
|
| 1625 | - return false; |
|
| 1626 | - } |
|
| 1627 | -} |
|
| 1580 | + $width = 0; |
|
| 1581 | + $height = 0; |
|
| 1582 | + if (is_file($request->path) && file_exists($request->path)) {
|
|
| 1583 | + $imagesize = getimagesize($request->path); |
|
| 1584 | + $width = !empty($imagesize) && isset($imagesize[0]) ? $imagesize[0] : ''; |
|
| 1585 | + $height = !empty($imagesize) && isset($imagesize[1]) ? $imagesize[1] : ''; |
|
| 1586 | + } |
|
| 1628 | 1587 | |
| 1629 | -if (!function_exists('geodir_set_post_terms')) {
|
|
| 1630 | - /** |
|
| 1631 | - * Set post Categories. |
|
| 1632 | - * |
|
| 1633 | - * @since 1.0.0 |
|
| 1634 | - * @package GeoDirectory |
|
| 1635 | - * @global object $wpdb WordPress Database object. |
|
| 1636 | - * @global string $plugin_prefix Geodirectory plugin table prefix. |
|
| 1637 | - * @param int $post_id The post ID. |
|
| 1638 | - * @param array $terms An array of term objects. |
|
| 1639 | - * @param array $tt_ids An array of term taxonomy IDs. |
|
| 1640 | - * @param string $taxonomy Taxonomy slug. |
|
| 1641 | - */ |
|
| 1642 | - function geodir_set_post_terms($post_id, $terms, $tt_ids, $taxonomy) |
|
| 1643 | - {
|
|
| 1644 | - global $wpdb, $plugin_prefix; |
|
| 1588 | + $image->src = $request->src; |
|
| 1589 | + $image->width = $width; |
|
| 1590 | + $image->height = $height; |
|
| 1645 | 1591 | |
| 1646 | - $post_type = get_post_type($post_id); |
|
| 1592 | + $max_size = (object)geodir_get_imagesize($size); |
|
| 1647 | 1593 | |
| 1648 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 1594 | + if (!is_wp_error($max_size)) {
|
|
| 1595 | + if ($image->width) {
|
|
| 1596 | + if ($image->height >= $image->width) {
|
|
| 1597 | + $width_per = round(((($image->width * ($max_size->h / $image->height)) / $max_size->w) * 100), 2); |
|
| 1598 | + } else if ($image->width < ($max_size->h)) {
|
|
| 1599 | + $width_per = round((($image->width / $max_size->w) * 100), 2); |
|
| 1600 | + } else |
|
| 1601 | + $width_per = 100; |
|
| 1602 | + } |
|
| 1649 | 1603 | |
| 1650 | - if (in_array($post_type, geodir_get_posttypes()) && !wp_is_post_revision($post_id)) {
|
|
| 1604 | + if (is_admin() && !isset($_REQUEST['geodir_ajax'])){
|
|
| 1605 | + $html = '<div class="geodir_thumbnail"><img style="max-height:' . $max_size->h . 'px;" alt="place image" src="' . $image->src . '" /></div>'; |
|
| 1606 | + } else {
|
|
| 1607 | + if($size=='widget-thumb' || !get_option('geodir_lazy_load',1)){
|
|
| 1608 | + $html = '<div class="geodir_thumbnail" style="background-image:url(\'' . $image->src . '\');"></div>'; |
|
| 1609 | + }else{
|
|
| 1610 | + //$html = '<div class="geodir_thumbnail" style="background-image:url(\'' . $image->src . '\');"></div>'; |
|
| 1611 | + //$html = '<div data-src="'.$image->src.'" class="geodir_thumbnail" ></div>'; |
|
| 1612 | + $html = '<div data-src="'.str_replace(' ','%20',$image->src).'" class="geodir_thumbnail geodir_lazy_load_thumbnail" ></div>';
|
|
| 1613 | + |
|
| 1614 | + } |
|
| 1615 | + |
|
| 1616 | + } |
|
| 1617 | + } |
|
| 1618 | + } |
|
| 1619 | + |
|
| 1620 | + if (!empty($html) && $echo) {
|
|
| 1621 | + echo $html; |
|
| 1622 | + } elseif (!empty($html)) {
|
|
| 1623 | + return $html; |
|
| 1624 | + } else |
|
| 1625 | + return false; |
|
| 1626 | + } |
|
| 1627 | +} |
|
| 1651 | 1628 | |
| 1652 | - if ($taxonomy == $post_type . '_tags') {
|
|
| 1653 | - if (isset($_POST['action']) && $_POST['action'] == 'inline-save') {
|
|
| 1654 | - geodir_save_post_meta($post_id, 'post_tags', $terms); |
|
| 1655 | - } |
|
| 1656 | - } elseif ($taxonomy == $post_type . 'category') {
|
|
| 1657 | - $srcharr = array('"', '\\');
|
|
| 1658 | - $replarr = array(""", '');
|
|
| 1629 | +if (!function_exists('geodir_set_post_terms')) {
|
|
| 1630 | + /** |
|
| 1631 | + * Set post Categories. |
|
| 1632 | + * |
|
| 1633 | + * @since 1.0.0 |
|
| 1634 | + * @package GeoDirectory |
|
| 1635 | + * @global object $wpdb WordPress Database object. |
|
| 1636 | + * @global string $plugin_prefix Geodirectory plugin table prefix. |
|
| 1637 | + * @param int $post_id The post ID. |
|
| 1638 | + * @param array $terms An array of term objects. |
|
| 1639 | + * @param array $tt_ids An array of term taxonomy IDs. |
|
| 1640 | + * @param string $taxonomy Taxonomy slug. |
|
| 1641 | + */ |
|
| 1642 | + function geodir_set_post_terms($post_id, $terms, $tt_ids, $taxonomy) |
|
| 1643 | + {
|
|
| 1644 | + global $wpdb, $plugin_prefix; |
|
| 1645 | + |
|
| 1646 | + $post_type = get_post_type($post_id); |
|
| 1647 | + |
|
| 1648 | + $table = $plugin_prefix . $post_type . '_detail'; |
|
| 1649 | + |
|
| 1650 | + if (in_array($post_type, geodir_get_posttypes()) && !wp_is_post_revision($post_id)) {
|
|
| 1651 | + |
|
| 1652 | + if ($taxonomy == $post_type . '_tags') {
|
|
| 1653 | + if (isset($_POST['action']) && $_POST['action'] == 'inline-save') {
|
|
| 1654 | + geodir_save_post_meta($post_id, 'post_tags', $terms); |
|
| 1655 | + } |
|
| 1656 | + } elseif ($taxonomy == $post_type . 'category') {
|
|
| 1657 | + $srcharr = array('"', '\\');
|
|
| 1658 | + $replarr = array(""", '');
|
|
| 1659 | 1659 | |
| 1660 | - $post_obj = get_post($post_id); |
|
| 1660 | + $post_obj = get_post($post_id); |
|
| 1661 | 1661 | |
| 1662 | - $cat_ids = array('0');
|
|
| 1663 | - if (is_array($tt_ids)) |
|
| 1664 | - $cat_ids = $tt_ids; |
|
| 1662 | + $cat_ids = array('0');
|
|
| 1663 | + if (is_array($tt_ids)) |
|
| 1664 | + $cat_ids = $tt_ids; |
|
| 1665 | 1665 | |
| 1666 | 1666 | |
| 1667 | - if (!empty($cat_ids)) {
|
|
| 1668 | - $cat_ids_array = $cat_ids; |
|
| 1669 | - $cat_ids_length = count($cat_ids_array); |
|
| 1670 | - $cat_ids_format = array_fill(0, $cat_ids_length, '%d'); |
|
| 1671 | - $format = implode(',', $cat_ids_format);
|
|
| 1667 | + if (!empty($cat_ids)) {
|
|
| 1668 | + $cat_ids_array = $cat_ids; |
|
| 1669 | + $cat_ids_length = count($cat_ids_array); |
|
| 1670 | + $cat_ids_format = array_fill(0, $cat_ids_length, '%d'); |
|
| 1671 | + $format = implode(',', $cat_ids_format);
|
|
| 1672 | 1672 | |
| 1673 | - $cat_ids_array_del = $cat_ids_array; |
|
| 1674 | - $cat_ids_array_del[] = $post_id; |
|
| 1673 | + $cat_ids_array_del = $cat_ids_array; |
|
| 1674 | + $cat_ids_array_del[] = $post_id; |
|
| 1675 | 1675 | |
| 1676 | - $wpdb->get_var( |
|
| 1677 | - $wpdb->prepare( |
|
| 1678 | - "DELETE from " . GEODIR_ICON_TABLE . " WHERE cat_id NOT IN ($format) AND post_id = %d ", |
|
| 1679 | - $cat_ids_array_del |
|
| 1680 | - ) |
|
| 1681 | - ); |
|
| 1676 | + $wpdb->get_var( |
|
| 1677 | + $wpdb->prepare( |
|
| 1678 | + "DELETE from " . GEODIR_ICON_TABLE . " WHERE cat_id NOT IN ($format) AND post_id = %d ", |
|
| 1679 | + $cat_ids_array_del |
|
| 1680 | + ) |
|
| 1681 | + ); |
|
| 1682 | 1682 | |
| 1683 | 1683 | |
| 1684 | - $post_term = $wpdb->get_col( |
|
| 1685 | - $wpdb->prepare( |
|
| 1686 | - "SELECT term_id FROM " . $wpdb->term_taxonomy . " WHERE term_taxonomy_id IN($format) GROUP BY term_id", |
|
| 1687 | - $cat_ids_array |
|
| 1688 | - ) |
|
| 1689 | - ); |
|
| 1684 | + $post_term = $wpdb->get_col( |
|
| 1685 | + $wpdb->prepare( |
|
| 1686 | + "SELECT term_id FROM " . $wpdb->term_taxonomy . " WHERE term_taxonomy_id IN($format) GROUP BY term_id", |
|
| 1687 | + $cat_ids_array |
|
| 1688 | + ) |
|
| 1689 | + ); |
|
| 1690 | 1690 | |
| 1691 | - } |
|
| 1691 | + } |
|
| 1692 | 1692 | |
| 1693 | - $post_marker_json = ''; |
|
| 1693 | + $post_marker_json = ''; |
|
| 1694 | 1694 | |
| 1695 | - if (!empty($post_term)): |
|
| 1695 | + if (!empty($post_term)): |
|
| 1696 | 1696 | |
| 1697 | - foreach ($post_term as $cat_id): |
|
| 1697 | + foreach ($post_term as $cat_id): |
|
| 1698 | 1698 | |
| 1699 | - $term_icon_url = get_tax_meta($cat_id, 'ct_cat_icon', false, $post_type); |
|
| 1700 | - $term_icon = isset($term_icon_url['src']) ? $term_icon_url['src'] : ''; |
|
| 1699 | + $term_icon_url = get_tax_meta($cat_id, 'ct_cat_icon', false, $post_type); |
|
| 1700 | + $term_icon = isset($term_icon_url['src']) ? $term_icon_url['src'] : ''; |
|
| 1701 | 1701 | |
| 1702 | - $post_title = $post_obj->title; |
|
| 1703 | - $title = str_replace($srcharr, $replarr, $post_title); |
|
| 1702 | + $post_title = $post_obj->title; |
|
| 1703 | + $title = str_replace($srcharr, $replarr, $post_title); |
|
| 1704 | 1704 | |
| 1705 | - $lat = geodir_get_post_meta($post_id, 'post_latitude', true); |
|
| 1706 | - $lng = geodir_get_post_meta($post_id, 'post_longitude', true); |
|
| 1705 | + $lat = geodir_get_post_meta($post_id, 'post_latitude', true); |
|
| 1706 | + $lng = geodir_get_post_meta($post_id, 'post_longitude', true); |
|
| 1707 | 1707 | |
| 1708 | - $timing = ' - ' . date('D M j, Y', strtotime(geodir_get_post_meta($post_id, 'st_date', true)));
|
|
| 1709 | - $timing .= ' - ' . geodir_get_post_meta($post_id, 'st_time', true); |
|
| 1708 | + $timing = ' - ' . date('D M j, Y', strtotime(geodir_get_post_meta($post_id, 'st_date', true)));
|
|
| 1709 | + $timing .= ' - ' . geodir_get_post_meta($post_id, 'st_time', true); |
|
| 1710 | 1710 | |
| 1711 | - $json = '{';
|
|
| 1712 | - $json .= '"id":"' . $post_id . '",'; |
|
| 1713 | - $json .= '"lat_pos": "' . $lat . '",'; |
|
| 1714 | - $json .= '"long_pos": "' . $lng . '",'; |
|
| 1715 | - $json .= '"marker_id":"' . $post_id . '_' . $cat_id . '",'; |
|
| 1716 | - $json .= '"icon":"' . $term_icon . '",'; |
|
| 1717 | - $json .= '"group":"catgroup' . $cat_id . '"'; |
|
| 1718 | - $json .= '}'; |
|
| 1711 | + $json = '{';
|
|
| 1712 | + $json .= '"id":"' . $post_id . '",'; |
|
| 1713 | + $json .= '"lat_pos": "' . $lat . '",'; |
|
| 1714 | + $json .= '"long_pos": "' . $lng . '",'; |
|
| 1715 | + $json .= '"marker_id":"' . $post_id . '_' . $cat_id . '",'; |
|
| 1716 | + $json .= '"icon":"' . $term_icon . '",'; |
|
| 1717 | + $json .= '"group":"catgroup' . $cat_id . '"'; |
|
| 1718 | + $json .= '}'; |
|
| 1719 | 1719 | |
| 1720 | 1720 | |
| 1721 | - if ($cat_id == geodir_get_post_meta($post_id, 'default_category', true)) |
|
| 1722 | - $post_marker_json = $json; |
|
| 1721 | + if ($cat_id == geodir_get_post_meta($post_id, 'default_category', true)) |
|
| 1722 | + $post_marker_json = $json; |
|
| 1723 | 1723 | |
| 1724 | 1724 | |
| 1725 | - if ($wpdb->get_var($wpdb->prepare("SELECT post_id from " . GEODIR_ICON_TABLE . " WHERE post_id = %d AND cat_id = %d", array($post_id, $cat_id)))) {
|
|
| 1725 | + if ($wpdb->get_var($wpdb->prepare("SELECT post_id from " . GEODIR_ICON_TABLE . " WHERE post_id = %d AND cat_id = %d", array($post_id, $cat_id)))) {
|
|
| 1726 | 1726 | |
| 1727 | - $json_query = $wpdb->prepare("UPDATE " . GEODIR_ICON_TABLE . " SET
|
|
| 1727 | + $json_query = $wpdb->prepare("UPDATE " . GEODIR_ICON_TABLE . " SET
|
|
| 1728 | 1728 | post_title = %s, |
| 1729 | 1729 | json = %s |
| 1730 | 1730 | WHERE post_id = %d AND cat_id = %d ", |
| 1731 | - array($post_title, $json, $post_id, $cat_id)); |
|
| 1731 | + array($post_title, $json, $post_id, $cat_id)); |
|
| 1732 | 1732 | |
| 1733 | - } else {
|
|
| 1733 | + } else {
|
|
| 1734 | 1734 | |
| 1735 | - $json_query = $wpdb->prepare("INSERT INTO " . GEODIR_ICON_TABLE . " SET
|
|
| 1735 | + $json_query = $wpdb->prepare("INSERT INTO " . GEODIR_ICON_TABLE . " SET
|
|
| 1736 | 1736 | post_id = %d, |
| 1737 | 1737 | post_title = %s, |
| 1738 | 1738 | cat_id = %d, |
| 1739 | 1739 | json = %s", |
| 1740 | - array($post_id, $post_title, $cat_id, $json)); |
|
| 1740 | + array($post_id, $post_title, $cat_id, $json)); |
|
| 1741 | 1741 | |
| 1742 | - } |
|
| 1742 | + } |
|
| 1743 | 1743 | |
| 1744 | - $wpdb->query($json_query); |
|
| 1744 | + $wpdb->query($json_query); |
|
| 1745 | 1745 | |
| 1746 | - endforeach; |
|
| 1746 | + endforeach; |
|
| 1747 | 1747 | |
| 1748 | - endif; |
|
| 1748 | + endif; |
|
| 1749 | 1749 | |
| 1750 | - if (!empty($post_term) && is_array($post_term)) {
|
|
| 1751 | - $categories = implode(',', $post_term);
|
|
| 1750 | + if (!empty($post_term) && is_array($post_term)) {
|
|
| 1751 | + $categories = implode(',', $post_term);
|
|
| 1752 | 1752 | |
| 1753 | - if ($categories != '' && $categories != 0) $categories = ',' . $categories . ','; |
|
| 1753 | + if ($categories != '' && $categories != 0) $categories = ',' . $categories . ','; |
|
| 1754 | 1754 | |
| 1755 | - if (empty($post_marker_json)) |
|
| 1756 | - $post_marker_json = isset($json) ? $json : ''; |
|
| 1755 | + if (empty($post_marker_json)) |
|
| 1756 | + $post_marker_json = isset($json) ? $json : ''; |
|
| 1757 | 1757 | |
| 1758 | - if ($wpdb->get_var($wpdb->prepare("SELECT post_id from " . $table . " where post_id = %d", array($post_id)))) {
|
|
| 1758 | + if ($wpdb->get_var($wpdb->prepare("SELECT post_id from " . $table . " where post_id = %d", array($post_id)))) {
|
|
| 1759 | 1759 | |
| 1760 | - $wpdb->query( |
|
| 1761 | - $wpdb->prepare( |
|
| 1762 | - "UPDATE " . $table . " SET |
|
| 1760 | + $wpdb->query( |
|
| 1761 | + $wpdb->prepare( |
|
| 1762 | + "UPDATE " . $table . " SET |
|
| 1763 | 1763 | " . $taxonomy . " = %s, |
| 1764 | 1764 | marker_json = %s |
| 1765 | 1765 | where post_id = %d", |
| 1766 | - array($categories, $post_marker_json, $post_id) |
|
| 1767 | - ) |
|
| 1768 | - ); |
|
| 1766 | + array($categories, $post_marker_json, $post_id) |
|
| 1767 | + ) |
|
| 1768 | + ); |
|
| 1769 | 1769 | |
| 1770 | - if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'inline-save') {
|
|
| 1770 | + if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'inline-save') {
|
|
| 1771 | 1771 | |
| 1772 | - $categories = trim($categories, ','); |
|
| 1772 | + $categories = trim($categories, ','); |
|
| 1773 | 1773 | |
| 1774 | - if ($categories) {
|
|
| 1774 | + if ($categories) {
|
|
| 1775 | 1775 | |
| 1776 | - $categories = explode(',', $categories);
|
|
| 1776 | + $categories = explode(',', $categories);
|
|
| 1777 | 1777 | |
| 1778 | - $default_category = geodir_get_post_meta($post_id, 'default_category', true); |
|
| 1778 | + $default_category = geodir_get_post_meta($post_id, 'default_category', true); |
|
| 1779 | 1779 | |
| 1780 | - if (!in_array($default_category, $categories)) {
|
|
| 1780 | + if (!in_array($default_category, $categories)) {
|
|
| 1781 | 1781 | |
| 1782 | - $wpdb->query( |
|
| 1783 | - $wpdb->prepare( |
|
| 1784 | - "UPDATE " . $table . " SET |
|
| 1782 | + $wpdb->query( |
|
| 1783 | + $wpdb->prepare( |
|
| 1784 | + "UPDATE " . $table . " SET |
|
| 1785 | 1785 | default_category = %s |
| 1786 | 1786 | where post_id = %d", |
| 1787 | - array($categories[0], $post_id) |
|
| 1788 | - ) |
|
| 1789 | - ); |
|
| 1787 | + array($categories[0], $post_id) |
|
| 1788 | + ) |
|
| 1789 | + ); |
|
| 1790 | 1790 | |
| 1791 | - $default_category = $categories[0]; |
|
| 1791 | + $default_category = $categories[0]; |
|
| 1792 | 1792 | |
| 1793 | - } |
|
| 1793 | + } |
|
| 1794 | 1794 | |
| 1795 | - if ($default_category == '') |
|
| 1796 | - $default_category = $categories[0]; |
|
| 1795 | + if ($default_category == '') |
|
| 1796 | + $default_category = $categories[0]; |
|
| 1797 | 1797 | |
| 1798 | - geodir_set_postcat_structure($post_id, $taxonomy, $default_category, ''); |
|
| 1798 | + geodir_set_postcat_structure($post_id, $taxonomy, $default_category, ''); |
|
| 1799 | 1799 | |
| 1800 | - } |
|
| 1800 | + } |
|
| 1801 | 1801 | |
| 1802 | - } |
|
| 1802 | + } |
|
| 1803 | 1803 | |
| 1804 | 1804 | |
| 1805 | - } else {
|
|
| 1805 | + } else {
|
|
| 1806 | 1806 | |
| 1807 | - $wpdb->query( |
|
| 1808 | - $wpdb->prepare( |
|
| 1809 | - "INSERT INTO " . $table . " SET |
|
| 1807 | + $wpdb->query( |
|
| 1808 | + $wpdb->prepare( |
|
| 1809 | + "INSERT INTO " . $table . " SET |
|
| 1810 | 1810 | post_id = %d, |
| 1811 | 1811 | " . $taxonomy . " = %s, |
| 1812 | 1812 | marker_json = %s ", |
| 1813 | 1813 | |
| 1814 | - array($post_id, $categories, $post_marker_json) |
|
| 1815 | - ) |
|
| 1816 | - ); |
|
| 1817 | - } |
|
| 1818 | - } |
|
| 1819 | - } |
|
| 1820 | - } |
|
| 1821 | - } |
|
| 1814 | + array($post_id, $categories, $post_marker_json) |
|
| 1815 | + ) |
|
| 1816 | + ); |
|
| 1817 | + } |
|
| 1818 | + } |
|
| 1819 | + } |
|
| 1820 | + } |
|
| 1821 | + } |
|
| 1822 | 1822 | } |
| 1823 | 1823 | |
| 1824 | 1824 | if (!function_exists('geodir_get_infowindow_html')) {
|
| 1825 | - /** |
|
| 1826 | - * Set post Map Marker info html. |
|
| 1827 | - * |
|
| 1828 | - * @since 1.0.0 |
|
| 1829 | - * @since 1.5.4 Modified to add new action "geodir_infowindow_meta_before". |
|
| 1830 | - * @package GeoDirectory |
|
| 1831 | - * @global array $geodir_addon_list List of active GeoDirectory extensions. |
|
| 1832 | - * @global object $gd_session GeoDirectory Session object. |
|
| 1833 | - * @param object $postinfo_obj The post details object. |
|
| 1834 | - * @param string $post_preview Is this a post preview?. |
|
| 1835 | - * @return mixed|string|void |
|
| 1836 | - */ |
|
| 1837 | - function geodir_get_infowindow_html($postinfo_obj, $post_preview = '') |
|
| 1838 | - {
|
|
| 1839 | - global $preview, $gd_session; |
|
| 1840 | - $srcharr = array("'", "/", "-", '"', '\\');
|
|
| 1841 | - $replarr = array("′", "⁄", "–", "“", '');
|
|
| 1842 | - |
|
| 1843 | - if ($gd_session->get('listing') && isset($post_preview) && $post_preview != '') {
|
|
| 1844 | - $ID = ''; |
|
| 1845 | - $plink = ''; |
|
| 1846 | - |
|
| 1847 | - if (isset($postinfo_obj->pid)) {
|
|
| 1848 | - $ID = $postinfo_obj->pid; |
|
| 1849 | - $plink = get_permalink($ID); |
|
| 1850 | - } |
|
| 1851 | - |
|
| 1852 | - $title = str_replace($srcharr, $replarr, ($postinfo_obj->post_title)); |
|
| 1853 | - $lat = $postinfo_obj->post_latitude; |
|
| 1854 | - $lng = $postinfo_obj->post_longitude; |
|
| 1855 | - } else {
|
|
| 1856 | - $ID = $postinfo_obj->post_id; |
|
| 1857 | - $title = str_replace($srcharr, $replarr, htmlentities($postinfo_obj->post_title, ENT_COMPAT, 'UTF-8')); // fix by Stiofan |
|
| 1858 | - $plink = get_permalink($ID); |
|
| 1859 | - $lat = htmlentities(geodir_get_post_meta($ID, 'post_latitude', true)); |
|
| 1860 | - $lng = htmlentities(geodir_get_post_meta($ID, 'post_longitude', true)); |
|
| 1861 | - } |
|
| 1862 | - |
|
| 1863 | - // filter field as per price package |
|
| 1864 | - global $geodir_addon_list; |
|
| 1865 | - if (isset($geodir_addon_list['geodir_payment_manager']) && $geodir_addon_list['geodir_payment_manager'] == 'yes') {
|
|
| 1866 | - $post_type = get_post_type($ID); |
|
| 1867 | - $package_id = isset($postinfo_obj->package_id) && $postinfo_obj->package_id ? $postinfo_obj->package_id : NULL; |
|
| 1868 | - $field_name = 'geodir_contact'; |
|
| 1869 | - if (!check_field_visibility($package_id, $field_name, $post_type)) {
|
|
| 1870 | - $contact = ''; |
|
| 1871 | - } |
|
| 1872 | - |
|
| 1873 | - $field_name = 'geodir_timing'; |
|
| 1874 | - if (!check_field_visibility($package_id, $field_name, $post_type)) {
|
|
| 1875 | - $timing = ''; |
|
| 1876 | - } |
|
| 1877 | - } |
|
| 1878 | - |
|
| 1879 | - if ($lat && $lng) {
|
|
| 1880 | - ob_start(); ?> |
|
| 1825 | + /** |
|
| 1826 | + * Set post Map Marker info html. |
|
| 1827 | + * |
|
| 1828 | + * @since 1.0.0 |
|
| 1829 | + * @since 1.5.4 Modified to add new action "geodir_infowindow_meta_before". |
|
| 1830 | + * @package GeoDirectory |
|
| 1831 | + * @global array $geodir_addon_list List of active GeoDirectory extensions. |
|
| 1832 | + * @global object $gd_session GeoDirectory Session object. |
|
| 1833 | + * @param object $postinfo_obj The post details object. |
|
| 1834 | + * @param string $post_preview Is this a post preview?. |
|
| 1835 | + * @return mixed|string|void |
|
| 1836 | + */ |
|
| 1837 | + function geodir_get_infowindow_html($postinfo_obj, $post_preview = '') |
|
| 1838 | + {
|
|
| 1839 | + global $preview, $gd_session; |
|
| 1840 | + $srcharr = array("'", "/", "-", '"', '\\');
|
|
| 1841 | + $replarr = array("′", "⁄", "–", "“", '');
|
|
| 1842 | + |
|
| 1843 | + if ($gd_session->get('listing') && isset($post_preview) && $post_preview != '') {
|
|
| 1844 | + $ID = ''; |
|
| 1845 | + $plink = ''; |
|
| 1846 | + |
|
| 1847 | + if (isset($postinfo_obj->pid)) {
|
|
| 1848 | + $ID = $postinfo_obj->pid; |
|
| 1849 | + $plink = get_permalink($ID); |
|
| 1850 | + } |
|
| 1851 | + |
|
| 1852 | + $title = str_replace($srcharr, $replarr, ($postinfo_obj->post_title)); |
|
| 1853 | + $lat = $postinfo_obj->post_latitude; |
|
| 1854 | + $lng = $postinfo_obj->post_longitude; |
|
| 1855 | + } else {
|
|
| 1856 | + $ID = $postinfo_obj->post_id; |
|
| 1857 | + $title = str_replace($srcharr, $replarr, htmlentities($postinfo_obj->post_title, ENT_COMPAT, 'UTF-8')); // fix by Stiofan |
|
| 1858 | + $plink = get_permalink($ID); |
|
| 1859 | + $lat = htmlentities(geodir_get_post_meta($ID, 'post_latitude', true)); |
|
| 1860 | + $lng = htmlentities(geodir_get_post_meta($ID, 'post_longitude', true)); |
|
| 1861 | + } |
|
| 1862 | + |
|
| 1863 | + // filter field as per price package |
|
| 1864 | + global $geodir_addon_list; |
|
| 1865 | + if (isset($geodir_addon_list['geodir_payment_manager']) && $geodir_addon_list['geodir_payment_manager'] == 'yes') {
|
|
| 1866 | + $post_type = get_post_type($ID); |
|
| 1867 | + $package_id = isset($postinfo_obj->package_id) && $postinfo_obj->package_id ? $postinfo_obj->package_id : NULL; |
|
| 1868 | + $field_name = 'geodir_contact'; |
|
| 1869 | + if (!check_field_visibility($package_id, $field_name, $post_type)) {
|
|
| 1870 | + $contact = ''; |
|
| 1871 | + } |
|
| 1872 | + |
|
| 1873 | + $field_name = 'geodir_timing'; |
|
| 1874 | + if (!check_field_visibility($package_id, $field_name, $post_type)) {
|
|
| 1875 | + $timing = ''; |
|
| 1876 | + } |
|
| 1877 | + } |
|
| 1878 | + |
|
| 1879 | + if ($lat && $lng) {
|
|
| 1880 | + ob_start(); ?> |
|
| 1881 | 1881 | <div class="gd-bubble" style=""> |
| 1882 | 1882 | <div class="gd-bubble-inside"> |
| 1883 | 1883 | <?php |
| 1884 | - $comment_count = ''; |
|
| 1885 | - $rating_star = ''; |
|
| 1886 | - if ($ID != '') {
|
|
| 1887 | - $rating_star = ''; |
|
| 1888 | - $comment_count = geodir_get_review_count_total($ID); |
|
| 1889 | - |
|
| 1890 | - if (!$preview) {
|
|
| 1891 | - $post_avgratings = geodir_get_post_rating($ID); |
|
| 1892 | - |
|
| 1893 | - $rating_star = geodir_get_rating_stars($post_avgratings, $ID, false); |
|
| 1894 | - |
|
| 1895 | - /** |
|
| 1896 | - * Filter to change rating stars |
|
| 1897 | - * |
|
| 1898 | - * You can use this filter to change Rating stars. |
|
| 1899 | - * |
|
| 1900 | - * @since 1.0.0 |
|
| 1901 | - * @package GeoDirectory |
|
| 1902 | - * @param string $rating_star Rating stars. |
|
| 1903 | - * @param float $post_avgratings Average ratings of the post. |
|
| 1904 | - * @param int $ID The post ID. |
|
| 1905 | - */ |
|
| 1906 | - $rating_star = apply_filters('geodir_review_rating_stars_on_infowindow', $rating_star, $post_avgratings, $ID);
|
|
| 1907 | - } |
|
| 1908 | - } |
|
| 1909 | - ?> |
|
| 1884 | + $comment_count = ''; |
|
| 1885 | + $rating_star = ''; |
|
| 1886 | + if ($ID != '') {
|
|
| 1887 | + $rating_star = ''; |
|
| 1888 | + $comment_count = geodir_get_review_count_total($ID); |
|
| 1889 | + |
|
| 1890 | + if (!$preview) {
|
|
| 1891 | + $post_avgratings = geodir_get_post_rating($ID); |
|
| 1892 | + |
|
| 1893 | + $rating_star = geodir_get_rating_stars($post_avgratings, $ID, false); |
|
| 1894 | + |
|
| 1895 | + /** |
|
| 1896 | + * Filter to change rating stars |
|
| 1897 | + * |
|
| 1898 | + * You can use this filter to change Rating stars. |
|
| 1899 | + * |
|
| 1900 | + * @since 1.0.0 |
|
| 1901 | + * @package GeoDirectory |
|
| 1902 | + * @param string $rating_star Rating stars. |
|
| 1903 | + * @param float $post_avgratings Average ratings of the post. |
|
| 1904 | + * @param int $ID The post ID. |
|
| 1905 | + */ |
|
| 1906 | + $rating_star = apply_filters('geodir_review_rating_stars_on_infowindow', $rating_star, $post_avgratings, $ID);
|
|
| 1907 | + } |
|
| 1908 | + } |
|
| 1909 | + ?> |
|
| 1910 | 1910 | <div class="geodir-bubble_desc"> |
| 1911 | 1911 | <h4> |
| 1912 | 1912 | <a href="<?php if ($plink != '') {
|
| 1913 | - echo $plink; |
|
| 1914 | - } else {
|
|
| 1915 | - echo 'javascript:void(0);'; |
|
| 1916 | - } ?>"><?php echo $title; ?></a> |
|
| 1913 | + echo $plink; |
|
| 1914 | + } else {
|
|
| 1915 | + echo 'javascript:void(0);'; |
|
| 1916 | + } ?>"><?php echo $title; ?></a> |
|
| 1917 | 1917 | </h4> |
| 1918 | 1918 | <?php |
| 1919 | - if ($gd_session->get('listing') && isset($post_preview) && $post_preview != '') {
|
|
| 1920 | - $post_images = array(); |
|
| 1921 | - if (!empty($postinfo_obj->post_images)) {
|
|
| 1922 | - $post_images = explode(",", $postinfo_obj->post_images);
|
|
| 1923 | - } |
|
| 1924 | - |
|
| 1925 | - if (!empty($post_images)) {
|
|
| 1926 | - ?> |
|
| 1919 | + if ($gd_session->get('listing') && isset($post_preview) && $post_preview != '') {
|
|
| 1920 | + $post_images = array(); |
|
| 1921 | + if (!empty($postinfo_obj->post_images)) {
|
|
| 1922 | + $post_images = explode(",", $postinfo_obj->post_images);
|
|
| 1923 | + } |
|
| 1924 | + |
|
| 1925 | + if (!empty($post_images)) {
|
|
| 1926 | + ?> |
|
| 1927 | 1927 | <div class="geodir-bubble_image"><a href="<?php if ($plink != '') {
|
| 1928 | - echo $plink; |
|
| 1929 | - } else {
|
|
| 1930 | - echo 'javascript:void(0);'; |
|
| 1931 | - } ?>"><img alt="bubble image" style="max-height:50px;" |
|
| 1928 | + echo $plink; |
|
| 1929 | + } else {
|
|
| 1930 | + echo 'javascript:void(0);'; |
|
| 1931 | + } ?>"><img alt="bubble image" style="max-height:50px;" |
|
| 1932 | 1932 | src="<?php echo $post_images[0]; ?>"/></a></div> |
| 1933 | 1933 | <?php |
| 1934 | - }else{
|
|
| 1935 | - echo '<div class="geodir-bubble_image"></div>'; |
|
| 1936 | - } |
|
| 1937 | - } else {
|
|
| 1938 | - if ($image = geodir_show_featured_image($ID, 'widget-thumb', true, false, $postinfo_obj->featured_image)) {
|
|
| 1939 | - ?> |
|
| 1934 | + }else{
|
|
| 1935 | + echo '<div class="geodir-bubble_image"></div>'; |
|
| 1936 | + } |
|
| 1937 | + } else {
|
|
| 1938 | + if ($image = geodir_show_featured_image($ID, 'widget-thumb', true, false, $postinfo_obj->featured_image)) {
|
|
| 1939 | + ?> |
|
| 1940 | 1940 | <div class="geodir-bubble_image"><a href="<?php echo $plink; ?>"><?php echo $image; ?></a></div> |
| 1941 | 1941 | <?php |
| 1942 | - }else{
|
|
| 1943 | - echo '<div class="geodir-bubble_image"></div>'; |
|
| 1944 | - } |
|
| 1945 | - } |
|
| 1946 | - ?> |
|
| 1942 | + }else{
|
|
| 1943 | + echo '<div class="geodir-bubble_image"></div>'; |
|
| 1944 | + } |
|
| 1945 | + } |
|
| 1946 | + ?> |
|
| 1947 | 1947 | <div class="geodir-bubble-meta-side"> |
| 1948 | 1948 | <?php |
| 1949 | - /** |
|
| 1950 | - * Fires before the meta info in the map info window. |
|
| 1951 | - * |
|
| 1952 | - * This can be used to add more info to the map info window before the normal meta info. |
|
| 1953 | - * |
|
| 1954 | - * @since 1.5.4 |
|
| 1955 | - * @param int $ID The post id. |
|
| 1956 | - * @param object $postinfo_obj The posts info as an object. |
|
| 1957 | - * @param bool|string $post_preview True if currently in post preview page. Empty string if not. * |
|
| 1958 | - */ |
|
| 1959 | - do_action('geodir_infowindow_meta_before', $ID, $postinfo_obj, $post_preview);
|
|
| 1960 | - |
|
| 1961 | - |
|
| 1962 | - echo geodir_show_listing_info('mapbubble');
|
|
| 1949 | + /** |
|
| 1950 | + * Fires before the meta info in the map info window. |
|
| 1951 | + * |
|
| 1952 | + * This can be used to add more info to the map info window before the normal meta info. |
|
| 1953 | + * |
|
| 1954 | + * @since 1.5.4 |
|
| 1955 | + * @param int $ID The post id. |
|
| 1956 | + * @param object $postinfo_obj The posts info as an object. |
|
| 1957 | + * @param bool|string $post_preview True if currently in post preview page. Empty string if not. * |
|
| 1958 | + */ |
|
| 1959 | + do_action('geodir_infowindow_meta_before', $ID, $postinfo_obj, $post_preview);
|
|
| 1960 | + |
|
| 1961 | + |
|
| 1962 | + echo geodir_show_listing_info('mapbubble');
|
|
| 1963 | 1963 | |
| 1964 | 1964 | |
| 1965 | 1965 | |
| 1966 | - /** |
|
| 1967 | - * Fires after the meta info in the map info window. |
|
| 1968 | - * |
|
| 1969 | - * This can be used to add more info to the map info window after the normal meta info. |
|
| 1970 | - * |
|
| 1971 | - * @since 1.4.2 |
|
| 1972 | - * @param object $postinfo_obj The posts info as an object. |
|
| 1973 | - * @param bool|string $post_preview True if currently in post preview page. Empty string if not. * |
|
| 1974 | - */ |
|
| 1975 | - do_action('geodir_infowindow_meta_after',$postinfo_obj,$post_preview );
|
|
| 1976 | - ?> |
|
| 1966 | + /** |
|
| 1967 | + * Fires after the meta info in the map info window. |
|
| 1968 | + * |
|
| 1969 | + * This can be used to add more info to the map info window after the normal meta info. |
|
| 1970 | + * |
|
| 1971 | + * @since 1.4.2 |
|
| 1972 | + * @param object $postinfo_obj The posts info as an object. |
|
| 1973 | + * @param bool|string $post_preview True if currently in post preview page. Empty string if not. * |
|
| 1974 | + */ |
|
| 1975 | + do_action('geodir_infowindow_meta_after',$postinfo_obj,$post_preview );
|
|
| 1976 | + ?> |
|
| 1977 | 1977 | </div> |
| 1978 | 1978 | <?php |
| 1979 | 1979 | |
| 1980 | - if ($ID) {
|
|
| 1980 | + if ($ID) {
|
|
| 1981 | 1981 | |
| 1982 | - $post_author = isset($postinfo_obj->post_author) ? $postinfo_obj->post_author : get_post_field('post_author', $ID);
|
|
| 1983 | - ?> |
|
| 1982 | + $post_author = isset($postinfo_obj->post_author) ? $postinfo_obj->post_author : get_post_field('post_author', $ID);
|
|
| 1983 | + ?> |
|
| 1984 | 1984 | <div class="geodir-bubble-meta-fade"></div> |
| 1985 | 1985 | |
| 1986 | 1986 | <div class="geodir-bubble-meta-bottom"> |
@@ -2000,69 +2000,69 @@ discard block |
||
| 2000 | 2000 | </div> |
| 2001 | 2001 | </div> |
| 2002 | 2002 | <?php |
| 2003 | - $html = ob_get_clean(); |
|
| 2004 | - /** |
|
| 2005 | - * Filter to change infowindow html |
|
| 2006 | - * |
|
| 2007 | - * You can use this filter to change infowindow html. |
|
| 2008 | - * |
|
| 2009 | - * @since 1.0.0 |
|
| 2010 | - * @package GeoDirectory |
|
| 2011 | - * @param string $html Infowindow html. |
|
| 2012 | - * @param object $postinfo_obj The Post object. |
|
| 2013 | - * @param bool|string $post_preview Is this a post preview? |
|
| 2014 | - */ |
|
| 2015 | - $html = apply_filters('geodir_custom_infowindow_html', $html, $postinfo_obj, $post_preview);
|
|
| 2016 | - return $html; |
|
| 2017 | - } |
|
| 2018 | - } |
|
| 2003 | + $html = ob_get_clean(); |
|
| 2004 | + /** |
|
| 2005 | + * Filter to change infowindow html |
|
| 2006 | + * |
|
| 2007 | + * You can use this filter to change infowindow html. |
|
| 2008 | + * |
|
| 2009 | + * @since 1.0.0 |
|
| 2010 | + * @package GeoDirectory |
|
| 2011 | + * @param string $html Infowindow html. |
|
| 2012 | + * @param object $postinfo_obj The Post object. |
|
| 2013 | + * @param bool|string $post_preview Is this a post preview? |
|
| 2014 | + */ |
|
| 2015 | + $html = apply_filters('geodir_custom_infowindow_html', $html, $postinfo_obj, $post_preview);
|
|
| 2016 | + return $html; |
|
| 2017 | + } |
|
| 2018 | + } |
|
| 2019 | 2019 | } |
| 2020 | 2020 | |
| 2021 | 2021 | |
| 2022 | 2022 | if (!function_exists('geodir_new_post_default_status')) {
|
| 2023 | - /** |
|
| 2024 | - * Default post status for new posts. |
|
| 2025 | - * |
|
| 2026 | - * @since 1.0.0 |
|
| 2027 | - * @package GeoDirectory |
|
| 2028 | - * @return string Returns the default post status for new posts. Ex: draft, publish etc. |
|
| 2029 | - */ |
|
| 2030 | - function geodir_new_post_default_status() |
|
| 2031 | - {
|
|
| 2032 | - if (get_option('geodir_new_post_default_status'))
|
|
| 2033 | - return get_option('geodir_new_post_default_status');
|
|
| 2034 | - else |
|
| 2035 | - return 'publish'; |
|
| 2036 | - |
|
| 2037 | - } |
|
| 2023 | + /** |
|
| 2024 | + * Default post status for new posts. |
|
| 2025 | + * |
|
| 2026 | + * @since 1.0.0 |
|
| 2027 | + * @package GeoDirectory |
|
| 2028 | + * @return string Returns the default post status for new posts. Ex: draft, publish etc. |
|
| 2029 | + */ |
|
| 2030 | + function geodir_new_post_default_status() |
|
| 2031 | + {
|
|
| 2032 | + if (get_option('geodir_new_post_default_status'))
|
|
| 2033 | + return get_option('geodir_new_post_default_status');
|
|
| 2034 | + else |
|
| 2035 | + return 'publish'; |
|
| 2036 | + |
|
| 2037 | + } |
|
| 2038 | 2038 | } |
| 2039 | 2039 | |
| 2040 | 2040 | if (!function_exists('geodir_change_post_status')) {
|
| 2041 | - /** |
|
| 2042 | - * Change post status of a post. |
|
| 2043 | - * |
|
| 2044 | - * @global object $wpdb WordPress Database object. |
|
| 2045 | - * @global string $plugin_prefix Geodirectory plugin table prefix. |
|
| 2046 | - * @param int|string $post_id The post ID. |
|
| 2047 | - * @param string $status New post status. Ex: draft, publish etc. |
|
| 2048 | - */ |
|
| 2049 | - function geodir_change_post_status($post_id = '', $status = '') |
|
| 2050 | - {
|
|
| 2051 | - global $wpdb, $plugin_prefix; |
|
| 2052 | - |
|
| 2053 | - $post_type = get_post_type($post_id); |
|
| 2054 | - |
|
| 2055 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 2056 | - |
|
| 2057 | - $wpdb->query( |
|
| 2058 | - $wpdb->prepare( |
|
| 2059 | - "UPDATE " . $table . " SET post_status=%s WHERE post_id=%d", |
|
| 2060 | - array($status, $post_id) |
|
| 2061 | - ) |
|
| 2062 | - ); |
|
| 2063 | - |
|
| 2064 | - |
|
| 2065 | - } |
|
| 2041 | + /** |
|
| 2042 | + * Change post status of a post. |
|
| 2043 | + * |
|
| 2044 | + * @global object $wpdb WordPress Database object. |
|
| 2045 | + * @global string $plugin_prefix Geodirectory plugin table prefix. |
|
| 2046 | + * @param int|string $post_id The post ID. |
|
| 2047 | + * @param string $status New post status. Ex: draft, publish etc. |
|
| 2048 | + */ |
|
| 2049 | + function geodir_change_post_status($post_id = '', $status = '') |
|
| 2050 | + {
|
|
| 2051 | + global $wpdb, $plugin_prefix; |
|
| 2052 | + |
|
| 2053 | + $post_type = get_post_type($post_id); |
|
| 2054 | + |
|
| 2055 | + $table = $plugin_prefix . $post_type . '_detail'; |
|
| 2056 | + |
|
| 2057 | + $wpdb->query( |
|
| 2058 | + $wpdb->prepare( |
|
| 2059 | + "UPDATE " . $table . " SET post_status=%s WHERE post_id=%d", |
|
| 2060 | + array($status, $post_id) |
|
| 2061 | + ) |
|
| 2062 | + ); |
|
| 2063 | + |
|
| 2064 | + |
|
| 2065 | + } |
|
| 2066 | 2066 | } |
| 2067 | 2067 | |
| 2068 | 2068 | /** |
@@ -2076,13 +2076,13 @@ discard block |
||
| 2076 | 2076 | */ |
| 2077 | 2077 | function geodir_set_post_status($pid, $status) |
| 2078 | 2078 | {
|
| 2079 | - if ($pid) {
|
|
| 2080 | - global $wpdb; |
|
| 2081 | - $my_post = array(); |
|
| 2082 | - $my_post['post_status'] = $status; |
|
| 2083 | - $my_post['ID'] = $pid; |
|
| 2084 | - $last_postid = wp_update_post($my_post); |
|
| 2085 | - } |
|
| 2079 | + if ($pid) {
|
|
| 2080 | + global $wpdb; |
|
| 2081 | + $my_post = array(); |
|
| 2082 | + $my_post['post_status'] = $status; |
|
| 2083 | + $my_post['ID'] = $pid; |
|
| 2084 | + $last_postid = wp_update_post($my_post); |
|
| 2085 | + } |
|
| 2086 | 2086 | } |
| 2087 | 2087 | |
| 2088 | 2088 | |
@@ -2098,384 +2098,384 @@ discard block |
||
| 2098 | 2098 | */ |
| 2099 | 2099 | function geodir_update_poststatus($new_status, $old_status, $post) |
| 2100 | 2100 | {
|
| 2101 | - global $wpdb; |
|
| 2101 | + global $wpdb; |
|
| 2102 | 2102 | |
| 2103 | - $geodir_posttypes = geodir_get_posttypes(); |
|
| 2103 | + $geodir_posttypes = geodir_get_posttypes(); |
|
| 2104 | 2104 | |
| 2105 | - if (!wp_is_post_revision($post->ID) && in_array($post->post_type, $geodir_posttypes)) {
|
|
| 2105 | + if (!wp_is_post_revision($post->ID) && in_array($post->post_type, $geodir_posttypes)) {
|
|
| 2106 | 2106 | |
| 2107 | - geodir_change_post_status($post->ID, $new_status); |
|
| 2108 | - } |
|
| 2107 | + geodir_change_post_status($post->ID, $new_status); |
|
| 2108 | + } |
|
| 2109 | 2109 | } |
| 2110 | 2110 | |
| 2111 | 2111 | |
| 2112 | 2112 | if (!function_exists('geodir_update_listing_info')) {
|
| 2113 | - /** |
|
| 2114 | - * Update post info. |
|
| 2115 | - * |
|
| 2116 | - * @since 1.0.0 |
|
| 2117 | - * @package GeoDirectory |
|
| 2118 | - * @global object $wpdb WordPress Database object. |
|
| 2119 | - * @global string $plugin_prefix Geodirectory plugin table prefix. |
|
| 2120 | - * @param int $updatingpost The updating post ID. |
|
| 2121 | - * @param int $temppost The temporary post ID. |
|
| 2122 | - * @todo fix post_id variable |
|
| 2123 | - */ |
|
| 2124 | - function geodir_update_listing_info($updatingpost, $temppost) |
|
| 2125 | - {
|
|
| 2126 | - |
|
| 2127 | - global $wpdb, $plugin_prefix; |
|
| 2128 | - |
|
| 2129 | - $post_type = get_post_type($post_id); |
|
| 2130 | - |
|
| 2131 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 2132 | - |
|
| 2133 | - $wpdb->query( |
|
| 2134 | - $wpdb->prepare( |
|
| 2135 | - "UPDATE " . $table . " SET `post_id` = %d WHERE `post_id` = %d", |
|
| 2136 | - array($updatingpost, $temppost) |
|
| 2137 | - ) |
|
| 2138 | - ); |
|
| 2139 | - |
|
| 2140 | - $wpdb->query( |
|
| 2141 | - $wpdb->prepare( |
|
| 2142 | - "UPDATE " . GEODIR_ICON_TABLE . " SET `post_id` = %d WHERE `post_id` = %d", |
|
| 2143 | - array($updatingpost, $temppost) |
|
| 2144 | - ) |
|
| 2145 | - ); |
|
| 2146 | - |
|
| 2147 | - /* Update Attachments*/ |
|
| 2148 | - |
|
| 2149 | - $wpdb->query( |
|
| 2150 | - $wpdb->prepare( |
|
| 2151 | - "UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET `post_id` = %d WHERE `post_id` = %d", |
|
| 2152 | - array($updatingpost, $temppost) |
|
| 2153 | - ) |
|
| 2154 | - ); |
|
| 2155 | - |
|
| 2156 | - } |
|
| 2113 | + /** |
|
| 2114 | + * Update post info. |
|
| 2115 | + * |
|
| 2116 | + * @since 1.0.0 |
|
| 2117 | + * @package GeoDirectory |
|
| 2118 | + * @global object $wpdb WordPress Database object. |
|
| 2119 | + * @global string $plugin_prefix Geodirectory plugin table prefix. |
|
| 2120 | + * @param int $updatingpost The updating post ID. |
|
| 2121 | + * @param int $temppost The temporary post ID. |
|
| 2122 | + * @todo fix post_id variable |
|
| 2123 | + */ |
|
| 2124 | + function geodir_update_listing_info($updatingpost, $temppost) |
|
| 2125 | + {
|
|
| 2126 | + |
|
| 2127 | + global $wpdb, $plugin_prefix; |
|
| 2128 | + |
|
| 2129 | + $post_type = get_post_type($post_id); |
|
| 2130 | + |
|
| 2131 | + $table = $plugin_prefix . $post_type . '_detail'; |
|
| 2132 | + |
|
| 2133 | + $wpdb->query( |
|
| 2134 | + $wpdb->prepare( |
|
| 2135 | + "UPDATE " . $table . " SET `post_id` = %d WHERE `post_id` = %d", |
|
| 2136 | + array($updatingpost, $temppost) |
|
| 2137 | + ) |
|
| 2138 | + ); |
|
| 2139 | + |
|
| 2140 | + $wpdb->query( |
|
| 2141 | + $wpdb->prepare( |
|
| 2142 | + "UPDATE " . GEODIR_ICON_TABLE . " SET `post_id` = %d WHERE `post_id` = %d", |
|
| 2143 | + array($updatingpost, $temppost) |
|
| 2144 | + ) |
|
| 2145 | + ); |
|
| 2146 | + |
|
| 2147 | + /* Update Attachments*/ |
|
| 2148 | + |
|
| 2149 | + $wpdb->query( |
|
| 2150 | + $wpdb->prepare( |
|
| 2151 | + "UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET `post_id` = %d WHERE `post_id` = %d", |
|
| 2152 | + array($updatingpost, $temppost) |
|
| 2153 | + ) |
|
| 2154 | + ); |
|
| 2155 | + |
|
| 2156 | + } |
|
| 2157 | 2157 | } |
| 2158 | 2158 | |
| 2159 | 2159 | |
| 2160 | 2160 | if (!function_exists('geodir_delete_listing_info')) {
|
| 2161 | - /** |
|
| 2162 | - * Delete Listing info from details table for the given post id. |
|
| 2163 | - * |
|
| 2164 | - * @since 1.0.0 |
|
| 2165 | - * @package GeoDirectory |
|
| 2166 | - * @global object $wpdb WordPress Database object. |
|
| 2167 | - * @global string $plugin_prefix Geodirectory plugin table prefix. |
|
| 2168 | - * @param int $deleted_postid The post ID. |
|
| 2169 | - * @param bool $force Optional. Do you want to force delete it? Default: false. |
|
| 2170 | - * @return bool|void |
|
| 2171 | - */ |
|
| 2172 | - function geodir_delete_listing_info($deleted_postid, $force = false) |
|
| 2173 | - {
|
|
| 2174 | - global $wpdb, $plugin_prefix; |
|
| 2175 | - |
|
| 2176 | - // check for multisite deletions |
|
| 2177 | - if (strpos($plugin_prefix, $wpdb->prefix) !== false) {
|
|
| 2178 | - } else {
|
|
| 2179 | - return; |
|
| 2180 | - } |
|
| 2181 | - |
|
| 2182 | - $post_type = get_post_type($deleted_postid); |
|
| 2183 | - |
|
| 2184 | - $all_postypes = geodir_get_posttypes(); |
|
| 2185 | - |
|
| 2186 | - if (!in_array($post_type, $all_postypes)) |
|
| 2187 | - return false; |
|
| 2188 | - |
|
| 2189 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 2190 | - |
|
| 2191 | - /* Delete custom post meta*/ |
|
| 2192 | - $wpdb->query( |
|
| 2193 | - $wpdb->prepare( |
|
| 2194 | - "DELETE FROM " . $table . " WHERE `post_id` = %d", |
|
| 2195 | - array($deleted_postid) |
|
| 2196 | - ) |
|
| 2197 | - ); |
|
| 2198 | - |
|
| 2199 | - /* Delete post map icons*/ |
|
| 2200 | - |
|
| 2201 | - $wpdb->query( |
|
| 2202 | - $wpdb->prepare( |
|
| 2203 | - "DELETE FROM " . GEODIR_ICON_TABLE . " WHERE `post_id` = %d", |
|
| 2204 | - array($deleted_postid) |
|
| 2205 | - ) |
|
| 2206 | - ); |
|
| 2207 | - |
|
| 2208 | - /* Delete Attachments*/ |
|
| 2209 | - $postcurr_images = geodir_get_images($deleted_postid); |
|
| 2210 | - |
|
| 2211 | - $wpdb->query( |
|
| 2212 | - $wpdb->prepare( |
|
| 2213 | - "DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE `post_id` = %d", |
|
| 2214 | - array($deleted_postid) |
|
| 2215 | - ) |
|
| 2216 | - ); |
|
| 2217 | - geodir_remove_attachments($postcurr_images); |
|
| 2218 | - |
|
| 2219 | - } |
|
| 2161 | + /** |
|
| 2162 | + * Delete Listing info from details table for the given post id. |
|
| 2163 | + * |
|
| 2164 | + * @since 1.0.0 |
|
| 2165 | + * @package GeoDirectory |
|
| 2166 | + * @global object $wpdb WordPress Database object. |
|
| 2167 | + * @global string $plugin_prefix Geodirectory plugin table prefix. |
|
| 2168 | + * @param int $deleted_postid The post ID. |
|
| 2169 | + * @param bool $force Optional. Do you want to force delete it? Default: false. |
|
| 2170 | + * @return bool|void |
|
| 2171 | + */ |
|
| 2172 | + function geodir_delete_listing_info($deleted_postid, $force = false) |
|
| 2173 | + {
|
|
| 2174 | + global $wpdb, $plugin_prefix; |
|
| 2175 | + |
|
| 2176 | + // check for multisite deletions |
|
| 2177 | + if (strpos($plugin_prefix, $wpdb->prefix) !== false) {
|
|
| 2178 | + } else {
|
|
| 2179 | + return; |
|
| 2180 | + } |
|
| 2181 | + |
|
| 2182 | + $post_type = get_post_type($deleted_postid); |
|
| 2183 | + |
|
| 2184 | + $all_postypes = geodir_get_posttypes(); |
|
| 2185 | + |
|
| 2186 | + if (!in_array($post_type, $all_postypes)) |
|
| 2187 | + return false; |
|
| 2188 | + |
|
| 2189 | + $table = $plugin_prefix . $post_type . '_detail'; |
|
| 2190 | + |
|
| 2191 | + /* Delete custom post meta*/ |
|
| 2192 | + $wpdb->query( |
|
| 2193 | + $wpdb->prepare( |
|
| 2194 | + "DELETE FROM " . $table . " WHERE `post_id` = %d", |
|
| 2195 | + array($deleted_postid) |
|
| 2196 | + ) |
|
| 2197 | + ); |
|
| 2198 | + |
|
| 2199 | + /* Delete post map icons*/ |
|
| 2200 | + |
|
| 2201 | + $wpdb->query( |
|
| 2202 | + $wpdb->prepare( |
|
| 2203 | + "DELETE FROM " . GEODIR_ICON_TABLE . " WHERE `post_id` = %d", |
|
| 2204 | + array($deleted_postid) |
|
| 2205 | + ) |
|
| 2206 | + ); |
|
| 2207 | + |
|
| 2208 | + /* Delete Attachments*/ |
|
| 2209 | + $postcurr_images = geodir_get_images($deleted_postid); |
|
| 2210 | + |
|
| 2211 | + $wpdb->query( |
|
| 2212 | + $wpdb->prepare( |
|
| 2213 | + "DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE `post_id` = %d", |
|
| 2214 | + array($deleted_postid) |
|
| 2215 | + ) |
|
| 2216 | + ); |
|
| 2217 | + geodir_remove_attachments($postcurr_images); |
|
| 2218 | + |
|
| 2219 | + } |
|
| 2220 | 2220 | } |
| 2221 | 2221 | |
| 2222 | 2222 | |
| 2223 | 2223 | if (!function_exists('geodir_add_to_favorite')) {
|
| 2224 | - /** |
|
| 2225 | - * This function would add listing to favorite listing. |
|
| 2226 | - * |
|
| 2227 | - * @since 1.0.0 |
|
| 2228 | - * @package GeoDirectory |
|
| 2229 | - * @global object $current_user Current user object. |
|
| 2230 | - * @param int $post_id The post ID. |
|
| 2231 | - */ |
|
| 2232 | - function geodir_add_to_favorite($post_id) |
|
| 2233 | - {
|
|
| 2234 | - |
|
| 2235 | - global $current_user; |
|
| 2236 | - |
|
| 2237 | - /** |
|
| 2238 | - * Filter to modify "Unfavorite" text |
|
| 2239 | - * |
|
| 2240 | - * You can use this filter to rename "Unfavorite" text to something else. |
|
| 2241 | - * |
|
| 2242 | - * @since 1.0.0 |
|
| 2243 | - * @package GeoDirectory |
|
| 2244 | - */ |
|
| 2245 | - $remove_favourite_text = apply_filters('geodir_remove_favourite_text', REMOVE_FAVOURITE_TEXT);
|
|
| 2246 | - |
|
| 2247 | - /** |
|
| 2248 | - * Filter to modify "Remove from Favorites" text |
|
| 2249 | - * |
|
| 2250 | - * You can use this filter to rename "Remove from Favorites" text to something else. |
|
| 2251 | - * |
|
| 2252 | - * @since 1.0.0 |
|
| 2253 | - * @package GeoDirectory |
|
| 2254 | - */ |
|
| 2255 | - $unfavourite_text = apply_filters('geodir_unfavourite_text', UNFAVOURITE_TEXT);
|
|
| 2256 | - |
|
| 2257 | - /** |
|
| 2258 | - * Filter to modify "fa fa-heart" icon |
|
| 2259 | - * |
|
| 2260 | - * You can use this filter to change "fa fa-heart" icon to something else. |
|
| 2261 | - * |
|
| 2262 | - * @since 1.0.0 |
|
| 2263 | - * @package GeoDirectory |
|
| 2264 | - */ |
|
| 2265 | - $favourite_icon = apply_filters('geodir_favourite_icon', 'fa fa-heart');
|
|
| 2224 | + /** |
|
| 2225 | + * This function would add listing to favorite listing. |
|
| 2226 | + * |
|
| 2227 | + * @since 1.0.0 |
|
| 2228 | + * @package GeoDirectory |
|
| 2229 | + * @global object $current_user Current user object. |
|
| 2230 | + * @param int $post_id The post ID. |
|
| 2231 | + */ |
|
| 2232 | + function geodir_add_to_favorite($post_id) |
|
| 2233 | + {
|
|
| 2234 | + |
|
| 2235 | + global $current_user; |
|
| 2236 | + |
|
| 2237 | + /** |
|
| 2238 | + * Filter to modify "Unfavorite" text |
|
| 2239 | + * |
|
| 2240 | + * You can use this filter to rename "Unfavorite" text to something else. |
|
| 2241 | + * |
|
| 2242 | + * @since 1.0.0 |
|
| 2243 | + * @package GeoDirectory |
|
| 2244 | + */ |
|
| 2245 | + $remove_favourite_text = apply_filters('geodir_remove_favourite_text', REMOVE_FAVOURITE_TEXT);
|
|
| 2246 | + |
|
| 2247 | + /** |
|
| 2248 | + * Filter to modify "Remove from Favorites" text |
|
| 2249 | + * |
|
| 2250 | + * You can use this filter to rename "Remove from Favorites" text to something else. |
|
| 2251 | + * |
|
| 2252 | + * @since 1.0.0 |
|
| 2253 | + * @package GeoDirectory |
|
| 2254 | + */ |
|
| 2255 | + $unfavourite_text = apply_filters('geodir_unfavourite_text', UNFAVOURITE_TEXT);
|
|
| 2256 | + |
|
| 2257 | + /** |
|
| 2258 | + * Filter to modify "fa fa-heart" icon |
|
| 2259 | + * |
|
| 2260 | + * You can use this filter to change "fa fa-heart" icon to something else. |
|
| 2261 | + * |
|
| 2262 | + * @since 1.0.0 |
|
| 2263 | + * @package GeoDirectory |
|
| 2264 | + */ |
|
| 2265 | + $favourite_icon = apply_filters('geodir_favourite_icon', 'fa fa-heart');
|
|
| 2266 | + |
|
| 2267 | + $user_meta_data = array(); |
|
| 2268 | + $user_meta_data = get_user_meta($current_user->data->ID, 'gd_user_favourite_post', true); |
|
| 2269 | + |
|
| 2270 | + if (empty($user_meta_data) || (!empty($user_meta_data) && !in_array($post_id, $user_meta_data))) {
|
|
| 2271 | + $user_meta_data[] = $post_id; |
|
| 2272 | + } |
|
| 2273 | + |
|
| 2274 | + update_user_meta($current_user->data->ID, 'gd_user_favourite_post', $user_meta_data); |
|
| 2275 | + |
|
| 2276 | + /** |
|
| 2277 | + * Called before adding the post from favourites. |
|
| 2278 | + * |
|
| 2279 | + * @since 1.0.0 |
|
| 2280 | + * @package GeoDirectory |
|
| 2281 | + * @param int $post_id The post ID. |
|
| 2282 | + */ |
|
| 2283 | + do_action('geodir_before_add_from_favorite', $post_id);
|
|
| 2284 | + |
|
| 2285 | + echo '<a href="javascript:void(0);" title="' . $remove_favourite_text . '" class="geodir-removetofav-icon" onclick="javascript:addToFavourite(\'' . $post_id . '\',\'remove\');"><i class="'. $favourite_icon .'"></i> ' . $unfavourite_text . '</a>'; |
|
| 2286 | + |
|
| 2287 | + /** |
|
| 2288 | + * Called after adding the post from favourites. |
|
| 2289 | + * |
|
| 2290 | + * @since 1.0.0 |
|
| 2291 | + * @package GeoDirectory |
|
| 2292 | + * @param int $post_id The post ID. |
|
| 2293 | + */ |
|
| 2294 | + do_action('geodir_after_add_from_favorite', $post_id);
|
|
| 2266 | 2295 | |
| 2267 | - $user_meta_data = array(); |
|
| 2268 | - $user_meta_data = get_user_meta($current_user->data->ID, 'gd_user_favourite_post', true); |
|
| 2269 | - |
|
| 2270 | - if (empty($user_meta_data) || (!empty($user_meta_data) && !in_array($post_id, $user_meta_data))) {
|
|
| 2271 | - $user_meta_data[] = $post_id; |
|
| 2272 | - } |
|
| 2273 | - |
|
| 2274 | - update_user_meta($current_user->data->ID, 'gd_user_favourite_post', $user_meta_data); |
|
| 2275 | - |
|
| 2276 | - /** |
|
| 2277 | - * Called before adding the post from favourites. |
|
| 2278 | - * |
|
| 2279 | - * @since 1.0.0 |
|
| 2280 | - * @package GeoDirectory |
|
| 2281 | - * @param int $post_id The post ID. |
|
| 2282 | - */ |
|
| 2283 | - do_action('geodir_before_add_from_favorite', $post_id);
|
|
| 2284 | - |
|
| 2285 | - echo '<a href="javascript:void(0);" title="' . $remove_favourite_text . '" class="geodir-removetofav-icon" onclick="javascript:addToFavourite(\'' . $post_id . '\',\'remove\');"><i class="'. $favourite_icon .'"></i> ' . $unfavourite_text . '</a>'; |
|
| 2286 | - |
|
| 2287 | - /** |
|
| 2288 | - * Called after adding the post from favourites. |
|
| 2289 | - * |
|
| 2290 | - * @since 1.0.0 |
|
| 2291 | - * @package GeoDirectory |
|
| 2292 | - * @param int $post_id The post ID. |
|
| 2293 | - */ |
|
| 2294 | - do_action('geodir_after_add_from_favorite', $post_id);
|
|
| 2295 | - |
|
| 2296 | - } |
|
| 2296 | + } |
|
| 2297 | 2297 | } |
| 2298 | 2298 | |
| 2299 | 2299 | if (!function_exists('geodir_remove_from_favorite')) {
|
| 2300 | - /** |
|
| 2301 | - * This function would remove the favourited property earlier. |
|
| 2302 | - * |
|
| 2303 | - * @since 1.0.0 |
|
| 2304 | - * @package GeoDirectory |
|
| 2305 | - * @global object $current_user Current user object. |
|
| 2306 | - * @param int $post_id The post ID. |
|
| 2307 | - */ |
|
| 2308 | - function geodir_remove_from_favorite($post_id) |
|
| 2309 | - {
|
|
| 2310 | - global $current_user; |
|
| 2311 | - |
|
| 2312 | - /** |
|
| 2313 | - * Filter to modify "Add to Favorites" text |
|
| 2314 | - * |
|
| 2315 | - * You can use this filter to rename "Add to Favorites" text to something else. |
|
| 2316 | - * |
|
| 2317 | - * @since 1.0.0 |
|
| 2318 | - * @package GeoDirectory |
|
| 2319 | - */ |
|
| 2320 | - $add_favourite_text = apply_filters('geodir_add_favourite_text', ADD_FAVOURITE_TEXT);
|
|
| 2321 | - |
|
| 2322 | - /** |
|
| 2323 | - * Filter to modify "Favourite" text |
|
| 2324 | - * |
|
| 2325 | - * You can use this filter to rename "Favourite" text to something else. |
|
| 2326 | - * |
|
| 2327 | - * @since 1.0.0 |
|
| 2328 | - * @package GeoDirectory |
|
| 2329 | - */ |
|
| 2330 | - $favourite_text = apply_filters('geodir_favourite_text', FAVOURITE_TEXT);
|
|
| 2331 | - |
|
| 2332 | - /** |
|
| 2333 | - * Filter to modify "fa fa-heart" icon |
|
| 2334 | - * |
|
| 2335 | - * You can use this filter to change "fa fa-heart" icon to something else. |
|
| 2336 | - * |
|
| 2337 | - * @since 1.0.0 |
|
| 2338 | - * @package GeoDirectory |
|
| 2339 | - */ |
|
| 2340 | - $favourite_icon = apply_filters('geodir_favourite_icon', 'fa fa-heart');
|
|
| 2341 | - |
|
| 2342 | - $user_meta_data = array(); |
|
| 2343 | - $user_meta_data = get_user_meta($current_user->data->ID, 'gd_user_favourite_post', true); |
|
| 2344 | - |
|
| 2345 | - if (!empty($user_meta_data)) {
|
|
| 2300 | + /** |
|
| 2301 | + * This function would remove the favourited property earlier. |
|
| 2302 | + * |
|
| 2303 | + * @since 1.0.0 |
|
| 2304 | + * @package GeoDirectory |
|
| 2305 | + * @global object $current_user Current user object. |
|
| 2306 | + * @param int $post_id The post ID. |
|
| 2307 | + */ |
|
| 2308 | + function geodir_remove_from_favorite($post_id) |
|
| 2309 | + {
|
|
| 2310 | + global $current_user; |
|
| 2311 | + |
|
| 2312 | + /** |
|
| 2313 | + * Filter to modify "Add to Favorites" text |
|
| 2314 | + * |
|
| 2315 | + * You can use this filter to rename "Add to Favorites" text to something else. |
|
| 2316 | + * |
|
| 2317 | + * @since 1.0.0 |
|
| 2318 | + * @package GeoDirectory |
|
| 2319 | + */ |
|
| 2320 | + $add_favourite_text = apply_filters('geodir_add_favourite_text', ADD_FAVOURITE_TEXT);
|
|
| 2321 | + |
|
| 2322 | + /** |
|
| 2323 | + * Filter to modify "Favourite" text |
|
| 2324 | + * |
|
| 2325 | + * You can use this filter to rename "Favourite" text to something else. |
|
| 2326 | + * |
|
| 2327 | + * @since 1.0.0 |
|
| 2328 | + * @package GeoDirectory |
|
| 2329 | + */ |
|
| 2330 | + $favourite_text = apply_filters('geodir_favourite_text', FAVOURITE_TEXT);
|
|
| 2331 | + |
|
| 2332 | + /** |
|
| 2333 | + * Filter to modify "fa fa-heart" icon |
|
| 2334 | + * |
|
| 2335 | + * You can use this filter to change "fa fa-heart" icon to something else. |
|
| 2336 | + * |
|
| 2337 | + * @since 1.0.0 |
|
| 2338 | + * @package GeoDirectory |
|
| 2339 | + */ |
|
| 2340 | + $favourite_icon = apply_filters('geodir_favourite_icon', 'fa fa-heart');
|
|
| 2341 | + |
|
| 2342 | + $user_meta_data = array(); |
|
| 2343 | + $user_meta_data = get_user_meta($current_user->data->ID, 'gd_user_favourite_post', true); |
|
| 2344 | + |
|
| 2345 | + if (!empty($user_meta_data)) {
|
|
| 2346 | + |
|
| 2347 | + if (($key = array_search($post_id, $user_meta_data)) !== false) {
|
|
| 2348 | + unset($user_meta_data[$key]); |
|
| 2349 | + } |
|
| 2346 | 2350 | |
| 2347 | - if (($key = array_search($post_id, $user_meta_data)) !== false) {
|
|
| 2348 | - unset($user_meta_data[$key]); |
|
| 2349 | - } |
|
| 2351 | + } |
|
| 2350 | 2352 | |
| 2351 | - } |
|
| 2353 | + update_user_meta($current_user->data->ID, 'gd_user_favourite_post', $user_meta_data); |
|
| 2352 | 2354 | |
| 2353 | - update_user_meta($current_user->data->ID, 'gd_user_favourite_post', $user_meta_data); |
|
| 2355 | + /** |
|
| 2356 | + * Called before removing the post from favourites. |
|
| 2357 | + * |
|
| 2358 | + * @since 1.0.0 |
|
| 2359 | + * @package GeoDirectory |
|
| 2360 | + * @param int $post_id The post ID. |
|
| 2361 | + */ |
|
| 2362 | + do_action('geodir_before_remove_from_favorite', $post_id);
|
|
| 2354 | 2363 | |
| 2355 | - /** |
|
| 2356 | - * Called before removing the post from favourites. |
|
| 2357 | - * |
|
| 2358 | - * @since 1.0.0 |
|
| 2359 | - * @package GeoDirectory |
|
| 2360 | - * @param int $post_id The post ID. |
|
| 2361 | - */ |
|
| 2362 | - do_action('geodir_before_remove_from_favorite', $post_id);
|
|
| 2364 | + echo '<a href="javascript:void(0);" title="' . $add_favourite_text . '" class="geodir-addtofav-icon" onclick="javascript:addToFavourite(\'' . $post_id . '\',\'add\');"><i class="'. $favourite_icon .'"></i> ' . $favourite_text . '</a>'; |
|
| 2363 | 2365 | |
| 2364 | - echo '<a href="javascript:void(0);" title="' . $add_favourite_text . '" class="geodir-addtofav-icon" onclick="javascript:addToFavourite(\'' . $post_id . '\',\'add\');"><i class="'. $favourite_icon .'"></i> ' . $favourite_text . '</a>'; |
|
| 2366 | + /** |
|
| 2367 | + * Called after removing the post from favourites. |
|
| 2368 | + * |
|
| 2369 | + * @since 1.0.0 |
|
| 2370 | + * @package GeoDirectory |
|
| 2371 | + * @param int $post_id The post ID. |
|
| 2372 | + */ |
|
| 2373 | + do_action('geodir_after_remove_from_favorite', $post_id);
|
|
| 2365 | 2374 | |
| 2366 | - /** |
|
| 2367 | - * Called after removing the post from favourites. |
|
| 2368 | - * |
|
| 2369 | - * @since 1.0.0 |
|
| 2370 | - * @package GeoDirectory |
|
| 2371 | - * @param int $post_id The post ID. |
|
| 2372 | - */ |
|
| 2373 | - do_action('geodir_after_remove_from_favorite', $post_id);
|
|
| 2374 | - |
|
| 2375 | - } |
|
| 2375 | + } |
|
| 2376 | 2376 | } |
| 2377 | 2377 | |
| 2378 | 2378 | if (!function_exists('geodir_favourite_html')) {
|
| 2379 | - /** |
|
| 2380 | - * This function would display the html content for add to favorite or remove from favorite. |
|
| 2381 | - * |
|
| 2382 | - * @since 1.0.0 |
|
| 2383 | - * @package GeoDirectory |
|
| 2384 | - * @global object $current_user Current user object. |
|
| 2385 | - * @global object $post The current post object. |
|
| 2386 | - * @param int $user_id The user ID. |
|
| 2387 | - * @param int $post_id The post ID. |
|
| 2388 | - */ |
|
| 2389 | - function geodir_favourite_html($user_id, $post_id) |
|
| 2390 | - {
|
|
| 2391 | - |
|
| 2392 | - global $current_user, $post; |
|
| 2393 | - |
|
| 2394 | - /** |
|
| 2395 | - * Filter to modify "Add to Favorites" text |
|
| 2396 | - * |
|
| 2397 | - * You can use this filter to rename "Add to Favorites" text to something else. |
|
| 2398 | - * |
|
| 2399 | - * @since 1.0.0 |
|
| 2400 | - * @package GeoDirectory |
|
| 2401 | - */ |
|
| 2402 | - $add_favourite_text = apply_filters('geodir_add_favourite_text', ADD_FAVOURITE_TEXT);
|
|
| 2403 | - |
|
| 2404 | - /** |
|
| 2405 | - * Filter to modify "Favourite" text |
|
| 2406 | - * |
|
| 2407 | - * You can use this filter to rename "Favourite" text to something else. |
|
| 2408 | - * |
|
| 2409 | - * @since 1.0.0 |
|
| 2410 | - * @package GeoDirectory |
|
| 2411 | - */ |
|
| 2412 | - $favourite_text = apply_filters('geodir_favourite_text', FAVOURITE_TEXT);
|
|
| 2413 | - |
|
| 2414 | - /** |
|
| 2415 | - * Filter to modify "Unfavorite" text |
|
| 2416 | - * |
|
| 2417 | - * You can use this filter to rename "Unfavorite" text to something else. |
|
| 2418 | - * |
|
| 2419 | - * @since 1.0.0 |
|
| 2420 | - * @package GeoDirectory |
|
| 2421 | - */ |
|
| 2422 | - $remove_favourite_text = apply_filters('geodir_remove_favourite_text', REMOVE_FAVOURITE_TEXT);
|
|
| 2423 | - |
|
| 2424 | - /** |
|
| 2425 | - * Filter to modify "Remove from Favorites" text |
|
| 2426 | - * |
|
| 2427 | - * You can use this filter to rename "Remove from Favorites" text to something else. |
|
| 2428 | - * |
|
| 2429 | - * @since 1.0.0 |
|
| 2430 | - * @package GeoDirectory |
|
| 2431 | - */ |
|
| 2432 | - $unfavourite_text = apply_filters('geodir_unfavourite_text', UNFAVOURITE_TEXT);
|
|
| 2433 | - |
|
| 2434 | - /** |
|
| 2435 | - * Filter to modify "fa fa-heart" icon |
|
| 2436 | - * |
|
| 2437 | - * You can use this filter to change "fa fa-heart" icon to something else. |
|
| 2438 | - * |
|
| 2439 | - * @since 1.0.0 |
|
| 2440 | - * @package GeoDirectory |
|
| 2441 | - */ |
|
| 2442 | - $favourite_icon = apply_filters('geodir_favourite_icon', 'fa fa-heart');
|
|
| 2443 | - |
|
| 2444 | - /** |
|
| 2445 | - * Filter to modify "fa fa-heart" icon for "remove from favorites" link |
|
| 2446 | - * |
|
| 2447 | - * You can use this filter to change "fa fa-heart" icon to something else. |
|
| 2448 | - * |
|
| 2449 | - * @since 1.0.0 |
|
| 2450 | - * @package GeoDirectory |
|
| 2451 | - */ |
|
| 2452 | - $unfavourite_icon = apply_filters('geodir_unfavourite_icon', 'fa fa-heart');
|
|
| 2453 | - |
|
| 2454 | - $user_meta_data = ''; |
|
| 2455 | - if (isset($current_user->data->ID)) |
|
| 2456 | - $user_meta_data = get_user_meta($current_user->data->ID, 'gd_user_favourite_post', true); |
|
| 2457 | - |
|
| 2458 | - if (!empty($user_meta_data) && in_array($post_id, $user_meta_data)) {
|
|
| 2459 | - ?><span class="geodir-addtofav favorite_property_<?php echo $post_id;?>" ><a |
|
| 2379 | + /** |
|
| 2380 | + * This function would display the html content for add to favorite or remove from favorite. |
|
| 2381 | + * |
|
| 2382 | + * @since 1.0.0 |
|
| 2383 | + * @package GeoDirectory |
|
| 2384 | + * @global object $current_user Current user object. |
|
| 2385 | + * @global object $post The current post object. |
|
| 2386 | + * @param int $user_id The user ID. |
|
| 2387 | + * @param int $post_id The post ID. |
|
| 2388 | + */ |
|
| 2389 | + function geodir_favourite_html($user_id, $post_id) |
|
| 2390 | + {
|
|
| 2391 | + |
|
| 2392 | + global $current_user, $post; |
|
| 2393 | + |
|
| 2394 | + /** |
|
| 2395 | + * Filter to modify "Add to Favorites" text |
|
| 2396 | + * |
|
| 2397 | + * You can use this filter to rename "Add to Favorites" text to something else. |
|
| 2398 | + * |
|
| 2399 | + * @since 1.0.0 |
|
| 2400 | + * @package GeoDirectory |
|
| 2401 | + */ |
|
| 2402 | + $add_favourite_text = apply_filters('geodir_add_favourite_text', ADD_FAVOURITE_TEXT);
|
|
| 2403 | + |
|
| 2404 | + /** |
|
| 2405 | + * Filter to modify "Favourite" text |
|
| 2406 | + * |
|
| 2407 | + * You can use this filter to rename "Favourite" text to something else. |
|
| 2408 | + * |
|
| 2409 | + * @since 1.0.0 |
|
| 2410 | + * @package GeoDirectory |
|
| 2411 | + */ |
|
| 2412 | + $favourite_text = apply_filters('geodir_favourite_text', FAVOURITE_TEXT);
|
|
| 2413 | + |
|
| 2414 | + /** |
|
| 2415 | + * Filter to modify "Unfavorite" text |
|
| 2416 | + * |
|
| 2417 | + * You can use this filter to rename "Unfavorite" text to something else. |
|
| 2418 | + * |
|
| 2419 | + * @since 1.0.0 |
|
| 2420 | + * @package GeoDirectory |
|
| 2421 | + */ |
|
| 2422 | + $remove_favourite_text = apply_filters('geodir_remove_favourite_text', REMOVE_FAVOURITE_TEXT);
|
|
| 2423 | + |
|
| 2424 | + /** |
|
| 2425 | + * Filter to modify "Remove from Favorites" text |
|
| 2426 | + * |
|
| 2427 | + * You can use this filter to rename "Remove from Favorites" text to something else. |
|
| 2428 | + * |
|
| 2429 | + * @since 1.0.0 |
|
| 2430 | + * @package GeoDirectory |
|
| 2431 | + */ |
|
| 2432 | + $unfavourite_text = apply_filters('geodir_unfavourite_text', UNFAVOURITE_TEXT);
|
|
| 2433 | + |
|
| 2434 | + /** |
|
| 2435 | + * Filter to modify "fa fa-heart" icon |
|
| 2436 | + * |
|
| 2437 | + * You can use this filter to change "fa fa-heart" icon to something else. |
|
| 2438 | + * |
|
| 2439 | + * @since 1.0.0 |
|
| 2440 | + * @package GeoDirectory |
|
| 2441 | + */ |
|
| 2442 | + $favourite_icon = apply_filters('geodir_favourite_icon', 'fa fa-heart');
|
|
| 2443 | + |
|
| 2444 | + /** |
|
| 2445 | + * Filter to modify "fa fa-heart" icon for "remove from favorites" link |
|
| 2446 | + * |
|
| 2447 | + * You can use this filter to change "fa fa-heart" icon to something else. |
|
| 2448 | + * |
|
| 2449 | + * @since 1.0.0 |
|
| 2450 | + * @package GeoDirectory |
|
| 2451 | + */ |
|
| 2452 | + $unfavourite_icon = apply_filters('geodir_unfavourite_icon', 'fa fa-heart');
|
|
| 2453 | + |
|
| 2454 | + $user_meta_data = ''; |
|
| 2455 | + if (isset($current_user->data->ID)) |
|
| 2456 | + $user_meta_data = get_user_meta($current_user->data->ID, 'gd_user_favourite_post', true); |
|
| 2457 | + |
|
| 2458 | + if (!empty($user_meta_data) && in_array($post_id, $user_meta_data)) {
|
|
| 2459 | + ?><span class="geodir-addtofav favorite_property_<?php echo $post_id;?>" ><a |
|
| 2460 | 2460 | class="geodir-removetofav-icon" href="javascript:void(0);" |
| 2461 | 2461 | onclick="javascript:addToFavourite(<?php echo $post_id;?>,'remove');" |
| 2462 | 2462 | title="<?php echo $remove_favourite_text;?>"><i class="<?php echo $unfavourite_icon; ?>"></i> <?php echo $unfavourite_text;?> |
| 2463 | 2463 | </a> </span><?php |
| 2464 | 2464 | |
| 2465 | - } else {
|
|
| 2465 | + } else {
|
|
| 2466 | 2466 | |
| 2467 | - if (!isset($current_user->data->ID) || $current_user->data->ID == '') {
|
|
| 2468 | - $script_text = 'javascript:window.location.href=\'' . geodir_login_url() . '\''; |
|
| 2469 | - } else |
|
| 2470 | - $script_text = 'javascript:addToFavourite(' . $post_id . ',\'add\')';
|
|
| 2467 | + if (!isset($current_user->data->ID) || $current_user->data->ID == '') {
|
|
| 2468 | + $script_text = 'javascript:window.location.href=\'' . geodir_login_url() . '\''; |
|
| 2469 | + } else |
|
| 2470 | + $script_text = 'javascript:addToFavourite(' . $post_id . ',\'add\')';
|
|
| 2471 | 2471 | |
| 2472 | - ?><span class="geodir-addtofav favorite_property_<?php echo $post_id;?>"><a class="geodir-addtofav-icon" |
|
| 2472 | + ?><span class="geodir-addtofav favorite_property_<?php echo $post_id;?>"><a class="geodir-addtofav-icon" |
|
| 2473 | 2473 | href="javascript:void(0);" |
| 2474 | 2474 | onclick="<?php echo $script_text;?>" |
| 2475 | 2475 | title="<?php echo $add_favourite_text;?>"><i |
| 2476 | 2476 | class="<?php echo $favourite_icon; ?>"></i> <?php echo $favourite_text;?></a></span> |
| 2477 | 2477 | <?php } |
| 2478 | - } |
|
| 2478 | + } |
|
| 2479 | 2479 | } |
| 2480 | 2480 | |
| 2481 | 2481 | |
@@ -2492,54 +2492,54 @@ discard block |
||
| 2492 | 2492 | function geodir_get_cat_postcount($term = array()) |
| 2493 | 2493 | {
|
| 2494 | 2494 | |
| 2495 | - if (!empty($term)) {
|
|
| 2495 | + if (!empty($term)) {
|
|
| 2496 | 2496 | |
| 2497 | - global $wpdb, $plugin_prefix; |
|
| 2497 | + global $wpdb, $plugin_prefix; |
|
| 2498 | 2498 | |
| 2499 | - $where = ''; |
|
| 2500 | - $join = ''; |
|
| 2501 | - if (get_query_var('gd_country') != '' || get_query_var('gd_region') != '' || get_query_var('gd_city') != '') {
|
|
| 2502 | - $taxonomy_obj = get_taxonomy($term->taxonomy); |
|
| 2499 | + $where = ''; |
|
| 2500 | + $join = ''; |
|
| 2501 | + if (get_query_var('gd_country') != '' || get_query_var('gd_region') != '' || get_query_var('gd_city') != '') {
|
|
| 2502 | + $taxonomy_obj = get_taxonomy($term->taxonomy); |
|
| 2503 | 2503 | |
| 2504 | - $post_type = $taxonomy_obj->object_type[0]; |
|
| 2504 | + $post_type = $taxonomy_obj->object_type[0]; |
|
| 2505 | 2505 | |
| 2506 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 2506 | + $table = $plugin_prefix . $post_type . '_detail'; |
|
| 2507 | 2507 | |
| 2508 | - /** |
|
| 2509 | - * Filter to modify the 'join' query |
|
| 2510 | - * |
|
| 2511 | - * @since 1.0.0 |
|
| 2512 | - * @package GeoDirectory |
|
| 2513 | - * @param object|array $term category / term object that need to be processed. |
|
| 2514 | - * @param string $join The join query. |
|
| 2515 | - */ |
|
| 2516 | - $join = apply_filters('geodir_cat_post_count_join', $join, $term);
|
|
| 2508 | + /** |
|
| 2509 | + * Filter to modify the 'join' query |
|
| 2510 | + * |
|
| 2511 | + * @since 1.0.0 |
|
| 2512 | + * @package GeoDirectory |
|
| 2513 | + * @param object|array $term category / term object that need to be processed. |
|
| 2514 | + * @param string $join The join query. |
|
| 2515 | + */ |
|
| 2516 | + $join = apply_filters('geodir_cat_post_count_join', $join, $term);
|
|
| 2517 | 2517 | |
| 2518 | - /** |
|
| 2519 | - * Filter to modify the 'where' query |
|
| 2520 | - * |
|
| 2521 | - * @since 1.0.0 |
|
| 2522 | - * @package GeoDirectory |
|
| 2523 | - * @param object|array $term category / term object that need to be processed. |
|
| 2524 | - * @param string $where The where query. |
|
| 2525 | - */ |
|
| 2526 | - $where = apply_filters('geodir_cat_post_count_where', $where, $term);
|
|
| 2518 | + /** |
|
| 2519 | + * Filter to modify the 'where' query |
|
| 2520 | + * |
|
| 2521 | + * @since 1.0.0 |
|
| 2522 | + * @package GeoDirectory |
|
| 2523 | + * @param object|array $term category / term object that need to be processed. |
|
| 2524 | + * @param string $where The where query. |
|
| 2525 | + */ |
|
| 2526 | + $where = apply_filters('geodir_cat_post_count_where', $where, $term);
|
|
| 2527 | 2527 | |
| 2528 | - $count_query = "SELECT count(post_id) FROM |
|
| 2528 | + $count_query = "SELECT count(post_id) FROM |
|
| 2529 | 2529 | " . $table . " as pd " . $join . " |
| 2530 | 2530 | WHERE pd.post_status='publish' AND FIND_IN_SET('" . $term->term_id . "'," . $term->taxonomy . ") " . $where;
|
| 2531 | 2531 | |
| 2532 | - $cat_post_count = $wpdb->get_var($count_query); |
|
| 2533 | - if (empty($cat_post_count) || is_wp_error($cat_post_count)) |
|
| 2534 | - $cat_post_count = 0; |
|
| 2532 | + $cat_post_count = $wpdb->get_var($count_query); |
|
| 2533 | + if (empty($cat_post_count) || is_wp_error($cat_post_count)) |
|
| 2534 | + $cat_post_count = 0; |
|
| 2535 | 2535 | |
| 2536 | - return $cat_post_count; |
|
| 2536 | + return $cat_post_count; |
|
| 2537 | 2537 | |
| 2538 | - } else |
|
| 2538 | + } else |
|
| 2539 | 2539 | |
| 2540 | - return $term->count; |
|
| 2541 | - } |
|
| 2542 | - return false; |
|
| 2540 | + return $term->count; |
|
| 2541 | + } |
|
| 2542 | + return false; |
|
| 2543 | 2543 | |
| 2544 | 2544 | } |
| 2545 | 2545 | |
@@ -2552,17 +2552,17 @@ discard block |
||
| 2552 | 2552 | */ |
| 2553 | 2553 | function geodir_allow_post_type_frontend() |
| 2554 | 2554 | {
|
| 2555 | - $geodir_allow_posttype_frontend = get_option('geodir_allow_posttype_frontend');
|
|
| 2555 | + $geodir_allow_posttype_frontend = get_option('geodir_allow_posttype_frontend');
|
|
| 2556 | 2556 | |
| 2557 | - if (!is_admin() && isset($_REQUEST['listing_type']) |
|
| 2558 | - && !empty($geodir_allow_posttype_frontend) |
|
| 2559 | - && !in_array($_REQUEST['listing_type'], $geodir_allow_posttype_frontend) |
|
| 2560 | - ) {
|
|
| 2557 | + if (!is_admin() && isset($_REQUEST['listing_type']) |
|
| 2558 | + && !empty($geodir_allow_posttype_frontend) |
|
| 2559 | + && !in_array($_REQUEST['listing_type'], $geodir_allow_posttype_frontend) |
|
| 2560 | + ) {
|
|
| 2561 | 2561 | |
| 2562 | - wp_redirect(home_url()); |
|
| 2563 | - exit; |
|
| 2562 | + wp_redirect(home_url()); |
|
| 2563 | + exit; |
|
| 2564 | 2564 | |
| 2565 | - } |
|
| 2565 | + } |
|
| 2566 | 2566 | |
| 2567 | 2567 | } |
| 2568 | 2568 | |
@@ -2579,20 +2579,20 @@ discard block |
||
| 2579 | 2579 | */ |
| 2580 | 2580 | function geodir_excerpt_length($length) |
| 2581 | 2581 | {
|
| 2582 | - global $wp_query, $geodir_is_widget_listing; |
|
| 2582 | + global $wp_query, $geodir_is_widget_listing; |
|
| 2583 | 2583 | if ($geodir_is_widget_listing) {
|
| 2584 | 2584 | return $length; |
| 2585 | 2585 | } |
| 2586 | 2586 | |
| 2587 | - if (isset($wp_query->query_vars['is_geodir_loop']) && $wp_query->query_vars['is_geodir_loop'] && get_option('geodir_desc_word_limit'))
|
|
| 2588 | - $length = get_option('geodir_desc_word_limit');
|
|
| 2589 | - elseif (get_query_var('excerpt_length'))
|
|
| 2590 | - $length = get_query_var('excerpt_length');
|
|
| 2587 | + if (isset($wp_query->query_vars['is_geodir_loop']) && $wp_query->query_vars['is_geodir_loop'] && get_option('geodir_desc_word_limit'))
|
|
| 2588 | + $length = get_option('geodir_desc_word_limit');
|
|
| 2589 | + elseif (get_query_var('excerpt_length'))
|
|
| 2590 | + $length = get_query_var('excerpt_length');
|
|
| 2591 | 2591 | |
| 2592 | - if (geodir_is_page('author') && get_option('geodir_author_desc_word_limit'))
|
|
| 2593 | - $length = get_option('geodir_author_desc_word_limit');
|
|
| 2592 | + if (geodir_is_page('author') && get_option('geodir_author_desc_word_limit'))
|
|
| 2593 | + $length = get_option('geodir_author_desc_word_limit');
|
|
| 2594 | 2594 | |
| 2595 | - return $length; |
|
| 2595 | + return $length; |
|
| 2596 | 2596 | } |
| 2597 | 2597 | |
| 2598 | 2598 | /** |
@@ -2607,13 +2607,13 @@ discard block |
||
| 2607 | 2607 | */ |
| 2608 | 2608 | function geodir_excerpt_more($more) |
| 2609 | 2609 | {
|
| 2610 | - global $post; |
|
| 2611 | - $all_postypes = geodir_get_posttypes(); |
|
| 2612 | - if (is_array($all_postypes) && in_array($post->post_type, $all_postypes)) {
|
|
| 2613 | - return ' <a href="' . get_permalink($post->ID) . '">' . READ_MORE_TXT . '</a>'; |
|
| 2614 | - } |
|
| 2610 | + global $post; |
|
| 2611 | + $all_postypes = geodir_get_posttypes(); |
|
| 2612 | + if (is_array($all_postypes) && in_array($post->post_type, $all_postypes)) {
|
|
| 2613 | + return ' <a href="' . get_permalink($post->ID) . '">' . READ_MORE_TXT . '</a>'; |
|
| 2614 | + } |
|
| 2615 | 2615 | |
| 2616 | - return $more; |
|
| 2616 | + return $more; |
|
| 2617 | 2617 | } |
| 2618 | 2618 | |
| 2619 | 2619 | |
@@ -2630,63 +2630,63 @@ discard block |
||
| 2630 | 2630 | */ |
| 2631 | 2631 | function geodir_update_markers_oncatedit($term_id, $tt_id, $taxonomy) |
| 2632 | 2632 | {
|
| 2633 | - global $plugin_prefix, $wpdb; |
|
| 2633 | + global $plugin_prefix, $wpdb; |
|
| 2634 | 2634 | |
| 2635 | - $gd_taxonomies = geodir_get_taxonomies(); |
|
| 2635 | + $gd_taxonomies = geodir_get_taxonomies(); |
|
| 2636 | 2636 | |
| 2637 | - if (is_array($gd_taxonomies) && in_array($taxonomy, $gd_taxonomies)) {
|
|
| 2637 | + if (is_array($gd_taxonomies) && in_array($taxonomy, $gd_taxonomies)) {
|
|
| 2638 | 2638 | |
| 2639 | - $geodir_post_type = geodir_get_taxonomy_posttype($taxonomy); |
|
| 2640 | - $table = $plugin_prefix . $geodir_post_type . '_detail'; |
|
| 2639 | + $geodir_post_type = geodir_get_taxonomy_posttype($taxonomy); |
|
| 2640 | + $table = $plugin_prefix . $geodir_post_type . '_detail'; |
|
| 2641 | 2641 | |
| 2642 | - $path_parts = pathinfo($_REQUEST['ct_cat_icon']['src']); |
|
| 2643 | - $term_icon = $path_parts['dirname'] . '/cat_icon_' . $term_id . '.png'; |
|
| 2642 | + $path_parts = pathinfo($_REQUEST['ct_cat_icon']['src']); |
|
| 2643 | + $term_icon = $path_parts['dirname'] . '/cat_icon_' . $term_id . '.png'; |
|
| 2644 | 2644 | |
| 2645 | - $posts = $wpdb->get_results( |
|
| 2646 | - $wpdb->prepare( |
|
| 2647 | - "SELECT post_id,post_title,post_latitude,post_longitude,default_category FROM " . $table . " WHERE FIND_IN_SET(%s,%1\$s ) ", |
|
| 2648 | - array($term_id, $taxonomy) |
|
| 2649 | - ) |
|
| 2650 | - ); |
|
| 2645 | + $posts = $wpdb->get_results( |
|
| 2646 | + $wpdb->prepare( |
|
| 2647 | + "SELECT post_id,post_title,post_latitude,post_longitude,default_category FROM " . $table . " WHERE FIND_IN_SET(%s,%1\$s ) ", |
|
| 2648 | + array($term_id, $taxonomy) |
|
| 2649 | + ) |
|
| 2650 | + ); |
|
| 2651 | 2651 | |
| 2652 | - if (!empty($posts)): |
|
| 2653 | - foreach ($posts as $post_obj) {
|
|
| 2652 | + if (!empty($posts)): |
|
| 2653 | + foreach ($posts as $post_obj) {
|
|
| 2654 | 2654 | |
| 2655 | - $lat = $post_obj->post_latitude; |
|
| 2656 | - $lng = $post_obj->post_longitude; |
|
| 2655 | + $lat = $post_obj->post_latitude; |
|
| 2656 | + $lng = $post_obj->post_longitude; |
|
| 2657 | 2657 | |
| 2658 | - $json = '{';
|
|
| 2659 | - $json .= '"id":"' . $post_obj->post_id . '",'; |
|
| 2660 | - $json .= '"lat_pos": "' . $lat . '",'; |
|
| 2661 | - $json .= '"long_pos": "' . $lng . '",'; |
|
| 2662 | - $json .= '"marker_id":"' . $post_obj->post_id . '_' . $term_id . '",'; |
|
| 2663 | - $json .= '"icon":"' . $term_icon . '",'; |
|
| 2664 | - $json .= '"group":"catgroup' . $term_id . '"'; |
|
| 2665 | - $json .= '}'; |
|
| 2658 | + $json = '{';
|
|
| 2659 | + $json .= '"id":"' . $post_obj->post_id . '",'; |
|
| 2660 | + $json .= '"lat_pos": "' . $lat . '",'; |
|
| 2661 | + $json .= '"long_pos": "' . $lng . '",'; |
|
| 2662 | + $json .= '"marker_id":"' . $post_obj->post_id . '_' . $term_id . '",'; |
|
| 2663 | + $json .= '"icon":"' . $term_icon . '",'; |
|
| 2664 | + $json .= '"group":"catgroup' . $term_id . '"'; |
|
| 2665 | + $json .= '}'; |
|
| 2666 | 2666 | |
| 2667 | - if ($post_obj->default_category == $term_id) {
|
|
| 2667 | + if ($post_obj->default_category == $term_id) {
|
|
| 2668 | 2668 | |
| 2669 | - $wpdb->query( |
|
| 2670 | - $wpdb->prepare( |
|
| 2671 | - "UPDATE " . $table . " SET marker_json = %s where post_id = %d", |
|
| 2672 | - array($json, $post_obj->post_id) |
|
| 2673 | - ) |
|
| 2674 | - ); |
|
| 2675 | - } |
|
| 2669 | + $wpdb->query( |
|
| 2670 | + $wpdb->prepare( |
|
| 2671 | + "UPDATE " . $table . " SET marker_json = %s where post_id = %d", |
|
| 2672 | + array($json, $post_obj->post_id) |
|
| 2673 | + ) |
|
| 2674 | + ); |
|
| 2675 | + } |
|
| 2676 | 2676 | |
| 2677 | - $wpdb->query( |
|
| 2678 | - $wpdb->prepare( |
|
| 2679 | - "UPDATE " . GEODIR_ICON_TABLE . " SET json = %s WHERE post_id = %d AND cat_id = %d", |
|
| 2680 | - array($json, $post_obj->post_id, $term_id) |
|
| 2681 | - ) |
|
| 2682 | - ); |
|
| 2677 | + $wpdb->query( |
|
| 2678 | + $wpdb->prepare( |
|
| 2679 | + "UPDATE " . GEODIR_ICON_TABLE . " SET json = %s WHERE post_id = %d AND cat_id = %d", |
|
| 2680 | + array($json, $post_obj->post_id, $term_id) |
|
| 2681 | + ) |
|
| 2682 | + ); |
|
| 2683 | 2683 | |
| 2684 | - } |
|
| 2684 | + } |
|
| 2685 | 2685 | |
| 2686 | 2686 | |
| 2687 | - endif; |
|
| 2687 | + endif; |
|
| 2688 | 2688 | |
| 2689 | - } |
|
| 2689 | + } |
|
| 2690 | 2690 | |
| 2691 | 2691 | } |
| 2692 | 2692 | |
@@ -2700,14 +2700,14 @@ discard block |
||
| 2700 | 2700 | */ |
| 2701 | 2701 | function geodir_get_listing_author($listing_id = '') |
| 2702 | 2702 | {
|
| 2703 | - if ($listing_id == '') {
|
|
| 2704 | - if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 2705 | - $listing_id = $_REQUEST['pid']; |
|
| 2706 | - } |
|
| 2707 | - } |
|
| 2708 | - $listing = get_post(strip_tags($listing_id)); |
|
| 2709 | - $listing_author_id = $listing->post_author; |
|
| 2710 | - return $listing_author_id; |
|
| 2703 | + if ($listing_id == '') {
|
|
| 2704 | + if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 2705 | + $listing_id = $_REQUEST['pid']; |
|
| 2706 | + } |
|
| 2707 | + } |
|
| 2708 | + $listing = get_post(strip_tags($listing_id)); |
|
| 2709 | + $listing_author_id = $listing->post_author; |
|
| 2710 | + return $listing_author_id; |
|
| 2711 | 2711 | } |
| 2712 | 2712 | |
| 2713 | 2713 | |
@@ -2722,11 +2722,11 @@ discard block |
||
| 2722 | 2722 | */ |
| 2723 | 2723 | function geodir_lisiting_belong_to_user($listing_id, $user_id) |
| 2724 | 2724 | {
|
| 2725 | - $listing_author_id = geodir_get_listing_author($listing_id); |
|
| 2726 | - if ($listing_author_id == $user_id) |
|
| 2727 | - return true; |
|
| 2728 | - else |
|
| 2729 | - return false; |
|
| 2725 | + $listing_author_id = geodir_get_listing_author($listing_id); |
|
| 2726 | + if ($listing_author_id == $user_id) |
|
| 2727 | + return true; |
|
| 2728 | + else |
|
| 2729 | + return false; |
|
| 2730 | 2730 | |
| 2731 | 2731 | } |
| 2732 | 2732 | |
@@ -2742,17 +2742,17 @@ discard block |
||
| 2742 | 2742 | */ |
| 2743 | 2743 | function geodir_listing_belong_to_current_user($listing_id = '', $exclude_admin = true) |
| 2744 | 2744 | {
|
| 2745 | - global $current_user; |
|
| 2746 | - if ($exclude_admin) {
|
|
| 2747 | - foreach ($current_user->caps as $key => $caps) {
|
|
| 2748 | - if (geodir_strtolower($key) == 'administrator') {
|
|
| 2749 | - return true; |
|
| 2750 | - break; |
|
| 2751 | - } |
|
| 2752 | - } |
|
| 2753 | - } |
|
| 2754 | - |
|
| 2755 | - return geodir_lisiting_belong_to_user($listing_id, $current_user->ID); |
|
| 2745 | + global $current_user; |
|
| 2746 | + if ($exclude_admin) {
|
|
| 2747 | + foreach ($current_user->caps as $key => $caps) {
|
|
| 2748 | + if (geodir_strtolower($key) == 'administrator') {
|
|
| 2749 | + return true; |
|
| 2750 | + break; |
|
| 2751 | + } |
|
| 2752 | + } |
|
| 2753 | + } |
|
| 2754 | + |
|
| 2755 | + return geodir_lisiting_belong_to_user($listing_id, $current_user->ID); |
|
| 2756 | 2756 | } |
| 2757 | 2757 | |
| 2758 | 2758 | |
@@ -2768,17 +2768,17 @@ discard block |
||
| 2768 | 2768 | function geodir_only_supportable_attachments_remove($file) |
| 2769 | 2769 | {
|
| 2770 | 2770 | |
| 2771 | - global $wpdb; |
|
| 2771 | + global $wpdb; |
|
| 2772 | 2772 | |
| 2773 | - $matches = array(); |
|
| 2773 | + $matches = array(); |
|
| 2774 | 2774 | |
| 2775 | - $pattern = '/-\d+x\d+\./'; |
|
| 2776 | - preg_match($pattern, $file, $matches, PREG_OFFSET_CAPTURE); |
|
| 2775 | + $pattern = '/-\d+x\d+\./'; |
|
| 2776 | + preg_match($pattern, $file, $matches, PREG_OFFSET_CAPTURE); |
|
| 2777 | 2777 | |
| 2778 | - if (empty($matches)) |
|
| 2779 | - return ''; |
|
| 2780 | - else |
|
| 2781 | - return $file; |
|
| 2778 | + if (empty($matches)) |
|
| 2779 | + return ''; |
|
| 2780 | + else |
|
| 2781 | + return $file; |
|
| 2782 | 2782 | |
| 2783 | 2783 | } |
| 2784 | 2784 | |
@@ -2795,78 +2795,78 @@ discard block |
||
| 2795 | 2795 | function geodir_set_wp_featured_image($post_id) |
| 2796 | 2796 | {
|
| 2797 | 2797 | |
| 2798 | - global $wpdb, $plugin_prefix; |
|
| 2799 | - $uploads = wp_upload_dir(); |
|
| 2798 | + global $wpdb, $plugin_prefix; |
|
| 2799 | + $uploads = wp_upload_dir(); |
|
| 2800 | 2800 | // print_r($uploads ) ; |
| 2801 | - $post_first_image = $wpdb->get_results( |
|
| 2802 | - $wpdb->prepare( |
|
| 2803 | - "SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = %d and menu_order = 1 ", array($post_id) |
|
| 2804 | - ) |
|
| 2805 | - ); |
|
| 2801 | + $post_first_image = $wpdb->get_results( |
|
| 2802 | + $wpdb->prepare( |
|
| 2803 | + "SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = %d and menu_order = 1 ", array($post_id) |
|
| 2804 | + ) |
|
| 2805 | + ); |
|
| 2806 | 2806 | |
| 2807 | - $old_attachment_name = ''; |
|
| 2808 | - $post_thumbnail_id = ''; |
|
| 2809 | - if (has_post_thumbnail($post_id)) {
|
|
| 2807 | + $old_attachment_name = ''; |
|
| 2808 | + $post_thumbnail_id = ''; |
|
| 2809 | + if (has_post_thumbnail($post_id)) {
|
|
| 2810 | 2810 | |
| 2811 | - if (has_post_thumbnail($post_id)) {
|
|
| 2811 | + if (has_post_thumbnail($post_id)) {
|
|
| 2812 | 2812 | |
| 2813 | - $post_thumbnail_id = get_post_thumbnail_id($post_id); |
|
| 2813 | + $post_thumbnail_id = get_post_thumbnail_id($post_id); |
|
| 2814 | 2814 | |
| 2815 | - $old_attachment_name = basename(get_attached_file($post_thumbnail_id)); |
|
| 2815 | + $old_attachment_name = basename(get_attached_file($post_thumbnail_id)); |
|
| 2816 | 2816 | |
| 2817 | - } |
|
| 2818 | - } |
|
| 2819 | - |
|
| 2820 | - if (!empty($post_first_image)) {
|
|
| 2817 | + } |
|
| 2818 | + } |
|
| 2821 | 2819 | |
| 2822 | - $post_type = get_post_type($post_id); |
|
| 2820 | + if (!empty($post_first_image)) {
|
|
| 2823 | 2821 | |
| 2824 | - $table_name = $plugin_prefix . $post_type . '_detail'; |
|
| 2822 | + $post_type = get_post_type($post_id); |
|
| 2825 | 2823 | |
| 2826 | - $wpdb->query("UPDATE " . $table_name . " SET featured_image='" . $post_first_image[0]->file . "' WHERE post_id =" . $post_id);
|
|
| 2824 | + $table_name = $plugin_prefix . $post_type . '_detail'; |
|
| 2827 | 2825 | |
| 2828 | - $new_attachment_name = basename($post_first_image[0]->file); |
|
| 2826 | + $wpdb->query("UPDATE " . $table_name . " SET featured_image='" . $post_first_image[0]->file . "' WHERE post_id =" . $post_id);
|
|
| 2829 | 2827 | |
| 2830 | - if (geodir_strtolower($new_attachment_name) != geodir_strtolower($old_attachment_name)) {
|
|
| 2828 | + $new_attachment_name = basename($post_first_image[0]->file); |
|
| 2831 | 2829 | |
| 2832 | - if (has_post_thumbnail($post_id) && $post_thumbnail_id != '' && (!isset($_REQUEST['action']) || $_REQUEST['action'] != 'delete')) {
|
|
| 2830 | + if (geodir_strtolower($new_attachment_name) != geodir_strtolower($old_attachment_name)) {
|
|
| 2833 | 2831 | |
| 2834 | - add_filter('wp_delete_file', 'geodir_only_supportable_attachments_remove');
|
|
| 2832 | + if (has_post_thumbnail($post_id) && $post_thumbnail_id != '' && (!isset($_REQUEST['action']) || $_REQUEST['action'] != 'delete')) {
|
|
| 2835 | 2833 | |
| 2836 | - wp_delete_attachment($post_thumbnail_id); |
|
| 2834 | + add_filter('wp_delete_file', 'geodir_only_supportable_attachments_remove');
|
|
| 2837 | 2835 | |
| 2838 | - } |
|
| 2839 | - $filename = $uploads['basedir'] . $post_first_image[0]->file; |
|
| 2836 | + wp_delete_attachment($post_thumbnail_id); |
|
| 2840 | 2837 | |
| 2841 | - $attachment = array( |
|
| 2842 | - 'post_mime_type' => $post_first_image[0]->mime_type, |
|
| 2843 | - 'guid' => $uploads['baseurl'] . $post_first_image[0]->file, |
|
| 2844 | - 'post_parent' => $post_id, |
|
| 2845 | - 'post_title' => preg_replace('/\.[^.]+$/', '', $post_first_image[0]->title),
|
|
| 2846 | - 'post_content' => '' |
|
| 2847 | - ); |
|
| 2838 | + } |
|
| 2839 | + $filename = $uploads['basedir'] . $post_first_image[0]->file; |
|
| 2840 | + |
|
| 2841 | + $attachment = array( |
|
| 2842 | + 'post_mime_type' => $post_first_image[0]->mime_type, |
|
| 2843 | + 'guid' => $uploads['baseurl'] . $post_first_image[0]->file, |
|
| 2844 | + 'post_parent' => $post_id, |
|
| 2845 | + 'post_title' => preg_replace('/\.[^.]+$/', '', $post_first_image[0]->title),
|
|
| 2846 | + 'post_content' => '' |
|
| 2847 | + ); |
|
| 2848 | 2848 | |
| 2849 | 2849 | |
| 2850 | - $id = wp_insert_attachment($attachment, $filename, $post_id); |
|
| 2850 | + $id = wp_insert_attachment($attachment, $filename, $post_id); |
|
| 2851 | 2851 | |
| 2852 | - if (!is_wp_error($id)) {
|
|
| 2852 | + if (!is_wp_error($id)) {
|
|
| 2853 | 2853 | |
| 2854 | - set_post_thumbnail($post_id, $id); |
|
| 2854 | + set_post_thumbnail($post_id, $id); |
|
| 2855 | 2855 | |
| 2856 | - require_once(ABSPATH . 'wp-admin/includes/image.php'); |
|
| 2857 | - wp_update_attachment_metadata($id, wp_generate_attachment_metadata($id, $filename)); |
|
| 2856 | + require_once(ABSPATH . 'wp-admin/includes/image.php'); |
|
| 2857 | + wp_update_attachment_metadata($id, wp_generate_attachment_metadata($id, $filename)); |
|
| 2858 | 2858 | |
| 2859 | - } |
|
| 2859 | + } |
|
| 2860 | 2860 | |
| 2861 | - } |
|
| 2861 | + } |
|
| 2862 | 2862 | |
| 2863 | - } else {
|
|
| 2864 | - //set_post_thumbnail($post_id,-1); |
|
| 2863 | + } else {
|
|
| 2864 | + //set_post_thumbnail($post_id,-1); |
|
| 2865 | 2865 | |
| 2866 | - if (has_post_thumbnail($post_id) && $post_thumbnail_id != '' && (!isset($_REQUEST['action']) || $_REQUEST['action'] != 'delete')) |
|
| 2867 | - wp_delete_attachment($post_thumbnail_id); |
|
| 2866 | + if (has_post_thumbnail($post_id) && $post_thumbnail_id != '' && (!isset($_REQUEST['action']) || $_REQUEST['action'] != 'delete')) |
|
| 2867 | + wp_delete_attachment($post_thumbnail_id); |
|
| 2868 | 2868 | |
| 2869 | - } |
|
| 2869 | + } |
|
| 2870 | 2870 | } |
| 2871 | 2871 | |
| 2872 | 2872 | |
@@ -2881,53 +2881,53 @@ discard block |
||
| 2881 | 2881 | */ |
| 2882 | 2882 | function gd_copy_original_translation() |
| 2883 | 2883 | {
|
| 2884 | - if (function_exists('icl_object_id')) {
|
|
| 2885 | - global $wpdb, $table_prefix, $plugin_prefix; |
|
| 2886 | - $post_id = absint($_POST['post_id']); |
|
| 2887 | - $upload_dir = wp_upload_dir(); |
|
| 2888 | - $post_type = get_post_type($_POST['post_id']); |
|
| 2889 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 2890 | - |
|
| 2891 | - $post_arr = $wpdb->get_results($wpdb->prepare( |
|
| 2892 | - "SELECT * FROM $wpdb->posts p JOIN " . $table . " gd ON gd.post_id=p.ID WHERE p.ID=%d LIMIT 1", |
|
| 2893 | - array($post_id) |
|
| 2894 | - ) |
|
| 2895 | - , ARRAY_A); |
|
| 2896 | - |
|
| 2897 | - $arrImages = $wpdb->get_results( |
|
| 2898 | - $wpdb->prepare( |
|
| 2899 | - "SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE mime_type like %s AND post_id = %d ORDER BY menu_order ASC, ID DESC ", |
|
| 2900 | - array('%image%', $post_id)
|
|
| 2901 | - ) |
|
| 2902 | - ); |
|
| 2903 | - if ($arrImages) {
|
|
| 2904 | - $image_arr = array(); |
|
| 2905 | - foreach ($arrImages as $img) {
|
|
| 2906 | - $image_arr[] = $upload_dir['baseurl'] . $img->file; |
|
| 2907 | - } |
|
| 2908 | - $comma_separated = implode(",", $image_arr);
|
|
| 2909 | - $post_arr[0]['post_images'] = $comma_separated; |
|
| 2910 | - } |
|
| 2911 | - |
|
| 2912 | - |
|
| 2913 | - $cats = $post_arr[0][$post_arr[0]['post_type'] . 'category']; |
|
| 2914 | - $cat_arr = array_filter(explode(",", $cats));
|
|
| 2915 | - $trans_cat = array(); |
|
| 2916 | - foreach ($cat_arr as $cat) {
|
|
| 2917 | - $trans_cat[] = icl_object_id($cat, $post_arr[0]['post_type'] . 'category', false); |
|
| 2918 | - } |
|
| 2919 | - |
|
| 2920 | - |
|
| 2921 | - $post_arr[0]['categories'] = array_filter($trans_cat); |
|
| 2884 | + if (function_exists('icl_object_id')) {
|
|
| 2885 | + global $wpdb, $table_prefix, $plugin_prefix; |
|
| 2886 | + $post_id = absint($_POST['post_id']); |
|
| 2887 | + $upload_dir = wp_upload_dir(); |
|
| 2888 | + $post_type = get_post_type($_POST['post_id']); |
|
| 2889 | + $table = $plugin_prefix . $post_type . '_detail'; |
|
| 2890 | + |
|
| 2891 | + $post_arr = $wpdb->get_results($wpdb->prepare( |
|
| 2892 | + "SELECT * FROM $wpdb->posts p JOIN " . $table . " gd ON gd.post_id=p.ID WHERE p.ID=%d LIMIT 1", |
|
| 2893 | + array($post_id) |
|
| 2894 | + ) |
|
| 2895 | + , ARRAY_A); |
|
| 2896 | + |
|
| 2897 | + $arrImages = $wpdb->get_results( |
|
| 2898 | + $wpdb->prepare( |
|
| 2899 | + "SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE mime_type like %s AND post_id = %d ORDER BY menu_order ASC, ID DESC ", |
|
| 2900 | + array('%image%', $post_id)
|
|
| 2901 | + ) |
|
| 2902 | + ); |
|
| 2903 | + if ($arrImages) {
|
|
| 2904 | + $image_arr = array(); |
|
| 2905 | + foreach ($arrImages as $img) {
|
|
| 2906 | + $image_arr[] = $upload_dir['baseurl'] . $img->file; |
|
| 2907 | + } |
|
| 2908 | + $comma_separated = implode(",", $image_arr);
|
|
| 2909 | + $post_arr[0]['post_images'] = $comma_separated; |
|
| 2910 | + } |
|
| 2911 | + |
|
| 2912 | + |
|
| 2913 | + $cats = $post_arr[0][$post_arr[0]['post_type'] . 'category']; |
|
| 2914 | + $cat_arr = array_filter(explode(",", $cats));
|
|
| 2915 | + $trans_cat = array(); |
|
| 2916 | + foreach ($cat_arr as $cat) {
|
|
| 2917 | + $trans_cat[] = icl_object_id($cat, $post_arr[0]['post_type'] . 'category', false); |
|
| 2918 | + } |
|
| 2919 | + |
|
| 2920 | + |
|
| 2921 | + $post_arr[0]['categories'] = array_filter($trans_cat); |
|
| 2922 | 2922 | //print_r($image_arr); |
| 2923 | - //print_r($arrImages); |
|
| 2924 | - //echo $_REQUEST['lang']; |
|
| 2923 | + //print_r($arrImages); |
|
| 2924 | + //echo $_REQUEST['lang']; |
|
| 2925 | 2925 | //print_r($post_arr); |
| 2926 | 2926 | //print_r($trans_cat); |
| 2927 | - echo json_encode($post_arr[0]); |
|
| 2927 | + echo json_encode($post_arr[0]); |
|
| 2928 | 2928 | |
| 2929 | - } |
|
| 2930 | - die(); |
|
| 2929 | + } |
|
| 2930 | + die(); |
|
| 2931 | 2931 | } |
| 2932 | 2932 | |
| 2933 | 2933 | |
@@ -2947,54 +2947,54 @@ discard block |
||
| 2947 | 2947 | function geodir_get_custom_fields_type($listing_type = '') |
| 2948 | 2948 | {
|
| 2949 | 2949 | |
| 2950 | - global $wpdb; |
|
| 2950 | + global $wpdb; |
|
| 2951 | 2951 | |
| 2952 | - if ($listing_type == '') |
|
| 2953 | - $listing_type = 'gd_place'; |
|
| 2952 | + if ($listing_type == '') |
|
| 2953 | + $listing_type = 'gd_place'; |
|
| 2954 | 2954 | |
| 2955 | - $fields_info = array(); |
|
| 2955 | + $fields_info = array(); |
|
| 2956 | 2956 | |
| 2957 | - $get_data = $wpdb->get_results( |
|
| 2958 | - $wpdb->prepare( |
|
| 2959 | - "SELECT htmlvar_name, field_type, extra_fields FROM " . GEODIR_CUSTOM_FIELDS_TABLE . " WHERE post_type=%s AND is_active='1'", |
|
| 2960 | - array($listing_type) |
|
| 2961 | - ) |
|
| 2962 | - ); |
|
| 2957 | + $get_data = $wpdb->get_results( |
|
| 2958 | + $wpdb->prepare( |
|
| 2959 | + "SELECT htmlvar_name, field_type, extra_fields FROM " . GEODIR_CUSTOM_FIELDS_TABLE . " WHERE post_type=%s AND is_active='1'", |
|
| 2960 | + array($listing_type) |
|
| 2961 | + ) |
|
| 2962 | + ); |
|
| 2963 | 2963 | |
| 2964 | - if (!empty($get_data)) {
|
|
| 2964 | + if (!empty($get_data)) {
|
|
| 2965 | 2965 | |
| 2966 | - foreach ($get_data as $data) {
|
|
| 2966 | + foreach ($get_data as $data) {
|
|
| 2967 | 2967 | |
| 2968 | - if ($data->field_type == 'address') {
|
|
| 2968 | + if ($data->field_type == 'address') {
|
|
| 2969 | 2969 | |
| 2970 | - $extra_fields = unserialize($data->extra_fields); |
|
| 2970 | + $extra_fields = unserialize($data->extra_fields); |
|
| 2971 | 2971 | |
| 2972 | - $prefix = $data->htmlvar_name . '_'; |
|
| 2972 | + $prefix = $data->htmlvar_name . '_'; |
|
| 2973 | 2973 | |
| 2974 | - $fields_info[$prefix . 'address'] = $data->field_type; |
|
| 2974 | + $fields_info[$prefix . 'address'] = $data->field_type; |
|
| 2975 | 2975 | |
| 2976 | - if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) |
|
| 2977 | - $fields_info[$prefix . 'zip'] = $data->field_type; |
|
| 2976 | + if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) |
|
| 2977 | + $fields_info[$prefix . 'zip'] = $data->field_type; |
|
| 2978 | 2978 | |
| 2979 | - } else {
|
|
| 2979 | + } else {
|
|
| 2980 | 2980 | |
| 2981 | - $fields_info[$data->htmlvar_name] = $data->field_type; |
|
| 2981 | + $fields_info[$data->htmlvar_name] = $data->field_type; |
|
| 2982 | 2982 | |
| 2983 | - } |
|
| 2983 | + } |
|
| 2984 | 2984 | |
| 2985 | - } |
|
| 2985 | + } |
|
| 2986 | 2986 | |
| 2987 | - } |
|
| 2987 | + } |
|
| 2988 | 2988 | |
| 2989 | - /** |
|
| 2990 | - * Filter to modify custom fields info using listing post type. |
|
| 2991 | - * |
|
| 2992 | - * @since 1.0.0 |
|
| 2993 | - * @package GeoDirectory |
|
| 2994 | - * @return array $fields_info Custom fields info. |
|
| 2995 | - * @param string $listing_type The listing post type. |
|
| 2996 | - */ |
|
| 2997 | - return apply_filters('geodir_get_custom_fields_type', $fields_info, $listing_type);
|
|
| 2989 | + /** |
|
| 2990 | + * Filter to modify custom fields info using listing post type. |
|
| 2991 | + * |
|
| 2992 | + * @since 1.0.0 |
|
| 2993 | + * @package GeoDirectory |
|
| 2994 | + * @return array $fields_info Custom fields info. |
|
| 2995 | + * @param string $listing_type The listing post type. |
|
| 2996 | + */ |
|
| 2997 | + return apply_filters('geodir_get_custom_fields_type', $fields_info, $listing_type);
|
|
| 2998 | 2998 | } |
| 2999 | 2999 | |
| 3000 | 3000 | |
@@ -3009,58 +3009,58 @@ discard block |
||
| 3009 | 3009 | */ |
| 3010 | 3010 | function geodir_function_post_updated($post_ID, $post_after, $post_before) |
| 3011 | 3011 | {
|
| 3012 | - $post_type = get_post_type($post_ID); |
|
| 3012 | + $post_type = get_post_type($post_ID); |
|
| 3013 | 3013 | |
| 3014 | - if ($post_type != '' && in_array($post_type, geodir_get_posttypes())) {
|
|
| 3015 | - // send notification to client when post moves from draft to publish |
|
| 3016 | - if (!empty($post_after->post_status) && $post_after->post_status == 'publish' && !empty($post_before->post_status) && ($post_before->post_status == 'draft' || $post_before->post_status == 'auto-draft')) {
|
|
| 3017 | - $post_author_id = !empty($post_after->post_author) ? $post_after->post_author : NULL; |
|
| 3018 | - $post_author_data = get_userdata($post_author_id); |
|
| 3014 | + if ($post_type != '' && in_array($post_type, geodir_get_posttypes())) {
|
|
| 3015 | + // send notification to client when post moves from draft to publish |
|
| 3016 | + if (!empty($post_after->post_status) && $post_after->post_status == 'publish' && !empty($post_before->post_status) && ($post_before->post_status == 'draft' || $post_before->post_status == 'auto-draft')) {
|
|
| 3017 | + $post_author_id = !empty($post_after->post_author) ? $post_after->post_author : NULL; |
|
| 3018 | + $post_author_data = get_userdata($post_author_id); |
|
| 3019 | 3019 | |
| 3020 | - $to_name = geodir_get_client_name($post_author_id); |
|
| 3020 | + $to_name = geodir_get_client_name($post_author_id); |
|
| 3021 | 3021 | |
| 3022 | - $from_email = geodir_get_site_email_id(); |
|
| 3023 | - $from_name = get_site_emailName(); |
|
| 3024 | - $to_email = $post_author_data->user_email; |
|
| 3022 | + $from_email = geodir_get_site_email_id(); |
|
| 3023 | + $from_name = get_site_emailName(); |
|
| 3024 | + $to_email = $post_author_data->user_email; |
|
| 3025 | 3025 | |
| 3026 | - if (!is_email($to_email) && !empty($post_author_data->user_email)) {
|
|
| 3027 | - $to_email = $post_author_data->user_email; |
|
| 3028 | - } |
|
| 3026 | + if (!is_email($to_email) && !empty($post_author_data->user_email)) {
|
|
| 3027 | + $to_email = $post_author_data->user_email; |
|
| 3028 | + } |
|
| 3029 | 3029 | |
| 3030 | - $message_type = 'listing_published'; |
|
| 3030 | + $message_type = 'listing_published'; |
|
| 3031 | 3031 | |
| 3032 | - if (get_option('geodir_post_published_email_subject') == '') {
|
|
| 3033 | - update_option('geodir_post_published_email_subject', __('Listing Published Successfully', 'geodirectory'));
|
|
| 3034 | - } |
|
| 3032 | + if (get_option('geodir_post_published_email_subject') == '') {
|
|
| 3033 | + update_option('geodir_post_published_email_subject', __('Listing Published Successfully', 'geodirectory'));
|
|
| 3034 | + } |
|
| 3035 | 3035 | |
| 3036 | - if (get_option('geodir_post_published_email_content') == '') {
|
|
| 3037 | - update_option('geodir_post_published_email_content', __("<p>Dear [#client_name#],</p><p>Your listing [#listing_link#] has been published. This email is just for your information.</p><p>[#listing_link#]</p><br><p>Thank you for your contribution.</p><p>[#site_name#]</p>", 'geodirectory'));
|
|
| 3038 | - } |
|
| 3036 | + if (get_option('geodir_post_published_email_content') == '') {
|
|
| 3037 | + update_option('geodir_post_published_email_content', __("<p>Dear [#client_name#],</p><p>Your listing [#listing_link#] has been published. This email is just for your information.</p><p>[#listing_link#]</p><br><p>Thank you for your contribution.</p><p>[#site_name#]</p>", 'geodirectory'));
|
|
| 3038 | + } |
|
| 3039 | 3039 | |
| 3040 | - /** |
|
| 3041 | - * Called before sending the email when listing gets published. |
|
| 3042 | - * |
|
| 3043 | - * @since 1.0.0 |
|
| 3044 | - * @package GeoDirectory |
|
| 3045 | - * @param object $post_after The post object after update. |
|
| 3046 | - * @param object $post_before The post object before update. |
|
| 3047 | - */ |
|
| 3048 | - do_action('geodir_before_listing_published_email', $post_after, $post_before);
|
|
| 3049 | - if (is_email($to_email)) {
|
|
| 3050 | - geodir_sendEmail($from_email, $from_name, $to_email, $to_name, '', '', '', $message_type, $post_ID); |
|
| 3051 | - } |
|
| 3040 | + /** |
|
| 3041 | + * Called before sending the email when listing gets published. |
|
| 3042 | + * |
|
| 3043 | + * @since 1.0.0 |
|
| 3044 | + * @package GeoDirectory |
|
| 3045 | + * @param object $post_after The post object after update. |
|
| 3046 | + * @param object $post_before The post object before update. |
|
| 3047 | + */ |
|
| 3048 | + do_action('geodir_before_listing_published_email', $post_after, $post_before);
|
|
| 3049 | + if (is_email($to_email)) {
|
|
| 3050 | + geodir_sendEmail($from_email, $from_name, $to_email, $to_name, '', '', '', $message_type, $post_ID); |
|
| 3051 | + } |
|
| 3052 | 3052 | |
| 3053 | - /** |
|
| 3054 | - * Called after sending the email when listing gets published. |
|
| 3055 | - * |
|
| 3056 | - * @since 1.0.0 |
|
| 3057 | - * @package GeoDirectory |
|
| 3058 | - * @param object $post_after The post object after update. |
|
| 3059 | - * @param object $post_before The post object before update. |
|
| 3060 | - */ |
|
| 3061 | - do_action('geodir_after_listing_published_email', $post_after, $post_before);
|
|
| 3062 | - } |
|
| 3063 | - } |
|
| 3053 | + /** |
|
| 3054 | + * Called after sending the email when listing gets published. |
|
| 3055 | + * |
|
| 3056 | + * @since 1.0.0 |
|
| 3057 | + * @package GeoDirectory |
|
| 3058 | + * @param object $post_after The post object after update. |
|
| 3059 | + * @param object $post_before The post object before update. |
|
| 3060 | + */ |
|
| 3061 | + do_action('geodir_after_listing_published_email', $post_after, $post_before);
|
|
| 3062 | + } |
|
| 3063 | + } |
|
| 3064 | 3064 | } |
| 3065 | 3065 | |
| 3066 | 3066 | add_action('wp_head', 'geodir_fb_like_thumbnail');
|
@@ -3074,14 +3074,14 @@ discard block |
||
| 3074 | 3074 | */ |
| 3075 | 3075 | function geodir_fb_like_thumbnail(){
|
| 3076 | 3076 | |
| 3077 | - // return if not a single post |
|
| 3078 | - if(!is_single()){return;}
|
|
| 3077 | + // return if not a single post |
|
| 3078 | + if(!is_single()){return;}
|
|
| 3079 | 3079 | |
| 3080 | - global $post; |
|
| 3081 | - if(isset($post->featured_image) && $post->featured_image){
|
|
| 3082 | - $upload_dir = wp_upload_dir(); |
|
| 3083 | - $thumb = $upload_dir['baseurl'].$post->featured_image; |
|
| 3084 | - echo "\n\n<!-- GD Facebook Like Thumbnail -->\n<link rel=\"image_src\" href=\"$thumb\" />\n<!-- End GD Facebook Like Thumbnail -->\n\n"; |
|
| 3080 | + global $post; |
|
| 3081 | + if(isset($post->featured_image) && $post->featured_image){
|
|
| 3082 | + $upload_dir = wp_upload_dir(); |
|
| 3083 | + $thumb = $upload_dir['baseurl'].$post->featured_image; |
|
| 3084 | + echo "\n\n<!-- GD Facebook Like Thumbnail -->\n<link rel=\"image_src\" href=\"$thumb\" />\n<!-- End GD Facebook Like Thumbnail -->\n\n"; |
|
| 3085 | 3085 | |
| 3086 | - } |
|
| 3086 | + } |
|
| 3087 | 3087 | } |
| 3088 | 3088 | \ No newline at end of file |
@@ -26,11 +26,11 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | if (!isset($default_cat) || empty($default_cat)) {
|
| 28 | 28 | $default_cat = isset($post_cat_array[0]) ? $post_cat_array[0] : ''; |
| 29 | - }else{
|
|
| 30 | - if(!is_int($default_cat)){
|
|
| 29 | + } else {
|
|
| 30 | + if (!is_int($default_cat)) {
|
|
| 31 | 31 | $category = get_term_by('name', $default_cat, $taxonomy);
|
| 32 | - if(isset($category->term_id)){
|
|
| 33 | - $default_cat = $category->term_id; |
|
| 32 | + if (isset($category->term_id)) {
|
|
| 33 | + $default_cat = $category->term_id; |
|
| 34 | 34 | } |
| 35 | 35 | } |
| 36 | 36 | |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | |
| 59 | 59 | if ($default_pos === false) {
|
| 60 | 60 | |
| 61 | - $change_cat_str = str_replace($default_cat . ',y:', $default_cat . ',y,d:', $change_cat_str); |
|
| 61 | + $change_cat_str = str_replace($default_cat.',y:', $default_cat.',y,d:', $change_cat_str); |
|
| 62 | 62 | |
| 63 | 63 | } |
| 64 | 64 | |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | $send_post_submit_mail = false; |
| 228 | 228 | |
| 229 | 229 | // unhook this function so it doesn't loop infinitely |
| 230 | - remove_action('save_post', 'geodir_post_information_save',10,2);
|
|
| 230 | + remove_action('save_post', 'geodir_post_information_save', 10, 2);
|
|
| 231 | 231 | |
| 232 | 232 | if (isset($request_info['pid']) && $request_info['pid'] != '') {
|
| 233 | 233 | $post['ID'] = $request_info['pid']; |
@@ -251,13 +251,13 @@ discard block |
||
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | // re-hook this function |
| 254 | - add_action('save_post', 'geodir_post_information_save',10,2);
|
|
| 254 | + add_action('save_post', 'geodir_post_information_save', 10, 2);
|
|
| 255 | 255 | |
| 256 | 256 | $post_tags = ''; |
| 257 | 257 | if (!isset($request_info['post_tags'])) {
|
| 258 | 258 | |
| 259 | 259 | $post_type = $request_info['listing_type']; |
| 260 | - $post_tags = implode(",", wp_get_object_terms($last_post_id, $post_type . '_tags', array('fields' => 'names')));
|
|
| 260 | + $post_tags = implode(",", wp_get_object_terms($last_post_id, $post_type.'_tags', array('fields' => 'names')));
|
|
| 261 | 261 | |
| 262 | 262 | } |
| 263 | 263 | |
@@ -275,13 +275,13 @@ discard block |
||
| 275 | 275 | $payment_info = array(); |
| 276 | 276 | $package_info = array(); |
| 277 | 277 | |
| 278 | - $package_info = (array)geodir_post_package_info($package_info, $post); |
|
| 278 | + $package_info = (array) geodir_post_package_info($package_info, $post); |
|
| 279 | 279 | |
| 280 | 280 | $post_package_id = geodir_get_post_meta($last_post_id, 'package_id'); |
| 281 | 281 | |
| 282 | 282 | if (!empty($package_info) && !$post_package_id) {
|
| 283 | 283 | if (isset($package_info['days']) && $package_info['days'] != 0) {
|
| 284 | - $payment_info['expire_date'] = date('Y-m-d', strtotime("+" . $package_info['days'] . " days"));
|
|
| 284 | + $payment_info['expire_date'] = date('Y-m-d', strtotime("+".$package_info['days']." days"));
|
|
| 285 | 285 | } else {
|
| 286 | 286 | $payment_info['expire_date'] = 'Never'; |
| 287 | 287 | } |
@@ -302,8 +302,8 @@ discard block |
||
| 302 | 302 | $extrafields = $val['extra_fields']; |
| 303 | 303 | |
| 304 | 304 | if (trim($type) == 'address') {
|
| 305 | - $prefix = $name . '_'; |
|
| 306 | - $address = $prefix . 'address'; |
|
| 305 | + $prefix = $name.'_'; |
|
| 306 | + $address = $prefix.'address'; |
|
| 307 | 307 | |
| 308 | 308 | if (isset($request_info[$address]) && $request_info[$address] != '') {
|
| 309 | 309 | $gd_post_info[$address] = wp_slash($request_info[$address]); |
@@ -313,59 +313,59 @@ discard block |
||
| 313 | 313 | $extrafields = unserialize($extrafields); |
| 314 | 314 | |
| 315 | 315 | |
| 316 | - if (!isset($request_info[$prefix . 'city']) || $request_info[$prefix . 'city'] == '') {
|
|
| 316 | + if (!isset($request_info[$prefix.'city']) || $request_info[$prefix.'city'] == '') {
|
|
| 317 | 317 | |
| 318 | 318 | $location_result = geodir_get_default_location(); |
| 319 | 319 | |
| 320 | - $gd_post_info[$prefix . 'city'] = $location_result->city; |
|
| 321 | - $gd_post_info[$prefix . 'region'] = $location_result->region; |
|
| 322 | - $gd_post_info[$prefix . 'country'] = $location_result->country; |
|
| 320 | + $gd_post_info[$prefix.'city'] = $location_result->city; |
|
| 321 | + $gd_post_info[$prefix.'region'] = $location_result->region; |
|
| 322 | + $gd_post_info[$prefix.'country'] = $location_result->country; |
|
| 323 | 323 | |
| 324 | - $gd_post_info['post_locations'] = '[' . $location_result->city_slug . '],[' . $location_result->region_slug . '],[' . $location_result->country_slug . ']'; // set all overall post location |
|
| 324 | + $gd_post_info['post_locations'] = '['.$location_result->city_slug.'],['.$location_result->region_slug.'],['.$location_result->country_slug.']'; // set all overall post location |
|
| 325 | 325 | |
| 326 | 326 | } else {
|
| 327 | 327 | |
| 328 | - $gd_post_info[$prefix . 'city'] = $request_info[$prefix . 'city']; |
|
| 329 | - $gd_post_info[$prefix . 'region'] = $request_info[$prefix . 'region']; |
|
| 330 | - $gd_post_info[$prefix . 'country'] = $request_info[$prefix . 'country']; |
|
| 328 | + $gd_post_info[$prefix.'city'] = $request_info[$prefix.'city']; |
|
| 329 | + $gd_post_info[$prefix.'region'] = $request_info[$prefix.'region']; |
|
| 330 | + $gd_post_info[$prefix.'country'] = $request_info[$prefix.'country']; |
|
| 331 | 331 | |
| 332 | 332 | //----------set post locations when import dummy data------- |
| 333 | 333 | $location_result = geodir_get_default_location(); |
| 334 | 334 | |
| 335 | - $gd_post_info['post_locations'] = '[' . $location_result->city_slug . '],[' . $location_result->region_slug . '],[' . $location_result->country_slug . ']'; // set all overall post location |
|
| 335 | + $gd_post_info['post_locations'] = '['.$location_result->city_slug.'],['.$location_result->region_slug.'],['.$location_result->country_slug.']'; // set all overall post location |
|
| 336 | 336 | //----------------------------------------------------------------- |
| 337 | 337 | |
| 338 | 338 | } |
| 339 | 339 | |
| 340 | 340 | |
| 341 | - if (isset($extrafields['show_zip']) && $extrafields['show_zip'] && isset($request_info[$prefix . 'zip'])) {
|
|
| 342 | - $gd_post_info[$prefix . 'zip'] = $request_info[$prefix . 'zip']; |
|
| 341 | + if (isset($extrafields['show_zip']) && $extrafields['show_zip'] && isset($request_info[$prefix.'zip'])) {
|
|
| 342 | + $gd_post_info[$prefix.'zip'] = $request_info[$prefix.'zip']; |
|
| 343 | 343 | } |
| 344 | 344 | |
| 345 | 345 | |
| 346 | 346 | if (isset($extrafields['show_map']) && $extrafields['show_map']) {
|
| 347 | 347 | |
| 348 | - if (isset($request_info[$prefix . 'latitude']) && $request_info[$prefix . 'latitude'] != '') {
|
|
| 349 | - $gd_post_info[$prefix . 'latitude'] = $request_info[$prefix . 'latitude']; |
|
| 348 | + if (isset($request_info[$prefix.'latitude']) && $request_info[$prefix.'latitude'] != '') {
|
|
| 349 | + $gd_post_info[$prefix.'latitude'] = $request_info[$prefix.'latitude']; |
|
| 350 | 350 | } |
| 351 | 351 | |
| 352 | - if (isset($request_info[$prefix . 'longitude']) && $request_info[$prefix . 'longitude'] != '') {
|
|
| 353 | - $gd_post_info[$prefix . 'longitude'] = $request_info[$prefix . 'longitude']; |
|
| 352 | + if (isset($request_info[$prefix.'longitude']) && $request_info[$prefix.'longitude'] != '') {
|
|
| 353 | + $gd_post_info[$prefix.'longitude'] = $request_info[$prefix.'longitude']; |
|
| 354 | 354 | } |
| 355 | 355 | |
| 356 | - if (isset($request_info[$prefix . 'mapview']) && $request_info[$prefix . 'mapview'] != '') {
|
|
| 357 | - $gd_post_info[$prefix . 'mapview'] = $request_info[$prefix . 'mapview']; |
|
| 356 | + if (isset($request_info[$prefix.'mapview']) && $request_info[$prefix.'mapview'] != '') {
|
|
| 357 | + $gd_post_info[$prefix.'mapview'] = $request_info[$prefix.'mapview']; |
|
| 358 | 358 | } |
| 359 | 359 | |
| 360 | - if (isset($request_info[$prefix . 'mapzoom']) && $request_info[$prefix . 'mapzoom'] != '') {
|
|
| 361 | - $gd_post_info[$prefix . 'mapzoom'] = $request_info[$prefix . 'mapzoom']; |
|
| 360 | + if (isset($request_info[$prefix.'mapzoom']) && $request_info[$prefix.'mapzoom'] != '') {
|
|
| 361 | + $gd_post_info[$prefix.'mapzoom'] = $request_info[$prefix.'mapzoom']; |
|
| 362 | 362 | } |
| 363 | 363 | |
| 364 | 364 | } |
| 365 | 365 | |
| 366 | 366 | // show lat lng |
| 367 | - if (isset($extrafields['show_latlng']) && $extrafields['show_latlng'] && isset($request_info[$prefix . 'latlng'])) {
|
|
| 368 | - $gd_post_info[$prefix . 'latlng'] = $request_info[$prefix . 'latlng']; |
|
| 367 | + if (isset($extrafields['show_latlng']) && $extrafields['show_latlng'] && isset($request_info[$prefix.'latlng'])) {
|
|
| 368 | + $gd_post_info[$prefix.'latlng'] = $request_info[$prefix.'latlng']; |
|
| 369 | 369 | } |
| 370 | 370 | } |
| 371 | 371 | |
@@ -390,16 +390,16 @@ discard block |
||
| 390 | 390 | |
| 391 | 391 | // check if we need to change the format or not |
| 392 | 392 | $date_format_len = strlen(str_replace(' ', '', $date_format));
|
| 393 | - if($date_format_len>5){// if greater then 5 then it's the old style format.
|
|
| 393 | + if ($date_format_len > 5) {// if greater then 5 then it's the old style format.
|
|
| 394 | 394 | |
| 395 | - $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
|
|
| 396 | - $replace = array('d','j','l','m','n','F','Y');//PHP date format
|
|
| 395 | + $search = array('dd', 'd', 'DD', 'mm', 'm', 'MM', 'yy'); //jQuery UI datepicker format
|
|
| 396 | + $replace = array('d', 'j', 'l', 'm', 'n', 'F', 'Y'); //PHP date format
|
|
| 397 | 397 | |
| 398 | 398 | $date_format = str_replace($search, $replace, $date_format); |
| 399 | 399 | |
| 400 | 400 | $post_htmlvar_value = $date_format == 'd/m/Y' ? str_replace('/', '-', $request_info[$name]) : $request_info[$name];
|
| 401 | 401 | |
| 402 | - }else{
|
|
| 402 | + } else {
|
|
| 403 | 403 | $post_htmlvar_value = $request_info[$name]; |
| 404 | 404 | } |
| 405 | 405 | |
@@ -414,7 +414,7 @@ discard block |
||
| 414 | 414 | if (isset($request_info[$name])) {
|
| 415 | 415 | $gd_post_info[$name] = $request_info[$name]; |
| 416 | 416 | } else {
|
| 417 | - if (isset($request_info['gd_field_' . $name])) {
|
|
| 417 | + if (isset($request_info['gd_field_'.$name])) {
|
|
| 418 | 418 | $gd_post_info[$name] = ''; /* fix de-select for multiselect */ |
| 419 | 419 | } |
| 420 | 420 | } |
@@ -474,7 +474,7 @@ discard block |
||
| 474 | 474 | } |
| 475 | 475 | |
| 476 | 476 | if (is_array($post_tags)) {
|
| 477 | - $taxonomy = $request_info['listing_type'] . '_tags'; |
|
| 477 | + $taxonomy = $request_info['listing_type'].'_tags'; |
|
| 478 | 478 | wp_set_object_terms($last_post_id, $post_tags, $taxonomy); |
| 479 | 479 | } |
| 480 | 480 | |
@@ -486,7 +486,7 @@ discard block |
||
| 486 | 486 | $tmpimgArr = trim($request_info['post_images'], ","); |
| 487 | 487 | $tmpimgArr = explode(",", $tmpimgArr);
|
| 488 | 488 | geodir_save_post_images($last_post_id, $tmpimgArr, $dummy); |
| 489 | - } else{
|
|
| 489 | + } else {
|
|
| 490 | 490 | geodir_save_post_images($last_post_id, $request_info['post_images'], $dummy); |
| 491 | 491 | } |
| 492 | 492 | |
@@ -567,7 +567,7 @@ discard block |
||
| 567 | 567 | if (!in_array($post_type, $all_postypes)) |
| 568 | 568 | return false; |
| 569 | 569 | |
| 570 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 570 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
| 571 | 571 | |
| 572 | 572 | /** |
| 573 | 573 | * Apply Filter to change Post info |
@@ -577,7 +577,7 @@ discard block |
||
| 577 | 577 | * @since 1.0.0 |
| 578 | 578 | * @package GeoDirectory |
| 579 | 579 | */ |
| 580 | - $query = apply_filters('geodir_post_info_query', "SELECT p.*,pd.* FROM " . $wpdb->posts . " p," . $table . " pd
|
|
| 580 | + $query = apply_filters('geodir_post_info_query', "SELECT p.*,pd.* FROM ".$wpdb->posts." p,".$table." pd
|
|
| 581 | 581 | WHERE p.ID = pd.post_id |
| 582 | 582 | AND post_id = " . $post_id); |
| 583 | 583 | |
@@ -640,7 +640,7 @@ discard block |
||
| 640 | 640 | |
| 641 | 641 | $post_type = get_post_type($post_id); |
| 642 | 642 | |
| 643 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 643 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
| 644 | 644 | |
| 645 | 645 | /** |
| 646 | 646 | * Filter to change Post info |
@@ -663,7 +663,7 @@ discard block |
||
| 663 | 663 | $mval = implode(",", $mval);
|
| 664 | 664 | } |
| 665 | 665 | |
| 666 | - $post_meta_set_query .= $mkey . " = '" . addslashes_gpc($mval) . "', "; |
|
| 666 | + $post_meta_set_query .= $mkey." = '".addslashes_gpc($mval)."', "; |
|
| 667 | 667 | } |
| 668 | 668 | } |
| 669 | 669 | |
@@ -673,7 +673,7 @@ discard block |
||
| 673 | 673 | return false; |
| 674 | 674 | } |
| 675 | 675 | |
| 676 | - $post_meta_set_query = str_replace('%', '%%', $post_meta_set_query);// escape %
|
|
| 676 | + $post_meta_set_query = str_replace('%', '%%', $post_meta_set_query); // escape %
|
|
| 677 | 677 | |
| 678 | 678 | |
| 679 | 679 | /** |
@@ -686,11 +686,11 @@ discard block |
||
| 686 | 686 | */ |
| 687 | 687 | do_action('geodir_before_save_listinginfo', $postinfo_array, $post_id);
|
| 688 | 688 | |
| 689 | - if ($wpdb->get_var($wpdb->prepare("SELECT post_id from " . $table . " where post_id = %d", array($post_id)))) {
|
|
| 689 | + if ($wpdb->get_var($wpdb->prepare("SELECT post_id from ".$table." where post_id = %d", array($post_id)))) {
|
|
| 690 | 690 | |
| 691 | 691 | $wpdb->query( |
| 692 | 692 | $wpdb->prepare( |
| 693 | - "UPDATE " . $table . " SET " . $post_meta_set_query . " where post_id =%d", |
|
| 693 | + "UPDATE ".$table." SET ".$post_meta_set_query." where post_id =%d", |
|
| 694 | 694 | array($post_id) |
| 695 | 695 | ) |
| 696 | 696 | ); |
@@ -700,7 +700,7 @@ discard block |
||
| 700 | 700 | |
| 701 | 701 | $wpdb->query( |
| 702 | 702 | $wpdb->prepare( |
| 703 | - "INSERT INTO " . $table . " SET post_id = %d," . $post_meta_set_query, |
|
| 703 | + "INSERT INTO ".$table." SET post_id = %d,".$post_meta_set_query, |
|
| 704 | 704 | array($post_id) |
| 705 | 705 | ) |
| 706 | 706 | ); |
@@ -746,7 +746,7 @@ discard block |
||
| 746 | 746 | |
| 747 | 747 | $post_type = get_post_type($post_id); |
| 748 | 748 | |
| 749 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 749 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
| 750 | 750 | |
| 751 | 751 | if ($postmeta != '' && geodir_column_exist($table, $postmeta) && $post_id) {
|
| 752 | 752 | |
@@ -754,11 +754,11 @@ discard block |
||
| 754 | 754 | $meta_value = implode(",", $meta_value);
|
| 755 | 755 | } |
| 756 | 756 | |
| 757 | - if ($wpdb->get_var($wpdb->prepare("SELECT post_id from " . $table . " where post_id = %d", array($post_id)))) {
|
|
| 757 | + if ($wpdb->get_var($wpdb->prepare("SELECT post_id from ".$table." where post_id = %d", array($post_id)))) {
|
|
| 758 | 758 | |
| 759 | 759 | $wpdb->query( |
| 760 | 760 | $wpdb->prepare( |
| 761 | - "UPDATE " . $table . " SET " . $postmeta . " = '" . $meta_value . "' where post_id =%d", |
|
| 761 | + "UPDATE ".$table." SET ".$postmeta." = '".$meta_value."' where post_id =%d", |
|
| 762 | 762 | array($post_id) |
| 763 | 763 | ) |
| 764 | 764 | ); |
@@ -767,7 +767,7 @@ discard block |
||
| 767 | 767 | |
| 768 | 768 | $wpdb->query( |
| 769 | 769 | $wpdb->prepare( |
| 770 | - "INSERT INTO " . $table . " SET post_id = %d, " . $postmeta . " = '" . $meta_value . "'", |
|
| 770 | + "INSERT INTO ".$table." SET post_id = %d, ".$postmeta." = '".$meta_value."'", |
|
| 771 | 771 | array($post_id) |
| 772 | 772 | ) |
| 773 | 773 | ); |
@@ -800,14 +800,14 @@ discard block |
||
| 800 | 800 | |
| 801 | 801 | $post_type = get_post_type($post_id); |
| 802 | 802 | |
| 803 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 803 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
| 804 | 804 | |
| 805 | 805 | if (is_array($postmeta) && !empty($postmeta) && $post_id) {
|
| 806 | 806 | $post_meta_set_query = ''; |
| 807 | 807 | |
| 808 | 808 | foreach ($postmeta as $mkey) {
|
| 809 | 809 | if ($mval != '') |
| 810 | - $post_meta_set_query .= $mkey . " = '', "; |
|
| 810 | + $post_meta_set_query .= $mkey." = '', "; |
|
| 811 | 811 | } |
| 812 | 812 | |
| 813 | 813 | $post_meta_set_query = trim($post_meta_set_query, ", "); |
@@ -816,11 +816,11 @@ discard block |
||
| 816 | 816 | return false; |
| 817 | 817 | } |
| 818 | 818 | |
| 819 | - if ($wpdb->get_var("SHOW COLUMNS FROM " . $table . " WHERE field = '" . $postmeta . "'") != '') {
|
|
| 819 | + if ($wpdb->get_var("SHOW COLUMNS FROM ".$table." WHERE field = '".$postmeta."'") != '') {
|
|
| 820 | 820 | |
| 821 | 821 | $wpdb->query( |
| 822 | 822 | $wpdb->prepare( |
| 823 | - "UPDATE " . $table . " SET " . $post_meta_set_query . " where post_id = %d", |
|
| 823 | + "UPDATE ".$table." SET ".$post_meta_set_query." where post_id = %d", |
|
| 824 | 824 | array($post_id) |
| 825 | 825 | ) |
| 826 | 826 | ); |
@@ -829,11 +829,11 @@ discard block |
||
| 829 | 829 | } |
| 830 | 830 | |
| 831 | 831 | } elseif ($postmeta != '' && $post_id) {
|
| 832 | - if ($wpdb->get_var("SHOW COLUMNS FROM " . $table . " WHERE field = '" . $postmeta . "'") != '') {
|
|
| 832 | + if ($wpdb->get_var("SHOW COLUMNS FROM ".$table." WHERE field = '".$postmeta."'") != '') {
|
|
| 833 | 833 | |
| 834 | 834 | $wpdb->query( |
| 835 | 835 | $wpdb->prepare( |
| 836 | - "UPDATE " . $table . " SET " . $postmeta . "= '' where post_id = %d", |
|
| 836 | + "UPDATE ".$table." SET ".$postmeta."= '' where post_id = %d", |
|
| 837 | 837 | array($post_id) |
| 838 | 838 | ) |
| 839 | 839 | ); |
@@ -875,10 +875,10 @@ discard block |
||
| 875 | 875 | if (!in_array($post_type, $all_postypes)) |
| 876 | 876 | return false; |
| 877 | 877 | |
| 878 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 878 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
| 879 | 879 | |
| 880 | - if ($wpdb->get_var("SHOW COLUMNS FROM " . $table . " WHERE field = '" . $meta_key . "'") != '') {
|
|
| 881 | - $meta_value = $wpdb->get_var($wpdb->prepare("SELECT " . $meta_key . " from " . $table . " where post_id = %d", array($post_id)));
|
|
| 880 | + if ($wpdb->get_var("SHOW COLUMNS FROM ".$table." WHERE field = '".$meta_key."'") != '') {
|
|
| 881 | + $meta_value = $wpdb->get_var($wpdb->prepare("SELECT ".$meta_key." from ".$table." where post_id = %d", array($post_id)));
|
|
| 882 | 882 | |
| 883 | 883 | if ($meta_value && $meta_value !== '') {
|
| 884 | 884 | return maybe_serialize($meta_value); |
@@ -912,13 +912,13 @@ discard block |
||
| 912 | 912 | |
| 913 | 913 | $post_type = get_post_type($post_id); |
| 914 | 914 | |
| 915 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 915 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
| 916 | 916 | |
| 917 | 917 | $post_images = geodir_get_images($post_id); |
| 918 | 918 | |
| 919 | 919 | $wpdb->query( |
| 920 | 920 | $wpdb->prepare( |
| 921 | - "UPDATE " . $table . " SET featured_image = '' where post_id =%d", |
|
| 921 | + "UPDATE ".$table." SET featured_image = '' where post_id =%d", |
|
| 922 | 922 | array($post_id) |
| 923 | 923 | ) |
| 924 | 924 | ); |
@@ -948,12 +948,12 @@ discard block |
||
| 948 | 948 | $file_path = ''; |
| 949 | 949 | /* --------- start ------- */ |
| 950 | 950 | |
| 951 | - $split_img_path = explode(str_replace(array('http://','https://'),'',$uploads['baseurl']), str_replace(array('http://','https://'),'',$post_image[$m]));
|
|
| 951 | + $split_img_path = explode(str_replace(array('http://', 'https://'), '', $uploads['baseurl']), str_replace(array('http://', 'https://'), '', $post_image[$m]));
|
|
| 952 | 952 | |
| 953 | 953 | $split_img_file_path = isset($split_img_path[1]) ? $split_img_path[1] : ''; |
| 954 | 954 | |
| 955 | 955 | |
| 956 | - if (!$find_image = $wpdb->get_var($wpdb->prepare("SELECT ID FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE file=%s AND post_id = %d", array($split_img_file_path, $post_id)))) {
|
|
| 956 | + if (!$find_image = $wpdb->get_var($wpdb->prepare("SELECT ID FROM ".GEODIR_ATTACHMENT_TABLE." WHERE file=%s AND post_id = %d", array($split_img_file_path, $post_id)))) {
|
|
| 957 | 957 | |
| 958 | 958 | /* --------- end ------- */ |
| 959 | 959 | $curr_img_url = $post_image[$m]; |
@@ -997,7 +997,7 @@ discard block |
||
| 997 | 997 | // If the uploaded file is the right format |
| 998 | 998 | if (in_array($uploaded_file_type, $allowed_file_types)) {
|
| 999 | 999 | if (!function_exists('wp_handle_upload')) {
|
| 1000 | - require_once(ABSPATH . 'wp-admin/includes/file.php'); |
|
| 1000 | + require_once(ABSPATH.'wp-admin/includes/file.php'); |
|
| 1001 | 1001 | } |
| 1002 | 1002 | |
| 1003 | 1003 | if (!is_dir($geodir_uploadpath)) {
|
@@ -1005,41 +1005,41 @@ discard block |
||
| 1005 | 1005 | } |
| 1006 | 1006 | |
| 1007 | 1007 | $external_img = false; |
| 1008 | - if (strpos(str_replace(array('http://','https://'),'',$curr_img_url), str_replace(array('http://','https://'),'',$uploads['baseurl'])) !== false) {
|
|
| 1008 | + if (strpos(str_replace(array('http://', 'https://'), '', $curr_img_url), str_replace(array('http://', 'https://'), '', $uploads['baseurl'])) !== false) {
|
|
| 1009 | 1009 | } else {
|
| 1010 | 1010 | $external_img = true; |
| 1011 | 1011 | } |
| 1012 | 1012 | |
| 1013 | 1013 | if ($dummy || $external_img) {
|
| 1014 | 1014 | $uploaded_file = array(); |
| 1015 | - $uploaded = (array)fetch_remote_file($curr_img_url); |
|
| 1015 | + $uploaded = (array) fetch_remote_file($curr_img_url); |
|
| 1016 | 1016 | |
| 1017 | 1017 | if (isset($uploaded['error']) && empty($uploaded['error'])) {
|
| 1018 | 1018 | $new_name = basename($uploaded['file']); |
| 1019 | 1019 | $uploaded_file = $uploaded; |
| 1020 | - }else{
|
|
| 1021 | - print_r($uploaded);exit; |
|
| 1020 | + } else {
|
|
| 1021 | + print_r($uploaded); exit; |
|
| 1022 | 1022 | } |
| 1023 | 1023 | $external_img = false; |
| 1024 | 1024 | } else {
|
| 1025 | - $new_name = $post_id . '_' . $file_name; |
|
| 1025 | + $new_name = $post_id.'_'.$file_name; |
|
| 1026 | 1026 | |
| 1027 | 1027 | if ($curr_img_dir == $sub_dir) {
|
| 1028 | - $img_path = $geodir_uploadpath . '/' . $filename; |
|
| 1029 | - $img_url = $geodir_uploadurl . '/' . $filename; |
|
| 1028 | + $img_path = $geodir_uploadpath.'/'.$filename; |
|
| 1029 | + $img_url = $geodir_uploadurl.'/'.$filename; |
|
| 1030 | 1030 | } else {
|
| 1031 | - $img_path = $uploads_dir . '/temp_' . $current_user->data->ID . '/' . $filename; |
|
| 1032 | - $img_url = $uploads['url'] . '/temp_' . $current_user->data->ID . '/' . $filename; |
|
| 1031 | + $img_path = $uploads_dir.'/temp_'.$current_user->data->ID.'/'.$filename; |
|
| 1032 | + $img_url = $uploads['url'].'/temp_'.$current_user->data->ID.'/'.$filename; |
|
| 1033 | 1033 | } |
| 1034 | 1034 | |
| 1035 | 1035 | $uploaded_file = ''; |
| 1036 | 1036 | |
| 1037 | 1037 | if (file_exists($img_path)) {
|
| 1038 | - $uploaded_file = copy($img_path, $geodir_uploadpath . '/' . $new_name); |
|
| 1038 | + $uploaded_file = copy($img_path, $geodir_uploadpath.'/'.$new_name); |
|
| 1039 | 1039 | $file_path = ''; |
| 1040 | - } else if (file_exists($uploads['basedir'] . $curr_img_dir . $filename)) {
|
|
| 1040 | + } else if (file_exists($uploads['basedir'].$curr_img_dir.$filename)) {
|
|
| 1041 | 1041 | $uploaded_file = true; |
| 1042 | - $file_path = $curr_img_dir . '/' . $filename; |
|
| 1042 | + $file_path = $curr_img_dir.'/'.$filename; |
|
| 1043 | 1043 | } |
| 1044 | 1044 | |
| 1045 | 1045 | if ($curr_img_dir != $geodir_uploaddir && file_exists($img_path)) |
@@ -1048,14 +1048,14 @@ discard block |
||
| 1048 | 1048 | |
| 1049 | 1049 | if (!empty($uploaded_file)) {
|
| 1050 | 1050 | if (!isset($file_path) || !$file_path) {
|
| 1051 | - $file_path = $sub_dir . '/' . $new_name; |
|
| 1051 | + $file_path = $sub_dir.'/'.$new_name; |
|
| 1052 | 1052 | } |
| 1053 | 1053 | |
| 1054 | - $postcurr_images[] = str_replace(array('http://','https://'),'',$uploads['baseurl'] . $file_path);
|
|
| 1054 | + $postcurr_images[] = str_replace(array('http://', 'https://'), '', $uploads['baseurl'].$file_path);
|
|
| 1055 | 1055 | |
| 1056 | 1056 | if ($menu_order == 1) {
|
| 1057 | 1057 | |
| 1058 | - $wpdb->query($wpdb->prepare("UPDATE " . $table . " SET featured_image = %s where post_id =%d", array($file_path, $post_id)));
|
|
| 1058 | + $wpdb->query($wpdb->prepare("UPDATE ".$table." SET featured_image = %s where post_id =%d", array($file_path, $post_id)));
|
|
| 1059 | 1059 | |
| 1060 | 1060 | } |
| 1061 | 1061 | |
@@ -1073,12 +1073,12 @@ discard block |
||
| 1073 | 1073 | |
| 1074 | 1074 | foreach ($attachment as $key => $val) {
|
| 1075 | 1075 | if ($val != '') |
| 1076 | - $attachment_set .= $key . " = '" . $val . "', "; |
|
| 1076 | + $attachment_set .= $key." = '".$val."', "; |
|
| 1077 | 1077 | } |
| 1078 | 1078 | |
| 1079 | 1079 | $attachment_set = trim($attachment_set, ", "); |
| 1080 | 1080 | |
| 1081 | - $wpdb->query("INSERT INTO " . GEODIR_ATTACHMENT_TABLE . " SET " . $attachment_set);
|
|
| 1081 | + $wpdb->query("INSERT INTO ".GEODIR_ATTACHMENT_TABLE." SET ".$attachment_set);
|
|
| 1082 | 1082 | |
| 1083 | 1083 | $valid_file_ids[] = $wpdb->insert_id; |
| 1084 | 1084 | } |
@@ -1089,17 +1089,17 @@ discard block |
||
| 1089 | 1089 | } else {
|
| 1090 | 1090 | $valid_file_ids[] = $find_image; |
| 1091 | 1091 | |
| 1092 | - $postcurr_images[] = str_replace(array('http://','https://'),'',$post_image[$m]);
|
|
| 1092 | + $postcurr_images[] = str_replace(array('http://', 'https://'), '', $post_image[$m]);
|
|
| 1093 | 1093 | |
| 1094 | 1094 | $wpdb->query( |
| 1095 | 1095 | $wpdb->prepare( |
| 1096 | - "UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order = %d where file =%s AND post_id =%d", |
|
| 1096 | + "UPDATE ".GEODIR_ATTACHMENT_TABLE." SET menu_order = %d where file =%s AND post_id =%d", |
|
| 1097 | 1097 | array($menu_order, $split_img_path[1], $post_id) |
| 1098 | 1098 | ) |
| 1099 | 1099 | ); |
| 1100 | 1100 | |
| 1101 | 1101 | if ($menu_order == 1) |
| 1102 | - $wpdb->query($wpdb->prepare("UPDATE " . $table . " SET featured_image = %s where post_id =%d", array($split_img_path[1], $post_id)));
|
|
| 1102 | + $wpdb->query($wpdb->prepare("UPDATE ".$table." SET featured_image = %s where post_id =%d", array($split_img_path[1], $post_id)));
|
|
| 1103 | 1103 | |
| 1104 | 1104 | } |
| 1105 | 1105 | |
@@ -1123,9 +1123,9 @@ discard block |
||
| 1123 | 1123 | |
| 1124 | 1124 | foreach ($post_images as $img) {
|
| 1125 | 1125 | |
| 1126 | - if (!in_array(str_replace(array('http://','https://'),'',$img->src), $postcurr_images)) {
|
|
| 1126 | + if (!in_array(str_replace(array('http://', 'https://'), '', $img->src), $postcurr_images)) {
|
|
| 1127 | 1127 | |
| 1128 | - $invalid_files[] = (object)array('src' => $img->src);
|
|
| 1128 | + $invalid_files[] = (object) array('src' => $img->src);
|
|
| 1129 | 1129 | |
| 1130 | 1130 | } |
| 1131 | 1131 | |
@@ -1133,12 +1133,12 @@ discard block |
||
| 1133 | 1133 | |
| 1134 | 1134 | } |
| 1135 | 1135 | |
| 1136 | - $invalid_files = (object)$invalid_files; |
|
| 1136 | + $invalid_files = (object) $invalid_files; |
|
| 1137 | 1137 | } |
| 1138 | 1138 | |
| 1139 | 1139 | $remove_files[] = $post_id; |
| 1140 | 1140 | |
| 1141 | - $wpdb->query($wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE " . $valid_files_condition . " post_id = %d", $remove_files));
|
|
| 1141 | + $wpdb->query($wpdb->prepare("DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE ".$valid_files_condition." post_id = %d", $remove_files));
|
|
| 1142 | 1142 | |
| 1143 | 1143 | if (!empty($invalid_files)) |
| 1144 | 1144 | geodir_remove_attachments($invalid_files); |
@@ -1178,7 +1178,7 @@ discard block |
||
| 1178 | 1178 | rmdir($dirPath); |
| 1179 | 1179 | } */ |
| 1180 | 1180 | |
| 1181 | - $dirname = $uploads_dir . '/temp_' . $current_user->ID; |
|
| 1181 | + $dirname = $uploads_dir.'/temp_'.$current_user->ID; |
|
| 1182 | 1182 | geodir_delete_directory($dirname); |
| 1183 | 1183 | } |
| 1184 | 1184 | |
@@ -1200,10 +1200,10 @@ discard block |
||
| 1200 | 1200 | return false; |
| 1201 | 1201 | while ($file = readdir($dir_handle)) {
|
| 1202 | 1202 | if ($file != "." && $file != "..") {
|
| 1203 | - if (!is_dir($dirname . "/" . $file)) |
|
| 1204 | - unlink($dirname . "/" . $file); |
|
| 1203 | + if (!is_dir($dirname."/".$file)) |
|
| 1204 | + unlink($dirname."/".$file); |
|
| 1205 | 1205 | else |
| 1206 | - geodir_delete_directory($dirname . '/' . $file); |
|
| 1206 | + geodir_delete_directory($dirname.'/'.$file); |
|
| 1207 | 1207 | } |
| 1208 | 1208 | } |
| 1209 | 1209 | closedir($dir_handle); |
@@ -1232,8 +1232,8 @@ discard block |
||
| 1232 | 1232 | foreach ($postcurr_images as $postimg) {
|
| 1233 | 1233 | $image_name_arr = explode('/', $postimg->src);
|
| 1234 | 1234 | $filename = end($image_name_arr); |
| 1235 | - if (file_exists($uploads_dir . '/' . $filename)) |
|
| 1236 | - unlink($uploads_dir . '/' . $filename); |
|
| 1235 | + if (file_exists($uploads_dir.'/'.$filename)) |
|
| 1236 | + unlink($uploads_dir.'/'.$filename); |
|
| 1237 | 1237 | } |
| 1238 | 1238 | |
| 1239 | 1239 | } // endif |
@@ -1274,16 +1274,16 @@ discard block |
||
| 1274 | 1274 | } |
| 1275 | 1275 | |
| 1276 | 1276 | if (!in_array($post_type, geodir_get_posttypes())) {
|
| 1277 | - return false;// if not a GD CPT return; |
|
| 1277 | + return false; // if not a GD CPT return; |
|
| 1278 | 1278 | } |
| 1279 | 1279 | |
| 1280 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 1280 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
| 1281 | 1281 | |
| 1282 | 1282 | if (!$file) {
|
| 1283 | 1283 | if (isset($post->featured_image)) {
|
| 1284 | 1284 | $file = $post->featured_image; |
| 1285 | 1285 | } else {
|
| 1286 | - $file = $wpdb->get_var($wpdb->prepare("SELECT featured_image FROM " . $table . " WHERE post_id = %d", array($post_id)));
|
|
| 1286 | + $file = $wpdb->get_var($wpdb->prepare("SELECT featured_image FROM ".$table." WHERE post_id = %d", array($post_id)));
|
|
| 1287 | 1287 | } |
| 1288 | 1288 | } |
| 1289 | 1289 | |
@@ -1301,7 +1301,7 @@ discard block |
||
| 1301 | 1301 | |
| 1302 | 1302 | $file_name = $file_info['basename']; |
| 1303 | 1303 | |
| 1304 | - $uploads_url = $uploads_baseurl . $sub_dir; |
|
| 1304 | + $uploads_url = $uploads_baseurl.$sub_dir; |
|
| 1305 | 1305 | /* |
| 1306 | 1306 | * Allows the filter of image src for such things as CDN change. |
| 1307 | 1307 | * |
@@ -1311,8 +1311,8 @@ discard block |
||
| 1311 | 1311 | * @param string $uploads_url The server upload directory url. |
| 1312 | 1312 | * @param string $uploads_baseurl The uploads dir base url. |
| 1313 | 1313 | */ |
| 1314 | - $img_arr['src'] = apply_filters('geodir_get_featured_image_src',$uploads_url . '/' . $file_name,$file_name,$uploads_url,$uploads_baseurl);
|
|
| 1315 | - $img_arr['path'] = $uploads_path . '/' . $file_name; |
|
| 1314 | + $img_arr['src'] = apply_filters('geodir_get_featured_image_src', $uploads_url.'/'.$file_name, $file_name, $uploads_url, $uploads_baseurl);
|
|
| 1315 | + $img_arr['path'] = $uploads_path.'/'.$file_name; |
|
| 1316 | 1316 | $width = 0; |
| 1317 | 1317 | $height = 0; |
| 1318 | 1318 | if (is_file($img_arr['path']) && file_exists($img_arr['path'])) {
|
@@ -1355,7 +1355,7 @@ discard block |
||
| 1355 | 1355 | $file_name = $file_info['basename']; |
| 1356 | 1356 | |
| 1357 | 1357 | $img_arr['src'] = $default_img; |
| 1358 | - $img_arr['path'] = $uploads_path . '/' . $file_name; |
|
| 1358 | + $img_arr['path'] = $uploads_path.'/'.$file_name; |
|
| 1359 | 1359 | |
| 1360 | 1360 | $width = 0; |
| 1361 | 1361 | $height = 0; |
@@ -1372,7 +1372,7 @@ discard block |
||
| 1372 | 1372 | } |
| 1373 | 1373 | |
| 1374 | 1374 | if (!empty($img_arr)) |
| 1375 | - return (object)$img_arr;//return (object)array( 'src' => $file_url, 'path' => $file_path ); |
|
| 1375 | + return (object) $img_arr; //return (object)array( 'src' => $file_url, 'path' => $file_path ); |
|
| 1376 | 1376 | else |
| 1377 | 1377 | return false; |
| 1378 | 1378 | } |
@@ -1435,7 +1435,7 @@ discard block |
||
| 1435 | 1435 | |
| 1436 | 1436 | $arrImages = $wpdb->get_results( |
| 1437 | 1437 | $wpdb->prepare( |
| 1438 | - "SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE mime_type like %s AND post_id = %d" . $not_featured . " ORDER BY menu_order ASC, ID DESC $limit_q ", |
|
| 1438 | + "SELECT * FROM ".GEODIR_ATTACHMENT_TABLE." WHERE mime_type like %s AND post_id = %d".$not_featured." ORDER BY menu_order ASC, ID DESC $limit_q ", |
|
| 1439 | 1439 | array('%image%', $post_id)
|
| 1440 | 1440 | ) |
| 1441 | 1441 | ); |
@@ -1461,7 +1461,7 @@ discard block |
||
| 1461 | 1461 | |
| 1462 | 1462 | $file_name = $file_info['basename']; |
| 1463 | 1463 | |
| 1464 | - $uploads_url = $uploads_baseurl . $sub_dir; |
|
| 1464 | + $uploads_url = $uploads_baseurl.$sub_dir; |
|
| 1465 | 1465 | /* |
| 1466 | 1466 | * Allows the filter of image src for such things as CDN change. |
| 1467 | 1467 | * |
@@ -1471,8 +1471,8 @@ discard block |
||
| 1471 | 1471 | * @param string $uploads_url The server upload directory url. |
| 1472 | 1472 | * @param string $uploads_baseurl The uploads dir base url. |
| 1473 | 1473 | */ |
| 1474 | - $img_arr['src'] = apply_filters('geodir_get_images_src',$uploads_url . '/' . $file_name,$file_name,$uploads_url,$uploads_baseurl);
|
|
| 1475 | - $img_arr['path'] = $uploads_path . '/' . $file_name; |
|
| 1474 | + $img_arr['src'] = apply_filters('geodir_get_images_src', $uploads_url.'/'.$file_name, $file_name, $uploads_url, $uploads_baseurl);
|
|
| 1475 | + $img_arr['path'] = $uploads_path.'/'.$file_name; |
|
| 1476 | 1476 | $width = 0; |
| 1477 | 1477 | $height = 0; |
| 1478 | 1478 | if (is_file($img_arr['path']) && file_exists($img_arr['path'])) {
|
@@ -1489,11 +1489,11 @@ discard block |
||
| 1489 | 1489 | $img_arr['content'] = $attechment->content; // add the description to the array |
| 1490 | 1490 | $img_arr['is_approved'] = isset($attechment->is_approved) ? $attechment->is_approved : ''; // used for user image moderation. For backward compatibility Default value is 1. |
| 1491 | 1491 | |
| 1492 | - $return_arr[] = (object)$img_arr; |
|
| 1492 | + $return_arr[] = (object) $img_arr; |
|
| 1493 | 1493 | |
| 1494 | 1494 | $counter++; |
| 1495 | 1495 | } |
| 1496 | - return (object)$return_arr; |
|
| 1496 | + return (object) $return_arr; |
|
| 1497 | 1497 | } else if ($no_images) {
|
| 1498 | 1498 | $default_img = ''; |
| 1499 | 1499 | $default_cat = geodir_get_post_meta($post_id, 'default_category', true); |
@@ -1532,7 +1532,7 @@ discard block |
||
| 1532 | 1532 | $img_arr['title'] = $file_info['filename']; // add the title to the array |
| 1533 | 1533 | $img_arr['content'] = $file_info['filename']; // add the description to the array |
| 1534 | 1534 | |
| 1535 | - $return_arr[] = (object)$img_arr; |
|
| 1535 | + $return_arr[] = (object) $img_arr; |
|
| 1536 | 1536 | |
| 1537 | 1537 | return $return_arr; |
| 1538 | 1538 | } else |
@@ -1559,8 +1559,8 @@ discard block |
||
| 1559 | 1559 | |
| 1560 | 1560 | $html = ''; |
| 1561 | 1561 | if (!empty($request)) {
|
| 1562 | - if (!is_object($request)){
|
|
| 1563 | - $request = (object)$request; |
|
| 1562 | + if (!is_object($request)) {
|
|
| 1563 | + $request = (object) $request; |
|
| 1564 | 1564 | } |
| 1565 | 1565 | |
| 1566 | 1566 | if (isset($request->src) && !isset($request->path)) {
|
@@ -1574,7 +1574,7 @@ discard block |
||
| 1574 | 1574 | $img_no_http = str_replace(array("http://", "https://"), "", $request->path);
|
| 1575 | 1575 | $upload_no_http = str_replace(array("http://", "https://"), "", $upload_dir['baseurl']);
|
| 1576 | 1576 | if (strpos($img_no_http, $upload_no_http) !== false) {
|
| 1577 | - $request->path = str_replace( $img_no_http,$upload_dir['basedir'], $request->path); |
|
| 1577 | + $request->path = str_replace($img_no_http, $upload_dir['basedir'], $request->path); |
|
| 1578 | 1578 | } |
| 1579 | 1579 | |
| 1580 | 1580 | $width = 0; |
@@ -1589,7 +1589,7 @@ discard block |
||
| 1589 | 1589 | $image->width = $width; |
| 1590 | 1590 | $image->height = $height; |
| 1591 | 1591 | |
| 1592 | - $max_size = (object)geodir_get_imagesize($size); |
|
| 1592 | + $max_size = (object) geodir_get_imagesize($size); |
|
| 1593 | 1593 | |
| 1594 | 1594 | if (!is_wp_error($max_size)) {
|
| 1595 | 1595 | if ($image->width) {
|
@@ -1601,15 +1601,15 @@ discard block |
||
| 1601 | 1601 | $width_per = 100; |
| 1602 | 1602 | } |
| 1603 | 1603 | |
| 1604 | - if (is_admin() && !isset($_REQUEST['geodir_ajax'])){
|
|
| 1605 | - $html = '<div class="geodir_thumbnail"><img style="max-height:' . $max_size->h . 'px;" alt="place image" src="' . $image->src . '" /></div>'; |
|
| 1604 | + if (is_admin() && !isset($_REQUEST['geodir_ajax'])) {
|
|
| 1605 | + $html = '<div class="geodir_thumbnail"><img style="max-height:'.$max_size->h.'px;" alt="place image" src="'.$image->src.'" /></div>'; |
|
| 1606 | 1606 | } else {
|
| 1607 | - if($size=='widget-thumb' || !get_option('geodir_lazy_load',1)){
|
|
| 1608 | - $html = '<div class="geodir_thumbnail" style="background-image:url(\'' . $image->src . '\');"></div>'; |
|
| 1609 | - }else{
|
|
| 1607 | + if ($size == 'widget-thumb' || !get_option('geodir_lazy_load', 1)) {
|
|
| 1608 | + $html = '<div class="geodir_thumbnail" style="background-image:url(\''.$image->src.'\');"></div>'; |
|
| 1609 | + } else {
|
|
| 1610 | 1610 | //$html = '<div class="geodir_thumbnail" style="background-image:url(\'' . $image->src . '\');"></div>'; |
| 1611 | 1611 | //$html = '<div data-src="'.$image->src.'" class="geodir_thumbnail" ></div>'; |
| 1612 | - $html = '<div data-src="'.str_replace(' ','%20',$image->src).'" class="geodir_thumbnail geodir_lazy_load_thumbnail" ></div>';
|
|
| 1612 | + $html = '<div data-src="'.str_replace(' ', '%20', $image->src).'" class="geodir_thumbnail geodir_lazy_load_thumbnail" ></div>';
|
|
| 1613 | 1613 | |
| 1614 | 1614 | } |
| 1615 | 1615 | |
@@ -1645,15 +1645,15 @@ discard block |
||
| 1645 | 1645 | |
| 1646 | 1646 | $post_type = get_post_type($post_id); |
| 1647 | 1647 | |
| 1648 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 1648 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
| 1649 | 1649 | |
| 1650 | 1650 | if (in_array($post_type, geodir_get_posttypes()) && !wp_is_post_revision($post_id)) {
|
| 1651 | 1651 | |
| 1652 | - if ($taxonomy == $post_type . '_tags') {
|
|
| 1652 | + if ($taxonomy == $post_type.'_tags') {
|
|
| 1653 | 1653 | if (isset($_POST['action']) && $_POST['action'] == 'inline-save') {
|
| 1654 | 1654 | geodir_save_post_meta($post_id, 'post_tags', $terms); |
| 1655 | 1655 | } |
| 1656 | - } elseif ($taxonomy == $post_type . 'category') {
|
|
| 1656 | + } elseif ($taxonomy == $post_type.'category') {
|
|
| 1657 | 1657 | $srcharr = array('"', '\\');
|
| 1658 | 1658 | $replarr = array(""", '');
|
| 1659 | 1659 | |
@@ -1675,7 +1675,7 @@ discard block |
||
| 1675 | 1675 | |
| 1676 | 1676 | $wpdb->get_var( |
| 1677 | 1677 | $wpdb->prepare( |
| 1678 | - "DELETE from " . GEODIR_ICON_TABLE . " WHERE cat_id NOT IN ($format) AND post_id = %d ", |
|
| 1678 | + "DELETE from ".GEODIR_ICON_TABLE." WHERE cat_id NOT IN ($format) AND post_id = %d ", |
|
| 1679 | 1679 | $cat_ids_array_del |
| 1680 | 1680 | ) |
| 1681 | 1681 | ); |
@@ -1683,7 +1683,7 @@ discard block |
||
| 1683 | 1683 | |
| 1684 | 1684 | $post_term = $wpdb->get_col( |
| 1685 | 1685 | $wpdb->prepare( |
| 1686 | - "SELECT term_id FROM " . $wpdb->term_taxonomy . " WHERE term_taxonomy_id IN($format) GROUP BY term_id", |
|
| 1686 | + "SELECT term_id FROM ".$wpdb->term_taxonomy." WHERE term_taxonomy_id IN($format) GROUP BY term_id", |
|
| 1687 | 1687 | $cat_ids_array |
| 1688 | 1688 | ) |
| 1689 | 1689 | ); |
@@ -1705,16 +1705,16 @@ discard block |
||
| 1705 | 1705 | $lat = geodir_get_post_meta($post_id, 'post_latitude', true); |
| 1706 | 1706 | $lng = geodir_get_post_meta($post_id, 'post_longitude', true); |
| 1707 | 1707 | |
| 1708 | - $timing = ' - ' . date('D M j, Y', strtotime(geodir_get_post_meta($post_id, 'st_date', true)));
|
|
| 1709 | - $timing .= ' - ' . geodir_get_post_meta($post_id, 'st_time', true); |
|
| 1708 | + $timing = ' - '.date('D M j, Y', strtotime(geodir_get_post_meta($post_id, 'st_date', true)));
|
|
| 1709 | + $timing .= ' - '.geodir_get_post_meta($post_id, 'st_time', true); |
|
| 1710 | 1710 | |
| 1711 | 1711 | $json = '{';
|
| 1712 | - $json .= '"id":"' . $post_id . '",'; |
|
| 1713 | - $json .= '"lat_pos": "' . $lat . '",'; |
|
| 1714 | - $json .= '"long_pos": "' . $lng . '",'; |
|
| 1715 | - $json .= '"marker_id":"' . $post_id . '_' . $cat_id . '",'; |
|
| 1716 | - $json .= '"icon":"' . $term_icon . '",'; |
|
| 1717 | - $json .= '"group":"catgroup' . $cat_id . '"'; |
|
| 1712 | + $json .= '"id":"'.$post_id.'",'; |
|
| 1713 | + $json .= '"lat_pos": "'.$lat.'",'; |
|
| 1714 | + $json .= '"long_pos": "'.$lng.'",'; |
|
| 1715 | + $json .= '"marker_id":"'.$post_id.'_'.$cat_id.'",'; |
|
| 1716 | + $json .= '"icon":"'.$term_icon.'",'; |
|
| 1717 | + $json .= '"group":"catgroup'.$cat_id.'"'; |
|
| 1718 | 1718 | $json .= '}'; |
| 1719 | 1719 | |
| 1720 | 1720 | |
@@ -1722,9 +1722,9 @@ discard block |
||
| 1722 | 1722 | $post_marker_json = $json; |
| 1723 | 1723 | |
| 1724 | 1724 | |
| 1725 | - if ($wpdb->get_var($wpdb->prepare("SELECT post_id from " . GEODIR_ICON_TABLE . " WHERE post_id = %d AND cat_id = %d", array($post_id, $cat_id)))) {
|
|
| 1725 | + if ($wpdb->get_var($wpdb->prepare("SELECT post_id from ".GEODIR_ICON_TABLE." WHERE post_id = %d AND cat_id = %d", array($post_id, $cat_id)))) {
|
|
| 1726 | 1726 | |
| 1727 | - $json_query = $wpdb->prepare("UPDATE " . GEODIR_ICON_TABLE . " SET
|
|
| 1727 | + $json_query = $wpdb->prepare("UPDATE ".GEODIR_ICON_TABLE." SET
|
|
| 1728 | 1728 | post_title = %s, |
| 1729 | 1729 | json = %s |
| 1730 | 1730 | WHERE post_id = %d AND cat_id = %d ", |
@@ -1732,7 +1732,7 @@ discard block |
||
| 1732 | 1732 | |
| 1733 | 1733 | } else {
|
| 1734 | 1734 | |
| 1735 | - $json_query = $wpdb->prepare("INSERT INTO " . GEODIR_ICON_TABLE . " SET
|
|
| 1735 | + $json_query = $wpdb->prepare("INSERT INTO ".GEODIR_ICON_TABLE." SET
|
|
| 1736 | 1736 | post_id = %d, |
| 1737 | 1737 | post_title = %s, |
| 1738 | 1738 | cat_id = %d, |
@@ -1750,17 +1750,17 @@ discard block |
||
| 1750 | 1750 | if (!empty($post_term) && is_array($post_term)) {
|
| 1751 | 1751 | $categories = implode(',', $post_term);
|
| 1752 | 1752 | |
| 1753 | - if ($categories != '' && $categories != 0) $categories = ',' . $categories . ','; |
|
| 1753 | + if ($categories != '' && $categories != 0) $categories = ','.$categories.','; |
|
| 1754 | 1754 | |
| 1755 | 1755 | if (empty($post_marker_json)) |
| 1756 | 1756 | $post_marker_json = isset($json) ? $json : ''; |
| 1757 | 1757 | |
| 1758 | - if ($wpdb->get_var($wpdb->prepare("SELECT post_id from " . $table . " where post_id = %d", array($post_id)))) {
|
|
| 1758 | + if ($wpdb->get_var($wpdb->prepare("SELECT post_id from ".$table." where post_id = %d", array($post_id)))) {
|
|
| 1759 | 1759 | |
| 1760 | 1760 | $wpdb->query( |
| 1761 | 1761 | $wpdb->prepare( |
| 1762 | - "UPDATE " . $table . " SET |
|
| 1763 | - " . $taxonomy . " = %s, |
|
| 1762 | + "UPDATE ".$table." SET |
|
| 1763 | + " . $taxonomy." = %s, |
|
| 1764 | 1764 | marker_json = %s |
| 1765 | 1765 | where post_id = %d", |
| 1766 | 1766 | array($categories, $post_marker_json, $post_id) |
@@ -1781,7 +1781,7 @@ discard block |
||
| 1781 | 1781 | |
| 1782 | 1782 | $wpdb->query( |
| 1783 | 1783 | $wpdb->prepare( |
| 1784 | - "UPDATE " . $table . " SET |
|
| 1784 | + "UPDATE ".$table." SET |
|
| 1785 | 1785 | default_category = %s |
| 1786 | 1786 | where post_id = %d", |
| 1787 | 1787 | array($categories[0], $post_id) |
@@ -1806,9 +1806,9 @@ discard block |
||
| 1806 | 1806 | |
| 1807 | 1807 | $wpdb->query( |
| 1808 | 1808 | $wpdb->prepare( |
| 1809 | - "INSERT INTO " . $table . " SET |
|
| 1809 | + "INSERT INTO ".$table." SET |
|
| 1810 | 1810 | post_id = %d, |
| 1811 | - " . $taxonomy . " = %s, |
|
| 1811 | + " . $taxonomy." = %s, |
|
| 1812 | 1812 | marker_json = %s ", |
| 1813 | 1813 | |
| 1814 | 1814 | array($post_id, $categories, $post_marker_json) |
@@ -1931,7 +1931,7 @@ discard block |
||
| 1931 | 1931 | } ?>"><img alt="bubble image" style="max-height:50px;" |
| 1932 | 1932 | src="<?php echo $post_images[0]; ?>"/></a></div> |
| 1933 | 1933 | <?php |
| 1934 | - }else{
|
|
| 1934 | + } else {
|
|
| 1935 | 1935 | echo '<div class="geodir-bubble_image"></div>'; |
| 1936 | 1936 | } |
| 1937 | 1937 | } else {
|
@@ -1939,7 +1939,7 @@ discard block |
||
| 1939 | 1939 | ?> |
| 1940 | 1940 | <div class="geodir-bubble_image"><a href="<?php echo $plink; ?>"><?php echo $image; ?></a></div> |
| 1941 | 1941 | <?php |
| 1942 | - }else{
|
|
| 1942 | + } else {
|
|
| 1943 | 1943 | echo '<div class="geodir-bubble_image"></div>'; |
| 1944 | 1944 | } |
| 1945 | 1945 | } |
@@ -1972,7 +1972,7 @@ discard block |
||
| 1972 | 1972 | * @param object $postinfo_obj The posts info as an object. |
| 1973 | 1973 | * @param bool|string $post_preview True if currently in post preview page. Empty string if not. * |
| 1974 | 1974 | */ |
| 1975 | - do_action('geodir_infowindow_meta_after',$postinfo_obj,$post_preview );
|
|
| 1975 | + do_action('geodir_infowindow_meta_after', $postinfo_obj, $post_preview);
|
|
| 1976 | 1976 | ?> |
| 1977 | 1977 | </div> |
| 1978 | 1978 | <?php |
@@ -1984,10 +1984,10 @@ discard block |
||
| 1984 | 1984 | <div class="geodir-bubble-meta-fade"></div> |
| 1985 | 1985 | |
| 1986 | 1986 | <div class="geodir-bubble-meta-bottom"> |
| 1987 | - <span class="geodir-bubble-rating"><?php echo $rating_star;?></span> |
|
| 1987 | + <span class="geodir-bubble-rating"><?php echo $rating_star; ?></span> |
|
| 1988 | 1988 | |
| 1989 | 1989 | <span |
| 1990 | - class="geodir-bubble-fav"><?php echo geodir_favourite_html($post_author, $ID);?></span> |
|
| 1990 | + class="geodir-bubble-fav"><?php echo geodir_favourite_html($post_author, $ID); ?></span> |
|
| 1991 | 1991 | <span class="geodir-bubble-reviews"><a href="<?php echo get_comments_link($ID); ?>" |
| 1992 | 1992 | class="geodir-pcomments"><i class="fa fa-comments"></i> |
| 1993 | 1993 | <?php echo get_comments_number($ID); ?> |
@@ -2052,11 +2052,11 @@ discard block |
||
| 2052 | 2052 | |
| 2053 | 2053 | $post_type = get_post_type($post_id); |
| 2054 | 2054 | |
| 2055 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 2055 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
| 2056 | 2056 | |
| 2057 | 2057 | $wpdb->query( |
| 2058 | 2058 | $wpdb->prepare( |
| 2059 | - "UPDATE " . $table . " SET post_status=%s WHERE post_id=%d", |
|
| 2059 | + "UPDATE ".$table." SET post_status=%s WHERE post_id=%d", |
|
| 2060 | 2060 | array($status, $post_id) |
| 2061 | 2061 | ) |
| 2062 | 2062 | ); |
@@ -2128,18 +2128,18 @@ discard block |
||
| 2128 | 2128 | |
| 2129 | 2129 | $post_type = get_post_type($post_id); |
| 2130 | 2130 | |
| 2131 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 2131 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
| 2132 | 2132 | |
| 2133 | 2133 | $wpdb->query( |
| 2134 | 2134 | $wpdb->prepare( |
| 2135 | - "UPDATE " . $table . " SET `post_id` = %d WHERE `post_id` = %d", |
|
| 2135 | + "UPDATE ".$table." SET `post_id` = %d WHERE `post_id` = %d", |
|
| 2136 | 2136 | array($updatingpost, $temppost) |
| 2137 | 2137 | ) |
| 2138 | 2138 | ); |
| 2139 | 2139 | |
| 2140 | 2140 | $wpdb->query( |
| 2141 | 2141 | $wpdb->prepare( |
| 2142 | - "UPDATE " . GEODIR_ICON_TABLE . " SET `post_id` = %d WHERE `post_id` = %d", |
|
| 2142 | + "UPDATE ".GEODIR_ICON_TABLE." SET `post_id` = %d WHERE `post_id` = %d", |
|
| 2143 | 2143 | array($updatingpost, $temppost) |
| 2144 | 2144 | ) |
| 2145 | 2145 | ); |
@@ -2148,7 +2148,7 @@ discard block |
||
| 2148 | 2148 | |
| 2149 | 2149 | $wpdb->query( |
| 2150 | 2150 | $wpdb->prepare( |
| 2151 | - "UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET `post_id` = %d WHERE `post_id` = %d", |
|
| 2151 | + "UPDATE ".GEODIR_ATTACHMENT_TABLE." SET `post_id` = %d WHERE `post_id` = %d", |
|
| 2152 | 2152 | array($updatingpost, $temppost) |
| 2153 | 2153 | ) |
| 2154 | 2154 | ); |
@@ -2186,12 +2186,12 @@ discard block |
||
| 2186 | 2186 | if (!in_array($post_type, $all_postypes)) |
| 2187 | 2187 | return false; |
| 2188 | 2188 | |
| 2189 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 2189 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
| 2190 | 2190 | |
| 2191 | 2191 | /* Delete custom post meta*/ |
| 2192 | 2192 | $wpdb->query( |
| 2193 | 2193 | $wpdb->prepare( |
| 2194 | - "DELETE FROM " . $table . " WHERE `post_id` = %d", |
|
| 2194 | + "DELETE FROM ".$table." WHERE `post_id` = %d", |
|
| 2195 | 2195 | array($deleted_postid) |
| 2196 | 2196 | ) |
| 2197 | 2197 | ); |
@@ -2200,7 +2200,7 @@ discard block |
||
| 2200 | 2200 | |
| 2201 | 2201 | $wpdb->query( |
| 2202 | 2202 | $wpdb->prepare( |
| 2203 | - "DELETE FROM " . GEODIR_ICON_TABLE . " WHERE `post_id` = %d", |
|
| 2203 | + "DELETE FROM ".GEODIR_ICON_TABLE." WHERE `post_id` = %d", |
|
| 2204 | 2204 | array($deleted_postid) |
| 2205 | 2205 | ) |
| 2206 | 2206 | ); |
@@ -2210,7 +2210,7 @@ discard block |
||
| 2210 | 2210 | |
| 2211 | 2211 | $wpdb->query( |
| 2212 | 2212 | $wpdb->prepare( |
| 2213 | - "DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE `post_id` = %d", |
|
| 2213 | + "DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE `post_id` = %d", |
|
| 2214 | 2214 | array($deleted_postid) |
| 2215 | 2215 | ) |
| 2216 | 2216 | ); |
@@ -2282,7 +2282,7 @@ discard block |
||
| 2282 | 2282 | */ |
| 2283 | 2283 | do_action('geodir_before_add_from_favorite', $post_id);
|
| 2284 | 2284 | |
| 2285 | - echo '<a href="javascript:void(0);" title="' . $remove_favourite_text . '" class="geodir-removetofav-icon" onclick="javascript:addToFavourite(\'' . $post_id . '\',\'remove\');"><i class="'. $favourite_icon .'"></i> ' . $unfavourite_text . '</a>'; |
|
| 2285 | + echo '<a href="javascript:void(0);" title="'.$remove_favourite_text.'" class="geodir-removetofav-icon" onclick="javascript:addToFavourite(\''.$post_id.'\',\'remove\');"><i class="'.$favourite_icon.'"></i> '.$unfavourite_text.'</a>'; |
|
| 2286 | 2286 | |
| 2287 | 2287 | /** |
| 2288 | 2288 | * Called after adding the post from favourites. |
@@ -2361,7 +2361,7 @@ discard block |
||
| 2361 | 2361 | */ |
| 2362 | 2362 | do_action('geodir_before_remove_from_favorite', $post_id);
|
| 2363 | 2363 | |
| 2364 | - echo '<a href="javascript:void(0);" title="' . $add_favourite_text . '" class="geodir-addtofav-icon" onclick="javascript:addToFavourite(\'' . $post_id . '\',\'add\');"><i class="'. $favourite_icon .'"></i> ' . $favourite_text . '</a>'; |
|
| 2364 | + echo '<a href="javascript:void(0);" title="'.$add_favourite_text.'" class="geodir-addtofav-icon" onclick="javascript:addToFavourite(\''.$post_id.'\',\'add\');"><i class="'.$favourite_icon.'"></i> '.$favourite_text.'</a>'; |
|
| 2365 | 2365 | |
| 2366 | 2366 | /** |
| 2367 | 2367 | * Called after removing the post from favourites. |
@@ -2456,24 +2456,24 @@ discard block |
||
| 2456 | 2456 | $user_meta_data = get_user_meta($current_user->data->ID, 'gd_user_favourite_post', true); |
| 2457 | 2457 | |
| 2458 | 2458 | if (!empty($user_meta_data) && in_array($post_id, $user_meta_data)) {
|
| 2459 | - ?><span class="geodir-addtofav favorite_property_<?php echo $post_id;?>" ><a |
|
| 2459 | + ?><span class="geodir-addtofav favorite_property_<?php echo $post_id; ?>" ><a |
|
| 2460 | 2460 | class="geodir-removetofav-icon" href="javascript:void(0);" |
| 2461 | - onclick="javascript:addToFavourite(<?php echo $post_id;?>,'remove');" |
|
| 2462 | - title="<?php echo $remove_favourite_text;?>"><i class="<?php echo $unfavourite_icon; ?>"></i> <?php echo $unfavourite_text;?> |
|
| 2461 | + onclick="javascript:addToFavourite(<?php echo $post_id; ?>,'remove');" |
|
| 2462 | + title="<?php echo $remove_favourite_text; ?>"><i class="<?php echo $unfavourite_icon; ?>"></i> <?php echo $unfavourite_text; ?> |
|
| 2463 | 2463 | </a> </span><?php |
| 2464 | 2464 | |
| 2465 | 2465 | } else {
|
| 2466 | 2466 | |
| 2467 | 2467 | if (!isset($current_user->data->ID) || $current_user->data->ID == '') {
|
| 2468 | - $script_text = 'javascript:window.location.href=\'' . geodir_login_url() . '\''; |
|
| 2468 | + $script_text = 'javascript:window.location.href=\''.geodir_login_url().'\''; |
|
| 2469 | 2469 | } else |
| 2470 | - $script_text = 'javascript:addToFavourite(' . $post_id . ',\'add\')';
|
|
| 2470 | + $script_text = 'javascript:addToFavourite('.$post_id.',\'add\')';
|
|
| 2471 | 2471 | |
| 2472 | - ?><span class="geodir-addtofav favorite_property_<?php echo $post_id;?>"><a class="geodir-addtofav-icon" |
|
| 2472 | + ?><span class="geodir-addtofav favorite_property_<?php echo $post_id; ?>"><a class="geodir-addtofav-icon" |
|
| 2473 | 2473 | href="javascript:void(0);" |
| 2474 | - onclick="<?php echo $script_text;?>" |
|
| 2475 | - title="<?php echo $add_favourite_text;?>"><i |
|
| 2476 | - class="<?php echo $favourite_icon; ?>"></i> <?php echo $favourite_text;?></a></span> |
|
| 2474 | + onclick="<?php echo $script_text; ?>" |
|
| 2475 | + title="<?php echo $add_favourite_text; ?>"><i |
|
| 2476 | + class="<?php echo $favourite_icon; ?>"></i> <?php echo $favourite_text; ?></a></span> |
|
| 2477 | 2477 | <?php } |
| 2478 | 2478 | } |
| 2479 | 2479 | } |
@@ -2503,7 +2503,7 @@ discard block |
||
| 2503 | 2503 | |
| 2504 | 2504 | $post_type = $taxonomy_obj->object_type[0]; |
| 2505 | 2505 | |
| 2506 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 2506 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
| 2507 | 2507 | |
| 2508 | 2508 | /** |
| 2509 | 2509 | * Filter to modify the 'join' query |
@@ -2526,8 +2526,8 @@ discard block |
||
| 2526 | 2526 | $where = apply_filters('geodir_cat_post_count_where', $where, $term);
|
| 2527 | 2527 | |
| 2528 | 2528 | $count_query = "SELECT count(post_id) FROM |
| 2529 | - " . $table . " as pd " . $join . " |
|
| 2530 | - WHERE pd.post_status='publish' AND FIND_IN_SET('" . $term->term_id . "'," . $term->taxonomy . ") " . $where;
|
|
| 2529 | + " . $table." as pd ".$join." |
|
| 2530 | + WHERE pd.post_status='publish' AND FIND_IN_SET('" . $term->term_id."',".$term->taxonomy.") ".$where;
|
|
| 2531 | 2531 | |
| 2532 | 2532 | $cat_post_count = $wpdb->get_var($count_query); |
| 2533 | 2533 | if (empty($cat_post_count) || is_wp_error($cat_post_count)) |
@@ -2610,7 +2610,7 @@ discard block |
||
| 2610 | 2610 | global $post; |
| 2611 | 2611 | $all_postypes = geodir_get_posttypes(); |
| 2612 | 2612 | if (is_array($all_postypes) && in_array($post->post_type, $all_postypes)) {
|
| 2613 | - return ' <a href="' . get_permalink($post->ID) . '">' . READ_MORE_TXT . '</a>'; |
|
| 2613 | + return ' <a href="'.get_permalink($post->ID).'">'.READ_MORE_TXT.'</a>'; |
|
| 2614 | 2614 | } |
| 2615 | 2615 | |
| 2616 | 2616 | return $more; |
@@ -2637,14 +2637,14 @@ discard block |
||
| 2637 | 2637 | if (is_array($gd_taxonomies) && in_array($taxonomy, $gd_taxonomies)) {
|
| 2638 | 2638 | |
| 2639 | 2639 | $geodir_post_type = geodir_get_taxonomy_posttype($taxonomy); |
| 2640 | - $table = $plugin_prefix . $geodir_post_type . '_detail'; |
|
| 2640 | + $table = $plugin_prefix.$geodir_post_type.'_detail'; |
|
| 2641 | 2641 | |
| 2642 | 2642 | $path_parts = pathinfo($_REQUEST['ct_cat_icon']['src']); |
| 2643 | - $term_icon = $path_parts['dirname'] . '/cat_icon_' . $term_id . '.png'; |
|
| 2643 | + $term_icon = $path_parts['dirname'].'/cat_icon_'.$term_id.'.png'; |
|
| 2644 | 2644 | |
| 2645 | 2645 | $posts = $wpdb->get_results( |
| 2646 | 2646 | $wpdb->prepare( |
| 2647 | - "SELECT post_id,post_title,post_latitude,post_longitude,default_category FROM " . $table . " WHERE FIND_IN_SET(%s,%1\$s ) ", |
|
| 2647 | + "SELECT post_id,post_title,post_latitude,post_longitude,default_category FROM ".$table." WHERE FIND_IN_SET(%s,%1\$s ) ", |
|
| 2648 | 2648 | array($term_id, $taxonomy) |
| 2649 | 2649 | ) |
| 2650 | 2650 | ); |
@@ -2656,19 +2656,19 @@ discard block |
||
| 2656 | 2656 | $lng = $post_obj->post_longitude; |
| 2657 | 2657 | |
| 2658 | 2658 | $json = '{';
|
| 2659 | - $json .= '"id":"' . $post_obj->post_id . '",'; |
|
| 2660 | - $json .= '"lat_pos": "' . $lat . '",'; |
|
| 2661 | - $json .= '"long_pos": "' . $lng . '",'; |
|
| 2662 | - $json .= '"marker_id":"' . $post_obj->post_id . '_' . $term_id . '",'; |
|
| 2663 | - $json .= '"icon":"' . $term_icon . '",'; |
|
| 2664 | - $json .= '"group":"catgroup' . $term_id . '"'; |
|
| 2659 | + $json .= '"id":"'.$post_obj->post_id.'",'; |
|
| 2660 | + $json .= '"lat_pos": "'.$lat.'",'; |
|
| 2661 | + $json .= '"long_pos": "'.$lng.'",'; |
|
| 2662 | + $json .= '"marker_id":"'.$post_obj->post_id.'_'.$term_id.'",'; |
|
| 2663 | + $json .= '"icon":"'.$term_icon.'",'; |
|
| 2664 | + $json .= '"group":"catgroup'.$term_id.'"'; |
|
| 2665 | 2665 | $json .= '}'; |
| 2666 | 2666 | |
| 2667 | 2667 | if ($post_obj->default_category == $term_id) {
|
| 2668 | 2668 | |
| 2669 | 2669 | $wpdb->query( |
| 2670 | 2670 | $wpdb->prepare( |
| 2671 | - "UPDATE " . $table . " SET marker_json = %s where post_id = %d", |
|
| 2671 | + "UPDATE ".$table." SET marker_json = %s where post_id = %d", |
|
| 2672 | 2672 | array($json, $post_obj->post_id) |
| 2673 | 2673 | ) |
| 2674 | 2674 | ); |
@@ -2676,7 +2676,7 @@ discard block |
||
| 2676 | 2676 | |
| 2677 | 2677 | $wpdb->query( |
| 2678 | 2678 | $wpdb->prepare( |
| 2679 | - "UPDATE " . GEODIR_ICON_TABLE . " SET json = %s WHERE post_id = %d AND cat_id = %d", |
|
| 2679 | + "UPDATE ".GEODIR_ICON_TABLE." SET json = %s WHERE post_id = %d AND cat_id = %d", |
|
| 2680 | 2680 | array($json, $post_obj->post_id, $term_id) |
| 2681 | 2681 | ) |
| 2682 | 2682 | ); |
@@ -2800,7 +2800,7 @@ discard block |
||
| 2800 | 2800 | // print_r($uploads ) ; |
| 2801 | 2801 | $post_first_image = $wpdb->get_results( |
| 2802 | 2802 | $wpdb->prepare( |
| 2803 | - "SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = %d and menu_order = 1 ", array($post_id) |
|
| 2803 | + "SELECT * FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id = %d and menu_order = 1 ", array($post_id) |
|
| 2804 | 2804 | ) |
| 2805 | 2805 | ); |
| 2806 | 2806 | |
@@ -2821,9 +2821,9 @@ discard block |
||
| 2821 | 2821 | |
| 2822 | 2822 | $post_type = get_post_type($post_id); |
| 2823 | 2823 | |
| 2824 | - $table_name = $plugin_prefix . $post_type . '_detail'; |
|
| 2824 | + $table_name = $plugin_prefix.$post_type.'_detail'; |
|
| 2825 | 2825 | |
| 2826 | - $wpdb->query("UPDATE " . $table_name . " SET featured_image='" . $post_first_image[0]->file . "' WHERE post_id =" . $post_id);
|
|
| 2826 | + $wpdb->query("UPDATE ".$table_name." SET featured_image='".$post_first_image[0]->file."' WHERE post_id =".$post_id);
|
|
| 2827 | 2827 | |
| 2828 | 2828 | $new_attachment_name = basename($post_first_image[0]->file); |
| 2829 | 2829 | |
@@ -2836,11 +2836,11 @@ discard block |
||
| 2836 | 2836 | wp_delete_attachment($post_thumbnail_id); |
| 2837 | 2837 | |
| 2838 | 2838 | } |
| 2839 | - $filename = $uploads['basedir'] . $post_first_image[0]->file; |
|
| 2839 | + $filename = $uploads['basedir'].$post_first_image[0]->file; |
|
| 2840 | 2840 | |
| 2841 | 2841 | $attachment = array( |
| 2842 | 2842 | 'post_mime_type' => $post_first_image[0]->mime_type, |
| 2843 | - 'guid' => $uploads['baseurl'] . $post_first_image[0]->file, |
|
| 2843 | + 'guid' => $uploads['baseurl'].$post_first_image[0]->file, |
|
| 2844 | 2844 | 'post_parent' => $post_id, |
| 2845 | 2845 | 'post_title' => preg_replace('/\.[^.]+$/', '', $post_first_image[0]->title),
|
| 2846 | 2846 | 'post_content' => '' |
@@ -2853,7 +2853,7 @@ discard block |
||
| 2853 | 2853 | |
| 2854 | 2854 | set_post_thumbnail($post_id, $id); |
| 2855 | 2855 | |
| 2856 | - require_once(ABSPATH . 'wp-admin/includes/image.php'); |
|
| 2856 | + require_once(ABSPATH.'wp-admin/includes/image.php'); |
|
| 2857 | 2857 | wp_update_attachment_metadata($id, wp_generate_attachment_metadata($id, $filename)); |
| 2858 | 2858 | |
| 2859 | 2859 | } |
@@ -2886,35 +2886,35 @@ discard block |
||
| 2886 | 2886 | $post_id = absint($_POST['post_id']); |
| 2887 | 2887 | $upload_dir = wp_upload_dir(); |
| 2888 | 2888 | $post_type = get_post_type($_POST['post_id']); |
| 2889 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 2889 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
| 2890 | 2890 | |
| 2891 | 2891 | $post_arr = $wpdb->get_results($wpdb->prepare( |
| 2892 | - "SELECT * FROM $wpdb->posts p JOIN " . $table . " gd ON gd.post_id=p.ID WHERE p.ID=%d LIMIT 1", |
|
| 2892 | + "SELECT * FROM $wpdb->posts p JOIN ".$table." gd ON gd.post_id=p.ID WHERE p.ID=%d LIMIT 1", |
|
| 2893 | 2893 | array($post_id) |
| 2894 | 2894 | ) |
| 2895 | 2895 | , ARRAY_A); |
| 2896 | 2896 | |
| 2897 | 2897 | $arrImages = $wpdb->get_results( |
| 2898 | 2898 | $wpdb->prepare( |
| 2899 | - "SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE mime_type like %s AND post_id = %d ORDER BY menu_order ASC, ID DESC ", |
|
| 2899 | + "SELECT * FROM ".GEODIR_ATTACHMENT_TABLE." WHERE mime_type like %s AND post_id = %d ORDER BY menu_order ASC, ID DESC ", |
|
| 2900 | 2900 | array('%image%', $post_id)
|
| 2901 | 2901 | ) |
| 2902 | 2902 | ); |
| 2903 | 2903 | if ($arrImages) {
|
| 2904 | 2904 | $image_arr = array(); |
| 2905 | 2905 | foreach ($arrImages as $img) {
|
| 2906 | - $image_arr[] = $upload_dir['baseurl'] . $img->file; |
|
| 2906 | + $image_arr[] = $upload_dir['baseurl'].$img->file; |
|
| 2907 | 2907 | } |
| 2908 | 2908 | $comma_separated = implode(",", $image_arr);
|
| 2909 | 2909 | $post_arr[0]['post_images'] = $comma_separated; |
| 2910 | 2910 | } |
| 2911 | 2911 | |
| 2912 | 2912 | |
| 2913 | - $cats = $post_arr[0][$post_arr[0]['post_type'] . 'category']; |
|
| 2913 | + $cats = $post_arr[0][$post_arr[0]['post_type'].'category']; |
|
| 2914 | 2914 | $cat_arr = array_filter(explode(",", $cats));
|
| 2915 | 2915 | $trans_cat = array(); |
| 2916 | 2916 | foreach ($cat_arr as $cat) {
|
| 2917 | - $trans_cat[] = icl_object_id($cat, $post_arr[0]['post_type'] . 'category', false); |
|
| 2917 | + $trans_cat[] = icl_object_id($cat, $post_arr[0]['post_type'].'category', false); |
|
| 2918 | 2918 | } |
| 2919 | 2919 | |
| 2920 | 2920 | |
@@ -2956,7 +2956,7 @@ discard block |
||
| 2956 | 2956 | |
| 2957 | 2957 | $get_data = $wpdb->get_results( |
| 2958 | 2958 | $wpdb->prepare( |
| 2959 | - "SELECT htmlvar_name, field_type, extra_fields FROM " . GEODIR_CUSTOM_FIELDS_TABLE . " WHERE post_type=%s AND is_active='1'", |
|
| 2959 | + "SELECT htmlvar_name, field_type, extra_fields FROM ".GEODIR_CUSTOM_FIELDS_TABLE." WHERE post_type=%s AND is_active='1'", |
|
| 2960 | 2960 | array($listing_type) |
| 2961 | 2961 | ) |
| 2962 | 2962 | ); |
@@ -2969,12 +2969,12 @@ discard block |
||
| 2969 | 2969 | |
| 2970 | 2970 | $extra_fields = unserialize($data->extra_fields); |
| 2971 | 2971 | |
| 2972 | - $prefix = $data->htmlvar_name . '_'; |
|
| 2972 | + $prefix = $data->htmlvar_name.'_'; |
|
| 2973 | 2973 | |
| 2974 | - $fields_info[$prefix . 'address'] = $data->field_type; |
|
| 2974 | + $fields_info[$prefix.'address'] = $data->field_type; |
|
| 2975 | 2975 | |
| 2976 | 2976 | if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) |
| 2977 | - $fields_info[$prefix . 'zip'] = $data->field_type; |
|
| 2977 | + $fields_info[$prefix.'zip'] = $data->field_type; |
|
| 2978 | 2978 | |
| 2979 | 2979 | } else {
|
| 2980 | 2980 | |
@@ -3072,13 +3072,13 @@ discard block |
||
| 3072 | 3072 | * @since 1.4.9 |
| 3073 | 3073 | * @package GeoDirectory |
| 3074 | 3074 | */ |
| 3075 | -function geodir_fb_like_thumbnail(){
|
|
| 3075 | +function geodir_fb_like_thumbnail() {
|
|
| 3076 | 3076 | |
| 3077 | 3077 | // return if not a single post |
| 3078 | - if(!is_single()){return;}
|
|
| 3078 | + if (!is_single()) {return; }
|
|
| 3079 | 3079 | |
| 3080 | 3080 | global $post; |
| 3081 | - if(isset($post->featured_image) && $post->featured_image){
|
|
| 3081 | + if (isset($post->featured_image) && $post->featured_image) {
|
|
| 3082 | 3082 | $upload_dir = wp_upload_dir(); |
| 3083 | 3083 | $thumb = $upload_dir['baseurl'].$post->featured_image; |
| 3084 | 3084 | echo "\n\n<!-- GD Facebook Like Thumbnail -->\n<link rel=\"image_src\" href=\"$thumb\" />\n<!-- End GD Facebook Like Thumbnail -->\n\n"; |