@@ -1,10 +1,10 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Custom functions |
|
| 4 | - * |
|
| 5 | - * @since 1.0.0 |
|
| 6 | - * @package GeoDirectory |
|
| 7 | - */ |
|
| 3 | + * Custom functions |
|
| 4 | + * |
|
| 5 | + * @since 1.0.0 |
|
| 6 | + * @package GeoDirectory |
|
| 7 | + */ |
|
| 8 | 8 | |
| 9 | 9 | /** |
| 10 | 10 | * Front end listing view template selection. |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | * @global object $gd_session GeoDirectory Session object. |
| 18 | 18 | */ |
| 19 | 19 | function geodir_list_view_select() {
|
| 20 | - global $gd_session; |
|
| 20 | + global $gd_session; |
|
| 21 | 21 | ?> |
| 22 | 22 | <script type="text/javascript"> |
| 23 | 23 | function geodir_list_view_select(list) {
|
@@ -86,63 +86,63 @@ discard block |
||
| 86 | 86 | */ |
| 87 | 87 | function geodir_max_excerpt($charlength) |
| 88 | 88 | {
|
| 89 | - global $post; |
|
| 90 | - if ($charlength == '0') {
|
|
| 91 | - return; |
|
| 92 | - } |
|
| 93 | - $out = ''; |
|
| 89 | + global $post; |
|
| 90 | + if ($charlength == '0') {
|
|
| 91 | + return; |
|
| 92 | + } |
|
| 93 | + $out = ''; |
|
| 94 | 94 | |
| 95 | 95 | $temp_post = $post; |
| 96 | 96 | $excerpt = get_the_excerpt(); |
| 97 | 97 | |
| 98 | - $charlength++; |
|
| 99 | - $excerpt_more = function_exists('geodirf_excerpt_more') ? geodirf_excerpt_more('') : geodir_excerpt_more('');
|
|
| 100 | - if (mb_strlen($excerpt) > $charlength) {
|
|
| 101 | - if (mb_strlen($excerpt_more) > 0 && mb_strpos($excerpt, $excerpt_more) !== false) {
|
|
| 102 | - $excut = -(mb_strlen($excerpt_more)); |
|
| 103 | - $subex = mb_substr($excerpt, 0, $excut); |
|
| 104 | - if ($charlength > 0 && mb_strlen($subex) > $charlength) {
|
|
| 105 | - $subex = mb_substr($subex, 0, $charlength); |
|
| 106 | - } |
|
| 107 | - $out .= $subex; |
|
| 108 | - } else {
|
|
| 109 | - $subex = mb_substr($excerpt, 0, $charlength - 5); |
|
| 110 | - $exwords = explode(' ', $subex);
|
|
| 111 | - $excut = -(mb_strlen($exwords[count($exwords) - 1])); |
|
| 112 | - if ($excut < 0) {
|
|
| 113 | - $out .= mb_substr($subex, 0, $excut); |
|
| 114 | - } else {
|
|
| 115 | - $out .= $subex; |
|
| 116 | - } |
|
| 117 | - } |
|
| 118 | - $out .= ' <a class="excerpt-read-more" href="' . get_permalink() . '" title="' . get_the_title() . '">'; |
|
| 119 | - /** |
|
| 120 | - * Filter excerpt read more text. |
|
| 121 | - * |
|
| 122 | - * @since 1.0.0 |
|
| 123 | - */ |
|
| 124 | - $out .= apply_filters('geodir_max_excerpt_end', __('Read more [...]', 'geodirectory'));
|
|
| 125 | - $out .= '</a>'; |
|
| 126 | - |
|
| 127 | - } else {
|
|
| 128 | - if (mb_strlen($excerpt_more) > 0 && mb_strpos($excerpt, $excerpt_more) !== false) {
|
|
| 129 | - $excut = -(mb_strlen($excerpt_more)); |
|
| 130 | - $out .= mb_substr($excerpt, 0, $excut); |
|
| 131 | - $out .= ' <a class="excerpt-read-more" href="' . get_permalink() . '" title="' . get_the_title() . '">'; |
|
| 132 | - /** |
|
| 133 | - * Filter excerpt read more text. |
|
| 134 | - * |
|
| 135 | - * @since 1.0.0 |
|
| 136 | - */ |
|
| 137 | - $out .= apply_filters('geodir_max_excerpt_end', __('Read more [...]', 'geodirectory'));
|
|
| 138 | - $out .= '</a>'; |
|
| 139 | - } else {
|
|
| 140 | - $out .= $excerpt; |
|
| 141 | - } |
|
| 142 | - } |
|
| 98 | + $charlength++; |
|
| 99 | + $excerpt_more = function_exists('geodirf_excerpt_more') ? geodirf_excerpt_more('') : geodir_excerpt_more('');
|
|
| 100 | + if (mb_strlen($excerpt) > $charlength) {
|
|
| 101 | + if (mb_strlen($excerpt_more) > 0 && mb_strpos($excerpt, $excerpt_more) !== false) {
|
|
| 102 | + $excut = -(mb_strlen($excerpt_more)); |
|
| 103 | + $subex = mb_substr($excerpt, 0, $excut); |
|
| 104 | + if ($charlength > 0 && mb_strlen($subex) > $charlength) {
|
|
| 105 | + $subex = mb_substr($subex, 0, $charlength); |
|
| 106 | + } |
|
| 107 | + $out .= $subex; |
|
| 108 | + } else {
|
|
| 109 | + $subex = mb_substr($excerpt, 0, $charlength - 5); |
|
| 110 | + $exwords = explode(' ', $subex);
|
|
| 111 | + $excut = -(mb_strlen($exwords[count($exwords) - 1])); |
|
| 112 | + if ($excut < 0) {
|
|
| 113 | + $out .= mb_substr($subex, 0, $excut); |
|
| 114 | + } else {
|
|
| 115 | + $out .= $subex; |
|
| 116 | + } |
|
| 117 | + } |
|
| 118 | + $out .= ' <a class="excerpt-read-more" href="' . get_permalink() . '" title="' . get_the_title() . '">'; |
|
| 119 | + /** |
|
| 120 | + * Filter excerpt read more text. |
|
| 121 | + * |
|
| 122 | + * @since 1.0.0 |
|
| 123 | + */ |
|
| 124 | + $out .= apply_filters('geodir_max_excerpt_end', __('Read more [...]', 'geodirectory'));
|
|
| 125 | + $out .= '</a>'; |
|
| 126 | + |
|
| 127 | + } else {
|
|
| 128 | + if (mb_strlen($excerpt_more) > 0 && mb_strpos($excerpt, $excerpt_more) !== false) {
|
|
| 129 | + $excut = -(mb_strlen($excerpt_more)); |
|
| 130 | + $out .= mb_substr($excerpt, 0, $excut); |
|
| 131 | + $out .= ' <a class="excerpt-read-more" href="' . get_permalink() . '" title="' . get_the_title() . '">'; |
|
| 132 | + /** |
|
| 133 | + * Filter excerpt read more text. |
|
| 134 | + * |
|
| 135 | + * @since 1.0.0 |
|
| 136 | + */ |
|
| 137 | + $out .= apply_filters('geodir_max_excerpt_end', __('Read more [...]', 'geodirectory'));
|
|
| 138 | + $out .= '</a>'; |
|
| 139 | + } else {
|
|
| 140 | + $out .= $excerpt; |
|
| 141 | + } |
|
| 142 | + } |
|
| 143 | 143 | $post = $temp_post; |
| 144 | 144 | |
| 145 | - return $out; |
|
| 145 | + return $out; |
|
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | /** |
@@ -157,34 +157,34 @@ discard block |
||
| 157 | 157 | */ |
| 158 | 158 | function geodir_post_package_info($package_info, $post = '', $post_type = '') |
| 159 | 159 | {
|
| 160 | - $package_info['pid'] = 0; |
|
| 161 | - $package_info['days'] = 0; |
|
| 162 | - $package_info['amount'] = 0; |
|
| 163 | - $package_info['is_featured'] = 0; |
|
| 164 | - $package_info['image_limit'] = ''; |
|
| 165 | - $package_info['google_analytics'] = 1; |
|
| 166 | - $package_info['sendtofriend'] = 1; |
|
| 167 | - |
|
| 168 | - /** |
|
| 169 | - * Filter listing package info. |
|
| 170 | - * |
|
| 171 | - * @since 1.0.0 |
|
| 172 | - * @param array $package_info {
|
|
| 173 | - * Attributes of the package_info. |
|
| 174 | - * |
|
| 175 | - * @type int $pid Package ID. Default 0. |
|
| 176 | - * @type int $days Package validity in Days. Default 0. |
|
| 177 | - * @type int $amount Package amount. Default 0. |
|
| 178 | - * @type int $is_featured Is this featured package? Default 0. |
|
| 179 | - * @type string $image_limit Image limit for this package. Default "". |
|
| 180 | - * @type int $google_analytics Add analytics to this package. Default 1. |
|
| 181 | - * @type int $sendtofriend Send to friend. Default 1. |
|
| 182 | - * |
|
| 183 | - * } |
|
| 184 | - * @param object|string $post The post object. |
|
| 185 | - * @param string $post_type The post type. |
|
| 186 | - */ |
|
| 187 | - return (object)apply_filters('geodir_post_package_info', $package_info, $post, $post_type);
|
|
| 160 | + $package_info['pid'] = 0; |
|
| 161 | + $package_info['days'] = 0; |
|
| 162 | + $package_info['amount'] = 0; |
|
| 163 | + $package_info['is_featured'] = 0; |
|
| 164 | + $package_info['image_limit'] = ''; |
|
| 165 | + $package_info['google_analytics'] = 1; |
|
| 166 | + $package_info['sendtofriend'] = 1; |
|
| 167 | + |
|
| 168 | + /** |
|
| 169 | + * Filter listing package info. |
|
| 170 | + * |
|
| 171 | + * @since 1.0.0 |
|
| 172 | + * @param array $package_info {
|
|
| 173 | + * Attributes of the package_info. |
|
| 174 | + * |
|
| 175 | + * @type int $pid Package ID. Default 0. |
|
| 176 | + * @type int $days Package validity in Days. Default 0. |
|
| 177 | + * @type int $amount Package amount. Default 0. |
|
| 178 | + * @type int $is_featured Is this featured package? Default 0. |
|
| 179 | + * @type string $image_limit Image limit for this package. Default "". |
|
| 180 | + * @type int $google_analytics Add analytics to this package. Default 1. |
|
| 181 | + * @type int $sendtofriend Send to friend. Default 1. |
|
| 182 | + * |
|
| 183 | + * } |
|
| 184 | + * @param object|string $post The post object. |
|
| 185 | + * @param string $post_type The post type. |
|
| 186 | + */ |
|
| 187 | + return (object)apply_filters('geodir_post_package_info', $package_info, $post, $post_type);
|
|
| 188 | 188 | |
| 189 | 189 | } |
| 190 | 190 | |
@@ -212,127 +212,127 @@ discard block |
||
| 212 | 212 | */ |
| 213 | 213 | function geodir_send_inquiry($request) |
| 214 | 214 | {
|
| 215 | - global $wpdb; |
|
| 215 | + global $wpdb; |
|
| 216 | 216 | |
| 217 | - // strip slashes from text |
|
| 218 | - $request = !empty($request) ? stripslashes_deep($request) : $request; |
|
| 217 | + // strip slashes from text |
|
| 218 | + $request = !empty($request) ? stripslashes_deep($request) : $request; |
|
| 219 | 219 | |
| 220 | - $yourname = $request['inq_name']; |
|
| 221 | - $youremail = $request['inq_email']; |
|
| 222 | - $inq_phone = $request['inq_phone']; |
|
| 223 | - $frnd_comments = $request['inq_msg']; |
|
| 224 | - $pid = $request['pid']; |
|
| 220 | + $yourname = $request['inq_name']; |
|
| 221 | + $youremail = $request['inq_email']; |
|
| 222 | + $inq_phone = $request['inq_phone']; |
|
| 223 | + $frnd_comments = $request['inq_msg']; |
|
| 224 | + $pid = $request['pid']; |
|
| 225 | 225 | |
| 226 | - $author_id = ''; |
|
| 227 | - $post_title = ''; |
|
| 226 | + $author_id = ''; |
|
| 227 | + $post_title = ''; |
|
| 228 | 228 | |
| 229 | - if ($request['pid']) {
|
|
| 229 | + if ($request['pid']) {
|
|
| 230 | 230 | |
| 231 | - $productinfosql = $wpdb->prepare( |
|
| 232 | - "select ID,post_author,post_title from $wpdb->posts where ID =%d", |
|
| 233 | - array($request['pid']) |
|
| 234 | - ); |
|
| 235 | - $productinfo = $wpdb->get_row($productinfosql); |
|
| 231 | + $productinfosql = $wpdb->prepare( |
|
| 232 | + "select ID,post_author,post_title from $wpdb->posts where ID =%d", |
|
| 233 | + array($request['pid']) |
|
| 234 | + ); |
|
| 235 | + $productinfo = $wpdb->get_row($productinfosql); |
|
| 236 | 236 | |
| 237 | - $author_id = $productinfo->post_author; |
|
| 238 | - $post_title = $productinfo->post_title; |
|
| 239 | - } |
|
| 237 | + $author_id = $productinfo->post_author; |
|
| 238 | + $post_title = $productinfo->post_title; |
|
| 239 | + } |
|
| 240 | 240 | |
| 241 | - $post_title = '<a href="' . get_permalink($pid) . '">' . $post_title . '</a>'; |
|
| 241 | + $post_title = '<a href="' . get_permalink($pid) . '">' . $post_title . '</a>'; |
|
| 242 | 242 | |
| 243 | - $user_info = get_userdata($author_id); |
|
| 244 | - $to_email = geodir_get_post_meta($pid, 'geodir_email', true); |
|
| 245 | - $to_name = geodir_get_client_name($author_id); |
|
| 243 | + $user_info = get_userdata($author_id); |
|
| 244 | + $to_email = geodir_get_post_meta($pid, 'geodir_email', true); |
|
| 245 | + $to_name = geodir_get_client_name($author_id); |
|
| 246 | 246 | |
| 247 | - if ($to_email == '') {
|
|
| 248 | - $to_email = get_option('admin_email');
|
|
| 249 | - } |
|
| 247 | + if ($to_email == '') {
|
|
| 248 | + $to_email = get_option('admin_email');
|
|
| 249 | + } |
|
| 250 | 250 | |
| 251 | - /** |
|
| 252 | - * Called after the send enquiry var have been set but before the email has been sent. |
|
| 253 | - * |
|
| 254 | - * @since 1.0.0 |
|
| 255 | - * @param array $request {
|
|
| 256 | - * The submitted form fields as an array. |
|
| 257 | - * |
|
| 258 | - * @type string $sendact Enquiry type. Default "send_inqury". |
|
| 259 | - * @type string $pid Post ID. |
|
| 260 | - * @type string $inq_name Sender name. |
|
| 261 | - * @type string $inq_email Sender mail. |
|
| 262 | - * @type string $inq_phone Sender phone. |
|
| 263 | - * @type string $inq_msg Email message. |
|
| 264 | - * |
|
| 265 | - * } |
|
| 266 | - * @param string $type The form type, default: `Enquiry`. |
|
| 267 | - */ |
|
| 268 | - do_action('geodir_after_send_enquiry', $request, 'Enquiry');
|
|
| 269 | - |
|
| 270 | - $client_message = $frnd_comments; |
|
| 271 | - $client_message .= '<br>' . __('From :', 'geodirectory') . ' ' . $yourname . '<br>' . __('Phone :', 'geodirectory') . ' ' . $inq_phone . '<br>' . __('Email :', 'geodirectory') . ' ' . $youremail . '<br><br>' . __('Sent from', 'geodirectory') . ' - <b><a href="' . trailingslashit(home_url()) . '">' . get_option('blogname') . '</a></b>.';
|
|
| 272 | - /** |
|
| 273 | - * Filter client message text. |
|
| 274 | - * |
|
| 275 | - * @since 1.0.0 |
|
| 276 | - * @param string $client_message Client message text. |
|
| 277 | - */ |
|
| 278 | - $client_message = apply_filters('geodir_inquiry_email_msg', $client_message);
|
|
| 279 | - |
|
| 280 | - /** |
|
| 281 | - * Called before the send enquiry email is sent. |
|
| 282 | - * |
|
| 283 | - * @since 1.0.0 |
|
| 284 | - * @param array $request {
|
|
| 285 | - * The submitted form fields as an array. |
|
| 286 | - * |
|
| 287 | - * @type string $sendact Enquiry type. Default "send_inqury". |
|
| 288 | - * @type string $pid Post ID. |
|
| 289 | - * @type string $inq_name Sender name. |
|
| 290 | - * @type string $inq_email Sender mail. |
|
| 291 | - * @type string $inq_phone Sender phone. |
|
| 292 | - * @type string $inq_msg Email message. |
|
| 293 | - * |
|
| 294 | - * } |
|
| 295 | - */ |
|
| 296 | - do_action('geodir_before_send_enquiry_email', $request);
|
|
| 297 | - if ($to_email) {
|
|
| 298 | - // strip slashes message |
|
| 299 | - $client_message = stripslashes_deep($client_message); |
|
| 300 | - |
|
| 301 | - geodir_sendEmail($youremail, $yourname, $to_email, $to_name, '', $client_message, $extra = '', 'send_enquiry', $request['pid']);//To client email |
|
| 302 | - } |
|
| 251 | + /** |
|
| 252 | + * Called after the send enquiry var have been set but before the email has been sent. |
|
| 253 | + * |
|
| 254 | + * @since 1.0.0 |
|
| 255 | + * @param array $request {
|
|
| 256 | + * The submitted form fields as an array. |
|
| 257 | + * |
|
| 258 | + * @type string $sendact Enquiry type. Default "send_inqury". |
|
| 259 | + * @type string $pid Post ID. |
|
| 260 | + * @type string $inq_name Sender name. |
|
| 261 | + * @type string $inq_email Sender mail. |
|
| 262 | + * @type string $inq_phone Sender phone. |
|
| 263 | + * @type string $inq_msg Email message. |
|
| 264 | + * |
|
| 265 | + * } |
|
| 266 | + * @param string $type The form type, default: `Enquiry`. |
|
| 267 | + */ |
|
| 268 | + do_action('geodir_after_send_enquiry', $request, 'Enquiry');
|
|
| 303 | 269 | |
| 304 | - /** |
|
| 305 | - * Called after the send enquiry email is sent. |
|
| 306 | - * |
|
| 307 | - * @since 1.0.0 |
|
| 308 | - * @param array $request {
|
|
| 309 | - * The submitted form fields as an array. |
|
| 310 | - * |
|
| 311 | - * @type string $sendact Enquiry type. Default "send_inqury". |
|
| 312 | - * @type string $pid Post ID. |
|
| 313 | - * @type string $inq_name Sender name. |
|
| 314 | - * @type string $inq_email Sender mail. |
|
| 315 | - * @type string $inq_phone Sender phone. |
|
| 316 | - * @type string $inq_msg Email message. |
|
| 317 | - * |
|
| 318 | - * } |
|
| 319 | - */ |
|
| 320 | - do_action('geodir_after_send_enquiry_email', $request);
|
|
| 321 | - $url = get_permalink($pid); |
|
| 322 | - if (strstr($url, '?')) {
|
|
| 323 | - $url = $url . "&send_inquiry=success"; |
|
| 324 | - } else {
|
|
| 325 | - $url = $url . "?send_inquiry=success"; |
|
| 326 | - } |
|
| 327 | - /** |
|
| 328 | - * Filter redirect url after the send enquiry email is sent. |
|
| 329 | - * |
|
| 330 | - * @since 1.0.0 |
|
| 331 | - * @param string $url Redirect url. |
|
| 332 | - */ |
|
| 333 | - $url = apply_filters('geodir_send_enquiry_after_submit_redirect', $url);
|
|
| 334 | - wp_redirect($url); |
|
| 335 | - exit; |
|
| 270 | + $client_message = $frnd_comments; |
|
| 271 | + $client_message .= '<br>' . __('From :', 'geodirectory') . ' ' . $yourname . '<br>' . __('Phone :', 'geodirectory') . ' ' . $inq_phone . '<br>' . __('Email :', 'geodirectory') . ' ' . $youremail . '<br><br>' . __('Sent from', 'geodirectory') . ' - <b><a href="' . trailingslashit(home_url()) . '">' . get_option('blogname') . '</a></b>.';
|
|
| 272 | + /** |
|
| 273 | + * Filter client message text. |
|
| 274 | + * |
|
| 275 | + * @since 1.0.0 |
|
| 276 | + * @param string $client_message Client message text. |
|
| 277 | + */ |
|
| 278 | + $client_message = apply_filters('geodir_inquiry_email_msg', $client_message);
|
|
| 279 | + |
|
| 280 | + /** |
|
| 281 | + * Called before the send enquiry email is sent. |
|
| 282 | + * |
|
| 283 | + * @since 1.0.0 |
|
| 284 | + * @param array $request {
|
|
| 285 | + * The submitted form fields as an array. |
|
| 286 | + * |
|
| 287 | + * @type string $sendact Enquiry type. Default "send_inqury". |
|
| 288 | + * @type string $pid Post ID. |
|
| 289 | + * @type string $inq_name Sender name. |
|
| 290 | + * @type string $inq_email Sender mail. |
|
| 291 | + * @type string $inq_phone Sender phone. |
|
| 292 | + * @type string $inq_msg Email message. |
|
| 293 | + * |
|
| 294 | + * } |
|
| 295 | + */ |
|
| 296 | + do_action('geodir_before_send_enquiry_email', $request);
|
|
| 297 | + if ($to_email) {
|
|
| 298 | + // strip slashes message |
|
| 299 | + $client_message = stripslashes_deep($client_message); |
|
| 300 | + |
|
| 301 | + geodir_sendEmail($youremail, $yourname, $to_email, $to_name, '', $client_message, $extra = '', 'send_enquiry', $request['pid']);//To client email |
|
| 302 | + } |
|
| 303 | + |
|
| 304 | + /** |
|
| 305 | + * Called after the send enquiry email is sent. |
|
| 306 | + * |
|
| 307 | + * @since 1.0.0 |
|
| 308 | + * @param array $request {
|
|
| 309 | + * The submitted form fields as an array. |
|
| 310 | + * |
|
| 311 | + * @type string $sendact Enquiry type. Default "send_inqury". |
|
| 312 | + * @type string $pid Post ID. |
|
| 313 | + * @type string $inq_name Sender name. |
|
| 314 | + * @type string $inq_email Sender mail. |
|
| 315 | + * @type string $inq_phone Sender phone. |
|
| 316 | + * @type string $inq_msg Email message. |
|
| 317 | + * |
|
| 318 | + * } |
|
| 319 | + */ |
|
| 320 | + do_action('geodir_after_send_enquiry_email', $request);
|
|
| 321 | + $url = get_permalink($pid); |
|
| 322 | + if (strstr($url, '?')) {
|
|
| 323 | + $url = $url . "&send_inquiry=success"; |
|
| 324 | + } else {
|
|
| 325 | + $url = $url . "?send_inquiry=success"; |
|
| 326 | + } |
|
| 327 | + /** |
|
| 328 | + * Filter redirect url after the send enquiry email is sent. |
|
| 329 | + * |
|
| 330 | + * @since 1.0.0 |
|
| 331 | + * @param string $url Redirect url. |
|
| 332 | + */ |
|
| 333 | + $url = apply_filters('geodir_send_enquiry_after_submit_redirect', $url);
|
|
| 334 | + wp_redirect($url); |
|
| 335 | + exit; |
|
| 336 | 336 | |
| 337 | 337 | } |
| 338 | 338 | |
@@ -361,85 +361,85 @@ discard block |
||
| 361 | 361 | */ |
| 362 | 362 | function geodir_send_friend($request) |
| 363 | 363 | {
|
| 364 | - global $wpdb; |
|
| 365 | - |
|
| 366 | - // strip slashes from text |
|
| 367 | - $request = !empty($request) ? stripslashes_deep($request) : $request; |
|
| 368 | - |
|
| 369 | - $yourname = $request['yourname']; |
|
| 370 | - $youremail = $request['youremail']; |
|
| 371 | - $frnd_subject = $request['frnd_subject']; |
|
| 372 | - $frnd_comments = $request['frnd_comments']; |
|
| 373 | - $pid = $request['pid']; |
|
| 374 | - $to_email = $request['to_email']; |
|
| 375 | - $to_name = $request['to_name']; |
|
| 376 | - if ($request['pid']) {
|
|
| 377 | - $productinfosql = $wpdb->prepare( |
|
| 378 | - "select ID,post_title from $wpdb->posts where ID =%d", |
|
| 379 | - array($request['pid']) |
|
| 380 | - ); |
|
| 381 | - $productinfo = $wpdb->get_results($productinfosql); |
|
| 382 | - foreach ($productinfo as $productinfoObj) {
|
|
| 383 | - $post_title = $productinfoObj->post_title; |
|
| 384 | - } |
|
| 385 | - } |
|
| 364 | + global $wpdb; |
|
| 365 | + |
|
| 366 | + // strip slashes from text |
|
| 367 | + $request = !empty($request) ? stripslashes_deep($request) : $request; |
|
| 368 | + |
|
| 369 | + $yourname = $request['yourname']; |
|
| 370 | + $youremail = $request['youremail']; |
|
| 371 | + $frnd_subject = $request['frnd_subject']; |
|
| 372 | + $frnd_comments = $request['frnd_comments']; |
|
| 373 | + $pid = $request['pid']; |
|
| 374 | + $to_email = $request['to_email']; |
|
| 375 | + $to_name = $request['to_name']; |
|
| 376 | + if ($request['pid']) {
|
|
| 377 | + $productinfosql = $wpdb->prepare( |
|
| 378 | + "select ID,post_title from $wpdb->posts where ID =%d", |
|
| 379 | + array($request['pid']) |
|
| 380 | + ); |
|
| 381 | + $productinfo = $wpdb->get_results($productinfosql); |
|
| 382 | + foreach ($productinfo as $productinfoObj) {
|
|
| 383 | + $post_title = $productinfoObj->post_title; |
|
| 384 | + } |
|
| 385 | + } |
|
| 386 | 386 | |
| 387 | - /** |
|
| 388 | - * Called before the send to friend email is sent. |
|
| 389 | - * |
|
| 390 | - * @since 1.0.0 |
|
| 391 | - * @param array $request {
|
|
| 392 | - * The submitted form fields as an array. |
|
| 393 | - * |
|
| 394 | - * @type string $sendact Enquiry type. Default "email_frnd". |
|
| 395 | - * @type string $pid Post ID. |
|
| 396 | - * @type string $to_name Friend name. |
|
| 397 | - * @type string $to_email Friend email. |
|
| 398 | - * @type string $yourname Sender name. |
|
| 399 | - * @type string $youremail Sender email. |
|
| 400 | - * @type string $frnd_subject Email subject. |
|
| 401 | - * @type string $frnd_comments Email Message. |
|
| 402 | - * |
|
| 403 | - * } |
|
| 404 | - */ |
|
| 405 | - do_action('geodir_before_send_to_friend_email', $request);
|
|
| 406 | - geodir_sendEmail($youremail, $yourname, $to_email, $to_name, $frnd_subject, $frnd_comments, $extra = '', 'send_friend', $request['pid']);//To client email |
|
| 407 | - |
|
| 408 | - /** |
|
| 409 | - * Called after the send to friend email is sent. |
|
| 410 | - * |
|
| 411 | - * @since 1.0.0 |
|
| 412 | - * @param array $request {
|
|
| 413 | - * The submitted form fields as an array. |
|
| 414 | - * |
|
| 415 | - * @type string $sendact Enquiry type. Default "email_frnd". |
|
| 416 | - * @type string $pid Post ID. |
|
| 417 | - * @type string $to_name Friend name. |
|
| 418 | - * @type string $to_email Friend email. |
|
| 419 | - * @type string $yourname Sender name. |
|
| 420 | - * @type string $youremail Sender email. |
|
| 421 | - * @type string $frnd_subject Email subject. |
|
| 422 | - * @type string $frnd_comments Email Message. |
|
| 423 | - * |
|
| 424 | - * } |
|
| 425 | - */ |
|
| 426 | - do_action('geodir_after_send_to_friend_email', $request);
|
|
| 427 | - |
|
| 428 | - $url = get_permalink($pid); |
|
| 429 | - if (strstr($url, '?')) {
|
|
| 430 | - $url = $url . "&sendtofrnd=success"; |
|
| 431 | - } else {
|
|
| 432 | - $url = $url . "?sendtofrnd=success"; |
|
| 433 | - } |
|
| 434 | - /** |
|
| 435 | - * Filter redirect url after the send to friend email is sent. |
|
| 436 | - * |
|
| 437 | - * @since 1.0.0 |
|
| 438 | - * @param string $url Redirect url. |
|
| 439 | - */ |
|
| 440 | - $url = apply_filters('geodir_send_to_friend_after_submit_redirect', $url);
|
|
| 441 | - wp_redirect($url); |
|
| 442 | - exit; |
|
| 387 | + /** |
|
| 388 | + * Called before the send to friend email is sent. |
|
| 389 | + * |
|
| 390 | + * @since 1.0.0 |
|
| 391 | + * @param array $request {
|
|
| 392 | + * The submitted form fields as an array. |
|
| 393 | + * |
|
| 394 | + * @type string $sendact Enquiry type. Default "email_frnd". |
|
| 395 | + * @type string $pid Post ID. |
|
| 396 | + * @type string $to_name Friend name. |
|
| 397 | + * @type string $to_email Friend email. |
|
| 398 | + * @type string $yourname Sender name. |
|
| 399 | + * @type string $youremail Sender email. |
|
| 400 | + * @type string $frnd_subject Email subject. |
|
| 401 | + * @type string $frnd_comments Email Message. |
|
| 402 | + * |
|
| 403 | + * } |
|
| 404 | + */ |
|
| 405 | + do_action('geodir_before_send_to_friend_email', $request);
|
|
| 406 | + geodir_sendEmail($youremail, $yourname, $to_email, $to_name, $frnd_subject, $frnd_comments, $extra = '', 'send_friend', $request['pid']);//To client email |
|
| 407 | + |
|
| 408 | + /** |
|
| 409 | + * Called after the send to friend email is sent. |
|
| 410 | + * |
|
| 411 | + * @since 1.0.0 |
|
| 412 | + * @param array $request {
|
|
| 413 | + * The submitted form fields as an array. |
|
| 414 | + * |
|
| 415 | + * @type string $sendact Enquiry type. Default "email_frnd". |
|
| 416 | + * @type string $pid Post ID. |
|
| 417 | + * @type string $to_name Friend name. |
|
| 418 | + * @type string $to_email Friend email. |
|
| 419 | + * @type string $yourname Sender name. |
|
| 420 | + * @type string $youremail Sender email. |
|
| 421 | + * @type string $frnd_subject Email subject. |
|
| 422 | + * @type string $frnd_comments Email Message. |
|
| 423 | + * |
|
| 424 | + * } |
|
| 425 | + */ |
|
| 426 | + do_action('geodir_after_send_to_friend_email', $request);
|
|
| 427 | + |
|
| 428 | + $url = get_permalink($pid); |
|
| 429 | + if (strstr($url, '?')) {
|
|
| 430 | + $url = $url . "&sendtofrnd=success"; |
|
| 431 | + } else {
|
|
| 432 | + $url = $url . "?sendtofrnd=success"; |
|
| 433 | + } |
|
| 434 | + /** |
|
| 435 | + * Filter redirect url after the send to friend email is sent. |
|
| 436 | + * |
|
| 437 | + * @since 1.0.0 |
|
| 438 | + * @param string $url Redirect url. |
|
| 439 | + */ |
|
| 440 | + $url = apply_filters('geodir_send_to_friend_after_submit_redirect', $url);
|
|
| 441 | + wp_redirect($url); |
|
| 442 | + exit; |
|
| 443 | 443 | } |
| 444 | 444 | |
| 445 | 445 | /** |
@@ -453,28 +453,28 @@ discard block |
||
| 453 | 453 | */ |
| 454 | 454 | function geodir_before_tab_content($hash_key) |
| 455 | 455 | {
|
| 456 | - switch ($hash_key) {
|
|
| 457 | - case 'post_info' : |
|
| 458 | - echo '<div class="geodir-company_info field-group">'; |
|
| 459 | - break; |
|
| 460 | - case 'post_images' : |
|
| 461 | - /** |
|
| 462 | - * Filter post gallery HTML id. |
|
| 463 | - * |
|
| 464 | - * @since 1.0.0 |
|
| 465 | - */ |
|
| 466 | - echo ' <div id="' . apply_filters('geodir_post_gallery_id', 'geodir-post-gallery') . '" class="clearfix" >';
|
|
| 467 | - break; |
|
| 468 | - case 'reviews' : |
|
| 469 | - echo '<div id="reviews-wrap" class="clearfix"> '; |
|
| 470 | - break; |
|
| 471 | - case 'post_video': |
|
| 472 | - echo ' <div id="post_video-wrap" class="clearfix">'; |
|
| 473 | - break; |
|
| 474 | - case 'special_offers': |
|
| 475 | - echo '<div id="special_offers-wrap" class="clearfix">'; |
|
| 476 | - break; |
|
| 477 | - } |
|
| 456 | + switch ($hash_key) {
|
|
| 457 | + case 'post_info' : |
|
| 458 | + echo '<div class="geodir-company_info field-group">'; |
|
| 459 | + break; |
|
| 460 | + case 'post_images' : |
|
| 461 | + /** |
|
| 462 | + * Filter post gallery HTML id. |
|
| 463 | + * |
|
| 464 | + * @since 1.0.0 |
|
| 465 | + */ |
|
| 466 | + echo ' <div id="' . apply_filters('geodir_post_gallery_id', 'geodir-post-gallery') . '" class="clearfix" >';
|
|
| 467 | + break; |
|
| 468 | + case 'reviews' : |
|
| 469 | + echo '<div id="reviews-wrap" class="clearfix"> '; |
|
| 470 | + break; |
|
| 471 | + case 'post_video': |
|
| 472 | + echo ' <div id="post_video-wrap" class="clearfix">'; |
|
| 473 | + break; |
|
| 474 | + case 'special_offers': |
|
| 475 | + echo '<div id="special_offers-wrap" class="clearfix">'; |
|
| 476 | + break; |
|
| 477 | + } |
|
| 478 | 478 | } |
| 479 | 479 | |
| 480 | 480 | /** |
@@ -488,23 +488,23 @@ discard block |
||
| 488 | 488 | */ |
| 489 | 489 | function geodir_after_tab_content($hash_key) |
| 490 | 490 | {
|
| 491 | - switch ($hash_key) {
|
|
| 492 | - case 'post_info' : |
|
| 493 | - echo '</div>'; |
|
| 494 | - break; |
|
| 495 | - case 'post_images' : |
|
| 496 | - echo '</div>'; |
|
| 497 | - break; |
|
| 498 | - case 'reviews' : |
|
| 499 | - echo '</div>'; |
|
| 500 | - break; |
|
| 501 | - case 'post_video': |
|
| 502 | - echo '</div>'; |
|
| 503 | - break; |
|
| 504 | - case 'special_offers': |
|
| 505 | - echo '</div>'; |
|
| 506 | - break; |
|
| 507 | - } |
|
| 491 | + switch ($hash_key) {
|
|
| 492 | + case 'post_info' : |
|
| 493 | + echo '</div>'; |
|
| 494 | + break; |
|
| 495 | + case 'post_images' : |
|
| 496 | + echo '</div>'; |
|
| 497 | + break; |
|
| 498 | + case 'reviews' : |
|
| 499 | + echo '</div>'; |
|
| 500 | + break; |
|
| 501 | + case 'post_video': |
|
| 502 | + echo '</div>'; |
|
| 503 | + break; |
|
| 504 | + case 'special_offers': |
|
| 505 | + echo '</div>'; |
|
| 506 | + break; |
|
| 507 | + } |
|
| 508 | 508 | } |
| 509 | 509 | |
| 510 | 510 | |
@@ -520,21 +520,21 @@ discard block |
||
| 520 | 520 | function geodir_get_posts_default_sort($post_type) |
| 521 | 521 | {
|
| 522 | 522 | |
| 523 | - global $wpdb; |
|
| 523 | + global $wpdb; |
|
| 524 | 524 | |
| 525 | - if ($post_type != '') {
|
|
| 525 | + if ($post_type != '') {
|
|
| 526 | 526 | |
| 527 | - $all_postypes = geodir_get_posttypes(); |
|
| 527 | + $all_postypes = geodir_get_posttypes(); |
|
| 528 | 528 | |
| 529 | - if (!in_array($post_type, $all_postypes)) |
|
| 530 | - return false; |
|
| 529 | + if (!in_array($post_type, $all_postypes)) |
|
| 530 | + return false; |
|
| 531 | 531 | |
| 532 | - $sort_field_info = $wpdb->get_var($wpdb->prepare("select default_order from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where post_type= %s and is_active=%d and is_default=%d", array($post_type, 1, 1)));
|
|
| 532 | + $sort_field_info = $wpdb->get_var($wpdb->prepare("select default_order from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where post_type= %s and is_active=%d and is_default=%d", array($post_type, 1, 1)));
|
|
| 533 | 533 | |
| 534 | - if (!empty($sort_field_info)) |
|
| 535 | - return $sort_field_info; |
|
| 534 | + if (!empty($sort_field_info)) |
|
| 535 | + return $sort_field_info; |
|
| 536 | 536 | |
| 537 | - } |
|
| 537 | + } |
|
| 538 | 538 | |
| 539 | 539 | } |
| 540 | 540 | |
@@ -549,24 +549,24 @@ discard block |
||
| 549 | 549 | * @return bool|mixed|void Returns sort results, when the post type is valid. Otherwise returns false. |
| 550 | 550 | */ |
| 551 | 551 | function geodir_get_sort_options($post_type) {
|
| 552 | - global $wpdb; |
|
| 553 | - |
|
| 554 | - if ($post_type != '') {
|
|
| 555 | - $all_postypes = geodir_get_posttypes(); |
|
| 556 | - |
|
| 557 | - if (!in_array($post_type, $all_postypes)) |
|
| 558 | - return false; |
|
| 559 | - |
|
| 560 | - $sort_field_info = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " WHERE post_type=%s AND is_active=%d AND (sort_asc=1 || sort_desc=1 || field_type='random') AND field_type != 'address' ORDER BY sort_order ASC", array($post_type, 1)));
|
|
| 561 | - /** |
|
| 562 | - * Filter post sort options. |
|
| 563 | - * |
|
| 564 | - * @since 1.0.0 |
|
| 565 | - * @param array $sort_field_info Unfiltered sort field array. |
|
| 566 | - * @param string $post_type Post type. |
|
| 567 | - */ |
|
| 568 | - return apply_filters('geodir_get_sort_options', $sort_field_info, $post_type);
|
|
| 569 | - } |
|
| 552 | + global $wpdb; |
|
| 553 | + |
|
| 554 | + if ($post_type != '') {
|
|
| 555 | + $all_postypes = geodir_get_posttypes(); |
|
| 556 | + |
|
| 557 | + if (!in_array($post_type, $all_postypes)) |
|
| 558 | + return false; |
|
| 559 | + |
|
| 560 | + $sort_field_info = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " WHERE post_type=%s AND is_active=%d AND (sort_asc=1 || sort_desc=1 || field_type='random') AND field_type != 'address' ORDER BY sort_order ASC", array($post_type, 1)));
|
|
| 561 | + /** |
|
| 562 | + * Filter post sort options. |
|
| 563 | + * |
|
| 564 | + * @since 1.0.0 |
|
| 565 | + * @param array $sort_field_info Unfiltered sort field array. |
|
| 566 | + * @param string $post_type Post type. |
|
| 567 | + */ |
|
| 568 | + return apply_filters('geodir_get_sort_options', $sort_field_info, $post_type);
|
|
| 569 | + } |
|
| 570 | 570 | |
| 571 | 571 | } |
| 572 | 572 | |
@@ -580,7 +580,7 @@ discard block |
||
| 580 | 580 | */ |
| 581 | 581 | function geodir_display_sort_options() |
| 582 | 582 | {
|
| 583 | - global $wp_query; |
|
| 583 | + global $wp_query; |
|
| 584 | 584 | |
| 585 | 585 | /** |
| 586 | 586 | * On search pages there should be no sort options, sorting is done by search criteria. |
@@ -591,57 +591,57 @@ discard block |
||
| 591 | 591 | return; |
| 592 | 592 | } |
| 593 | 593 | |
| 594 | - $sort_by = ''; |
|
| 594 | + $sort_by = ''; |
|
| 595 | 595 | |
| 596 | - if (isset($_REQUEST['sort_by'])) $sort_by = $_REQUEST['sort_by']; |
|
| 596 | + if (isset($_REQUEST['sort_by'])) $sort_by = $_REQUEST['sort_by']; |
|
| 597 | 597 | |
| 598 | - $gd_post_type = geodir_get_current_posttype(); |
|
| 598 | + $gd_post_type = geodir_get_current_posttype(); |
|
| 599 | 599 | |
| 600 | - $sort_options = geodir_get_sort_options($gd_post_type); |
|
| 600 | + $sort_options = geodir_get_sort_options($gd_post_type); |
|
| 601 | 601 | |
| 602 | 602 | |
| 603 | - $sort_field_options = ''; |
|
| 603 | + $sort_field_options = ''; |
|
| 604 | 604 | |
| 605 | - if (!empty($sort_options)) {
|
|
| 606 | - foreach ($sort_options as $sort) {
|
|
| 605 | + if (!empty($sort_options)) {
|
|
| 606 | + foreach ($sort_options as $sort) {
|
|
| 607 | 607 | $sort = stripslashes_deep($sort); // strip slashes |
| 608 | 608 | |
| 609 | - $label = __($sort->site_title, 'geodirectory'); |
|
| 609 | + $label = __($sort->site_title, 'geodirectory'); |
|
| 610 | 610 | |
| 611 | - if ($sort->field_type == 'random') {
|
|
| 612 | - $key = $sort->field_type; |
|
| 613 | - ($sort_by == $key || ($sort->is_default == '1' && !isset($_REQUEST['sort_by']))) ? $selected = 'selected="selected"' : $selected = ''; |
|
| 614 | - $sort_field_options .= '<option ' . $selected . ' value="' . esc_url( add_query_arg('sort_by', $key) ) . '">' . __($label, 'geodirectory') . '</option>';
|
|
| 615 | - } |
|
| 611 | + if ($sort->field_type == 'random') {
|
|
| 612 | + $key = $sort->field_type; |
|
| 613 | + ($sort_by == $key || ($sort->is_default == '1' && !isset($_REQUEST['sort_by']))) ? $selected = 'selected="selected"' : $selected = ''; |
|
| 614 | + $sort_field_options .= '<option ' . $selected . ' value="' . esc_url( add_query_arg('sort_by', $key) ) . '">' . __($label, 'geodirectory') . '</option>';
|
|
| 615 | + } |
|
| 616 | 616 | |
| 617 | - if ($sort->htmlvar_name == 'comment_count') {
|
|
| 618 | - $sort->htmlvar_name = 'rating_count'; |
|
| 619 | - } |
|
| 617 | + if ($sort->htmlvar_name == 'comment_count') {
|
|
| 618 | + $sort->htmlvar_name = 'rating_count'; |
|
| 619 | + } |
|
| 620 | 620 | |
| 621 | - if ($sort->sort_asc) {
|
|
| 622 | - $key = $sort->htmlvar_name . '_asc'; |
|
| 623 | - $label = $sort->site_title; |
|
| 624 | - if ($sort->asc_title) |
|
| 625 | - $label = $sort->asc_title; |
|
| 626 | - ($sort_by == $key || ($sort->is_default == '1' && $sort->default_order == $key && !isset($_REQUEST['sort_by']))) ? $selected = 'selected="selected"' : $selected = ''; |
|
| 627 | - $sort_field_options .= '<option ' . $selected . ' value="' . esc_url( add_query_arg('sort_by', $key) ) . '">' . __($label, 'geodirectory') . '</option>';
|
|
| 628 | - } |
|
| 621 | + if ($sort->sort_asc) {
|
|
| 622 | + $key = $sort->htmlvar_name . '_asc'; |
|
| 623 | + $label = $sort->site_title; |
|
| 624 | + if ($sort->asc_title) |
|
| 625 | + $label = $sort->asc_title; |
|
| 626 | + ($sort_by == $key || ($sort->is_default == '1' && $sort->default_order == $key && !isset($_REQUEST['sort_by']))) ? $selected = 'selected="selected"' : $selected = ''; |
|
| 627 | + $sort_field_options .= '<option ' . $selected . ' value="' . esc_url( add_query_arg('sort_by', $key) ) . '">' . __($label, 'geodirectory') . '</option>';
|
|
| 628 | + } |
|
| 629 | 629 | |
| 630 | - if ($sort->sort_desc) {
|
|
| 631 | - $key = $sort->htmlvar_name . '_desc'; |
|
| 632 | - $label = $sort->site_title; |
|
| 633 | - if ($sort->desc_title) |
|
| 634 | - $label = $sort->desc_title; |
|
| 635 | - ($sort_by == $key || ($sort->is_default == '1' && $sort->default_order == $key && !isset($_REQUEST['sort_by']))) ? $selected = 'selected="selected"' : $selected = ''; |
|
| 636 | - $sort_field_options .= '<option ' . $selected . ' value="' . esc_url( add_query_arg('sort_by', $key) ) . '">' . __($label, 'geodirectory') . '</option>';
|
|
| 637 | - } |
|
| 630 | + if ($sort->sort_desc) {
|
|
| 631 | + $key = $sort->htmlvar_name . '_desc'; |
|
| 632 | + $label = $sort->site_title; |
|
| 633 | + if ($sort->desc_title) |
|
| 634 | + $label = $sort->desc_title; |
|
| 635 | + ($sort_by == $key || ($sort->is_default == '1' && $sort->default_order == $key && !isset($_REQUEST['sort_by']))) ? $selected = 'selected="selected"' : $selected = ''; |
|
| 636 | + $sort_field_options .= '<option ' . $selected . ' value="' . esc_url( add_query_arg('sort_by', $key) ) . '">' . __($label, 'geodirectory') . '</option>';
|
|
| 637 | + } |
|
| 638 | 638 | |
| 639 | - } |
|
| 640 | - } |
|
| 639 | + } |
|
| 640 | + } |
|
| 641 | 641 | |
| 642 | - if ($sort_field_options != '') {
|
|
| 642 | + if ($sort_field_options != '') {
|
|
| 643 | 643 | |
| 644 | - ?> |
|
| 644 | + ?> |
|
| 645 | 645 | |
| 646 | 646 | <div class="geodir-tax-sort"> |
| 647 | 647 | |
@@ -650,14 +650,14 @@ discard block |
||
| 650 | 650 | <option |
| 651 | 651 | value="<?php echo esc_url( add_query_arg('sort_by', '') );?>" <?php if ($sort_by == '') echo 'selected="selected"';?>><?php _e('Sort By', 'geodirectory');?></option><?php
|
| 652 | 652 | |
| 653 | - echo $sort_field_options;?> |
|
| 653 | + echo $sort_field_options;?> |
|
| 654 | 654 | |
| 655 | 655 | </select> |
| 656 | 656 | |
| 657 | 657 | </div> |
| 658 | 658 | <?php |
| 659 | 659 | |
| 660 | - } |
|
| 660 | + } |
|
| 661 | 661 | |
| 662 | 662 | } |
| 663 | 663 | |
@@ -677,10 +677,10 @@ discard block |
||
| 677 | 677 | function geodir_advance_customfields_heading($title, $field_type) |
| 678 | 678 | {
|
| 679 | 679 | |
| 680 | - if (in_array($field_type, array('multiselect', 'textarea', 'taxonomy'))) {
|
|
| 681 | - $title = ''; |
|
| 682 | - } |
|
| 683 | - return $title; |
|
| 680 | + if (in_array($field_type, array('multiselect', 'textarea', 'taxonomy'))) {
|
|
| 681 | + $title = ''; |
|
| 682 | + } |
|
| 683 | + return $title; |
|
| 684 | 684 | } |
| 685 | 685 | |
| 686 | 686 | |
@@ -697,69 +697,69 @@ discard block |
||
| 697 | 697 | * @return string Returns related posts html. |
| 698 | 698 | */ |
| 699 | 699 | function geodir_related_posts_display($request) {
|
| 700 | - if (!empty($request)) {
|
|
| 701 | - $before_title = (isset($request['before_title']) && !empty($request['before_title'])) ? $request['before_title'] : ''; |
|
| 702 | - $after_title = (isset($request['after_title']) && !empty($request['after_title'])) ? $request['after_title'] : ''; |
|
| 703 | - |
|
| 704 | - $title = (isset($request['title']) && !empty($request['title'])) ? $request['title'] : __('Related Listings', 'geodirectory');
|
|
| 705 | - $post_number = (isset($request['post_number']) && !empty($request['post_number'])) ? $request['post_number'] : '5'; |
|
| 706 | - $relate_to = (isset($request['relate_to']) && !empty($request['relate_to'])) ? $request['relate_to'] : 'category'; |
|
| 707 | - $layout = (isset($request['layout']) && !empty($request['layout'])) ? $request['layout'] : 'gridview_onehalf'; |
|
| 708 | - $add_location_filter = (isset($request['add_location_filter']) && !empty($request['add_location_filter'])) ? $request['add_location_filter'] : '0'; |
|
| 709 | - $listing_width = (isset($request['listing_width']) && !empty($request['listing_width'])) ? $request['listing_width'] : ''; |
|
| 710 | - $list_sort = (isset($request['list_sort']) && !empty($request['list_sort'])) ? $request['list_sort'] : 'latest'; |
|
| 711 | - $character_count = (isset($request['character_count']) && !empty($request['character_count'])) ? $request['character_count'] : ''; |
|
| 712 | - |
|
| 713 | - global $wpdb, $post, $gd_session; |
|
| 714 | - $origi_post = $post; |
|
| 715 | - $post_type = ''; |
|
| 716 | - $post_id = ''; |
|
| 717 | - $category_taxonomy = ''; |
|
| 718 | - $tax_field = 'id'; |
|
| 719 | - $category = array(); |
|
| 720 | - |
|
| 721 | - if (isset($_REQUEST['backandedit'])) {
|
|
| 722 | - $post = (object)$gd_session->get('listing');
|
|
| 723 | - $post_type = $post->listing_type; |
|
| 724 | - if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') |
|
| 725 | - $post_id = $_REQUEST['pid']; |
|
| 726 | - } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 727 | - $post = geodir_get_post_info($_REQUEST['pid']); |
|
| 728 | - $post_type = $post->post_type; |
|
| 729 | - $post_id = $_REQUEST['pid']; |
|
| 730 | - } elseif (isset($post->post_type) && $post->post_type != '') {
|
|
| 731 | - $post_type = $post->post_type; |
|
| 732 | - $post_id = $post->ID; |
|
| 733 | - } |
|
| 700 | + if (!empty($request)) {
|
|
| 701 | + $before_title = (isset($request['before_title']) && !empty($request['before_title'])) ? $request['before_title'] : ''; |
|
| 702 | + $after_title = (isset($request['after_title']) && !empty($request['after_title'])) ? $request['after_title'] : ''; |
|
| 703 | + |
|
| 704 | + $title = (isset($request['title']) && !empty($request['title'])) ? $request['title'] : __('Related Listings', 'geodirectory');
|
|
| 705 | + $post_number = (isset($request['post_number']) && !empty($request['post_number'])) ? $request['post_number'] : '5'; |
|
| 706 | + $relate_to = (isset($request['relate_to']) && !empty($request['relate_to'])) ? $request['relate_to'] : 'category'; |
|
| 707 | + $layout = (isset($request['layout']) && !empty($request['layout'])) ? $request['layout'] : 'gridview_onehalf'; |
|
| 708 | + $add_location_filter = (isset($request['add_location_filter']) && !empty($request['add_location_filter'])) ? $request['add_location_filter'] : '0'; |
|
| 709 | + $listing_width = (isset($request['listing_width']) && !empty($request['listing_width'])) ? $request['listing_width'] : ''; |
|
| 710 | + $list_sort = (isset($request['list_sort']) && !empty($request['list_sort'])) ? $request['list_sort'] : 'latest'; |
|
| 711 | + $character_count = (isset($request['character_count']) && !empty($request['character_count'])) ? $request['character_count'] : ''; |
|
| 712 | + |
|
| 713 | + global $wpdb, $post, $gd_session; |
|
| 714 | + $origi_post = $post; |
|
| 715 | + $post_type = ''; |
|
| 716 | + $post_id = ''; |
|
| 717 | + $category_taxonomy = ''; |
|
| 718 | + $tax_field = 'id'; |
|
| 719 | + $category = array(); |
|
| 720 | + |
|
| 721 | + if (isset($_REQUEST['backandedit'])) {
|
|
| 722 | + $post = (object)$gd_session->get('listing');
|
|
| 723 | + $post_type = $post->listing_type; |
|
| 724 | + if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') |
|
| 725 | + $post_id = $_REQUEST['pid']; |
|
| 726 | + } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 727 | + $post = geodir_get_post_info($_REQUEST['pid']); |
|
| 728 | + $post_type = $post->post_type; |
|
| 729 | + $post_id = $_REQUEST['pid']; |
|
| 730 | + } elseif (isset($post->post_type) && $post->post_type != '') {
|
|
| 731 | + $post_type = $post->post_type; |
|
| 732 | + $post_id = $post->ID; |
|
| 733 | + } |
|
| 734 | 734 | |
| 735 | - if ($relate_to == 'category') {
|
|
| 735 | + if ($relate_to == 'category') {
|
|
| 736 | 736 | |
| 737 | - $category_taxonomy = $post_type . $relate_to; |
|
| 738 | - if (isset($post->$category_taxonomy) && $post->$category_taxonomy != '') |
|
| 739 | - $category = explode(',', trim($post->$category_taxonomy, ','));
|
|
| 737 | + $category_taxonomy = $post_type . $relate_to; |
|
| 738 | + if (isset($post->$category_taxonomy) && $post->$category_taxonomy != '') |
|
| 739 | + $category = explode(',', trim($post->$category_taxonomy, ','));
|
|
| 740 | 740 | |
| 741 | - } elseif ($relate_to == 'tags') {
|
|
| 741 | + } elseif ($relate_to == 'tags') {
|
|
| 742 | 742 | |
| 743 | - $category_taxonomy = $post_type . '_' . $relate_to; |
|
| 744 | - if ($post->post_tags != '') |
|
| 745 | - $category = explode(',', trim($post->post_tags, ','));
|
|
| 746 | - $tax_field = 'name'; |
|
| 747 | - } |
|
| 743 | + $category_taxonomy = $post_type . '_' . $relate_to; |
|
| 744 | + if ($post->post_tags != '') |
|
| 745 | + $category = explode(',', trim($post->post_tags, ','));
|
|
| 746 | + $tax_field = 'name'; |
|
| 747 | + } |
|
| 748 | 748 | |
| 749 | - /* --- return false in invalid request --- */ |
|
| 750 | - if (empty($category)) |
|
| 751 | - return false; |
|
| 749 | + /* --- return false in invalid request --- */ |
|
| 750 | + if (empty($category)) |
|
| 751 | + return false; |
|
| 752 | 752 | |
| 753 | - $all_postypes = geodir_get_posttypes(); |
|
| 753 | + $all_postypes = geodir_get_posttypes(); |
|
| 754 | 754 | |
| 755 | - if (!in_array($post_type, $all_postypes)) |
|
| 756 | - return false; |
|
| 755 | + if (!in_array($post_type, $all_postypes)) |
|
| 756 | + return false; |
|
| 757 | 757 | |
| 758 | - /* --- return false in invalid request --- */ |
|
| 758 | + /* --- return false in invalid request --- */ |
|
| 759 | 759 | |
| 760 | - $location_url = ''; |
|
| 761 | - if ($add_location_filter != '0') {
|
|
| 762 | - $location_url = array(); |
|
| 760 | + $location_url = ''; |
|
| 761 | + if ($add_location_filter != '0') {
|
|
| 762 | + $location_url = array(); |
|
| 763 | 763 | $geodir_show_location_url = get_option('geodir_show_location_url');
|
| 764 | 764 | |
| 765 | 765 | $gd_city = get_query_var('gd_city');
|
@@ -767,13 +767,13 @@ discard block |
||
| 767 | 767 | if ($gd_city) {
|
| 768 | 768 | $gd_country = get_query_var('gd_country');
|
| 769 | 769 | $gd_region = get_query_var('gd_region');
|
| 770 | - } else {
|
|
| 771 | - $location = geodir_get_default_location(); |
|
| 770 | + } else {
|
|
| 771 | + $location = geodir_get_default_location(); |
|
| 772 | 772 | |
| 773 | 773 | $gd_country = isset($location->country_slug) ? $location->country_slug : ''; |
| 774 | 774 | $gd_region = isset($location->region_slug) ? $location->region_slug : ''; |
| 775 | 775 | $gd_city = isset($location->city_slug) ? $location->city_slug : ''; |
| 776 | - } |
|
| 776 | + } |
|
| 777 | 777 | |
| 778 | 778 | if ($geodir_show_location_url == 'all') {
|
| 779 | 779 | $location_url[] = $gd_country; |
@@ -786,92 +786,92 @@ discard block |
||
| 786 | 786 | |
| 787 | 787 | $location_url[] = $gd_city; |
| 788 | 788 | |
| 789 | - $location_url = implode('/', $location_url);
|
|
| 790 | - } |
|
| 789 | + $location_url = implode('/', $location_url);
|
|
| 790 | + } |
|
| 791 | 791 | |
| 792 | 792 | |
| 793 | - if (!empty($category)) {
|
|
| 794 | - global $geodir_add_location_url; |
|
| 795 | - $geodir_add_location_url = '0'; |
|
| 796 | - if ($add_location_filter != '0') {
|
|
| 797 | - $geodir_add_location_url = '1'; |
|
| 798 | - } |
|
| 799 | - $viewall_url = get_term_link((int)$category[0], $post_type . $category_taxonomy); |
|
| 800 | - $geodir_add_location_url = NULL; |
|
| 801 | - } |
|
| 802 | - ob_start(); |
|
| 803 | - ?> |
|
| 793 | + if (!empty($category)) {
|
|
| 794 | + global $geodir_add_location_url; |
|
| 795 | + $geodir_add_location_url = '0'; |
|
| 796 | + if ($add_location_filter != '0') {
|
|
| 797 | + $geodir_add_location_url = '1'; |
|
| 798 | + } |
|
| 799 | + $viewall_url = get_term_link((int)$category[0], $post_type . $category_taxonomy); |
|
| 800 | + $geodir_add_location_url = NULL; |
|
| 801 | + } |
|
| 802 | + ob_start(); |
|
| 803 | + ?> |
|
| 804 | 804 | |
| 805 | 805 | |
| 806 | 806 | <div class="geodir_locations geodir_location_listing"> |
| 807 | 807 | |
| 808 | 808 | <?php |
| 809 | - if (isset($request['is_widget']) && $request['is_widget'] == '1') {
|
|
| 810 | - /** geodir_before_title filter Documented in geodirectory_widgets.php */ |
|
| 811 | - $before_title = isset($before_title) ? $before_title : apply_filters('geodir_before_title', '<h3 class="widget-title">');
|
|
| 812 | - /** geodir_after_title filter Documented in geodirectory_widgets.php */ |
|
| 813 | - $after_title = isset($after_title) ? $after_title : apply_filters('geodir_after_title', '</h3>');
|
|
| 814 | - ?> |
|
| 809 | + if (isset($request['is_widget']) && $request['is_widget'] == '1') {
|
|
| 810 | + /** geodir_before_title filter Documented in geodirectory_widgets.php */ |
|
| 811 | + $before_title = isset($before_title) ? $before_title : apply_filters('geodir_before_title', '<h3 class="widget-title">');
|
|
| 812 | + /** geodir_after_title filter Documented in geodirectory_widgets.php */ |
|
| 813 | + $after_title = isset($after_title) ? $after_title : apply_filters('geodir_after_title', '</h3>');
|
|
| 814 | + ?> |
|
| 815 | 815 | <div class="location_list_heading clearfix"> |
| 816 | 816 | <?php echo $before_title . $title . $after_title; ?> |
| 817 | 817 | </div> |
| 818 | 818 | <?php |
| 819 | - } |
|
| 820 | - $query_args = array( |
|
| 821 | - 'posts_per_page' => $post_number, |
|
| 822 | - 'is_geodir_loop' => true, |
|
| 823 | - 'gd_location' => ($add_location_filter) ? true : false, |
|
| 824 | - 'post_type' => $post_type, |
|
| 825 | - 'order_by' => $list_sort, |
|
| 826 | - 'post__not_in' => array($post_id), |
|
| 827 | - 'excerpt_length' => $character_count, |
|
| 828 | - ); |
|
| 819 | + } |
|
| 820 | + $query_args = array( |
|
| 821 | + 'posts_per_page' => $post_number, |
|
| 822 | + 'is_geodir_loop' => true, |
|
| 823 | + 'gd_location' => ($add_location_filter) ? true : false, |
|
| 824 | + 'post_type' => $post_type, |
|
| 825 | + 'order_by' => $list_sort, |
|
| 826 | + 'post__not_in' => array($post_id), |
|
| 827 | + 'excerpt_length' => $character_count, |
|
| 828 | + ); |
|
| 829 | 829 | |
| 830 | - $tax_query = array('taxonomy' => $category_taxonomy,
|
|
| 831 | - 'field' => $tax_field, |
|
| 832 | - 'terms' => $category |
|
| 833 | - ); |
|
| 830 | + $tax_query = array('taxonomy' => $category_taxonomy,
|
|
| 831 | + 'field' => $tax_field, |
|
| 832 | + 'terms' => $category |
|
| 833 | + ); |
|
| 834 | 834 | |
| 835 | - $query_args['tax_query'] = array($tax_query); |
|
| 835 | + $query_args['tax_query'] = array($tax_query); |
|
| 836 | 836 | |
| 837 | 837 | |
| 838 | - global $gridview_columns, $post; |
|
| 838 | + global $gridview_columns, $post; |
|
| 839 | 839 | |
| 840 | 840 | |
| 841 | - query_posts($query_args); |
|
| 841 | + query_posts($query_args); |
|
| 842 | 842 | |
| 843 | - if (strstr($layout, 'gridview')) {
|
|
| 844 | - $listing_view_exp = explode('_', $layout);
|
|
| 845 | - $gridview_columns = $layout; |
|
| 846 | - $layout = $listing_view_exp[0]; |
|
| 847 | - } else if ($layout == 'list') {
|
|
| 848 | - $gridview_columns = ''; |
|
| 849 | - } |
|
| 850 | - $related_posts = true; |
|
| 851 | - |
|
| 852 | - /** |
|
| 853 | - * Filters related listing listview template. |
|
| 854 | - * |
|
| 855 | - * @since 1.0.0 |
|
| 856 | - */ |
|
| 857 | - $template = apply_filters("geodir_template_part-related-listing-listview", geodir_locate_template('listing-listview'));
|
|
| 858 | - |
|
| 859 | - /** |
|
| 860 | - * Includes related listing listview template. |
|
| 861 | - * |
|
| 862 | - * @since 1.0.0 |
|
| 863 | - */ |
|
| 864 | - include($template); |
|
| 865 | - |
|
| 866 | - wp_reset_query(); |
|
| 867 | - $post = $origi_post; |
|
| 868 | - ?> |
|
| 843 | + if (strstr($layout, 'gridview')) {
|
|
| 844 | + $listing_view_exp = explode('_', $layout);
|
|
| 845 | + $gridview_columns = $layout; |
|
| 846 | + $layout = $listing_view_exp[0]; |
|
| 847 | + } else if ($layout == 'list') {
|
|
| 848 | + $gridview_columns = ''; |
|
| 849 | + } |
|
| 850 | + $related_posts = true; |
|
| 851 | + |
|
| 852 | + /** |
|
| 853 | + * Filters related listing listview template. |
|
| 854 | + * |
|
| 855 | + * @since 1.0.0 |
|
| 856 | + */ |
|
| 857 | + $template = apply_filters("geodir_template_part-related-listing-listview", geodir_locate_template('listing-listview'));
|
|
| 858 | + |
|
| 859 | + /** |
|
| 860 | + * Includes related listing listview template. |
|
| 861 | + * |
|
| 862 | + * @since 1.0.0 |
|
| 863 | + */ |
|
| 864 | + include($template); |
|
| 865 | + |
|
| 866 | + wp_reset_query(); |
|
| 867 | + $post = $origi_post; |
|
| 868 | + ?> |
|
| 869 | 869 | |
| 870 | 870 | </div> |
| 871 | 871 | <?php |
| 872 | - return $html = ob_get_clean(); |
|
| 872 | + return $html = ob_get_clean(); |
|
| 873 | 873 | |
| 874 | - } |
|
| 874 | + } |
|
| 875 | 875 | |
| 876 | 876 | } |
| 877 | 877 | |
@@ -887,17 +887,17 @@ discard block |
||
| 887 | 887 | */ |
| 888 | 888 | function geodir_category_count_script() |
| 889 | 889 | {
|
| 890 | - global $geodir_post_category_str; |
|
| 890 | + global $geodir_post_category_str; |
|
| 891 | 891 | |
| 892 | - if (!empty($geodir_post_category_str)) {
|
|
| 893 | - $geodir_post_category_str = serialize($geodir_post_category_str); |
|
| 894 | - } |
|
| 892 | + if (!empty($geodir_post_category_str)) {
|
|
| 893 | + $geodir_post_category_str = serialize($geodir_post_category_str); |
|
| 894 | + } |
|
| 895 | 895 | |
| 896 | - $all_var['post_category_array'] = html_entity_decode((string)$geodir_post_category_str, ENT_QUOTES, 'UTF-8'); |
|
| 897 | - $script = "var post_category_array = " . json_encode($all_var) . ';'; |
|
| 898 | - echo '<script>'; |
|
| 899 | - echo $script; |
|
| 900 | - echo '</script>'; |
|
| 896 | + $all_var['post_category_array'] = html_entity_decode((string)$geodir_post_category_str, ENT_QUOTES, 'UTF-8'); |
|
| 897 | + $script = "var post_category_array = " . json_encode($all_var) . ';'; |
|
| 898 | + echo '<script>'; |
|
| 899 | + echo $script; |
|
| 900 | + echo '</script>'; |
|
| 901 | 901 | |
| 902 | 902 | } |
| 903 | 903 | |
@@ -910,16 +910,16 @@ discard block |
||
| 910 | 910 | */ |
| 911 | 911 | function geodir_get_map_default_language() |
| 912 | 912 | {
|
| 913 | - $geodir_default_map_language = get_option('geodir_default_map_language');
|
|
| 914 | - if (empty($geodir_default_map_language)) |
|
| 915 | - $geodir_default_map_language = 'en'; |
|
| 916 | - /** |
|
| 917 | - * Filter default map language. |
|
| 918 | - * |
|
| 919 | - * @since 1.0.0 |
|
| 920 | - * @param string $geodir_default_map_language Default map language. |
|
| 921 | - */ |
|
| 922 | - return apply_filters('geodir_default_map_language', $geodir_default_map_language);
|
|
| 913 | + $geodir_default_map_language = get_option('geodir_default_map_language');
|
|
| 914 | + if (empty($geodir_default_map_language)) |
|
| 915 | + $geodir_default_map_language = 'en'; |
|
| 916 | + /** |
|
| 917 | + * Filter default map language. |
|
| 918 | + * |
|
| 919 | + * @since 1.0.0 |
|
| 920 | + * @param string $geodir_default_map_language Default map language. |
|
| 921 | + */ |
|
| 922 | + return apply_filters('geodir_default_map_language', $geodir_default_map_language);
|
|
| 923 | 923 | } |
| 924 | 924 | |
| 925 | 925 | |
@@ -936,12 +936,12 @@ discard block |
||
| 936 | 936 | */ |
| 937 | 937 | function geodir_add_meta_keywords() |
| 938 | 938 | {
|
| 939 | - global $wp, $post, $wp_query, $wpdb, $geodir_addon_list; |
|
| 939 | + global $wp, $post, $wp_query, $wpdb, $geodir_addon_list; |
|
| 940 | 940 | |
| 941 | - $is_geodir_page = geodir_is_geodir_page(); |
|
| 942 | - if (!$is_geodir_page) {
|
|
| 943 | - return; |
|
| 944 | - }// if non GD page, bail |
|
| 941 | + $is_geodir_page = geodir_is_geodir_page(); |
|
| 942 | + if (!$is_geodir_page) {
|
|
| 943 | + return; |
|
| 944 | + }// if non GD page, bail |
|
| 945 | 945 | |
| 946 | 946 | $use_gd_meta = true; |
| 947 | 947 | if (class_exists('WPSEO_Frontend') || class_exists('All_in_One_SEO_Pack')) {
|
@@ -956,182 +956,182 @@ discard block |
||
| 956 | 956 | return; |
| 957 | 957 | }// bail if Yoast Wordpress SEO or All_in_One_SEO_Pack active. |
| 958 | 958 | |
| 959 | - $current_term = $wp_query->get_queried_object(); |
|
| 959 | + $current_term = $wp_query->get_queried_object(); |
|
| 960 | 960 | |
| 961 | - $all_postypes = geodir_get_posttypes(); |
|
| 961 | + $all_postypes = geodir_get_posttypes(); |
|
| 962 | 962 | |
| 963 | - $geodir_taxonomies = geodir_get_taxonomies('', true);
|
|
| 963 | + $geodir_taxonomies = geodir_get_taxonomies('', true);
|
|
| 964 | 964 | |
| 965 | - $meta_desc = ''; |
|
| 966 | - $meta_key = ''; |
|
| 967 | - if (isset($current_term->ID) && $current_term->ID == geodir_location_page_id()) {
|
|
| 968 | - /** |
|
| 969 | - * Filter SEO meta location description. |
|
| 970 | - * |
|
| 971 | - * @since 1.0.0 |
|
| 972 | - */ |
|
| 973 | - $meta_desc = apply_filters('geodir_seo_meta_location_description', '');
|
|
| 974 | - $meta_desc .= ''; |
|
| 975 | - } |
|
| 976 | - if (have_posts() && is_single() OR is_page()) {
|
|
| 977 | - while (have_posts()) {
|
|
| 978 | - the_post(); |
|
| 979 | - |
|
| 980 | - if (has_excerpt()) {
|
|
| 981 | - $out_excerpt = strip_tags(strip_shortcodes(get_the_excerpt())); |
|
| 982 | - if (empty($out_excerpt)) {
|
|
| 983 | - $out_excerpt = strip_tags(do_shortcode(get_the_excerpt())); |
|
| 984 | - } |
|
| 985 | - $out_excerpt = str_replace(array("\r\n", "\r", "\n"), "", $out_excerpt);
|
|
| 986 | - } else {
|
|
| 987 | - $out_excerpt = str_replace(array("\r\n", "\r", "\n"), "", $post->post_content);
|
|
| 988 | - $out_excerpt = strip_tags(strip_shortcodes($out_excerpt)); |
|
| 989 | - if (empty($out_excerpt)) {
|
|
| 990 | - $out_excerpt = strip_tags(do_shortcode($out_excerpt)); // parse short code from content |
|
| 991 | - } |
|
| 992 | - $out_excerpt = trim(wp_trim_words($out_excerpt, 35, ''), '.!?,;:-'); |
|
| 993 | - } |
|
| 965 | + $meta_desc = ''; |
|
| 966 | + $meta_key = ''; |
|
| 967 | + if (isset($current_term->ID) && $current_term->ID == geodir_location_page_id()) {
|
|
| 968 | + /** |
|
| 969 | + * Filter SEO meta location description. |
|
| 970 | + * |
|
| 971 | + * @since 1.0.0 |
|
| 972 | + */ |
|
| 973 | + $meta_desc = apply_filters('geodir_seo_meta_location_description', '');
|
|
| 974 | + $meta_desc .= ''; |
|
| 975 | + } |
|
| 976 | + if (have_posts() && is_single() OR is_page()) {
|
|
| 977 | + while (have_posts()) {
|
|
| 978 | + the_post(); |
|
| 979 | + |
|
| 980 | + if (has_excerpt()) {
|
|
| 981 | + $out_excerpt = strip_tags(strip_shortcodes(get_the_excerpt())); |
|
| 982 | + if (empty($out_excerpt)) {
|
|
| 983 | + $out_excerpt = strip_tags(do_shortcode(get_the_excerpt())); |
|
| 984 | + } |
|
| 985 | + $out_excerpt = str_replace(array("\r\n", "\r", "\n"), "", $out_excerpt);
|
|
| 986 | + } else {
|
|
| 987 | + $out_excerpt = str_replace(array("\r\n", "\r", "\n"), "", $post->post_content);
|
|
| 988 | + $out_excerpt = strip_tags(strip_shortcodes($out_excerpt)); |
|
| 989 | + if (empty($out_excerpt)) {
|
|
| 990 | + $out_excerpt = strip_tags(do_shortcode($out_excerpt)); // parse short code from content |
|
| 991 | + } |
|
| 992 | + $out_excerpt = trim(wp_trim_words($out_excerpt, 35, ''), '.!?,;:-'); |
|
| 993 | + } |
|
| 994 | 994 | |
| 995 | - $meta_desc .= $out_excerpt; |
|
| 996 | - } |
|
| 997 | - } elseif ((is_category() || is_tag()) && isset($current_term->taxonomy) && in_array($current_term->taxonomy, $geodir_taxonomies)) {
|
|
| 998 | - if (is_category()) {
|
|
| 999 | - $meta_desc .= __("Posts related to Category:", 'geodirectory') . " " . ucfirst(single_cat_title("", FALSE));
|
|
| 1000 | - } elseif (is_tag()) {
|
|
| 1001 | - $meta_desc .= __("Posts related to Tag:", 'geodirectory') . " " . ucfirst(single_tag_title("", FALSE));
|
|
| 1002 | - } |
|
| 1003 | - } elseif (isset($current_term->taxonomy) && in_array($current_term->taxonomy, $geodir_taxonomies)) {
|
|
| 1004 | - $meta_desc .= isset($current_term->description) ? $current_term->description : ''; |
|
| 1005 | - } |
|
| 995 | + $meta_desc .= $out_excerpt; |
|
| 996 | + } |
|
| 997 | + } elseif ((is_category() || is_tag()) && isset($current_term->taxonomy) && in_array($current_term->taxonomy, $geodir_taxonomies)) {
|
|
| 998 | + if (is_category()) {
|
|
| 999 | + $meta_desc .= __("Posts related to Category:", 'geodirectory') . " " . ucfirst(single_cat_title("", FALSE));
|
|
| 1000 | + } elseif (is_tag()) {
|
|
| 1001 | + $meta_desc .= __("Posts related to Tag:", 'geodirectory') . " " . ucfirst(single_tag_title("", FALSE));
|
|
| 1002 | + } |
|
| 1003 | + } elseif (isset($current_term->taxonomy) && in_array($current_term->taxonomy, $geodir_taxonomies)) {
|
|
| 1004 | + $meta_desc .= isset($current_term->description) ? $current_term->description : ''; |
|
| 1005 | + } |
|
| 1006 | 1006 | |
| 1007 | 1007 | |
| 1008 | - $geodir_post_type = geodir_get_current_posttype(); |
|
| 1009 | - $geodir_post_type_info = get_post_type_object($geodir_post_type); |
|
| 1010 | - $geodir_is_page_listing = geodir_is_page('listing') ? true : false;
|
|
| 1011 | - |
|
| 1012 | - $category_taxonomy = geodir_get_taxonomies($geodir_post_type); |
|
| 1013 | - $tag_taxonomy = geodir_get_taxonomies($geodir_post_type, true); |
|
| 1014 | - |
|
| 1015 | - $geodir_is_category = isset($category_taxonomy[0]) && get_query_var($category_taxonomy[0]) ? get_query_var($category_taxonomy[0]) : false; |
|
| 1016 | - $geodir_is_tag = isset($tag_taxonomy[0]) && get_query_var($tag_taxonomy[0]) ? true : false; |
|
| 1017 | - |
|
| 1018 | - $geodir_is_search = geodir_is_page('search') ? true : false;
|
|
| 1019 | - $geodir_is_location = geodir_is_page('location') ? true : false;
|
|
| 1020 | - $geodir_location_manager = isset($geodir_addon_list['geodir_location_manager']) && $geodir_addon_list['geodir_location_manager'] = 'yes' ? true : false; |
|
| 1021 | - $godir_location_terms = geodir_get_current_location_terms('query_vars');
|
|
| 1022 | - $gd_city = $geodir_location_manager && isset($godir_location_terms['gd_city']) ? $godir_location_terms['gd_city'] : NULL; |
|
| 1023 | - $gd_region = $geodir_location_manager && isset($godir_location_terms['gd_region']) ? $godir_location_terms['gd_region'] : NULL; |
|
| 1024 | - $gd_country = $geodir_location_manager && isset($godir_location_terms['gd_country']) ? $godir_location_terms['gd_country'] : NULL; |
|
| 1025 | - $replace_location = __('Everywhere', 'geodirectory');
|
|
| 1026 | - $location_id = NULL; |
|
| 1027 | - if ($geodir_location_manager) {
|
|
| 1028 | - $sql = $wpdb->prepare("SELECT location_id FROM " . POST_LOCATION_TABLE . " WHERE city_slug=%s ORDER BY location_id ASC LIMIT 1", array($gd_city));
|
|
| 1029 | - $location_id = (int)$wpdb->get_var($sql); |
|
| 1030 | - $location_type = geodir_what_is_current_location(); |
|
| 1031 | - if ($location_type == 'city') {
|
|
| 1032 | - $replace_location = geodir_get_current_location(array('what' => 'city', 'echo' => false));
|
|
| 1033 | - } elseif ($location_type == 'region') {
|
|
| 1034 | - $replace_location = geodir_get_current_location(array('what' => 'region', 'echo' => false));
|
|
| 1035 | - } elseif ($location_type == 'country') {
|
|
| 1036 | - $replace_location = geodir_get_current_location(array('what' => 'country', 'echo' => false));
|
|
| 1037 | - $replace_location = __($replace_location, 'geodirectory'); |
|
| 1038 | - } |
|
| 1039 | - $country = get_query_var('gd_country');
|
|
| 1040 | - $region = get_query_var('gd_region');
|
|
| 1041 | - $city = get_query_var('gd_city');
|
|
| 1042 | - $current_location = ''; |
|
| 1043 | - if ($country != '') {
|
|
| 1044 | - $current_location = get_actual_location_name('country', $country, true);
|
|
| 1045 | - } |
|
| 1046 | - if ($region != '') {
|
|
| 1047 | - $current_location = get_actual_location_name('region', $region);
|
|
| 1048 | - } |
|
| 1049 | - if ($city != '') {
|
|
| 1050 | - $current_location = get_actual_location_name('city', $city);
|
|
| 1051 | - } |
|
| 1052 | - $replace_location = $current_location != '' ? $current_location : $replace_location; |
|
| 1053 | - } |
|
| 1008 | + $geodir_post_type = geodir_get_current_posttype(); |
|
| 1009 | + $geodir_post_type_info = get_post_type_object($geodir_post_type); |
|
| 1010 | + $geodir_is_page_listing = geodir_is_page('listing') ? true : false;
|
|
| 1011 | + |
|
| 1012 | + $category_taxonomy = geodir_get_taxonomies($geodir_post_type); |
|
| 1013 | + $tag_taxonomy = geodir_get_taxonomies($geodir_post_type, true); |
|
| 1014 | + |
|
| 1015 | + $geodir_is_category = isset($category_taxonomy[0]) && get_query_var($category_taxonomy[0]) ? get_query_var($category_taxonomy[0]) : false; |
|
| 1016 | + $geodir_is_tag = isset($tag_taxonomy[0]) && get_query_var($tag_taxonomy[0]) ? true : false; |
|
| 1017 | + |
|
| 1018 | + $geodir_is_search = geodir_is_page('search') ? true : false;
|
|
| 1019 | + $geodir_is_location = geodir_is_page('location') ? true : false;
|
|
| 1020 | + $geodir_location_manager = isset($geodir_addon_list['geodir_location_manager']) && $geodir_addon_list['geodir_location_manager'] = 'yes' ? true : false; |
|
| 1021 | + $godir_location_terms = geodir_get_current_location_terms('query_vars');
|
|
| 1022 | + $gd_city = $geodir_location_manager && isset($godir_location_terms['gd_city']) ? $godir_location_terms['gd_city'] : NULL; |
|
| 1023 | + $gd_region = $geodir_location_manager && isset($godir_location_terms['gd_region']) ? $godir_location_terms['gd_region'] : NULL; |
|
| 1024 | + $gd_country = $geodir_location_manager && isset($godir_location_terms['gd_country']) ? $godir_location_terms['gd_country'] : NULL; |
|
| 1025 | + $replace_location = __('Everywhere', 'geodirectory');
|
|
| 1026 | + $location_id = NULL; |
|
| 1027 | + if ($geodir_location_manager) {
|
|
| 1028 | + $sql = $wpdb->prepare("SELECT location_id FROM " . POST_LOCATION_TABLE . " WHERE city_slug=%s ORDER BY location_id ASC LIMIT 1", array($gd_city));
|
|
| 1029 | + $location_id = (int)$wpdb->get_var($sql); |
|
| 1030 | + $location_type = geodir_what_is_current_location(); |
|
| 1031 | + if ($location_type == 'city') {
|
|
| 1032 | + $replace_location = geodir_get_current_location(array('what' => 'city', 'echo' => false));
|
|
| 1033 | + } elseif ($location_type == 'region') {
|
|
| 1034 | + $replace_location = geodir_get_current_location(array('what' => 'region', 'echo' => false));
|
|
| 1035 | + } elseif ($location_type == 'country') {
|
|
| 1036 | + $replace_location = geodir_get_current_location(array('what' => 'country', 'echo' => false));
|
|
| 1037 | + $replace_location = __($replace_location, 'geodirectory'); |
|
| 1038 | + } |
|
| 1039 | + $country = get_query_var('gd_country');
|
|
| 1040 | + $region = get_query_var('gd_region');
|
|
| 1041 | + $city = get_query_var('gd_city');
|
|
| 1042 | + $current_location = ''; |
|
| 1043 | + if ($country != '') {
|
|
| 1044 | + $current_location = get_actual_location_name('country', $country, true);
|
|
| 1045 | + } |
|
| 1046 | + if ($region != '') {
|
|
| 1047 | + $current_location = get_actual_location_name('region', $region);
|
|
| 1048 | + } |
|
| 1049 | + if ($city != '') {
|
|
| 1050 | + $current_location = get_actual_location_name('city', $city);
|
|
| 1051 | + } |
|
| 1052 | + $replace_location = $current_location != '' ? $current_location : $replace_location; |
|
| 1053 | + } |
|
| 1054 | 1054 | |
| 1055 | - $geodir_meta_keys = ''; |
|
| 1056 | - $geodir_meta_desc = ''; |
|
| 1057 | - if ($is_geodir_page && !empty($geodir_post_type_info)) {
|
|
| 1058 | - if ($geodir_is_page_listing || $geodir_is_search || geodir_is_page('add-listing')) {
|
|
| 1059 | - $geodir_meta_keys = isset($geodir_post_type_info->seo['meta_keyword']) && $geodir_post_type_info->seo['meta_keyword'] != '' ? $geodir_post_type_info->seo['meta_keyword'] : $geodir_meta_keys; |
|
| 1060 | - |
|
| 1061 | - $geodir_meta_desc = isset($geodir_post_type_info->description) ? $geodir_post_type_info->description : $geodir_meta_desc; |
|
| 1062 | - $geodir_meta_desc = isset($geodir_post_type_info->seo['meta_description']) && $geodir_post_type_info->seo['meta_description'] != '' ? $geodir_post_type_info->seo['meta_description'] : $geodir_meta_desc; |
|
| 1063 | - |
|
| 1064 | - if ($geodir_is_category) {
|
|
| 1065 | - $category = $geodir_is_category ? get_term_by('slug', $geodir_is_category, $category_taxonomy[0]) : NULL;
|
|
| 1066 | - if (isset($category->term_id) && !empty($category->term_id)) {
|
|
| 1067 | - $category_id = $category->term_id; |
|
| 1068 | - $category_desc = trim($category->description) != '' ? trim($category->description) : get_tax_meta($category_id, 'ct_cat_top_desc', false, $geodir_post_type); |
|
| 1069 | - if ($location_id) {
|
|
| 1070 | - $option_name = 'geodir_cat_loc_' . $geodir_post_type . '_' . $category_id; |
|
| 1071 | - $cat_loc_option = get_option($option_name); |
|
| 1072 | - |
|
| 1073 | - $gd_cat_loc_default = !empty($cat_loc_option) && isset($cat_loc_option['gd_cat_loc_default']) && $cat_loc_option['gd_cat_loc_default'] > 0 ? true : false; |
|
| 1074 | - if (!$gd_cat_loc_default) {
|
|
| 1075 | - $option_name = 'geodir_cat_loc_' . $geodir_post_type . '_' . $category_id . '_' . $location_id; |
|
| 1076 | - $option = get_option($option_name); |
|
| 1077 | - $category_desc = isset($option['gd_cat_loc_desc']) && trim($option['gd_cat_loc_desc']) != '' ? trim($option['gd_cat_loc_desc']) : $category_desc; |
|
| 1078 | - } |
|
| 1079 | - } |
|
| 1080 | - $geodir_meta_desc = __("Posts related to Category:", 'geodirectory') . " " . ucfirst(single_cat_title("", FALSE)) . '. ' . $category_desc;
|
|
| 1081 | - } |
|
| 1082 | - } else if ($geodir_is_tag) {
|
|
| 1083 | - $geodir_meta_desc = __("Posts related to Tag:", 'geodirectory') . " " . ucfirst(single_tag_title("", FALSE)) . '. ' . $geodir_meta_desc;
|
|
| 1084 | - } |
|
| 1085 | - } |
|
| 1086 | - } |
|
| 1055 | + $geodir_meta_keys = ''; |
|
| 1056 | + $geodir_meta_desc = ''; |
|
| 1057 | + if ($is_geodir_page && !empty($geodir_post_type_info)) {
|
|
| 1058 | + if ($geodir_is_page_listing || $geodir_is_search || geodir_is_page('add-listing')) {
|
|
| 1059 | + $geodir_meta_keys = isset($geodir_post_type_info->seo['meta_keyword']) && $geodir_post_type_info->seo['meta_keyword'] != '' ? $geodir_post_type_info->seo['meta_keyword'] : $geodir_meta_keys; |
|
| 1060 | + |
|
| 1061 | + $geodir_meta_desc = isset($geodir_post_type_info->description) ? $geodir_post_type_info->description : $geodir_meta_desc; |
|
| 1062 | + $geodir_meta_desc = isset($geodir_post_type_info->seo['meta_description']) && $geodir_post_type_info->seo['meta_description'] != '' ? $geodir_post_type_info->seo['meta_description'] : $geodir_meta_desc; |
|
| 1063 | + |
|
| 1064 | + if ($geodir_is_category) {
|
|
| 1065 | + $category = $geodir_is_category ? get_term_by('slug', $geodir_is_category, $category_taxonomy[0]) : NULL;
|
|
| 1066 | + if (isset($category->term_id) && !empty($category->term_id)) {
|
|
| 1067 | + $category_id = $category->term_id; |
|
| 1068 | + $category_desc = trim($category->description) != '' ? trim($category->description) : get_tax_meta($category_id, 'ct_cat_top_desc', false, $geodir_post_type); |
|
| 1069 | + if ($location_id) {
|
|
| 1070 | + $option_name = 'geodir_cat_loc_' . $geodir_post_type . '_' . $category_id; |
|
| 1071 | + $cat_loc_option = get_option($option_name); |
|
| 1072 | + |
|
| 1073 | + $gd_cat_loc_default = !empty($cat_loc_option) && isset($cat_loc_option['gd_cat_loc_default']) && $cat_loc_option['gd_cat_loc_default'] > 0 ? true : false; |
|
| 1074 | + if (!$gd_cat_loc_default) {
|
|
| 1075 | + $option_name = 'geodir_cat_loc_' . $geodir_post_type . '_' . $category_id . '_' . $location_id; |
|
| 1076 | + $option = get_option($option_name); |
|
| 1077 | + $category_desc = isset($option['gd_cat_loc_desc']) && trim($option['gd_cat_loc_desc']) != '' ? trim($option['gd_cat_loc_desc']) : $category_desc; |
|
| 1078 | + } |
|
| 1079 | + } |
|
| 1080 | + $geodir_meta_desc = __("Posts related to Category:", 'geodirectory') . " " . ucfirst(single_cat_title("", FALSE)) . '. ' . $category_desc;
|
|
| 1081 | + } |
|
| 1082 | + } else if ($geodir_is_tag) {
|
|
| 1083 | + $geodir_meta_desc = __("Posts related to Tag:", 'geodirectory') . " " . ucfirst(single_tag_title("", FALSE)) . '. ' . $geodir_meta_desc;
|
|
| 1084 | + } |
|
| 1085 | + } |
|
| 1086 | + } |
|
| 1087 | 1087 | |
| 1088 | 1088 | |
| 1089 | - $gd_page = ''; |
|
| 1090 | - if(geodir_is_page('home')){
|
|
| 1091 | - $gd_page = 'home'; |
|
| 1092 | - $meta_desc = (get_option('geodir_meta_desc_homepage')) ? get_option('geodir_meta_desc_homepage') : $meta_desc;
|
|
| 1093 | - } |
|
| 1094 | - elseif(geodir_is_page('detail')){
|
|
| 1095 | - $gd_page = 'detail'; |
|
| 1096 | - $meta_desc = (get_option('geodir_meta_desc_detail')) ? get_option('geodir_meta_desc_detail') : $meta_desc;
|
|
| 1097 | - } |
|
| 1098 | - elseif(geodir_is_page('pt')){
|
|
| 1099 | - $gd_page = 'pt'; |
|
| 1100 | - $meta_desc = (get_option('geodir_meta_desc_pt')) ? get_option('geodir_meta_desc_pt') : $meta_desc;
|
|
| 1101 | - } |
|
| 1102 | - elseif(geodir_is_page('listing')){
|
|
| 1103 | - $gd_page = 'listing'; |
|
| 1104 | - $meta_desc = (get_option('geodir_meta_desc_listing')) ? get_option('geodir_meta_desc_listing') : $meta_desc;
|
|
| 1105 | - } |
|
| 1106 | - elseif(geodir_is_page('location')){
|
|
| 1107 | - $gd_page = 'location'; |
|
| 1108 | - $meta_desc = (get_option('geodir_meta_desc_location')) ? get_option('geodir_meta_desc_location') : $meta_desc;
|
|
| 1109 | - $meta_desc = apply_filters('geodir_seo_meta_location_description', $meta_desc);
|
|
| 1089 | + $gd_page = ''; |
|
| 1090 | + if(geodir_is_page('home')){
|
|
| 1091 | + $gd_page = 'home'; |
|
| 1092 | + $meta_desc = (get_option('geodir_meta_desc_homepage')) ? get_option('geodir_meta_desc_homepage') : $meta_desc;
|
|
| 1093 | + } |
|
| 1094 | + elseif(geodir_is_page('detail')){
|
|
| 1095 | + $gd_page = 'detail'; |
|
| 1096 | + $meta_desc = (get_option('geodir_meta_desc_detail')) ? get_option('geodir_meta_desc_detail') : $meta_desc;
|
|
| 1097 | + } |
|
| 1098 | + elseif(geodir_is_page('pt')){
|
|
| 1099 | + $gd_page = 'pt'; |
|
| 1100 | + $meta_desc = (get_option('geodir_meta_desc_pt')) ? get_option('geodir_meta_desc_pt') : $meta_desc;
|
|
| 1101 | + } |
|
| 1102 | + elseif(geodir_is_page('listing')){
|
|
| 1103 | + $gd_page = 'listing'; |
|
| 1104 | + $meta_desc = (get_option('geodir_meta_desc_listing')) ? get_option('geodir_meta_desc_listing') : $meta_desc;
|
|
| 1105 | + } |
|
| 1106 | + elseif(geodir_is_page('location')){
|
|
| 1107 | + $gd_page = 'location'; |
|
| 1108 | + $meta_desc = (get_option('geodir_meta_desc_location')) ? get_option('geodir_meta_desc_location') : $meta_desc;
|
|
| 1109 | + $meta_desc = apply_filters('geodir_seo_meta_location_description', $meta_desc);
|
|
| 1110 | 1110 | |
| 1111 | - } |
|
| 1112 | - elseif(geodir_is_page('search')){
|
|
| 1113 | - $gd_page = 'search'; |
|
| 1114 | - $meta_desc = (get_option('geodir_meta_desc_search')) ? get_option('geodir_meta_desc_search') : $meta_desc;
|
|
| 1115 | - } |
|
| 1116 | - elseif(geodir_is_page('add-listing')){
|
|
| 1117 | - $gd_page = 'add-listing'; |
|
| 1118 | - $meta_desc = (get_option('geodir_meta_desc_add-listing')) ? get_option('geodir_meta_desc_add-listing') : $meta_desc;
|
|
| 1119 | - } |
|
| 1120 | - elseif(geodir_is_page('author')){
|
|
| 1121 | - $gd_page = 'author'; |
|
| 1122 | - $meta_desc = (get_option('geodir_meta_desc_author')) ? get_option('geodir_meta_desc_author') : $meta_desc;
|
|
| 1123 | - } |
|
| 1124 | - elseif(geodir_is_page('login')){
|
|
| 1125 | - $gd_page = 'login'; |
|
| 1126 | - $meta_desc = (get_option('geodir_meta_desc_login')) ? get_option('geodir_meta_desc_login') : $meta_desc;
|
|
| 1127 | - } |
|
| 1128 | - elseif(geodir_is_page('listing-success')){
|
|
| 1129 | - $gd_page = 'listing-success'; |
|
| 1130 | - $meta_desc = (get_option('geodir_meta_desc_listing-success')) ? get_option('geodir_meta_desc_listing-success') : $meta_desc;
|
|
| 1131 | - } |
|
| 1111 | + } |
|
| 1112 | + elseif(geodir_is_page('search')){
|
|
| 1113 | + $gd_page = 'search'; |
|
| 1114 | + $meta_desc = (get_option('geodir_meta_desc_search')) ? get_option('geodir_meta_desc_search') : $meta_desc;
|
|
| 1115 | + } |
|
| 1116 | + elseif(geodir_is_page('add-listing')){
|
|
| 1117 | + $gd_page = 'add-listing'; |
|
| 1118 | + $meta_desc = (get_option('geodir_meta_desc_add-listing')) ? get_option('geodir_meta_desc_add-listing') : $meta_desc;
|
|
| 1119 | + } |
|
| 1120 | + elseif(geodir_is_page('author')){
|
|
| 1121 | + $gd_page = 'author'; |
|
| 1122 | + $meta_desc = (get_option('geodir_meta_desc_author')) ? get_option('geodir_meta_desc_author') : $meta_desc;
|
|
| 1123 | + } |
|
| 1124 | + elseif(geodir_is_page('login')){
|
|
| 1125 | + $gd_page = 'login'; |
|
| 1126 | + $meta_desc = (get_option('geodir_meta_desc_login')) ? get_option('geodir_meta_desc_login') : $meta_desc;
|
|
| 1127 | + } |
|
| 1128 | + elseif(geodir_is_page('listing-success')){
|
|
| 1129 | + $gd_page = 'listing-success'; |
|
| 1130 | + $meta_desc = (get_option('geodir_meta_desc_listing-success')) ? get_option('geodir_meta_desc_listing-success') : $meta_desc;
|
|
| 1131 | + } |
|
| 1132 | 1132 | |
| 1133 | 1133 | |
| 1134 | - /* |
|
| 1134 | + /* |
|
| 1135 | 1135 | $geodir_meta_desc = $geodir_meta_desc != '' ? $geodir_meta_desc : $meta_desc; |
| 1136 | 1136 | if ($geodir_meta_desc != '') {
|
| 1137 | 1137 | $geodir_meta_desc = strip_tags($geodir_meta_desc); |
@@ -1144,74 +1144,74 @@ discard block |
||
| 1144 | 1144 | */ |
| 1145 | 1145 | |
| 1146 | 1146 | |
| 1147 | - if ($meta_desc) {
|
|
| 1148 | - $meta_desc = stripslashes_deep($meta_desc); |
|
| 1149 | - /** |
|
| 1150 | - * Filter page description to replace variables. |
|
| 1151 | - * |
|
| 1152 | - * @since 1.5.4 |
|
| 1153 | - * @param string $title The page description including variables. |
|
| 1154 | - * @param string $gd_page The GeoDirectory page type if any. |
|
| 1155 | - */ |
|
| 1156 | - $meta_desc = apply_filters('geodir_seo_meta_description_pre', __($meta_desc, 'geodirectory'),$gd_page,'');
|
|
| 1157 | - |
|
| 1158 | - /** |
|
| 1159 | - * Filter SEO meta description. |
|
| 1160 | - * |
|
| 1161 | - * @since 1.0.0 |
|
| 1162 | - * @param string $meta_desc Meta description content. |
|
| 1163 | - */ |
|
| 1164 | - echo apply_filters('geodir_seo_meta_description', '<meta name="description" content="' . $meta_desc . '" />', $meta_desc);
|
|
| 1165 | - } |
|
| 1147 | + if ($meta_desc) {
|
|
| 1148 | + $meta_desc = stripslashes_deep($meta_desc); |
|
| 1149 | + /** |
|
| 1150 | + * Filter page description to replace variables. |
|
| 1151 | + * |
|
| 1152 | + * @since 1.5.4 |
|
| 1153 | + * @param string $title The page description including variables. |
|
| 1154 | + * @param string $gd_page The GeoDirectory page type if any. |
|
| 1155 | + */ |
|
| 1156 | + $meta_desc = apply_filters('geodir_seo_meta_description_pre', __($meta_desc, 'geodirectory'),$gd_page,'');
|
|
| 1157 | + |
|
| 1158 | + /** |
|
| 1159 | + * Filter SEO meta description. |
|
| 1160 | + * |
|
| 1161 | + * @since 1.0.0 |
|
| 1162 | + * @param string $meta_desc Meta description content. |
|
| 1163 | + */ |
|
| 1164 | + echo apply_filters('geodir_seo_meta_description', '<meta name="description" content="' . $meta_desc . '" />', $meta_desc);
|
|
| 1165 | + } |
|
| 1166 | 1166 | |
| 1167 | - // meta keywords |
|
| 1168 | - if (isset($post->post_type) && in_array($post->post_type, $all_postypes)) {
|
|
| 1169 | - $place_tags = wp_get_post_terms($post->ID, $post->post_type . '_tags', array("fields" => "names"));
|
|
| 1170 | - $place_cats = wp_get_post_terms($post->ID, $post->post_type . 'category', array("fields" => "names"));
|
|
| 1171 | - |
|
| 1172 | - $meta_key .= implode(", ", array_merge((array)$place_cats, (array)$place_tags));
|
|
| 1173 | - } else {
|
|
| 1174 | - $posttags = get_the_tags(); |
|
| 1175 | - if ($posttags) {
|
|
| 1176 | - foreach ($posttags as $tag) {
|
|
| 1177 | - $meta_key .= $tag->name . ' '; |
|
| 1178 | - } |
|
| 1179 | - } else {
|
|
| 1180 | - $tags = get_tags(array('orderby' => 'count', 'order' => 'DESC'));
|
|
| 1181 | - $xt = 1; |
|
| 1167 | + // meta keywords |
|
| 1168 | + if (isset($post->post_type) && in_array($post->post_type, $all_postypes)) {
|
|
| 1169 | + $place_tags = wp_get_post_terms($post->ID, $post->post_type . '_tags', array("fields" => "names"));
|
|
| 1170 | + $place_cats = wp_get_post_terms($post->ID, $post->post_type . 'category', array("fields" => "names"));
|
|
| 1171 | + |
|
| 1172 | + $meta_key .= implode(", ", array_merge((array)$place_cats, (array)$place_tags));
|
|
| 1173 | + } else {
|
|
| 1174 | + $posttags = get_the_tags(); |
|
| 1175 | + if ($posttags) {
|
|
| 1176 | + foreach ($posttags as $tag) {
|
|
| 1177 | + $meta_key .= $tag->name . ' '; |
|
| 1178 | + } |
|
| 1179 | + } else {
|
|
| 1180 | + $tags = get_tags(array('orderby' => 'count', 'order' => 'DESC'));
|
|
| 1181 | + $xt = 1; |
|
| 1182 | 1182 | |
| 1183 | - foreach ($tags as $tag) {
|
|
| 1184 | - if ($xt <= 20) {
|
|
| 1185 | - $meta_key .= $tag->name . ", "; |
|
| 1186 | - } |
|
| 1183 | + foreach ($tags as $tag) {
|
|
| 1184 | + if ($xt <= 20) {
|
|
| 1185 | + $meta_key .= $tag->name . ", "; |
|
| 1186 | + } |
|
| 1187 | 1187 | |
| 1188 | - $xt++; |
|
| 1189 | - } |
|
| 1190 | - } |
|
| 1191 | - } |
|
| 1188 | + $xt++; |
|
| 1189 | + } |
|
| 1190 | + } |
|
| 1191 | + } |
|
| 1192 | 1192 | |
| 1193 | - $meta_key = $meta_key != '' ? rtrim(trim($meta_key), ",") : $meta_key; |
|
| 1194 | - $geodir_meta_keys = $geodir_meta_keys != '' ? ($meta_key != '' ? $meta_key . ', ' . $geodir_meta_keys : $geodir_meta_keys) : $meta_key; |
|
| 1195 | - if ($geodir_meta_keys != '') {
|
|
| 1196 | - $geodir_meta_keys = strip_tags($geodir_meta_keys); |
|
| 1197 | - $geodir_meta_keys = esc_html($geodir_meta_keys); |
|
| 1198 | - $geodir_meta_keys = geodir_strtolower($geodir_meta_keys); |
|
| 1199 | - $geodir_meta_keys = wp_html_excerpt($geodir_meta_keys, 1000, ''); |
|
| 1200 | - $geodir_meta_keys = str_replace('%location%', $replace_location, $geodir_meta_keys);
|
|
| 1193 | + $meta_key = $meta_key != '' ? rtrim(trim($meta_key), ",") : $meta_key; |
|
| 1194 | + $geodir_meta_keys = $geodir_meta_keys != '' ? ($meta_key != '' ? $meta_key . ', ' . $geodir_meta_keys : $geodir_meta_keys) : $meta_key; |
|
| 1195 | + if ($geodir_meta_keys != '') {
|
|
| 1196 | + $geodir_meta_keys = strip_tags($geodir_meta_keys); |
|
| 1197 | + $geodir_meta_keys = esc_html($geodir_meta_keys); |
|
| 1198 | + $geodir_meta_keys = geodir_strtolower($geodir_meta_keys); |
|
| 1199 | + $geodir_meta_keys = wp_html_excerpt($geodir_meta_keys, 1000, ''); |
|
| 1200 | + $geodir_meta_keys = str_replace('%location%', $replace_location, $geodir_meta_keys);
|
|
| 1201 | 1201 | |
| 1202 | - $meta_key = rtrim(trim($geodir_meta_keys), ","); |
|
| 1203 | - } |
|
| 1202 | + $meta_key = rtrim(trim($geodir_meta_keys), ","); |
|
| 1203 | + } |
|
| 1204 | 1204 | |
| 1205 | - if ($meta_key) {
|
|
| 1206 | - $meta_key = stripslashes_deep($meta_key); |
|
| 1207 | - /** |
|
| 1208 | - * Filter SEO meta keywords. |
|
| 1209 | - * |
|
| 1210 | - * @since 1.0.0 |
|
| 1211 | - * @param string $meta_desc Meta keywords. |
|
| 1212 | - */ |
|
| 1213 | - echo apply_filters('geodir_seo_meta_keywords', '<meta name="keywords" content="' . $meta_key . '" />', $meta_key);
|
|
| 1214 | - } |
|
| 1205 | + if ($meta_key) {
|
|
| 1206 | + $meta_key = stripslashes_deep($meta_key); |
|
| 1207 | + /** |
|
| 1208 | + * Filter SEO meta keywords. |
|
| 1209 | + * |
|
| 1210 | + * @since 1.0.0 |
|
| 1211 | + * @param string $meta_desc Meta keywords. |
|
| 1212 | + */ |
|
| 1213 | + echo apply_filters('geodir_seo_meta_keywords', '<meta name="keywords" content="' . $meta_key . '" />', $meta_key);
|
|
| 1214 | + } |
|
| 1215 | 1215 | |
| 1216 | 1216 | } |
| 1217 | 1217 | |
@@ -1226,14 +1226,14 @@ discard block |
||
| 1226 | 1226 | */ |
| 1227 | 1227 | function geodir_detail_page_tabs_key_value_array() |
| 1228 | 1228 | {
|
| 1229 | - $geodir_detail_page_tabs_key_value_array = array(); |
|
| 1229 | + $geodir_detail_page_tabs_key_value_array = array(); |
|
| 1230 | 1230 | |
| 1231 | - $geodir_detail_page_tabs_array = geodir_detail_page_tabs_array(); |
|
| 1231 | + $geodir_detail_page_tabs_array = geodir_detail_page_tabs_array(); |
|
| 1232 | 1232 | |
| 1233 | - foreach ($geodir_detail_page_tabs_array as $key => $tabs_obj) {
|
|
| 1234 | - $geodir_detail_page_tabs_key_value_array[$key] = $tabs_obj['heading_text']; |
|
| 1235 | - } |
|
| 1236 | - return $geodir_detail_page_tabs_key_value_array; |
|
| 1233 | + foreach ($geodir_detail_page_tabs_array as $key => $tabs_obj) {
|
|
| 1234 | + $geodir_detail_page_tabs_key_value_array[$key] = $tabs_obj['heading_text']; |
|
| 1235 | + } |
|
| 1236 | + return $geodir_detail_page_tabs_key_value_array; |
|
| 1237 | 1237 | } |
| 1238 | 1238 | |
| 1239 | 1239 | /** |
@@ -1246,73 +1246,73 @@ discard block |
||
| 1246 | 1246 | function geodir_detail_page_tabs_array() |
| 1247 | 1247 | {
|
| 1248 | 1248 | |
| 1249 | - $arr_tabs = array(); |
|
| 1250 | - /** |
|
| 1251 | - * Filter detail page tab display. |
|
| 1252 | - * |
|
| 1253 | - * @since 1.0.0 |
|
| 1254 | - */ |
|
| 1255 | - $arr_tabs['post_profile'] = array( |
|
| 1256 | - 'heading_text' => __('Profile', 'geodirectory'),
|
|
| 1257 | - 'is_active_tab' => true, |
|
| 1258 | - 'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'post_profile'),
|
|
| 1259 | - 'tab_content' => '' |
|
| 1260 | - ); |
|
| 1261 | - $arr_tabs['post_info'] = array( |
|
| 1262 | - 'heading_text' => __('More Info', 'geodirectory'),
|
|
| 1263 | - 'is_active_tab' => false, |
|
| 1264 | - 'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'post_info'),
|
|
| 1265 | - 'tab_content' => '' |
|
| 1266 | - ); |
|
| 1267 | - |
|
| 1268 | - $arr_tabs['post_images'] = array( |
|
| 1269 | - 'heading_text' => __('Photo', 'geodirectory'),
|
|
| 1270 | - 'is_active_tab' => false, |
|
| 1271 | - 'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'post_images'),
|
|
| 1272 | - 'tab_content' => '' |
|
| 1273 | - ); |
|
| 1274 | - |
|
| 1275 | - $arr_tabs['post_video'] = array( |
|
| 1276 | - 'heading_text' => __('Video', 'geodirectory'),
|
|
| 1277 | - 'is_active_tab' => false, |
|
| 1278 | - 'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'post_video'),
|
|
| 1279 | - 'tab_content' => '' |
|
| 1280 | - ); |
|
| 1281 | - |
|
| 1282 | - $arr_tabs['special_offers'] = array( |
|
| 1283 | - 'heading_text' => __('Special Offers', 'geodirectory'),
|
|
| 1284 | - 'is_active_tab' => false, |
|
| 1285 | - 'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'special_offers'),
|
|
| 1286 | - 'tab_content' => '' |
|
| 1287 | - ); |
|
| 1288 | - |
|
| 1289 | - $arr_tabs['post_map'] = array( |
|
| 1290 | - 'heading_text' => __('Map', 'geodirectory'),
|
|
| 1291 | - 'is_active_tab' => false, |
|
| 1292 | - 'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'post_map'),
|
|
| 1293 | - 'tab_content' => '' |
|
| 1294 | - ); |
|
| 1295 | - |
|
| 1296 | - $arr_tabs['reviews'] = array( |
|
| 1297 | - 'heading_text' => __('Reviews', 'geodirectory'),
|
|
| 1298 | - 'is_active_tab' => false, |
|
| 1299 | - 'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'reviews'),
|
|
| 1300 | - 'tab_content' => 'review display' |
|
| 1301 | - ); |
|
| 1302 | - |
|
| 1303 | - $arr_tabs['related_listing'] = array( |
|
| 1304 | - 'heading_text' => __('Related Listing', 'geodirectory'),
|
|
| 1305 | - 'is_active_tab' => false, |
|
| 1306 | - 'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'related_listing'),
|
|
| 1307 | - 'tab_content' => '' |
|
| 1308 | - ); |
|
| 1309 | - |
|
| 1310 | - /** |
|
| 1311 | - * Filter the tabs array. |
|
| 1312 | - * |
|
| 1313 | - * @since 1.0.0 |
|
| 1314 | - */ |
|
| 1315 | - return apply_filters('geodir_detail_page_tab_list_extend', $arr_tabs);
|
|
| 1249 | + $arr_tabs = array(); |
|
| 1250 | + /** |
|
| 1251 | + * Filter detail page tab display. |
|
| 1252 | + * |
|
| 1253 | + * @since 1.0.0 |
|
| 1254 | + */ |
|
| 1255 | + $arr_tabs['post_profile'] = array( |
|
| 1256 | + 'heading_text' => __('Profile', 'geodirectory'),
|
|
| 1257 | + 'is_active_tab' => true, |
|
| 1258 | + 'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'post_profile'),
|
|
| 1259 | + 'tab_content' => '' |
|
| 1260 | + ); |
|
| 1261 | + $arr_tabs['post_info'] = array( |
|
| 1262 | + 'heading_text' => __('More Info', 'geodirectory'),
|
|
| 1263 | + 'is_active_tab' => false, |
|
| 1264 | + 'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'post_info'),
|
|
| 1265 | + 'tab_content' => '' |
|
| 1266 | + ); |
|
| 1267 | + |
|
| 1268 | + $arr_tabs['post_images'] = array( |
|
| 1269 | + 'heading_text' => __('Photo', 'geodirectory'),
|
|
| 1270 | + 'is_active_tab' => false, |
|
| 1271 | + 'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'post_images'),
|
|
| 1272 | + 'tab_content' => '' |
|
| 1273 | + ); |
|
| 1274 | + |
|
| 1275 | + $arr_tabs['post_video'] = array( |
|
| 1276 | + 'heading_text' => __('Video', 'geodirectory'),
|
|
| 1277 | + 'is_active_tab' => false, |
|
| 1278 | + 'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'post_video'),
|
|
| 1279 | + 'tab_content' => '' |
|
| 1280 | + ); |
|
| 1281 | + |
|
| 1282 | + $arr_tabs['special_offers'] = array( |
|
| 1283 | + 'heading_text' => __('Special Offers', 'geodirectory'),
|
|
| 1284 | + 'is_active_tab' => false, |
|
| 1285 | + 'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'special_offers'),
|
|
| 1286 | + 'tab_content' => '' |
|
| 1287 | + ); |
|
| 1288 | + |
|
| 1289 | + $arr_tabs['post_map'] = array( |
|
| 1290 | + 'heading_text' => __('Map', 'geodirectory'),
|
|
| 1291 | + 'is_active_tab' => false, |
|
| 1292 | + 'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'post_map'),
|
|
| 1293 | + 'tab_content' => '' |
|
| 1294 | + ); |
|
| 1295 | + |
|
| 1296 | + $arr_tabs['reviews'] = array( |
|
| 1297 | + 'heading_text' => __('Reviews', 'geodirectory'),
|
|
| 1298 | + 'is_active_tab' => false, |
|
| 1299 | + 'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'reviews'),
|
|
| 1300 | + 'tab_content' => 'review display' |
|
| 1301 | + ); |
|
| 1302 | + |
|
| 1303 | + $arr_tabs['related_listing'] = array( |
|
| 1304 | + 'heading_text' => __('Related Listing', 'geodirectory'),
|
|
| 1305 | + 'is_active_tab' => false, |
|
| 1306 | + 'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'related_listing'),
|
|
| 1307 | + 'tab_content' => '' |
|
| 1308 | + ); |
|
| 1309 | + |
|
| 1310 | + /** |
|
| 1311 | + * Filter the tabs array. |
|
| 1312 | + * |
|
| 1313 | + * @since 1.0.0 |
|
| 1314 | + */ |
|
| 1315 | + return apply_filters('geodir_detail_page_tab_list_extend', $arr_tabs);
|
|
| 1316 | 1316 | |
| 1317 | 1317 | |
| 1318 | 1318 | } |
@@ -1327,15 +1327,15 @@ discard block |
||
| 1327 | 1327 | */ |
| 1328 | 1328 | function geodir_detail_page_tabs_list() |
| 1329 | 1329 | {
|
| 1330 | - $tabs_excluded = get_option('geodir_detail_page_tabs_excluded');
|
|
| 1331 | - $tabs_array = geodir_detail_page_tabs_array(); |
|
| 1332 | - if (!empty($tabs_excluded)) {
|
|
| 1333 | - foreach ($tabs_excluded as $tab) {
|
|
| 1334 | - if (array_key_exists($tab, $tabs_array)) |
|
| 1335 | - unset($tabs_array[$tab]); |
|
| 1336 | - } |
|
| 1337 | - } |
|
| 1338 | - return $tabs_array; |
|
| 1330 | + $tabs_excluded = get_option('geodir_detail_page_tabs_excluded');
|
|
| 1331 | + $tabs_array = geodir_detail_page_tabs_array(); |
|
| 1332 | + if (!empty($tabs_excluded)) {
|
|
| 1333 | + foreach ($tabs_excluded as $tab) {
|
|
| 1334 | + if (array_key_exists($tab, $tabs_array)) |
|
| 1335 | + unset($tabs_array[$tab]); |
|
| 1336 | + } |
|
| 1337 | + } |
|
| 1338 | + return $tabs_array; |
|
| 1339 | 1339 | } |
| 1340 | 1340 | |
| 1341 | 1341 | |
@@ -1353,145 +1353,145 @@ discard block |
||
| 1353 | 1353 | */ |
| 1354 | 1354 | function geodir_show_detail_page_tabs() |
| 1355 | 1355 | {
|
| 1356 | - global $post, $post_images, $video, $special_offers, $related_listing, $geodir_post_detail_fields; |
|
| 1356 | + global $post, $post_images, $video, $special_offers, $related_listing, $geodir_post_detail_fields; |
|
| 1357 | 1357 | |
| 1358 | - $post_id = !empty($post) && isset($post->ID) ? (int)$post->ID : 0; |
|
| 1359 | - $request_post_id = !empty($_REQUEST['p']) ? (int)$_REQUEST['p'] : 0; |
|
| 1360 | - $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend |
|
| 1358 | + $post_id = !empty($post) && isset($post->ID) ? (int)$post->ID : 0; |
|
| 1359 | + $request_post_id = !empty($_REQUEST['p']) ? (int)$_REQUEST['p'] : 0; |
|
| 1360 | + $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend |
|
| 1361 | 1361 | |
| 1362 | - if ($is_backend_preview && !$post_id > 0 && $request_post_id > 0) {
|
|
| 1363 | - $post = geodir_get_post_info($request_post_id); |
|
| 1364 | - setup_postdata($post); |
|
| 1365 | - } |
|
| 1362 | + if ($is_backend_preview && !$post_id > 0 && $request_post_id > 0) {
|
|
| 1363 | + $post = geodir_get_post_info($request_post_id); |
|
| 1364 | + setup_postdata($post); |
|
| 1365 | + } |
|
| 1366 | 1366 | |
| 1367 | - $geodir_post_detail_fields = geodir_show_listing_info('detail');
|
|
| 1368 | - |
|
| 1369 | - if (geodir_is_page('detail')) {
|
|
| 1370 | - $video = geodir_get_video($post->ID); |
|
| 1371 | - $special_offers = geodir_get_special_offers($post->ID); |
|
| 1372 | - $related_listing_array = array(); |
|
| 1373 | - if (get_option('geodir_add_related_listing_posttypes'))
|
|
| 1374 | - $related_listing_array = get_option('geodir_add_related_listing_posttypes');
|
|
| 1375 | - |
|
| 1376 | - $related_listing = ''; |
|
| 1377 | - if (in_array($post->post_type, $related_listing_array)) {
|
|
| 1378 | - $request = array('post_number' => get_option('geodir_related_post_count'),
|
|
| 1379 | - 'relate_to' => get_option('geodir_related_post_relate_to'),
|
|
| 1380 | - 'layout' => get_option('geodir_related_post_listing_view'),
|
|
| 1381 | - 'add_location_filter' => get_option('geodir_related_post_location_filter'),
|
|
| 1382 | - 'list_sort' => get_option('geodir_related_post_sortby'),
|
|
| 1383 | - 'character_count' => get_option('geodir_related_post_excerpt'));
|
|
| 1384 | - |
|
| 1385 | - $related_listing = geodir_related_posts_display($request); |
|
| 1386 | - } |
|
| 1367 | + $geodir_post_detail_fields = geodir_show_listing_info('detail');
|
|
| 1368 | + |
|
| 1369 | + if (geodir_is_page('detail')) {
|
|
| 1370 | + $video = geodir_get_video($post->ID); |
|
| 1371 | + $special_offers = geodir_get_special_offers($post->ID); |
|
| 1372 | + $related_listing_array = array(); |
|
| 1373 | + if (get_option('geodir_add_related_listing_posttypes'))
|
|
| 1374 | + $related_listing_array = get_option('geodir_add_related_listing_posttypes');
|
|
| 1375 | + |
|
| 1376 | + $related_listing = ''; |
|
| 1377 | + if (in_array($post->post_type, $related_listing_array)) {
|
|
| 1378 | + $request = array('post_number' => get_option('geodir_related_post_count'),
|
|
| 1379 | + 'relate_to' => get_option('geodir_related_post_relate_to'),
|
|
| 1380 | + 'layout' => get_option('geodir_related_post_listing_view'),
|
|
| 1381 | + 'add_location_filter' => get_option('geodir_related_post_location_filter'),
|
|
| 1382 | + 'list_sort' => get_option('geodir_related_post_sortby'),
|
|
| 1383 | + 'character_count' => get_option('geodir_related_post_excerpt'));
|
|
| 1384 | + |
|
| 1385 | + $related_listing = geodir_related_posts_display($request); |
|
| 1386 | + } |
|
| 1387 | 1387 | |
| 1388 | - $post_images = geodir_get_images($post->ID, 'thumbnail'); |
|
| 1389 | - $thumb_image = ''; |
|
| 1390 | - if (!empty($post_images)) {
|
|
| 1391 | - foreach ($post_images as $image) {
|
|
| 1392 | - $caption = (!empty($image->caption)) ? $image->caption : ''; |
|
| 1393 | - $thumb_image .= '<a href="' . $image->src . '" title="'.$caption.'">'; |
|
| 1394 | - $thumb_image .= geodir_show_image($image, 'thumbnail', true, false); |
|
| 1395 | - $thumb_image .= '</a>'; |
|
| 1396 | - } |
|
| 1397 | - } |
|
| 1388 | + $post_images = geodir_get_images($post->ID, 'thumbnail'); |
|
| 1389 | + $thumb_image = ''; |
|
| 1390 | + if (!empty($post_images)) {
|
|
| 1391 | + foreach ($post_images as $image) {
|
|
| 1392 | + $caption = (!empty($image->caption)) ? $image->caption : ''; |
|
| 1393 | + $thumb_image .= '<a href="' . $image->src . '" title="'.$caption.'">'; |
|
| 1394 | + $thumb_image .= geodir_show_image($image, 'thumbnail', true, false); |
|
| 1395 | + $thumb_image .= '</a>'; |
|
| 1396 | + } |
|
| 1397 | + } |
|
| 1398 | 1398 | |
| 1399 | - $map_args = array(); |
|
| 1400 | - $map_args['map_canvas_name'] = 'detail_page_map_canvas'; |
|
| 1401 | - $map_args['width'] = '600'; |
|
| 1402 | - $map_args['height'] = '300'; |
|
| 1403 | - if ($post->post_mapzoom) {
|
|
| 1404 | - $map_args['zoom'] = '' . $post->post_mapzoom . ''; |
|
| 1405 | - } |
|
| 1406 | - $map_args['autozoom'] = false; |
|
| 1407 | - $map_args['child_collapse'] = '0'; |
|
| 1408 | - $map_args['enable_cat_filters'] = false; |
|
| 1409 | - $map_args['enable_text_search'] = false; |
|
| 1410 | - $map_args['enable_post_type_filters'] = false; |
|
| 1411 | - $map_args['enable_location_filters'] = false; |
|
| 1412 | - $map_args['enable_jason_on_load'] = true; |
|
| 1413 | - $map_args['enable_map_direction'] = true; |
|
| 1414 | - $map_args['map_class_name'] = 'geodir-map-detail-page'; |
|
| 1415 | - $map_args['maptype'] = (!empty($post->post_mapview)) ? $post->post_mapview : 'ROADMAP'; |
|
| 1416 | - } else if (geodir_is_page('preview')) {
|
|
| 1417 | - $video = isset($post->geodir_video) ? $post->geodir_video : ''; |
|
| 1418 | - $special_offers = isset($post->geodir_special_offers) ? $post->geodir_special_offers : ''; |
|
| 1419 | - |
|
| 1420 | - if (isset($post->post_images)) |
|
| 1421 | - $post->post_images = trim($post->post_images, ","); |
|
| 1422 | - |
|
| 1423 | - if (isset($post->post_images) && !empty($post->post_images)) |
|
| 1424 | - $post_images = explode(",", $post->post_images);
|
|
| 1425 | - |
|
| 1426 | - $thumb_image = ''; |
|
| 1427 | - if (!empty($post_images)) {
|
|
| 1428 | - foreach ($post_images as $image) {
|
|
| 1429 | - if ($image != '') {
|
|
| 1430 | - $thumb_image .= '<a href="' . $image . '">'; |
|
| 1431 | - $thumb_image .= geodir_show_image(array('src' => $image), 'thumbnail', true, false);
|
|
| 1432 | - $thumb_image .= '</a>'; |
|
| 1433 | - } |
|
| 1434 | - } |
|
| 1435 | - } |
|
| 1399 | + $map_args = array(); |
|
| 1400 | + $map_args['map_canvas_name'] = 'detail_page_map_canvas'; |
|
| 1401 | + $map_args['width'] = '600'; |
|
| 1402 | + $map_args['height'] = '300'; |
|
| 1403 | + if ($post->post_mapzoom) {
|
|
| 1404 | + $map_args['zoom'] = '' . $post->post_mapzoom . ''; |
|
| 1405 | + } |
|
| 1406 | + $map_args['autozoom'] = false; |
|
| 1407 | + $map_args['child_collapse'] = '0'; |
|
| 1408 | + $map_args['enable_cat_filters'] = false; |
|
| 1409 | + $map_args['enable_text_search'] = false; |
|
| 1410 | + $map_args['enable_post_type_filters'] = false; |
|
| 1411 | + $map_args['enable_location_filters'] = false; |
|
| 1412 | + $map_args['enable_jason_on_load'] = true; |
|
| 1413 | + $map_args['enable_map_direction'] = true; |
|
| 1414 | + $map_args['map_class_name'] = 'geodir-map-detail-page'; |
|
| 1415 | + $map_args['maptype'] = (!empty($post->post_mapview)) ? $post->post_mapview : 'ROADMAP'; |
|
| 1416 | + } else if (geodir_is_page('preview')) {
|
|
| 1417 | + $video = isset($post->geodir_video) ? $post->geodir_video : ''; |
|
| 1418 | + $special_offers = isset($post->geodir_special_offers) ? $post->geodir_special_offers : ''; |
|
| 1419 | + |
|
| 1420 | + if (isset($post->post_images)) |
|
| 1421 | + $post->post_images = trim($post->post_images, ","); |
|
| 1422 | + |
|
| 1423 | + if (isset($post->post_images) && !empty($post->post_images)) |
|
| 1424 | + $post_images = explode(",", $post->post_images);
|
|
| 1425 | + |
|
| 1426 | + $thumb_image = ''; |
|
| 1427 | + if (!empty($post_images)) {
|
|
| 1428 | + foreach ($post_images as $image) {
|
|
| 1429 | + if ($image != '') {
|
|
| 1430 | + $thumb_image .= '<a href="' . $image . '">'; |
|
| 1431 | + $thumb_image .= geodir_show_image(array('src' => $image), 'thumbnail', true, false);
|
|
| 1432 | + $thumb_image .= '</a>'; |
|
| 1433 | + } |
|
| 1434 | + } |
|
| 1435 | + } |
|
| 1436 | 1436 | |
| 1437 | - global $map_jason; |
|
| 1438 | - $map_jason[] = $post->marker_json; |
|
| 1437 | + global $map_jason; |
|
| 1438 | + $map_jason[] = $post->marker_json; |
|
| 1439 | 1439 | |
| 1440 | - $address_latitude = isset($post->post_latitude) ? $post->post_latitude : ''; |
|
| 1441 | - $address_longitude = isset($post->post_longitude) ? $post->post_longitude : ''; |
|
| 1442 | - $mapview = isset($post->post_mapview) ? $post->post_mapview : ''; |
|
| 1443 | - $mapzoom = isset($post->post_mapzoom) ? $post->post_mapzoom : ''; |
|
| 1444 | - if (!$mapzoom) {
|
|
| 1445 | - $mapzoom = 12; |
|
| 1446 | - } |
|
| 1440 | + $address_latitude = isset($post->post_latitude) ? $post->post_latitude : ''; |
|
| 1441 | + $address_longitude = isset($post->post_longitude) ? $post->post_longitude : ''; |
|
| 1442 | + $mapview = isset($post->post_mapview) ? $post->post_mapview : ''; |
|
| 1443 | + $mapzoom = isset($post->post_mapzoom) ? $post->post_mapzoom : ''; |
|
| 1444 | + if (!$mapzoom) {
|
|
| 1445 | + $mapzoom = 12; |
|
| 1446 | + } |
|
| 1447 | 1447 | |
| 1448 | - $map_args = array(); |
|
| 1449 | - $map_args['map_canvas_name'] = 'preview_map_canvas'; |
|
| 1450 | - $map_args['width'] = '950'; |
|
| 1451 | - $map_args['height'] = '300'; |
|
| 1452 | - $map_args['child_collapse'] = '0'; |
|
| 1453 | - $map_args['maptype'] = $mapview; |
|
| 1454 | - $map_args['autozoom'] = false; |
|
| 1455 | - $map_args['zoom'] = "$mapzoom"; |
|
| 1456 | - $map_args['latitude'] = $address_latitude; |
|
| 1457 | - $map_args['longitude'] = $address_longitude; |
|
| 1458 | - $map_args['enable_cat_filters'] = false; |
|
| 1459 | - $map_args['enable_text_search'] = false; |
|
| 1460 | - $map_args['enable_post_type_filters'] = false; |
|
| 1461 | - $map_args['enable_location_filters'] = false; |
|
| 1462 | - $map_args['enable_jason_on_load'] = true; |
|
| 1463 | - $map_args['enable_map_direction'] = true; |
|
| 1464 | - $map_args['map_class_name'] = 'geodir-map-preview-page'; |
|
| 1465 | - } |
|
| 1448 | + $map_args = array(); |
|
| 1449 | + $map_args['map_canvas_name'] = 'preview_map_canvas'; |
|
| 1450 | + $map_args['width'] = '950'; |
|
| 1451 | + $map_args['height'] = '300'; |
|
| 1452 | + $map_args['child_collapse'] = '0'; |
|
| 1453 | + $map_args['maptype'] = $mapview; |
|
| 1454 | + $map_args['autozoom'] = false; |
|
| 1455 | + $map_args['zoom'] = "$mapzoom"; |
|
| 1456 | + $map_args['latitude'] = $address_latitude; |
|
| 1457 | + $map_args['longitude'] = $address_longitude; |
|
| 1458 | + $map_args['enable_cat_filters'] = false; |
|
| 1459 | + $map_args['enable_text_search'] = false; |
|
| 1460 | + $map_args['enable_post_type_filters'] = false; |
|
| 1461 | + $map_args['enable_location_filters'] = false; |
|
| 1462 | + $map_args['enable_jason_on_load'] = true; |
|
| 1463 | + $map_args['enable_map_direction'] = true; |
|
| 1464 | + $map_args['map_class_name'] = 'geodir-map-preview-page'; |
|
| 1465 | + } |
|
| 1466 | 1466 | |
| 1467 | - $arr_detail_page_tabs = geodir_detail_page_tabs_list();// get this sooner so we can get the active tab for the user |
|
| 1467 | + $arr_detail_page_tabs = geodir_detail_page_tabs_list();// get this sooner so we can get the active tab for the user |
|
| 1468 | 1468 | |
| 1469 | - $active_tab = ''; |
|
| 1470 | - $active_tab_name = ''; |
|
| 1471 | - $default_tab = ''; |
|
| 1472 | - $default_tab_name = ''; |
|
| 1473 | - foreach($arr_detail_page_tabs as $tab_index => $tabs){
|
|
| 1474 | - if (isset($tabs['is_active_tab']) && $tabs['is_active_tab'] && !empty($tabs['is_display']) && isset($tabs['heading_text']) && $tabs['heading_text']) {
|
|
| 1475 | - $active_tab = $tab_index; |
|
| 1476 | - $active_tab_name = __($tabs['heading_text'], 'geodirectory'); |
|
| 1477 | - } |
|
| 1469 | + $active_tab = ''; |
|
| 1470 | + $active_tab_name = ''; |
|
| 1471 | + $default_tab = ''; |
|
| 1472 | + $default_tab_name = ''; |
|
| 1473 | + foreach($arr_detail_page_tabs as $tab_index => $tabs){
|
|
| 1474 | + if (isset($tabs['is_active_tab']) && $tabs['is_active_tab'] && !empty($tabs['is_display']) && isset($tabs['heading_text']) && $tabs['heading_text']) {
|
|
| 1475 | + $active_tab = $tab_index; |
|
| 1476 | + $active_tab_name = __($tabs['heading_text'], 'geodirectory'); |
|
| 1477 | + } |
|
| 1478 | 1478 | |
| 1479 | - if ($default_tab === '' && !empty($tabs['is_display']) && !empty($tabs['heading_text'])) {
|
|
| 1480 | - $default_tab = $tab_index; |
|
| 1481 | - $default_tab_name = __($tabs['heading_text'], 'geodirectory'); |
|
| 1482 | - } |
|
| 1483 | - } |
|
| 1479 | + if ($default_tab === '' && !empty($tabs['is_display']) && !empty($tabs['heading_text'])) {
|
|
| 1480 | + $default_tab = $tab_index; |
|
| 1481 | + $default_tab_name = __($tabs['heading_text'], 'geodirectory'); |
|
| 1482 | + } |
|
| 1483 | + } |
|
| 1484 | 1484 | |
| 1485 | - if ($active_tab === '' && $default_tab !== '') { // Make first tab acs a active tab if not any tab is active.
|
|
| 1486 | - if (isset($arr_detail_page_tabs[$active_tab]) && isset($arr_detail_page_tabs[$active_tab]['is_active_tab'])) {
|
|
| 1487 | - $arr_detail_page_tabs[$active_tab]['is_active_tab'] = false; |
|
| 1488 | - } |
|
| 1485 | + if ($active_tab === '' && $default_tab !== '') { // Make first tab acs a active tab if not any tab is active.
|
|
| 1486 | + if (isset($arr_detail_page_tabs[$active_tab]) && isset($arr_detail_page_tabs[$active_tab]['is_active_tab'])) {
|
|
| 1487 | + $arr_detail_page_tabs[$active_tab]['is_active_tab'] = false; |
|
| 1488 | + } |
|
| 1489 | 1489 | |
| 1490 | - $arr_detail_page_tabs[$default_tab]['is_active_tab'] = true; |
|
| 1491 | - $active_tab = $default_tab; |
|
| 1492 | - $active_tab_name = $default_tab_name; |
|
| 1493 | - } |
|
| 1494 | - ?> |
|
| 1490 | + $arr_detail_page_tabs[$default_tab]['is_active_tab'] = true; |
|
| 1491 | + $active_tab = $default_tab; |
|
| 1492 | + $active_tab_name = $default_tab_name; |
|
| 1493 | + } |
|
| 1494 | + ?> |
|
| 1495 | 1495 | <div class="geodir-tabs" id="gd-tabs" style="position:relative;"> |
| 1496 | 1496 | <div id="geodir-tab-mobile-menu" > |
| 1497 | 1497 | <i class="fa fa-bars"></i> |
@@ -1500,147 +1500,147 @@ discard block |
||
| 1500 | 1500 | </div> |
| 1501 | 1501 | <dl class="geodir-tab-head"> |
| 1502 | 1502 | <?php |
| 1503 | - /** |
|
| 1504 | - * Called before the details page tab list headings, inside the `dl` tag. |
|
| 1505 | - * |
|
| 1506 | - * @since 1.0.0 |
|
| 1507 | - * @see 'geodir_after_tab_list' |
|
| 1508 | - */ |
|
| 1509 | - do_action('geodir_before_tab_list'); ?>
|
|
| 1503 | + /** |
|
| 1504 | + * Called before the details page tab list headings, inside the `dl` tag. |
|
| 1505 | + * |
|
| 1506 | + * @since 1.0.0 |
|
| 1507 | + * @see 'geodir_after_tab_list' |
|
| 1508 | + */ |
|
| 1509 | + do_action('geodir_before_tab_list'); ?>
|
|
| 1510 | 1510 | <?php |
| 1511 | - foreach ($arr_detail_page_tabs as $tab_index => $detail_page_tab) {
|
|
| 1512 | - if ($detail_page_tab['is_display']) {
|
|
| 1513 | - ?> |
|
| 1511 | + foreach ($arr_detail_page_tabs as $tab_index => $detail_page_tab) {
|
|
| 1512 | + if ($detail_page_tab['is_display']) {
|
|
| 1513 | + ?> |
|
| 1514 | 1514 | <dt></dt> <!-- added to comply with validation --> |
| 1515 | 1515 | <dd <?php if ($detail_page_tab['is_active_tab']){ ?>class="geodir-tab-active"<?php }?> ><a data-tab="#<?php echo $tab_index;?>" data-status="enable"><?php _e($detail_page_tab['heading_text'],'geodirectory');?></a>
|
| 1516 | 1516 | </dd> |
| 1517 | 1517 | <?php |
| 1518 | - ob_start() // start tab content buffering |
|
| 1519 | - ?> |
|
| 1518 | + ob_start() // start tab content buffering |
|
| 1519 | + ?> |
|
| 1520 | 1520 | <li id="<?php echo $tab_index;?>Tab"> |
| 1521 | 1521 | <div id="<?php echo $tab_index;?>" class="hash-offset"></div> |
| 1522 | 1522 | <?php |
| 1523 | - /** |
|
| 1524 | - * Called before the details tab content is output per tab. |
|
| 1525 | - * |
|
| 1526 | - * @since 1.0.0 |
|
| 1527 | - * @param string $tab_index The tab name ID. |
|
| 1528 | - */ |
|
| 1529 | - do_action('geodir_before_tab_content', $tab_index);
|
|
| 1530 | - |
|
| 1531 | - /** |
|
| 1532 | - * Called before the details tab content is output per tab. |
|
| 1533 | - * |
|
| 1534 | - * Uses dynamic hook name: geodir_before_$tab_index_tab_content |
|
| 1535 | - * |
|
| 1536 | - * @since 1.0.0 |
|
| 1537 | - * @todo do we need this if we have the hook above? 'geodir_before_tab_content' |
|
| 1538 | - */ |
|
| 1539 | - do_action('geodir_before_' . $tab_index . '_tab_content');
|
|
| 1540 | - /// write a code to generate content of each tab |
|
| 1541 | - switch ($tab_index) {
|
|
| 1542 | - case 'post_profile': |
|
| 1543 | - /** |
|
| 1544 | - * Called before the listing description content on the details page tab. |
|
| 1545 | - * |
|
| 1546 | - * @since 1.0.0 |
|
| 1547 | - */ |
|
| 1548 | - do_action('geodir_before_description_on_listing_detail');
|
|
| 1549 | - if (geodir_is_page('detail')) {
|
|
| 1550 | - the_content(); |
|
| 1551 | - } else {
|
|
| 1552 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 1553 | - echo apply_filters('the_content', stripslashes($post->post_desc));
|
|
| 1554 | - } |
|
| 1555 | - |
|
| 1556 | - /** |
|
| 1557 | - * Called after the listing description content on the details page tab. |
|
| 1558 | - * |
|
| 1559 | - * @since 1.0.0 |
|
| 1560 | - */ |
|
| 1561 | - do_action('geodir_after_description_on_listing_detail');
|
|
| 1562 | - break; |
|
| 1563 | - case 'post_info': |
|
| 1564 | - echo $geodir_post_detail_fields; |
|
| 1565 | - break; |
|
| 1566 | - case 'post_images': |
|
| 1567 | - echo $thumb_image; |
|
| 1568 | - break; |
|
| 1569 | - case 'post_video': |
|
| 1570 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 1571 | - echo apply_filters('the_content', stripslashes($video));// we apply the_content filter so oembed works also;
|
|
| 1572 | - break; |
|
| 1573 | - case 'special_offers': |
|
| 1574 | - echo wpautop(stripslashes($special_offers)); |
|
| 1575 | - |
|
| 1576 | - break; |
|
| 1577 | - case 'post_map': |
|
| 1578 | - geodir_draw_map($map_args); |
|
| 1579 | - break; |
|
| 1580 | - case 'reviews': |
|
| 1581 | - comments_template(); |
|
| 1582 | - break; |
|
| 1583 | - case 'related_listing': |
|
| 1584 | - echo $related_listing; |
|
| 1585 | - break; |
|
| 1586 | - default: {
|
|
| 1587 | - if ((isset($post->$tab_index) || (!isset($post->$tab_index) && (strpos($tab_index, 'gd_tab_') !== false || $tab_index == 'link_business'))) && !empty($detail_page_tab['tab_content'])) {
|
|
| 1588 | - echo $detail_page_tab['tab_content']; |
|
| 1589 | - } |
|
| 1590 | - } |
|
| 1591 | - break; |
|
| 1592 | - } |
|
| 1593 | - |
|
| 1594 | - /** |
|
| 1595 | - * Called after the details tab content is output per tab. |
|
| 1596 | - * |
|
| 1597 | - * @since 1.0.0 |
|
| 1598 | - */ |
|
| 1599 | - do_action('geodir_after_tab_content', $tab_index);
|
|
| 1600 | - |
|
| 1601 | - /** |
|
| 1602 | - * Called after the details tab content is output per tab. |
|
| 1603 | - * |
|
| 1604 | - * Uses dynamic hook name: geodir_after_$tab_index_tab_content |
|
| 1605 | - * |
|
| 1606 | - * @since 1.0.0 |
|
| 1607 | - * @todo do we need this if we have the hook above? 'geodir_after_tab_content' |
|
| 1608 | - */ |
|
| 1609 | - do_action('geodir_after_' . $tab_index . '_tab_content');
|
|
| 1610 | - ?> </li> |
|
| 1523 | + /** |
|
| 1524 | + * Called before the details tab content is output per tab. |
|
| 1525 | + * |
|
| 1526 | + * @since 1.0.0 |
|
| 1527 | + * @param string $tab_index The tab name ID. |
|
| 1528 | + */ |
|
| 1529 | + do_action('geodir_before_tab_content', $tab_index);
|
|
| 1530 | + |
|
| 1531 | + /** |
|
| 1532 | + * Called before the details tab content is output per tab. |
|
| 1533 | + * |
|
| 1534 | + * Uses dynamic hook name: geodir_before_$tab_index_tab_content |
|
| 1535 | + * |
|
| 1536 | + * @since 1.0.0 |
|
| 1537 | + * @todo do we need this if we have the hook above? 'geodir_before_tab_content' |
|
| 1538 | + */ |
|
| 1539 | + do_action('geodir_before_' . $tab_index . '_tab_content');
|
|
| 1540 | + /// write a code to generate content of each tab |
|
| 1541 | + switch ($tab_index) {
|
|
| 1542 | + case 'post_profile': |
|
| 1543 | + /** |
|
| 1544 | + * Called before the listing description content on the details page tab. |
|
| 1545 | + * |
|
| 1546 | + * @since 1.0.0 |
|
| 1547 | + */ |
|
| 1548 | + do_action('geodir_before_description_on_listing_detail');
|
|
| 1549 | + if (geodir_is_page('detail')) {
|
|
| 1550 | + the_content(); |
|
| 1551 | + } else {
|
|
| 1552 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 1553 | + echo apply_filters('the_content', stripslashes($post->post_desc));
|
|
| 1554 | + } |
|
| 1555 | + |
|
| 1556 | + /** |
|
| 1557 | + * Called after the listing description content on the details page tab. |
|
| 1558 | + * |
|
| 1559 | + * @since 1.0.0 |
|
| 1560 | + */ |
|
| 1561 | + do_action('geodir_after_description_on_listing_detail');
|
|
| 1562 | + break; |
|
| 1563 | + case 'post_info': |
|
| 1564 | + echo $geodir_post_detail_fields; |
|
| 1565 | + break; |
|
| 1566 | + case 'post_images': |
|
| 1567 | + echo $thumb_image; |
|
| 1568 | + break; |
|
| 1569 | + case 'post_video': |
|
| 1570 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 1571 | + echo apply_filters('the_content', stripslashes($video));// we apply the_content filter so oembed works also;
|
|
| 1572 | + break; |
|
| 1573 | + case 'special_offers': |
|
| 1574 | + echo wpautop(stripslashes($special_offers)); |
|
| 1575 | + |
|
| 1576 | + break; |
|
| 1577 | + case 'post_map': |
|
| 1578 | + geodir_draw_map($map_args); |
|
| 1579 | + break; |
|
| 1580 | + case 'reviews': |
|
| 1581 | + comments_template(); |
|
| 1582 | + break; |
|
| 1583 | + case 'related_listing': |
|
| 1584 | + echo $related_listing; |
|
| 1585 | + break; |
|
| 1586 | + default: {
|
|
| 1587 | + if ((isset($post->$tab_index) || (!isset($post->$tab_index) && (strpos($tab_index, 'gd_tab_') !== false || $tab_index == 'link_business'))) && !empty($detail_page_tab['tab_content'])) {
|
|
| 1588 | + echo $detail_page_tab['tab_content']; |
|
| 1589 | + } |
|
| 1590 | + } |
|
| 1591 | + break; |
|
| 1592 | + } |
|
| 1593 | + |
|
| 1594 | + /** |
|
| 1595 | + * Called after the details tab content is output per tab. |
|
| 1596 | + * |
|
| 1597 | + * @since 1.0.0 |
|
| 1598 | + */ |
|
| 1599 | + do_action('geodir_after_tab_content', $tab_index);
|
|
| 1600 | + |
|
| 1601 | + /** |
|
| 1602 | + * Called after the details tab content is output per tab. |
|
| 1603 | + * |
|
| 1604 | + * Uses dynamic hook name: geodir_after_$tab_index_tab_content |
|
| 1605 | + * |
|
| 1606 | + * @since 1.0.0 |
|
| 1607 | + * @todo do we need this if we have the hook above? 'geodir_after_tab_content' |
|
| 1608 | + */ |
|
| 1609 | + do_action('geodir_after_' . $tab_index . '_tab_content');
|
|
| 1610 | + ?> </li> |
|
| 1611 | 1611 | <?php |
| 1612 | - /** |
|
| 1613 | - * Filter the current tab content. |
|
| 1614 | - * |
|
| 1615 | - * @since 1.0.0 |
|
| 1616 | - */ |
|
| 1617 | - $arr_detail_page_tabs[$tab_index]['tab_content'] = apply_filters("geodir_modify_" . $detail_page_tab['tab_content'] . "_tab_content", ob_get_clean());
|
|
| 1618 | - } // end of if for is_display |
|
| 1619 | - }// end of foreach |
|
| 1620 | - |
|
| 1621 | - /** |
|
| 1622 | - * Called after the details page tab list headings, inside the `dl` tag. |
|
| 1623 | - * |
|
| 1624 | - * @since 1.0.0 |
|
| 1625 | - * @see 'geodir_before_tab_list' |
|
| 1626 | - */ |
|
| 1627 | - do_action('geodir_after_tab_list');
|
|
| 1628 | - ?> |
|
| 1612 | + /** |
|
| 1613 | + * Filter the current tab content. |
|
| 1614 | + * |
|
| 1615 | + * @since 1.0.0 |
|
| 1616 | + */ |
|
| 1617 | + $arr_detail_page_tabs[$tab_index]['tab_content'] = apply_filters("geodir_modify_" . $detail_page_tab['tab_content'] . "_tab_content", ob_get_clean());
|
|
| 1618 | + } // end of if for is_display |
|
| 1619 | + }// end of foreach |
|
| 1620 | + |
|
| 1621 | + /** |
|
| 1622 | + * Called after the details page tab list headings, inside the `dl` tag. |
|
| 1623 | + * |
|
| 1624 | + * @since 1.0.0 |
|
| 1625 | + * @see 'geodir_before_tab_list' |
|
| 1626 | + */ |
|
| 1627 | + do_action('geodir_after_tab_list');
|
|
| 1628 | + ?> |
|
| 1629 | 1629 | </dl> |
| 1630 | 1630 | <ul class="geodir-tabs-content entry-content" style="position:relative;"> |
| 1631 | 1631 | <?php |
| 1632 | - foreach ($arr_detail_page_tabs as $detail_page_tab) {
|
|
| 1633 | - if ($detail_page_tab['is_display'] && !empty($detail_page_tab['tab_content'])) {
|
|
| 1634 | - echo $detail_page_tab['tab_content']; |
|
| 1635 | - }// end of if |
|
| 1636 | - }// end of foreach |
|
| 1637 | - |
|
| 1638 | - /** |
|
| 1639 | - * Called after all the tab content is output in `li` tags, called before the closing `ul` tag. |
|
| 1640 | - * |
|
| 1641 | - * @since 1.0.0 |
|
| 1642 | - */ |
|
| 1643 | - do_action('geodir_add_tab_content'); ?>
|
|
| 1632 | + foreach ($arr_detail_page_tabs as $detail_page_tab) {
|
|
| 1633 | + if ($detail_page_tab['is_display'] && !empty($detail_page_tab['tab_content'])) {
|
|
| 1634 | + echo $detail_page_tab['tab_content']; |
|
| 1635 | + }// end of if |
|
| 1636 | + }// end of foreach |
|
| 1637 | + |
|
| 1638 | + /** |
|
| 1639 | + * Called after all the tab content is output in `li` tags, called before the closing `ul` tag. |
|
| 1640 | + * |
|
| 1641 | + * @since 1.0.0 |
|
| 1642 | + */ |
|
| 1643 | + do_action('geodir_add_tab_content'); ?>
|
|
| 1644 | 1644 | </ul> |
| 1645 | 1645 | <!--gd-tabs-content ul end--> |
| 1646 | 1646 | </div> |
@@ -1677,120 +1677,120 @@ discard block |
||
| 1677 | 1677 | */ |
| 1678 | 1678 | function geodir_exif($file) |
| 1679 | 1679 | {
|
| 1680 | - if (empty($file) || !is_array($file)) {
|
|
| 1681 | - return $file; |
|
| 1682 | - } |
|
| 1680 | + if (empty($file) || !is_array($file)) {
|
|
| 1681 | + return $file; |
|
| 1682 | + } |
|
| 1683 | 1683 | |
| 1684 | - $file_path = !empty($file['tmp_name']) ? sanitize_text_field($file['tmp_name']) : ''; |
|
| 1685 | - if (!($file_path && file_exists($file_path))) {
|
|
| 1686 | - return $file; |
|
| 1687 | - } |
|
| 1688 | - $file['file'] = $file_path; |
|
| 1684 | + $file_path = !empty($file['tmp_name']) ? sanitize_text_field($file['tmp_name']) : ''; |
|
| 1685 | + if (!($file_path && file_exists($file_path))) {
|
|
| 1686 | + return $file; |
|
| 1687 | + } |
|
| 1688 | + $file['file'] = $file_path; |
|
| 1689 | 1689 | |
| 1690 | - if (!file_is_valid_image($file_path)) {
|
|
| 1691 | - return $file; // Bail if file is not an image. |
|
| 1692 | - } |
|
| 1690 | + if (!file_is_valid_image($file_path)) {
|
|
| 1691 | + return $file; // Bail if file is not an image. |
|
| 1692 | + } |
|
| 1693 | 1693 | |
| 1694 | - if (!function_exists('wp_get_image_editor') || !function_exists('exif_read_data')) {
|
|
| 1695 | - return $file; |
|
| 1696 | - } |
|
| 1694 | + if (!function_exists('wp_get_image_editor') || !function_exists('exif_read_data')) {
|
|
| 1695 | + return $file; |
|
| 1696 | + } |
|
| 1697 | 1697 | |
| 1698 | - $exif = exif_read_data($file_path); |
|
| 1698 | + $exif = exif_read_data($file_path); |
|
| 1699 | 1699 | |
| 1700 | - $rotate = false; |
|
| 1701 | - $flip = false; |
|
| 1702 | - $modify = false; |
|
| 1703 | - $orientation = 0; |
|
| 1704 | - if (!empty($exif) && isset($exif['Orientation'])) {
|
|
| 1705 | - switch ((int)$exif['Orientation']) {
|
|
| 1706 | - case 1: |
|
| 1707 | - // do nothing |
|
| 1708 | - break; |
|
| 1709 | - case 2: |
|
| 1710 | - $flip = array(false, true); |
|
| 1711 | - $modify = true; |
|
| 1712 | - break; |
|
| 1713 | - case 3: |
|
| 1714 | - $orientation = -180; |
|
| 1715 | - $rotate = true; |
|
| 1716 | - $modify = true; |
|
| 1717 | - break; |
|
| 1718 | - case 4: |
|
| 1719 | - $flip = array(true, false); |
|
| 1720 | - $modify = true; |
|
| 1721 | - break; |
|
| 1722 | - case 5: |
|
| 1723 | - $orientation = -90; |
|
| 1724 | - $rotate = true; |
|
| 1725 | - $flip = array(false, true); |
|
| 1726 | - $modify = true; |
|
| 1727 | - break; |
|
| 1728 | - case 6: |
|
| 1729 | - $orientation = -90; |
|
| 1730 | - $rotate = true; |
|
| 1731 | - $modify = true; |
|
| 1732 | - break; |
|
| 1733 | - case 7: |
|
| 1734 | - $orientation = -270; |
|
| 1735 | - $rotate = true; |
|
| 1736 | - $flip = array(false, true); |
|
| 1737 | - $modify = true; |
|
| 1738 | - break; |
|
| 1739 | - case 8: |
|
| 1740 | - case 9: |
|
| 1741 | - $orientation = -270; |
|
| 1742 | - $rotate = true; |
|
| 1743 | - $modify = true; |
|
| 1744 | - break; |
|
| 1745 | - default: |
|
| 1746 | - $orientation = 0; |
|
| 1747 | - $rotate = true; |
|
| 1748 | - $modify = true; |
|
| 1749 | - break; |
|
| 1750 | - } |
|
| 1751 | - } |
|
| 1700 | + $rotate = false; |
|
| 1701 | + $flip = false; |
|
| 1702 | + $modify = false; |
|
| 1703 | + $orientation = 0; |
|
| 1704 | + if (!empty($exif) && isset($exif['Orientation'])) {
|
|
| 1705 | + switch ((int)$exif['Orientation']) {
|
|
| 1706 | + case 1: |
|
| 1707 | + // do nothing |
|
| 1708 | + break; |
|
| 1709 | + case 2: |
|
| 1710 | + $flip = array(false, true); |
|
| 1711 | + $modify = true; |
|
| 1712 | + break; |
|
| 1713 | + case 3: |
|
| 1714 | + $orientation = -180; |
|
| 1715 | + $rotate = true; |
|
| 1716 | + $modify = true; |
|
| 1717 | + break; |
|
| 1718 | + case 4: |
|
| 1719 | + $flip = array(true, false); |
|
| 1720 | + $modify = true; |
|
| 1721 | + break; |
|
| 1722 | + case 5: |
|
| 1723 | + $orientation = -90; |
|
| 1724 | + $rotate = true; |
|
| 1725 | + $flip = array(false, true); |
|
| 1726 | + $modify = true; |
|
| 1727 | + break; |
|
| 1728 | + case 6: |
|
| 1729 | + $orientation = -90; |
|
| 1730 | + $rotate = true; |
|
| 1731 | + $modify = true; |
|
| 1732 | + break; |
|
| 1733 | + case 7: |
|
| 1734 | + $orientation = -270; |
|
| 1735 | + $rotate = true; |
|
| 1736 | + $flip = array(false, true); |
|
| 1737 | + $modify = true; |
|
| 1738 | + break; |
|
| 1739 | + case 8: |
|
| 1740 | + case 9: |
|
| 1741 | + $orientation = -270; |
|
| 1742 | + $rotate = true; |
|
| 1743 | + $modify = true; |
|
| 1744 | + break; |
|
| 1745 | + default: |
|
| 1746 | + $orientation = 0; |
|
| 1747 | + $rotate = true; |
|
| 1748 | + $modify = true; |
|
| 1749 | + break; |
|
| 1750 | + } |
|
| 1751 | + } |
|
| 1752 | 1752 | |
| 1753 | - $mime_type = $file['type']; |
|
| 1754 | - $quality = null; |
|
| 1755 | - /** |
|
| 1756 | - * Filter the image quality. |
|
| 1757 | - * |
|
| 1758 | - * @since 1.5.7 |
|
| 1759 | - * @param int|null $quality Image Compression quality between 1-100% scale. Default null. |
|
| 1760 | - * @param string $quality Image mime type. |
|
| 1761 | - */ |
|
| 1762 | - $quality = apply_filters('geodir_image_upload_set_quality', $quality, $mime_type);
|
|
| 1763 | - if ($quality !== null) {
|
|
| 1764 | - $modify = true; |
|
| 1765 | - } |
|
| 1753 | + $mime_type = $file['type']; |
|
| 1754 | + $quality = null; |
|
| 1755 | + /** |
|
| 1756 | + * Filter the image quality. |
|
| 1757 | + * |
|
| 1758 | + * @since 1.5.7 |
|
| 1759 | + * @param int|null $quality Image Compression quality between 1-100% scale. Default null. |
|
| 1760 | + * @param string $quality Image mime type. |
|
| 1761 | + */ |
|
| 1762 | + $quality = apply_filters('geodir_image_upload_set_quality', $quality, $mime_type);
|
|
| 1763 | + if ($quality !== null) {
|
|
| 1764 | + $modify = true; |
|
| 1765 | + } |
|
| 1766 | 1766 | |
| 1767 | - if (!$modify) {
|
|
| 1768 | - return $file; // no change |
|
| 1769 | - } |
|
| 1767 | + if (!$modify) {
|
|
| 1768 | + return $file; // no change |
|
| 1769 | + } |
|
| 1770 | 1770 | |
| 1771 | - $image = wp_get_image_editor($file_path); |
|
| 1772 | - if (!is_wp_error($image)) {
|
|
| 1773 | - if ($rotate) {
|
|
| 1774 | - $image->rotate($orientation); |
|
| 1775 | - } |
|
| 1771 | + $image = wp_get_image_editor($file_path); |
|
| 1772 | + if (!is_wp_error($image)) {
|
|
| 1773 | + if ($rotate) {
|
|
| 1774 | + $image->rotate($orientation); |
|
| 1775 | + } |
|
| 1776 | 1776 | |
| 1777 | - if (!empty($flip)) {
|
|
| 1778 | - $image->flip($flip[0], $flip[1]); |
|
| 1779 | - } |
|
| 1777 | + if (!empty($flip)) {
|
|
| 1778 | + $image->flip($flip[0], $flip[1]); |
|
| 1779 | + } |
|
| 1780 | 1780 | |
| 1781 | - if ($quality !== null) {
|
|
| 1782 | - $image->set_quality((int)$quality); |
|
| 1783 | - } |
|
| 1781 | + if ($quality !== null) {
|
|
| 1782 | + $image->set_quality((int)$quality); |
|
| 1783 | + } |
|
| 1784 | 1784 | |
| 1785 | - $result = $image->save($file_path); |
|
| 1786 | - if (!is_wp_error($result)) {
|
|
| 1787 | - $file['file'] = $result['path']; |
|
| 1788 | - $file['tmp_name'] = $result['path']; |
|
| 1789 | - } |
|
| 1790 | - } |
|
| 1785 | + $result = $image->save($file_path); |
|
| 1786 | + if (!is_wp_error($result)) {
|
|
| 1787 | + $file['file'] = $result['path']; |
|
| 1788 | + $file['tmp_name'] = $result['path']; |
|
| 1789 | + } |
|
| 1790 | + } |
|
| 1791 | 1791 | |
| 1792 | - // The image orientation is fixed, pass it back for further processing |
|
| 1793 | - return $file; |
|
| 1792 | + // The image orientation is fixed, pass it back for further processing |
|
| 1793 | + return $file; |
|
| 1794 | 1794 | } |
| 1795 | 1795 | |
| 1796 | 1796 | /** |
@@ -1809,138 +1809,138 @@ discard block |
||
| 1809 | 1809 | * @return string Returns the recent reviews html. |
| 1810 | 1810 | */ |
| 1811 | 1811 | function geodir_get_recent_reviews($g_size = 60, $no_comments = 10, $comment_lenth = 60, $show_pass_post = false) {
|
| 1812 | - global $wpdb, $tablecomments, $tableposts, $rating_table_name, $gd_session; |
|
| 1813 | - $tablecomments = $wpdb->comments; |
|
| 1814 | - $tableposts = $wpdb->posts; |
|
| 1815 | - |
|
| 1816 | - $comments_echo = ''; |
|
| 1817 | - $city_filter = ''; |
|
| 1818 | - $region_filter = ''; |
|
| 1819 | - $country_filter = ''; |
|
| 1820 | - |
|
| 1821 | - if ($gd_session->get('gd_multi_location')) {
|
|
| 1822 | - if ($gd_ses_country = $gd_session->get('gd_country')) {
|
|
| 1823 | - $country_filter = $wpdb->prepare(" AND r.post_country=%s ", str_replace("-", " ", $gd_ses_country));
|
|
| 1824 | - } |
|
| 1812 | + global $wpdb, $tablecomments, $tableposts, $rating_table_name, $gd_session; |
|
| 1813 | + $tablecomments = $wpdb->comments; |
|
| 1814 | + $tableposts = $wpdb->posts; |
|
| 1815 | + |
|
| 1816 | + $comments_echo = ''; |
|
| 1817 | + $city_filter = ''; |
|
| 1818 | + $region_filter = ''; |
|
| 1819 | + $country_filter = ''; |
|
| 1820 | + |
|
| 1821 | + if ($gd_session->get('gd_multi_location')) {
|
|
| 1822 | + if ($gd_ses_country = $gd_session->get('gd_country')) {
|
|
| 1823 | + $country_filter = $wpdb->prepare(" AND r.post_country=%s ", str_replace("-", " ", $gd_ses_country));
|
|
| 1824 | + } |
|
| 1825 | 1825 | |
| 1826 | - if ($gd_ses_region = $gd_session->get('gd_region')) {
|
|
| 1827 | - $region_filter = $wpdb->prepare(" AND r.post_region=%s ", str_replace("-", " ", $gd_ses_region));
|
|
| 1828 | - } |
|
| 1826 | + if ($gd_ses_region = $gd_session->get('gd_region')) {
|
|
| 1827 | + $region_filter = $wpdb->prepare(" AND r.post_region=%s ", str_replace("-", " ", $gd_ses_region));
|
|
| 1828 | + } |
|
| 1829 | 1829 | |
| 1830 | - if ($gd_ses_city = $gd_session->get('gd_city')) {
|
|
| 1831 | - $city_filter = $wpdb->prepare(" AND r.post_city=%s ", str_replace("-", " ", $gd_ses_city));
|
|
| 1832 | - } |
|
| 1833 | - } |
|
| 1830 | + if ($gd_ses_city = $gd_session->get('gd_city')) {
|
|
| 1831 | + $city_filter = $wpdb->prepare(" AND r.post_city=%s ", str_replace("-", " ", $gd_ses_city));
|
|
| 1832 | + } |
|
| 1833 | + } |
|
| 1834 | 1834 | |
| 1835 | - $review_table = GEODIR_REVIEW_TABLE; |
|
| 1836 | - $request = "SELECT r.id as ID, r.post_type, r.comment_id as comment_ID, r.post_date as comment_date,r.overall_rating, r.user_id, r.post_id FROM $review_table as r WHERE r.post_status = 1 AND r.status =1 AND r.overall_rating>=1 $country_filter $region_filter $city_filter ORDER BY r.post_date DESC, r.id DESC LIMIT $no_comments"; |
|
| 1837 | - |
|
| 1838 | - $comments = $wpdb->get_results($request); |
|
| 1839 | - |
|
| 1840 | - foreach ($comments as $comment) {
|
|
| 1841 | - // Set the extra comment info needed. |
|
| 1842 | - $comment_extra = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID =$comment->comment_ID");
|
|
| 1843 | - //echo "SELECT * FROM $wpdb->comments WHERE comment_ID =$comment->comment_ID"; |
|
| 1844 | - $comment->comment_content = $comment_extra->comment_content; |
|
| 1845 | - $comment->comment_author = $comment_extra->comment_author; |
|
| 1846 | - $comment->comment_author_email = $comment_extra->comment_author_email; |
|
| 1847 | - |
|
| 1848 | - $comment_id = ''; |
|
| 1849 | - $comment_id = $comment->comment_ID; |
|
| 1850 | - $comment_content = strip_tags($comment->comment_content); |
|
| 1851 | - |
|
| 1852 | - $comment_content = preg_replace('#(\\[img\\]).+(\\[\\/img\\])#', '', $comment_content);
|
|
| 1853 | - |
|
| 1854 | - $permalink = get_permalink($comment->ID) . "#comment-" . $comment->comment_ID; |
|
| 1855 | - $comment_author_email = $comment->comment_author_email; |
|
| 1856 | - $comment_post_ID = $comment->post_id; |
|
| 1857 | - |
|
| 1858 | - $na = true; |
|
| 1859 | - if (function_exists('icl_object_id') && icl_object_id($comment_post_ID, $comment->post_type, true)) {
|
|
| 1860 | - $comment_post_ID2 = icl_object_id($comment_post_ID, $comment->post_type, false); |
|
| 1861 | - if ($comment_post_ID == $comment_post_ID2) {
|
|
| 1862 | - } else {
|
|
| 1863 | - $na = false; |
|
| 1864 | - } |
|
| 1865 | - } |
|
| 1835 | + $review_table = GEODIR_REVIEW_TABLE; |
|
| 1836 | + $request = "SELECT r.id as ID, r.post_type, r.comment_id as comment_ID, r.post_date as comment_date,r.overall_rating, r.user_id, r.post_id FROM $review_table as r WHERE r.post_status = 1 AND r.status =1 AND r.overall_rating>=1 $country_filter $region_filter $city_filter ORDER BY r.post_date DESC, r.id DESC LIMIT $no_comments"; |
|
| 1837 | + |
|
| 1838 | + $comments = $wpdb->get_results($request); |
|
| 1839 | + |
|
| 1840 | + foreach ($comments as $comment) {
|
|
| 1841 | + // Set the extra comment info needed. |
|
| 1842 | + $comment_extra = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID =$comment->comment_ID");
|
|
| 1843 | + //echo "SELECT * FROM $wpdb->comments WHERE comment_ID =$comment->comment_ID"; |
|
| 1844 | + $comment->comment_content = $comment_extra->comment_content; |
|
| 1845 | + $comment->comment_author = $comment_extra->comment_author; |
|
| 1846 | + $comment->comment_author_email = $comment_extra->comment_author_email; |
|
| 1847 | + |
|
| 1848 | + $comment_id = ''; |
|
| 1849 | + $comment_id = $comment->comment_ID; |
|
| 1850 | + $comment_content = strip_tags($comment->comment_content); |
|
| 1851 | + |
|
| 1852 | + $comment_content = preg_replace('#(\\[img\\]).+(\\[\\/img\\])#', '', $comment_content);
|
|
| 1853 | + |
|
| 1854 | + $permalink = get_permalink($comment->ID) . "#comment-" . $comment->comment_ID; |
|
| 1855 | + $comment_author_email = $comment->comment_author_email; |
|
| 1856 | + $comment_post_ID = $comment->post_id; |
|
| 1857 | + |
|
| 1858 | + $na = true; |
|
| 1859 | + if (function_exists('icl_object_id') && icl_object_id($comment_post_ID, $comment->post_type, true)) {
|
|
| 1860 | + $comment_post_ID2 = icl_object_id($comment_post_ID, $comment->post_type, false); |
|
| 1861 | + if ($comment_post_ID == $comment_post_ID2) {
|
|
| 1862 | + } else {
|
|
| 1863 | + $na = false; |
|
| 1864 | + } |
|
| 1865 | + } |
|
| 1866 | 1866 | |
| 1867 | - $post_title = get_the_title($comment_post_ID); |
|
| 1868 | - $permalink = get_permalink($comment_post_ID); |
|
| 1869 | - $comment_permalink = $permalink . "#comment-" . $comment->comment_ID; |
|
| 1870 | - $read_more = '<a class="comment_excerpt" href="' . $comment_permalink . '">' . __('Read more', 'geodirectory') . '</a>';
|
|
| 1867 | + $post_title = get_the_title($comment_post_ID); |
|
| 1868 | + $permalink = get_permalink($comment_post_ID); |
|
| 1869 | + $comment_permalink = $permalink . "#comment-" . $comment->comment_ID; |
|
| 1870 | + $read_more = '<a class="comment_excerpt" href="' . $comment_permalink . '">' . __('Read more', 'geodirectory') . '</a>';
|
|
| 1871 | 1871 | |
| 1872 | - $comment_content_length = strlen($comment_content); |
|
| 1873 | - if ($comment_content_length > $comment_lenth) {
|
|
| 1874 | - $comment_excerpt = mb_substr($comment_content, 0, $comment_lenth) . '... ' . $read_more; |
|
| 1875 | - } else {
|
|
| 1876 | - $comment_excerpt = $comment_content; |
|
| 1877 | - } |
|
| 1872 | + $comment_content_length = strlen($comment_content); |
|
| 1873 | + if ($comment_content_length > $comment_lenth) {
|
|
| 1874 | + $comment_excerpt = mb_substr($comment_content, 0, $comment_lenth) . '... ' . $read_more; |
|
| 1875 | + } else {
|
|
| 1876 | + $comment_excerpt = $comment_content; |
|
| 1877 | + } |
|
| 1878 | 1878 | |
| 1879 | - if ($comment->user_id) {
|
|
| 1880 | - $user_profile_url = get_author_posts_url($comment->user_id); |
|
| 1881 | - } else {
|
|
| 1882 | - $user_profile_url = ''; |
|
| 1883 | - } |
|
| 1879 | + if ($comment->user_id) {
|
|
| 1880 | + $user_profile_url = get_author_posts_url($comment->user_id); |
|
| 1881 | + } else {
|
|
| 1882 | + $user_profile_url = ''; |
|
| 1883 | + } |
|
| 1884 | 1884 | |
| 1885 | - if ($comment_id && $na) {
|
|
| 1886 | - $comments_echo .= '<li class="clearfix">'; |
|
| 1887 | - $comments_echo .= "<span class=\"li" . $comment_id . " geodir_reviewer_image\">"; |
|
| 1888 | - if (function_exists('get_avatar')) {
|
|
| 1889 | - if (!isset($comment->comment_type)) {
|
|
| 1890 | - if ($user_profile_url) {
|
|
| 1891 | - $comments_echo .= '<a href="' . $user_profile_url . '">'; |
|
| 1892 | - } |
|
| 1893 | - $comments_echo .= get_avatar($comment->comment_author_email, $g_size, geodir_plugin_url() . '/geodirectory-assets/images/gravatar2.png'); |
|
| 1894 | - if ($user_profile_url) {
|
|
| 1895 | - $comments_echo .= '</a>'; |
|
| 1896 | - } |
|
| 1897 | - } elseif ((isset($comment->comment_type) && $comment->comment_type == 'trackback') || (isset($comment->comment_type) && $comment->comment_type == 'pingback')) {
|
|
| 1898 | - if ($user_profile_url) {
|
|
| 1899 | - $comments_echo .= '<a href="' . $user_profile_url . '">'; |
|
| 1900 | - } |
|
| 1901 | - $comments_echo .= get_avatar($comment->comment_author_url, $g_size, geodir_plugin_url() . '/geodirectory-assets/images/gravatar2.png'); |
|
| 1902 | - } |
|
| 1903 | - } elseif (function_exists('gravatar')) {
|
|
| 1904 | - if ($user_profile_url) {
|
|
| 1905 | - $comments_echo .= '<a href="' . $user_profile_url . '">'; |
|
| 1906 | - } |
|
| 1907 | - $comments_echo .= "<img src=\""; |
|
| 1908 | - if ('' == $comment->comment_type) {
|
|
| 1909 | - $comments_echo .= gravatar($comment->comment_author_email, $g_size, geodir_plugin_url() . '/geodirectory-assets/images/gravatar2.png'); |
|
| 1910 | - if ($user_profile_url) {
|
|
| 1911 | - $comments_echo .= '</a>'; |
|
| 1912 | - } |
|
| 1913 | - } elseif (('trackback' == $comment->comment_type) || ('pingback' == $comment->comment_type)) {
|
|
| 1914 | - if ($user_profile_url) {
|
|
| 1915 | - $comments_echo .= '<a href="' . $user_profile_url . '">'; |
|
| 1916 | - } |
|
| 1917 | - $comments_echo .= gravatar($comment->comment_author_url, $g_size, geodir_plugin_url() . '/geodirectory-assets/images/gravatar2.png'); |
|
| 1918 | - if ($user_profile_url) {
|
|
| 1919 | - $comments_echo .= '</a>'; |
|
| 1920 | - } |
|
| 1921 | - } |
|
| 1922 | - $comments_echo .= "\" alt=\"\" class=\"avatar\" />"; |
|
| 1923 | - } |
|
| 1885 | + if ($comment_id && $na) {
|
|
| 1886 | + $comments_echo .= '<li class="clearfix">'; |
|
| 1887 | + $comments_echo .= "<span class=\"li" . $comment_id . " geodir_reviewer_image\">"; |
|
| 1888 | + if (function_exists('get_avatar')) {
|
|
| 1889 | + if (!isset($comment->comment_type)) {
|
|
| 1890 | + if ($user_profile_url) {
|
|
| 1891 | + $comments_echo .= '<a href="' . $user_profile_url . '">'; |
|
| 1892 | + } |
|
| 1893 | + $comments_echo .= get_avatar($comment->comment_author_email, $g_size, geodir_plugin_url() . '/geodirectory-assets/images/gravatar2.png'); |
|
| 1894 | + if ($user_profile_url) {
|
|
| 1895 | + $comments_echo .= '</a>'; |
|
| 1896 | + } |
|
| 1897 | + } elseif ((isset($comment->comment_type) && $comment->comment_type == 'trackback') || (isset($comment->comment_type) && $comment->comment_type == 'pingback')) {
|
|
| 1898 | + if ($user_profile_url) {
|
|
| 1899 | + $comments_echo .= '<a href="' . $user_profile_url . '">'; |
|
| 1900 | + } |
|
| 1901 | + $comments_echo .= get_avatar($comment->comment_author_url, $g_size, geodir_plugin_url() . '/geodirectory-assets/images/gravatar2.png'); |
|
| 1902 | + } |
|
| 1903 | + } elseif (function_exists('gravatar')) {
|
|
| 1904 | + if ($user_profile_url) {
|
|
| 1905 | + $comments_echo .= '<a href="' . $user_profile_url . '">'; |
|
| 1906 | + } |
|
| 1907 | + $comments_echo .= "<img src=\""; |
|
| 1908 | + if ('' == $comment->comment_type) {
|
|
| 1909 | + $comments_echo .= gravatar($comment->comment_author_email, $g_size, geodir_plugin_url() . '/geodirectory-assets/images/gravatar2.png'); |
|
| 1910 | + if ($user_profile_url) {
|
|
| 1911 | + $comments_echo .= '</a>'; |
|
| 1912 | + } |
|
| 1913 | + } elseif (('trackback' == $comment->comment_type) || ('pingback' == $comment->comment_type)) {
|
|
| 1914 | + if ($user_profile_url) {
|
|
| 1915 | + $comments_echo .= '<a href="' . $user_profile_url . '">'; |
|
| 1916 | + } |
|
| 1917 | + $comments_echo .= gravatar($comment->comment_author_url, $g_size, geodir_plugin_url() . '/geodirectory-assets/images/gravatar2.png'); |
|
| 1918 | + if ($user_profile_url) {
|
|
| 1919 | + $comments_echo .= '</a>'; |
|
| 1920 | + } |
|
| 1921 | + } |
|
| 1922 | + $comments_echo .= "\" alt=\"\" class=\"avatar\" />"; |
|
| 1923 | + } |
|
| 1924 | 1924 | |
| 1925 | - $comments_echo .= "</span>\n"; |
|
| 1926 | - |
|
| 1927 | - $comments_echo .= '<span class="geodir_reviewer_content">'; |
|
| 1928 | - if($comment->user_id){$comments_echo .= '<a href="'.get_author_posts_url( $comment->user_id ).'">';}
|
|
| 1929 | - $comments_echo .= '<span class="geodir_reviewer_author">' . $comment->comment_author . '</span> '; |
|
| 1930 | - if($comment->user_id){$comments_echo .= '</a>';}
|
|
| 1931 | - $comments_echo .= '<span class="geodir_reviewer_reviewed">' . __('reviewed', 'geodirectory') . '</span> ';
|
|
| 1932 | - $comments_echo .= '<a href="' . $permalink . '" class="geodir_reviewer_title">' . $post_title . '</a>'; |
|
| 1933 | - $comments_echo .= geodir_get_rating_stars($comment->overall_rating, $comment_post_ID); |
|
| 1934 | - $comments_echo .= '<p class="geodir_reviewer_text">' . $comment_excerpt . ''; |
|
| 1935 | - //echo preg_replace('#(\\[img\\]).+(\\[\\/img\\])#', '', $comment_excerpt);
|
|
| 1936 | - $comments_echo .= '</p>'; |
|
| 1937 | - |
|
| 1938 | - $comments_echo .= "</span>\n"; |
|
| 1939 | - $comments_echo .= '</li>'; |
|
| 1940 | - } |
|
| 1941 | - } |
|
| 1925 | + $comments_echo .= "</span>\n"; |
|
| 1926 | + |
|
| 1927 | + $comments_echo .= '<span class="geodir_reviewer_content">'; |
|
| 1928 | + if($comment->user_id){$comments_echo .= '<a href="'.get_author_posts_url( $comment->user_id ).'">';}
|
|
| 1929 | + $comments_echo .= '<span class="geodir_reviewer_author">' . $comment->comment_author . '</span> '; |
|
| 1930 | + if($comment->user_id){$comments_echo .= '</a>';}
|
|
| 1931 | + $comments_echo .= '<span class="geodir_reviewer_reviewed">' . __('reviewed', 'geodirectory') . '</span> ';
|
|
| 1932 | + $comments_echo .= '<a href="' . $permalink . '" class="geodir_reviewer_title">' . $post_title . '</a>'; |
|
| 1933 | + $comments_echo .= geodir_get_rating_stars($comment->overall_rating, $comment_post_ID); |
|
| 1934 | + $comments_echo .= '<p class="geodir_reviewer_text">' . $comment_excerpt . ''; |
|
| 1935 | + //echo preg_replace('#(\\[img\\]).+(\\[\\/img\\])#', '', $comment_excerpt);
|
|
| 1936 | + $comments_echo .= '</p>'; |
|
| 1937 | + |
|
| 1938 | + $comments_echo .= "</span>\n"; |
|
| 1939 | + $comments_echo .= '</li>'; |
|
| 1940 | + } |
|
| 1941 | + } |
|
| 1942 | 1942 | |
| 1943 | - return $comments_echo; |
|
| 1943 | + return $comments_echo; |
|
| 1944 | 1944 | } |
| 1945 | 1945 | |
| 1946 | 1946 | /** |
@@ -1952,29 +1952,29 @@ discard block |
||
| 1952 | 1952 | */ |
| 1953 | 1953 | function geodir_home_map_cats_key_value_array() |
| 1954 | 1954 | {
|
| 1955 | - $post_types = geodir_get_posttypes('object');
|
|
| 1955 | + $post_types = geodir_get_posttypes('object');
|
|
| 1956 | 1956 | |
| 1957 | - $return = array(); |
|
| 1958 | - if (!empty($post_types)) {
|
|
| 1959 | - foreach ($post_types as $key => $post_type) {
|
|
| 1960 | - $cpt_name = __($post_type->labels->singular_name, 'geodirectory'); |
|
| 1961 | - $post_type_name = sprintf(__('%s Categories', 'geodirectory'),$cpt_name);
|
|
| 1962 | - $taxonomies = geodir_get_taxonomies($key); |
|
| 1963 | - $cat_taxonomy = !empty($taxonomies[0]) ? $taxonomies[0] : NULL; |
|
| 1964 | - $cat_terms = $cat_taxonomy ? get_terms($cat_taxonomy) : NULL; |
|
| 1957 | + $return = array(); |
|
| 1958 | + if (!empty($post_types)) {
|
|
| 1959 | + foreach ($post_types as $key => $post_type) {
|
|
| 1960 | + $cpt_name = __($post_type->labels->singular_name, 'geodirectory'); |
|
| 1961 | + $post_type_name = sprintf(__('%s Categories', 'geodirectory'),$cpt_name);
|
|
| 1962 | + $taxonomies = geodir_get_taxonomies($key); |
|
| 1963 | + $cat_taxonomy = !empty($taxonomies[0]) ? $taxonomies[0] : NULL; |
|
| 1964 | + $cat_terms = $cat_taxonomy ? get_terms($cat_taxonomy) : NULL; |
|
| 1965 | 1965 | |
| 1966 | - if (!empty($cat_terms)) {
|
|
| 1967 | - $return['optgroup_start-' . $key] = $post_type_name; |
|
| 1966 | + if (!empty($cat_terms)) {
|
|
| 1967 | + $return['optgroup_start-' . $key] = $post_type_name; |
|
| 1968 | 1968 | |
| 1969 | - foreach ($cat_terms as $cat_term) {
|
|
| 1970 | - $return[$key . '_' . $cat_term->term_id] = $cat_term->name; |
|
| 1971 | - } |
|
| 1969 | + foreach ($cat_terms as $cat_term) {
|
|
| 1970 | + $return[$key . '_' . $cat_term->term_id] = $cat_term->name; |
|
| 1971 | + } |
|
| 1972 | 1972 | |
| 1973 | - $return['optgroup_end-' . $key] = $post_type_name; |
|
| 1974 | - } |
|
| 1975 | - } |
|
| 1976 | - } |
|
| 1977 | - return $return; |
|
| 1973 | + $return['optgroup_end-' . $key] = $post_type_name; |
|
| 1974 | + } |
|
| 1975 | + } |
|
| 1976 | + } |
|
| 1977 | + return $return; |
|
| 1978 | 1978 | } |
| 1979 | 1979 | |
| 1980 | 1980 | /** |
@@ -1986,7 +1986,7 @@ discard block |
||
| 1986 | 1986 | */ |
| 1987 | 1987 | function geodir_twitter_tweet_button() |
| 1988 | 1988 | {
|
| 1989 | - ?> |
|
| 1989 | + ?> |
|
| 1990 | 1990 | <a href="http://twitter.com/share" |
| 1991 | 1991 | class="twitter-share-button"><?php _e('Tweet', 'geodirectory'); ?></a>
|
| 1992 | 1992 | <script type="text/javascript" src="//platform.twitter.com/widgets.js"></script> |
@@ -2004,11 +2004,11 @@ discard block |
||
| 2004 | 2004 | */ |
| 2005 | 2005 | function geodir_fb_like_button() |
| 2006 | 2006 | {
|
| 2007 | - global $post; |
|
| 2008 | - ?> |
|
| 2007 | + global $post; |
|
| 2008 | + ?> |
|
| 2009 | 2009 | <iframe <?php if (isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false)) {
|
| 2010 | - echo 'allowtransparency="true"'; |
|
| 2011 | - } ?> class="facebook" |
|
| 2010 | + echo 'allowtransparency="true"'; |
|
| 2011 | + } ?> class="facebook" |
|
| 2012 | 2012 | src="//www.facebook.com/plugins/like.php?href=<?php echo urlencode(get_permalink($post->ID)); ?>&layout=button_count&show_faces=false&width=100&action=like&colorscheme=light" |
| 2013 | 2013 | style="border:none; overflow:hidden; width:100px; height:20px"></iframe> |
| 2014 | 2014 | <?php |
@@ -2024,7 +2024,7 @@ discard block |
||
| 2024 | 2024 | */ |
| 2025 | 2025 | function geodir_google_plus_button() |
| 2026 | 2026 | {
|
| 2027 | - ?> |
|
| 2027 | + ?> |
|
| 2028 | 2028 | <div id="plusone-div" class="g-plusone" data-size="medium"></div> |
| 2029 | 2029 | <script type="text/javascript"> |
| 2030 | 2030 | (function () {
|
@@ -2050,8 +2050,8 @@ discard block |
||
| 2050 | 2050 | */ |
| 2051 | 2051 | function geodir_share_this_button_code() |
| 2052 | 2052 | {
|
| 2053 | - global $post; |
|
| 2054 | - ?> |
|
| 2053 | + global $post; |
|
| 2054 | + ?> |
|
| 2055 | 2055 | <div class="addthis_toolbox addthis_default_style"> |
| 2056 | 2056 | <span id='st_sharethis'></span> |
| 2057 | 2057 | <script type="text/javascript">var switchTo5x = false;</script> |
@@ -51,20 +51,20 @@ discard block |
||
| 51 | 51 | jQuery(listSel).children('li').switchClass('gridview_onehalf gridview_onethird gridview_onefourth', 'gridview_onefifth', 600);
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | - jQuery.post("<?php echo geodir_get_ajax_url();?>&gd_listing_view=" + val, function (data) {
|
|
| 54 | + jQuery.post("<?php echo geodir_get_ajax_url(); ?>&gd_listing_view=" + val, function (data) {
|
|
| 55 | 55 | //alert(data ); |
| 56 | 56 | }); |
| 57 | 57 | } |
| 58 | 58 | </script> |
| 59 | 59 | <div class="geodir-list-view-select"> |
| 60 | 60 | <select name="gd_list_view" id="gd_list_view" onchange="geodir_list_view_select(this);"> |
| 61 | - <?php $listing_view = (int)$gd_session->get('gd_listing_view'); ?>
|
|
| 62 | - <option value=""><?php _e('View:', 'geodirectory');?></option>
|
|
| 63 | - <option value="1" <?php selected(1, $listing_view);?>><?php _e('View: List', 'geodirectory');?></option>
|
|
| 64 | - <option value="2" <?php selected(2, $listing_view);?>><?php _e('View: Grid 2', 'geodirectory');?></option>
|
|
| 65 | - <option value="3" <?php selected(3, $listing_view);?>><?php _e('View: Grid 3', 'geodirectory');?></option>
|
|
| 66 | - <option value="4" <?php selected(4, $listing_view);?>><?php _e('View: Grid 4', 'geodirectory');?></option>
|
|
| 67 | - <option value="5" <?php selected(5, $listing_view);?>><?php _e('View: Grid 5', 'geodirectory');?></option>
|
|
| 61 | + <?php $listing_view = (int) $gd_session->get('gd_listing_view'); ?>
|
|
| 62 | + <option value=""><?php _e('View:', 'geodirectory'); ?></option>
|
|
| 63 | + <option value="1" <?php selected(1, $listing_view); ?>><?php _e('View: List', 'geodirectory'); ?></option>
|
|
| 64 | + <option value="2" <?php selected(2, $listing_view); ?>><?php _e('View: Grid 2', 'geodirectory'); ?></option>
|
|
| 65 | + <option value="3" <?php selected(3, $listing_view); ?>><?php _e('View: Grid 3', 'geodirectory'); ?></option>
|
|
| 66 | + <option value="4" <?php selected(4, $listing_view); ?>><?php _e('View: Grid 4', 'geodirectory'); ?></option>
|
|
| 67 | + <option value="5" <?php selected(5, $listing_view); ?>><?php _e('View: Grid 5', 'geodirectory'); ?></option>
|
|
| 68 | 68 | </select> |
| 69 | 69 | </div> |
| 70 | 70 | <?php |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | * @param object|string $post The post object. |
| 185 | 185 | * @param string $post_type The post type. |
| 186 | 186 | */ |
| 187 | - return (object)apply_filters('geodir_post_package_info', $package_info, $post, $post_type);
|
|
| 187 | + return (object) apply_filters('geodir_post_package_info', $package_info, $post, $post_type);
|
|
| 188 | 188 | |
| 189 | 189 | } |
| 190 | 190 | |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | // strip slashes message |
| 299 | 299 | $client_message = stripslashes_deep($client_message); |
| 300 | 300 | |
| 301 | - geodir_sendEmail($youremail, $yourname, $to_email, $to_name, '', $client_message, $extra = '', 'send_enquiry', $request['pid']);//To client email |
|
| 301 | + geodir_sendEmail($youremail, $yourname, $to_email, $to_name, '', $client_message, $extra = '', 'send_enquiry', $request['pid']); //To client email |
|
| 302 | 302 | } |
| 303 | 303 | |
| 304 | 304 | /** |
@@ -403,7 +403,7 @@ discard block |
||
| 403 | 403 | * } |
| 404 | 404 | */ |
| 405 | 405 | do_action('geodir_before_send_to_friend_email', $request);
|
| 406 | - geodir_sendEmail($youremail, $yourname, $to_email, $to_name, $frnd_subject, $frnd_comments, $extra = '', 'send_friend', $request['pid']);//To client email |
|
| 406 | + geodir_sendEmail($youremail, $yourname, $to_email, $to_name, $frnd_subject, $frnd_comments, $extra = '', 'send_friend', $request['pid']); //To client email |
|
| 407 | 407 | |
| 408 | 408 | /** |
| 409 | 409 | * Called after the send to friend email is sent. |
@@ -587,7 +587,7 @@ discard block |
||
| 587 | 587 | * |
| 588 | 588 | * @since 1.4.4 |
| 589 | 589 | */ |
| 590 | - if ( is_search() ) {
|
|
| 590 | + if (is_search()) {
|
|
| 591 | 591 | return; |
| 592 | 592 | } |
| 593 | 593 | |
@@ -611,7 +611,7 @@ discard block |
||
| 611 | 611 | if ($sort->field_type == 'random') {
|
| 612 | 612 | $key = $sort->field_type; |
| 613 | 613 | ($sort_by == $key || ($sort->is_default == '1' && !isset($_REQUEST['sort_by']))) ? $selected = 'selected="selected"' : $selected = ''; |
| 614 | - $sort_field_options .= '<option ' . $selected . ' value="' . esc_url( add_query_arg('sort_by', $key) ) . '">' . __($label, 'geodirectory') . '</option>';
|
|
| 614 | + $sort_field_options .= '<option ' . $selected . ' value="' . esc_url(add_query_arg('sort_by', $key)) . '">' . __($label, 'geodirectory') . '</option>';
|
|
| 615 | 615 | } |
| 616 | 616 | |
| 617 | 617 | if ($sort->htmlvar_name == 'comment_count') {
|
@@ -624,7 +624,7 @@ discard block |
||
| 624 | 624 | if ($sort->asc_title) |
| 625 | 625 | $label = $sort->asc_title; |
| 626 | 626 | ($sort_by == $key || ($sort->is_default == '1' && $sort->default_order == $key && !isset($_REQUEST['sort_by']))) ? $selected = 'selected="selected"' : $selected = ''; |
| 627 | - $sort_field_options .= '<option ' . $selected . ' value="' . esc_url( add_query_arg('sort_by', $key) ) . '">' . __($label, 'geodirectory') . '</option>';
|
|
| 627 | + $sort_field_options .= '<option ' . $selected . ' value="' . esc_url(add_query_arg('sort_by', $key)) . '">' . __($label, 'geodirectory') . '</option>';
|
|
| 628 | 628 | } |
| 629 | 629 | |
| 630 | 630 | if ($sort->sort_desc) {
|
@@ -633,7 +633,7 @@ discard block |
||
| 633 | 633 | if ($sort->desc_title) |
| 634 | 634 | $label = $sort->desc_title; |
| 635 | 635 | ($sort_by == $key || ($sort->is_default == '1' && $sort->default_order == $key && !isset($_REQUEST['sort_by']))) ? $selected = 'selected="selected"' : $selected = ''; |
| 636 | - $sort_field_options .= '<option ' . $selected . ' value="' . esc_url( add_query_arg('sort_by', $key) ) . '">' . __($label, 'geodirectory') . '</option>';
|
|
| 636 | + $sort_field_options .= '<option ' . $selected . ' value="' . esc_url(add_query_arg('sort_by', $key)) . '">' . __($label, 'geodirectory') . '</option>';
|
|
| 637 | 637 | } |
| 638 | 638 | |
| 639 | 639 | } |
@@ -648,9 +648,9 @@ discard block |
||
| 648 | 648 | <select name="sort_by" id="sort_by" onchange="javascript:window.location=this.value;"> |
| 649 | 649 | |
| 650 | 650 | <option |
| 651 | - value="<?php echo esc_url( add_query_arg('sort_by', '') );?>" <?php if ($sort_by == '') echo 'selected="selected"';?>><?php _e('Sort By', 'geodirectory');?></option><?php
|
|
| 651 | + value="<?php echo esc_url(add_query_arg('sort_by', '')); ?>" <?php if ($sort_by == '') echo 'selected="selected"'; ?>><?php _e('Sort By', 'geodirectory'); ?></option><?php
|
|
| 652 | 652 | |
| 653 | - echo $sort_field_options;?> |
|
| 653 | + echo $sort_field_options; ?> |
|
| 654 | 654 | |
| 655 | 655 | </select> |
| 656 | 656 | |
@@ -719,7 +719,7 @@ discard block |
||
| 719 | 719 | $category = array(); |
| 720 | 720 | |
| 721 | 721 | if (isset($_REQUEST['backandedit'])) {
|
| 722 | - $post = (object)$gd_session->get('listing');
|
|
| 722 | + $post = (object) $gd_session->get('listing');
|
|
| 723 | 723 | $post_type = $post->listing_type; |
| 724 | 724 | if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') |
| 725 | 725 | $post_id = $_REQUEST['pid']; |
@@ -796,7 +796,7 @@ discard block |
||
| 796 | 796 | if ($add_location_filter != '0') {
|
| 797 | 797 | $geodir_add_location_url = '1'; |
| 798 | 798 | } |
| 799 | - $viewall_url = get_term_link((int)$category[0], $post_type . $category_taxonomy); |
|
| 799 | + $viewall_url = get_term_link((int) $category[0], $post_type . $category_taxonomy); |
|
| 800 | 800 | $geodir_add_location_url = NULL; |
| 801 | 801 | } |
| 802 | 802 | ob_start(); |
@@ -893,7 +893,7 @@ discard block |
||
| 893 | 893 | $geodir_post_category_str = serialize($geodir_post_category_str); |
| 894 | 894 | } |
| 895 | 895 | |
| 896 | - $all_var['post_category_array'] = html_entity_decode((string)$geodir_post_category_str, ENT_QUOTES, 'UTF-8'); |
|
| 896 | + $all_var['post_category_array'] = html_entity_decode((string) $geodir_post_category_str, ENT_QUOTES, 'UTF-8'); |
|
| 897 | 897 | $script = "var post_category_array = " . json_encode($all_var) . ';'; |
| 898 | 898 | echo '<script>'; |
| 899 | 899 | echo $script; |
@@ -1026,7 +1026,7 @@ discard block |
||
| 1026 | 1026 | $location_id = NULL; |
| 1027 | 1027 | if ($geodir_location_manager) {
|
| 1028 | 1028 | $sql = $wpdb->prepare("SELECT location_id FROM " . POST_LOCATION_TABLE . " WHERE city_slug=%s ORDER BY location_id ASC LIMIT 1", array($gd_city));
|
| 1029 | - $location_id = (int)$wpdb->get_var($sql); |
|
| 1029 | + $location_id = (int) $wpdb->get_var($sql); |
|
| 1030 | 1030 | $location_type = geodir_what_is_current_location(); |
| 1031 | 1031 | if ($location_type == 'city') {
|
| 1032 | 1032 | $replace_location = geodir_get_current_location(array('what' => 'city', 'echo' => false));
|
@@ -1087,45 +1087,45 @@ discard block |
||
| 1087 | 1087 | |
| 1088 | 1088 | |
| 1089 | 1089 | $gd_page = ''; |
| 1090 | - if(geodir_is_page('home')){
|
|
| 1090 | + if (geodir_is_page('home')) {
|
|
| 1091 | 1091 | $gd_page = 'home'; |
| 1092 | 1092 | $meta_desc = (get_option('geodir_meta_desc_homepage')) ? get_option('geodir_meta_desc_homepage') : $meta_desc;
|
| 1093 | 1093 | } |
| 1094 | - elseif(geodir_is_page('detail')){
|
|
| 1094 | + elseif (geodir_is_page('detail')) {
|
|
| 1095 | 1095 | $gd_page = 'detail'; |
| 1096 | 1096 | $meta_desc = (get_option('geodir_meta_desc_detail')) ? get_option('geodir_meta_desc_detail') : $meta_desc;
|
| 1097 | 1097 | } |
| 1098 | - elseif(geodir_is_page('pt')){
|
|
| 1098 | + elseif (geodir_is_page('pt')) {
|
|
| 1099 | 1099 | $gd_page = 'pt'; |
| 1100 | 1100 | $meta_desc = (get_option('geodir_meta_desc_pt')) ? get_option('geodir_meta_desc_pt') : $meta_desc;
|
| 1101 | 1101 | } |
| 1102 | - elseif(geodir_is_page('listing')){
|
|
| 1102 | + elseif (geodir_is_page('listing')) {
|
|
| 1103 | 1103 | $gd_page = 'listing'; |
| 1104 | 1104 | $meta_desc = (get_option('geodir_meta_desc_listing')) ? get_option('geodir_meta_desc_listing') : $meta_desc;
|
| 1105 | 1105 | } |
| 1106 | - elseif(geodir_is_page('location')){
|
|
| 1106 | + elseif (geodir_is_page('location')) {
|
|
| 1107 | 1107 | $gd_page = 'location'; |
| 1108 | 1108 | $meta_desc = (get_option('geodir_meta_desc_location')) ? get_option('geodir_meta_desc_location') : $meta_desc;
|
| 1109 | 1109 | $meta_desc = apply_filters('geodir_seo_meta_location_description', $meta_desc);
|
| 1110 | 1110 | |
| 1111 | 1111 | } |
| 1112 | - elseif(geodir_is_page('search')){
|
|
| 1112 | + elseif (geodir_is_page('search')) {
|
|
| 1113 | 1113 | $gd_page = 'search'; |
| 1114 | 1114 | $meta_desc = (get_option('geodir_meta_desc_search')) ? get_option('geodir_meta_desc_search') : $meta_desc;
|
| 1115 | 1115 | } |
| 1116 | - elseif(geodir_is_page('add-listing')){
|
|
| 1116 | + elseif (geodir_is_page('add-listing')) {
|
|
| 1117 | 1117 | $gd_page = 'add-listing'; |
| 1118 | 1118 | $meta_desc = (get_option('geodir_meta_desc_add-listing')) ? get_option('geodir_meta_desc_add-listing') : $meta_desc;
|
| 1119 | 1119 | } |
| 1120 | - elseif(geodir_is_page('author')){
|
|
| 1120 | + elseif (geodir_is_page('author')) {
|
|
| 1121 | 1121 | $gd_page = 'author'; |
| 1122 | 1122 | $meta_desc = (get_option('geodir_meta_desc_author')) ? get_option('geodir_meta_desc_author') : $meta_desc;
|
| 1123 | 1123 | } |
| 1124 | - elseif(geodir_is_page('login')){
|
|
| 1124 | + elseif (geodir_is_page('login')) {
|
|
| 1125 | 1125 | $gd_page = 'login'; |
| 1126 | 1126 | $meta_desc = (get_option('geodir_meta_desc_login')) ? get_option('geodir_meta_desc_login') : $meta_desc;
|
| 1127 | 1127 | } |
| 1128 | - elseif(geodir_is_page('listing-success')){
|
|
| 1128 | + elseif (geodir_is_page('listing-success')) {
|
|
| 1129 | 1129 | $gd_page = 'listing-success'; |
| 1130 | 1130 | $meta_desc = (get_option('geodir_meta_desc_listing-success')) ? get_option('geodir_meta_desc_listing-success') : $meta_desc;
|
| 1131 | 1131 | } |
@@ -1153,7 +1153,7 @@ discard block |
||
| 1153 | 1153 | * @param string $title The page description including variables. |
| 1154 | 1154 | * @param string $gd_page The GeoDirectory page type if any. |
| 1155 | 1155 | */ |
| 1156 | - $meta_desc = apply_filters('geodir_seo_meta_description_pre', __($meta_desc, 'geodirectory'),$gd_page,'');
|
|
| 1156 | + $meta_desc = apply_filters('geodir_seo_meta_description_pre', __($meta_desc, 'geodirectory'), $gd_page, '');
|
|
| 1157 | 1157 | |
| 1158 | 1158 | /** |
| 1159 | 1159 | * Filter SEO meta description. |
@@ -1169,7 +1169,7 @@ discard block |
||
| 1169 | 1169 | $place_tags = wp_get_post_terms($post->ID, $post->post_type . '_tags', array("fields" => "names"));
|
| 1170 | 1170 | $place_cats = wp_get_post_terms($post->ID, $post->post_type . 'category', array("fields" => "names"));
|
| 1171 | 1171 | |
| 1172 | - $meta_key .= implode(", ", array_merge((array)$place_cats, (array)$place_tags));
|
|
| 1172 | + $meta_key .= implode(", ", array_merge((array) $place_cats, (array) $place_tags));
|
|
| 1173 | 1173 | } else {
|
| 1174 | 1174 | $posttags = get_the_tags(); |
| 1175 | 1175 | if ($posttags) {
|
@@ -1355,8 +1355,8 @@ discard block |
||
| 1355 | 1355 | {
|
| 1356 | 1356 | global $post, $post_images, $video, $special_offers, $related_listing, $geodir_post_detail_fields; |
| 1357 | 1357 | |
| 1358 | - $post_id = !empty($post) && isset($post->ID) ? (int)$post->ID : 0; |
|
| 1359 | - $request_post_id = !empty($_REQUEST['p']) ? (int)$_REQUEST['p'] : 0; |
|
| 1358 | + $post_id = !empty($post) && isset($post->ID) ? (int) $post->ID : 0; |
|
| 1359 | + $request_post_id = !empty($_REQUEST['p']) ? (int) $_REQUEST['p'] : 0; |
|
| 1360 | 1360 | $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend |
| 1361 | 1361 | |
| 1362 | 1362 | if ($is_backend_preview && !$post_id > 0 && $request_post_id > 0) {
|
@@ -1390,7 +1390,7 @@ discard block |
||
| 1390 | 1390 | if (!empty($post_images)) {
|
| 1391 | 1391 | foreach ($post_images as $image) {
|
| 1392 | 1392 | $caption = (!empty($image->caption)) ? $image->caption : ''; |
| 1393 | - $thumb_image .= '<a href="' . $image->src . '" title="'.$caption.'">'; |
|
| 1393 | + $thumb_image .= '<a href="' . $image->src . '" title="' . $caption . '">'; |
|
| 1394 | 1394 | $thumb_image .= geodir_show_image($image, 'thumbnail', true, false); |
| 1395 | 1395 | $thumb_image .= '</a>'; |
| 1396 | 1396 | } |
@@ -1464,13 +1464,13 @@ discard block |
||
| 1464 | 1464 | $map_args['map_class_name'] = 'geodir-map-preview-page'; |
| 1465 | 1465 | } |
| 1466 | 1466 | |
| 1467 | - $arr_detail_page_tabs = geodir_detail_page_tabs_list();// get this sooner so we can get the active tab for the user |
|
| 1467 | + $arr_detail_page_tabs = geodir_detail_page_tabs_list(); // get this sooner so we can get the active tab for the user |
|
| 1468 | 1468 | |
| 1469 | 1469 | $active_tab = ''; |
| 1470 | 1470 | $active_tab_name = ''; |
| 1471 | 1471 | $default_tab = ''; |
| 1472 | 1472 | $default_tab_name = ''; |
| 1473 | - foreach($arr_detail_page_tabs as $tab_index => $tabs){
|
|
| 1473 | + foreach ($arr_detail_page_tabs as $tab_index => $tabs) {
|
|
| 1474 | 1474 | if (isset($tabs['is_active_tab']) && $tabs['is_active_tab'] && !empty($tabs['is_display']) && isset($tabs['heading_text']) && $tabs['heading_text']) {
|
| 1475 | 1475 | $active_tab = $tab_index; |
| 1476 | 1476 | $active_tab_name = __($tabs['heading_text'], 'geodirectory'); |
@@ -1495,7 +1495,7 @@ discard block |
||
| 1495 | 1495 | <div class="geodir-tabs" id="gd-tabs" style="position:relative;"> |
| 1496 | 1496 | <div id="geodir-tab-mobile-menu" > |
| 1497 | 1497 | <i class="fa fa-bars"></i> |
| 1498 | - <span class="geodir-mobile-active-tab"><?php echo $active_tab_name;?></span> |
|
| 1498 | + <span class="geodir-mobile-active-tab"><?php echo $active_tab_name; ?></span> |
|
| 1499 | 1499 | <i class="fa fa-sort-desc"></i> |
| 1500 | 1500 | </div> |
| 1501 | 1501 | <dl class="geodir-tab-head"> |
@@ -1512,13 +1512,13 @@ discard block |
||
| 1512 | 1512 | if ($detail_page_tab['is_display']) {
|
| 1513 | 1513 | ?> |
| 1514 | 1514 | <dt></dt> <!-- added to comply with validation --> |
| 1515 | - <dd <?php if ($detail_page_tab['is_active_tab']){ ?>class="geodir-tab-active"<?php }?> ><a data-tab="#<?php echo $tab_index;?>" data-status="enable"><?php _e($detail_page_tab['heading_text'],'geodirectory');?></a>
|
|
| 1515 | + <dd <?php if ($detail_page_tab['is_active_tab']) { ?>class="geodir-tab-active"<?php }?> ><a data-tab="#<?php echo $tab_index; ?>" data-status="enable"><?php _e($detail_page_tab['heading_text'], 'geodirectory'); ?></a>
|
|
| 1516 | 1516 | </dd> |
| 1517 | 1517 | <?php |
| 1518 | 1518 | ob_start() // start tab content buffering |
| 1519 | 1519 | ?> |
| 1520 | - <li id="<?php echo $tab_index;?>Tab"> |
|
| 1521 | - <div id="<?php echo $tab_index;?>" class="hash-offset"></div> |
|
| 1520 | + <li id="<?php echo $tab_index; ?>Tab"> |
|
| 1521 | + <div id="<?php echo $tab_index; ?>" class="hash-offset"></div> |
|
| 1522 | 1522 | <?php |
| 1523 | 1523 | /** |
| 1524 | 1524 | * Called before the details tab content is output per tab. |
@@ -1568,7 +1568,7 @@ discard block |
||
| 1568 | 1568 | break; |
| 1569 | 1569 | case 'post_video': |
| 1570 | 1570 | /** This action is documented in geodirectory_template_actions.php */ |
| 1571 | - echo apply_filters('the_content', stripslashes($video));// we apply the_content filter so oembed works also;
|
|
| 1571 | + echo apply_filters('the_content', stripslashes($video)); // we apply the_content filter so oembed works also;
|
|
| 1572 | 1572 | break; |
| 1573 | 1573 | case 'special_offers': |
| 1574 | 1574 | echo wpautop(stripslashes($special_offers)); |
@@ -1702,7 +1702,7 @@ discard block |
||
| 1702 | 1702 | $modify = false; |
| 1703 | 1703 | $orientation = 0; |
| 1704 | 1704 | if (!empty($exif) && isset($exif['Orientation'])) {
|
| 1705 | - switch ((int)$exif['Orientation']) {
|
|
| 1705 | + switch ((int) $exif['Orientation']) {
|
|
| 1706 | 1706 | case 1: |
| 1707 | 1707 | // do nothing |
| 1708 | 1708 | break; |
@@ -1779,7 +1779,7 @@ discard block |
||
| 1779 | 1779 | } |
| 1780 | 1780 | |
| 1781 | 1781 | if ($quality !== null) {
|
| 1782 | - $image->set_quality((int)$quality); |
|
| 1782 | + $image->set_quality((int) $quality); |
|
| 1783 | 1783 | } |
| 1784 | 1784 | |
| 1785 | 1785 | $result = $image->save($file_path); |
@@ -1925,9 +1925,9 @@ discard block |
||
| 1925 | 1925 | $comments_echo .= "</span>\n"; |
| 1926 | 1926 | |
| 1927 | 1927 | $comments_echo .= '<span class="geodir_reviewer_content">'; |
| 1928 | - if($comment->user_id){$comments_echo .= '<a href="'.get_author_posts_url( $comment->user_id ).'">';}
|
|
| 1928 | + if ($comment->user_id) {$comments_echo .= '<a href="' . get_author_posts_url($comment->user_id) . '">'; }
|
|
| 1929 | 1929 | $comments_echo .= '<span class="geodir_reviewer_author">' . $comment->comment_author . '</span> '; |
| 1930 | - if($comment->user_id){$comments_echo .= '</a>';}
|
|
| 1930 | + if ($comment->user_id) {$comments_echo .= '</a>'; }
|
|
| 1931 | 1931 | $comments_echo .= '<span class="geodir_reviewer_reviewed">' . __('reviewed', 'geodirectory') . '</span> ';
|
| 1932 | 1932 | $comments_echo .= '<a href="' . $permalink . '" class="geodir_reviewer_title">' . $post_title . '</a>'; |
| 1933 | 1933 | $comments_echo .= geodir_get_rating_stars($comment->overall_rating, $comment_post_ID); |
@@ -1958,7 +1958,7 @@ discard block |
||
| 1958 | 1958 | if (!empty($post_types)) {
|
| 1959 | 1959 | foreach ($post_types as $key => $post_type) {
|
| 1960 | 1960 | $cpt_name = __($post_type->labels->singular_name, 'geodirectory'); |
| 1961 | - $post_type_name = sprintf(__('%s Categories', 'geodirectory'),$cpt_name);
|
|
| 1961 | + $post_type_name = sprintf(__('%s Categories', 'geodirectory'), $cpt_name);
|
|
| 1962 | 1962 | $taxonomies = geodir_get_taxonomies($key); |
| 1963 | 1963 | $cat_taxonomy = !empty($taxonomies[0]) ? $taxonomies[0] : NULL; |
| 1964 | 1964 | $cat_terms = $cat_taxonomy ? get_terms($cat_taxonomy) : NULL; |
@@ -2065,10 +2065,10 @@ discard block |
||
| 2065 | 2065 | stWidget.addEntry({
|
| 2066 | 2066 | "service": "sharethis", |
| 2067 | 2067 | "element": document.getElementById('st_sharethis'),
|
| 2068 | - "url": "<?php echo geodir_curPageURL();?>", |
|
| 2069 | - "title": "<?php echo $post->post_title;?>", |
|
| 2068 | + "url": "<?php echo geodir_curPageURL(); ?>", |
|
| 2069 | + "title": "<?php echo $post->post_title; ?>", |
|
| 2070 | 2070 | "type": "chicklet", |
| 2071 | - "text": "<?php _e( 'Share', 'geodirectory' );?>" |
|
| 2071 | + "text": "<?php _e('Share', 'geodirectory'); ?>"
|
|
| 2072 | 2072 | });</script> |
| 2073 | 2073 | |
| 2074 | 2074 | </div> |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | */ |
| 20 | 20 | function geodir_get_ajax_url() |
| 21 | 21 | {
|
| 22 | - return admin_url('admin-ajax.php?action=geodir_ajax_action');
|
|
| 22 | + return admin_url('admin-ajax.php?action=geodir_ajax_action');
|
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | ///////////////////// |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | add_filter('query_vars', 'geodir_add_geodir_page_var');
|
| 88 | 88 | add_action('wp', 'geodir_add_page_id_in_query_var'); // problem fix in wordpress 3.8
|
| 89 | 89 | if (get_option('permalink_structure') != '')
|
| 90 | - add_filter('parse_request', 'geodir_set_location_var_in_session_in_core');
|
|
| 90 | + add_filter('parse_request', 'geodir_set_location_var_in_session_in_core');
|
|
| 91 | 91 | |
| 92 | 92 | add_filter('parse_query', 'geodir_modified_query');
|
| 93 | 93 | |
@@ -154,14 +154,14 @@ discard block |
||
| 154 | 154 | /* POST AND LOOP ACTIONS */ |
| 155 | 155 | //////////////////////// |
| 156 | 156 | if (!is_admin()) {
|
| 157 | - add_action('pre_get_posts', 'geodir_exclude_page', 100); /// Will help to exclude virtural page from everywhere
|
|
| 158 | - add_filter('wp_list_pages_excludes', 'exclude_from_wp_list_pages', 100);
|
|
| 159 | - /** Exclude Virtual Pages From Pages List **/ |
|
| 160 | - add_action('pre_get_posts', 'set_listing_request', 0);
|
|
| 161 | - add_action('pre_get_posts', 'geodir_listing_loop_filter', 1);
|
|
| 162 | - add_filter('excerpt_more', 'geodir_excerpt_more', 1000);
|
|
| 163 | - add_filter('excerpt_length', 'geodir_excerpt_length', 1000);
|
|
| 164 | - add_action('the_post', 'create_marker_jason_of_posts'); // Add marker in json array, Map related filter
|
|
| 157 | + add_action('pre_get_posts', 'geodir_exclude_page', 100); /// Will help to exclude virtural page from everywhere
|
|
| 158 | + add_filter('wp_list_pages_excludes', 'exclude_from_wp_list_pages', 100);
|
|
| 159 | + /** Exclude Virtual Pages From Pages List **/ |
|
| 160 | + add_action('pre_get_posts', 'set_listing_request', 0);
|
|
| 161 | + add_action('pre_get_posts', 'geodir_listing_loop_filter', 1);
|
|
| 162 | + add_filter('excerpt_more', 'geodir_excerpt_more', 1000);
|
|
| 163 | + add_filter('excerpt_length', 'geodir_excerpt_length', 1000);
|
|
| 164 | + add_action('the_post', 'create_marker_jason_of_posts'); // Add marker in json array, Map related filter
|
|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | |
@@ -221,12 +221,12 @@ discard block |
||
| 221 | 221 | */ |
| 222 | 222 | function geodir_unset_prev_theme_nav_location($newname) |
| 223 | 223 | {
|
| 224 | - $geodir_theme_location = get_option('geodir_theme_location_nav_' . $newname);
|
|
| 225 | - if ($geodir_theme_location) {
|
|
| 226 | - update_option('geodir_theme_location_nav', $geodir_theme_location);
|
|
| 227 | - } else {
|
|
| 228 | - update_option('geodir_theme_location_nav', '');
|
|
| 229 | - } |
|
| 224 | + $geodir_theme_location = get_option('geodir_theme_location_nav_' . $newname);
|
|
| 225 | + if ($geodir_theme_location) {
|
|
| 226 | + update_option('geodir_theme_location_nav', $geodir_theme_location);
|
|
| 227 | + } else {
|
|
| 228 | + update_option('geodir_theme_location_nav', '');
|
|
| 229 | + } |
|
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | /// add action for theme switch to blank previous theme navigation location setting |
@@ -247,32 +247,32 @@ discard block |
||
| 247 | 247 | */ |
| 248 | 248 | function geodir_add_post_filters() |
| 249 | 249 | {
|
| 250 | - /** |
|
| 251 | - * Contains all function for filtering listing. |
|
| 252 | - * |
|
| 253 | - * @since 1.0.0 |
|
| 254 | - * @package GeoDirectory |
|
| 255 | - */ |
|
| 256 | - include_once('geodirectory-functions/listing_filters.php');
|
|
| 250 | + /** |
|
| 251 | + * Contains all function for filtering listing. |
|
| 252 | + * |
|
| 253 | + * @since 1.0.0 |
|
| 254 | + * @package GeoDirectory |
|
| 255 | + */ |
|
| 256 | + include_once('geodirectory-functions/listing_filters.php');
|
|
| 257 | 257 | } |
| 258 | 258 | |
| 259 | 259 | |
| 260 | 260 | if (!function_exists('geodir_init_defaults')) {
|
| 261 | - /** |
|
| 262 | - * Calls the function to register the GeoDirectory default CPT and taxonomies. |
|
| 263 | - * |
|
| 264 | - * @since 1.0.0 |
|
| 265 | - * @package GeoDirectory |
|
| 266 | - */ |
|
| 267 | - function geodir_init_defaults() |
|
| 268 | - {
|
|
| 269 | - if (function_exists('geodir_register_defaults')) {
|
|
| 261 | + /** |
|
| 262 | + * Calls the function to register the GeoDirectory default CPT and taxonomies. |
|
| 263 | + * |
|
| 264 | + * @since 1.0.0 |
|
| 265 | + * @package GeoDirectory |
|
| 266 | + */ |
|
| 267 | + function geodir_init_defaults() |
|
| 268 | + {
|
|
| 269 | + if (function_exists('geodir_register_defaults')) {
|
|
| 270 | 270 | |
| 271 | - geodir_register_defaults(); |
|
| 271 | + geodir_register_defaults(); |
|
| 272 | 272 | |
| 273 | - } |
|
| 273 | + } |
|
| 274 | 274 | |
| 275 | - } |
|
| 275 | + } |
|
| 276 | 276 | } |
| 277 | 277 | |
| 278 | 278 | |
@@ -294,26 +294,26 @@ discard block |
||
| 294 | 294 | // CALLED ON 'sidebars_widgets' FILTER |
| 295 | 295 | |
| 296 | 296 | if (!function_exists('geodir_restrict_widget')) {
|
| 297 | - /** |
|
| 298 | - * Sets global values to be able to tell if the current page is a GeoDirectory listing page or a GeoDirectory details page. |
|
| 299 | - * |
|
| 300 | - * @global bool $is_listing Sets the global value to true if on a GD category page. False if not. |
|
| 301 | - * @global bool $is_single_place Sets the global value to true if on a GD details (post) page. False if not. |
|
| 302 | - * @since 1.0.0 |
|
| 303 | - * @package GeoDirectory |
|
| 304 | - */ |
|
| 305 | - function geodir_restrict_widget() |
|
| 306 | - {
|
|
| 307 | - global $is_listing, $is_single_place; |
|
| 297 | + /** |
|
| 298 | + * Sets global values to be able to tell if the current page is a GeoDirectory listing page or a GeoDirectory details page. |
|
| 299 | + * |
|
| 300 | + * @global bool $is_listing Sets the global value to true if on a GD category page. False if not. |
|
| 301 | + * @global bool $is_single_place Sets the global value to true if on a GD details (post) page. False if not. |
|
| 302 | + * @since 1.0.0 |
|
| 303 | + * @package GeoDirectory |
|
| 304 | + */ |
|
| 305 | + function geodir_restrict_widget() |
|
| 306 | + {
|
|
| 307 | + global $is_listing, $is_single_place; |
|
| 308 | 308 | |
| 309 | - // set is listing |
|
| 310 | - (geodir_is_page('listing')) ? $is_listing = true : $is_listing = false;
|
|
| 309 | + // set is listing |
|
| 310 | + (geodir_is_page('listing')) ? $is_listing = true : $is_listing = false;
|
|
| 311 | 311 | |
| 312 | - // set is single place |
|
| 313 | - (geodir_is_page('place')) ? $is_single_place = true : $is_single_place = false;
|
|
| 312 | + // set is single place |
|
| 313 | + (geodir_is_page('place')) ? $is_single_place = true : $is_single_place = false;
|
|
| 314 | 314 | |
| 315 | 315 | |
| 316 | - } |
|
| 316 | + } |
|
| 317 | 317 | } |
| 318 | 318 | |
| 319 | 319 | |
@@ -334,32 +334,32 @@ discard block |
||
| 334 | 334 | */ |
| 335 | 335 | function geodir_detail_page_sidebar_content_sorting() |
| 336 | 336 | {
|
| 337 | - $arr_detail_page_sidebar_content = |
|
| 338 | - /** |
|
| 339 | - * An array of functions to be called to be displayed on the details (post) page sidebar. |
|
| 340 | - * |
|
| 341 | - * This filter can be used to remove sections of the details page sidebar, |
|
| 342 | - * add new sections or rearrange the order of the sections. |
|
| 343 | - * |
|
| 344 | - * @param array array('geodir_social_sharing_buttons','geodir_share_this_button','geodir_detail_page_google_analytics','geodir_edit_post_link','geodir_detail_page_review_rating','geodir_detail_page_more_info') The array of functions that will be called.
|
|
| 345 | - * @since 1.0.0 |
|
| 346 | - */ |
|
| 347 | - apply_filters('geodir_detail_page_sidebar_content',
|
|
| 348 | - array('geodir_social_sharing_buttons',
|
|
| 349 | - 'geodir_share_this_button', |
|
| 350 | - 'geodir_detail_page_google_analytics', |
|
| 351 | - 'geodir_edit_post_link', |
|
| 352 | - 'geodir_detail_page_review_rating', |
|
| 353 | - 'geodir_detail_page_more_info' |
|
| 354 | - ) // end of array |
|
| 355 | - ); // end of apply filter |
|
| 356 | - if (!empty($arr_detail_page_sidebar_content)) {
|
|
| 357 | - foreach ($arr_detail_page_sidebar_content as $content_function) {
|
|
| 358 | - if (function_exists($content_function)) {
|
|
| 359 | - add_action('geodir_detail_page_sidebar', $content_function);
|
|
| 360 | - } |
|
| 361 | - } |
|
| 362 | - } |
|
| 337 | + $arr_detail_page_sidebar_content = |
|
| 338 | + /** |
|
| 339 | + * An array of functions to be called to be displayed on the details (post) page sidebar. |
|
| 340 | + * |
|
| 341 | + * This filter can be used to remove sections of the details page sidebar, |
|
| 342 | + * add new sections or rearrange the order of the sections. |
|
| 343 | + * |
|
| 344 | + * @param array array('geodir_social_sharing_buttons','geodir_share_this_button','geodir_detail_page_google_analytics','geodir_edit_post_link','geodir_detail_page_review_rating','geodir_detail_page_more_info') The array of functions that will be called.
|
|
| 345 | + * @since 1.0.0 |
|
| 346 | + */ |
|
| 347 | + apply_filters('geodir_detail_page_sidebar_content',
|
|
| 348 | + array('geodir_social_sharing_buttons',
|
|
| 349 | + 'geodir_share_this_button', |
|
| 350 | + 'geodir_detail_page_google_analytics', |
|
| 351 | + 'geodir_edit_post_link', |
|
| 352 | + 'geodir_detail_page_review_rating', |
|
| 353 | + 'geodir_detail_page_more_info' |
|
| 354 | + ) // end of array |
|
| 355 | + ); // end of apply filter |
|
| 356 | + if (!empty($arr_detail_page_sidebar_content)) {
|
|
| 357 | + foreach ($arr_detail_page_sidebar_content as $content_function) {
|
|
| 358 | + if (function_exists($content_function)) {
|
|
| 359 | + add_action('geodir_detail_page_sidebar', $content_function);
|
|
| 360 | + } |
|
| 361 | + } |
|
| 362 | + } |
|
| 363 | 363 | } |
| 364 | 364 | |
| 365 | 365 | add_action('geodir_after_edit_post_link', 'geodir_add_to_favourite_link', 1);
|
@@ -374,14 +374,14 @@ discard block |
||
| 374 | 374 | */ |
| 375 | 375 | function geodir_add_to_favourite_link() |
| 376 | 376 | {
|
| 377 | - global $post, $preview; |
|
| 378 | - if (!$preview && geodir_is_page('detail')) {
|
|
| 379 | - ?> |
|
| 377 | + global $post, $preview; |
|
| 378 | + if (!$preview && geodir_is_page('detail')) {
|
|
| 379 | + ?> |
|
| 380 | 380 | <p class="edit_link"> |
| 381 | 381 | <?php geodir_favourite_html($post->post_author, $post->ID); ?> |
| 382 | 382 | </p> |
| 383 | 383 | <?php |
| 384 | - } |
|
| 384 | + } |
|
| 385 | 385 | } |
| 386 | 386 | |
| 387 | 387 | /** |
@@ -395,41 +395,41 @@ discard block |
||
| 395 | 395 | */ |
| 396 | 396 | function geodir_social_sharing_buttons() |
| 397 | 397 | {
|
| 398 | - global $preview; |
|
| 399 | - ob_start(); // Start buffering; |
|
| 400 | - /** |
|
| 401 | - * This action is called before the social buttons twitter,facebook and google plus are output in a containing div. |
|
| 402 | - * |
|
| 403 | - * @since 1.0.0 |
|
| 404 | - */ |
|
| 405 | - do_action('geodir_before_social_sharing_buttons');
|
|
| 406 | - if (!$preview) {
|
|
| 407 | - ?> |
|
| 398 | + global $preview; |
|
| 399 | + ob_start(); // Start buffering; |
|
| 400 | + /** |
|
| 401 | + * This action is called before the social buttons twitter,facebook and google plus are output in a containing div. |
|
| 402 | + * |
|
| 403 | + * @since 1.0.0 |
|
| 404 | + */ |
|
| 405 | + do_action('geodir_before_social_sharing_buttons');
|
|
| 406 | + if (!$preview) {
|
|
| 407 | + ?> |
|
| 408 | 408 | <div class="likethis"> |
| 409 | 409 | <?php geodir_twitter_tweet_button(); ?> |
| 410 | 410 | <?php geodir_fb_like_button(); ?> |
| 411 | 411 | <?php geodir_google_plus_button(); ?> |
| 412 | 412 | </div> |
| 413 | 413 | <?php |
| 414 | - }// end of if, if its a preview or not |
|
| 415 | - |
|
| 416 | - /** |
|
| 417 | - * This action is called after the social buttons twitter,facebook and google plus are output in a containing div. |
|
| 418 | - * |
|
| 419 | - * @since 1.0.0 |
|
| 420 | - */ |
|
| 421 | - do_action('geodir_after_social_sharing_buttons');
|
|
| 422 | - $content_html = ob_get_clean(); |
|
| 423 | - if (trim($content_html) != '') |
|
| 424 | - $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">' . $content_html . '</div>'; |
|
| 425 | - if ((int)get_option('geodir_disable_tfg_buttons_section') != 1) {
|
|
| 426 | - /** |
|
| 427 | - * Filter the geodir_social_sharing_buttons() function content. |
|
| 428 | - * |
|
| 429 | - * @param string $content_html The output html of the geodir_social_sharing_buttons() function. |
|
| 430 | - */ |
|
| 431 | - echo $content_html = apply_filters('geodir_social_sharing_buttons_html', $content_html);
|
|
| 432 | - } |
|
| 414 | + }// end of if, if its a preview or not |
|
| 415 | + |
|
| 416 | + /** |
|
| 417 | + * This action is called after the social buttons twitter,facebook and google plus are output in a containing div. |
|
| 418 | + * |
|
| 419 | + * @since 1.0.0 |
|
| 420 | + */ |
|
| 421 | + do_action('geodir_after_social_sharing_buttons');
|
|
| 422 | + $content_html = ob_get_clean(); |
|
| 423 | + if (trim($content_html) != '') |
|
| 424 | + $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">' . $content_html . '</div>'; |
|
| 425 | + if ((int)get_option('geodir_disable_tfg_buttons_section') != 1) {
|
|
| 426 | + /** |
|
| 427 | + * Filter the geodir_social_sharing_buttons() function content. |
|
| 428 | + * |
|
| 429 | + * @param string $content_html The output html of the geodir_social_sharing_buttons() function. |
|
| 430 | + */ |
|
| 431 | + echo $content_html = apply_filters('geodir_social_sharing_buttons_html', $content_html);
|
|
| 432 | + } |
|
| 433 | 433 | |
| 434 | 434 | |
| 435 | 435 | } |
@@ -445,39 +445,39 @@ discard block |
||
| 445 | 445 | */ |
| 446 | 446 | function geodir_share_this_button() |
| 447 | 447 | {
|
| 448 | - global $preview; |
|
| 449 | - ob_start(); // Start buffering; |
|
| 450 | - /** |
|
| 451 | - * This is called before the share this html in the function geodir_share_this_button() |
|
| 452 | - * |
|
| 453 | - * @since 1.0.0 |
|
| 454 | - */ |
|
| 455 | - do_action('geodir_before_share_this_button');
|
|
| 456 | - if (!$preview) {
|
|
| 457 | - ?> |
|
| 448 | + global $preview; |
|
| 449 | + ob_start(); // Start buffering; |
|
| 450 | + /** |
|
| 451 | + * This is called before the share this html in the function geodir_share_this_button() |
|
| 452 | + * |
|
| 453 | + * @since 1.0.0 |
|
| 454 | + */ |
|
| 455 | + do_action('geodir_before_share_this_button');
|
|
| 456 | + if (!$preview) {
|
|
| 457 | + ?> |
|
| 458 | 458 | <div class="share clearfix"> |
| 459 | 459 | <?php geodir_share_this_button_code(); ?> |
| 460 | 460 | </div> |
| 461 | 461 | <?php |
| 462 | - }// end of if, if its a preview or not |
|
| 463 | - /** |
|
| 464 | - * This is called after the share this html in the function geodir_share_this_button() |
|
| 465 | - * |
|
| 466 | - * @since 1.0.0 |
|
| 467 | - */ |
|
| 468 | - do_action('geodir_after_share_this_button');
|
|
| 469 | - $content_html = ob_get_clean(); |
|
| 470 | - if (trim($content_html) != '') |
|
| 471 | - $content_html = '<div class="geodir-company_info geodir-details-sidebar-sharethis">' . $content_html . '</div>'; |
|
| 472 | - if ((int)get_option('geodir_disable_sharethis_button_section') != 1) {
|
|
| 473 | - /** |
|
| 474 | - * Filter the geodir_share_this_button() function content. |
|
| 475 | - * |
|
| 476 | - * @param string $content_html The output html of the geodir_share_this_button() function. |
|
| 477 | - * @since 1.0.0 |
|
| 478 | - */ |
|
| 479 | - echo $content_html = apply_filters('geodir_share_this_button_html', $content_html);
|
|
| 480 | - } |
|
| 462 | + }// end of if, if its a preview or not |
|
| 463 | + /** |
|
| 464 | + * This is called after the share this html in the function geodir_share_this_button() |
|
| 465 | + * |
|
| 466 | + * @since 1.0.0 |
|
| 467 | + */ |
|
| 468 | + do_action('geodir_after_share_this_button');
|
|
| 469 | + $content_html = ob_get_clean(); |
|
| 470 | + if (trim($content_html) != '') |
|
| 471 | + $content_html = '<div class="geodir-company_info geodir-details-sidebar-sharethis">' . $content_html . '</div>'; |
|
| 472 | + if ((int)get_option('geodir_disable_sharethis_button_section') != 1) {
|
|
| 473 | + /** |
|
| 474 | + * Filter the geodir_share_this_button() function content. |
|
| 475 | + * |
|
| 476 | + * @param string $content_html The output html of the geodir_share_this_button() function. |
|
| 477 | + * @since 1.0.0 |
|
| 478 | + */ |
|
| 479 | + echo $content_html = apply_filters('geodir_share_this_button_html', $content_html);
|
|
| 480 | + } |
|
| 481 | 481 | |
| 482 | 482 | } |
| 483 | 483 | |
@@ -493,46 +493,46 @@ discard block |
||
| 493 | 493 | */ |
| 494 | 494 | function geodir_edit_post_link() |
| 495 | 495 | {
|
| 496 | - global $post, $preview; |
|
| 497 | - ob_start(); // Start buffering; |
|
| 498 | - /** |
|
| 499 | - * This is called before the edit post link html in the function geodir_edit_post_link() |
|
| 500 | - * |
|
| 501 | - * @since 1.0.0 |
|
| 502 | - */ |
|
| 503 | - do_action('geodir_before_edit_post_link');
|
|
| 504 | - if (!$preview) {
|
|
| 505 | - $is_current_user_owner = geodir_listing_belong_to_current_user(); |
|
| 496 | + global $post, $preview; |
|
| 497 | + ob_start(); // Start buffering; |
|
| 498 | + /** |
|
| 499 | + * This is called before the edit post link html in the function geodir_edit_post_link() |
|
| 500 | + * |
|
| 501 | + * @since 1.0.0 |
|
| 502 | + */ |
|
| 503 | + do_action('geodir_before_edit_post_link');
|
|
| 504 | + if (!$preview) {
|
|
| 505 | + $is_current_user_owner = geodir_listing_belong_to_current_user(); |
|
| 506 | 506 | |
| 507 | - if ($is_current_user_owner) {
|
|
| 508 | - $post_id = $post->ID; |
|
| 507 | + if ($is_current_user_owner) {
|
|
| 508 | + $post_id = $post->ID; |
|
| 509 | 509 | |
| 510 | - if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 511 | - $post_id = (int)$_REQUEST['pid']; |
|
| 512 | - } |
|
| 510 | + if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 511 | + $post_id = (int)$_REQUEST['pid']; |
|
| 512 | + } |
|
| 513 | 513 | |
| 514 | - $postlink = get_permalink(geodir_add_listing_page_id()); |
|
| 515 | - $editlink = geodir_getlink($postlink, array('pid' => $post_id), false);
|
|
| 516 | - echo ' <p class="edit_link"><i class="fa fa-pencil"></i> <a href="' . esc_url($editlink) . '">' . __('Edit this Post', 'geodirectory') . '</a></p>';
|
|
| 517 | - } |
|
| 518 | - }// end of if, if its a preview or not |
|
| 519 | - /** |
|
| 520 | - * This is called after the edit post link html in the function geodir_edit_post_link() |
|
| 521 | - * |
|
| 522 | - * @since 1.0.0 |
|
| 523 | - */ |
|
| 524 | - do_action('geodir_after_edit_post_link');
|
|
| 525 | - $content_html = ob_get_clean(); |
|
| 526 | - if (trim($content_html) != '') |
|
| 527 | - $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">' . $content_html . '</div>'; |
|
| 528 | - if ((int)get_option('geodir_disable_user_links_section') != 1) {
|
|
| 529 | - /** |
|
| 530 | - * Filter the geodir_edit_post_link() function content. |
|
| 531 | - * |
|
| 532 | - * @param string $content_html The output html of the geodir_edit_post_link() function. |
|
| 533 | - */ |
|
| 534 | - echo $content_html = apply_filters('geodir_edit_post_link_html', $content_html);
|
|
| 535 | - } |
|
| 514 | + $postlink = get_permalink(geodir_add_listing_page_id()); |
|
| 515 | + $editlink = geodir_getlink($postlink, array('pid' => $post_id), false);
|
|
| 516 | + echo ' <p class="edit_link"><i class="fa fa-pencil"></i> <a href="' . esc_url($editlink) . '">' . __('Edit this Post', 'geodirectory') . '</a></p>';
|
|
| 517 | + } |
|
| 518 | + }// end of if, if its a preview or not |
|
| 519 | + /** |
|
| 520 | + * This is called after the edit post link html in the function geodir_edit_post_link() |
|
| 521 | + * |
|
| 522 | + * @since 1.0.0 |
|
| 523 | + */ |
|
| 524 | + do_action('geodir_after_edit_post_link');
|
|
| 525 | + $content_html = ob_get_clean(); |
|
| 526 | + if (trim($content_html) != '') |
|
| 527 | + $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">' . $content_html . '</div>'; |
|
| 528 | + if ((int)get_option('geodir_disable_user_links_section') != 1) {
|
|
| 529 | + /** |
|
| 530 | + * Filter the geodir_edit_post_link() function content. |
|
| 531 | + * |
|
| 532 | + * @param string $content_html The output html of the geodir_edit_post_link() function. |
|
| 533 | + */ |
|
| 534 | + echo $content_html = apply_filters('geodir_edit_post_link_html', $content_html);
|
|
| 535 | + } |
|
| 536 | 536 | } |
| 537 | 537 | |
| 538 | 538 | /** |
@@ -546,27 +546,27 @@ discard block |
||
| 546 | 546 | */ |
| 547 | 547 | function geodir_detail_page_google_analytics() |
| 548 | 548 | {
|
| 549 | - global $post; |
|
| 550 | - $package_info = array(); |
|
| 551 | - $package_info = geodir_post_package_info($package_info, $post); |
|
| 549 | + global $post; |
|
| 550 | + $package_info = array(); |
|
| 551 | + $package_info = geodir_post_package_info($package_info, $post); |
|
| 552 | 552 | |
| 553 | - $id = trim(get_option('geodir_ga_id'));
|
|
| 553 | + $id = trim(get_option('geodir_ga_id'));
|
|
| 554 | 554 | |
| 555 | - if (!$id) {
|
|
| 556 | - return; //if no Google Analytics ID then bail. |
|
| 557 | - } |
|
| 555 | + if (!$id) {
|
|
| 556 | + return; //if no Google Analytics ID then bail. |
|
| 557 | + } |
|
| 558 | 558 | |
| 559 | - ob_start(); // Start buffering; |
|
| 560 | - /** |
|
| 561 | - * This is called before the edit post link html in the function geodir_detail_page_google_analytics() |
|
| 562 | - * |
|
| 563 | - * @since 1.0.0 |
|
| 564 | - */ |
|
| 565 | - do_action('geodir_before_google_analytics');
|
|
| 559 | + ob_start(); // Start buffering; |
|
| 560 | + /** |
|
| 561 | + * This is called before the edit post link html in the function geodir_detail_page_google_analytics() |
|
| 562 | + * |
|
| 563 | + * @since 1.0.0 |
|
| 564 | + */ |
|
| 565 | + do_action('geodir_before_google_analytics');
|
|
| 566 | 566 | |
| 567 | - if (get_option('geodir_ga_stats') && is_user_logged_in() && (isset($package_info->google_analytics) && $package_info->google_analytics == '1') && (get_current_user_id()==$post->post_author || current_user_can( 'manage_options' )) ) {
|
|
| 568 | - $page_url = urlencode($_SERVER['REQUEST_URI']); |
|
| 569 | - ?> |
|
| 567 | + if (get_option('geodir_ga_stats') && is_user_logged_in() && (isset($package_info->google_analytics) && $package_info->google_analytics == '1') && (get_current_user_id()==$post->post_author || current_user_can( 'manage_options' )) ) {
|
|
| 568 | + $page_url = urlencode($_SERVER['REQUEST_URI']); |
|
| 569 | + ?> |
|
| 570 | 570 | <script type="text/javascript"> |
| 571 | 571 | ga_data1 = false; |
| 572 | 572 | ga_data2 = false; |
@@ -795,15 +795,15 @@ discard block |
||
| 795 | 795 | var labels = results[1].rows.map(function(row) { return +row[0]; });
|
| 796 | 796 | |
| 797 | 797 | <?php |
| 798 | - // Here we list the shorthand days of the week so it can be used in translation. |
|
| 799 | - __("Mon",'geodirectory');
|
|
| 800 | - __("Tue",'geodirectory');
|
|
| 801 | - __("Wed",'geodirectory');
|
|
| 802 | - __("Thu",'geodirectory');
|
|
| 803 | - __("Fri",'geodirectory');
|
|
| 804 | - __("Sat",'geodirectory');
|
|
| 805 | - __("Sun",'geodirectory');
|
|
| 806 | - ?> |
|
| 798 | + // Here we list the shorthand days of the week so it can be used in translation. |
|
| 799 | + __("Mon",'geodirectory');
|
|
| 800 | + __("Tue",'geodirectory');
|
|
| 801 | + __("Wed",'geodirectory');
|
|
| 802 | + __("Thu",'geodirectory');
|
|
| 803 | + __("Fri",'geodirectory');
|
|
| 804 | + __("Sat",'geodirectory');
|
|
| 805 | + __("Sun",'geodirectory');
|
|
| 806 | + ?> |
|
| 807 | 807 | |
| 808 | 808 | labels = [ |
| 809 | 809 | "<?php _e(date('D', strtotime("+1 day")),'geodirectory'); ?>",
|
@@ -1028,24 +1028,24 @@ discard block |
||
| 1028 | 1028 | </span> |
| 1029 | 1029 | |
| 1030 | 1030 | <?php |
| 1031 | - } |
|
| 1032 | - /** |
|
| 1033 | - * This is called after the edit post link html in the function geodir_detail_page_google_analytics() |
|
| 1034 | - * |
|
| 1035 | - * @since 1.0.0 |
|
| 1036 | - */ |
|
| 1037 | - do_action('geodir_after_google_analytics');
|
|
| 1038 | - $content_html = ob_get_clean(); |
|
| 1039 | - if (trim($content_html) != '') |
|
| 1040 | - $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">' . $content_html . '</div>'; |
|
| 1041 | - if ((int)get_option('geodir_disable_google_analytics_section') != 1) {
|
|
| 1042 | - /** |
|
| 1043 | - * Filter the geodir_edit_post_link() function content. |
|
| 1044 | - * |
|
| 1045 | - * @param string $content_html The output html of the geodir_edit_post_link() function. |
|
| 1046 | - */ |
|
| 1047 | - echo $content_html = apply_filters('geodir_google_analytic_html', $content_html);
|
|
| 1048 | - } |
|
| 1031 | + } |
|
| 1032 | + /** |
|
| 1033 | + * This is called after the edit post link html in the function geodir_detail_page_google_analytics() |
|
| 1034 | + * |
|
| 1035 | + * @since 1.0.0 |
|
| 1036 | + */ |
|
| 1037 | + do_action('geodir_after_google_analytics');
|
|
| 1038 | + $content_html = ob_get_clean(); |
|
| 1039 | + if (trim($content_html) != '') |
|
| 1040 | + $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">' . $content_html . '</div>'; |
|
| 1041 | + if ((int)get_option('geodir_disable_google_analytics_section') != 1) {
|
|
| 1042 | + /** |
|
| 1043 | + * Filter the geodir_edit_post_link() function content. |
|
| 1044 | + * |
|
| 1045 | + * @param string $content_html The output html of the geodir_edit_post_link() function. |
|
| 1046 | + */ |
|
| 1047 | + echo $content_html = apply_filters('geodir_google_analytic_html', $content_html);
|
|
| 1048 | + } |
|
| 1049 | 1049 | } |
| 1050 | 1050 | |
| 1051 | 1051 | /** |
@@ -1059,90 +1059,90 @@ discard block |
||
| 1059 | 1059 | */ |
| 1060 | 1060 | function geodir_detail_page_review_rating() |
| 1061 | 1061 | {
|
| 1062 | - global $post, $preview, $post_images; |
|
| 1063 | - ob_start(); // Start buffering; |
|
| 1064 | - /** |
|
| 1065 | - * This is called before the rating html in the function geodir_detail_page_review_rating(). |
|
| 1066 | - * |
|
| 1067 | - * This is called outside the check for an actual rating and the check for preview page. |
|
| 1068 | - * |
|
| 1069 | - * @since 1.0.0 |
|
| 1070 | - */ |
|
| 1071 | - do_action('geodir_before_detail_page_review_rating');
|
|
| 1072 | - |
|
| 1073 | - $comment_count = geodir_get_review_count_total($post->ID); |
|
| 1074 | - $post_avgratings = geodir_get_post_rating($post->ID); |
|
| 1075 | - |
|
| 1076 | - if ($post_avgratings != 0 && !$preview) {
|
|
| 1077 | - /** |
|
| 1078 | - * This is called before the rating html in the function geodir_detail_page_review_rating(). |
|
| 1079 | - * |
|
| 1080 | - * This is called inside the check for an actual rating and the check for preview page. |
|
| 1081 | - * |
|
| 1082 | - * @since 1.0.0 |
|
| 1083 | - * @param float $post_avgratings Average rating for the surrent post. |
|
| 1084 | - * @param int $post->ID Current post ID. |
|
| 1085 | - */ |
|
| 1086 | - do_action('geodir_before_review_rating_stars_on_detail', $post_avgratings, $post->ID);
|
|
| 1087 | - |
|
| 1088 | - $html = '<p style=" float:left;">'; |
|
| 1089 | - $html .= geodir_get_rating_stars($post_avgratings, $post->ID); |
|
| 1090 | - $html .= '<div class="average-review" itemscope itemtype="http://data-vocabulary.org/Review-aggregate">'; |
|
| 1091 | - $post_avgratings = (is_float($post_avgratings) || (strpos($post_avgratings, ".", 1) == 1 && strlen($post_avgratings) > 3)) ? number_format($post_avgratings, 1, '.', '') : $post_avgratings; |
|
| 1062 | + global $post, $preview, $post_images; |
|
| 1063 | + ob_start(); // Start buffering; |
|
| 1064 | + /** |
|
| 1065 | + * This is called before the rating html in the function geodir_detail_page_review_rating(). |
|
| 1066 | + * |
|
| 1067 | + * This is called outside the check for an actual rating and the check for preview page. |
|
| 1068 | + * |
|
| 1069 | + * @since 1.0.0 |
|
| 1070 | + */ |
|
| 1071 | + do_action('geodir_before_detail_page_review_rating');
|
|
| 1072 | + |
|
| 1073 | + $comment_count = geodir_get_review_count_total($post->ID); |
|
| 1074 | + $post_avgratings = geodir_get_post_rating($post->ID); |
|
| 1075 | + |
|
| 1076 | + if ($post_avgratings != 0 && !$preview) {
|
|
| 1077 | + /** |
|
| 1078 | + * This is called before the rating html in the function geodir_detail_page_review_rating(). |
|
| 1079 | + * |
|
| 1080 | + * This is called inside the check for an actual rating and the check for preview page. |
|
| 1081 | + * |
|
| 1082 | + * @since 1.0.0 |
|
| 1083 | + * @param float $post_avgratings Average rating for the surrent post. |
|
| 1084 | + * @param int $post->ID Current post ID. |
|
| 1085 | + */ |
|
| 1086 | + do_action('geodir_before_review_rating_stars_on_detail', $post_avgratings, $post->ID);
|
|
| 1087 | + |
|
| 1088 | + $html = '<p style=" float:left;">'; |
|
| 1089 | + $html .= geodir_get_rating_stars($post_avgratings, $post->ID); |
|
| 1090 | + $html .= '<div class="average-review" itemscope itemtype="http://data-vocabulary.org/Review-aggregate">'; |
|
| 1091 | + $post_avgratings = (is_float($post_avgratings) || (strpos($post_avgratings, ".", 1) == 1 && strlen($post_avgratings) > 3)) ? number_format($post_avgratings, 1, '.', '') : $post_avgratings; |
|
| 1092 | 1092 | |
| 1093 | 1093 | $reviews_text = $comment_count > 1 ? __("reviews", 'geodirectory') : __("review", 'geodirectory');
|
| 1094 | 1094 | |
| 1095 | 1095 | $html .= '<span itemprop="rating" itemscope itemtype="http://data-vocabulary.org/Rating"><span class="rating" itemprop="average" content="' . $post_avgratings . '">' . $post_avgratings . '</span> / <span itemprop="best" content="5">5</span> ' . __("based on", 'geodirectory') . ' </span><span class="count" itemprop="count" content="' . $comment_count . '">' . $comment_count . ' ' . $reviews_text . '</span><br />';
|
| 1096 | 1096 | |
| 1097 | - $html .= '<span class="item">'; |
|
| 1098 | - $html .= '<span class="fn" itemprop="itemreviewed">' . $post->post_title . '</span>'; |
|
| 1097 | + $html .= '<span class="item">'; |
|
| 1098 | + $html .= '<span class="fn" itemprop="itemreviewed">' . $post->post_title . '</span>'; |
|
| 1099 | 1099 | |
| 1100 | - if ($post_images) {
|
|
| 1101 | - foreach ($post_images as $img) {
|
|
| 1102 | - $post_img = $img->src; |
|
| 1103 | - break; |
|
| 1104 | - } |
|
| 1105 | - } |
|
| 1106 | - |
|
| 1107 | - if (isset($post_img) && $post_img) {
|
|
| 1108 | - $html .= '<br /><img src="' . $post_img . '" class="photo hreview-img" alt="' . esc_attr($post->post_title) . '" itemprop="photo" content="' . $post_img . '" class="photo hreview-img" />'; |
|
| 1109 | - } |
|
| 1110 | - |
|
| 1111 | - $html .= '</span>'; |
|
| 1112 | - |
|
| 1113 | - echo $html .= '</div>'; |
|
| 1114 | - /** |
|
| 1115 | - * This is called after the rating html in the function geodir_detail_page_review_rating(). |
|
| 1116 | - * |
|
| 1117 | - * This is called inside the check for an actual rating and the check for preview page. |
|
| 1118 | - * |
|
| 1119 | - * @since 1.0.0 |
|
| 1120 | - * @param float $post_avgratings Average rating for the surrent post. |
|
| 1121 | - * @param int $post->ID Current post ID. |
|
| 1122 | - */ |
|
| 1123 | - do_action('geodir_after_review_rating_stars_on_detail', $post_avgratings, $post->ID);
|
|
| 1124 | - } |
|
| 1125 | - /** |
|
| 1126 | - * This is called before the rating html in the function geodir_detail_page_review_rating(). |
|
| 1127 | - * |
|
| 1128 | - * This is called outside the check for an actual rating and the check for preview page. |
|
| 1129 | - * |
|
| 1130 | - * @since 1.0.0 |
|
| 1131 | - */ |
|
| 1132 | - do_action('geodir_after_detail_page_review_rating');
|
|
| 1133 | - $content_html = ob_get_clean(); |
|
| 1134 | - if (trim($content_html) != '') {
|
|
| 1135 | - $content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">' . $content_html . '</div>'; |
|
| 1136 | - } |
|
| 1137 | - if ((int)get_option('geodir_disable_rating_info_section') != 1) {
|
|
| 1138 | - /** |
|
| 1139 | - * Filter the geodir_detail_page_review_rating() function content. |
|
| 1140 | - * |
|
| 1141 | - * @since 1.0.0 |
|
| 1142 | - * @param string $content_html The output html of the geodir_detail_page_review_rating() function. |
|
| 1143 | - */ |
|
| 1144 | - echo $content_html = apply_filters('geodir_detail_page_review_rating_html', $content_html);
|
|
| 1145 | - } |
|
| 1100 | + if ($post_images) {
|
|
| 1101 | + foreach ($post_images as $img) {
|
|
| 1102 | + $post_img = $img->src; |
|
| 1103 | + break; |
|
| 1104 | + } |
|
| 1105 | + } |
|
| 1106 | + |
|
| 1107 | + if (isset($post_img) && $post_img) {
|
|
| 1108 | + $html .= '<br /><img src="' . $post_img . '" class="photo hreview-img" alt="' . esc_attr($post->post_title) . '" itemprop="photo" content="' . $post_img . '" class="photo hreview-img" />'; |
|
| 1109 | + } |
|
| 1110 | + |
|
| 1111 | + $html .= '</span>'; |
|
| 1112 | + |
|
| 1113 | + echo $html .= '</div>'; |
|
| 1114 | + /** |
|
| 1115 | + * This is called after the rating html in the function geodir_detail_page_review_rating(). |
|
| 1116 | + * |
|
| 1117 | + * This is called inside the check for an actual rating and the check for preview page. |
|
| 1118 | + * |
|
| 1119 | + * @since 1.0.0 |
|
| 1120 | + * @param float $post_avgratings Average rating for the surrent post. |
|
| 1121 | + * @param int $post->ID Current post ID. |
|
| 1122 | + */ |
|
| 1123 | + do_action('geodir_after_review_rating_stars_on_detail', $post_avgratings, $post->ID);
|
|
| 1124 | + } |
|
| 1125 | + /** |
|
| 1126 | + * This is called before the rating html in the function geodir_detail_page_review_rating(). |
|
| 1127 | + * |
|
| 1128 | + * This is called outside the check for an actual rating and the check for preview page. |
|
| 1129 | + * |
|
| 1130 | + * @since 1.0.0 |
|
| 1131 | + */ |
|
| 1132 | + do_action('geodir_after_detail_page_review_rating');
|
|
| 1133 | + $content_html = ob_get_clean(); |
|
| 1134 | + if (trim($content_html) != '') {
|
|
| 1135 | + $content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">' . $content_html . '</div>'; |
|
| 1136 | + } |
|
| 1137 | + if ((int)get_option('geodir_disable_rating_info_section') != 1) {
|
|
| 1138 | + /** |
|
| 1139 | + * Filter the geodir_detail_page_review_rating() function content. |
|
| 1140 | + * |
|
| 1141 | + * @since 1.0.0 |
|
| 1142 | + * @param string $content_html The output html of the geodir_detail_page_review_rating() function. |
|
| 1143 | + */ |
|
| 1144 | + echo $content_html = apply_filters('geodir_detail_page_review_rating_html', $content_html);
|
|
| 1145 | + } |
|
| 1146 | 1146 | } |
| 1147 | 1147 | |
| 1148 | 1148 | /** |
@@ -1154,35 +1154,35 @@ discard block |
||
| 1154 | 1154 | */ |
| 1155 | 1155 | function geodir_detail_page_more_info() |
| 1156 | 1156 | {
|
| 1157 | - ob_start(); // Start buffering; |
|
| 1158 | - /** |
|
| 1159 | - * This is called before the info section html. |
|
| 1160 | - * |
|
| 1161 | - * @since 1.0.0 |
|
| 1162 | - */ |
|
| 1163 | - do_action('geodir_before_detail_page_more_info');
|
|
| 1164 | - if ($geodir_post_detail_fields = geodir_show_listing_info()) {
|
|
| 1165 | - echo $geodir_post_detail_fields; |
|
| 1166 | - } |
|
| 1167 | - /** |
|
| 1168 | - * This is called after the info section html. |
|
| 1169 | - * |
|
| 1170 | - * @since 1.0.0 |
|
| 1171 | - */ |
|
| 1172 | - do_action('geodir_after_detail_page_more_info');
|
|
| 1173 | - |
|
| 1174 | - $content_html = ob_get_clean(); |
|
| 1175 | - if (trim($content_html) != '') |
|
| 1176 | - $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">' . $content_html . '</div>'; |
|
| 1177 | - if ((int)get_option('geodir_disable_listing_info_section') != 1) {
|
|
| 1178 | - /** |
|
| 1179 | - * Filter the output html for function geodir_detail_page_more_info(). |
|
| 1180 | - * |
|
| 1181 | - * @since 1.0.0 |
|
| 1182 | - * @param string $content_html The output html of the geodir_detail_page_more_info() function. |
|
| 1183 | - */ |
|
| 1184 | - echo $content_html = apply_filters('geodir_detail_page_more_info_html', $content_html);
|
|
| 1185 | - } |
|
| 1157 | + ob_start(); // Start buffering; |
|
| 1158 | + /** |
|
| 1159 | + * This is called before the info section html. |
|
| 1160 | + * |
|
| 1161 | + * @since 1.0.0 |
|
| 1162 | + */ |
|
| 1163 | + do_action('geodir_before_detail_page_more_info');
|
|
| 1164 | + if ($geodir_post_detail_fields = geodir_show_listing_info()) {
|
|
| 1165 | + echo $geodir_post_detail_fields; |
|
| 1166 | + } |
|
| 1167 | + /** |
|
| 1168 | + * This is called after the info section html. |
|
| 1169 | + * |
|
| 1170 | + * @since 1.0.0 |
|
| 1171 | + */ |
|
| 1172 | + do_action('geodir_after_detail_page_more_info');
|
|
| 1173 | + |
|
| 1174 | + $content_html = ob_get_clean(); |
|
| 1175 | + if (trim($content_html) != '') |
|
| 1176 | + $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">' . $content_html . '</div>'; |
|
| 1177 | + if ((int)get_option('geodir_disable_listing_info_section') != 1) {
|
|
| 1178 | + /** |
|
| 1179 | + * Filter the output html for function geodir_detail_page_more_info(). |
|
| 1180 | + * |
|
| 1181 | + * @since 1.0.0 |
|
| 1182 | + * @param string $content_html The output html of the geodir_detail_page_more_info() function. |
|
| 1183 | + */ |
|
| 1184 | + echo $content_html = apply_filters('geodir_detail_page_more_info_html', $content_html);
|
|
| 1185 | + } |
|
| 1186 | 1186 | } |
| 1187 | 1187 | |
| 1188 | 1188 | |
@@ -1196,15 +1196,15 @@ discard block |
||
| 1196 | 1196 | */ |
| 1197 | 1197 | function geodir_localize_all_js_msg() |
| 1198 | 1198 | {// check_ajax_referer function is used to make sure no files are uplaoded remotly but it will fail if used between https and non https so we do the check below of the urls
|
| 1199 | - if (str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
|
|
| 1200 | - $ajax_url = admin_url('admin-ajax.php');
|
|
| 1201 | - } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
|
|
| 1202 | - $ajax_url = admin_url('admin-ajax.php');
|
|
| 1203 | - } elseif (str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
|
|
| 1204 | - $ajax_url = str_replace("https", "http", admin_url('admin-ajax.php'));
|
|
| 1205 | - } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
|
|
| 1206 | - $ajax_url = str_replace("http", "https", admin_url('admin-ajax.php'));
|
|
| 1207 | - } |
|
| 1199 | + if (str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
|
|
| 1200 | + $ajax_url = admin_url('admin-ajax.php');
|
|
| 1201 | + } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
|
|
| 1202 | + $ajax_url = admin_url('admin-ajax.php');
|
|
| 1203 | + } elseif (str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
|
|
| 1204 | + $ajax_url = str_replace("https", "http", admin_url('admin-ajax.php'));
|
|
| 1205 | + } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
|
|
| 1206 | + $ajax_url = str_replace("http", "https", admin_url('admin-ajax.php'));
|
|
| 1207 | + } |
|
| 1208 | 1208 | |
| 1209 | 1209 | /** |
| 1210 | 1210 | * Filter the allowed image type extensions for post images. |
@@ -1214,52 +1214,52 @@ discard block |
||
| 1214 | 1214 | */ |
| 1215 | 1215 | $allowed_img_types = apply_filters('geodir_allowed_post_image_exts', array('jpg', 'jpeg', 'jpe', 'gif', 'png'));
|
| 1216 | 1216 | |
| 1217 | - $arr_alert_msg = array( |
|
| 1218 | - 'geodir_plugin_url' => geodir_plugin_url(), |
|
| 1219 | - 'geodir_admin_ajax_url' => $ajax_url, |
|
| 1220 | - 'custom_field_not_blank_var' => __('HTML Variable Name must not be blank', 'geodirectory'),
|
|
| 1221 | - 'custom_field_not_special_char' => __('Please do not use special character and spaces in HTML Variable Name.', 'geodirectory'),
|
|
| 1222 | - 'custom_field_unique_name' => __('HTML Variable Name should be a unique name.', 'geodirectory'),
|
|
| 1223 | - 'custom_field_delete' => __('Are you wish to delete this field?', 'geodirectory'),
|
|
| 1224 | - //start not show alert msg |
|
| 1225 | - 'tax_meta_class_succ_del_msg' => __('File has been successfully deleted.', 'geodirectory'),
|
|
| 1226 | - 'tax_meta_class_not_permission_to_del_msg' => __('You do NOT have permission to delete this file.', 'geodirectory'),
|
|
| 1227 | - 'tax_meta_class_order_save_msg' => __('Order saved!', 'geodirectory'),
|
|
| 1228 | - 'tax_meta_class_not_permission_record_img_msg' => __('You do not have permission to reorder images.', 'geodirectory'),
|
|
| 1229 | - 'address_not_found_on_map_msg' => __('Address not found for:', 'geodirectory'),
|
|
| 1230 | - // end not show alert msg |
|
| 1231 | - 'my_place_listing_del' => __('Are you wish to delete this listing?', 'geodirectory'),
|
|
| 1232 | - //start not show alert msg |
|
| 1233 | - 'rating_error_msg' => __('Error : please retry', 'geodirectory'),
|
|
| 1234 | - 'listing_url_prefix_msg' => __('Please enter listing url prefix', 'geodirectory'),
|
|
| 1235 | - 'invalid_listing_prefix_msg' => __('Invalid character in listing url prefix', 'geodirectory'),
|
|
| 1236 | - 'location_url_prefix_msg' => __('Please enter location url prefix', 'geodirectory'),
|
|
| 1237 | - 'invalid_location_prefix_msg' => __('Invalid character in location url prefix', 'geodirectory'),
|
|
| 1238 | - 'location_and_cat_url_separator_msg' => __('Please enter location and category url separator', 'geodirectory'),
|
|
| 1239 | - 'invalid_char_and_cat_url_separator_msg' => __('Invalid character in location and category url separator', 'geodirectory'),
|
|
| 1240 | - 'listing_det_url_separator_msg' => __('Please enter listing detail url separator', 'geodirectory'),
|
|
| 1241 | - 'invalid_char_listing_det_url_separator_msg' => __('Invalid character in listing detail url separator', 'geodirectory'),
|
|
| 1242 | - 'loading_listing_error_favorite' => __('Error loading listing.', 'geodirectory'),
|
|
| 1243 | - 'geodir_field_id_required' => __('This field is required.', 'geodirectory'),
|
|
| 1244 | - 'geodir_valid_email_address_msg' => __('Please enter valid email address.', 'geodirectory'),
|
|
| 1245 | - 'geodir_default_marker_icon' => get_option('geodir_default_marker_icon'),
|
|
| 1246 | - 'geodir_latitude_error_msg' => GEODIR_LATITUDE_ERROR_MSG, |
|
| 1247 | - 'geodir_longgitude_error_msg' => GEODIR_LOGNGITUDE_ERROR_MSG, |
|
| 1248 | - 'geodir_default_rating_star_icon' => get_option('geodir_default_rating_star_icon'),
|
|
| 1249 | - 'gd_cmt_btn_post_reply' => __('Post Reply', 'geodirectory'),
|
|
| 1250 | - 'gd_cmt_btn_reply_text' => __('Reply text', 'geodirectory'),
|
|
| 1251 | - 'gd_cmt_btn_post_review' => __('Post Review', 'geodirectory'),
|
|
| 1252 | - 'gd_cmt_btn_review_text' => __('Review text', 'geodirectory'),
|
|
| 1253 | - 'gd_cmt_err_no_rating' => __("Please select star rating, you can't leave a review without stars.", 'geodirectory'),
|
|
| 1254 | - /* on/off dragging for phone devices */ |
|
| 1255 | - 'geodir_onoff_dragging' => get_option('geodir_map_onoff_dragging') ? true : false,
|
|
| 1256 | - 'geodir_is_mobile' => wp_is_mobile() ? true : false, |
|
| 1257 | - 'geodir_on_dragging_text' => __('Enable Dragging', 'geodirectory'),
|
|
| 1258 | - 'geodir_off_dragging_text' => __('Disable Dragging', 'geodirectory'),
|
|
| 1259 | - 'geodir_err_max_file_size' => __('File size error : You tried to upload a file over %s', 'geodirectory'),
|
|
| 1260 | - 'geodir_err_file_upload_limit' => __('You have reached your upload limit of %s files.', 'geodirectory'),
|
|
| 1261 | - 'geodir_err_pkg_upload_limit' => __('You may only upload %s files with this package, please try again.', 'geodirectory'),
|
|
| 1262 | - 'geodir_action_remove' => __('Remove', 'geodirectory'),
|
|
| 1217 | + $arr_alert_msg = array( |
|
| 1218 | + 'geodir_plugin_url' => geodir_plugin_url(), |
|
| 1219 | + 'geodir_admin_ajax_url' => $ajax_url, |
|
| 1220 | + 'custom_field_not_blank_var' => __('HTML Variable Name must not be blank', 'geodirectory'),
|
|
| 1221 | + 'custom_field_not_special_char' => __('Please do not use special character and spaces in HTML Variable Name.', 'geodirectory'),
|
|
| 1222 | + 'custom_field_unique_name' => __('HTML Variable Name should be a unique name.', 'geodirectory'),
|
|
| 1223 | + 'custom_field_delete' => __('Are you wish to delete this field?', 'geodirectory'),
|
|
| 1224 | + //start not show alert msg |
|
| 1225 | + 'tax_meta_class_succ_del_msg' => __('File has been successfully deleted.', 'geodirectory'),
|
|
| 1226 | + 'tax_meta_class_not_permission_to_del_msg' => __('You do NOT have permission to delete this file.', 'geodirectory'),
|
|
| 1227 | + 'tax_meta_class_order_save_msg' => __('Order saved!', 'geodirectory'),
|
|
| 1228 | + 'tax_meta_class_not_permission_record_img_msg' => __('You do not have permission to reorder images.', 'geodirectory'),
|
|
| 1229 | + 'address_not_found_on_map_msg' => __('Address not found for:', 'geodirectory'),
|
|
| 1230 | + // end not show alert msg |
|
| 1231 | + 'my_place_listing_del' => __('Are you wish to delete this listing?', 'geodirectory'),
|
|
| 1232 | + //start not show alert msg |
|
| 1233 | + 'rating_error_msg' => __('Error : please retry', 'geodirectory'),
|
|
| 1234 | + 'listing_url_prefix_msg' => __('Please enter listing url prefix', 'geodirectory'),
|
|
| 1235 | + 'invalid_listing_prefix_msg' => __('Invalid character in listing url prefix', 'geodirectory'),
|
|
| 1236 | + 'location_url_prefix_msg' => __('Please enter location url prefix', 'geodirectory'),
|
|
| 1237 | + 'invalid_location_prefix_msg' => __('Invalid character in location url prefix', 'geodirectory'),
|
|
| 1238 | + 'location_and_cat_url_separator_msg' => __('Please enter location and category url separator', 'geodirectory'),
|
|
| 1239 | + 'invalid_char_and_cat_url_separator_msg' => __('Invalid character in location and category url separator', 'geodirectory'),
|
|
| 1240 | + 'listing_det_url_separator_msg' => __('Please enter listing detail url separator', 'geodirectory'),
|
|
| 1241 | + 'invalid_char_listing_det_url_separator_msg' => __('Invalid character in listing detail url separator', 'geodirectory'),
|
|
| 1242 | + 'loading_listing_error_favorite' => __('Error loading listing.', 'geodirectory'),
|
|
| 1243 | + 'geodir_field_id_required' => __('This field is required.', 'geodirectory'),
|
|
| 1244 | + 'geodir_valid_email_address_msg' => __('Please enter valid email address.', 'geodirectory'),
|
|
| 1245 | + 'geodir_default_marker_icon' => get_option('geodir_default_marker_icon'),
|
|
| 1246 | + 'geodir_latitude_error_msg' => GEODIR_LATITUDE_ERROR_MSG, |
|
| 1247 | + 'geodir_longgitude_error_msg' => GEODIR_LOGNGITUDE_ERROR_MSG, |
|
| 1248 | + 'geodir_default_rating_star_icon' => get_option('geodir_default_rating_star_icon'),
|
|
| 1249 | + 'gd_cmt_btn_post_reply' => __('Post Reply', 'geodirectory'),
|
|
| 1250 | + 'gd_cmt_btn_reply_text' => __('Reply text', 'geodirectory'),
|
|
| 1251 | + 'gd_cmt_btn_post_review' => __('Post Review', 'geodirectory'),
|
|
| 1252 | + 'gd_cmt_btn_review_text' => __('Review text', 'geodirectory'),
|
|
| 1253 | + 'gd_cmt_err_no_rating' => __("Please select star rating, you can't leave a review without stars.", 'geodirectory'),
|
|
| 1254 | + /* on/off dragging for phone devices */ |
|
| 1255 | + 'geodir_onoff_dragging' => get_option('geodir_map_onoff_dragging') ? true : false,
|
|
| 1256 | + 'geodir_is_mobile' => wp_is_mobile() ? true : false, |
|
| 1257 | + 'geodir_on_dragging_text' => __('Enable Dragging', 'geodirectory'),
|
|
| 1258 | + 'geodir_off_dragging_text' => __('Disable Dragging', 'geodirectory'),
|
|
| 1259 | + 'geodir_err_max_file_size' => __('File size error : You tried to upload a file over %s', 'geodirectory'),
|
|
| 1260 | + 'geodir_err_file_upload_limit' => __('You have reached your upload limit of %s files.', 'geodirectory'),
|
|
| 1261 | + 'geodir_err_pkg_upload_limit' => __('You may only upload %s files with this package, please try again.', 'geodirectory'),
|
|
| 1262 | + 'geodir_action_remove' => __('Remove', 'geodirectory'),
|
|
| 1263 | 1263 | 'geodir_txt_all_files' => __('Allowed files', 'geodirectory'),
|
| 1264 | 1264 | 'geodir_err_file_type' => __('File type error. Allowed file types: %s', 'geodirectory'),
|
| 1265 | 1265 | 'gd_allowed_img_types' => !empty($allowed_img_types) ? implode(',', $allowed_img_types) : '',
|
@@ -1267,28 +1267,28 @@ discard block |
||
| 1267 | 1267 | 'geodir_txt_form_searching' => __('Searching...', 'geodirectory'),
|
| 1268 | 1268 | 'fa_rating' => (int)get_option('geodir_reviewrating_enable_font_awesome') == 1 ? 1 : '',
|
| 1269 | 1269 | 'reviewrating' => defined('GEODIRREVIEWRATING_VERSION') ? 1 : '',
|
| 1270 | - ); |
|
| 1271 | - |
|
| 1272 | - /** |
|
| 1273 | - * Filters the translated JS strings from function geodir_localize_all_js_msg(). |
|
| 1274 | - * |
|
| 1275 | - * With this filter you can add, remove or change translated JS strings. |
|
| 1276 | - * You should add your own translations to this if you are building an addon rather than adding another script block. |
|
| 1277 | - * |
|
| 1278 | - * @since 1.0.0 |
|
| 1279 | - */ |
|
| 1280 | - $arr_alert_msg = apply_filters('geodir_all_js_msg', $arr_alert_msg);
|
|
| 1281 | - |
|
| 1282 | - foreach ($arr_alert_msg as $key => $value) {
|
|
| 1283 | - if (!is_scalar($value)) |
|
| 1284 | - continue; |
|
| 1285 | - $arr_alert_msg[$key] = html_entity_decode((string)$value, ENT_QUOTES, 'UTF-8'); |
|
| 1286 | - } |
|
| 1270 | + ); |
|
| 1271 | + |
|
| 1272 | + /** |
|
| 1273 | + * Filters the translated JS strings from function geodir_localize_all_js_msg(). |
|
| 1274 | + * |
|
| 1275 | + * With this filter you can add, remove or change translated JS strings. |
|
| 1276 | + * You should add your own translations to this if you are building an addon rather than adding another script block. |
|
| 1277 | + * |
|
| 1278 | + * @since 1.0.0 |
|
| 1279 | + */ |
|
| 1280 | + $arr_alert_msg = apply_filters('geodir_all_js_msg', $arr_alert_msg);
|
|
| 1287 | 1281 | |
| 1288 | - $script = "var geodir_all_js_msg = " . json_encode($arr_alert_msg) . ';'; |
|
| 1289 | - echo '<script>'; |
|
| 1290 | - echo $script; |
|
| 1291 | - echo '</script>'; |
|
| 1282 | + foreach ($arr_alert_msg as $key => $value) {
|
|
| 1283 | + if (!is_scalar($value)) |
|
| 1284 | + continue; |
|
| 1285 | + $arr_alert_msg[$key] = html_entity_decode((string)$value, ENT_QUOTES, 'UTF-8'); |
|
| 1286 | + } |
|
| 1287 | + |
|
| 1288 | + $script = "var geodir_all_js_msg = " . json_encode($arr_alert_msg) . ';'; |
|
| 1289 | + echo '<script>'; |
|
| 1290 | + echo $script; |
|
| 1291 | + echo '</script>'; |
|
| 1292 | 1292 | } |
| 1293 | 1293 | |
| 1294 | 1294 | add_action('admin_bar_menu', 'geodir_admin_bar_site_menu', 31);
|
@@ -1304,9 +1304,9 @@ discard block |
||
| 1304 | 1304 | */ |
| 1305 | 1305 | function geodir_admin_bar_site_menu($wp_admin_bar) |
| 1306 | 1306 | {
|
| 1307 | - if (get_option("geodir_installed")) {
|
|
| 1308 | - $wp_admin_bar->add_menu(array('parent' => 'appearance', 'id' => 'geodirectory', 'title' => __('GeoDirectory', 'geodirectory'), 'href' => admin_url('?page=geodirectory')));
|
|
| 1309 | - } |
|
| 1307 | + if (get_option("geodir_installed")) {
|
|
| 1308 | + $wp_admin_bar->add_menu(array('parent' => 'appearance', 'id' => 'geodirectory', 'title' => __('GeoDirectory', 'geodirectory'), 'href' => admin_url('?page=geodirectory')));
|
|
| 1309 | + } |
|
| 1310 | 1310 | } |
| 1311 | 1311 | |
| 1312 | 1312 | add_action('geodir_before_listing', 'geodir_display_sort_options'); /*function in custom_functions.php*/
|
@@ -1332,25 +1332,25 @@ discard block |
||
| 1332 | 1332 | */ |
| 1333 | 1333 | function geodir_store_sidebars() |
| 1334 | 1334 | {
|
| 1335 | - global $geodir_sidebars; |
|
| 1336 | - global $sidebars_widgets; |
|
| 1337 | - |
|
| 1338 | - if (!is_array($sidebars_widgets)) |
|
| 1339 | - $sidebars_widgets = wp_get_sidebars_widgets(); |
|
| 1340 | - $geodir_old_sidebars = array(); |
|
| 1341 | - |
|
| 1342 | - if (is_array($geodir_sidebars)) {
|
|
| 1343 | - foreach ($geodir_sidebars as $val) {
|
|
| 1344 | - if (is_array($sidebars_widgets)) {
|
|
| 1345 | - if (array_key_exists($val, $sidebars_widgets)) |
|
| 1346 | - $geodir_old_sidebars[$val] = $sidebars_widgets[$val]; |
|
| 1347 | - else |
|
| 1348 | - $geodir_old_sidebars[$val] = array(); |
|
| 1349 | - } |
|
| 1350 | - } |
|
| 1351 | - } |
|
| 1352 | - update_option('geodir_sidebars', $geodir_old_sidebars);
|
|
| 1353 | - geodir_option_version_backup('geodir_sidebars');
|
|
| 1335 | + global $geodir_sidebars; |
|
| 1336 | + global $sidebars_widgets; |
|
| 1337 | + |
|
| 1338 | + if (!is_array($sidebars_widgets)) |
|
| 1339 | + $sidebars_widgets = wp_get_sidebars_widgets(); |
|
| 1340 | + $geodir_old_sidebars = array(); |
|
| 1341 | + |
|
| 1342 | + if (is_array($geodir_sidebars)) {
|
|
| 1343 | + foreach ($geodir_sidebars as $val) {
|
|
| 1344 | + if (is_array($sidebars_widgets)) {
|
|
| 1345 | + if (array_key_exists($val, $sidebars_widgets)) |
|
| 1346 | + $geodir_old_sidebars[$val] = $sidebars_widgets[$val]; |
|
| 1347 | + else |
|
| 1348 | + $geodir_old_sidebars[$val] = array(); |
|
| 1349 | + } |
|
| 1350 | + } |
|
| 1351 | + } |
|
| 1352 | + update_option('geodir_sidebars', $geodir_old_sidebars);
|
|
| 1353 | + geodir_option_version_backup('geodir_sidebars');
|
|
| 1354 | 1354 | |
| 1355 | 1355 | } |
| 1356 | 1356 | |
@@ -1364,34 +1364,34 @@ discard block |
||
| 1364 | 1364 | */ |
| 1365 | 1365 | function geodir_restore_sidebars() |
| 1366 | 1366 | {
|
| 1367 | - global $sidebars_widgets; |
|
| 1368 | - |
|
| 1369 | - if (!is_array($sidebars_widgets)) |
|
| 1370 | - $sidebars_widgets = wp_get_sidebars_widgets(); |
|
| 1371 | - |
|
| 1372 | - if (is_array($sidebars_widgets)) {
|
|
| 1373 | - $geodir_old_sidebars = get_option('geodir_sidebars');
|
|
| 1374 | - if (is_array($geodir_old_sidebars)) {
|
|
| 1375 | - foreach ($geodir_old_sidebars as $key => $val) {
|
|
| 1376 | - //if(array_key_exists($key, $sidebars_widgets)) |
|
| 1377 | - {
|
|
| 1378 | - $sidebars_widgets[$key] = $geodir_old_sidebars[$key]; |
|
| 1379 | - } |
|
| 1367 | + global $sidebars_widgets; |
|
| 1380 | 1368 | |
| 1369 | + if (!is_array($sidebars_widgets)) |
|
| 1370 | + $sidebars_widgets = wp_get_sidebars_widgets(); |
|
| 1381 | 1371 | |
| 1382 | - } |
|
| 1383 | - } |
|
| 1372 | + if (is_array($sidebars_widgets)) {
|
|
| 1373 | + $geodir_old_sidebars = get_option('geodir_sidebars');
|
|
| 1374 | + if (is_array($geodir_old_sidebars)) {
|
|
| 1375 | + foreach ($geodir_old_sidebars as $key => $val) {
|
|
| 1376 | + //if(array_key_exists($key, $sidebars_widgets)) |
|
| 1377 | + {
|
|
| 1378 | + $sidebars_widgets[$key] = $geodir_old_sidebars[$key]; |
|
| 1379 | + } |
|
| 1384 | 1380 | |
| 1385 | - // now clear all non geodiretory sidebars |
|
| 1386 | - foreach ($sidebars_widgets as $key => $val) {
|
|
| 1387 | - if (!array_key_exists($key, $geodir_old_sidebars)) {
|
|
| 1388 | - $sidebars_widgets[$key] = array(); |
|
| 1389 | - } |
|
| 1390 | - } |
|
| 1391 | - } |
|
| 1392 | 1381 | |
| 1393 | - update_option('sidebars_widgets', $sidebars_widgets);
|
|
| 1394 | - update_option('geodir_sidebars', '');
|
|
| 1382 | + } |
|
| 1383 | + } |
|
| 1384 | + |
|
| 1385 | + // now clear all non geodiretory sidebars |
|
| 1386 | + foreach ($sidebars_widgets as $key => $val) {
|
|
| 1387 | + if (!array_key_exists($key, $geodir_old_sidebars)) {
|
|
| 1388 | + $sidebars_widgets[$key] = array(); |
|
| 1389 | + } |
|
| 1390 | + } |
|
| 1391 | + } |
|
| 1392 | + |
|
| 1393 | + update_option('sidebars_widgets', $sidebars_widgets);
|
|
| 1394 | + update_option('geodir_sidebars', '');
|
|
| 1395 | 1395 | } |
| 1396 | 1396 | |
| 1397 | 1397 | add_action('geodir_after_listing_post_gridview', 'geodir_after_listing_post_gridview');
|
@@ -1404,9 +1404,9 @@ discard block |
||
| 1404 | 1404 | */ |
| 1405 | 1405 | function geodir_after_listing_post_gridview() |
| 1406 | 1406 | {
|
| 1407 | - global $gridview_columns; |
|
| 1407 | + global $gridview_columns; |
|
| 1408 | 1408 | |
| 1409 | - $gridview_columns = ''; |
|
| 1409 | + $gridview_columns = ''; |
|
| 1410 | 1410 | |
| 1411 | 1411 | } |
| 1412 | 1412 | |
@@ -1434,11 +1434,11 @@ discard block |
||
| 1434 | 1434 | */ |
| 1435 | 1435 | function so_handle_038($url, $original_url, $_context) |
| 1436 | 1436 | {
|
| 1437 | - if (strstr($url, "maps.google.com/maps/api/js") !== false) {
|
|
| 1438 | - $url = str_replace("&", "&", $url); // or $url = $original_url
|
|
| 1439 | - } |
|
| 1437 | + if (strstr($url, "maps.google.com/maps/api/js") !== false) {
|
|
| 1438 | + $url = str_replace("&", "&", $url); // or $url = $original_url
|
|
| 1439 | + } |
|
| 1440 | 1440 | |
| 1441 | - return $url; |
|
| 1441 | + return $url; |
|
| 1442 | 1442 | } |
| 1443 | 1443 | |
| 1444 | 1444 | |
@@ -1454,34 +1454,34 @@ discard block |
||
| 1454 | 1454 | function geodir_after_main_form_fields() {
|
| 1455 | 1455 | global $gd_session; |
| 1456 | 1456 | |
| 1457 | - if (get_option('geodir_accept_term_condition')) {
|
|
| 1458 | - global $post; |
|
| 1459 | - $term_condition = ''; |
|
| 1460 | - if (isset($_REQUEST['backandedit'])) {
|
|
| 1461 | - $post = (object)$gd_session->get('listing');
|
|
| 1462 | - $term_condition = isset($post->geodir_accept_term_condition) ? $post->geodir_accept_term_condition : ''; |
|
| 1463 | - } |
|
| 1464 | - |
|
| 1465 | - ?> |
|
| 1457 | + if (get_option('geodir_accept_term_condition')) {
|
|
| 1458 | + global $post; |
|
| 1459 | + $term_condition = ''; |
|
| 1460 | + if (isset($_REQUEST['backandedit'])) {
|
|
| 1461 | + $post = (object)$gd_session->get('listing');
|
|
| 1462 | + $term_condition = isset($post->geodir_accept_term_condition) ? $post->geodir_accept_term_condition : ''; |
|
| 1463 | + } |
|
| 1464 | + |
|
| 1465 | + ?> |
|
| 1466 | 1466 | <div id="geodir_accept_term_condition_row" class="required_field geodir_form_row clearfix"> |
| 1467 | 1467 | <label> </label> |
| 1468 | 1468 | |
| 1469 | 1469 | <div class="geodir_taxonomy_field" style="float:left; width:70%;"> |
| 1470 | 1470 | <span style="display:block"> |
| 1471 | 1471 | <input class="main_list_selecter" type="checkbox" <?php if ($term_condition == '1') {
|
| 1472 | - echo 'checked="checked"'; |
|
| 1473 | - } ?> field_type="checkbox" name="geodir_accept_term_condition" id="geodir_accept_term_condition" |
|
| 1472 | + echo 'checked="checked"'; |
|
| 1473 | + } ?> field_type="checkbox" name="geodir_accept_term_condition" id="geodir_accept_term_condition" |
|
| 1474 | 1474 | class="geodir_textfield" value="1" |
| 1475 | 1475 | style="display:inline-block"/><a href="<?php $terms_page = get_option('geodir_term_condition_page'); if($terms_page){ echo get_permalink($terms_page);}?>" target="_blank"><?php _e('Please accept our terms and conditions', 'geodirectory'); ?></a>
|
| 1476 | 1476 | </span> |
| 1477 | 1477 | </div> |
| 1478 | 1478 | <span class="geodir_message_error"><?php if (isset($required_msg)) {
|
| 1479 | - _e($required_msg, 'geodirectory'); |
|
| 1480 | - } ?></span> |
|
| 1479 | + _e($required_msg, 'geodirectory'); |
|
| 1480 | + } ?></span> |
|
| 1481 | 1481 | </div> |
| 1482 | 1482 | <?php |
| 1483 | 1483 | |
| 1484 | - } |
|
| 1484 | + } |
|
| 1485 | 1485 | } |
| 1486 | 1486 | |
| 1487 | 1487 | |
@@ -1506,42 +1506,42 @@ discard block |
||
| 1506 | 1506 | */ |
| 1507 | 1507 | function geodir_detail_page_tab_is_display($is_display, $tab) |
| 1508 | 1508 | {
|
| 1509 | - global $post, $post_images, $video, $special_offers, $related_listing, $geodir_post_detail_fields; |
|
| 1509 | + global $post, $post_images, $video, $special_offers, $related_listing, $geodir_post_detail_fields; |
|
| 1510 | 1510 | |
| 1511 | - if ($tab == 'post_profile') {
|
|
| 1512 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 1513 | - $desc_limit = apply_filters('geodir_description_field_desc_limit', '');
|
|
| 1511 | + if ($tab == 'post_profile') {
|
|
| 1512 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 1513 | + $desc_limit = apply_filters('geodir_description_field_desc_limit', '');
|
|
| 1514 | 1514 | |
| 1515 | - if (!($desc_limit === '' || (int)$desc_limit > 0)) {
|
|
| 1516 | - $is_display = false; |
|
| 1517 | - } |
|
| 1518 | - } |
|
| 1515 | + if (!($desc_limit === '' || (int)$desc_limit > 0)) {
|
|
| 1516 | + $is_display = false; |
|
| 1517 | + } |
|
| 1518 | + } |
|
| 1519 | 1519 | |
| 1520 | - if ($tab == 'post_info') |
|
| 1521 | - $is_display = (!empty($geodir_post_detail_fields)) ? true : false; |
|
| 1520 | + if ($tab == 'post_info') |
|
| 1521 | + $is_display = (!empty($geodir_post_detail_fields)) ? true : false; |
|
| 1522 | 1522 | |
| 1523 | - if ($tab == 'post_images') |
|
| 1524 | - $is_display = (!empty($post_images)) ? true : false; |
|
| 1523 | + if ($tab == 'post_images') |
|
| 1524 | + $is_display = (!empty($post_images)) ? true : false; |
|
| 1525 | 1525 | |
| 1526 | - if ($tab == 'post_video') |
|
| 1527 | - $is_display = (!empty($video)) ? true : false; |
|
| 1526 | + if ($tab == 'post_video') |
|
| 1527 | + $is_display = (!empty($video)) ? true : false; |
|
| 1528 | 1528 | |
| 1529 | - if ($tab == 'special_offers') |
|
| 1530 | - $is_display = (!empty($special_offers)) ? true : false; |
|
| 1529 | + if ($tab == 'special_offers') |
|
| 1530 | + $is_display = (!empty($special_offers)) ? true : false; |
|
| 1531 | 1531 | |
| 1532 | - if ($tab == 'reviews') |
|
| 1533 | - $is_display = (geodir_is_page('detail')) ? true : false;
|
|
| 1532 | + if ($tab == 'reviews') |
|
| 1533 | + $is_display = (geodir_is_page('detail')) ? true : false;
|
|
| 1534 | 1534 | |
| 1535 | - if ($tab == 'related_listing') {
|
|
| 1536 | - $message = __('No listings found which match your selection.', 'geodirectory');
|
|
| 1535 | + if ($tab == 'related_listing') {
|
|
| 1536 | + $message = __('No listings found which match your selection.', 'geodirectory');
|
|
| 1537 | 1537 | |
| 1538 | - /** This action is documented in geodirectory-functions/template_functions.php */ |
|
| 1539 | - $message = apply_filters('geodir_message_listing_not_found', $message, 'listing-listview', false);
|
|
| 1538 | + /** This action is documented in geodirectory-functions/template_functions.php */ |
|
| 1539 | + $message = apply_filters('geodir_message_listing_not_found', $message, 'listing-listview', false);
|
|
| 1540 | 1540 | |
| 1541 | - $is_display = ((strpos($related_listing, $message) !== false || $related_listing == '' || !geodir_is_page('detail'))) ? false : true;
|
|
| 1542 | - } |
|
| 1541 | + $is_display = ((strpos($related_listing, $message) !== false || $related_listing == '' || !geodir_is_page('detail'))) ? false : true;
|
|
| 1542 | + } |
|
| 1543 | 1543 | |
| 1544 | - return $is_display; |
|
| 1544 | + return $is_display; |
|
| 1545 | 1545 | } |
| 1546 | 1546 | |
| 1547 | 1547 | |
@@ -1560,14 +1560,14 @@ discard block |
||
| 1560 | 1560 | */ |
| 1561 | 1561 | function geodir_after_core_plugin_row($plugin_file, $plugin_data, $status) |
| 1562 | 1562 | {
|
| 1563 | - //echo $plugin_file . " " . $plugin_data . " " . $status ; |
|
| 1564 | - if (is_plugin_active($plugin_file)) {
|
|
| 1565 | - $wp_list_table = _get_list_table('WP_Plugins_List_Table');
|
|
| 1563 | + //echo $plugin_file . " " . $plugin_data . " " . $status ; |
|
| 1564 | + if (is_plugin_active($plugin_file)) {
|
|
| 1565 | + $wp_list_table = _get_list_table('WP_Plugins_List_Table');
|
|
| 1566 | 1566 | |
| 1567 | - echo '<tr class="plugin-update-tr active update"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange"><div class="geodir-plugin-row-warning">'; |
|
| 1568 | - _e('Deactivate all GeoDirectory dependent add-ons first before deactivating GeoDirectory.', 'geodirectory');
|
|
| 1569 | - echo '</div></td></tr>'; |
|
| 1570 | - } |
|
| 1567 | + echo '<tr class="plugin-update-tr active update"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange"><div class="geodir-plugin-row-warning">'; |
|
| 1568 | + _e('Deactivate all GeoDirectory dependent add-ons first before deactivating GeoDirectory.', 'geodirectory');
|
|
| 1569 | + echo '</div></td></tr>'; |
|
| 1570 | + } |
|
| 1571 | 1571 | } |
| 1572 | 1572 | |
| 1573 | 1573 | |
@@ -1583,17 +1583,17 @@ discard block |
||
| 1583 | 1583 | * @global string $plugin_prefix Geodirectory plugin table prefix. |
| 1584 | 1584 | */ |
| 1585 | 1585 | function geodir_changes_in_custom_fields_table() {
|
| 1586 | - global $wpdb, $plugin_prefix; |
|
| 1586 | + global $wpdb, $plugin_prefix; |
|
| 1587 | 1587 | |
| 1588 | 1588 | // Remove unused virtual page |
| 1589 | 1589 | $listings_page_id = (int)get_option('geodir_listing_page');
|
| 1590 | 1590 | if ($listings_page_id) {
|
| 1591 | 1591 | $wpdb->query($wpdb->prepare("DELETE FROM " . $wpdb->posts . " WHERE ID=%d AND post_name = %s AND post_type=%s", array($listings_page_id, 'listings', 'page')));
|
| 1592 | - delete_option('geodir_listing_page');
|
|
| 1592 | + delete_option('geodir_listing_page');
|
|
| 1593 | 1593 | } |
| 1594 | 1594 | |
| 1595 | - // updated custom field table(add field to show custom field as a tab) |
|
| 1596 | - /*if (!$wpdb->get_var("SHOW COLUMNS FROM ".GEODIR_CUSTOM_FIELDS_TABLE." WHERE field = 'show_as_tab'")) {
|
|
| 1595 | + // updated custom field table(add field to show custom field as a tab) |
|
| 1596 | + /*if (!$wpdb->get_var("SHOW COLUMNS FROM ".GEODIR_CUSTOM_FIELDS_TABLE." WHERE field = 'show_as_tab'")) {
|
|
| 1597 | 1597 | $wpdb->query("ALTER TABLE `".GEODIR_CUSTOM_FIELDS_TABLE."` ADD `show_as_tab` ENUM( '0', '1' ) NOT NULL DEFAULT '0' AFTER `show_on_detail`");
|
| 1598 | 1598 | } |
| 1599 | 1599 | |
@@ -1601,66 +1601,66 @@ discard block |
||
| 1601 | 1601 | $wpdb->query("ALTER TABLE `".GEODIR_CUSTOM_FIELDS_TABLE."` ADD `for_admin_use` ENUM( '0', '1' ) NOT NULL DEFAULT '0'");
|
| 1602 | 1602 | }*/ |
| 1603 | 1603 | |
| 1604 | - if (!get_option('geodir_changes_in_custom_fields_table')) {
|
|
| 1604 | + if (!get_option('geodir_changes_in_custom_fields_table')) {
|
|
| 1605 | 1605 | |
| 1606 | - $post_types = geodir_get_posttypes(); |
|
| 1606 | + $post_types = geodir_get_posttypes(); |
|
| 1607 | 1607 | |
| 1608 | - /*if(!$wpdb->get_var("SHOW COLUMNS FROM ".GEODIR_CUSTOM_FIELDS_TABLE." WHERE field = 'is_admin'"))
|
|
| 1608 | + /*if(!$wpdb->get_var("SHOW COLUMNS FROM ".GEODIR_CUSTOM_FIELDS_TABLE." WHERE field = 'is_admin'"))
|
|
| 1609 | 1609 | $wpdb->query("ALTER TABLE `".GEODIR_CUSTOM_FIELDS_TABLE."` ADD `is_admin` ENUM( '0', '1' ) NOT NULL DEFAULT '0' AFTER `is_default`");*/
|
| 1610 | 1610 | |
| 1611 | - $wpdb->query( |
|
| 1612 | - $wpdb->prepare( |
|
| 1613 | - "UPDATE " . GEODIR_CUSTOM_FIELDS_TABLE . " SET is_default=%s, is_admin=%s WHERE is_default=%s", |
|
| 1614 | - array('1', '1', 'admin')
|
|
| 1615 | - ) |
|
| 1616 | - ); |
|
| 1611 | + $wpdb->query( |
|
| 1612 | + $wpdb->prepare( |
|
| 1613 | + "UPDATE " . GEODIR_CUSTOM_FIELDS_TABLE . " SET is_default=%s, is_admin=%s WHERE is_default=%s", |
|
| 1614 | + array('1', '1', 'admin')
|
|
| 1615 | + ) |
|
| 1616 | + ); |
|
| 1617 | 1617 | |
| 1618 | 1618 | |
| 1619 | - /* --- terms meta value set --- */ |
|
| 1619 | + /* --- terms meta value set --- */ |
|
| 1620 | 1620 | |
| 1621 | - update_option('geodir_default_marker_icon', geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png');
|
|
| 1621 | + update_option('geodir_default_marker_icon', geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png');
|
|
| 1622 | 1622 | |
| 1623 | - $options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "options WHERE option_name LIKE %s", array('%tax_meta_%')));
|
|
| 1623 | + $options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "options WHERE option_name LIKE %s", array('%tax_meta_%')));
|
|
| 1624 | 1624 | |
| 1625 | - if (!empty($options_data)) {
|
|
| 1625 | + if (!empty($options_data)) {
|
|
| 1626 | 1626 | |
| 1627 | - foreach ($options_data as $optobj) {
|
|
| 1627 | + foreach ($options_data as $optobj) {
|
|
| 1628 | 1628 | |
| 1629 | - $option_val = str_replace('tax_meta_', '', $optobj->option_name);
|
|
| 1629 | + $option_val = str_replace('tax_meta_', '', $optobj->option_name);
|
|
| 1630 | 1630 | |
| 1631 | - $taxonomies_data = $wpdb->get_results($wpdb->prepare("SELECT taxonomy FROM " . $wpdb->prefix . "term_taxonomy WHERE taxonomy LIKE %s AND term_id=%d", array('%category%', $option_val)));
|
|
| 1631 | + $taxonomies_data = $wpdb->get_results($wpdb->prepare("SELECT taxonomy FROM " . $wpdb->prefix . "term_taxonomy WHERE taxonomy LIKE %s AND term_id=%d", array('%category%', $option_val)));
|
|
| 1632 | 1632 | |
| 1633 | - if (!empty($taxonomies_data)) {
|
|
| 1633 | + if (!empty($taxonomies_data)) {
|
|
| 1634 | 1634 | |
| 1635 | - foreach ($taxonomies_data as $taxobj) {
|
|
| 1635 | + foreach ($taxonomies_data as $taxobj) {
|
|
| 1636 | 1636 | |
| 1637 | - $taxObject = get_taxonomy($taxobj->taxonomy); |
|
| 1638 | - $post_type = $taxObject->object_type[0]; |
|
| 1637 | + $taxObject = get_taxonomy($taxobj->taxonomy); |
|
| 1638 | + $post_type = $taxObject->object_type[0]; |
|
| 1639 | 1639 | |
| 1640 | - $opt_value = 'tax_meta_' . $post_type . '_' . $option_val; |
|
| 1640 | + $opt_value = 'tax_meta_' . $post_type . '_' . $option_val; |
|
| 1641 | 1641 | |
| 1642 | - $duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM " . $wpdb->prefix . "options WHERE option_name=%s", array('tax_meta_' . $option_val)));
|
|
| 1642 | + $duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM " . $wpdb->prefix . "options WHERE option_name=%s", array('tax_meta_' . $option_val)));
|
|
| 1643 | 1643 | |
| 1644 | - if ($duplicate_data) {
|
|
| 1644 | + if ($duplicate_data) {
|
|
| 1645 | 1645 | |
| 1646 | - $wpdb->query($wpdb->prepare("UPDATE " . $wpdb->prefix . "options SET option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id)));
|
|
| 1646 | + $wpdb->query($wpdb->prepare("UPDATE " . $wpdb->prefix . "options SET option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id)));
|
|
| 1647 | 1647 | |
| 1648 | - } else {
|
|
| 1648 | + } else {
|
|
| 1649 | 1649 | |
| 1650 | - $wpdb->query($wpdb->prepare("INSERT INTO " . $wpdb->prefix . "options (option_name,option_value,autoload) VALUES (%s, %s, %s)", array($opt_value, $optobj->option_value, $optobj->autoload)));
|
|
| 1650 | + $wpdb->query($wpdb->prepare("INSERT INTO " . $wpdb->prefix . "options (option_name,option_value,autoload) VALUES (%s, %s, %s)", array($opt_value, $optobj->option_value, $optobj->autoload)));
|
|
| 1651 | 1651 | |
| 1652 | - } |
|
| 1652 | + } |
|
| 1653 | 1653 | |
| 1654 | - } |
|
| 1654 | + } |
|
| 1655 | 1655 | |
| 1656 | - } |
|
| 1656 | + } |
|
| 1657 | 1657 | |
| 1658 | - } |
|
| 1659 | - } |
|
| 1658 | + } |
|
| 1659 | + } |
|
| 1660 | 1660 | |
| 1661 | - update_option('geodir_changes_in_custom_fields_table', '1');
|
|
| 1661 | + update_option('geodir_changes_in_custom_fields_table', '1');
|
|
| 1662 | 1662 | |
| 1663 | - } |
|
| 1663 | + } |
|
| 1664 | 1664 | |
| 1665 | 1665 | } |
| 1666 | 1666 | |
@@ -1679,24 +1679,24 @@ discard block |
||
| 1679 | 1679 | function geodir_location_slug_check($slug) |
| 1680 | 1680 | {
|
| 1681 | 1681 | |
| 1682 | - global $wpdb, $table_prefix; |
|
| 1682 | + global $wpdb, $table_prefix; |
|
| 1683 | 1683 | |
| 1684 | - $slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($slug)));
|
|
| 1684 | + $slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($slug)));
|
|
| 1685 | 1685 | |
| 1686 | - if ($slug_exists) {
|
|
| 1686 | + if ($slug_exists) {
|
|
| 1687 | 1687 | |
| 1688 | - $suffix = 1; |
|
| 1689 | - do {
|
|
| 1690 | - $alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix"; |
|
| 1691 | - $location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($alt_location_name)));
|
|
| 1692 | - $suffix++; |
|
| 1693 | - } while ($location_slug_check && $suffix < 100); |
|
| 1688 | + $suffix = 1; |
|
| 1689 | + do {
|
|
| 1690 | + $alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix"; |
|
| 1691 | + $location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($alt_location_name)));
|
|
| 1692 | + $suffix++; |
|
| 1693 | + } while ($location_slug_check && $suffix < 100); |
|
| 1694 | 1694 | |
| 1695 | - $slug = $alt_location_name; |
|
| 1695 | + $slug = $alt_location_name; |
|
| 1696 | 1696 | |
| 1697 | - } |
|
| 1697 | + } |
|
| 1698 | 1698 | |
| 1699 | - return $slug; |
|
| 1699 | + return $slug; |
|
| 1700 | 1700 | |
| 1701 | 1701 | } |
| 1702 | 1702 | |
@@ -1721,42 +1721,42 @@ discard block |
||
| 1721 | 1721 | function geodir_update_term_slug($term_id, $tt_id, $taxonomy) |
| 1722 | 1722 | {
|
| 1723 | 1723 | |
| 1724 | - global $wpdb, $plugin_prefix, $table_prefix; |
|
| 1724 | + global $wpdb, $plugin_prefix, $table_prefix; |
|
| 1725 | 1725 | |
| 1726 | - $tern_data = get_term_by('id', $term_id, $taxonomy);
|
|
| 1726 | + $tern_data = get_term_by('id', $term_id, $taxonomy);
|
|
| 1727 | 1727 | |
| 1728 | - $slug = $tern_data->slug; |
|
| 1728 | + $slug = $tern_data->slug; |
|
| 1729 | 1729 | |
| 1730 | - /** |
|
| 1731 | - * Filter if a term slug exists. |
|
| 1732 | - * |
|
| 1733 | - * @since 1.0.0 |
|
| 1734 | - * @package GeoDirectory |
|
| 1735 | - * @param bool $bool Default: false. |
|
| 1736 | - * @param string $slug The term slug. |
|
| 1737 | - * @param int $term_id The term ID. |
|
| 1738 | - */ |
|
| 1739 | - $slug_exists = apply_filters('geodir_term_slug_is_exists', false, $slug, $term_id);
|
|
| 1730 | + /** |
|
| 1731 | + * Filter if a term slug exists. |
|
| 1732 | + * |
|
| 1733 | + * @since 1.0.0 |
|
| 1734 | + * @package GeoDirectory |
|
| 1735 | + * @param bool $bool Default: false. |
|
| 1736 | + * @param string $slug The term slug. |
|
| 1737 | + * @param int $term_id The term ID. |
|
| 1738 | + */ |
|
| 1739 | + $slug_exists = apply_filters('geodir_term_slug_is_exists', false, $slug, $term_id);
|
|
| 1740 | 1740 | |
| 1741 | - if ($slug_exists) {
|
|
| 1741 | + if ($slug_exists) {
|
|
| 1742 | 1742 | |
| 1743 | - $suffix = 1; |
|
| 1744 | - do {
|
|
| 1745 | - $new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix"; |
|
| 1743 | + $suffix = 1; |
|
| 1744 | + do {
|
|
| 1745 | + $new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix"; |
|
| 1746 | 1746 | |
| 1747 | - /** This action is documented in geodirectory_hooks_actions.php */ |
|
| 1748 | - $term_slug_check = apply_filters('geodir_term_slug_is_exists', false, $new_slug, $term_id);
|
|
| 1747 | + /** This action is documented in geodirectory_hooks_actions.php */ |
|
| 1748 | + $term_slug_check = apply_filters('geodir_term_slug_is_exists', false, $new_slug, $term_id);
|
|
| 1749 | 1749 | |
| 1750 | - $suffix++; |
|
| 1751 | - } while ($term_slug_check && $suffix < 100); |
|
| 1750 | + $suffix++; |
|
| 1751 | + } while ($term_slug_check && $suffix < 100); |
|
| 1752 | 1752 | |
| 1753 | - $slug = $new_slug; |
|
| 1753 | + $slug = $new_slug; |
|
| 1754 | 1754 | |
| 1755 | - //wp_update_term( $term_id, $taxonomy, array('slug' => $slug) );
|
|
| 1755 | + //wp_update_term( $term_id, $taxonomy, array('slug' => $slug) );
|
|
| 1756 | 1756 | |
| 1757 | - $wpdb->query($wpdb->prepare("UPDATE " . $table_prefix . "terms SET slug=%s WHERE term_id=%d", array($slug, $term_id)));
|
|
| 1757 | + $wpdb->query($wpdb->prepare("UPDATE " . $table_prefix . "terms SET slug=%s WHERE term_id=%d", array($slug, $term_id)));
|
|
| 1758 | 1758 | |
| 1759 | - } |
|
| 1759 | + } |
|
| 1760 | 1760 | |
| 1761 | 1761 | // Update tag in detail table. |
| 1762 | 1762 | $taxonomy_obj = get_taxonomy($taxonomy); |
@@ -1797,21 +1797,21 @@ discard block |
||
| 1797 | 1797 | function geodir_term_slug_is_exists($slug_exists, $slug, $term_id) |
| 1798 | 1798 | {
|
| 1799 | 1799 | |
| 1800 | - global $wpdb, $table_prefix; |
|
| 1800 | + global $wpdb, $table_prefix; |
|
| 1801 | 1801 | |
| 1802 | - $default_location = geodir_get_default_location(); |
|
| 1802 | + $default_location = geodir_get_default_location(); |
|
| 1803 | 1803 | |
| 1804 | - $country_slug = $default_location->country_slug; |
|
| 1805 | - $region_slug = $default_location->region_slug; |
|
| 1806 | - $city_slug = $default_location->city_slug; |
|
| 1804 | + $country_slug = $default_location->country_slug; |
|
| 1805 | + $region_slug = $default_location->region_slug; |
|
| 1806 | + $city_slug = $default_location->city_slug; |
|
| 1807 | 1807 | |
| 1808 | - if ($country_slug == $slug || $region_slug == $slug || $city_slug == $slug) |
|
| 1809 | - return $slug_exists = true; |
|
| 1808 | + if ($country_slug == $slug || $region_slug == $slug || $city_slug == $slug) |
|
| 1809 | + return $slug_exists = true; |
|
| 1810 | 1810 | |
| 1811 | - if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s AND term_id != %d", array($slug, $term_id))))
|
|
| 1812 | - return $slug_exists = true; |
|
| 1811 | + if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s AND term_id != %d", array($slug, $term_id))))
|
|
| 1812 | + return $slug_exists = true; |
|
| 1813 | 1813 | |
| 1814 | - return $slug_exists; |
|
| 1814 | + return $slug_exists; |
|
| 1815 | 1815 | } |
| 1816 | 1816 | |
| 1817 | 1817 | |
@@ -1830,75 +1830,75 @@ discard block |
||
| 1830 | 1830 | */ |
| 1831 | 1831 | function geodir_custom_page_title($title = '', $sep = '') |
| 1832 | 1832 | {
|
| 1833 | - global $wp; |
|
| 1834 | - if (class_exists('WPSEO_Frontend') || class_exists('All_in_One_SEO_Pack')) {
|
|
| 1835 | - return $title; |
|
| 1836 | - } |
|
| 1833 | + global $wp; |
|
| 1834 | + if (class_exists('WPSEO_Frontend') || class_exists('All_in_One_SEO_Pack')) {
|
|
| 1835 | + return $title; |
|
| 1836 | + } |
|
| 1837 | 1837 | |
| 1838 | - if ($sep == '') {
|
|
| 1839 | - /** |
|
| 1840 | - * Filter the page title separator. |
|
| 1841 | - * |
|
| 1842 | - * @since 1.0.0 |
|
| 1843 | - * @package GeoDirectory |
|
| 1844 | - * @param string $sep The separator, default: `|`. |
|
| 1845 | - */ |
|
| 1846 | - $sep = apply_filters('geodir_page_title_separator', '|');
|
|
| 1847 | - } |
|
| 1838 | + if ($sep == '') {
|
|
| 1839 | + /** |
|
| 1840 | + * Filter the page title separator. |
|
| 1841 | + * |
|
| 1842 | + * @since 1.0.0 |
|
| 1843 | + * @package GeoDirectory |
|
| 1844 | + * @param string $sep The separator, default: `|`. |
|
| 1845 | + */ |
|
| 1846 | + $sep = apply_filters('geodir_page_title_separator', '|');
|
|
| 1847 | + } |
|
| 1848 | 1848 | |
| 1849 | 1849 | |
| 1850 | - $gd_page = ''; |
|
| 1851 | - if(geodir_is_page('home')){
|
|
| 1852 | - $gd_page = 'home'; |
|
| 1853 | - $title = (get_option('geodir_meta_title_homepage')) ? get_option('geodir_meta_title_homepage') : $title;
|
|
| 1854 | - } |
|
| 1855 | - elseif(geodir_is_page('detail')){
|
|
| 1856 | - $gd_page = 'detail'; |
|
| 1857 | - $title = (get_option('geodir_meta_title_detail')) ? get_option('geodir_meta_title_detail') : $title;
|
|
| 1858 | - } |
|
| 1859 | - elseif(geodir_is_page('pt')){
|
|
| 1860 | - $gd_page = 'pt'; |
|
| 1861 | - $title = (get_option('geodir_meta_title_pt')) ? get_option('geodir_meta_title_pt') : $title;
|
|
| 1862 | - } |
|
| 1863 | - elseif(geodir_is_page('listing')){
|
|
| 1864 | - $gd_page = 'listing'; |
|
| 1865 | - $title = (get_option('geodir_meta_title_listing')) ? get_option('geodir_meta_title_listing') : $title;
|
|
| 1866 | - } |
|
| 1867 | - elseif(geodir_is_page('location')){
|
|
| 1868 | - $gd_page = 'location'; |
|
| 1869 | - $title = (get_option('geodir_meta_title_location')) ? get_option('geodir_meta_title_location') : $title;
|
|
| 1870 | - } |
|
| 1871 | - elseif(geodir_is_page('search')){
|
|
| 1872 | - $gd_page = 'search'; |
|
| 1873 | - $title = (get_option('geodir_meta_title_search')) ? get_option('geodir_meta_title_search') : $title;
|
|
| 1874 | - } |
|
| 1875 | - elseif(geodir_is_page('add-listing')){
|
|
| 1876 | - $gd_page = 'add-listing'; |
|
| 1877 | - $title = (get_option('geodir_meta_title_add-listing')) ? get_option('geodir_meta_title_add-listing') : $title;
|
|
| 1878 | - } |
|
| 1879 | - elseif(geodir_is_page('author')){
|
|
| 1880 | - $gd_page = 'author'; |
|
| 1881 | - $title = (get_option('geodir_meta_title_author')) ? get_option('geodir_meta_title_author') : $title;
|
|
| 1882 | - } |
|
| 1883 | - elseif(geodir_is_page('login')){
|
|
| 1884 | - $gd_page = 'login'; |
|
| 1885 | - $title = (get_option('geodir_meta_title_login')) ? get_option('geodir_meta_title_login') : $title;
|
|
| 1886 | - } |
|
| 1887 | - elseif(geodir_is_page('listing-success')){
|
|
| 1888 | - $gd_page = 'listing-success'; |
|
| 1889 | - $title = (get_option('geodir_meta_title_listing-success')) ? get_option('geodir_meta_title_listing-success') : $title;
|
|
| 1890 | - } |
|
| 1850 | + $gd_page = ''; |
|
| 1851 | + if(geodir_is_page('home')){
|
|
| 1852 | + $gd_page = 'home'; |
|
| 1853 | + $title = (get_option('geodir_meta_title_homepage')) ? get_option('geodir_meta_title_homepage') : $title;
|
|
| 1854 | + } |
|
| 1855 | + elseif(geodir_is_page('detail')){
|
|
| 1856 | + $gd_page = 'detail'; |
|
| 1857 | + $title = (get_option('geodir_meta_title_detail')) ? get_option('geodir_meta_title_detail') : $title;
|
|
| 1858 | + } |
|
| 1859 | + elseif(geodir_is_page('pt')){
|
|
| 1860 | + $gd_page = 'pt'; |
|
| 1861 | + $title = (get_option('geodir_meta_title_pt')) ? get_option('geodir_meta_title_pt') : $title;
|
|
| 1862 | + } |
|
| 1863 | + elseif(geodir_is_page('listing')){
|
|
| 1864 | + $gd_page = 'listing'; |
|
| 1865 | + $title = (get_option('geodir_meta_title_listing')) ? get_option('geodir_meta_title_listing') : $title;
|
|
| 1866 | + } |
|
| 1867 | + elseif(geodir_is_page('location')){
|
|
| 1868 | + $gd_page = 'location'; |
|
| 1869 | + $title = (get_option('geodir_meta_title_location')) ? get_option('geodir_meta_title_location') : $title;
|
|
| 1870 | + } |
|
| 1871 | + elseif(geodir_is_page('search')){
|
|
| 1872 | + $gd_page = 'search'; |
|
| 1873 | + $title = (get_option('geodir_meta_title_search')) ? get_option('geodir_meta_title_search') : $title;
|
|
| 1874 | + } |
|
| 1875 | + elseif(geodir_is_page('add-listing')){
|
|
| 1876 | + $gd_page = 'add-listing'; |
|
| 1877 | + $title = (get_option('geodir_meta_title_add-listing')) ? get_option('geodir_meta_title_add-listing') : $title;
|
|
| 1878 | + } |
|
| 1879 | + elseif(geodir_is_page('author')){
|
|
| 1880 | + $gd_page = 'author'; |
|
| 1881 | + $title = (get_option('geodir_meta_title_author')) ? get_option('geodir_meta_title_author') : $title;
|
|
| 1882 | + } |
|
| 1883 | + elseif(geodir_is_page('login')){
|
|
| 1884 | + $gd_page = 'login'; |
|
| 1885 | + $title = (get_option('geodir_meta_title_login')) ? get_option('geodir_meta_title_login') : $title;
|
|
| 1886 | + } |
|
| 1887 | + elseif(geodir_is_page('listing-success')){
|
|
| 1888 | + $gd_page = 'listing-success'; |
|
| 1889 | + $title = (get_option('geodir_meta_title_listing-success')) ? get_option('geodir_meta_title_listing-success') : $title;
|
|
| 1890 | + } |
|
| 1891 | 1891 | |
| 1892 | 1892 | |
| 1893 | - /** |
|
| 1894 | - * Filter page meta title to replace variables. |
|
| 1895 | - * |
|
| 1896 | - * @since 1.5.4 |
|
| 1897 | - * @param string $title The page title including variables. |
|
| 1898 | - * @param string $gd_page The GeoDirectory page type if any. |
|
| 1899 | - * @param string $sep The title separator symbol. |
|
| 1900 | - */ |
|
| 1901 | - return apply_filters('geodir_seo_meta_title', __($title, 'geodirectory'), $gd_page, $sep);
|
|
| 1893 | + /** |
|
| 1894 | + * Filter page meta title to replace variables. |
|
| 1895 | + * |
|
| 1896 | + * @since 1.5.4 |
|
| 1897 | + * @param string $title The page title including variables. |
|
| 1898 | + * @param string $gd_page The GeoDirectory page type if any. |
|
| 1899 | + * @param string $sep The title separator symbol. |
|
| 1900 | + */ |
|
| 1901 | + return apply_filters('geodir_seo_meta_title', __($title, 'geodirectory'), $gd_page, $sep);
|
|
| 1902 | 1902 | |
| 1903 | 1903 | } |
| 1904 | 1904 | |
@@ -1914,33 +1914,33 @@ discard block |
||
| 1914 | 1914 | function geodir_set_post_attachment() |
| 1915 | 1915 | {
|
| 1916 | 1916 | |
| 1917 | - if (!get_option('geodir_set_post_attachments')) {
|
|
| 1917 | + if (!get_option('geodir_set_post_attachments')) {
|
|
| 1918 | 1918 | |
| 1919 | - require_once(ABSPATH . 'wp-admin/includes/image.php'); |
|
| 1920 | - require_once(ABSPATH . 'wp-admin/includes/file.php'); |
|
| 1919 | + require_once(ABSPATH . 'wp-admin/includes/image.php'); |
|
| 1920 | + require_once(ABSPATH . 'wp-admin/includes/file.php'); |
|
| 1921 | 1921 | |
| 1922 | - $all_postypes = geodir_get_posttypes(); |
|
| 1922 | + $all_postypes = geodir_get_posttypes(); |
|
| 1923 | 1923 | |
| 1924 | - $args = array( |
|
| 1925 | - 'posts_per_page' => -1, |
|
| 1926 | - 'post_type' => $all_postypes, |
|
| 1927 | - 'post_status' => 'publish'); |
|
| 1924 | + $args = array( |
|
| 1925 | + 'posts_per_page' => -1, |
|
| 1926 | + 'post_type' => $all_postypes, |
|
| 1927 | + 'post_status' => 'publish'); |
|
| 1928 | 1928 | |
| 1929 | - $posts_array = get_posts($args); |
|
| 1929 | + $posts_array = get_posts($args); |
|
| 1930 | 1930 | |
| 1931 | - if (!empty($posts_array)) {
|
|
| 1931 | + if (!empty($posts_array)) {
|
|
| 1932 | 1932 | |
| 1933 | - foreach ($posts_array as $post) {
|
|
| 1933 | + foreach ($posts_array as $post) {
|
|
| 1934 | 1934 | |
| 1935 | - geodir_set_wp_featured_image($post->ID); |
|
| 1935 | + geodir_set_wp_featured_image($post->ID); |
|
| 1936 | 1936 | |
| 1937 | - } |
|
| 1937 | + } |
|
| 1938 | 1938 | |
| 1939 | - } |
|
| 1939 | + } |
|
| 1940 | 1940 | |
| 1941 | - update_option('geodir_set_post_attachments', '1');
|
|
| 1941 | + update_option('geodir_set_post_attachments', '1');
|
|
| 1942 | 1942 | |
| 1943 | - } |
|
| 1943 | + } |
|
| 1944 | 1944 | |
| 1945 | 1945 | } |
| 1946 | 1946 | |
@@ -1957,19 +1957,19 @@ discard block |
||
| 1957 | 1957 | function geodir_remove_url_seperator() |
| 1958 | 1958 | {
|
| 1959 | 1959 | |
| 1960 | - if (!get_option('geodir_remove_url_seperator')) {
|
|
| 1960 | + if (!get_option('geodir_remove_url_seperator')) {
|
|
| 1961 | 1961 | |
| 1962 | - if (get_option('geodir_listingurl_separator'))
|
|
| 1963 | - delete_option('geodir_listingurl_separator');
|
|
| 1962 | + if (get_option('geodir_listingurl_separator'))
|
|
| 1963 | + delete_option('geodir_listingurl_separator');
|
|
| 1964 | 1964 | |
| 1965 | - if (get_option('geodir_detailurl_separator'))
|
|
| 1966 | - delete_option('geodir_detailurl_separator');
|
|
| 1965 | + if (get_option('geodir_detailurl_separator'))
|
|
| 1966 | + delete_option('geodir_detailurl_separator');
|
|
| 1967 | 1967 | |
| 1968 | - flush_rewrite_rules(false); |
|
| 1968 | + flush_rewrite_rules(false); |
|
| 1969 | 1969 | |
| 1970 | - update_option('geodir_remove_url_seperator', '1');
|
|
| 1970 | + update_option('geodir_remove_url_seperator', '1');
|
|
| 1971 | 1971 | |
| 1972 | - } |
|
| 1972 | + } |
|
| 1973 | 1973 | |
| 1974 | 1974 | } |
| 1975 | 1975 | |
@@ -1985,39 +1985,39 @@ discard block |
||
| 1985 | 1985 | */ |
| 1986 | 1986 | function geodir_remove_url_seperator_form_permalink_settings($permalink_arr) |
| 1987 | 1987 | {
|
| 1988 | - foreach ($permalink_arr as $key => $value) {
|
|
| 1988 | + foreach ($permalink_arr as $key => $value) {
|
|
| 1989 | 1989 | |
| 1990 | - if ($value['id'] == 'geodir_listingurl_separator' || $value['id'] == 'geodir_detailurl_separator') |
|
| 1991 | - unset($permalink_arr[$key]); |
|
| 1990 | + if ($value['id'] == 'geodir_listingurl_separator' || $value['id'] == 'geodir_detailurl_separator') |
|
| 1991 | + unset($permalink_arr[$key]); |
|
| 1992 | 1992 | |
| 1993 | - } |
|
| 1993 | + } |
|
| 1994 | 1994 | |
| 1995 | - return $permalink_arr; |
|
| 1995 | + return $permalink_arr; |
|
| 1996 | 1996 | |
| 1997 | 1997 | } |
| 1998 | 1998 | |
| 1999 | 1999 | if (!is_admin()) {
|
| 2000 | - add_filter('posts_results', 'geodir_set_status_draft_to_publish_for_own_post');
|
|
| 2000 | + add_filter('posts_results', 'geodir_set_status_draft_to_publish_for_own_post');
|
|
| 2001 | 2001 | } |
| 2002 | 2002 | /** |
| 2003 | - * Set status from draft to publish. |
|
| 2004 | - * |
|
| 2005 | - * @since 1.0.0 |
|
| 2006 | - * @package GeoDirectory |
|
| 2007 | - * @global object $wp WordPress object. |
|
| 2008 | - * @param object $post Post object. |
|
| 2009 | - * @return object Modified post object. |
|
| 2010 | - */ |
|
| 2003 | + * Set status from draft to publish. |
|
| 2004 | + * |
|
| 2005 | + * @since 1.0.0 |
|
| 2006 | + * @package GeoDirectory |
|
| 2007 | + * @global object $wp WordPress object. |
|
| 2008 | + * @param object $post Post object. |
|
| 2009 | + * @return object Modified post object. |
|
| 2010 | + */ |
|
| 2011 | 2011 | function geodir_set_status_draft_to_publish_for_own_post($post) |
| 2012 | 2012 | {
|
| 2013 | - global $wp; |
|
| 2014 | - $user_id = get_current_user_id(); |
|
| 2013 | + global $wp; |
|
| 2014 | + $user_id = get_current_user_id(); |
|
| 2015 | 2015 | |
| 2016 | - if (!empty($post) && $post[0]->post_author == $user_id) {
|
|
| 2017 | - $post[0]->post_status = 'publish'; |
|
| 2018 | - } |
|
| 2019 | - //print_r($post) ; |
|
| 2020 | - return $post; |
|
| 2016 | + if (!empty($post) && $post[0]->post_author == $user_id) {
|
|
| 2017 | + $post[0]->post_status = 'publish'; |
|
| 2018 | + } |
|
| 2019 | + //print_r($post) ; |
|
| 2020 | + return $post; |
|
| 2021 | 2021 | } |
| 2022 | 2022 | |
| 2023 | 2023 | |
@@ -2109,33 +2109,33 @@ discard block |
||
| 2109 | 2109 | */ |
| 2110 | 2110 | function geodir_detail_page_tab_headings_change($tabs_arr) |
| 2111 | 2111 | {
|
| 2112 | - global $wpdb; |
|
| 2112 | + global $wpdb; |
|
| 2113 | 2113 | |
| 2114 | - $post_type = geodir_get_current_posttype(); |
|
| 2114 | + $post_type = geodir_get_current_posttype(); |
|
| 2115 | 2115 | |
| 2116 | - $all_postypes = geodir_get_posttypes(); |
|
| 2116 | + $all_postypes = geodir_get_posttypes(); |
|
| 2117 | 2117 | |
| 2118 | - if (!empty($tabs_arr) && $post_type != '' && in_array($post_type, $all_postypes)) {
|
|
| 2118 | + if (!empty($tabs_arr) && $post_type != '' && in_array($post_type, $all_postypes)) {
|
|
| 2119 | 2119 | |
| 2120 | - if (array_key_exists('post_video', $tabs_arr)) {
|
|
| 2120 | + if (array_key_exists('post_video', $tabs_arr)) {
|
|
| 2121 | 2121 | |
| 2122 | - $field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_video', $post_type)));
|
|
| 2122 | + $field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_video', $post_type)));
|
|
| 2123 | 2123 | |
| 2124 | - if (isset($tabs_arr['post_video']['heading_text']) && $field_title != '') |
|
| 2125 | - $tabs_arr['post_video']['heading_text'] = $field_title; |
|
| 2126 | - } |
|
| 2124 | + if (isset($tabs_arr['post_video']['heading_text']) && $field_title != '') |
|
| 2125 | + $tabs_arr['post_video']['heading_text'] = $field_title; |
|
| 2126 | + } |
|
| 2127 | 2127 | |
| 2128 | - if (array_key_exists('special_offers', $tabs_arr)) {
|
|
| 2128 | + if (array_key_exists('special_offers', $tabs_arr)) {
|
|
| 2129 | 2129 | |
| 2130 | - $field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_special_offers', $post_type)));
|
|
| 2130 | + $field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_special_offers', $post_type)));
|
|
| 2131 | 2131 | |
| 2132 | - if (isset($tabs_arr['special_offers']['heading_text']) && $field_title != '') |
|
| 2133 | - $tabs_arr['special_offers']['heading_text'] = $field_title; |
|
| 2134 | - } |
|
| 2132 | + if (isset($tabs_arr['special_offers']['heading_text']) && $field_title != '') |
|
| 2133 | + $tabs_arr['special_offers']['heading_text'] = $field_title; |
|
| 2134 | + } |
|
| 2135 | 2135 | |
| 2136 | - } |
|
| 2136 | + } |
|
| 2137 | 2137 | |
| 2138 | - return $tabs_arr; |
|
| 2138 | + return $tabs_arr; |
|
| 2139 | 2139 | |
| 2140 | 2140 | } |
| 2141 | 2141 | |
@@ -2148,10 +2148,10 @@ discard block |
||
| 2148 | 2148 | */ |
| 2149 | 2149 | function geodir_remove_template_redirect_actions() |
| 2150 | 2150 | {
|
| 2151 | - if (geodir_is_page('login')){
|
|
| 2152 | - remove_all_actions('template_redirect');
|
|
| 2153 | - remove_action('init', 'avia_modify_front', 10);
|
|
| 2154 | - } |
|
| 2151 | + if (geodir_is_page('login')){
|
|
| 2152 | + remove_all_actions('template_redirect');
|
|
| 2153 | + remove_action('init', 'avia_modify_front', 10);
|
|
| 2154 | + } |
|
| 2155 | 2155 | } |
| 2156 | 2156 | |
| 2157 | 2157 | |
@@ -2173,51 +2173,51 @@ discard block |
||
| 2173 | 2173 | function geodirectory_before_featured_image_delete($attachment_id) |
| 2174 | 2174 | {
|
| 2175 | 2175 | |
| 2176 | - global $wpdb, $plugin_prefix; |
|
| 2176 | + global $wpdb, $plugin_prefix; |
|
| 2177 | 2177 | |
| 2178 | - $post_id = get_post_field('post_parent', $attachment_id);
|
|
| 2178 | + $post_id = get_post_field('post_parent', $attachment_id);
|
|
| 2179 | 2179 | |
| 2180 | - $attachment_url = wp_get_attachment_url($attachment_id); |
|
| 2180 | + $attachment_url = wp_get_attachment_url($attachment_id); |
|
| 2181 | 2181 | |
| 2182 | - if ($post_id > 0 && (isset($_REQUEST['action']) && $_REQUEST['action'] == 'delete')) {
|
|
| 2182 | + if ($post_id > 0 && (isset($_REQUEST['action']) && $_REQUEST['action'] == 'delete')) {
|
|
| 2183 | 2183 | |
| 2184 | - $post_type = get_post_type($post_id); |
|
| 2184 | + $post_type = get_post_type($post_id); |
|
| 2185 | 2185 | |
| 2186 | - $all_postypes = geodir_get_posttypes(); |
|
| 2186 | + $all_postypes = geodir_get_posttypes(); |
|
| 2187 | 2187 | |
| 2188 | - if (!in_array($post_type, $all_postypes) || !is_admin()) |
|
| 2189 | - return false; |
|
| 2188 | + if (!in_array($post_type, $all_postypes) || !is_admin()) |
|
| 2189 | + return false; |
|
| 2190 | 2190 | |
| 2191 | - $uploads = wp_upload_dir(); |
|
| 2191 | + $uploads = wp_upload_dir(); |
|
| 2192 | 2192 | |
| 2193 | - $split_img_path = explode($uploads['baseurl'], $attachment_url); |
|
| 2193 | + $split_img_path = explode($uploads['baseurl'], $attachment_url); |
|
| 2194 | 2194 | |
| 2195 | - $split_img_file_path = isset($split_img_path[1]) ? $split_img_path[1] : ''; |
|
| 2195 | + $split_img_file_path = isset($split_img_path[1]) ? $split_img_path[1] : ''; |
|
| 2196 | 2196 | |
| 2197 | - $wpdb->query( |
|
| 2198 | - $wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = %d AND file=%s ",
|
|
| 2199 | - array($post_id, $split_img_file_path) |
|
| 2200 | - ) |
|
| 2201 | - ); |
|
| 2197 | + $wpdb->query( |
|
| 2198 | + $wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = %d AND file=%s ",
|
|
| 2199 | + array($post_id, $split_img_file_path) |
|
| 2200 | + ) |
|
| 2201 | + ); |
|
| 2202 | 2202 | |
| 2203 | - $attachment_data = $wpdb->get_row( |
|
| 2204 | - $wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=%d",
|
|
| 2205 | - array($post_id) |
|
| 2206 | - ) |
|
| 2207 | - ); |
|
| 2203 | + $attachment_data = $wpdb->get_row( |
|
| 2204 | + $wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=%d",
|
|
| 2205 | + array($post_id) |
|
| 2206 | + ) |
|
| 2207 | + ); |
|
| 2208 | 2208 | |
| 2209 | - if (!empty($attachment_data)) {
|
|
| 2210 | - $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
|
|
| 2211 | - } |
|
| 2209 | + if (!empty($attachment_data)) {
|
|
| 2210 | + $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
|
|
| 2211 | + } |
|
| 2212 | 2212 | |
| 2213 | 2213 | |
| 2214 | - $table_name = $plugin_prefix . $post_type . '_detail'; |
|
| 2214 | + $table_name = $plugin_prefix . $post_type . '_detail'; |
|
| 2215 | 2215 | |
| 2216 | - $wpdb->query("UPDATE " . $table_name . " SET featured_image='' WHERE post_id =" . $post_id);
|
|
| 2216 | + $wpdb->query("UPDATE " . $table_name . " SET featured_image='' WHERE post_id =" . $post_id);
|
|
| 2217 | 2217 | |
| 2218 | - geodir_set_wp_featured_image($post_id); |
|
| 2218 | + geodir_set_wp_featured_image($post_id); |
|
| 2219 | 2219 | |
| 2220 | - } |
|
| 2220 | + } |
|
| 2221 | 2221 | |
| 2222 | 2222 | } |
| 2223 | 2223 | |
@@ -2235,80 +2235,80 @@ discard block |
||
| 2235 | 2235 | function geodir_temp_set_post_attachment() |
| 2236 | 2236 | {
|
| 2237 | 2237 | |
| 2238 | - global $wpdb, $plugin_prefix; |
|
| 2238 | + global $wpdb, $plugin_prefix; |
|
| 2239 | 2239 | |
| 2240 | - $all_postypes = geodir_get_posttypes(); |
|
| 2240 | + $all_postypes = geodir_get_posttypes(); |
|
| 2241 | 2241 | |
| 2242 | - foreach ($all_postypes as $posttype) {
|
|
| 2242 | + foreach ($all_postypes as $posttype) {
|
|
| 2243 | 2243 | |
| 2244 | - $tablename = $plugin_prefix . $posttype . '_detail'; |
|
| 2244 | + $tablename = $plugin_prefix . $posttype . '_detail'; |
|
| 2245 | 2245 | |
| 2246 | - $get_post_data = $wpdb->get_results("SELECT post_id FROM " . $tablename);
|
|
| 2246 | + $get_post_data = $wpdb->get_results("SELECT post_id FROM " . $tablename);
|
|
| 2247 | 2247 | |
| 2248 | - if (!empty($get_post_data)) {
|
|
| 2248 | + if (!empty($get_post_data)) {
|
|
| 2249 | 2249 | |
| 2250 | - foreach ($get_post_data as $data) {
|
|
| 2250 | + foreach ($get_post_data as $data) {
|
|
| 2251 | 2251 | |
| 2252 | - $post_id = $data->post_id; |
|
| 2252 | + $post_id = $data->post_id; |
|
| 2253 | 2253 | |
| 2254 | - $attachment_data = $wpdb->get_results("SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id =" . $post_id . " AND file!=''");
|
|
| 2254 | + $attachment_data = $wpdb->get_results("SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id =" . $post_id . " AND file!=''");
|
|
| 2255 | 2255 | |
| 2256 | - if (!empty($attachment_data)) {
|
|
| 2256 | + if (!empty($attachment_data)) {
|
|
| 2257 | 2257 | |
| 2258 | - foreach ($attachment_data as $attach) {
|
|
| 2258 | + foreach ($attachment_data as $attach) {
|
|
| 2259 | 2259 | |
| 2260 | - $file_info = pathinfo($attach->file); |
|
| 2260 | + $file_info = pathinfo($attach->file); |
|
| 2261 | 2261 | |
| 2262 | - $sub_dir = ''; |
|
| 2263 | - if ($file_info['dirname'] != '.' && $file_info['dirname'] != '..') |
|
| 2264 | - $sub_dir = stripslashes_deep($file_info['dirname']); |
|
| 2262 | + $sub_dir = ''; |
|
| 2263 | + if ($file_info['dirname'] != '.' && $file_info['dirname'] != '..') |
|
| 2264 | + $sub_dir = stripslashes_deep($file_info['dirname']); |
|
| 2265 | 2265 | |
| 2266 | - $uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs |
|
| 2267 | - $uploads_baseurl = $uploads['baseurl']; |
|
| 2268 | - $uploads_path = $uploads['basedir']; |
|
| 2266 | + $uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs |
|
| 2267 | + $uploads_baseurl = $uploads['baseurl']; |
|
| 2268 | + $uploads_path = $uploads['basedir']; |
|
| 2269 | 2269 | |
| 2270 | - $file_name = $file_info['basename']; |
|
| 2270 | + $file_name = $file_info['basename']; |
|
| 2271 | 2271 | |
| 2272 | - $img_arr['path'] = $uploads_path . $sub_dir . '/' . $file_name; |
|
| 2272 | + $img_arr['path'] = $uploads_path . $sub_dir . '/' . $file_name; |
|
| 2273 | 2273 | |
| 2274 | - if (!file_exists($img_arr['path'])) {
|
|
| 2274 | + if (!file_exists($img_arr['path'])) {
|
|
| 2275 | 2275 | |
| 2276 | - $wpdb->query("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE ID=" . $attach->ID);
|
|
| 2276 | + $wpdb->query("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE ID=" . $attach->ID);
|
|
| 2277 | 2277 | |
| 2278 | - } |
|
| 2278 | + } |
|
| 2279 | 2279 | |
| 2280 | - } |
|
| 2280 | + } |
|
| 2281 | 2281 | |
| 2282 | - $attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=" . $post_id . " GROUP BY post_id");
|
|
| 2282 | + $attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=" . $post_id . " GROUP BY post_id");
|
|
| 2283 | 2283 | |
| 2284 | - if (!empty($attachment_data)) {
|
|
| 2284 | + if (!empty($attachment_data)) {
|
|
| 2285 | 2285 | |
| 2286 | - if ($attachment_data->ID) |
|
| 2287 | - $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
|
|
| 2286 | + if ($attachment_data->ID) |
|
| 2287 | + $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
|
|
| 2288 | 2288 | |
| 2289 | - } else {
|
|
| 2289 | + } else {
|
|
| 2290 | 2290 | |
| 2291 | - if (has_post_thumbnail($post_id)) {
|
|
| 2291 | + if (has_post_thumbnail($post_id)) {
|
|
| 2292 | 2292 | |
| 2293 | - $post_thumbnail_id = get_post_thumbnail_id($post_id); |
|
| 2293 | + $post_thumbnail_id = get_post_thumbnail_id($post_id); |
|
| 2294 | 2294 | |
| 2295 | - wp_delete_attachment($post_thumbnail_id); |
|
| 2295 | + wp_delete_attachment($post_thumbnail_id); |
|
| 2296 | 2296 | |
| 2297 | - } |
|
| 2297 | + } |
|
| 2298 | 2298 | |
| 2299 | - } |
|
| 2299 | + } |
|
| 2300 | 2300 | |
| 2301 | - $wpdb->query("UPDATE " . $tablename . " SET featured_image='' WHERE post_id =" . $post_id);
|
|
| 2301 | + $wpdb->query("UPDATE " . $tablename . " SET featured_image='' WHERE post_id =" . $post_id);
|
|
| 2302 | 2302 | |
| 2303 | - geodir_set_wp_featured_image($post_id); |
|
| 2303 | + geodir_set_wp_featured_image($post_id); |
|
| 2304 | 2304 | |
| 2305 | - } |
|
| 2305 | + } |
|
| 2306 | 2306 | |
| 2307 | - } |
|
| 2307 | + } |
|
| 2308 | 2308 | |
| 2309 | - } |
|
| 2309 | + } |
|
| 2310 | 2310 | |
| 2311 | - } |
|
| 2311 | + } |
|
| 2312 | 2312 | |
| 2313 | 2313 | } |
| 2314 | 2314 | |
@@ -2326,9 +2326,9 @@ discard block |
||
| 2326 | 2326 | function geodir_default_rating_star_icon() |
| 2327 | 2327 | {
|
| 2328 | 2328 | |
| 2329 | - if (!get_option('geodir_default_rating_star_icon')) {
|
|
| 2330 | - update_option('geodir_default_rating_star_icon', geodir_plugin_url() . '/geodirectory-assets/images/stars.png');
|
|
| 2331 | - } |
|
| 2329 | + if (!get_option('geodir_default_rating_star_icon')) {
|
|
| 2330 | + update_option('geodir_default_rating_star_icon', geodir_plugin_url() . '/geodirectory-assets/images/stars.png');
|
|
| 2331 | + } |
|
| 2332 | 2332 | |
| 2333 | 2333 | } |
| 2334 | 2334 | |
@@ -2346,24 +2346,24 @@ discard block |
||
| 2346 | 2346 | */ |
| 2347 | 2347 | function geodir_user_post_listing_count() |
| 2348 | 2348 | {
|
| 2349 | - global $wpdb, $plugin_prefix, $current_user; |
|
| 2349 | + global $wpdb, $plugin_prefix, $current_user; |
|
| 2350 | 2350 | |
| 2351 | - $user_id = $current_user->ID; |
|
| 2352 | - $all_postypes = geodir_get_posttypes(); |
|
| 2353 | - $all_posts = get_option('geodir_listing_link_user_dashboard');
|
|
| 2351 | + $user_id = $current_user->ID; |
|
| 2352 | + $all_postypes = geodir_get_posttypes(); |
|
| 2353 | + $all_posts = get_option('geodir_listing_link_user_dashboard');
|
|
| 2354 | 2354 | |
| 2355 | - $user_listing = array(); |
|
| 2356 | - if (is_array($all_posts) && !empty($all_posts)) {
|
|
| 2357 | - foreach ($all_posts as $ptype) {
|
|
| 2358 | - $total_posts = $wpdb->get_var("SELECT count( ID ) FROM " . $wpdb->prefix . "posts WHERE post_author=" . $user_id . " AND post_type='" . $ptype . "' AND ( post_status = 'publish' OR post_status = 'draft' OR post_status = 'private' )");
|
|
| 2355 | + $user_listing = array(); |
|
| 2356 | + if (is_array($all_posts) && !empty($all_posts)) {
|
|
| 2357 | + foreach ($all_posts as $ptype) {
|
|
| 2358 | + $total_posts = $wpdb->get_var("SELECT count( ID ) FROM " . $wpdb->prefix . "posts WHERE post_author=" . $user_id . " AND post_type='" . $ptype . "' AND ( post_status = 'publish' OR post_status = 'draft' OR post_status = 'private' )");
|
|
| 2359 | 2359 | |
| 2360 | - if ($total_posts > 0) {
|
|
| 2361 | - $user_listing[$ptype] = $total_posts; |
|
| 2362 | - } |
|
| 2363 | - } |
|
| 2364 | - } |
|
| 2360 | + if ($total_posts > 0) {
|
|
| 2361 | + $user_listing[$ptype] = $total_posts; |
|
| 2362 | + } |
|
| 2363 | + } |
|
| 2364 | + } |
|
| 2365 | 2365 | |
| 2366 | - return $user_listing; |
|
| 2366 | + return $user_listing; |
|
| 2367 | 2367 | } |
| 2368 | 2368 | |
| 2369 | 2369 | |
@@ -2380,27 +2380,27 @@ discard block |
||
| 2380 | 2380 | */ |
| 2381 | 2381 | function geodir_user_favourite_listing_count() |
| 2382 | 2382 | {
|
| 2383 | - global $wpdb, $plugin_prefix, $current_user; |
|
| 2383 | + global $wpdb, $plugin_prefix, $current_user; |
|
| 2384 | 2384 | |
| 2385 | - $user_id = $current_user->ID; |
|
| 2386 | - $all_postypes = geodir_get_posttypes(); |
|
| 2387 | - $user_favorites = get_user_meta($user_id, 'gd_user_favourite_post', true); |
|
| 2388 | - $all_posts = get_option('geodir_favorite_link_user_dashboard');
|
|
| 2385 | + $user_id = $current_user->ID; |
|
| 2386 | + $all_postypes = geodir_get_posttypes(); |
|
| 2387 | + $user_favorites = get_user_meta($user_id, 'gd_user_favourite_post', true); |
|
| 2388 | + $all_posts = get_option('geodir_favorite_link_user_dashboard');
|
|
| 2389 | 2389 | |
| 2390 | - $user_listing = array(); |
|
| 2391 | - if (is_array($all_posts) && !empty($all_posts) && is_array($user_favorites) && !empty($user_favorites)) {
|
|
| 2392 | - $user_favorites = "'" . implode("','", $user_favorites) . "'";
|
|
| 2390 | + $user_listing = array(); |
|
| 2391 | + if (is_array($all_posts) && !empty($all_posts) && is_array($user_favorites) && !empty($user_favorites)) {
|
|
| 2392 | + $user_favorites = "'" . implode("','", $user_favorites) . "'";
|
|
| 2393 | 2393 | |
| 2394 | - foreach ($all_posts as $ptype) {
|
|
| 2395 | - $total_posts = $wpdb->get_var("SELECT count( ID ) FROM " . $wpdb->prefix . "posts WHERE post_type='" . $ptype . "' AND post_status = 'publish' AND ID IN (" . $user_favorites . ")");
|
|
| 2394 | + foreach ($all_posts as $ptype) {
|
|
| 2395 | + $total_posts = $wpdb->get_var("SELECT count( ID ) FROM " . $wpdb->prefix . "posts WHERE post_type='" . $ptype . "' AND post_status = 'publish' AND ID IN (" . $user_favorites . ")");
|
|
| 2396 | 2396 | |
| 2397 | - if ($total_posts > 0) {
|
|
| 2398 | - $user_listing[$ptype] = $total_posts; |
|
| 2399 | - } |
|
| 2400 | - } |
|
| 2401 | - } |
|
| 2397 | + if ($total_posts > 0) {
|
|
| 2398 | + $user_listing[$ptype] = $total_posts; |
|
| 2399 | + } |
|
| 2400 | + } |
|
| 2401 | + } |
|
| 2402 | 2402 | |
| 2403 | - return $user_listing; |
|
| 2403 | + return $user_listing; |
|
| 2404 | 2404 | } |
| 2405 | 2405 | |
| 2406 | 2406 | add_filter('geodir_detail_page_tab_list_extend', 'geodir_detail_page_custom_field_tab');
|
@@ -2417,584 +2417,584 @@ discard block |
||
| 2417 | 2417 | */ |
| 2418 | 2418 | function geodir_detail_page_custom_field_tab($tabs_arr) |
| 2419 | 2419 | {
|
| 2420 | - global $post; |
|
| 2421 | - |
|
| 2422 | - $post_type = geodir_get_current_posttype(); |
|
| 2423 | - $all_postypes = geodir_get_posttypes(); |
|
| 2424 | - |
|
| 2425 | - if (!empty($tabs_arr) && $post_type != '' && in_array($post_type, $all_postypes) && (geodir_is_page('detail') || geodir_is_page('preview'))) {
|
|
| 2426 | - $package_info = array(); |
|
| 2427 | - $package_info = geodir_post_package_info($package_info, $post); |
|
| 2428 | - $post_package_id = $package_info->pid; |
|
| 2429 | - $fields_location = 'detail'; |
|
| 2430 | - |
|
| 2431 | - $custom_fields = geodir_post_custom_fields($post_package_id, 'default', $post_type, $fields_location); |
|
| 2432 | - if (!empty($custom_fields)) {
|
|
| 2433 | - $parse_custom_fields = array(); |
|
| 2434 | - foreach ($custom_fields as $field) {
|
|
| 2435 | - $field = stripslashes_deep($field); // strip slashes |
|
| 2420 | + global $post; |
|
| 2421 | + |
|
| 2422 | + $post_type = geodir_get_current_posttype(); |
|
| 2423 | + $all_postypes = geodir_get_posttypes(); |
|
| 2424 | + |
|
| 2425 | + if (!empty($tabs_arr) && $post_type != '' && in_array($post_type, $all_postypes) && (geodir_is_page('detail') || geodir_is_page('preview'))) {
|
|
| 2426 | + $package_info = array(); |
|
| 2427 | + $package_info = geodir_post_package_info($package_info, $post); |
|
| 2428 | + $post_package_id = $package_info->pid; |
|
| 2429 | + $fields_location = 'detail'; |
|
| 2430 | + |
|
| 2431 | + $custom_fields = geodir_post_custom_fields($post_package_id, 'default', $post_type, $fields_location); |
|
| 2432 | + if (!empty($custom_fields)) {
|
|
| 2433 | + $parse_custom_fields = array(); |
|
| 2434 | + foreach ($custom_fields as $field) {
|
|
| 2435 | + $field = stripslashes_deep($field); // strip slashes |
|
| 2436 | 2436 | |
| 2437 | - $type = $field; |
|
| 2438 | - $field_name = $field['htmlvar_name']; |
|
| 2439 | - if (empty($geodir_post_info) && geodir_is_page('preview') && $field_name != '' && !isset($post->$field_name) && isset($_REQUEST[$field_name])) {
|
|
| 2440 | - $post->$field_name = $_REQUEST[$field_name]; |
|
| 2441 | - } |
|
| 2442 | - |
|
| 2443 | - if (isset($field['show_as_tab']) && $field['show_as_tab'] == 1 && ((isset($post->$field_name) && $post->$field_name != '') || $field['type'] == 'fieldset') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file'))) {
|
|
| 2444 | - if ($type['type'] == 'datepicker' && ($post->$type['htmlvar_name'] == '' || $post->$type['htmlvar_name'] == '0000-00-00')) {
|
|
| 2445 | - continue; |
|
| 2446 | - } |
|
| 2447 | - |
|
| 2448 | - $parse_custom_fields[] = $field; |
|
| 2449 | - } |
|
| 2450 | - } |
|
| 2451 | - $custom_fields = $parse_custom_fields; |
|
| 2452 | - } |
|
| 2453 | - |
|
| 2454 | - if (!empty($custom_fields)) {
|
|
| 2455 | - $field_set_start = 0; |
|
| 2456 | - $fieldset_count = 0; |
|
| 2457 | - $fieldset = ''; |
|
| 2458 | - $total_fields = count($custom_fields); |
|
| 2459 | - $count_field = 0; |
|
| 2460 | - $fieldset_arr = array(); |
|
| 2461 | - $i = 0; |
|
| 2462 | - $geodir_post_info = isset($post->ID) && !empty($post->ID) ? geodir_get_post_info($post->ID) : NULL; |
|
| 2463 | - |
|
| 2464 | - foreach ($custom_fields as $field) {
|
|
| 2465 | - $count_field++; |
|
| 2466 | - $field_name = $field['htmlvar_name']; |
|
| 2467 | - if (empty($geodir_post_info) && geodir_is_page('preview') && $field_name != '' && !isset($post->$field_name) && isset($_REQUEST[$field_name])) {
|
|
| 2468 | - $post->$field_name = $_REQUEST[$field_name]; |
|
| 2469 | - } |
|
| 2470 | - |
|
| 2471 | - if (isset($field['show_as_tab']) && $field['show_as_tab'] == 1 && ((isset($post->$field_name) && $post->$field_name != '') || $field['type'] == 'fieldset') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file'))) {
|
|
| 2472 | - $label = $field['site_title'] != '' ? $field['site_title'] : $field['admin_title']; |
|
| 2473 | - $site_title = trim($field['site_title']); |
|
| 2474 | - $type = $field; |
|
| 2475 | - $html = ''; |
|
| 2476 | - $html_var = $field_name; |
|
| 2477 | - $field_icon = ''; |
|
| 2478 | - $variables_array = array(); |
|
| 2479 | - |
|
| 2480 | - if ($type['type'] == 'datepicker' && ($post->$type['htmlvar_name'] == '' || $post->$type['htmlvar_name'] == '0000-00-00')) {
|
|
| 2481 | - continue; |
|
| 2482 | - } |
|
| 2483 | - |
|
| 2484 | - if ($type['type'] != 'fieldset') {
|
|
| 2485 | - $i++; |
|
| 2486 | - $variables_array['post_id'] = $post->ID; |
|
| 2487 | - $variables_array['label'] = __($type['site_title'], 'geodirectory'); |
|
| 2488 | - $variables_array['value'] = ''; |
|
| 2489 | - $variables_array['value'] = $post->$type['htmlvar_name']; |
|
| 2490 | - } |
|
| 2491 | - |
|
| 2492 | - if (strpos($type['field_icon'], 'http') !== false) {
|
|
| 2493 | - $field_icon = ' background: url(' . $type['field_icon'] . ') no-repeat left center;background-size:18px 18px;padding-left: 21px;';
|
|
| 2494 | - } elseif (strpos($type['field_icon'], 'fa fa-') !== false) {
|
|
| 2495 | - $field_icon = '<i class="' . $type['field_icon'] . '"></i>'; |
|
| 2496 | - } |
|
| 2437 | + $type = $field; |
|
| 2438 | + $field_name = $field['htmlvar_name']; |
|
| 2439 | + if (empty($geodir_post_info) && geodir_is_page('preview') && $field_name != '' && !isset($post->$field_name) && isset($_REQUEST[$field_name])) {
|
|
| 2440 | + $post->$field_name = $_REQUEST[$field_name]; |
|
| 2441 | + } |
|
| 2442 | + |
|
| 2443 | + if (isset($field['show_as_tab']) && $field['show_as_tab'] == 1 && ((isset($post->$field_name) && $post->$field_name != '') || $field['type'] == 'fieldset') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file'))) {
|
|
| 2444 | + if ($type['type'] == 'datepicker' && ($post->$type['htmlvar_name'] == '' || $post->$type['htmlvar_name'] == '0000-00-00')) {
|
|
| 2445 | + continue; |
|
| 2446 | + } |
|
| 2447 | + |
|
| 2448 | + $parse_custom_fields[] = $field; |
|
| 2449 | + } |
|
| 2450 | + } |
|
| 2451 | + $custom_fields = $parse_custom_fields; |
|
| 2452 | + } |
|
| 2497 | 2453 | |
| 2498 | - switch ($type['type']) {
|
|
| 2499 | - case 'fieldset': {
|
|
| 2500 | - $i = 0; |
|
| 2501 | - $fieldset_count++; |
|
| 2502 | - $field_set_start = 1; |
|
| 2503 | - $fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_' . $fieldset_count; |
|
| 2504 | - $fieldset_arr[$fieldset_count]['label'] = $label; |
|
| 2505 | - } |
|
| 2506 | - break; |
|
| 2507 | - case 'url': {
|
|
| 2508 | - if (strpos($field_icon, 'http') !== false) {
|
|
| 2509 | - $field_icon_af = ''; |
|
| 2510 | - } elseif ($field_icon == '') {
|
|
| 2511 | - |
|
| 2512 | - if ($type['name'] == 'geodir_facebook') {
|
|
| 2513 | - $field_icon_af = '<i class="fa fa-facebook-square"></i>'; |
|
| 2514 | - } elseif ($type['name'] == 'geodir_twitter') {
|
|
| 2515 | - $field_icon_af = '<i class="fa fa-twitter-square"></i>'; |
|
| 2516 | - } else {
|
|
| 2517 | - $field_icon_af = '<i class="fa fa-link"></i>'; |
|
| 2518 | - } |
|
| 2519 | - |
|
| 2520 | - } else {
|
|
| 2521 | - $field_icon_af = $field_icon; |
|
| 2522 | - $field_icon = ''; |
|
| 2523 | - } |
|
| 2454 | + if (!empty($custom_fields)) {
|
|
| 2455 | + $field_set_start = 0; |
|
| 2456 | + $fieldset_count = 0; |
|
| 2457 | + $fieldset = ''; |
|
| 2458 | + $total_fields = count($custom_fields); |
|
| 2459 | + $count_field = 0; |
|
| 2460 | + $fieldset_arr = array(); |
|
| 2461 | + $i = 0; |
|
| 2462 | + $geodir_post_info = isset($post->ID) && !empty($post->ID) ? geodir_get_post_info($post->ID) : NULL; |
|
| 2463 | + |
|
| 2464 | + foreach ($custom_fields as $field) {
|
|
| 2465 | + $count_field++; |
|
| 2466 | + $field_name = $field['htmlvar_name']; |
|
| 2467 | + if (empty($geodir_post_info) && geodir_is_page('preview') && $field_name != '' && !isset($post->$field_name) && isset($_REQUEST[$field_name])) {
|
|
| 2468 | + $post->$field_name = $_REQUEST[$field_name]; |
|
| 2469 | + } |
|
| 2470 | + |
|
| 2471 | + if (isset($field['show_as_tab']) && $field['show_as_tab'] == 1 && ((isset($post->$field_name) && $post->$field_name != '') || $field['type'] == 'fieldset') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file'))) {
|
|
| 2472 | + $label = $field['site_title'] != '' ? $field['site_title'] : $field['admin_title']; |
|
| 2473 | + $site_title = trim($field['site_title']); |
|
| 2474 | + $type = $field; |
|
| 2475 | + $html = ''; |
|
| 2476 | + $html_var = $field_name; |
|
| 2477 | + $field_icon = ''; |
|
| 2478 | + $variables_array = array(); |
|
| 2479 | + |
|
| 2480 | + if ($type['type'] == 'datepicker' && ($post->$type['htmlvar_name'] == '' || $post->$type['htmlvar_name'] == '0000-00-00')) {
|
|
| 2481 | + continue; |
|
| 2482 | + } |
|
| 2483 | + |
|
| 2484 | + if ($type['type'] != 'fieldset') {
|
|
| 2485 | + $i++; |
|
| 2486 | + $variables_array['post_id'] = $post->ID; |
|
| 2487 | + $variables_array['label'] = __($type['site_title'], 'geodirectory'); |
|
| 2488 | + $variables_array['value'] = ''; |
|
| 2489 | + $variables_array['value'] = $post->$type['htmlvar_name']; |
|
| 2490 | + } |
|
| 2491 | + |
|
| 2492 | + if (strpos($type['field_icon'], 'http') !== false) {
|
|
| 2493 | + $field_icon = ' background: url(' . $type['field_icon'] . ') no-repeat left center;background-size:18px 18px;padding-left: 21px;';
|
|
| 2494 | + } elseif (strpos($type['field_icon'], 'fa fa-') !== false) {
|
|
| 2495 | + $field_icon = '<i class="' . $type['field_icon'] . '"></i>'; |
|
| 2496 | + } |
|
| 2497 | + |
|
| 2498 | + switch ($type['type']) {
|
|
| 2499 | + case 'fieldset': {
|
|
| 2500 | + $i = 0; |
|
| 2501 | + $fieldset_count++; |
|
| 2502 | + $field_set_start = 1; |
|
| 2503 | + $fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_' . $fieldset_count; |
|
| 2504 | + $fieldset_arr[$fieldset_count]['label'] = $label; |
|
| 2505 | + } |
|
| 2506 | + break; |
|
| 2507 | + case 'url': {
|
|
| 2508 | + if (strpos($field_icon, 'http') !== false) {
|
|
| 2509 | + $field_icon_af = ''; |
|
| 2510 | + } elseif ($field_icon == '') {
|
|
| 2511 | + |
|
| 2512 | + if ($type['name'] == 'geodir_facebook') {
|
|
| 2513 | + $field_icon_af = '<i class="fa fa-facebook-square"></i>'; |
|
| 2514 | + } elseif ($type['name'] == 'geodir_twitter') {
|
|
| 2515 | + $field_icon_af = '<i class="fa fa-twitter-square"></i>'; |
|
| 2516 | + } else {
|
|
| 2517 | + $field_icon_af = '<i class="fa fa-link"></i>'; |
|
| 2518 | + } |
|
| 2519 | + |
|
| 2520 | + } else {
|
|
| 2521 | + $field_icon_af = $field_icon; |
|
| 2522 | + $field_icon = ''; |
|
| 2523 | + } |
|
| 2524 | 2524 | |
| 2525 | - $a_url = geodir_parse_custom_field_url($post->$type['htmlvar_name']); |
|
| 2526 | - |
|
| 2527 | - $website = !empty($a_url['url']) ? $a_url['url'] : ''; |
|
| 2528 | - $title = !empty($a_url['label']) ? $a_url['label'] : $type['site_title']; |
|
| 2529 | - $title = $title != '' ? __(stripslashes($title), 'geodirectory') : ''; |
|
| 2530 | - |
|
| 2531 | - $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
| 2532 | - |
|
| 2533 | - // all search engines that use the nofollow value exclude links that use it from their ranking calculation |
|
| 2534 | - $rel = strpos($website, get_site_url()) !== false ? '' : 'rel="nofollow"'; |
|
| 2535 | - |
|
| 2536 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '"><span class="geodir-i-website" style="' . $field_icon . '">' . $field_icon_af . ' <a href="' . $website . '" target="_blank" ' . $rel . ' ><strong>' . |
|
| 2537 | - /** |
|
| 2538 | - * Filer the custom field website name. |
|
| 2539 | - * |
|
| 2540 | - * @since 1.0.0 |
|
| 2541 | - * @param string $title The field name default: "Website". |
|
| 2542 | - * @param string $website The website address. |
|
| 2543 | - * @param int $post->ID The post ID. |
|
| 2544 | - */ |
|
| 2545 | - apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID) . '</strong></a></span></div>';
|
|
| 2546 | - } |
|
| 2547 | - break; |
|
| 2548 | - case 'phone': {
|
|
| 2549 | - if (strpos($field_icon, 'http') !== false) {
|
|
| 2550 | - $field_icon_af = ''; |
|
| 2551 | - } elseif ($field_icon == '') {
|
|
| 2552 | - $field_icon_af = '<i class="fa fa-phone"></i>'; |
|
| 2553 | - } else {
|
|
| 2554 | - $field_icon_af = $field_icon; |
|
| 2555 | - $field_icon = ''; |
|
| 2556 | - } |
|
| 2557 | - |
|
| 2558 | - $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
| 2559 | - |
|
| 2560 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-contact" style="' . $field_icon . '">' . $field_icon_af; |
|
| 2561 | - if ($field_set_start == 1 && $site_title != '') {
|
|
| 2562 | - $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
| 2563 | - } |
|
| 2564 | - $html .= ' </span>' . stripslashes($post->$type['htmlvar_name']) . '</div>'; |
|
| 2565 | - } |
|
| 2566 | - break; |
|
| 2567 | - case 'time': {
|
|
| 2568 | - $value = ''; |
|
| 2569 | - if ($post->$type['htmlvar_name'] != '') |
|
| 2570 | - //$value = date('h:i',strtotime($post->$type['htmlvar_name']));
|
|
| 2571 | - $value = date(get_option('time_format'), strtotime($post->$type['htmlvar_name']));
|
|
| 2572 | - |
|
| 2573 | - if (strpos($field_icon, 'http') !== false) {
|
|
| 2574 | - $field_icon_af = ''; |
|
| 2575 | - } elseif ($field_icon == '') {
|
|
| 2576 | - $field_icon_af = '<i class="fa fa-clock-o"></i>'; |
|
| 2577 | - } else {
|
|
| 2578 | - $field_icon_af = $field_icon; |
|
| 2579 | - $field_icon = ''; |
|
| 2580 | - } |
|
| 2581 | - |
|
| 2582 | - $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
| 2583 | - |
|
| 2584 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-time" style="' . $field_icon . '">' . $field_icon_af; |
|
| 2585 | - if ($field_set_start == 1 && $site_title != '') {
|
|
| 2586 | - $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
| 2587 | - } |
|
| 2588 | - $html .= ' </span>' . stripslashes($value) . '</div>'; |
|
| 2589 | - } |
|
| 2590 | - break; |
|
| 2591 | - case 'datepicker': {
|
|
| 2592 | - $date_format = geodir_default_date_format(); |
|
| 2593 | - if ($type['extra_fields'] != '') {
|
|
| 2594 | - $date_format = unserialize($type['extra_fields']); |
|
| 2595 | - $date_format = $date_format['date_format']; |
|
| 2596 | - } |
|
| 2597 | - |
|
| 2598 | - $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
|
|
| 2599 | - $replace = array('d','j','l','m','n','F','Y');//PHP date format
|
|
| 2600 | - |
|
| 2601 | - $date_format = str_replace($search, $replace, $date_format); |
|
| 2602 | - |
|
| 2603 | - $post_htmlvar_value = $date_format == 'd/m/Y' ? str_replace('/', '-', $post->$type['htmlvar_name']) : $post->$type['htmlvar_name']; // PHP doesn't work well with dd/mm/yyyy format
|
|
| 2604 | - |
|
| 2605 | - $value = ''; |
|
| 2606 | - if ($post->$type['htmlvar_name'] != '') |
|
| 2607 | - $value = date($date_format, strtotime($post_htmlvar_value)); |
|
| 2608 | - |
|
| 2609 | - if (strpos($field_icon, 'http') !== false) {
|
|
| 2610 | - $field_icon_af = ''; |
|
| 2611 | - } elseif ($field_icon == '') {
|
|
| 2612 | - $field_icon_af = '<i class="fa fa-calendar"></i>'; |
|
| 2613 | - } else {
|
|
| 2614 | - $field_icon_af = $field_icon; |
|
| 2615 | - $field_icon = ''; |
|
| 2616 | - } |
|
| 2617 | - |
|
| 2618 | - $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
| 2619 | - |
|
| 2620 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-datepicker" style="' . $field_icon . '">' . $field_icon_af; |
|
| 2621 | - if ($field_set_start == 1 && $site_title != '') {
|
|
| 2622 | - $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
| 2623 | - } |
|
| 2624 | - $html .= ' </span>' . $value . '</div>'; |
|
| 2625 | - } |
|
| 2626 | - break; |
|
| 2627 | - case 'text': {
|
|
| 2628 | - if (strpos($field_icon, 'http') !== false) {
|
|
| 2629 | - $field_icon_af = ''; |
|
| 2630 | - } elseif ($field_icon == '') {
|
|
| 2631 | - $field_icon_af = ''; |
|
| 2632 | - } else {
|
|
| 2633 | - $field_icon_af = $field_icon; |
|
| 2634 | - $field_icon = ''; |
|
| 2635 | - } |
|
| 2636 | - |
|
| 2637 | - $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
| 2638 | - |
|
| 2639 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af; |
|
| 2640 | - if ($field_set_start == 1 && $site_title != '') {
|
|
| 2641 | - $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
| 2642 | - } |
|
| 2643 | - $html .= ' </span>' . stripslashes($post->$type['htmlvar_name']) . '</div>'; |
|
| 2644 | - } |
|
| 2645 | - break; |
|
| 2646 | - case 'radio': {
|
|
| 2647 | - |
|
| 2648 | - if ($post->$type['htmlvar_name'] != '') {
|
|
| 2649 | - if ($post->$type['htmlvar_name'] == 'f' || $post->$type['htmlvar_name'] == '0') {
|
|
| 2650 | - $html_val = __('No', 'geodirectory');
|
|
| 2651 | - } else if ($post->$type['htmlvar_name'] == 't' || $post->$type['htmlvar_name'] == '1') {
|
|
| 2652 | - $html_val = __('Yes', 'geodirectory');
|
|
| 2653 | - } else {
|
|
| 2654 | - $html_val = __($post->$type['htmlvar_name'], 'geodirectory'); |
|
| 2525 | + $a_url = geodir_parse_custom_field_url($post->$type['htmlvar_name']); |
|
| 2526 | + |
|
| 2527 | + $website = !empty($a_url['url']) ? $a_url['url'] : ''; |
|
| 2528 | + $title = !empty($a_url['label']) ? $a_url['label'] : $type['site_title']; |
|
| 2529 | + $title = $title != '' ? __(stripslashes($title), 'geodirectory') : ''; |
|
| 2530 | + |
|
| 2531 | + $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
| 2532 | + |
|
| 2533 | + // all search engines that use the nofollow value exclude links that use it from their ranking calculation |
|
| 2534 | + $rel = strpos($website, get_site_url()) !== false ? '' : 'rel="nofollow"'; |
|
| 2535 | + |
|
| 2536 | + $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '"><span class="geodir-i-website" style="' . $field_icon . '">' . $field_icon_af . ' <a href="' . $website . '" target="_blank" ' . $rel . ' ><strong>' . |
|
| 2537 | + /** |
|
| 2538 | + * Filer the custom field website name. |
|
| 2539 | + * |
|
| 2540 | + * @since 1.0.0 |
|
| 2541 | + * @param string $title The field name default: "Website". |
|
| 2542 | + * @param string $website The website address. |
|
| 2543 | + * @param int $post->ID The post ID. |
|
| 2544 | + */ |
|
| 2545 | + apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID) . '</strong></a></span></div>';
|
|
| 2546 | + } |
|
| 2547 | + break; |
|
| 2548 | + case 'phone': {
|
|
| 2549 | + if (strpos($field_icon, 'http') !== false) {
|
|
| 2550 | + $field_icon_af = ''; |
|
| 2551 | + } elseif ($field_icon == '') {
|
|
| 2552 | + $field_icon_af = '<i class="fa fa-phone"></i>'; |
|
| 2553 | + } else {
|
|
| 2554 | + $field_icon_af = $field_icon; |
|
| 2555 | + $field_icon = ''; |
|
| 2556 | + } |
|
| 2557 | + |
|
| 2558 | + $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
| 2559 | + |
|
| 2560 | + $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-contact" style="' . $field_icon . '">' . $field_icon_af; |
|
| 2561 | + if ($field_set_start == 1 && $site_title != '') {
|
|
| 2562 | + $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
| 2563 | + } |
|
| 2564 | + $html .= ' </span>' . stripslashes($post->$type['htmlvar_name']) . '</div>'; |
|
| 2565 | + } |
|
| 2566 | + break; |
|
| 2567 | + case 'time': {
|
|
| 2568 | + $value = ''; |
|
| 2569 | + if ($post->$type['htmlvar_name'] != '') |
|
| 2570 | + //$value = date('h:i',strtotime($post->$type['htmlvar_name']));
|
|
| 2571 | + $value = date(get_option('time_format'), strtotime($post->$type['htmlvar_name']));
|
|
| 2572 | + |
|
| 2573 | + if (strpos($field_icon, 'http') !== false) {
|
|
| 2574 | + $field_icon_af = ''; |
|
| 2575 | + } elseif ($field_icon == '') {
|
|
| 2576 | + $field_icon_af = '<i class="fa fa-clock-o"></i>'; |
|
| 2577 | + } else {
|
|
| 2578 | + $field_icon_af = $field_icon; |
|
| 2579 | + $field_icon = ''; |
|
| 2580 | + } |
|
| 2581 | + |
|
| 2582 | + $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
| 2583 | + |
|
| 2584 | + $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-time" style="' . $field_icon . '">' . $field_icon_af; |
|
| 2585 | + if ($field_set_start == 1 && $site_title != '') {
|
|
| 2586 | + $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
| 2587 | + } |
|
| 2588 | + $html .= ' </span>' . stripslashes($value) . '</div>'; |
|
| 2589 | + } |
|
| 2590 | + break; |
|
| 2591 | + case 'datepicker': {
|
|
| 2592 | + $date_format = geodir_default_date_format(); |
|
| 2593 | + if ($type['extra_fields'] != '') {
|
|
| 2594 | + $date_format = unserialize($type['extra_fields']); |
|
| 2595 | + $date_format = $date_format['date_format']; |
|
| 2596 | + } |
|
| 2597 | + |
|
| 2598 | + $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
|
|
| 2599 | + $replace = array('d','j','l','m','n','F','Y');//PHP date format
|
|
| 2600 | + |
|
| 2601 | + $date_format = str_replace($search, $replace, $date_format); |
|
| 2602 | + |
|
| 2603 | + $post_htmlvar_value = $date_format == 'd/m/Y' ? str_replace('/', '-', $post->$type['htmlvar_name']) : $post->$type['htmlvar_name']; // PHP doesn't work well with dd/mm/yyyy format
|
|
| 2604 | + |
|
| 2605 | + $value = ''; |
|
| 2606 | + if ($post->$type['htmlvar_name'] != '') |
|
| 2607 | + $value = date($date_format, strtotime($post_htmlvar_value)); |
|
| 2608 | + |
|
| 2609 | + if (strpos($field_icon, 'http') !== false) {
|
|
| 2610 | + $field_icon_af = ''; |
|
| 2611 | + } elseif ($field_icon == '') {
|
|
| 2612 | + $field_icon_af = '<i class="fa fa-calendar"></i>'; |
|
| 2613 | + } else {
|
|
| 2614 | + $field_icon_af = $field_icon; |
|
| 2615 | + $field_icon = ''; |
|
| 2616 | + } |
|
| 2617 | + |
|
| 2618 | + $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
| 2619 | + |
|
| 2620 | + $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-datepicker" style="' . $field_icon . '">' . $field_icon_af; |
|
| 2621 | + if ($field_set_start == 1 && $site_title != '') {
|
|
| 2622 | + $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
| 2623 | + } |
|
| 2624 | + $html .= ' </span>' . $value . '</div>'; |
|
| 2625 | + } |
|
| 2626 | + break; |
|
| 2627 | + case 'text': {
|
|
| 2628 | + if (strpos($field_icon, 'http') !== false) {
|
|
| 2629 | + $field_icon_af = ''; |
|
| 2630 | + } elseif ($field_icon == '') {
|
|
| 2631 | + $field_icon_af = ''; |
|
| 2632 | + } else {
|
|
| 2633 | + $field_icon_af = $field_icon; |
|
| 2634 | + $field_icon = ''; |
|
| 2635 | + } |
|
| 2636 | + |
|
| 2637 | + $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
| 2638 | + |
|
| 2639 | + $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af; |
|
| 2640 | + if ($field_set_start == 1 && $site_title != '') {
|
|
| 2641 | + $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
| 2642 | + } |
|
| 2643 | + $html .= ' </span>' . stripslashes($post->$type['htmlvar_name']) . '</div>'; |
|
| 2644 | + } |
|
| 2645 | + break; |
|
| 2646 | + case 'radio': {
|
|
| 2647 | + |
|
| 2648 | + if ($post->$type['htmlvar_name'] != '') {
|
|
| 2649 | + if ($post->$type['htmlvar_name'] == 'f' || $post->$type['htmlvar_name'] == '0') {
|
|
| 2650 | + $html_val = __('No', 'geodirectory');
|
|
| 2651 | + } else if ($post->$type['htmlvar_name'] == 't' || $post->$type['htmlvar_name'] == '1') {
|
|
| 2652 | + $html_val = __('Yes', 'geodirectory');
|
|
| 2653 | + } else {
|
|
| 2654 | + $html_val = __($post->$type['htmlvar_name'], 'geodirectory'); |
|
| 2655 | 2655 | |
| 2656 | - if (!empty($type['option_values'])) {
|
|
| 2657 | - $cf_option_values = geodir_string_values_to_options(stripslashes_deep($type['option_values']), true); |
|
| 2656 | + if (!empty($type['option_values'])) {
|
|
| 2657 | + $cf_option_values = geodir_string_values_to_options(stripslashes_deep($type['option_values']), true); |
|
| 2658 | 2658 | |
| 2659 | - if (!empty($cf_option_values)) {
|
|
| 2660 | - foreach ($cf_option_values as $cf_option_value) {
|
|
| 2661 | - if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->$type['htmlvar_name']) {
|
|
| 2662 | - $html_val = $cf_option_value['label']; |
|
| 2663 | - } |
|
| 2664 | - } |
|
| 2665 | - } |
|
| 2666 | - } |
|
| 2667 | - } |
|
| 2668 | - |
|
| 2669 | - if (strpos($field_icon, 'http') !== false) {
|
|
| 2670 | - $field_icon_af = ''; |
|
| 2671 | - } else if ($field_icon == '') {
|
|
| 2672 | - $field_icon_af = ''; |
|
| 2673 | - } else {
|
|
| 2674 | - $field_icon_af = $field_icon; |
|
| 2675 | - $field_icon = ''; |
|
| 2676 | - } |
|
| 2677 | - |
|
| 2678 | - $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
| 2679 | - |
|
| 2680 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-radio" style="' . $field_icon . '">' . $field_icon_af; |
|
| 2681 | - |
|
| 2682 | - if ($field_set_start == 1 && $site_title != '') {
|
|
| 2683 | - $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
| 2684 | - } |
|
| 2685 | - |
|
| 2686 | - $html .= ' </span>' . $html_val . '</div>'; |
|
| 2687 | - } |
|
| 2688 | - } |
|
| 2689 | - break; |
|
| 2690 | - case 'checkbox': {
|
|
| 2691 | - $html_var = $type['htmlvar_name']; |
|
| 2692 | - $html_val = $type['htmlvar_name']; |
|
| 2693 | - |
|
| 2694 | - if ((int)$post->$html_var == 1) {
|
|
| 2695 | - |
|
| 2696 | - if ($post->$type['htmlvar_name'] == '1') {
|
|
| 2697 | - $html_val = __('Yes', 'geodirectory');
|
|
| 2698 | - } else {
|
|
| 2699 | - $html_val = __('No', 'geodirectory');
|
|
| 2700 | - } |
|
| 2701 | - |
|
| 2702 | - if (strpos($field_icon, 'http') !== false) {
|
|
| 2703 | - $field_icon_af = ''; |
|
| 2704 | - } else if ($field_icon == '') {
|
|
| 2705 | - $field_icon_af = ''; |
|
| 2706 | - } else {
|
|
| 2707 | - $field_icon_af = $field_icon; |
|
| 2708 | - $field_icon = ''; |
|
| 2709 | - } |
|
| 2710 | - |
|
| 2711 | - $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
| 2712 | - |
|
| 2713 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-checkbox" style="' . $field_icon . '">' . $field_icon_af; |
|
| 2714 | - |
|
| 2715 | - if ($field_set_start == 1 && $site_title != '') {
|
|
| 2716 | - $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
| 2717 | - } |
|
| 2718 | - |
|
| 2719 | - $html .= ' </span>' . $html_val . '</div>'; |
|
| 2720 | - } |
|
| 2721 | - } |
|
| 2722 | - break; |
|
| 2723 | - case 'select': {
|
|
| 2724 | - if (strpos($field_icon, 'http') !== false) {
|
|
| 2725 | - $field_icon_af = ''; |
|
| 2726 | - } elseif ($field_icon == '') {
|
|
| 2727 | - $field_icon_af = ''; |
|
| 2728 | - } else {
|
|
| 2729 | - $field_icon_af = $field_icon; |
|
| 2730 | - $field_icon = ''; |
|
| 2731 | - } |
|
| 2659 | + if (!empty($cf_option_values)) {
|
|
| 2660 | + foreach ($cf_option_values as $cf_option_value) {
|
|
| 2661 | + if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->$type['htmlvar_name']) {
|
|
| 2662 | + $html_val = $cf_option_value['label']; |
|
| 2663 | + } |
|
| 2664 | + } |
|
| 2665 | + } |
|
| 2666 | + } |
|
| 2667 | + } |
|
| 2668 | + |
|
| 2669 | + if (strpos($field_icon, 'http') !== false) {
|
|
| 2670 | + $field_icon_af = ''; |
|
| 2671 | + } else if ($field_icon == '') {
|
|
| 2672 | + $field_icon_af = ''; |
|
| 2673 | + } else {
|
|
| 2674 | + $field_icon_af = $field_icon; |
|
| 2675 | + $field_icon = ''; |
|
| 2676 | + } |
|
| 2677 | + |
|
| 2678 | + $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
| 2679 | + |
|
| 2680 | + $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-radio" style="' . $field_icon . '">' . $field_icon_af; |
|
| 2681 | + |
|
| 2682 | + if ($field_set_start == 1 && $site_title != '') {
|
|
| 2683 | + $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
| 2684 | + } |
|
| 2685 | + |
|
| 2686 | + $html .= ' </span>' . $html_val . '</div>'; |
|
| 2687 | + } |
|
| 2688 | + } |
|
| 2689 | + break; |
|
| 2690 | + case 'checkbox': {
|
|
| 2691 | + $html_var = $type['htmlvar_name']; |
|
| 2692 | + $html_val = $type['htmlvar_name']; |
|
| 2693 | + |
|
| 2694 | + if ((int)$post->$html_var == 1) {
|
|
| 2695 | + |
|
| 2696 | + if ($post->$type['htmlvar_name'] == '1') {
|
|
| 2697 | + $html_val = __('Yes', 'geodirectory');
|
|
| 2698 | + } else {
|
|
| 2699 | + $html_val = __('No', 'geodirectory');
|
|
| 2700 | + } |
|
| 2701 | + |
|
| 2702 | + if (strpos($field_icon, 'http') !== false) {
|
|
| 2703 | + $field_icon_af = ''; |
|
| 2704 | + } else if ($field_icon == '') {
|
|
| 2705 | + $field_icon_af = ''; |
|
| 2706 | + } else {
|
|
| 2707 | + $field_icon_af = $field_icon; |
|
| 2708 | + $field_icon = ''; |
|
| 2709 | + } |
|
| 2710 | + |
|
| 2711 | + $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
| 2712 | + |
|
| 2713 | + $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-checkbox" style="' . $field_icon . '">' . $field_icon_af; |
|
| 2714 | + |
|
| 2715 | + if ($field_set_start == 1 && $site_title != '') {
|
|
| 2716 | + $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
| 2717 | + } |
|
| 2718 | + |
|
| 2719 | + $html .= ' </span>' . $html_val . '</div>'; |
|
| 2720 | + } |
|
| 2721 | + } |
|
| 2722 | + break; |
|
| 2723 | + case 'select': {
|
|
| 2724 | + if (strpos($field_icon, 'http') !== false) {
|
|
| 2725 | + $field_icon_af = ''; |
|
| 2726 | + } elseif ($field_icon == '') {
|
|
| 2727 | + $field_icon_af = ''; |
|
| 2728 | + } else {
|
|
| 2729 | + $field_icon_af = $field_icon; |
|
| 2730 | + $field_icon = ''; |
|
| 2731 | + } |
|
| 2732 | 2732 | |
| 2733 | - $field_value = __($post->$type['htmlvar_name'], 'geodirectory'); |
|
| 2733 | + $field_value = __($post->$type['htmlvar_name'], 'geodirectory'); |
|
| 2734 | 2734 | |
| 2735 | - if (!empty($type['option_values'])) {
|
|
| 2736 | - $cf_option_values = geodir_string_values_to_options(stripslashes_deep($type['option_values']), true); |
|
| 2735 | + if (!empty($type['option_values'])) {
|
|
| 2736 | + $cf_option_values = geodir_string_values_to_options(stripslashes_deep($type['option_values']), true); |
|
| 2737 | 2737 | |
| 2738 | - if (!empty($cf_option_values)) {
|
|
| 2739 | - foreach ($cf_option_values as $cf_option_value) {
|
|
| 2740 | - if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->$type['htmlvar_name']) {
|
|
| 2741 | - $field_value = $cf_option_value['label']; |
|
| 2742 | - } |
|
| 2743 | - } |
|
| 2744 | - } |
|
| 2745 | - } |
|
| 2746 | - |
|
| 2747 | - $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
| 2748 | - |
|
| 2749 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af; |
|
| 2750 | - if ($field_set_start == 1 && $site_title != '') {
|
|
| 2751 | - $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
| 2752 | - } |
|
| 2753 | - $html .= ' </span>' . $field_value . '</div>'; |
|
| 2754 | - } |
|
| 2755 | - break; |
|
| 2756 | - case 'multiselect': {
|
|
| 2757 | - if (is_array($post->$type['htmlvar_name'])) {
|
|
| 2758 | - $post->$type['htmlvar_name'] = implode(', ', $post->$type['htmlvar_name']);
|
|
| 2759 | - } |
|
| 2760 | - |
|
| 2761 | - if (strpos($field_icon, 'http') !== false) {
|
|
| 2762 | - $field_icon_af = ''; |
|
| 2763 | - } elseif ($field_icon == '') {
|
|
| 2764 | - $field_icon_af = ''; |
|
| 2765 | - } else {
|
|
| 2766 | - $field_icon_af = $field_icon; |
|
| 2767 | - $field_icon = ''; |
|
| 2768 | - } |
|
| 2769 | - |
|
| 2770 | - $field_values = explode(',', trim($post->$type['htmlvar_name'], ","));
|
|
| 2771 | - |
|
| 2772 | - $option_values = array(); |
|
| 2773 | - if (!empty($type['option_values'])) {
|
|
| 2774 | - $cf_option_values = geodir_string_values_to_options(stripslashes_deep($type['option_values']), true); |
|
| 2738 | + if (!empty($cf_option_values)) {
|
|
| 2739 | + foreach ($cf_option_values as $cf_option_value) {
|
|
| 2740 | + if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->$type['htmlvar_name']) {
|
|
| 2741 | + $field_value = $cf_option_value['label']; |
|
| 2742 | + } |
|
| 2743 | + } |
|
| 2744 | + } |
|
| 2745 | + } |
|
| 2746 | + |
|
| 2747 | + $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
| 2748 | + |
|
| 2749 | + $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af; |
|
| 2750 | + if ($field_set_start == 1 && $site_title != '') {
|
|
| 2751 | + $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
| 2752 | + } |
|
| 2753 | + $html .= ' </span>' . $field_value . '</div>'; |
|
| 2754 | + } |
|
| 2755 | + break; |
|
| 2756 | + case 'multiselect': {
|
|
| 2757 | + if (is_array($post->$type['htmlvar_name'])) {
|
|
| 2758 | + $post->$type['htmlvar_name'] = implode(', ', $post->$type['htmlvar_name']);
|
|
| 2759 | + } |
|
| 2760 | + |
|
| 2761 | + if (strpos($field_icon, 'http') !== false) {
|
|
| 2762 | + $field_icon_af = ''; |
|
| 2763 | + } elseif ($field_icon == '') {
|
|
| 2764 | + $field_icon_af = ''; |
|
| 2765 | + } else {
|
|
| 2766 | + $field_icon_af = $field_icon; |
|
| 2767 | + $field_icon = ''; |
|
| 2768 | + } |
|
| 2769 | + |
|
| 2770 | + $field_values = explode(',', trim($post->$type['htmlvar_name'], ","));
|
|
| 2771 | + |
|
| 2772 | + $option_values = array(); |
|
| 2773 | + if (!empty($type['option_values'])) {
|
|
| 2774 | + $cf_option_values = geodir_string_values_to_options(stripslashes_deep($type['option_values']), true); |
|
| 2775 | 2775 | |
| 2776 | - if (!empty($cf_option_values)) {
|
|
| 2777 | - foreach ($cf_option_values as $cf_option_value) {
|
|
| 2778 | - if (isset($cf_option_value['value']) && in_array($cf_option_value['value'], $field_values)) {
|
|
| 2779 | - $option_values[] = $cf_option_value['label']; |
|
| 2780 | - } |
|
| 2781 | - } |
|
| 2782 | - } |
|
| 2783 | - } |
|
| 2784 | - |
|
| 2785 | - $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
| 2786 | - |
|
| 2787 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af; |
|
| 2788 | - if ($field_set_start == 1 && $site_title != '') {
|
|
| 2789 | - $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
| 2790 | - } |
|
| 2791 | - $html .= ' </span>'; |
|
| 2792 | - |
|
| 2793 | - if (count($option_values) > 1) {
|
|
| 2794 | - $html .= '<ul>'; |
|
| 2795 | - foreach ($option_values as $val) {
|
|
| 2796 | - $html .= '<li>' . $val . '</li>'; |
|
| 2797 | - } |
|
| 2798 | - $html .= '</ul>'; |
|
| 2799 | - } else {
|
|
| 2800 | - $html .= $post->$type['htmlvar_name']; |
|
| 2801 | - } |
|
| 2802 | - $html .= '</div>'; |
|
| 2803 | - } |
|
| 2804 | - break; |
|
| 2805 | - case 'email': {
|
|
| 2806 | - if (strpos($field_icon, 'http') !== false) {
|
|
| 2807 | - $field_icon_af = ''; |
|
| 2808 | - } elseif ($field_icon == '') {
|
|
| 2809 | - $field_icon_af = '<i class="fa fa-envelope"></i>'; |
|
| 2810 | - } else {
|
|
| 2811 | - $field_icon_af = $field_icon; |
|
| 2812 | - $field_icon = ''; |
|
| 2813 | - } |
|
| 2814 | - |
|
| 2815 | - $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
| 2816 | - |
|
| 2817 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af; |
|
| 2818 | - if ($field_set_start == 1 && $site_title != '') {
|
|
| 2819 | - $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
| 2820 | - } |
|
| 2821 | - $html .= ' </span>' . stripslashes($post->$type['htmlvar_name']) . '</div>'; |
|
| 2822 | - } |
|
| 2823 | - break; |
|
| 2824 | - case 'textarea': {
|
|
| 2825 | - if (strpos($field_icon, 'http') !== false) {
|
|
| 2826 | - $field_icon_af = ''; |
|
| 2827 | - } elseif ($field_icon == '') {
|
|
| 2828 | - $field_icon_af = ''; |
|
| 2829 | - } else {
|
|
| 2830 | - $field_icon_af = $field_icon; |
|
| 2831 | - $field_icon = ''; |
|
| 2832 | - } |
|
| 2833 | - |
|
| 2834 | - $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
| 2835 | - |
|
| 2836 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af; |
|
| 2837 | - if ($field_set_start == 1 && $site_title != '') {
|
|
| 2838 | - $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
| 2839 | - } |
|
| 2840 | - $html .= '</span>' . wpautop(stripslashes($post->$type['htmlvar_name'])) . '</div>'; |
|
| 2841 | - } |
|
| 2842 | - break; |
|
| 2843 | - case 'html': {
|
|
| 2844 | - if (strpos($field_icon, 'http') !== false) {
|
|
| 2845 | - $field_icon_af = ''; |
|
| 2846 | - } elseif ($field_icon == '') {
|
|
| 2847 | - $field_icon_af = ''; |
|
| 2848 | - } else {
|
|
| 2849 | - $field_icon_af = $field_icon; |
|
| 2850 | - $field_icon = ''; |
|
| 2851 | - } |
|
| 2852 | - |
|
| 2853 | - $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
| 2854 | - |
|
| 2855 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af; |
|
| 2856 | - if ($field_set_start == 1 && $site_title != '') {
|
|
| 2857 | - $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
| 2858 | - } |
|
| 2859 | - $html .= ' </span>' . wpautop(stripslashes($post->$type['htmlvar_name'])) . '</div>'; |
|
| 2860 | - } |
|
| 2861 | - break; |
|
| 2862 | - case 'file': {
|
|
| 2863 | - $html_var = $type['htmlvar_name']; |
|
| 2864 | - |
|
| 2865 | - if (!empty($post->$type['htmlvar_name'])) {
|
|
| 2866 | - $files = explode(",", $post->$type['htmlvar_name']);
|
|
| 2867 | - |
|
| 2868 | - if (!empty($files)) {
|
|
| 2869 | - $extra_fields = !empty($type['extra_fields']) ? maybe_unserialize($type['extra_fields']) : NULL; |
|
| 2870 | - $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'] : '';
|
|
| 2776 | + if (!empty($cf_option_values)) {
|
|
| 2777 | + foreach ($cf_option_values as $cf_option_value) {
|
|
| 2778 | + if (isset($cf_option_value['value']) && in_array($cf_option_value['value'], $field_values)) {
|
|
| 2779 | + $option_values[] = $cf_option_value['label']; |
|
| 2780 | + } |
|
| 2781 | + } |
|
| 2782 | + } |
|
| 2783 | + } |
|
| 2784 | + |
|
| 2785 | + $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
| 2786 | + |
|
| 2787 | + $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af; |
|
| 2788 | + if ($field_set_start == 1 && $site_title != '') {
|
|
| 2789 | + $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
| 2790 | + } |
|
| 2791 | + $html .= ' </span>'; |
|
| 2792 | + |
|
| 2793 | + if (count($option_values) > 1) {
|
|
| 2794 | + $html .= '<ul>'; |
|
| 2795 | + foreach ($option_values as $val) {
|
|
| 2796 | + $html .= '<li>' . $val . '</li>'; |
|
| 2797 | + } |
|
| 2798 | + $html .= '</ul>'; |
|
| 2799 | + } else {
|
|
| 2800 | + $html .= $post->$type['htmlvar_name']; |
|
| 2801 | + } |
|
| 2802 | + $html .= '</div>'; |
|
| 2803 | + } |
|
| 2804 | + break; |
|
| 2805 | + case 'email': {
|
|
| 2806 | + if (strpos($field_icon, 'http') !== false) {
|
|
| 2807 | + $field_icon_af = ''; |
|
| 2808 | + } elseif ($field_icon == '') {
|
|
| 2809 | + $field_icon_af = '<i class="fa fa-envelope"></i>'; |
|
| 2810 | + } else {
|
|
| 2811 | + $field_icon_af = $field_icon; |
|
| 2812 | + $field_icon = ''; |
|
| 2813 | + } |
|
| 2814 | + |
|
| 2815 | + $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
| 2816 | + |
|
| 2817 | + $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af; |
|
| 2818 | + if ($field_set_start == 1 && $site_title != '') {
|
|
| 2819 | + $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
| 2820 | + } |
|
| 2821 | + $html .= ' </span>' . stripslashes($post->$type['htmlvar_name']) . '</div>'; |
|
| 2822 | + } |
|
| 2823 | + break; |
|
| 2824 | + case 'textarea': {
|
|
| 2825 | + if (strpos($field_icon, 'http') !== false) {
|
|
| 2826 | + $field_icon_af = ''; |
|
| 2827 | + } elseif ($field_icon == '') {
|
|
| 2828 | + $field_icon_af = ''; |
|
| 2829 | + } else {
|
|
| 2830 | + $field_icon_af = $field_icon; |
|
| 2831 | + $field_icon = ''; |
|
| 2832 | + } |
|
| 2833 | + |
|
| 2834 | + $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
| 2835 | + |
|
| 2836 | + $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af; |
|
| 2837 | + if ($field_set_start == 1 && $site_title != '') {
|
|
| 2838 | + $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
| 2839 | + } |
|
| 2840 | + $html .= '</span>' . wpautop(stripslashes($post->$type['htmlvar_name'])) . '</div>'; |
|
| 2841 | + } |
|
| 2842 | + break; |
|
| 2843 | + case 'html': {
|
|
| 2844 | + if (strpos($field_icon, 'http') !== false) {
|
|
| 2845 | + $field_icon_af = ''; |
|
| 2846 | + } elseif ($field_icon == '') {
|
|
| 2847 | + $field_icon_af = ''; |
|
| 2848 | + } else {
|
|
| 2849 | + $field_icon_af = $field_icon; |
|
| 2850 | + $field_icon = ''; |
|
| 2851 | + } |
|
| 2852 | + |
|
| 2853 | + $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
| 2854 | + |
|
| 2855 | + $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af; |
|
| 2856 | + if ($field_set_start == 1 && $site_title != '') {
|
|
| 2857 | + $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
| 2858 | + } |
|
| 2859 | + $html .= ' </span>' . wpautop(stripslashes($post->$type['htmlvar_name'])) . '</div>'; |
|
| 2860 | + } |
|
| 2861 | + break; |
|
| 2862 | + case 'file': {
|
|
| 2863 | + $html_var = $type['htmlvar_name']; |
|
| 2864 | + |
|
| 2865 | + if (!empty($post->$type['htmlvar_name'])) {
|
|
| 2866 | + $files = explode(",", $post->$type['htmlvar_name']);
|
|
| 2867 | + |
|
| 2868 | + if (!empty($files)) {
|
|
| 2869 | + $extra_fields = !empty($type['extra_fields']) ? maybe_unserialize($type['extra_fields']) : NULL; |
|
| 2870 | + $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'] : '';
|
|
| 2871 | 2871 | |
| 2872 | - $file_paths = ''; |
|
| 2873 | - foreach ($files as $file) {
|
|
| 2874 | - if (!empty($file)) {
|
|
| 2875 | - $filetype = wp_check_filetype($file); |
|
| 2876 | - $image_name_arr = explode('/', $file);
|
|
| 2877 | - $curr_img_dir = $image_name_arr[count($image_name_arr) - 2]; |
|
| 2878 | - $filename = end($image_name_arr); |
|
| 2879 | - $img_name_arr = explode('.', $filename);
|
|
| 2880 | - |
|
| 2881 | - $arr_file_type = wp_check_filetype($filename); |
|
| 2882 | - if (empty($arr_file_type['ext']) || empty($arr_file_type['type'])) {
|
|
| 2883 | - continue; |
|
| 2884 | - } |
|
| 2885 | - $uploaded_file_type = $arr_file_type['type']; |
|
| 2886 | - $uploaded_file_ext = $arr_file_type['ext']; |
|
| 2872 | + $file_paths = ''; |
|
| 2873 | + foreach ($files as $file) {
|
|
| 2874 | + if (!empty($file)) {
|
|
| 2875 | + $filetype = wp_check_filetype($file); |
|
| 2876 | + $image_name_arr = explode('/', $file);
|
|
| 2877 | + $curr_img_dir = $image_name_arr[count($image_name_arr) - 2]; |
|
| 2878 | + $filename = end($image_name_arr); |
|
| 2879 | + $img_name_arr = explode('.', $filename);
|
|
| 2880 | + |
|
| 2881 | + $arr_file_type = wp_check_filetype($filename); |
|
| 2882 | + if (empty($arr_file_type['ext']) || empty($arr_file_type['type'])) {
|
|
| 2883 | + continue; |
|
| 2884 | + } |
|
| 2885 | + $uploaded_file_type = $arr_file_type['type']; |
|
| 2886 | + $uploaded_file_ext = $arr_file_type['ext']; |
|
| 2887 | 2887 | |
| 2888 | - if (!empty($allowed_file_types) && !in_array($uploaded_file_ext, $allowed_file_types)) {
|
|
| 2889 | - continue; // Invalid file type. |
|
| 2890 | - } |
|
| 2891 | - |
|
| 2892 | - //$allowed_file_types = array('application/pdf', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'text/csv', 'text/plain');
|
|
| 2893 | - $image_file_types = array('image/jpg', 'image/jpeg', 'image/gif', 'image/png', 'image/bmp', 'image/x-icon');
|
|
| 2894 | - |
|
| 2895 | - // If the uploaded file is image |
|
| 2896 | - if (in_array($uploaded_file_type, $image_file_types)) {
|
|
| 2897 | - $file_paths .= '<div class="geodir-custom-post-gallery" class="clearfix">'; |
|
| 2898 | - $file_paths .= '<a href="'.$file.'">'; |
|
| 2899 | - $file_paths .= geodir_show_image(array('src' => $file), 'thumbnail', false, false);
|
|
| 2900 | - $file_paths .= '</a>'; |
|
| 2901 | - $file_paths .= '</div>'; |
|
| 2902 | - } else {
|
|
| 2903 | - $ext_path = '_' . $html_var . '_'; |
|
| 2904 | - $filename = explode($ext_path, $filename); |
|
| 2905 | - $file_paths .= '<a href="' . $file . '" target="_blank">' . $filename[count($filename) - 1] . '</a>'; |
|
| 2906 | - } |
|
| 2907 | - } |
|
| 2908 | - } |
|
| 2909 | - |
|
| 2910 | - if (strpos($field_icon, 'http') !== false) {
|
|
| 2911 | - $field_icon_af = ''; |
|
| 2912 | - } else if ($field_icon == '') {
|
|
| 2913 | - $field_icon_af = ''; |
|
| 2914 | - } else {
|
|
| 2915 | - $field_icon_af = $field_icon; |
|
| 2916 | - $field_icon = ''; |
|
| 2917 | - } |
|
| 2918 | - |
|
| 2919 | - $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
| 2920 | - |
|
| 2921 | - |
|
| 2922 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . ' geodir-custom-file-box" style="clear:both;"><span class="geodir-i-file" style="display:inline-block;vertical-align:top;padding-right:14px;' . $field_icon . '">' . $field_icon_af; |
|
| 2923 | - |
|
| 2924 | - if ($field_set_start == 1 && $site_title != '') {
|
|
| 2925 | - $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
| 2926 | - } |
|
| 2927 | - |
|
| 2928 | - $html .= ' </span>' . $file_paths . '</div>'; |
|
| 2929 | - } |
|
| 2930 | - } |
|
| 2931 | - } |
|
| 2932 | - break; |
|
| 2933 | - } |
|
| 2934 | - |
|
| 2935 | - |
|
| 2936 | - /** |
|
| 2937 | - * Filter custom field output in tab. |
|
| 2938 | - * |
|
| 2939 | - * @since 1.5.6 |
|
| 2940 | - * |
|
| 2941 | - * @param string $html_var The HTML variable name for the field. |
|
| 2942 | - * @param string $html Custom field unfiltered HTML. |
|
| 2943 | - * @param array $variables_array Custom field variables array. |
|
| 2944 | - */ |
|
| 2945 | - $html = apply_filters("geodir_tab_show_{$html_var}", $html, $variables_array);
|
|
| 2946 | - |
|
| 2947 | - |
|
| 2948 | - if ($field_set_start == 1) {
|
|
| 2949 | - $add_html = false; |
|
| 2950 | - if ($type['type'] == 'fieldset' && $fieldset_count > 1) {
|
|
| 2951 | - if ($fieldset != '') {
|
|
| 2952 | - $add_html = true; |
|
| 2953 | - $label = $fieldset_arr[$fieldset_count - 1]['label']; |
|
| 2954 | - $htmlvar_name = $fieldset_arr[$fieldset_count - 1]['htmlvar_name']; |
|
| 2955 | - } |
|
| 2956 | - $fieldset_html = $fieldset; |
|
| 2957 | - $fieldset = ''; |
|
| 2958 | - } else {
|
|
| 2959 | - $fieldset .= $html; |
|
| 2960 | - if ($total_fields == $count_field && $fieldset != '') {
|
|
| 2961 | - $add_html = true; |
|
| 2962 | - $label = $fieldset_arr[$fieldset_count]['label']; |
|
| 2963 | - $htmlvar_name = $fieldset_arr[$fieldset_count]['htmlvar_name']; |
|
| 2964 | - $fieldset_html = $fieldset; |
|
| 2965 | - } |
|
| 2966 | - } |
|
| 2967 | - |
|
| 2968 | - if ($add_html) {
|
|
| 2969 | - $tabs_arr[$htmlvar_name] = array( |
|
| 2970 | - 'heading_text' => __($label, 'geodirectory'), |
|
| 2971 | - 'is_active_tab' => false, |
|
| 2972 | - /** |
|
| 2973 | - * Filter if a custom field should be displayed on the details page tab. |
|
| 2974 | - * |
|
| 2975 | - * @since 1.0.0 |
|
| 2976 | - * @param string $htmlvar_name The field HTML var name. |
|
| 2977 | - */ |
|
| 2978 | - 'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $htmlvar_name),
|
|
| 2979 | - 'tab_content' => '<div class="geodir-company_info field-group">' . $fieldset_html . '</html>' |
|
| 2980 | - ); |
|
| 2981 | - } |
|
| 2982 | - } else {
|
|
| 2983 | - if ($html != '') {
|
|
| 2984 | - $tabs_arr[$field['htmlvar_name']] = array( |
|
| 2985 | - 'heading_text' => __($label, 'geodirectory'), |
|
| 2986 | - 'is_active_tab' => false, |
|
| 2987 | - /** This action is documented in geodirectory_hooks_actions.php */ |
|
| 2988 | - 'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $field['htmlvar_name']),
|
|
| 2989 | - 'tab_content' => $html |
|
| 2990 | - ); |
|
| 2991 | - } |
|
| 2992 | - } |
|
| 2993 | - } |
|
| 2994 | - } |
|
| 2995 | - } |
|
| 2996 | - } |
|
| 2997 | - return $tabs_arr; |
|
| 2888 | + if (!empty($allowed_file_types) && !in_array($uploaded_file_ext, $allowed_file_types)) {
|
|
| 2889 | + continue; // Invalid file type. |
|
| 2890 | + } |
|
| 2891 | + |
|
| 2892 | + //$allowed_file_types = array('application/pdf', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'text/csv', 'text/plain');
|
|
| 2893 | + $image_file_types = array('image/jpg', 'image/jpeg', 'image/gif', 'image/png', 'image/bmp', 'image/x-icon');
|
|
| 2894 | + |
|
| 2895 | + // If the uploaded file is image |
|
| 2896 | + if (in_array($uploaded_file_type, $image_file_types)) {
|
|
| 2897 | + $file_paths .= '<div class="geodir-custom-post-gallery" class="clearfix">'; |
|
| 2898 | + $file_paths .= '<a href="'.$file.'">'; |
|
| 2899 | + $file_paths .= geodir_show_image(array('src' => $file), 'thumbnail', false, false);
|
|
| 2900 | + $file_paths .= '</a>'; |
|
| 2901 | + $file_paths .= '</div>'; |
|
| 2902 | + } else {
|
|
| 2903 | + $ext_path = '_' . $html_var . '_'; |
|
| 2904 | + $filename = explode($ext_path, $filename); |
|
| 2905 | + $file_paths .= '<a href="' . $file . '" target="_blank">' . $filename[count($filename) - 1] . '</a>'; |
|
| 2906 | + } |
|
| 2907 | + } |
|
| 2908 | + } |
|
| 2909 | + |
|
| 2910 | + if (strpos($field_icon, 'http') !== false) {
|
|
| 2911 | + $field_icon_af = ''; |
|
| 2912 | + } else if ($field_icon == '') {
|
|
| 2913 | + $field_icon_af = ''; |
|
| 2914 | + } else {
|
|
| 2915 | + $field_icon_af = $field_icon; |
|
| 2916 | + $field_icon = ''; |
|
| 2917 | + } |
|
| 2918 | + |
|
| 2919 | + $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
| 2920 | + |
|
| 2921 | + |
|
| 2922 | + $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . ' geodir-custom-file-box" style="clear:both;"><span class="geodir-i-file" style="display:inline-block;vertical-align:top;padding-right:14px;' . $field_icon . '">' . $field_icon_af; |
|
| 2923 | + |
|
| 2924 | + if ($field_set_start == 1 && $site_title != '') {
|
|
| 2925 | + $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
| 2926 | + } |
|
| 2927 | + |
|
| 2928 | + $html .= ' </span>' . $file_paths . '</div>'; |
|
| 2929 | + } |
|
| 2930 | + } |
|
| 2931 | + } |
|
| 2932 | + break; |
|
| 2933 | + } |
|
| 2934 | + |
|
| 2935 | + |
|
| 2936 | + /** |
|
| 2937 | + * Filter custom field output in tab. |
|
| 2938 | + * |
|
| 2939 | + * @since 1.5.6 |
|
| 2940 | + * |
|
| 2941 | + * @param string $html_var The HTML variable name for the field. |
|
| 2942 | + * @param string $html Custom field unfiltered HTML. |
|
| 2943 | + * @param array $variables_array Custom field variables array. |
|
| 2944 | + */ |
|
| 2945 | + $html = apply_filters("geodir_tab_show_{$html_var}", $html, $variables_array);
|
|
| 2946 | + |
|
| 2947 | + |
|
| 2948 | + if ($field_set_start == 1) {
|
|
| 2949 | + $add_html = false; |
|
| 2950 | + if ($type['type'] == 'fieldset' && $fieldset_count > 1) {
|
|
| 2951 | + if ($fieldset != '') {
|
|
| 2952 | + $add_html = true; |
|
| 2953 | + $label = $fieldset_arr[$fieldset_count - 1]['label']; |
|
| 2954 | + $htmlvar_name = $fieldset_arr[$fieldset_count - 1]['htmlvar_name']; |
|
| 2955 | + } |
|
| 2956 | + $fieldset_html = $fieldset; |
|
| 2957 | + $fieldset = ''; |
|
| 2958 | + } else {
|
|
| 2959 | + $fieldset .= $html; |
|
| 2960 | + if ($total_fields == $count_field && $fieldset != '') {
|
|
| 2961 | + $add_html = true; |
|
| 2962 | + $label = $fieldset_arr[$fieldset_count]['label']; |
|
| 2963 | + $htmlvar_name = $fieldset_arr[$fieldset_count]['htmlvar_name']; |
|
| 2964 | + $fieldset_html = $fieldset; |
|
| 2965 | + } |
|
| 2966 | + } |
|
| 2967 | + |
|
| 2968 | + if ($add_html) {
|
|
| 2969 | + $tabs_arr[$htmlvar_name] = array( |
|
| 2970 | + 'heading_text' => __($label, 'geodirectory'), |
|
| 2971 | + 'is_active_tab' => false, |
|
| 2972 | + /** |
|
| 2973 | + * Filter if a custom field should be displayed on the details page tab. |
|
| 2974 | + * |
|
| 2975 | + * @since 1.0.0 |
|
| 2976 | + * @param string $htmlvar_name The field HTML var name. |
|
| 2977 | + */ |
|
| 2978 | + 'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $htmlvar_name),
|
|
| 2979 | + 'tab_content' => '<div class="geodir-company_info field-group">' . $fieldset_html . '</html>' |
|
| 2980 | + ); |
|
| 2981 | + } |
|
| 2982 | + } else {
|
|
| 2983 | + if ($html != '') {
|
|
| 2984 | + $tabs_arr[$field['htmlvar_name']] = array( |
|
| 2985 | + 'heading_text' => __($label, 'geodirectory'), |
|
| 2986 | + 'is_active_tab' => false, |
|
| 2987 | + /** This action is documented in geodirectory_hooks_actions.php */ |
|
| 2988 | + 'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $field['htmlvar_name']),
|
|
| 2989 | + 'tab_content' => $html |
|
| 2990 | + ); |
|
| 2991 | + } |
|
| 2992 | + } |
|
| 2993 | + } |
|
| 2994 | + } |
|
| 2995 | + } |
|
| 2996 | + } |
|
| 2997 | + return $tabs_arr; |
|
| 2998 | 2998 | } |
| 2999 | 2999 | |
| 3000 | 3000 | /* display add listing page for wpml */ |
@@ -3018,37 +3018,37 @@ discard block |
||
| 3018 | 3018 | */ |
| 3019 | 3019 | function geodir_add_post_status_author_page() |
| 3020 | 3020 | {
|
| 3021 | - global $wpdb, $post; |
|
| 3022 | - |
|
| 3023 | - $html = ''; |
|
| 3024 | - if (get_current_user_id()) {
|
|
| 3025 | - if (geodir_is_page('author') && !empty($post) && isset($post->post_author) && $post->post_author == get_current_user_id()) {
|
|
| 3026 | - |
|
| 3027 | - // we need to query real status direct as we dynamically change the status for author on author page so even non author status can view them. |
|
| 3028 | - $real_status = $wpdb->get_var("SELECT post_status from $wpdb->posts WHERE ID=$post->ID");
|
|
| 3029 | - $status = "<strong>(";
|
|
| 3030 | - $status_icon = '<i class="fa fa-play"></i>'; |
|
| 3031 | - if ($real_status == 'publish') {
|
|
| 3032 | - $status .= __('Published', 'geodirectory');
|
|
| 3033 | - } else {
|
|
| 3034 | - $status .= __('Not published', 'geodirectory');
|
|
| 3035 | - $status_icon = '<i class="fa fa-pause"></i>'; |
|
| 3036 | - } |
|
| 3037 | - $status .= ")</strong>"; |
|
| 3021 | + global $wpdb, $post; |
|
| 3022 | + |
|
| 3023 | + $html = ''; |
|
| 3024 | + if (get_current_user_id()) {
|
|
| 3025 | + if (geodir_is_page('author') && !empty($post) && isset($post->post_author) && $post->post_author == get_current_user_id()) {
|
|
| 3026 | + |
|
| 3027 | + // we need to query real status direct as we dynamically change the status for author on author page so even non author status can view them. |
|
| 3028 | + $real_status = $wpdb->get_var("SELECT post_status from $wpdb->posts WHERE ID=$post->ID");
|
|
| 3029 | + $status = "<strong>(";
|
|
| 3030 | + $status_icon = '<i class="fa fa-play"></i>'; |
|
| 3031 | + if ($real_status == 'publish') {
|
|
| 3032 | + $status .= __('Published', 'geodirectory');
|
|
| 3033 | + } else {
|
|
| 3034 | + $status .= __('Not published', 'geodirectory');
|
|
| 3035 | + $status_icon = '<i class="fa fa-pause"></i>'; |
|
| 3036 | + } |
|
| 3037 | + $status .= ")</strong>"; |
|
| 3038 | 3038 | |
| 3039 | - $html = '<span class="geodir-post-status">' . $status_icon . ' <font class="geodir-status-label">' . __('Status: ', 'geodirectory') . '</font>' . $status . '</span>';
|
|
| 3040 | - } |
|
| 3041 | - } |
|
| 3039 | + $html = '<span class="geodir-post-status">' . $status_icon . ' <font class="geodir-status-label">' . __('Status: ', 'geodirectory') . '</font>' . $status . '</span>';
|
|
| 3040 | + } |
|
| 3041 | + } |
|
| 3042 | 3042 | |
| 3043 | - if ($html != '') {
|
|
| 3044 | - /** |
|
| 3045 | - * Filter the post status text on the author page. |
|
| 3046 | - * |
|
| 3047 | - * @since 1.0.0 |
|
| 3048 | - * @param string $html The HTML of the status. |
|
| 3049 | - */ |
|
| 3050 | - echo apply_filters('geodir_filter_status_text_on_author_page', $html);
|
|
| 3051 | - } |
|
| 3043 | + if ($html != '') {
|
|
| 3044 | + /** |
|
| 3045 | + * Filter the post status text on the author page. |
|
| 3046 | + * |
|
| 3047 | + * @since 1.0.0 |
|
| 3048 | + * @param string $html The HTML of the status. |
|
| 3049 | + */ |
|
| 3050 | + echo apply_filters('geodir_filter_status_text_on_author_page', $html);
|
|
| 3051 | + } |
|
| 3052 | 3052 | |
| 3053 | 3053 | |
| 3054 | 3054 | } |
@@ -3062,21 +3062,21 @@ discard block |
||
| 3062 | 3062 | */ |
| 3063 | 3063 | function geodir_init_no_rating() |
| 3064 | 3064 | {
|
| 3065 | - if (get_option('geodir_disable_rating')) {
|
|
| 3066 | - remove_action('comment_form_logged_in_after', 'geodir_comment_rating_fields');
|
|
| 3067 | - remove_action('comment_form_before_fields', 'geodir_comment_rating_fields');
|
|
| 3068 | - remove_action('comment_form_logged_in_after', 'geodir_reviewrating_comment_rating_fields');
|
|
| 3069 | - remove_action('comment_form_before_fields', 'geodir_reviewrating_comment_rating_fields');
|
|
| 3070 | - remove_action('add_meta_boxes_comment', 'geodir_comment_add_meta_box');
|
|
| 3071 | - remove_action('add_meta_boxes', 'geodir_reviewrating_comment_metabox', 13);
|
|
| 3072 | - remove_filter('comment_text', 'geodir_wrap_comment_text', 40);
|
|
| 3073 | - |
|
| 3074 | - add_action('comment_form_logged_in_after', 'geodir_no_rating_rating_fields');
|
|
| 3075 | - add_action('comment_form_before_fields', 'geodir_no_rating_rating_fields');
|
|
| 3076 | - add_filter('comment_text', 'geodir_no_rating_comment_text', 100, 2);
|
|
| 3077 | - add_filter('geodir_detail_page_review_rating_html', 'geodir_no_rating_review_rating_html', 100);
|
|
| 3078 | - add_filter('geodir_get_sort_options', 'geodir_no_rating_get_sort_options', 100, 2);
|
|
| 3079 | - } |
|
| 3065 | + if (get_option('geodir_disable_rating')) {
|
|
| 3066 | + remove_action('comment_form_logged_in_after', 'geodir_comment_rating_fields');
|
|
| 3067 | + remove_action('comment_form_before_fields', 'geodir_comment_rating_fields');
|
|
| 3068 | + remove_action('comment_form_logged_in_after', 'geodir_reviewrating_comment_rating_fields');
|
|
| 3069 | + remove_action('comment_form_before_fields', 'geodir_reviewrating_comment_rating_fields');
|
|
| 3070 | + remove_action('add_meta_boxes_comment', 'geodir_comment_add_meta_box');
|
|
| 3071 | + remove_action('add_meta_boxes', 'geodir_reviewrating_comment_metabox', 13);
|
|
| 3072 | + remove_filter('comment_text', 'geodir_wrap_comment_text', 40);
|
|
| 3073 | + |
|
| 3074 | + add_action('comment_form_logged_in_after', 'geodir_no_rating_rating_fields');
|
|
| 3075 | + add_action('comment_form_before_fields', 'geodir_no_rating_rating_fields');
|
|
| 3076 | + add_filter('comment_text', 'geodir_no_rating_comment_text', 100, 2);
|
|
| 3077 | + add_filter('geodir_detail_page_review_rating_html', 'geodir_no_rating_review_rating_html', 100);
|
|
| 3078 | + add_filter('geodir_get_sort_options', 'geodir_no_rating_get_sort_options', 100, 2);
|
|
| 3079 | + } |
|
| 3080 | 3080 | } |
| 3081 | 3081 | |
| 3082 | 3082 | /** |
@@ -3088,20 +3088,20 @@ discard block |
||
| 3088 | 3088 | */ |
| 3089 | 3089 | function geodir_no_rating_rating_fields() |
| 3090 | 3090 | {
|
| 3091 | - global $post; |
|
| 3091 | + global $post; |
|
| 3092 | 3092 | |
| 3093 | - $post_types = geodir_get_posttypes(); |
|
| 3093 | + $post_types = geodir_get_posttypes(); |
|
| 3094 | 3094 | |
| 3095 | - if (!empty($post) && isset($post->post_type) && in_array($post->post_type, $post_types)) {
|
|
| 3096 | - if (is_plugin_active('geodir_review_rating_manager/geodir_review_rating_manager.php')) {
|
|
| 3097 | - echo '<input type="hidden" value="1" name="geodir_rating[overall]" />'; |
|
| 3098 | - if (get_option('geodir_reviewrating_enable_images')) {
|
|
| 3099 | - geodir_reviewrating_rating_img_html(); |
|
| 3100 | - } |
|
| 3101 | - } else {
|
|
| 3102 | - echo '<input type="hidden" id="geodir_overallrating" name="geodir_overallrating" value="1" />'; |
|
| 3103 | - } |
|
| 3104 | - } |
|
| 3095 | + if (!empty($post) && isset($post->post_type) && in_array($post->post_type, $post_types)) {
|
|
| 3096 | + if (is_plugin_active('geodir_review_rating_manager/geodir_review_rating_manager.php')) {
|
|
| 3097 | + echo '<input type="hidden" value="1" name="geodir_rating[overall]" />'; |
|
| 3098 | + if (get_option('geodir_reviewrating_enable_images')) {
|
|
| 3099 | + geodir_reviewrating_rating_img_html(); |
|
| 3100 | + } |
|
| 3101 | + } else {
|
|
| 3102 | + echo '<input type="hidden" id="geodir_overallrating" name="geodir_overallrating" value="1" />'; |
|
| 3103 | + } |
|
| 3104 | + } |
|
| 3105 | 3105 | } |
| 3106 | 3106 | |
| 3107 | 3107 | /** |
@@ -3115,11 +3115,11 @@ discard block |
||
| 3115 | 3115 | */ |
| 3116 | 3116 | function geodir_no_rating_comment_text($content, $comment = '') |
| 3117 | 3117 | {
|
| 3118 | - if (!is_admin()) {
|
|
| 3119 | - return '<div class="description">' . $content . '</div>'; |
|
| 3120 | - } else {
|
|
| 3121 | - return $content; |
|
| 3122 | - } |
|
| 3118 | + if (!is_admin()) {
|
|
| 3119 | + return '<div class="description">' . $content . '</div>'; |
|
| 3120 | + } else {
|
|
| 3121 | + return $content; |
|
| 3122 | + } |
|
| 3123 | 3123 | } |
| 3124 | 3124 | |
| 3125 | 3125 | /** |
@@ -3132,7 +3132,7 @@ discard block |
||
| 3132 | 3132 | */ |
| 3133 | 3133 | function geodir_no_rating_review_rating_html($content = '') |
| 3134 | 3134 | {
|
| 3135 | - return NULL; |
|
| 3135 | + return NULL; |
|
| 3136 | 3136 | } |
| 3137 | 3137 | |
| 3138 | 3138 | /** |
@@ -3146,19 +3146,19 @@ discard block |
||
| 3146 | 3146 | */ |
| 3147 | 3147 | function geodir_no_rating_get_sort_options($options, $post_type = '') |
| 3148 | 3148 | {
|
| 3149 | - $new_options = array(); |
|
| 3150 | - if (!empty($options)) {
|
|
| 3151 | - foreach ($options as $option) {
|
|
| 3152 | - if (is_object($option) && isset($option->htmlvar_name) && $option->htmlvar_name == 'overall_rating') {
|
|
| 3153 | - continue; |
|
| 3154 | - } |
|
| 3155 | - $new_options[] = $option; |
|
| 3156 | - } |
|
| 3149 | + $new_options = array(); |
|
| 3150 | + if (!empty($options)) {
|
|
| 3151 | + foreach ($options as $option) {
|
|
| 3152 | + if (is_object($option) && isset($option->htmlvar_name) && $option->htmlvar_name == 'overall_rating') {
|
|
| 3153 | + continue; |
|
| 3154 | + } |
|
| 3155 | + $new_options[] = $option; |
|
| 3156 | + } |
|
| 3157 | 3157 | |
| 3158 | - $options = $new_options; |
|
| 3159 | - } |
|
| 3158 | + $options = $new_options; |
|
| 3159 | + } |
|
| 3160 | 3160 | |
| 3161 | - return $options; |
|
| 3161 | + return $options; |
|
| 3162 | 3162 | } |
| 3163 | 3163 | |
| 3164 | 3164 | add_filter('geodir_all_js_msg', 'geodir_all_js_msg_no_rating', 100);
|
@@ -3172,11 +3172,11 @@ discard block |
||
| 3172 | 3172 | */ |
| 3173 | 3173 | function geodir_all_js_msg_no_rating($msg = array()) |
| 3174 | 3174 | {
|
| 3175 | - if (get_option('geodir_disable_rating')) {
|
|
| 3176 | - $msg['gd_cmt_no_rating'] = true; |
|
| 3177 | - } |
|
| 3175 | + if (get_option('geodir_disable_rating')) {
|
|
| 3176 | + $msg['gd_cmt_no_rating'] = true; |
|
| 3177 | + } |
|
| 3178 | 3178 | |
| 3179 | - return $msg; |
|
| 3179 | + return $msg; |
|
| 3180 | 3180 | } |
| 3181 | 3181 | |
| 3182 | 3182 | add_filter('body_class', 'geodir_body_class_no_rating', 100);
|
@@ -3190,11 +3190,11 @@ discard block |
||
| 3190 | 3190 | */ |
| 3191 | 3191 | function geodir_body_class_no_rating($classes = array()) |
| 3192 | 3192 | {
|
| 3193 | - if (get_option('geodir_disable_rating')) {
|
|
| 3194 | - $classes[] = 'gd-no-rating'; |
|
| 3195 | - } |
|
| 3193 | + if (get_option('geodir_disable_rating')) {
|
|
| 3194 | + $classes[] = 'gd-no-rating'; |
|
| 3195 | + } |
|
| 3196 | 3196 | |
| 3197 | - return $classes; |
|
| 3197 | + return $classes; |
|
| 3198 | 3198 | } |
| 3199 | 3199 | |
| 3200 | 3200 | add_filter('admin_body_class', 'geodir_admin_body_class_no_rating', 100);
|
@@ -3208,11 +3208,11 @@ discard block |
||
| 3208 | 3208 | */ |
| 3209 | 3209 | function geodir_admin_body_class_no_rating($class = '') |
| 3210 | 3210 | {
|
| 3211 | - if (get_option('geodir_disable_rating')) {
|
|
| 3212 | - $class .= ' gd-no-rating'; |
|
| 3213 | - } |
|
| 3211 | + if (get_option('geodir_disable_rating')) {
|
|
| 3212 | + $class .= ' gd-no-rating'; |
|
| 3213 | + } |
|
| 3214 | 3214 | |
| 3215 | - return $class; |
|
| 3215 | + return $class; |
|
| 3216 | 3216 | } |
| 3217 | 3217 | |
| 3218 | 3218 | add_action('wp_head', 'geodir_wp_head_no_rating');
|
@@ -3225,10 +3225,10 @@ discard block |
||
| 3225 | 3225 | */ |
| 3226 | 3226 | function geodir_wp_head_no_rating() |
| 3227 | 3227 | {
|
| 3228 | - if (get_option('geodir_disable_rating')) {
|
|
| 3229 | - echo '<style>body .geodir-rating, body .geodir-bubble-rating, body .gd_ratings_module_box{display:none!important;}</style>';
|
|
| 3230 | - echo '<script type="text/javascript">jQuery(function(){jQuery(".gd_rating_show").parent(".geodir-rating").remove();});</script>';
|
|
| 3231 | - } |
|
| 3228 | + if (get_option('geodir_disable_rating')) {
|
|
| 3229 | + echo '<style>body .geodir-rating, body .geodir-bubble-rating, body .gd_ratings_module_box{display:none!important;}</style>';
|
|
| 3230 | + echo '<script type="text/javascript">jQuery(function(){jQuery(".gd_rating_show").parent(".geodir-rating").remove();});</script>';
|
|
| 3231 | + } |
|
| 3232 | 3232 | } |
| 3233 | 3233 | |
| 3234 | 3234 | add_filter('geodir_load_db_language', 'geodir_load_custom_field_translation');
|
@@ -3245,36 +3245,36 @@ discard block |
||
| 3245 | 3245 | * @return array Translation texts. |
| 3246 | 3246 | */ |
| 3247 | 3247 | function geodir_load_gd_options_text_translation($translation_texts = array()) {
|
| 3248 | - $translation_texts = !empty( $translation_texts ) && is_array( $translation_texts ) ? $translation_texts : array(); |
|
| 3249 | - |
|
| 3250 | - $gd_options = array('geodir_post_submited_success_email_subject_admin', 'geodir_post_submited_success_email_content_admin', 'geodir_post_submited_success_email_subject', 'geodir_post_submited_success_email_content', 'geodir_forgot_password_subject', 'geodir_forgot_password_content', 'geodir_registration_success_email_subject', 'geodir_registration_success_email_content', 'geodir_post_published_email_subject', 'geodir_post_published_email_content', 'geodir_email_friend_subject', 'geodir_email_friend_content', 'geodir_email_enquiry_subject', 'geodir_email_enquiry_content', 'geodir_post_added_success_msg_content');
|
|
| 3251 | - |
|
| 3252 | - /** |
|
| 3253 | - * Filters the geodirectory option names that requires to add for translation. |
|
| 3254 | - * |
|
| 3255 | - * @since 1.5.7 |
|
| 3256 | - * @package GeoDirectory |
|
| 3257 | - * |
|
| 3258 | - * @param array $gd_options Array of option names. |
|
| 3259 | - */ |
|
| 3260 | - $gd_options = apply_filters('geodir_gd_options_for_translation', $gd_options);
|
|
| 3261 | - $gd_options = array_unique($gd_options); |
|
| 3262 | - |
|
| 3263 | - if (!empty($gd_options)) {
|
|
| 3264 | - foreach ($gd_options as $gd_option) {
|
|
| 3265 | - if ($gd_option != '' && $option_value = get_option($gd_option)) {
|
|
| 3266 | - $option_value = is_string($option_value) ? stripslashes_deep($option_value) : ''; |
|
| 3248 | + $translation_texts = !empty( $translation_texts ) && is_array( $translation_texts ) ? $translation_texts : array(); |
|
| 3249 | + |
|
| 3250 | + $gd_options = array('geodir_post_submited_success_email_subject_admin', 'geodir_post_submited_success_email_content_admin', 'geodir_post_submited_success_email_subject', 'geodir_post_submited_success_email_content', 'geodir_forgot_password_subject', 'geodir_forgot_password_content', 'geodir_registration_success_email_subject', 'geodir_registration_success_email_content', 'geodir_post_published_email_subject', 'geodir_post_published_email_content', 'geodir_email_friend_subject', 'geodir_email_friend_content', 'geodir_email_enquiry_subject', 'geodir_email_enquiry_content', 'geodir_post_added_success_msg_content');
|
|
| 3251 | + |
|
| 3252 | + /** |
|
| 3253 | + * Filters the geodirectory option names that requires to add for translation. |
|
| 3254 | + * |
|
| 3255 | + * @since 1.5.7 |
|
| 3256 | + * @package GeoDirectory |
|
| 3257 | + * |
|
| 3258 | + * @param array $gd_options Array of option names. |
|
| 3259 | + */ |
|
| 3260 | + $gd_options = apply_filters('geodir_gd_options_for_translation', $gd_options);
|
|
| 3261 | + $gd_options = array_unique($gd_options); |
|
| 3262 | + |
|
| 3263 | + if (!empty($gd_options)) {
|
|
| 3264 | + foreach ($gd_options as $gd_option) {
|
|
| 3265 | + if ($gd_option != '' && $option_value = get_option($gd_option)) {
|
|
| 3266 | + $option_value = is_string($option_value) ? stripslashes_deep($option_value) : ''; |
|
| 3267 | 3267 | |
| 3268 | - if ($option_value != '' && !in_array($option_value, $translation_texts)) {
|
|
| 3269 | - $translation_texts[] = stripslashes_deep($option_value); |
|
| 3270 | - } |
|
| 3271 | - } |
|
| 3272 | - } |
|
| 3273 | - } |
|
| 3268 | + if ($option_value != '' && !in_array($option_value, $translation_texts)) {
|
|
| 3269 | + $translation_texts[] = stripslashes_deep($option_value); |
|
| 3270 | + } |
|
| 3271 | + } |
|
| 3272 | + } |
|
| 3273 | + } |
|
| 3274 | 3274 | |
| 3275 | - $translation_texts = !empty($translation_texts) ? array_unique($translation_texts) : $translation_texts; |
|
| 3275 | + $translation_texts = !empty($translation_texts) ? array_unique($translation_texts) : $translation_texts; |
|
| 3276 | 3276 | |
| 3277 | - return $translation_texts; |
|
| 3277 | + return $translation_texts; |
|
| 3278 | 3278 | } |
| 3279 | 3279 | |
| 3280 | 3280 | add_filter('geodir_load_db_language', 'geodir_load_gd_options_text_translation');
|
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | /* ON TEMPLATE INCLUDE */ |
| 137 | 137 | ///////////////////////// |
| 138 | 138 | |
| 139 | -add_filter('template_include', 'geodir_template_loader',9);
|
|
| 139 | +add_filter('template_include', 'geodir_template_loader', 9);
|
|
| 140 | 140 | |
| 141 | 141 | ///////////////////////// |
| 142 | 142 | /* CATEGORY / TAXONOMY / CUSTOM POST ACTIONS */ |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | //////////////////////// |
| 178 | 178 | |
| 179 | 179 | add_action('geodir_update_postrating', 'geodir_term_review_count_force_update', 100);
|
| 180 | -add_action('transition_post_status', 'geodir_term_review_count_force_update', 100,3);
|
|
| 180 | +add_action('transition_post_status', 'geodir_term_review_count_force_update', 100, 3);
|
|
| 181 | 181 | add_action('created_term', 'geodir_term_review_count_force_update', 100);
|
| 182 | 182 | add_action('edited_term', 'geodir_term_review_count_force_update', 100);
|
| 183 | 183 | add_action('delete_term', 'geodir_term_review_count_force_update', 100);
|
@@ -319,8 +319,8 @@ discard block |
||
| 319 | 319 | |
| 320 | 320 | /////// GEO DIRECOTORY CUSTOM HOOKS /// |
| 321 | 321 | |
| 322 | -add_action('geodir_before_tab_content', 'geodir_before_tab_content');// this function is in custom_functions.php and it is used to wrap detail page tab content
|
|
| 323 | -add_action('geodir_after_tab_content', 'geodir_after_tab_content');// this function is in custom_functions.php and it is used to wrap detail page tab content
|
|
| 322 | +add_action('geodir_before_tab_content', 'geodir_before_tab_content'); // this function is in custom_functions.php and it is used to wrap detail page tab content
|
|
| 323 | +add_action('geodir_after_tab_content', 'geodir_after_tab_content'); // this function is in custom_functions.php and it is used to wrap detail page tab content
|
|
| 324 | 324 | |
| 325 | 325 | // Detail page sidebar content |
| 326 | 326 | add_action('geodir_detail_page_sidebar', 'geodir_detail_page_sidebar_content_sorting', 1);
|
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | $content_html = ob_get_clean(); |
| 423 | 423 | if (trim($content_html) != '') |
| 424 | 424 | $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">' . $content_html . '</div>'; |
| 425 | - if ((int)get_option('geodir_disable_tfg_buttons_section') != 1) {
|
|
| 425 | + if ((int) get_option('geodir_disable_tfg_buttons_section') != 1) {
|
|
| 426 | 426 | /** |
| 427 | 427 | * Filter the geodir_social_sharing_buttons() function content. |
| 428 | 428 | * |
@@ -469,7 +469,7 @@ discard block |
||
| 469 | 469 | $content_html = ob_get_clean(); |
| 470 | 470 | if (trim($content_html) != '') |
| 471 | 471 | $content_html = '<div class="geodir-company_info geodir-details-sidebar-sharethis">' . $content_html . '</div>'; |
| 472 | - if ((int)get_option('geodir_disable_sharethis_button_section') != 1) {
|
|
| 472 | + if ((int) get_option('geodir_disable_sharethis_button_section') != 1) {
|
|
| 473 | 473 | /** |
| 474 | 474 | * Filter the geodir_share_this_button() function content. |
| 475 | 475 | * |
@@ -508,7 +508,7 @@ discard block |
||
| 508 | 508 | $post_id = $post->ID; |
| 509 | 509 | |
| 510 | 510 | if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
| 511 | - $post_id = (int)$_REQUEST['pid']; |
|
| 511 | + $post_id = (int) $_REQUEST['pid']; |
|
| 512 | 512 | } |
| 513 | 513 | |
| 514 | 514 | $postlink = get_permalink(geodir_add_listing_page_id()); |
@@ -525,7 +525,7 @@ discard block |
||
| 525 | 525 | $content_html = ob_get_clean(); |
| 526 | 526 | if (trim($content_html) != '') |
| 527 | 527 | $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">' . $content_html . '</div>'; |
| 528 | - if ((int)get_option('geodir_disable_user_links_section') != 1) {
|
|
| 528 | + if ((int) get_option('geodir_disable_user_links_section') != 1) {
|
|
| 529 | 529 | /** |
| 530 | 530 | * Filter the geodir_edit_post_link() function content. |
| 531 | 531 | * |
@@ -564,7 +564,7 @@ discard block |
||
| 564 | 564 | */ |
| 565 | 565 | do_action('geodir_before_google_analytics');
|
| 566 | 566 | |
| 567 | - if (get_option('geodir_ga_stats') && is_user_logged_in() && (isset($package_info->google_analytics) && $package_info->google_analytics == '1') && (get_current_user_id()==$post->post_author || current_user_can( 'manage_options' )) ) {
|
|
| 567 | + if (get_option('geodir_ga_stats') && is_user_logged_in() && (isset($package_info->google_analytics) && $package_info->google_analytics == '1') && (get_current_user_id() == $post->post_author || current_user_can('manage_options'))) {
|
|
| 568 | 568 | $page_url = urlencode($_SERVER['REQUEST_URI']); |
| 569 | 569 | ?> |
| 570 | 570 | <script type="text/javascript"> |
@@ -588,34 +588,34 @@ discard block |
||
| 588 | 588 | }); |
| 589 | 589 | |
| 590 | 590 | function gdga_weekVSweek() {
|
| 591 | - jQuery.ajax({url: "<?php echo get_bloginfo('url').'/?ptype=ga&ga_page='.$page_url; ?>&ga_type=thisweek", success: function(result){
|
|
| 591 | + jQuery.ajax({url: "<?php echo get_bloginfo('url') . '/?ptype=ga&ga_page=' . $page_url; ?>&ga_type=thisweek", success: function(result){
|
|
| 592 | 592 | ga_data1 = jQuery.parseJSON(result); |
| 593 | 593 | if(ga_data1.error){jQuery('#ga_stats').html(result);return;}
|
| 594 | 594 | gd_renderWeekOverWeekChart(); |
| 595 | 595 | }}); |
| 596 | 596 | |
| 597 | - jQuery.ajax({url: "<?php echo get_bloginfo('url').'/?ptype=ga&ga_page='.$page_url; ?>&ga_type=lastweek", success: function(result){
|
|
| 597 | + jQuery.ajax({url: "<?php echo get_bloginfo('url') . '/?ptype=ga&ga_page=' . $page_url; ?>&ga_type=lastweek", success: function(result){
|
|
| 598 | 598 | ga_data2 = jQuery.parseJSON(result); |
| 599 | 599 | gd_renderWeekOverWeekChart(); |
| 600 | 600 | }}); |
| 601 | 601 | } |
| 602 | 602 | |
| 603 | 603 | function gdga_yearVSyear() {
|
| 604 | - jQuery.ajax({url: "<?php echo get_bloginfo('url').'/?ptype=ga&ga_page='.$page_url; ?>&ga_type=thisyear", success: function(result){
|
|
| 604 | + jQuery.ajax({url: "<?php echo get_bloginfo('url') . '/?ptype=ga&ga_page=' . $page_url; ?>&ga_type=thisyear", success: function(result){
|
|
| 605 | 605 | ga_data3 = jQuery.parseJSON(result); |
| 606 | 606 | if(ga_data3.error){jQuery('#ga_stats').html(result);return;}
|
| 607 | 607 | |
| 608 | 608 | gd_renderYearOverYearChart() |
| 609 | 609 | }}); |
| 610 | 610 | |
| 611 | - jQuery.ajax({url: "<?php echo get_bloginfo('url').'/?ptype=ga&ga_page='.$page_url; ?>&ga_type=lastyear", success: function(result){
|
|
| 611 | + jQuery.ajax({url: "<?php echo get_bloginfo('url') . '/?ptype=ga&ga_page=' . $page_url; ?>&ga_type=lastyear", success: function(result){
|
|
| 612 | 612 | ga_data4 = jQuery.parseJSON(result); |
| 613 | 613 | gd_renderYearOverYearChart() |
| 614 | 614 | }}); |
| 615 | 615 | } |
| 616 | 616 | |
| 617 | 617 | function gdga_country() {
|
| 618 | - jQuery.ajax({url: "<?php echo get_bloginfo('url').'/?ptype=ga&ga_page='.$page_url; ?>&ga_type=country", success: function(result){
|
|
| 618 | + jQuery.ajax({url: "<?php echo get_bloginfo('url') . '/?ptype=ga&ga_page=' . $page_url; ?>&ga_type=country", success: function(result){
|
|
| 619 | 619 | ga_data5 = jQuery.parseJSON(result); |
| 620 | 620 | if(ga_data5.error){jQuery('#ga_stats').html(result);return;}
|
| 621 | 621 | gd_renderTopCountriesChart(); |
@@ -623,7 +623,7 @@ discard block |
||
| 623 | 623 | } |
| 624 | 624 | |
| 625 | 625 | function gdga_realtime() {
|
| 626 | - jQuery.ajax({url: "<?php echo get_bloginfo('url').'/?ptype=ga&ga_page='.$page_url; ?>&ga_type=realtime", success: function(result){
|
|
| 626 | + jQuery.ajax({url: "<?php echo get_bloginfo('url') . '/?ptype=ga&ga_page=' . $page_url; ?>&ga_type=realtime", success: function(result){
|
|
| 627 | 627 | ga_data6 = jQuery.parseJSON(result); |
| 628 | 628 | if(ga_data6.error){jQuery('#ga_stats').html(result);return;}
|
| 629 | 629 | gd_renderRealTime(); |
@@ -689,7 +689,7 @@ discard block |
||
| 689 | 689 | } |
| 690 | 690 | |
| 691 | 691 | function gdga_noResults() {
|
| 692 | - jQuery('#gdga-chart-container').html('<?php _e('No results available','geodirectory');?>');
|
|
| 692 | + jQuery('#gdga-chart-container').html('<?php _e('No results available', 'geodirectory'); ?>');
|
|
| 693 | 693 | jQuery('#gdga-legend-container').html('');
|
| 694 | 694 | } |
| 695 | 695 | |
@@ -721,18 +721,18 @@ discard block |
||
| 721 | 721 | var data2 = results[1].rows.map(function(row) { return +row[2]; });
|
| 722 | 722 | //var labelsN = results[0].rows.map(function(row) { return +row[1]; });
|
| 723 | 723 | |
| 724 | - var labels = ['<?php _e('Jan', 'geodirectory');?>',
|
|
| 725 | - '<?php _e('Feb', 'geodirectory');?>',
|
|
| 726 | - '<?php _e('Mar', 'geodirectory');?>',
|
|
| 727 | - '<?php _e('Apr', 'geodirectory');?>',
|
|
| 728 | - '<?php _e('May', 'geodirectory');?>',
|
|
| 729 | - '<?php _e('Jun', 'geodirectory');?>',
|
|
| 730 | - '<?php _e('Jul', 'geodirectory');?>',
|
|
| 731 | - '<?php _e('Aug', 'geodirectory');?>',
|
|
| 732 | - '<?php _e('Sep', 'geodirectory');?>',
|
|
| 733 | - '<?php _e('Oct', 'geodirectory');?>',
|
|
| 734 | - '<?php _e('Nov', 'geodirectory');?>',
|
|
| 735 | - '<?php _e('Dec', 'geodirectory');?>'];
|
|
| 724 | + var labels = ['<?php _e('Jan', 'geodirectory'); ?>',
|
|
| 725 | + '<?php _e('Feb', 'geodirectory'); ?>',
|
|
| 726 | + '<?php _e('Mar', 'geodirectory'); ?>',
|
|
| 727 | + '<?php _e('Apr', 'geodirectory'); ?>',
|
|
| 728 | + '<?php _e('May', 'geodirectory'); ?>',
|
|
| 729 | + '<?php _e('Jun', 'geodirectory'); ?>',
|
|
| 730 | + '<?php _e('Jul', 'geodirectory'); ?>',
|
|
| 731 | + '<?php _e('Aug', 'geodirectory'); ?>',
|
|
| 732 | + '<?php _e('Sep', 'geodirectory'); ?>',
|
|
| 733 | + '<?php _e('Oct', 'geodirectory'); ?>',
|
|
| 734 | + '<?php _e('Nov', 'geodirectory'); ?>',
|
|
| 735 | + '<?php _e('Dec', 'geodirectory'); ?>'];
|
|
| 736 | 736 | |
| 737 | 737 | // Ensure the data arrays are at least as long as the labels array. |
| 738 | 738 | // Chart.js bar charts don't (yet) accept sparse datasets. |
@@ -745,13 +745,13 @@ discard block |
||
| 745 | 745 | labels : labels, |
| 746 | 746 | datasets : [ |
| 747 | 747 | {
|
| 748 | - label: '<?php _e('Last Year', 'geodirectory');?>',
|
|
| 748 | + label: '<?php _e('Last Year', 'geodirectory'); ?>',
|
|
| 749 | 749 | fillColor : "rgba(220,220,220,0.5)", |
| 750 | 750 | strokeColor : "rgba(220,220,220,1)", |
| 751 | 751 | data : data2 |
| 752 | 752 | }, |
| 753 | 753 | {
|
| 754 | - label: '<?php _e('This Year', 'geodirectory');?>',
|
|
| 754 | + label: '<?php _e('This Year', 'geodirectory'); ?>',
|
|
| 755 | 755 | fillColor : "rgba(151,187,205,0.5)", |
| 756 | 756 | strokeColor : "rgba(151,187,205,1)", |
| 757 | 757 | data : data1 |
@@ -796,30 +796,30 @@ discard block |
||
| 796 | 796 | |
| 797 | 797 | <?php |
| 798 | 798 | // Here we list the shorthand days of the week so it can be used in translation. |
| 799 | - __("Mon",'geodirectory');
|
|
| 800 | - __("Tue",'geodirectory');
|
|
| 801 | - __("Wed",'geodirectory');
|
|
| 802 | - __("Thu",'geodirectory');
|
|
| 803 | - __("Fri",'geodirectory');
|
|
| 804 | - __("Sat",'geodirectory');
|
|
| 805 | - __("Sun",'geodirectory');
|
|
| 799 | + __("Mon", 'geodirectory');
|
|
| 800 | + __("Tue", 'geodirectory');
|
|
| 801 | + __("Wed", 'geodirectory');
|
|
| 802 | + __("Thu", 'geodirectory');
|
|
| 803 | + __("Fri", 'geodirectory');
|
|
| 804 | + __("Sat", 'geodirectory');
|
|
| 805 | + __("Sun", 'geodirectory');
|
|
| 806 | 806 | ?> |
| 807 | 807 | |
| 808 | 808 | labels = [ |
| 809 | - "<?php _e(date('D', strtotime("+1 day")),'geodirectory'); ?>",
|
|
| 810 | - "<?php _e(date('D', strtotime("+2 day")),'geodirectory'); ?>",
|
|
| 811 | - "<?php _e(date('D', strtotime("+3 day")),'geodirectory'); ?>",
|
|
| 812 | - "<?php _e(date('D', strtotime("+4 day")),'geodirectory'); ?>",
|
|
| 813 | - "<?php _e(date('D', strtotime("+5 day")),'geodirectory'); ?>",
|
|
| 814 | - "<?php _e(date('D', strtotime("+6 day")),'geodirectory'); ?>",
|
|
| 815 | - "<?php _e(date('D', strtotime("+7 day")),'geodirectory'); ?>"
|
|
| 809 | + "<?php _e(date('D', strtotime("+1 day")), 'geodirectory'); ?>",
|
|
| 810 | + "<?php _e(date('D', strtotime("+2 day")), 'geodirectory'); ?>",
|
|
| 811 | + "<?php _e(date('D', strtotime("+3 day")), 'geodirectory'); ?>",
|
|
| 812 | + "<?php _e(date('D', strtotime("+4 day")), 'geodirectory'); ?>",
|
|
| 813 | + "<?php _e(date('D', strtotime("+5 day")), 'geodirectory'); ?>",
|
|
| 814 | + "<?php _e(date('D', strtotime("+6 day")), 'geodirectory'); ?>",
|
|
| 815 | + "<?php _e(date('D', strtotime("+7 day")), 'geodirectory'); ?>"
|
|
| 816 | 816 | ]; |
| 817 | 817 | |
| 818 | 818 | var data = {
|
| 819 | 819 | labels : labels, |
| 820 | 820 | datasets : [ |
| 821 | 821 | {
|
| 822 | - label: '<?php _e('Last Week', 'geodirectory');?>',
|
|
| 822 | + label: '<?php _e('Last Week', 'geodirectory'); ?>',
|
|
| 823 | 823 | fillColor : "rgba(220,220,220,0.5)", |
| 824 | 824 | strokeColor : "rgba(220,220,220,1)", |
| 825 | 825 | pointColor : "rgba(220,220,220,1)", |
@@ -827,7 +827,7 @@ discard block |
||
| 827 | 827 | data : data2 |
| 828 | 828 | }, |
| 829 | 829 | {
|
| 830 | - label: '<?php _e('This Week', 'geodirectory');?>',
|
|
| 830 | + label: '<?php _e('This Week', 'geodirectory'); ?>',
|
|
| 831 | 831 | fillColor : "rgba(151,187,205,0.5)", |
| 832 | 832 | strokeColor : "rgba(151,187,205,1)", |
| 833 | 833 | pointColor : "rgba(151,187,205,1)", |
@@ -1009,18 +1009,18 @@ discard block |
||
| 1009 | 1009 | |
| 1010 | 1010 | |
| 1011 | 1011 | <span id="ga_stats"> |
| 1012 | - <div id="ga-analytics-title"><?php _e("Analytics", 'geodirectory');?></div>
|
|
| 1012 | + <div id="ga-analytics-title"><?php _e("Analytics", 'geodirectory'); ?></div>
|
|
| 1013 | 1013 | |
| 1014 | 1014 | <div id="gd-active-users-container"> |
| 1015 | - <div class="gd-ActiveUsers"><?php _e("Active Users:", 'geodirectory');?>
|
|
| 1015 | + <div class="gd-ActiveUsers"><?php _e("Active Users:", 'geodirectory'); ?>
|
|
| 1016 | 1016 | <b class="gd-ActiveUsers-value">0</b> |
| 1017 | 1017 | </div> |
| 1018 | 1018 | </div> |
| 1019 | 1019 | |
| 1020 | 1020 | <select id="gdga-select-analytic" onchange="gdga_select_option();" style="display: none;"> |
| 1021 | - <option value="weeks"><?php _e("Last Week vs This Week", 'geodirectory');?></option>
|
|
| 1022 | - <option value="years"><?php _e("This Year vs Last Year", 'geodirectory');?></option>
|
|
| 1023 | - <option value="country"><?php _e("Top Countries", 'geodirectory');?></option>
|
|
| 1021 | + <option value="weeks"><?php _e("Last Week vs This Week", 'geodirectory'); ?></option>
|
|
| 1022 | + <option value="years"><?php _e("This Year vs Last Year", 'geodirectory'); ?></option>
|
|
| 1023 | + <option value="country"><?php _e("Top Countries", 'geodirectory'); ?></option>
|
|
| 1024 | 1024 | </select> |
| 1025 | 1025 | <img alt="loader icon" id="gdga-loader-icon" src="<?php echo geodir_plugin_url() . '/geodirectory-assets/images/ajax-loader.gif'; ?>" /> |
| 1026 | 1026 | <div class="Chartjs-figure" id="gdga-chart-container"></div> |
@@ -1038,7 +1038,7 @@ discard block |
||
| 1038 | 1038 | $content_html = ob_get_clean(); |
| 1039 | 1039 | if (trim($content_html) != '') |
| 1040 | 1040 | $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">' . $content_html . '</div>'; |
| 1041 | - if ((int)get_option('geodir_disable_google_analytics_section') != 1) {
|
|
| 1041 | + if ((int) get_option('geodir_disable_google_analytics_section') != 1) {
|
|
| 1042 | 1042 | /** |
| 1043 | 1043 | * Filter the geodir_edit_post_link() function content. |
| 1044 | 1044 | * |
@@ -1134,7 +1134,7 @@ discard block |
||
| 1134 | 1134 | if (trim($content_html) != '') {
|
| 1135 | 1135 | $content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">' . $content_html . '</div>'; |
| 1136 | 1136 | } |
| 1137 | - if ((int)get_option('geodir_disable_rating_info_section') != 1) {
|
|
| 1137 | + if ((int) get_option('geodir_disable_rating_info_section') != 1) {
|
|
| 1138 | 1138 | /** |
| 1139 | 1139 | * Filter the geodir_detail_page_review_rating() function content. |
| 1140 | 1140 | * |
@@ -1174,7 +1174,7 @@ discard block |
||
| 1174 | 1174 | $content_html = ob_get_clean(); |
| 1175 | 1175 | if (trim($content_html) != '') |
| 1176 | 1176 | $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">' . $content_html . '</div>'; |
| 1177 | - if ((int)get_option('geodir_disable_listing_info_section') != 1) {
|
|
| 1177 | + if ((int) get_option('geodir_disable_listing_info_section') != 1) {
|
|
| 1178 | 1178 | /** |
| 1179 | 1179 | * Filter the output html for function geodir_detail_page_more_info(). |
| 1180 | 1180 | * |
@@ -1265,7 +1265,7 @@ discard block |
||
| 1265 | 1265 | 'gd_allowed_img_types' => !empty($allowed_img_types) ? implode(',', $allowed_img_types) : '',
|
| 1266 | 1266 | 'geodir_txt_form_wait' => __('Wait...', 'geodirectory'),
|
| 1267 | 1267 | 'geodir_txt_form_searching' => __('Searching...', 'geodirectory'),
|
| 1268 | - 'fa_rating' => (int)get_option('geodir_reviewrating_enable_font_awesome') == 1 ? 1 : '',
|
|
| 1268 | + 'fa_rating' => (int) get_option('geodir_reviewrating_enable_font_awesome') == 1 ? 1 : '',
|
|
| 1269 | 1269 | 'reviewrating' => defined('GEODIRREVIEWRATING_VERSION') ? 1 : '',
|
| 1270 | 1270 | ); |
| 1271 | 1271 | |
@@ -1282,7 +1282,7 @@ discard block |
||
| 1282 | 1282 | foreach ($arr_alert_msg as $key => $value) {
|
| 1283 | 1283 | if (!is_scalar($value)) |
| 1284 | 1284 | continue; |
| 1285 | - $arr_alert_msg[$key] = html_entity_decode((string)$value, ENT_QUOTES, 'UTF-8'); |
|
| 1285 | + $arr_alert_msg[$key] = html_entity_decode((string) $value, ENT_QUOTES, 'UTF-8'); |
|
| 1286 | 1286 | } |
| 1287 | 1287 | |
| 1288 | 1288 | $script = "var geodir_all_js_msg = " . json_encode($arr_alert_msg) . ';'; |
@@ -1458,7 +1458,7 @@ discard block |
||
| 1458 | 1458 | global $post; |
| 1459 | 1459 | $term_condition = ''; |
| 1460 | 1460 | if (isset($_REQUEST['backandedit'])) {
|
| 1461 | - $post = (object)$gd_session->get('listing');
|
|
| 1461 | + $post = (object) $gd_session->get('listing');
|
|
| 1462 | 1462 | $term_condition = isset($post->geodir_accept_term_condition) ? $post->geodir_accept_term_condition : ''; |
| 1463 | 1463 | } |
| 1464 | 1464 | |
@@ -1472,7 +1472,7 @@ discard block |
||
| 1472 | 1472 | echo 'checked="checked"'; |
| 1473 | 1473 | } ?> field_type="checkbox" name="geodir_accept_term_condition" id="geodir_accept_term_condition" |
| 1474 | 1474 | class="geodir_textfield" value="1" |
| 1475 | - style="display:inline-block"/><a href="<?php $terms_page = get_option('geodir_term_condition_page'); if($terms_page){ echo get_permalink($terms_page);}?>" target="_blank"><?php _e('Please accept our terms and conditions', 'geodirectory'); ?></a>
|
|
| 1475 | + style="display:inline-block"/><a href="<?php $terms_page = get_option('geodir_term_condition_page'); if ($terms_page) { echo get_permalink($terms_page); }?>" target="_blank"><?php _e('Please accept our terms and conditions', 'geodirectory'); ?></a>
|
|
| 1476 | 1476 | </span> |
| 1477 | 1477 | </div> |
| 1478 | 1478 | <span class="geodir_message_error"><?php if (isset($required_msg)) {
|
@@ -1512,7 +1512,7 @@ discard block |
||
| 1512 | 1512 | /** This action is documented in geodirectory_template_actions.php */ |
| 1513 | 1513 | $desc_limit = apply_filters('geodir_description_field_desc_limit', '');
|
| 1514 | 1514 | |
| 1515 | - if (!($desc_limit === '' || (int)$desc_limit > 0)) {
|
|
| 1515 | + if (!($desc_limit === '' || (int) $desc_limit > 0)) {
|
|
| 1516 | 1516 | $is_display = false; |
| 1517 | 1517 | } |
| 1518 | 1518 | } |
@@ -1586,7 +1586,7 @@ discard block |
||
| 1586 | 1586 | global $wpdb, $plugin_prefix; |
| 1587 | 1587 | |
| 1588 | 1588 | // Remove unused virtual page |
| 1589 | - $listings_page_id = (int)get_option('geodir_listing_page');
|
|
| 1589 | + $listings_page_id = (int) get_option('geodir_listing_page');
|
|
| 1590 | 1590 | if ($listings_page_id) {
|
| 1591 | 1591 | $wpdb->query($wpdb->prepare("DELETE FROM " . $wpdb->posts . " WHERE ID=%d AND post_name = %s AND post_type=%s", array($listings_page_id, 'listings', 'page')));
|
| 1592 | 1592 | delete_option('geodir_listing_page');
|
@@ -1848,43 +1848,43 @@ discard block |
||
| 1848 | 1848 | |
| 1849 | 1849 | |
| 1850 | 1850 | $gd_page = ''; |
| 1851 | - if(geodir_is_page('home')){
|
|
| 1851 | + if (geodir_is_page('home')) {
|
|
| 1852 | 1852 | $gd_page = 'home'; |
| 1853 | 1853 | $title = (get_option('geodir_meta_title_homepage')) ? get_option('geodir_meta_title_homepage') : $title;
|
| 1854 | 1854 | } |
| 1855 | - elseif(geodir_is_page('detail')){
|
|
| 1855 | + elseif (geodir_is_page('detail')) {
|
|
| 1856 | 1856 | $gd_page = 'detail'; |
| 1857 | 1857 | $title = (get_option('geodir_meta_title_detail')) ? get_option('geodir_meta_title_detail') : $title;
|
| 1858 | 1858 | } |
| 1859 | - elseif(geodir_is_page('pt')){
|
|
| 1859 | + elseif (geodir_is_page('pt')) {
|
|
| 1860 | 1860 | $gd_page = 'pt'; |
| 1861 | 1861 | $title = (get_option('geodir_meta_title_pt')) ? get_option('geodir_meta_title_pt') : $title;
|
| 1862 | 1862 | } |
| 1863 | - elseif(geodir_is_page('listing')){
|
|
| 1863 | + elseif (geodir_is_page('listing')) {
|
|
| 1864 | 1864 | $gd_page = 'listing'; |
| 1865 | 1865 | $title = (get_option('geodir_meta_title_listing')) ? get_option('geodir_meta_title_listing') : $title;
|
| 1866 | 1866 | } |
| 1867 | - elseif(geodir_is_page('location')){
|
|
| 1867 | + elseif (geodir_is_page('location')) {
|
|
| 1868 | 1868 | $gd_page = 'location'; |
| 1869 | 1869 | $title = (get_option('geodir_meta_title_location')) ? get_option('geodir_meta_title_location') : $title;
|
| 1870 | 1870 | } |
| 1871 | - elseif(geodir_is_page('search')){
|
|
| 1871 | + elseif (geodir_is_page('search')) {
|
|
| 1872 | 1872 | $gd_page = 'search'; |
| 1873 | 1873 | $title = (get_option('geodir_meta_title_search')) ? get_option('geodir_meta_title_search') : $title;
|
| 1874 | 1874 | } |
| 1875 | - elseif(geodir_is_page('add-listing')){
|
|
| 1875 | + elseif (geodir_is_page('add-listing')) {
|
|
| 1876 | 1876 | $gd_page = 'add-listing'; |
| 1877 | 1877 | $title = (get_option('geodir_meta_title_add-listing')) ? get_option('geodir_meta_title_add-listing') : $title;
|
| 1878 | 1878 | } |
| 1879 | - elseif(geodir_is_page('author')){
|
|
| 1879 | + elseif (geodir_is_page('author')) {
|
|
| 1880 | 1880 | $gd_page = 'author'; |
| 1881 | 1881 | $title = (get_option('geodir_meta_title_author')) ? get_option('geodir_meta_title_author') : $title;
|
| 1882 | 1882 | } |
| 1883 | - elseif(geodir_is_page('login')){
|
|
| 1883 | + elseif (geodir_is_page('login')) {
|
|
| 1884 | 1884 | $gd_page = 'login'; |
| 1885 | 1885 | $title = (get_option('geodir_meta_title_login')) ? get_option('geodir_meta_title_login') : $title;
|
| 1886 | 1886 | } |
| 1887 | - elseif(geodir_is_page('listing-success')){
|
|
| 1887 | + elseif (geodir_is_page('listing-success')) {
|
|
| 1888 | 1888 | $gd_page = 'listing-success'; |
| 1889 | 1889 | $title = (get_option('geodir_meta_title_listing-success')) ? get_option('geodir_meta_title_listing-success') : $title;
|
| 1890 | 1890 | } |
@@ -2148,7 +2148,7 @@ discard block |
||
| 2148 | 2148 | */ |
| 2149 | 2149 | function geodir_remove_template_redirect_actions() |
| 2150 | 2150 | {
|
| 2151 | - if (geodir_is_page('login')){
|
|
| 2151 | + if (geodir_is_page('login')) {
|
|
| 2152 | 2152 | remove_all_actions('template_redirect');
|
| 2153 | 2153 | remove_action('init', 'avia_modify_front', 10);
|
| 2154 | 2154 | } |
@@ -2595,8 +2595,8 @@ discard block |
||
| 2595 | 2595 | $date_format = $date_format['date_format']; |
| 2596 | 2596 | } |
| 2597 | 2597 | |
| 2598 | - $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
|
|
| 2599 | - $replace = array('d','j','l','m','n','F','Y');//PHP date format
|
|
| 2598 | + $search = array('dd', 'd', 'DD', 'mm', 'm', 'MM', 'yy'); //jQuery UI datepicker format
|
|
| 2599 | + $replace = array('d', 'j', 'l', 'm', 'n', 'F', 'Y'); //PHP date format
|
|
| 2600 | 2600 | |
| 2601 | 2601 | $date_format = str_replace($search, $replace, $date_format); |
| 2602 | 2602 | |
@@ -2691,7 +2691,7 @@ discard block |
||
| 2691 | 2691 | $html_var = $type['htmlvar_name']; |
| 2692 | 2692 | $html_val = $type['htmlvar_name']; |
| 2693 | 2693 | |
| 2694 | - if ((int)$post->$html_var == 1) {
|
|
| 2694 | + if ((int) $post->$html_var == 1) {
|
|
| 2695 | 2695 | |
| 2696 | 2696 | if ($post->$type['htmlvar_name'] == '1') {
|
| 2697 | 2697 | $html_val = __('Yes', 'geodirectory');
|
@@ -2867,7 +2867,7 @@ discard block |
||
| 2867 | 2867 | |
| 2868 | 2868 | if (!empty($files)) {
|
| 2869 | 2869 | $extra_fields = !empty($type['extra_fields']) ? maybe_unserialize($type['extra_fields']) : NULL; |
| 2870 | - $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'] : '';
|
|
| 2870 | + $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'] : '';
|
|
| 2871 | 2871 | |
| 2872 | 2872 | $file_paths = ''; |
| 2873 | 2873 | foreach ($files as $file) {
|
@@ -2895,7 +2895,7 @@ discard block |
||
| 2895 | 2895 | // If the uploaded file is image |
| 2896 | 2896 | if (in_array($uploaded_file_type, $image_file_types)) {
|
| 2897 | 2897 | $file_paths .= '<div class="geodir-custom-post-gallery" class="clearfix">'; |
| 2898 | - $file_paths .= '<a href="'.$file.'">'; |
|
| 2898 | + $file_paths .= '<a href="' . $file . '">'; |
|
| 2899 | 2899 | $file_paths .= geodir_show_image(array('src' => $file), 'thumbnail', false, false);
|
| 2900 | 2900 | $file_paths .= '</a>'; |
| 2901 | 2901 | $file_paths .= '</div>'; |
@@ -3245,7 +3245,7 @@ discard block |
||
| 3245 | 3245 | * @return array Translation texts. |
| 3246 | 3246 | */ |
| 3247 | 3247 | function geodir_load_gd_options_text_translation($translation_texts = array()) {
|
| 3248 | - $translation_texts = !empty( $translation_texts ) && is_array( $translation_texts ) ? $translation_texts : array(); |
|
| 3248 | + $translation_texts = !empty($translation_texts) && is_array($translation_texts) ? $translation_texts : array(); |
|
| 3249 | 3249 | |
| 3250 | 3250 | $gd_options = array('geodir_post_submited_success_email_subject_admin', 'geodir_post_submited_success_email_content_admin', 'geodir_post_submited_success_email_subject', 'geodir_post_submited_success_email_content', 'geodir_forgot_password_subject', 'geodir_forgot_password_content', 'geodir_registration_success_email_subject', 'geodir_registration_success_email_content', 'geodir_post_published_email_subject', 'geodir_post_published_email_content', 'geodir_email_friend_subject', 'geodir_email_friend_content', 'geodir_email_enquiry_subject', 'geodir_email_enquiry_content', 'geodir_post_added_success_msg_content');
|
| 3251 | 3251 | |
@@ -1,10 +1,10 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Template functions that affect the output of most GeoDirectory pages |
|
| 4 | - * |
|
| 5 | - * @since 1.0.0 |
|
| 6 | - * @package GeoDirectory |
|
| 7 | - */ |
|
| 3 | + * Template functions that affect the output of most GeoDirectory pages |
|
| 4 | + * |
|
| 5 | + * @since 1.0.0 |
|
| 6 | + * @package GeoDirectory |
|
| 7 | + */ |
|
| 8 | 8 | ############################################### |
| 9 | 9 | ########### DYNAMIC CONTENT ################### |
| 10 | 10 | ############################################### |
@@ -17,10 +17,10 @@ discard block |
||
| 17 | 17 | */ |
| 18 | 18 | function gd_compat_styles() |
| 19 | 19 | {
|
| 20 | - $tc = get_option('theme_compatibility_setting');
|
|
| 21 | - echo "<style id='gd-compat-styles' type='text/css'>"; |
|
| 22 | - echo $tc['geodir_theme_compat_css']; |
|
| 23 | - echo "</style>"; |
|
| 20 | + $tc = get_option('theme_compatibility_setting');
|
|
| 21 | + echo "<style id='gd-compat-styles' type='text/css'>"; |
|
| 22 | + echo $tc['geodir_theme_compat_css']; |
|
| 23 | + echo "</style>"; |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | /** |
@@ -31,10 +31,10 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | function gd_compat_script() |
| 33 | 33 | {
|
| 34 | - $tc = get_option('theme_compatibility_setting');
|
|
| 35 | - echo "<script>"; |
|
| 36 | - echo $tc['geodir_theme_compat_js']; |
|
| 37 | - echo " </script>"; |
|
| 34 | + $tc = get_option('theme_compatibility_setting');
|
|
| 35 | + echo "<script>"; |
|
| 36 | + echo $tc['geodir_theme_compat_js']; |
|
| 37 | + echo " </script>"; |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | /** |
@@ -47,8 +47,8 @@ discard block |
||
| 47 | 47 | */ |
| 48 | 48 | function geodir_top_content_add_dynamic() |
| 49 | 49 | {
|
| 50 | - $tc = get_option('theme_compatibility_setting');
|
|
| 51 | - echo $tc['geodir_top_content_add']; |
|
| 50 | + $tc = get_option('theme_compatibility_setting');
|
|
| 51 | + echo $tc['geodir_top_content_add']; |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | /** |
@@ -61,8 +61,8 @@ discard block |
||
| 61 | 61 | */ |
| 62 | 62 | function geodir_before_main_content_add_dynamic() |
| 63 | 63 | {
|
| 64 | - $tc = get_option('theme_compatibility_setting');
|
|
| 65 | - echo $tc['geodir_before_main_content_add']; |
|
| 64 | + $tc = get_option('theme_compatibility_setting');
|
|
| 65 | + echo $tc['geodir_before_main_content_add']; |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | /** |
@@ -75,8 +75,8 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | function geodir_full_page_class_dynamic() |
| 77 | 77 | {
|
| 78 | - $tc = get_option('theme_compatibility_setting');
|
|
| 79 | - return $tc['geodir_full_page_class_filter']; |
|
| 78 | + $tc = get_option('theme_compatibility_setting');
|
|
| 79 | + return $tc['geodir_full_page_class_filter']; |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | /** |
@@ -89,8 +89,8 @@ discard block |
||
| 89 | 89 | */ |
| 90 | 90 | function geodir_before_widget_dynamic() |
| 91 | 91 | {
|
| 92 | - $tc = get_option('theme_compatibility_setting');
|
|
| 93 | - return $tc['geodir_before_widget_filter']; |
|
| 92 | + $tc = get_option('theme_compatibility_setting');
|
|
| 93 | + return $tc['geodir_before_widget_filter']; |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | /** |
@@ -103,8 +103,8 @@ discard block |
||
| 103 | 103 | */ |
| 104 | 104 | function geodir_after_widget_dynamic() |
| 105 | 105 | {
|
| 106 | - $tc = get_option('theme_compatibility_setting');
|
|
| 107 | - return $tc['geodir_after_widget_filter']; |
|
| 106 | + $tc = get_option('theme_compatibility_setting');
|
|
| 107 | + return $tc['geodir_after_widget_filter']; |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | /** |
@@ -117,8 +117,8 @@ discard block |
||
| 117 | 117 | */ |
| 118 | 118 | function geodir_before_title_dynamic() |
| 119 | 119 | {
|
| 120 | - $tc = get_option('theme_compatibility_setting');
|
|
| 121 | - return $tc['geodir_before_title_filter']; |
|
| 120 | + $tc = get_option('theme_compatibility_setting');
|
|
| 121 | + return $tc['geodir_before_title_filter']; |
|
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | /** |
@@ -131,8 +131,8 @@ discard block |
||
| 131 | 131 | */ |
| 132 | 132 | function geodir_after_title_dynamic() |
| 133 | 133 | {
|
| 134 | - $tc = get_option('theme_compatibility_setting');
|
|
| 135 | - return $tc['geodir_after_title_filter']; |
|
| 134 | + $tc = get_option('theme_compatibility_setting');
|
|
| 135 | + return $tc['geodir_after_title_filter']; |
|
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | /** |
@@ -145,8 +145,8 @@ discard block |
||
| 145 | 145 | */ |
| 146 | 146 | function geodir_menu_li_class_dynamic() |
| 147 | 147 | {
|
| 148 | - $tc = get_option('theme_compatibility_setting');
|
|
| 149 | - return $tc['geodir_menu_li_class_filter']; |
|
| 148 | + $tc = get_option('theme_compatibility_setting');
|
|
| 149 | + return $tc['geodir_menu_li_class_filter']; |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | /** |
@@ -159,8 +159,8 @@ discard block |
||
| 159 | 159 | */ |
| 160 | 160 | function geodir_sub_menu_ul_class_dynamic() |
| 161 | 161 | {
|
| 162 | - $tc = get_option('theme_compatibility_setting');
|
|
| 163 | - return $tc['geodir_sub_menu_ul_class_filter']; |
|
| 162 | + $tc = get_option('theme_compatibility_setting');
|
|
| 163 | + return $tc['geodir_sub_menu_ul_class_filter']; |
|
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | /** |
@@ -173,8 +173,8 @@ discard block |
||
| 173 | 173 | */ |
| 174 | 174 | function geodir_sub_menu_li_class_dynamic() |
| 175 | 175 | {
|
| 176 | - $tc = get_option('theme_compatibility_setting');
|
|
| 177 | - return $tc['geodir_sub_menu_li_class_filter']; |
|
| 176 | + $tc = get_option('theme_compatibility_setting');
|
|
| 177 | + return $tc['geodir_sub_menu_li_class_filter']; |
|
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | /** |
@@ -187,8 +187,8 @@ discard block |
||
| 187 | 187 | */ |
| 188 | 188 | function geodir_menu_a_class_dynamic() |
| 189 | 189 | {
|
| 190 | - $tc = get_option('theme_compatibility_setting');
|
|
| 191 | - return $tc['geodir_menu_a_class_filter']; |
|
| 190 | + $tc = get_option('theme_compatibility_setting');
|
|
| 191 | + return $tc['geodir_menu_a_class_filter']; |
|
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | /** |
@@ -201,8 +201,8 @@ discard block |
||
| 201 | 201 | */ |
| 202 | 202 | function geodir_sub_menu_a_class_dynamic() |
| 203 | 203 | {
|
| 204 | - $tc = get_option('theme_compatibility_setting');
|
|
| 205 | - return $tc['geodir_sub_menu_a_class_filter']; |
|
| 204 | + $tc = get_option('theme_compatibility_setting');
|
|
| 205 | + return $tc['geodir_sub_menu_a_class_filter']; |
|
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | /** |
@@ -215,8 +215,8 @@ discard block |
||
| 215 | 215 | */ |
| 216 | 216 | function geodir_location_switcher_menu_li_class_dynamic() |
| 217 | 217 | {
|
| 218 | - $tc = get_option('theme_compatibility_setting');
|
|
| 219 | - return $tc['geodir_location_switcher_menu_li_class_filter']; |
|
| 218 | + $tc = get_option('theme_compatibility_setting');
|
|
| 219 | + return $tc['geodir_location_switcher_menu_li_class_filter']; |
|
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | /** |
@@ -229,8 +229,8 @@ discard block |
||
| 229 | 229 | */ |
| 230 | 230 | function geodir_location_switcher_menu_a_class_dynamic() |
| 231 | 231 | {
|
| 232 | - $tc = get_option('theme_compatibility_setting');
|
|
| 233 | - return $tc['geodir_location_switcher_menu_a_class_filter']; |
|
| 232 | + $tc = get_option('theme_compatibility_setting');
|
|
| 233 | + return $tc['geodir_location_switcher_menu_a_class_filter']; |
|
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | /** |
@@ -243,8 +243,8 @@ discard block |
||
| 243 | 243 | */ |
| 244 | 244 | function geodir_location_switcher_menu_sub_ul_class_dynamic() |
| 245 | 245 | {
|
| 246 | - $tc = get_option('theme_compatibility_setting');
|
|
| 247 | - return $tc['geodir_location_switcher_menu_sub_ul_class_filter']; |
|
| 246 | + $tc = get_option('theme_compatibility_setting');
|
|
| 247 | + return $tc['geodir_location_switcher_menu_sub_ul_class_filter']; |
|
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | /** |
@@ -257,8 +257,8 @@ discard block |
||
| 257 | 257 | */ |
| 258 | 258 | function geodir_location_switcher_menu_sub_li_class_dynamic() |
| 259 | 259 | {
|
| 260 | - $tc = get_option('theme_compatibility_setting');
|
|
| 261 | - return $tc['geodir_location_switcher_menu_sub_li_class_filter']; |
|
| 260 | + $tc = get_option('theme_compatibility_setting');
|
|
| 261 | + return $tc['geodir_location_switcher_menu_sub_li_class_filter']; |
|
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | |
@@ -275,106 +275,106 @@ discard block |
||
| 275 | 275 | function geodir_content_actions_dynamic() |
| 276 | 276 | {
|
| 277 | 277 | |
| 278 | - $tc = get_option('theme_compatibility_setting');
|
|
| 279 | - if (empty($tc)) {
|
|
| 280 | - return; |
|
| 281 | - } |
|
| 278 | + $tc = get_option('theme_compatibility_setting');
|
|
| 279 | + if (empty($tc)) {
|
|
| 280 | + return; |
|
| 281 | + } |
|
| 282 | 282 | |
| 283 | - //php |
|
| 284 | - if (!empty($tc['geodir_theme_compat_code'])) {
|
|
| 285 | - include_once('geodirectory-functions/compatibility/' . $tc['geodir_theme_compat_code'] . '.php');
|
|
| 286 | - } |
|
| 283 | + //php |
|
| 284 | + if (!empty($tc['geodir_theme_compat_code'])) {
|
|
| 285 | + include_once('geodirectory-functions/compatibility/' . $tc['geodir_theme_compat_code'] . '.php');
|
|
| 286 | + } |
|
| 287 | 287 | |
| 288 | - //geodir_full_page_class |
|
| 289 | - if (!empty($tc['geodir_full_page_class_filter'])) {
|
|
| 290 | - add_filter('geodir_full_page_class', 'geodir_full_page_class_dynamic', 10);
|
|
| 291 | - } |
|
| 288 | + //geodir_full_page_class |
|
| 289 | + if (!empty($tc['geodir_full_page_class_filter'])) {
|
|
| 290 | + add_filter('geodir_full_page_class', 'geodir_full_page_class_dynamic', 10);
|
|
| 291 | + } |
|
| 292 | 292 | |
| 293 | - //widget before filter |
|
| 294 | - if (!empty($tc['geodir_before_widget_filter'])) {
|
|
| 295 | - add_filter('geodir_before_widget', 'geodir_before_widget_dynamic', 10);
|
|
| 296 | - } |
|
| 293 | + //widget before filter |
|
| 294 | + if (!empty($tc['geodir_before_widget_filter'])) {
|
|
| 295 | + add_filter('geodir_before_widget', 'geodir_before_widget_dynamic', 10);
|
|
| 296 | + } |
|
| 297 | 297 | |
| 298 | - //widget after filter |
|
| 299 | - if (!empty($tc['geodir_after_widget_filter'])) {
|
|
| 300 | - add_filter('geodir_after_widget', 'geodir_after_widget_dynamic', 10);
|
|
| 301 | - } |
|
| 298 | + //widget after filter |
|
| 299 | + if (!empty($tc['geodir_after_widget_filter'])) {
|
|
| 300 | + add_filter('geodir_after_widget', 'geodir_after_widget_dynamic', 10);
|
|
| 301 | + } |
|
| 302 | 302 | |
| 303 | - //widget before title filter |
|
| 304 | - if (!empty($tc['geodir_before_title_filter'])) {
|
|
| 305 | - add_filter('geodir_before_title', 'geodir_before_title_dynamic', 10);
|
|
| 306 | - } |
|
| 303 | + //widget before title filter |
|
| 304 | + if (!empty($tc['geodir_before_title_filter'])) {
|
|
| 305 | + add_filter('geodir_before_title', 'geodir_before_title_dynamic', 10);
|
|
| 306 | + } |
|
| 307 | 307 | |
| 308 | - //widget before title filter |
|
| 309 | - if (!empty($tc['geodir_after_title_filter'])) {
|
|
| 310 | - add_filter('geodir_after_title', 'geodir_after_title_dynamic', 10);
|
|
| 311 | - } |
|
| 308 | + //widget before title filter |
|
| 309 | + if (!empty($tc['geodir_after_title_filter'])) {
|
|
| 310 | + add_filter('geodir_after_title', 'geodir_after_title_dynamic', 10);
|
|
| 311 | + } |
|
| 312 | 312 | |
| 313 | - //menu li class |
|
| 314 | - if (!empty($tc['geodir_menu_li_class_filter'])) {
|
|
| 315 | - add_filter('geodir_menu_li_class', 'geodir_menu_li_class_dynamic', 10);
|
|
| 316 | - } |
|
| 313 | + //menu li class |
|
| 314 | + if (!empty($tc['geodir_menu_li_class_filter'])) {
|
|
| 315 | + add_filter('geodir_menu_li_class', 'geodir_menu_li_class_dynamic', 10);
|
|
| 316 | + } |
|
| 317 | 317 | |
| 318 | - //menu ul class |
|
| 319 | - if (!empty($tc['geodir_sub_menu_ul_class_filter'])) {
|
|
| 320 | - add_filter('geodir_sub_menu_ul_class', 'geodir_sub_menu_ul_class_dynamic', 10);
|
|
| 321 | - } |
|
| 318 | + //menu ul class |
|
| 319 | + if (!empty($tc['geodir_sub_menu_ul_class_filter'])) {
|
|
| 320 | + add_filter('geodir_sub_menu_ul_class', 'geodir_sub_menu_ul_class_dynamic', 10);
|
|
| 321 | + } |
|
| 322 | 322 | |
| 323 | - //menu sub li class |
|
| 324 | - if (!empty($tc['geodir_sub_menu_li_class_filter'])) {
|
|
| 325 | - add_filter('geodir_sub_menu_li_class', 'geodir_sub_menu_li_class_dynamic', 10);
|
|
| 326 | - } |
|
| 323 | + //menu sub li class |
|
| 324 | + if (!empty($tc['geodir_sub_menu_li_class_filter'])) {
|
|
| 325 | + add_filter('geodir_sub_menu_li_class', 'geodir_sub_menu_li_class_dynamic', 10);
|
|
| 326 | + } |
|
| 327 | 327 | |
| 328 | - //menu a class |
|
| 329 | - if (!empty($tc['geodir_menu_a_class_filter'])) {
|
|
| 330 | - add_filter('geodir_menu_a_class', 'geodir_menu_a_class_dynamic', 10);
|
|
| 331 | - } |
|
| 328 | + //menu a class |
|
| 329 | + if (!empty($tc['geodir_menu_a_class_filter'])) {
|
|
| 330 | + add_filter('geodir_menu_a_class', 'geodir_menu_a_class_dynamic', 10);
|
|
| 331 | + } |
|
| 332 | 332 | |
| 333 | - //menu sub a class |
|
| 334 | - if (!empty($tc['geodir_sub_menu_a_class_filter'])) {
|
|
| 335 | - add_filter('geodir_sub_menu_a_class', 'geodir_sub_menu_a_class_dynamic', 10);
|
|
| 336 | - } |
|
| 333 | + //menu sub a class |
|
| 334 | + if (!empty($tc['geodir_sub_menu_a_class_filter'])) {
|
|
| 335 | + add_filter('geodir_sub_menu_a_class', 'geodir_sub_menu_a_class_dynamic', 10);
|
|
| 336 | + } |
|
| 337 | 337 | |
| 338 | - //location menu li class |
|
| 339 | - if (!empty($tc['geodir_location_switcher_menu_li_class_filter'])) {
|
|
| 340 | - add_filter('geodir_location_switcher_menu_li_class', 'geodir_location_switcher_menu_li_class_dynamic', 10);
|
|
| 341 | - } |
|
| 338 | + //location menu li class |
|
| 339 | + if (!empty($tc['geodir_location_switcher_menu_li_class_filter'])) {
|
|
| 340 | + add_filter('geodir_location_switcher_menu_li_class', 'geodir_location_switcher_menu_li_class_dynamic', 10);
|
|
| 341 | + } |
|
| 342 | 342 | |
| 343 | - //location menu sub ul class |
|
| 344 | - if (!empty($tc['geodir_location_switcher_menu_sub_ul_class_filter'])) {
|
|
| 345 | - add_filter('geodir_location_switcher_menu_sub_ul_class', 'geodir_location_switcher_menu_sub_ul_class_dynamic', 10);
|
|
| 346 | - } |
|
| 343 | + //location menu sub ul class |
|
| 344 | + if (!empty($tc['geodir_location_switcher_menu_sub_ul_class_filter'])) {
|
|
| 345 | + add_filter('geodir_location_switcher_menu_sub_ul_class', 'geodir_location_switcher_menu_sub_ul_class_dynamic', 10);
|
|
| 346 | + } |
|
| 347 | 347 | |
| 348 | - //location menu sub li class |
|
| 349 | - if (!empty($tc['geodir_location_switcher_menu_sub_li_class_filter'])) {
|
|
| 350 | - add_filter('geodir_location_switcher_menu_sub_li_class', 'geodir_location_switcher_menu_sub_li_class_dynamic', 10);
|
|
| 351 | - } |
|
| 348 | + //location menu sub li class |
|
| 349 | + if (!empty($tc['geodir_location_switcher_menu_sub_li_class_filter'])) {
|
|
| 350 | + add_filter('geodir_location_switcher_menu_sub_li_class', 'geodir_location_switcher_menu_sub_li_class_dynamic', 10);
|
|
| 351 | + } |
|
| 352 | 352 | |
| 353 | - //location menu a class |
|
| 354 | - if (!empty($tc['geodir_location_switcher_menu_a_class_filter'])) {
|
|
| 355 | - add_filter('geodir_location_switcher_menu_a_class', 'geodir_location_switcher_menu_a_class_dynamic', 10);
|
|
| 356 | - } |
|
| 353 | + //location menu a class |
|
| 354 | + if (!empty($tc['geodir_location_switcher_menu_a_class_filter'])) {
|
|
| 355 | + add_filter('geodir_location_switcher_menu_a_class', 'geodir_location_switcher_menu_a_class_dynamic', 10);
|
|
| 356 | + } |
|
| 357 | 357 | |
| 358 | - // compat styles |
|
| 359 | - if (!empty($tc['geodir_theme_compat_css'])) {
|
|
| 360 | - add_action('wp_head', 'gd_compat_styles');
|
|
| 361 | - } |
|
| 358 | + // compat styles |
|
| 359 | + if (!empty($tc['geodir_theme_compat_css'])) {
|
|
| 360 | + add_action('wp_head', 'gd_compat_styles');
|
|
| 361 | + } |
|
| 362 | 362 | |
| 363 | - // compat js |
|
| 364 | - if (!empty($tc['geodir_theme_compat_js'])) {
|
|
| 365 | - add_action('wp_footer', 'gd_compat_script');
|
|
| 366 | - } |
|
| 363 | + // compat js |
|
| 364 | + if (!empty($tc['geodir_theme_compat_js'])) {
|
|
| 365 | + add_action('wp_footer', 'gd_compat_script');
|
|
| 366 | + } |
|
| 367 | 367 | |
| 368 | 368 | |
| 369 | - // geodir_top_content_add |
|
| 370 | - if (!empty($tc['geodir_top_content_add'])) {
|
|
| 371 | - add_action('geodir_top_content', 'geodir_top_content_add_dynamic', 10, 1);
|
|
| 372 | - } |
|
| 369 | + // geodir_top_content_add |
|
| 370 | + if (!empty($tc['geodir_top_content_add'])) {
|
|
| 371 | + add_action('geodir_top_content', 'geodir_top_content_add_dynamic', 10, 1);
|
|
| 372 | + } |
|
| 373 | 373 | |
| 374 | - // geodir_before_main_content_add |
|
| 375 | - if (!empty($tc['geodir_before_main_content_add'])) {
|
|
| 376 | - add_action('geodir_before_main_content', 'geodir_before_main_content_add_dynamic', 10, 1);
|
|
| 377 | - } |
|
| 374 | + // geodir_before_main_content_add |
|
| 375 | + if (!empty($tc['geodir_before_main_content_add'])) {
|
|
| 376 | + add_action('geodir_before_main_content', 'geodir_before_main_content_add_dynamic', 10, 1);
|
|
| 377 | + } |
|
| 378 | 378 | |
| 379 | 379 | |
| 380 | 380 | } |
@@ -397,23 +397,23 @@ discard block |
||
| 397 | 397 | */ |
| 398 | 398 | function geodir_action_wrapper_open($type = '', $id = '', $class = '') |
| 399 | 399 | {
|
| 400 | - $tc = get_option('theme_compatibility_setting');
|
|
| 401 | - if (!empty($tc['geodir_wrapper_open_replace'])) {
|
|
| 402 | - $text = $tc['geodir_wrapper_open_replace']; |
|
| 403 | - } else {
|
|
| 404 | - $text = '<div id="[id]" class="[class]">'; |
|
| 405 | - } |
|
| 400 | + $tc = get_option('theme_compatibility_setting');
|
|
| 401 | + if (!empty($tc['geodir_wrapper_open_replace'])) {
|
|
| 402 | + $text = $tc['geodir_wrapper_open_replace']; |
|
| 403 | + } else {
|
|
| 404 | + $text = '<div id="[id]" class="[class]">'; |
|
| 405 | + } |
|
| 406 | 406 | |
| 407 | - if (!empty($tc['geodir_wrapper_open_id'])) {
|
|
| 408 | - $id = $tc['geodir_wrapper_open_id']; |
|
| 409 | - } |
|
| 410 | - if (!empty($tc['geodir_wrapper_open_class'])) {
|
|
| 411 | - $class = $tc['geodir_wrapper_open_class']; |
|
| 412 | - } |
|
| 407 | + if (!empty($tc['geodir_wrapper_open_id'])) {
|
|
| 408 | + $id = $tc['geodir_wrapper_open_id']; |
|
| 409 | + } |
|
| 410 | + if (!empty($tc['geodir_wrapper_open_class'])) {
|
|
| 411 | + $class = $tc['geodir_wrapper_open_class']; |
|
| 412 | + } |
|
| 413 | 413 | |
| 414 | - $text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
|
|
| 414 | + $text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
|
|
| 415 | 415 | |
| 416 | - echo $text; |
|
| 416 | + echo $text; |
|
| 417 | 417 | } |
| 418 | 418 | |
| 419 | 419 | // action for adding the wrapperdiv closing tag |
@@ -428,14 +428,14 @@ discard block |
||
| 428 | 428 | */ |
| 429 | 429 | function geodir_action_wrapper_close($type = '') |
| 430 | 430 | {
|
| 431 | - $tc = get_option('theme_compatibility_setting');
|
|
| 432 | - if (!empty($tc['geodir_wrapper_close_replace'])) {
|
|
| 433 | - $text = $tc['geodir_wrapper_close_replace']; |
|
| 434 | - } else {
|
|
| 435 | - $text = '</div><!-- wrapper ends here-->'; |
|
| 436 | - } |
|
| 431 | + $tc = get_option('theme_compatibility_setting');
|
|
| 432 | + if (!empty($tc['geodir_wrapper_close_replace'])) {
|
|
| 433 | + $text = $tc['geodir_wrapper_close_replace']; |
|
| 434 | + } else {
|
|
| 435 | + $text = '</div><!-- wrapper ends here-->'; |
|
| 436 | + } |
|
| 437 | 437 | |
| 438 | - echo $text; |
|
| 438 | + echo $text; |
|
| 439 | 439 | } |
| 440 | 440 | |
| 441 | 441 | // action for adding the content div opening tag |
@@ -451,35 +451,35 @@ discard block |
||
| 451 | 451 | */ |
| 452 | 452 | function geodir_action_wrapper_content_open($type = '', $id = '', $class = '') |
| 453 | 453 | {
|
| 454 | - if ($type == 'home-page' && $width = get_option('geodir_width_home_contant_section')) {
|
|
| 455 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 456 | - } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_contant_section')) {
|
|
| 457 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 458 | - } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_contant_section')) {
|
|
| 459 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 460 | - } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_contant_section')) {
|
|
| 461 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 462 | - } else {
|
|
| 463 | - $width_css = ''; |
|
| 464 | - } |
|
| 465 | - |
|
| 466 | - $tc = get_option('theme_compatibility_setting');
|
|
| 467 | - if (!empty($tc['geodir_wrapper_content_open_replace'])) {
|
|
| 468 | - $text = $tc['geodir_wrapper_content_open_replace']; |
|
| 469 | - } else {
|
|
| 470 | - $text = '<div id="[id]" class="[class]" role="main" [width_css]>'; |
|
| 471 | - } |
|
| 472 | - |
|
| 473 | - if (!empty($tc['geodir_wrapper_content_open_id'])) {
|
|
| 474 | - $id = $tc['geodir_wrapper_content_open_id']; |
|
| 475 | - } |
|
| 476 | - if (!empty($tc['geodir_wrapper_content_open_class'])) {
|
|
| 477 | - $class = $tc['geodir_wrapper_content_open_class']; |
|
| 478 | - } |
|
| 479 | - |
|
| 480 | - $text = str_replace(array("[id]", "[class]", "[width_css]"), array($id, $class, $width_css), $text);
|
|
| 481 | - |
|
| 482 | - echo $text; |
|
| 454 | + if ($type == 'home-page' && $width = get_option('geodir_width_home_contant_section')) {
|
|
| 455 | + $width_css = 'style="width:' . $width . '%;"'; |
|
| 456 | + } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_contant_section')) {
|
|
| 457 | + $width_css = 'style="width:' . $width . '%;"'; |
|
| 458 | + } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_contant_section')) {
|
|
| 459 | + $width_css = 'style="width:' . $width . '%;"'; |
|
| 460 | + } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_contant_section')) {
|
|
| 461 | + $width_css = 'style="width:' . $width . '%;"'; |
|
| 462 | + } else {
|
|
| 463 | + $width_css = ''; |
|
| 464 | + } |
|
| 465 | + |
|
| 466 | + $tc = get_option('theme_compatibility_setting');
|
|
| 467 | + if (!empty($tc['geodir_wrapper_content_open_replace'])) {
|
|
| 468 | + $text = $tc['geodir_wrapper_content_open_replace']; |
|
| 469 | + } else {
|
|
| 470 | + $text = '<div id="[id]" class="[class]" role="main" [width_css]>'; |
|
| 471 | + } |
|
| 472 | + |
|
| 473 | + if (!empty($tc['geodir_wrapper_content_open_id'])) {
|
|
| 474 | + $id = $tc['geodir_wrapper_content_open_id']; |
|
| 475 | + } |
|
| 476 | + if (!empty($tc['geodir_wrapper_content_open_class'])) {
|
|
| 477 | + $class = $tc['geodir_wrapper_content_open_class']; |
|
| 478 | + } |
|
| 479 | + |
|
| 480 | + $text = str_replace(array("[id]", "[class]", "[width_css]"), array($id, $class, $width_css), $text);
|
|
| 481 | + |
|
| 482 | + echo $text; |
|
| 483 | 483 | } |
| 484 | 484 | |
| 485 | 485 | // action for adding the primary div closing tag |
@@ -493,13 +493,13 @@ discard block |
||
| 493 | 493 | */ |
| 494 | 494 | function geodir_action_wrapper_content_close($type = '') |
| 495 | 495 | {
|
| 496 | - $tc = get_option('theme_compatibility_setting');
|
|
| 497 | - if (!empty($tc['geodir_wrapper_content_close_replace'])) {
|
|
| 498 | - $text = $tc['geodir_wrapper_content_close_replace']; |
|
| 499 | - } else {
|
|
| 500 | - $text = '</div><!-- content ends here-->'; |
|
| 501 | - } |
|
| 502 | - echo $text; |
|
| 496 | + $tc = get_option('theme_compatibility_setting');
|
|
| 497 | + if (!empty($tc['geodir_wrapper_content_close_replace'])) {
|
|
| 498 | + $text = $tc['geodir_wrapper_content_close_replace']; |
|
| 499 | + } else {
|
|
| 500 | + $text = '</div><!-- content ends here-->'; |
|
| 501 | + } |
|
| 502 | + echo $text; |
|
| 503 | 503 | } |
| 504 | 504 | |
| 505 | 505 | // action for adding the <article> opening tag |
@@ -517,24 +517,24 @@ discard block |
||
| 517 | 517 | */ |
| 518 | 518 | function geodir_action_article_open($type = '', $id = '', $class = '', $itemtype = '') |
| 519 | 519 | {
|
| 520 | - $class = implode(" ", $class);
|
|
| 521 | - $tc = get_option('theme_compatibility_setting');
|
|
| 522 | - if (!empty($tc['geodir_article_open_replace'])) {
|
|
| 523 | - $text = $tc['geodir_article_open_replace']; |
|
| 524 | - } else {
|
|
| 525 | - $text = '<article id="[id]" class="[class]" >'; |
|
| 526 | - } |
|
| 520 | + $class = implode(" ", $class);
|
|
| 521 | + $tc = get_option('theme_compatibility_setting');
|
|
| 522 | + if (!empty($tc['geodir_article_open_replace'])) {
|
|
| 523 | + $text = $tc['geodir_article_open_replace']; |
|
| 524 | + } else {
|
|
| 525 | + $text = '<article id="[id]" class="[class]" >'; |
|
| 526 | + } |
|
| 527 | 527 | |
| 528 | - if (!empty($tc['geodir_article_open_id'])) {
|
|
| 529 | - $id = $tc['geodir_article_open_id']; |
|
| 530 | - } |
|
| 531 | - if (!empty($tc['geodir_article_open_class'])) {
|
|
| 532 | - $class = $tc['geodir_article_open_class']; |
|
| 533 | - } |
|
| 528 | + if (!empty($tc['geodir_article_open_id'])) {
|
|
| 529 | + $id = $tc['geodir_article_open_id']; |
|
| 530 | + } |
|
| 531 | + if (!empty($tc['geodir_article_open_class'])) {
|
|
| 532 | + $class = $tc['geodir_article_open_class']; |
|
| 533 | + } |
|
| 534 | 534 | |
| 535 | - $text = str_replace(array("[id]", "[class]", "[itemtype]"), array($id, $class, $itemtype), $text);
|
|
| 535 | + $text = str_replace(array("[id]", "[class]", "[itemtype]"), array($id, $class, $itemtype), $text);
|
|
| 536 | 536 | |
| 537 | - echo $text; |
|
| 537 | + echo $text; |
|
| 538 | 538 | } |
| 539 | 539 | |
| 540 | 540 | // action for adding the primary div closing tag |
@@ -548,13 +548,13 @@ discard block |
||
| 548 | 548 | */ |
| 549 | 549 | function geodir_action_article_close($type = '') |
| 550 | 550 | {
|
| 551 | - $tc = get_option('theme_compatibility_setting');
|
|
| 552 | - if (!empty($tc['geodir_article_close_replace'])) {
|
|
| 553 | - $text = $tc['geodir_article_close_replace']; |
|
| 554 | - } else {
|
|
| 555 | - $text = '</article><!-- article ends here-->'; |
|
| 556 | - } |
|
| 557 | - echo $text; |
|
| 551 | + $tc = get_option('theme_compatibility_setting');
|
|
| 552 | + if (!empty($tc['geodir_article_close_replace'])) {
|
|
| 553 | + $text = $tc['geodir_article_close_replace']; |
|
| 554 | + } else {
|
|
| 555 | + $text = '</article><!-- article ends here-->'; |
|
| 556 | + } |
|
| 557 | + echo $text; |
|
| 558 | 558 | } |
| 559 | 559 | |
| 560 | 560 | // action for adding the sidebar opening tag |
@@ -571,35 +571,35 @@ discard block |
||
| 571 | 571 | */ |
| 572 | 572 | function geodir_action_sidebar_right_open($type = '', $id = '', $class = '', $itemtype = '') |
| 573 | 573 | {
|
| 574 | - if ($type == 'home-page' && $width = get_option('geodir_width_home_right_section')) {
|
|
| 575 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 576 | - } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_right_section')) {
|
|
| 577 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 578 | - } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_right_section')) {
|
|
| 579 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 580 | - } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_right_section')) {
|
|
| 581 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 582 | - } else {
|
|
| 583 | - $width_css = ''; |
|
| 584 | - } |
|
| 585 | - |
|
| 586 | - $tc = get_option('theme_compatibility_setting');
|
|
| 587 | - if (!empty($tc['geodir_sidebar_right_open_replace'])) {
|
|
| 588 | - $text = $tc['geodir_sidebar_right_open_replace']; |
|
| 589 | - } else {
|
|
| 590 | - $text = '<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>'; |
|
| 591 | - } |
|
| 592 | - |
|
| 593 | - if (!empty($tc['geodir_sidebar_right_open_id'])) {
|
|
| 594 | - $id = $tc['geodir_sidebar_right_open_id']; |
|
| 595 | - } |
|
| 596 | - if (!empty($tc['geodir_sidebar_right_open_class'])) {
|
|
| 597 | - $class = $tc['geodir_sidebar_right_open_class']; |
|
| 598 | - } |
|
| 599 | - |
|
| 600 | - $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
|
|
| 601 | - |
|
| 602 | - echo $text; |
|
| 574 | + if ($type == 'home-page' && $width = get_option('geodir_width_home_right_section')) {
|
|
| 575 | + $width_css = 'style="width:' . $width . '%;"'; |
|
| 576 | + } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_right_section')) {
|
|
| 577 | + $width_css = 'style="width:' . $width . '%;"'; |
|
| 578 | + } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_right_section')) {
|
|
| 579 | + $width_css = 'style="width:' . $width . '%;"'; |
|
| 580 | + } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_right_section')) {
|
|
| 581 | + $width_css = 'style="width:' . $width . '%;"'; |
|
| 582 | + } else {
|
|
| 583 | + $width_css = ''; |
|
| 584 | + } |
|
| 585 | + |
|
| 586 | + $tc = get_option('theme_compatibility_setting');
|
|
| 587 | + if (!empty($tc['geodir_sidebar_right_open_replace'])) {
|
|
| 588 | + $text = $tc['geodir_sidebar_right_open_replace']; |
|
| 589 | + } else {
|
|
| 590 | + $text = '<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>'; |
|
| 591 | + } |
|
| 592 | + |
|
| 593 | + if (!empty($tc['geodir_sidebar_right_open_id'])) {
|
|
| 594 | + $id = $tc['geodir_sidebar_right_open_id']; |
|
| 595 | + } |
|
| 596 | + if (!empty($tc['geodir_sidebar_right_open_class'])) {
|
|
| 597 | + $class = $tc['geodir_sidebar_right_open_class']; |
|
| 598 | + } |
|
| 599 | + |
|
| 600 | + $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
|
|
| 601 | + |
|
| 602 | + echo $text; |
|
| 603 | 603 | } |
| 604 | 604 | |
| 605 | 605 | // action for adding the primary div closing tag |
@@ -613,13 +613,13 @@ discard block |
||
| 613 | 613 | */ |
| 614 | 614 | function geodir_action_sidebar_right_close($type = '') |
| 615 | 615 | {
|
| 616 | - $tc = get_option('theme_compatibility_setting');
|
|
| 617 | - if (!empty($tc['geodir_sidebar_right_close_replace'])) {
|
|
| 618 | - $text = $tc['geodir_sidebar_right_close_replace']; |
|
| 619 | - } else {
|
|
| 620 | - $text = '</aside><!-- sidebar ends here-->'; |
|
| 621 | - } |
|
| 622 | - echo $text; |
|
| 616 | + $tc = get_option('theme_compatibility_setting');
|
|
| 617 | + if (!empty($tc['geodir_sidebar_right_close_replace'])) {
|
|
| 618 | + $text = $tc['geodir_sidebar_right_close_replace']; |
|
| 619 | + } else {
|
|
| 620 | + $text = '</aside><!-- sidebar ends here-->'; |
|
| 621 | + } |
|
| 622 | + echo $text; |
|
| 623 | 623 | } |
| 624 | 624 | |
| 625 | 625 | |
@@ -640,121 +640,121 @@ discard block |
||
| 640 | 640 | */ |
| 641 | 641 | function geodir_action_geodir_set_preview_post() |
| 642 | 642 | {
|
| 643 | - global $post, $preview, $gd_session; |
|
| 644 | - $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend |
|
| 645 | - if (!$preview || $is_backend_preview) {
|
|
| 646 | - return; |
|
| 647 | - }// bail if not previewing |
|
| 648 | - |
|
| 649 | - $listing_type = isset($_REQUEST['listing_type']) ? sanitize_text_field($_REQUEST['listing_type']) : ''; |
|
| 650 | - |
|
| 651 | - $fields_info = geodir_get_custom_fields_type($listing_type); |
|
| 652 | - |
|
| 653 | - foreach ($_REQUEST as $pkey => $pval) {
|
|
| 654 | - if ($pkey == 'geodir_video') {
|
|
| 655 | - $tags = '<iframe>'; |
|
| 656 | - } else if ($pkey == 'post_desc') {
|
|
| 657 | - $tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'; |
|
| 658 | - } else if (is_array($fields_info) && isset($fields_info[$pkey]) && ($fields_info[$pkey] == 'textarea' || $fields_info[$pkey] == 'html')) {
|
|
| 659 | - $tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'; |
|
| 660 | - } else if (is_array($_REQUEST[$pkey])) {
|
|
| 661 | - $tags = 'skip_field'; |
|
| 662 | - } else {
|
|
| 663 | - $tags = ''; |
|
| 664 | - } |
|
| 665 | - /** |
|
| 666 | - * Allows the filtering of the allowed HTML tags per field when submitting from frontend add listing page. |
|
| 667 | - * |
|
| 668 | - * @since 1.0.0 |
|
| 669 | - * @param string $tags The allowed HTML tags for the field. Can be many things, for example the description allows these tags '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'. |
|
| 670 | - * @param string|array $pkey The field id/name. If array then value is set as "skip_field". |
|
| 671 | - */ |
|
| 672 | - $tags = apply_filters('geodir_save_post_key', $tags, $pkey);
|
|
| 673 | - |
|
| 674 | - if ($tags != 'skip_field') {
|
|
| 675 | - $_REQUEST[$pkey] = strip_tags($_REQUEST[$pkey], $tags); |
|
| 676 | - } |
|
| 677 | - } |
|
| 678 | - |
|
| 679 | - $post = (object)$_REQUEST; |
|
| 680 | - |
|
| 681 | - |
|
| 682 | - if (isset($post->video)) {
|
|
| 683 | - $post->video = stripslashes($post->video); |
|
| 684 | - } |
|
| 685 | - |
|
| 686 | - if (isset($post->Video2)) {
|
|
| 687 | - $post->Video2 = stripslashes($post->Video2); |
|
| 688 | - } |
|
| 689 | - |
|
| 690 | - $post_type = $post->listing_type; |
|
| 691 | - $post_type_info = get_post_type_object($post_type); |
|
| 692 | - |
|
| 693 | - $listing_label = $post_type_info->labels->singular_name; |
|
| 694 | - |
|
| 695 | - $term_icon = ''; |
|
| 696 | - |
|
| 697 | - if (!empty($post->post_category)) {
|
|
| 698 | - foreach ($post->post_category as $post_taxonomy => $post_term) {
|
|
| 699 | - |
|
| 700 | - if ($post_term != '' && !is_array($post_term)) {
|
|
| 701 | - $post_term = explode(',', trim($post_term, ','));
|
|
| 702 | - } |
|
| 643 | + global $post, $preview, $gd_session; |
|
| 644 | + $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend |
|
| 645 | + if (!$preview || $is_backend_preview) {
|
|
| 646 | + return; |
|
| 647 | + }// bail if not previewing |
|
| 648 | + |
|
| 649 | + $listing_type = isset($_REQUEST['listing_type']) ? sanitize_text_field($_REQUEST['listing_type']) : ''; |
|
| 650 | + |
|
| 651 | + $fields_info = geodir_get_custom_fields_type($listing_type); |
|
| 652 | + |
|
| 653 | + foreach ($_REQUEST as $pkey => $pval) {
|
|
| 654 | + if ($pkey == 'geodir_video') {
|
|
| 655 | + $tags = '<iframe>'; |
|
| 656 | + } else if ($pkey == 'post_desc') {
|
|
| 657 | + $tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'; |
|
| 658 | + } else if (is_array($fields_info) && isset($fields_info[$pkey]) && ($fields_info[$pkey] == 'textarea' || $fields_info[$pkey] == 'html')) {
|
|
| 659 | + $tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'; |
|
| 660 | + } else if (is_array($_REQUEST[$pkey])) {
|
|
| 661 | + $tags = 'skip_field'; |
|
| 662 | + } else {
|
|
| 663 | + $tags = ''; |
|
| 664 | + } |
|
| 665 | + /** |
|
| 666 | + * Allows the filtering of the allowed HTML tags per field when submitting from frontend add listing page. |
|
| 667 | + * |
|
| 668 | + * @since 1.0.0 |
|
| 669 | + * @param string $tags The allowed HTML tags for the field. Can be many things, for example the description allows these tags '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'. |
|
| 670 | + * @param string|array $pkey The field id/name. If array then value is set as "skip_field". |
|
| 671 | + */ |
|
| 672 | + $tags = apply_filters('geodir_save_post_key', $tags, $pkey);
|
|
| 673 | + |
|
| 674 | + if ($tags != 'skip_field') {
|
|
| 675 | + $_REQUEST[$pkey] = strip_tags($_REQUEST[$pkey], $tags); |
|
| 676 | + } |
|
| 677 | + } |
|
| 678 | + |
|
| 679 | + $post = (object)$_REQUEST; |
|
| 680 | + |
|
| 681 | + |
|
| 682 | + if (isset($post->video)) {
|
|
| 683 | + $post->video = stripslashes($post->video); |
|
| 684 | + } |
|
| 685 | + |
|
| 686 | + if (isset($post->Video2)) {
|
|
| 687 | + $post->Video2 = stripslashes($post->Video2); |
|
| 688 | + } |
|
| 689 | + |
|
| 690 | + $post_type = $post->listing_type; |
|
| 691 | + $post_type_info = get_post_type_object($post_type); |
|
| 692 | + |
|
| 693 | + $listing_label = $post_type_info->labels->singular_name; |
|
| 694 | + |
|
| 695 | + $term_icon = ''; |
|
| 696 | + |
|
| 697 | + if (!empty($post->post_category)) {
|
|
| 698 | + foreach ($post->post_category as $post_taxonomy => $post_term) {
|
|
| 699 | + |
|
| 700 | + if ($post_term != '' && !is_array($post_term)) {
|
|
| 701 | + $post_term = explode(',', trim($post_term, ','));
|
|
| 702 | + } |
|
| 703 | 703 | |
| 704 | - if (is_array($post_term)) {
|
|
| 705 | - $post_term = array_unique($post_term); |
|
| 706 | - } |
|
| 704 | + if (is_array($post_term)) {
|
|
| 705 | + $post_term = array_unique($post_term); |
|
| 706 | + } |
|
| 707 | 707 | |
| 708 | - if (!empty($post_term)) {
|
|
| 709 | - foreach ($post_term as $cat_id) {
|
|
| 710 | - $cat_id = trim($cat_id); |
|
| 711 | - |
|
| 712 | - if ($cat_id != '') {
|
|
| 713 | - $term_icon = get_option('geodir_default_marker_icon');
|
|
| 714 | - |
|
| 715 | - if (isset($post->post_default_category) && $post->post_default_category == $cat_id) {
|
|
| 716 | - if ($term_icon_url = get_tax_meta($cat_id, 'ct_cat_icon', false, $post_type)) {
|
|
| 717 | - if (isset($term_icon_url['src']) && $term_icon_url['src'] != '') |
|
| 718 | - $term_icon = $term_icon_url['src']; |
|
| 719 | - break; |
|
| 720 | - } |
|
| 721 | - } |
|
| 722 | - } |
|
| 723 | - } |
|
| 724 | - } |
|
| 725 | - } |
|
| 726 | - } |
|
| 708 | + if (!empty($post_term)) {
|
|
| 709 | + foreach ($post_term as $cat_id) {
|
|
| 710 | + $cat_id = trim($cat_id); |
|
| 711 | + |
|
| 712 | + if ($cat_id != '') {
|
|
| 713 | + $term_icon = get_option('geodir_default_marker_icon');
|
|
| 714 | + |
|
| 715 | + if (isset($post->post_default_category) && $post->post_default_category == $cat_id) {
|
|
| 716 | + if ($term_icon_url = get_tax_meta($cat_id, 'ct_cat_icon', false, $post_type)) {
|
|
| 717 | + if (isset($term_icon_url['src']) && $term_icon_url['src'] != '') |
|
| 718 | + $term_icon = $term_icon_url['src']; |
|
| 719 | + break; |
|
| 720 | + } |
|
| 721 | + } |
|
| 722 | + } |
|
| 723 | + } |
|
| 724 | + } |
|
| 725 | + } |
|
| 726 | + } |
|
| 727 | 727 | |
| 728 | - $post_latitude = isset($post->post_latitude) ? $post->post_latitude : ''; |
|
| 729 | - $post_longitude = isset($post->post_longitude) ? $post->post_longitude : ''; |
|
| 728 | + $post_latitude = isset($post->post_latitude) ? $post->post_latitude : ''; |
|
| 729 | + $post_longitude = isset($post->post_longitude) ? $post->post_longitude : ''; |
|
| 730 | 730 | |
| 731 | - $srcharr = array("'", "/", "-", '"', '\\');
|
|
| 732 | - $replarr = array("′", "⁄", "–", "“", '');
|
|
| 731 | + $srcharr = array("'", "/", "-", '"', '\\');
|
|
| 732 | + $replarr = array("′", "⁄", "–", "“", '');
|
|
| 733 | 733 | |
| 734 | - $json_title = str_replace($srcharr, $replarr, $post->post_title); |
|
| 734 | + $json_title = str_replace($srcharr, $replarr, $post->post_title); |
|
| 735 | 735 | |
| 736 | - $json = '{';
|
|
| 737 | - $json .= '"post_preview": "1",'; |
|
| 738 | - $json .= '"t": "' . $json_title . '",'; |
|
| 739 | - $json .= '"lt": "' . $post_latitude . '",'; |
|
| 740 | - $json .= '"ln": "' . $post_longitude . '",'; |
|
| 741 | - $json .= '"i":"' . $term_icon . '"'; |
|
| 742 | - $json .= '}'; |
|
| 736 | + $json = '{';
|
|
| 737 | + $json .= '"post_preview": "1",'; |
|
| 738 | + $json .= '"t": "' . $json_title . '",'; |
|
| 739 | + $json .= '"lt": "' . $post_latitude . '",'; |
|
| 740 | + $json .= '"ln": "' . $post_longitude . '",'; |
|
| 741 | + $json .= '"i":"' . $term_icon . '"'; |
|
| 742 | + $json .= '}'; |
|
| 743 | 743 | |
| 744 | - $post->marker_json = $json; |
|
| 744 | + $post->marker_json = $json; |
|
| 745 | 745 | |
| 746 | - $gd_session->set('listing', $_REQUEST);
|
|
| 746 | + $gd_session->set('listing', $_REQUEST);
|
|
| 747 | 747 | |
| 748 | - // we need to define a few things to trick the setup_postdata |
|
| 749 | - if (!isset($post->ID)) {
|
|
| 750 | - $post->ID = ''; |
|
| 751 | - $post->post_author = ''; |
|
| 752 | - $post->post_date = ''; |
|
| 753 | - $post->post_content = ''; |
|
| 754 | - $post->default_category = ''; |
|
| 755 | - $post->post_type = ''; |
|
| 756 | - } |
|
| 757 | - setup_postdata($post); |
|
| 748 | + // we need to define a few things to trick the setup_postdata |
|
| 749 | + if (!isset($post->ID)) {
|
|
| 750 | + $post->ID = ''; |
|
| 751 | + $post->post_author = ''; |
|
| 752 | + $post->post_date = ''; |
|
| 753 | + $post->post_content = ''; |
|
| 754 | + $post->default_category = ''; |
|
| 755 | + $post->post_type = ''; |
|
| 756 | + } |
|
| 757 | + setup_postdata($post); |
|
| 758 | 758 | } |
| 759 | 759 | |
| 760 | 760 | /** |
@@ -766,15 +766,15 @@ discard block |
||
| 766 | 766 | */ |
| 767 | 767 | function geodir_action_geodir_preview_code() |
| 768 | 768 | {
|
| 769 | - global $preview; |
|
| 769 | + global $preview; |
|
| 770 | 770 | |
| 771 | - $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend |
|
| 771 | + $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend |
|
| 772 | 772 | |
| 773 | - if (!$preview || $is_backend_preview) {
|
|
| 774 | - return; |
|
| 775 | - }// bail if not previewing |
|
| 773 | + if (!$preview || $is_backend_preview) {
|
|
| 774 | + return; |
|
| 775 | + }// bail if not previewing |
|
| 776 | 776 | |
| 777 | - geodir_get_template_part('preview', 'buttons');
|
|
| 777 | + geodir_get_template_part('preview', 'buttons');
|
|
| 778 | 778 | } |
| 779 | 779 | |
| 780 | 780 | // action for adding the details page top widget area |
@@ -790,20 +790,20 @@ discard block |
||
| 790 | 790 | */ |
| 791 | 791 | function geodir_action_geodir_sidebar_detail_top($class = '') |
| 792 | 792 | {
|
| 793 | - if (get_option('geodir_show_detail_top_section')) { ?>
|
|
| 793 | + if (get_option('geodir_show_detail_top_section')) { ?>
|
|
| 794 | 794 | <div |
| 795 | 795 | class="<?php |
| 796 | - /** |
|
| 797 | - * Filter the div class for the wrapper of the full width widget areas. |
|
| 798 | - * |
|
| 799 | - * Allows you to filter the class of the div for the HTML Container wrapper for the full width widget areas referred to as "Top Section" or "Bottom Section" in the widget areas. |
|
| 800 | - * |
|
| 801 | - * @since 1.0.0 |
|
| 802 | - * @param string $class The class of the div. |
|
| 803 | - * @param string $type The page type the widget area is being used on. Values can be 'geodir_detail_top', 'geodir_detail_bottom', 'geodir_listing_top', 'geodir_listing_bottom', 'Reg/Login Top Section', |
|
| 804 | - * 'geodir_author_top','geodir_author_bottom', 'geodir_search_top', 'geodir_search_bottom', 'geodir_home_top' or 'geodir_home_bottom'. |
|
| 805 | - */ |
|
| 806 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_top'); ?> <?php echo $class; ?>">
|
|
| 796 | + /** |
|
| 797 | + * Filter the div class for the wrapper of the full width widget areas. |
|
| 798 | + * |
|
| 799 | + * Allows you to filter the class of the div for the HTML Container wrapper for the full width widget areas referred to as "Top Section" or "Bottom Section" in the widget areas. |
|
| 800 | + * |
|
| 801 | + * @since 1.0.0 |
|
| 802 | + * @param string $class The class of the div. |
|
| 803 | + * @param string $type The page type the widget area is being used on. Values can be 'geodir_detail_top', 'geodir_detail_bottom', 'geodir_listing_top', 'geodir_listing_bottom', 'Reg/Login Top Section', |
|
| 804 | + * 'geodir_author_top','geodir_author_bottom', 'geodir_search_top', 'geodir_search_bottom', 'geodir_home_top' or 'geodir_home_bottom'. |
|
| 805 | + */ |
|
| 806 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_top'); ?> <?php echo $class; ?>">
|
|
| 807 | 807 | <?php dynamic_sidebar('geodir_detail_top'); ?>
|
| 808 | 808 | </div> |
| 809 | 809 | <?php } |
@@ -827,11 +827,11 @@ discard block |
||
| 827 | 827 | */ |
| 828 | 828 | function geodir_action_geodir_sidebar_detail_bottom_section($class = '') |
| 829 | 829 | {
|
| 830 | - if (get_option('geodir_show_detail_bottom_section')) { ?>
|
|
| 830 | + if (get_option('geodir_show_detail_bottom_section')) { ?>
|
|
| 831 | 831 | <div |
| 832 | 832 | class="<?php |
| 833 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 834 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_bottom'); ?> <?php echo $class; ?>">
|
|
| 833 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 834 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_bottom'); ?> <?php echo $class; ?>">
|
|
| 835 | 835 | <?php dynamic_sidebar('geodir_detail_bottom'); ?>
|
| 836 | 836 | </div><!-- clearfix ends here--> |
| 837 | 837 | <?php } |
@@ -845,7 +845,7 @@ discard block |
||
| 845 | 845 | */ |
| 846 | 846 | function geodir_details_sidebar_widget_area() |
| 847 | 847 | {
|
| 848 | - dynamic_sidebar('geodir_detail_sidebar');
|
|
| 848 | + dynamic_sidebar('geodir_detail_sidebar');
|
|
| 849 | 849 | } |
| 850 | 850 | |
| 851 | 851 | /** |
@@ -856,12 +856,12 @@ discard block |
||
| 856 | 856 | */ |
| 857 | 857 | function geodir_details_sidebar_place_details() |
| 858 | 858 | {
|
| 859 | - /** |
|
| 860 | - * Used to add items to the details page sidebar. |
|
| 861 | - * |
|
| 862 | - * @since 1.0.0 |
|
| 863 | - */ |
|
| 864 | - do_action('geodir_detail_page_sidebar');
|
|
| 859 | + /** |
|
| 860 | + * Used to add items to the details page sidebar. |
|
| 861 | + * |
|
| 862 | + * @since 1.0.0 |
|
| 863 | + */ |
|
| 864 | + do_action('geodir_detail_page_sidebar');
|
|
| 865 | 865 | } |
| 866 | 866 | |
| 867 | 867 | add_action('geodir_detail_sidebar_inside', 'geodir_details_sidebar_place_details', 10);
|
@@ -876,68 +876,68 @@ discard block |
||
| 876 | 876 | */ |
| 877 | 877 | function geodir_action_details_sidebar() |
| 878 | 878 | {
|
| 879 | - // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='') |
|
| 880 | - if (get_option('geodir_detail_sidebar_left_section')) {
|
|
| 881 | - /** |
|
| 882 | - * Called before the details page left sidebar is opened. |
|
| 883 | - * |
|
| 884 | - * This is used to add opening wrapper HTML to the details page left sidebar. |
|
| 885 | - * |
|
| 886 | - * @since 1.0.0 |
|
| 887 | - * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
| 888 | - * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-left'. |
|
| 889 | - * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-left geodir-details-sidebar-left'. |
|
| 890 | - * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'. |
|
| 891 | - */ |
|
| 892 | - do_action('geodir_sidebar_left_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-left geodir-details-sidebar-left', 'http://schema.org/WPSideBar');
|
|
| 893 | - ?> |
|
| 879 | + // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='') |
|
| 880 | + if (get_option('geodir_detail_sidebar_left_section')) {
|
|
| 881 | + /** |
|
| 882 | + * Called before the details page left sidebar is opened. |
|
| 883 | + * |
|
| 884 | + * This is used to add opening wrapper HTML to the details page left sidebar. |
|
| 885 | + * |
|
| 886 | + * @since 1.0.0 |
|
| 887 | + * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
| 888 | + * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-left'. |
|
| 889 | + * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-left geodir-details-sidebar-left'. |
|
| 890 | + * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'. |
|
| 891 | + */ |
|
| 892 | + do_action('geodir_sidebar_left_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-left geodir-details-sidebar-left', 'http://schema.org/WPSideBar');
|
|
| 893 | + ?> |
|
| 894 | 894 | <div class="geodir-content-left geodir-sidebar-wrap"><?php |
| 895 | - /** |
|
| 896 | - * Called inside the HTML wrapper of the details sidebar for either the left and right sidebar. |
|
| 897 | - * |
|
| 898 | - * This is used to add all info to the details page sidebars. |
|
| 899 | - * |
|
| 900 | - * @since 1.0.0 |
|
| 901 | - */ |
|
| 902 | - do_action('geodir_detail_sidebar_inside');
|
|
| 903 | - ?></div><!-- end geodir-content-left --><?php |
|
| 904 | - /** |
|
| 905 | - * Called after the details page left sidebar. |
|
| 906 | - * |
|
| 907 | - * This is used to add closing wrapper HTML to the details page left sidebar. |
|
| 908 | - * |
|
| 909 | - * @since 1.0.0 |
|
| 910 | - * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
| 911 | - */ |
|
| 912 | - do_action('geodir_sidebar_left_close', 'details-page');
|
|
| 913 | - } else {
|
|
| 914 | - /** |
|
| 915 | - * Called before the details page right sidebar is opened. |
|
| 916 | - * |
|
| 917 | - * This is used to add opening wrapper HTML to the details page right sidebar. |
|
| 918 | - * |
|
| 919 | - * @since 1.0.0 |
|
| 920 | - * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'add-listing-page', 'author-page', 'search-page' or 'home-page'. |
|
| 921 | - * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-right'. |
|
| 922 | - * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-right geodir-details-sidebar-right'. |
|
| 923 | - * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'. |
|
| 924 | - */ |
|
| 925 | - do_action('geodir_sidebar_right_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-right geodir-details-sidebar-right', 'http://schema.org/WPSideBar');
|
|
| 926 | - ?> |
|
| 895 | + /** |
|
| 896 | + * Called inside the HTML wrapper of the details sidebar for either the left and right sidebar. |
|
| 897 | + * |
|
| 898 | + * This is used to add all info to the details page sidebars. |
|
| 899 | + * |
|
| 900 | + * @since 1.0.0 |
|
| 901 | + */ |
|
| 902 | + do_action('geodir_detail_sidebar_inside');
|
|
| 903 | + ?></div><!-- end geodir-content-left --><?php |
|
| 904 | + /** |
|
| 905 | + * Called after the details page left sidebar. |
|
| 906 | + * |
|
| 907 | + * This is used to add closing wrapper HTML to the details page left sidebar. |
|
| 908 | + * |
|
| 909 | + * @since 1.0.0 |
|
| 910 | + * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
| 911 | + */ |
|
| 912 | + do_action('geodir_sidebar_left_close', 'details-page');
|
|
| 913 | + } else {
|
|
| 914 | + /** |
|
| 915 | + * Called before the details page right sidebar is opened. |
|
| 916 | + * |
|
| 917 | + * This is used to add opening wrapper HTML to the details page right sidebar. |
|
| 918 | + * |
|
| 919 | + * @since 1.0.0 |
|
| 920 | + * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'add-listing-page', 'author-page', 'search-page' or 'home-page'. |
|
| 921 | + * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-right'. |
|
| 922 | + * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-right geodir-details-sidebar-right'. |
|
| 923 | + * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'. |
|
| 924 | + */ |
|
| 925 | + do_action('geodir_sidebar_right_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-right geodir-details-sidebar-right', 'http://schema.org/WPSideBar');
|
|
| 926 | + ?> |
|
| 927 | 927 | <div class="geodir-content-right geodir-sidebar-wrap"><?php |
| 928 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 929 | - do_action('geodir_detail_sidebar_inside');
|
|
| 930 | - ?></div><!-- end geodir-content-right --><?php |
|
| 931 | - /** |
|
| 932 | - * Called after the details page right sidebar. |
|
| 933 | - * |
|
| 934 | - * This is used to add closing wrapper HTML to the details page right sidebar. |
|
| 935 | - * |
|
| 936 | - * @since 1.0.0 |
|
| 937 | - * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
| 938 | - */ |
|
| 939 | - do_action('geodir_sidebar_right_close', 'details-page');
|
|
| 940 | - } |
|
| 928 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 929 | + do_action('geodir_detail_sidebar_inside');
|
|
| 930 | + ?></div><!-- end geodir-content-right --><?php |
|
| 931 | + /** |
|
| 932 | + * Called after the details page right sidebar. |
|
| 933 | + * |
|
| 934 | + * This is used to add closing wrapper HTML to the details page right sidebar. |
|
| 935 | + * |
|
| 936 | + * @since 1.0.0 |
|
| 937 | + * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
| 938 | + */ |
|
| 939 | + do_action('geodir_sidebar_right_close', 'details-page');
|
|
| 940 | + } |
|
| 941 | 941 | } |
| 942 | 942 | |
| 943 | 943 | add_action('geodir_page_title', 'geodir_action_page_title', 10);
|
@@ -951,21 +951,21 @@ discard block |
||
| 951 | 951 | */ |
| 952 | 952 | function geodir_action_page_title() |
| 953 | 953 | {
|
| 954 | - /** |
|
| 955 | - * Filter the page title HTML h1 class. |
|
| 956 | - * |
|
| 957 | - * @since 1.0.0 |
|
| 958 | - * @param string $class The class to use. Default is 'entry-title fn'. |
|
| 959 | - */ |
|
| 960 | - $class = apply_filters('geodir_page_title_class', 'entry-title fn');
|
|
| 961 | - /** |
|
| 962 | - * Filter the page title HTML header wrapper class. |
|
| 963 | - * |
|
| 964 | - * @since 1.0.0 |
|
| 965 | - * @param string $class The class to use. Default is 'entry-header'. |
|
| 966 | - */ |
|
| 967 | - $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
|
|
| 968 | - echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . stripslashes(get_the_title()) . '</h1></header>'; |
|
| 954 | + /** |
|
| 955 | + * Filter the page title HTML h1 class. |
|
| 956 | + * |
|
| 957 | + * @since 1.0.0 |
|
| 958 | + * @param string $class The class to use. Default is 'entry-title fn'. |
|
| 959 | + */ |
|
| 960 | + $class = apply_filters('geodir_page_title_class', 'entry-title fn');
|
|
| 961 | + /** |
|
| 962 | + * Filter the page title HTML header wrapper class. |
|
| 963 | + * |
|
| 964 | + * @since 1.0.0 |
|
| 965 | + * @param string $class The class to use. Default is 'entry-header'. |
|
| 966 | + */ |
|
| 967 | + $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
|
|
| 968 | + echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . stripslashes(get_the_title()) . '</h1></header>'; |
|
| 969 | 969 | } |
| 970 | 970 | |
| 971 | 971 | |
@@ -982,87 +982,87 @@ discard block |
||
| 982 | 982 | */ |
| 983 | 983 | function geodir_action_details_slider() |
| 984 | 984 | {
|
| 985 | - global $preview, $post; |
|
| 986 | - |
|
| 987 | - $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // preview from backend |
|
| 988 | - |
|
| 989 | - if ($is_backend_preview && !empty($post) && !empty($post->ID) && !isset($post->post_images)) {
|
|
| 990 | - $preview_get_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
|
|
| 985 | + global $preview, $post; |
|
| 991 | 986 | |
| 992 | - $preview_post_images = array(); |
|
| 993 | - if ($preview_get_images) {
|
|
| 994 | - foreach ($preview_get_images as $row) {
|
|
| 995 | - $preview_post_images[] = $row->src; |
|
| 996 | - } |
|
| 997 | - } |
|
| 998 | - if (!empty($preview_post_images)) {
|
|
| 999 | - $post->post_images = implode(',', $preview_post_images);
|
|
| 1000 | - } |
|
| 1001 | - } |
|
| 987 | + $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // preview from backend |
|
| 1002 | 988 | |
| 1003 | - if ($preview) {
|
|
| 1004 | - $post_images = array(); |
|
| 1005 | - if (isset($post->post_images) && !empty($post->post_images)) {
|
|
| 1006 | - $post->post_images = trim($post->post_images, ","); |
|
| 1007 | - $post_images = explode(",", $post->post_images);
|
|
| 1008 | - } |
|
| 989 | + if ($is_backend_preview && !empty($post) && !empty($post->ID) && !isset($post->post_images)) {
|
|
| 990 | + $preview_get_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
|
|
| 1009 | 991 | |
| 1010 | - $main_slides = ''; |
|
| 1011 | - $nav_slides = ''; |
|
| 1012 | - $slides = 0; |
|
| 1013 | - |
|
| 1014 | - if (!empty($post_images)) {
|
|
| 1015 | - foreach ($post_images as $image) {
|
|
| 1016 | - if (!empty($image)) {
|
|
| 1017 | - $sizes = getimagesize(trim($image)); |
|
| 1018 | - $width = !empty($sizes) && isset($sizes[0]) ? $sizes[0] : 0; |
|
| 1019 | - $height = !empty($sizes) && isset($sizes[1]) ? $sizes[1] : 0; |
|
| 1020 | - |
|
| 1021 | - if ($image && $width && $height) {
|
|
| 1022 | - $image = (object)array('src' => $image, 'width' => $width, 'height' => $height);
|
|
| 1023 | - } |
|
| 1024 | - |
|
| 1025 | - if (isset($image->src)) {
|
|
| 1026 | - if ($image->height >= 400) {
|
|
| 1027 | - $spacer_height = 0; |
|
| 1028 | - } else {
|
|
| 1029 | - $spacer_height = ((400 - $image->height) / 2); |
|
| 1030 | - } |
|
| 1031 | - |
|
| 1032 | - $image_title = isset($image->title) ? $image->title : ''; |
|
| 1033 | - |
|
| 1034 | - $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />'; |
|
| 1035 | - $main_slides .= '<img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:400px;margin:0 auto;" /></li>'; |
|
| 1036 | - $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:48px;margin:0 auto;" /></li>'; |
|
| 1037 | - $slides++; |
|
| 1038 | - } |
|
| 1039 | - } |
|
| 1040 | - }// endfore |
|
| 1041 | - } //end if |
|
| 1042 | - } else {
|
|
| 1043 | - $main_slides = ''; |
|
| 1044 | - $nav_slides = ''; |
|
| 1045 | - $post_images = geodir_get_images($post->ID, 'thumbnail', false); // Hide default image on listing preview/detail page. |
|
| 1046 | - $slides = 0; |
|
| 1047 | - |
|
| 1048 | - if (!empty($post_images)) {
|
|
| 1049 | - foreach ($post_images as $image) {
|
|
| 1050 | - if ($image->height >= 400) {
|
|
| 1051 | - $spacer_height = 0; |
|
| 1052 | - } else {
|
|
| 1053 | - $spacer_height = ((400 - $image->height) / 2); |
|
| 1054 | - } |
|
| 1055 | - $caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : ''; |
|
| 1056 | - $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />'; |
|
| 1057 | - $main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>'; |
|
| 1058 | - $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>'; |
|
| 1059 | - $slides++; |
|
| 1060 | - } |
|
| 1061 | - }// endfore |
|
| 1062 | - } |
|
| 992 | + $preview_post_images = array(); |
|
| 993 | + if ($preview_get_images) {
|
|
| 994 | + foreach ($preview_get_images as $row) {
|
|
| 995 | + $preview_post_images[] = $row->src; |
|
| 996 | + } |
|
| 997 | + } |
|
| 998 | + if (!empty($preview_post_images)) {
|
|
| 999 | + $post->post_images = implode(',', $preview_post_images);
|
|
| 1000 | + } |
|
| 1001 | + } |
|
| 1002 | + |
|
| 1003 | + if ($preview) {
|
|
| 1004 | + $post_images = array(); |
|
| 1005 | + if (isset($post->post_images) && !empty($post->post_images)) {
|
|
| 1006 | + $post->post_images = trim($post->post_images, ","); |
|
| 1007 | + $post_images = explode(",", $post->post_images);
|
|
| 1008 | + } |
|
| 1009 | + |
|
| 1010 | + $main_slides = ''; |
|
| 1011 | + $nav_slides = ''; |
|
| 1012 | + $slides = 0; |
|
| 1013 | + |
|
| 1014 | + if (!empty($post_images)) {
|
|
| 1015 | + foreach ($post_images as $image) {
|
|
| 1016 | + if (!empty($image)) {
|
|
| 1017 | + $sizes = getimagesize(trim($image)); |
|
| 1018 | + $width = !empty($sizes) && isset($sizes[0]) ? $sizes[0] : 0; |
|
| 1019 | + $height = !empty($sizes) && isset($sizes[1]) ? $sizes[1] : 0; |
|
| 1020 | + |
|
| 1021 | + if ($image && $width && $height) {
|
|
| 1022 | + $image = (object)array('src' => $image, 'width' => $width, 'height' => $height);
|
|
| 1023 | + } |
|
| 1024 | + |
|
| 1025 | + if (isset($image->src)) {
|
|
| 1026 | + if ($image->height >= 400) {
|
|
| 1027 | + $spacer_height = 0; |
|
| 1028 | + } else {
|
|
| 1029 | + $spacer_height = ((400 - $image->height) / 2); |
|
| 1030 | + } |
|
| 1031 | + |
|
| 1032 | + $image_title = isset($image->title) ? $image->title : ''; |
|
| 1033 | + |
|
| 1034 | + $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />'; |
|
| 1035 | + $main_slides .= '<img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:400px;margin:0 auto;" /></li>'; |
|
| 1036 | + $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:48px;margin:0 auto;" /></li>'; |
|
| 1037 | + $slides++; |
|
| 1038 | + } |
|
| 1039 | + } |
|
| 1040 | + }// endfore |
|
| 1041 | + } //end if |
|
| 1042 | + } else {
|
|
| 1043 | + $main_slides = ''; |
|
| 1044 | + $nav_slides = ''; |
|
| 1045 | + $post_images = geodir_get_images($post->ID, 'thumbnail', false); // Hide default image on listing preview/detail page. |
|
| 1046 | + $slides = 0; |
|
| 1047 | + |
|
| 1048 | + if (!empty($post_images)) {
|
|
| 1049 | + foreach ($post_images as $image) {
|
|
| 1050 | + if ($image->height >= 400) {
|
|
| 1051 | + $spacer_height = 0; |
|
| 1052 | + } else {
|
|
| 1053 | + $spacer_height = ((400 - $image->height) / 2); |
|
| 1054 | + } |
|
| 1055 | + $caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : ''; |
|
| 1056 | + $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />'; |
|
| 1057 | + $main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>'; |
|
| 1058 | + $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>'; |
|
| 1059 | + $slides++; |
|
| 1060 | + } |
|
| 1061 | + }// endfore |
|
| 1062 | + } |
|
| 1063 | 1063 | |
| 1064 | - if (!empty($post_images)) {
|
|
| 1065 | - ?> |
|
| 1064 | + if (!empty($post_images)) {
|
|
| 1065 | + ?> |
|
| 1066 | 1066 | <div class="geodir_flex-container"> |
| 1067 | 1067 | <div class="geodir_flex-loader"><i class="fa fa-refresh fa-spin"></i></div> |
| 1068 | 1068 | <div id="geodir_slider" class="geodir_flexslider "> |
@@ -1075,7 +1075,7 @@ discard block |
||
| 1075 | 1075 | <?php } ?> |
| 1076 | 1076 | </div> |
| 1077 | 1077 | <?php |
| 1078 | - } |
|
| 1078 | + } |
|
| 1079 | 1079 | } |
| 1080 | 1080 | |
| 1081 | 1081 | add_action('geodir_details_taxonomies', 'geodir_action_details_taxonomies', 10);
|
@@ -1090,166 +1090,166 @@ discard block |
||
| 1090 | 1090 | */ |
| 1091 | 1091 | function geodir_action_details_taxonomies() |
| 1092 | 1092 | {
|
| 1093 | - global $preview, $post;?> |
|
| 1093 | + global $preview, $post;?> |
|
| 1094 | 1094 | <p class="geodir_post_taxomomies clearfix"> |
| 1095 | 1095 | <?php |
| 1096 | - $taxonomies = array(); |
|
| 1097 | - |
|
| 1098 | - $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend |
|
| 1099 | - |
|
| 1100 | - if ($preview && !$is_backend_preview) {
|
|
| 1101 | - $post_type = $post->listing_type; |
|
| 1102 | - $post_taxonomy = $post_type . 'category'; |
|
| 1103 | - $post->$post_taxonomy = $post->post_category[$post_taxonomy]; |
|
| 1104 | - } else {
|
|
| 1105 | - $post_type = $post->post_type; |
|
| 1106 | - $post_taxonomy = $post_type . 'category'; |
|
| 1107 | - } |
|
| 1096 | + $taxonomies = array(); |
|
| 1097 | + |
|
| 1098 | + $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend |
|
| 1099 | + |
|
| 1100 | + if ($preview && !$is_backend_preview) {
|
|
| 1101 | + $post_type = $post->listing_type; |
|
| 1102 | + $post_taxonomy = $post_type . 'category'; |
|
| 1103 | + $post->$post_taxonomy = $post->post_category[$post_taxonomy]; |
|
| 1104 | + } else {
|
|
| 1105 | + $post_type = $post->post_type; |
|
| 1106 | + $post_taxonomy = $post_type . 'category'; |
|
| 1107 | + } |
|
| 1108 | 1108 | //{
|
| 1109 | - $post_type_info = get_post_type_object($post_type); |
|
| 1110 | - $listing_label = $post_type_info->labels->singular_name; |
|
| 1111 | - |
|
| 1112 | - if (!empty($post->post_tags)) {
|
|
| 1113 | - |
|
| 1114 | - if (taxonomy_exists($post_type . '_tags')): |
|
| 1115 | - $links = array(); |
|
| 1116 | - $terms = array(); |
|
| 1117 | - // to limit post tags |
|
| 1118 | - $post_tags = trim($post->post_tags, ","); |
|
| 1119 | - $post_id = isset($post->ID) ? $post->ID : ''; |
|
| 1120 | - /** |
|
| 1121 | - * Filter the post tags. |
|
| 1122 | - * |
|
| 1123 | - * Allows you to filter the post tags output on the details page of a post. |
|
| 1124 | - * |
|
| 1125 | - * @since 1.0.0 |
|
| 1126 | - * @param string $post_tags A comma seperated list of tags. |
|
| 1127 | - * @param int $post_id The current post id. |
|
| 1128 | - */ |
|
| 1129 | - $post_tags = apply_filters('geodir_action_details_post_tags', $post_tags, $post_id);
|
|
| 1130 | - |
|
| 1131 | - $post->post_tags = $post_tags; |
|
| 1132 | - $post_tags = explode(",", trim($post->post_tags, ","));
|
|
| 1133 | - |
|
| 1134 | - foreach ($post_tags as $post_term) {
|
|
| 1135 | - |
|
| 1136 | - // fix slug creation order for tags & location |
|
| 1137 | - $post_term = trim($post_term); |
|
| 1138 | - |
|
| 1139 | - $priority_location = false; |
|
| 1140 | - if ($insert_term = term_exists($post_term, $post_type . '_tags')) {
|
|
| 1141 | - $term = get_term_by('name', $post_term, $post_type . '_tags');
|
|
| 1142 | - } else {
|
|
| 1143 | - $post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL; |
|
| 1144 | - $post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL; |
|
| 1145 | - $post_city = isset($_REQUEST['post_city']) && $_REQUEST['post_city'] != '' ? sanitize_text_field($_REQUEST['post_city']) : NULL; |
|
| 1146 | - $match_country = $post_country && sanitize_title($post_term) == sanitize_title($post_country) ? true : false; |
|
| 1147 | - $match_region = $post_region && sanitize_title($post_term) == sanitize_title($post_region) ? true : false; |
|
| 1148 | - $match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false; |
|
| 1149 | - if ($match_country || $match_region || $match_city) {
|
|
| 1150 | - $priority_location = true; |
|
| 1151 | - $term = get_term_by('name', $post_term, $post_type . '_tags');
|
|
| 1152 | - } else {
|
|
| 1153 | - $insert_term = wp_insert_term($post_term, $post_type . '_tags'); |
|
| 1154 | - $term = get_term_by('name', $post_term, $post_type . '_tags');
|
|
| 1155 | - } |
|
| 1156 | - } |
|
| 1157 | - |
|
| 1158 | - if (!is_wp_error($term) && is_object($term)) {
|
|
| 1159 | - |
|
| 1160 | - // fix tag link on detail page |
|
| 1161 | - if ($priority_location) {
|
|
| 1162 | - |
|
| 1163 | - $tag_link = "<a href=''>$post_term</a>"; |
|
| 1164 | - /** |
|
| 1165 | - * Filter the tag name on the details page. |
|
| 1166 | - * |
|
| 1167 | - * @since 1.5.6 |
|
| 1168 | - * @param string $tag_link The tag link html. |
|
| 1169 | - * @param object $term The tag term object. |
|
| 1170 | - */ |
|
| 1171 | - $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
|
|
| 1172 | - $links[] = $tag_link; |
|
| 1173 | - } else {
|
|
| 1174 | - $tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>"; |
|
| 1175 | - /** This action is documented in geodirectory-template_actions.php */ |
|
| 1176 | - $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
|
|
| 1177 | - $links[] = $tag_link; |
|
| 1178 | - } |
|
| 1179 | - $terms[] = $term; |
|
| 1180 | - } |
|
| 1181 | - // |
|
| 1182 | - } |
|
| 1183 | - if (!isset($listing_label)) {
|
|
| 1184 | - $listing_label = ''; |
|
| 1185 | - } |
|
| 1186 | - $taxonomies[$post_type . '_tags'] = wp_sprintf('%s: %l', geodir_ucwords($listing_label . ' ' . __('Tags', 'geodirectory')), $links, (object)$terms);
|
|
| 1187 | - endif; |
|
| 1188 | - |
|
| 1189 | - } |
|
| 1190 | - |
|
| 1191 | - if (!empty($post->$post_taxonomy)) {
|
|
| 1192 | - $links = array(); |
|
| 1193 | - $terms = array(); |
|
| 1194 | - $termsOrdered = array(); |
|
| 1195 | - if (!is_array($post->$post_taxonomy)) {
|
|
| 1196 | - $post_term = explode(",", trim($post->$post_taxonomy, ","));
|
|
| 1197 | - } else {
|
|
| 1198 | - $post_term = $post->$post_taxonomy; |
|
| 1109 | + $post_type_info = get_post_type_object($post_type); |
|
| 1110 | + $listing_label = $post_type_info->labels->singular_name; |
|
| 1111 | + |
|
| 1112 | + if (!empty($post->post_tags)) {
|
|
| 1113 | + |
|
| 1114 | + if (taxonomy_exists($post_type . '_tags')): |
|
| 1115 | + $links = array(); |
|
| 1116 | + $terms = array(); |
|
| 1117 | + // to limit post tags |
|
| 1118 | + $post_tags = trim($post->post_tags, ","); |
|
| 1119 | + $post_id = isset($post->ID) ? $post->ID : ''; |
|
| 1120 | + /** |
|
| 1121 | + * Filter the post tags. |
|
| 1122 | + * |
|
| 1123 | + * Allows you to filter the post tags output on the details page of a post. |
|
| 1124 | + * |
|
| 1125 | + * @since 1.0.0 |
|
| 1126 | + * @param string $post_tags A comma seperated list of tags. |
|
| 1127 | + * @param int $post_id The current post id. |
|
| 1128 | + */ |
|
| 1129 | + $post_tags = apply_filters('geodir_action_details_post_tags', $post_tags, $post_id);
|
|
| 1130 | + |
|
| 1131 | + $post->post_tags = $post_tags; |
|
| 1132 | + $post_tags = explode(",", trim($post->post_tags, ","));
|
|
| 1133 | + |
|
| 1134 | + foreach ($post_tags as $post_term) {
|
|
| 1135 | + |
|
| 1136 | + // fix slug creation order for tags & location |
|
| 1137 | + $post_term = trim($post_term); |
|
| 1138 | + |
|
| 1139 | + $priority_location = false; |
|
| 1140 | + if ($insert_term = term_exists($post_term, $post_type . '_tags')) {
|
|
| 1141 | + $term = get_term_by('name', $post_term, $post_type . '_tags');
|
|
| 1142 | + } else {
|
|
| 1143 | + $post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL; |
|
| 1144 | + $post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL; |
|
| 1145 | + $post_city = isset($_REQUEST['post_city']) && $_REQUEST['post_city'] != '' ? sanitize_text_field($_REQUEST['post_city']) : NULL; |
|
| 1146 | + $match_country = $post_country && sanitize_title($post_term) == sanitize_title($post_country) ? true : false; |
|
| 1147 | + $match_region = $post_region && sanitize_title($post_term) == sanitize_title($post_region) ? true : false; |
|
| 1148 | + $match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false; |
|
| 1149 | + if ($match_country || $match_region || $match_city) {
|
|
| 1150 | + $priority_location = true; |
|
| 1151 | + $term = get_term_by('name', $post_term, $post_type . '_tags');
|
|
| 1152 | + } else {
|
|
| 1153 | + $insert_term = wp_insert_term($post_term, $post_type . '_tags'); |
|
| 1154 | + $term = get_term_by('name', $post_term, $post_type . '_tags');
|
|
| 1155 | + } |
|
| 1156 | + } |
|
| 1157 | + |
|
| 1158 | + if (!is_wp_error($term) && is_object($term)) {
|
|
| 1159 | + |
|
| 1160 | + // fix tag link on detail page |
|
| 1161 | + if ($priority_location) {
|
|
| 1162 | + |
|
| 1163 | + $tag_link = "<a href=''>$post_term</a>"; |
|
| 1164 | + /** |
|
| 1165 | + * Filter the tag name on the details page. |
|
| 1166 | + * |
|
| 1167 | + * @since 1.5.6 |
|
| 1168 | + * @param string $tag_link The tag link html. |
|
| 1169 | + * @param object $term The tag term object. |
|
| 1170 | + */ |
|
| 1171 | + $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
|
|
| 1172 | + $links[] = $tag_link; |
|
| 1173 | + } else {
|
|
| 1174 | + $tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>"; |
|
| 1175 | + /** This action is documented in geodirectory-template_actions.php */ |
|
| 1176 | + $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
|
|
| 1177 | + $links[] = $tag_link; |
|
| 1178 | + } |
|
| 1179 | + $terms[] = $term; |
|
| 1180 | + } |
|
| 1181 | + // |
|
| 1182 | + } |
|
| 1183 | + if (!isset($listing_label)) {
|
|
| 1184 | + $listing_label = ''; |
|
| 1185 | + } |
|
| 1186 | + $taxonomies[$post_type . '_tags'] = wp_sprintf('%s: %l', geodir_ucwords($listing_label . ' ' . __('Tags', 'geodirectory')), $links, (object)$terms);
|
|
| 1187 | + endif; |
|
| 1188 | + |
|
| 1189 | + } |
|
| 1190 | + |
|
| 1191 | + if (!empty($post->$post_taxonomy)) {
|
|
| 1192 | + $links = array(); |
|
| 1193 | + $terms = array(); |
|
| 1194 | + $termsOrdered = array(); |
|
| 1195 | + if (!is_array($post->$post_taxonomy)) {
|
|
| 1196 | + $post_term = explode(",", trim($post->$post_taxonomy, ","));
|
|
| 1197 | + } else {
|
|
| 1198 | + $post_term = $post->$post_taxonomy; |
|
| 1199 | 1199 | |
| 1200 | 1200 | if ($preview && !$is_backend_preview) {
|
| 1201 | 1201 | $post_term = geodir_add_parent_terms($post_term, $post_taxonomy); |
| 1202 | 1202 | } |
| 1203 | - } |
|
| 1203 | + } |
|
| 1204 | + |
|
| 1205 | + $post_term = array_unique($post_term); |
|
| 1206 | + if (!empty($post_term)) {
|
|
| 1207 | + foreach ($post_term as $post_term) {
|
|
| 1208 | + $post_term = trim($post_term); |
|
| 1209 | + |
|
| 1210 | + if ($post_term != ''): |
|
| 1211 | + $term = get_term_by('id', $post_term, $post_taxonomy);
|
|
| 1212 | + |
|
| 1213 | + if (is_object($term)) {
|
|
| 1214 | + $term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>"; |
|
| 1215 | + /** |
|
| 1216 | + * Filter the category name on the details page. |
|
| 1217 | + * |
|
| 1218 | + * @since 1.5.6 |
|
| 1219 | + * @param string $term_link The link html to the category. |
|
| 1220 | + * @param object $term The category term object. |
|
| 1221 | + */ |
|
| 1222 | + $term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term);
|
|
| 1223 | + $links[] = $term_link; |
|
| 1224 | + $terms[] = $term; |
|
| 1225 | + } |
|
| 1226 | + endif; |
|
| 1227 | + } |
|
| 1228 | + // order alphabetically |
|
| 1229 | + asort($links); |
|
| 1230 | + foreach (array_keys($links) as $key) {
|
|
| 1231 | + $termsOrdered[$key] = $terms[$key]; |
|
| 1232 | + } |
|
| 1233 | + $terms = $termsOrdered; |
|
| 1204 | 1234 | |
| 1205 | - $post_term = array_unique($post_term); |
|
| 1206 | - if (!empty($post_term)) {
|
|
| 1207 | - foreach ($post_term as $post_term) {
|
|
| 1208 | - $post_term = trim($post_term); |
|
| 1209 | - |
|
| 1210 | - if ($post_term != ''): |
|
| 1211 | - $term = get_term_by('id', $post_term, $post_taxonomy);
|
|
| 1212 | - |
|
| 1213 | - if (is_object($term)) {
|
|
| 1214 | - $term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>"; |
|
| 1215 | - /** |
|
| 1216 | - * Filter the category name on the details page. |
|
| 1217 | - * |
|
| 1218 | - * @since 1.5.6 |
|
| 1219 | - * @param string $term_link The link html to the category. |
|
| 1220 | - * @param object $term The category term object. |
|
| 1221 | - */ |
|
| 1222 | - $term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term);
|
|
| 1223 | - $links[] = $term_link; |
|
| 1224 | - $terms[] = $term; |
|
| 1225 | - } |
|
| 1226 | - endif; |
|
| 1227 | - } |
|
| 1228 | - // order alphabetically |
|
| 1229 | - asort($links); |
|
| 1230 | - foreach (array_keys($links) as $key) {
|
|
| 1231 | - $termsOrdered[$key] = $terms[$key]; |
|
| 1232 | - } |
|
| 1233 | - $terms = $termsOrdered; |
|
| 1235 | + } |
|
| 1234 | 1236 | |
| 1235 | - } |
|
| 1237 | + if (!isset($listing_label)) {
|
|
| 1238 | + $listing_label = ''; |
|
| 1239 | + } |
|
| 1240 | + $taxonomies[$post_taxonomy] = wp_sprintf('%s: %l', geodir_ucwords($listing_label . ' ' . __('Category', 'geodirectory')), $links, (object)$terms);
|
|
| 1236 | 1241 | |
| 1237 | - if (!isset($listing_label)) {
|
|
| 1238 | - $listing_label = ''; |
|
| 1239 | - } |
|
| 1240 | - $taxonomies[$post_taxonomy] = wp_sprintf('%s: %l', geodir_ucwords($listing_label . ' ' . __('Category', 'geodirectory')), $links, (object)$terms);
|
|
| 1241 | - |
|
| 1242 | - } |
|
| 1242 | + } |
|
| 1243 | 1243 | |
| 1244 | 1244 | |
| 1245 | - if (isset($taxonomies[$post_taxonomy])) {
|
|
| 1246 | - echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>'; |
|
| 1247 | - } |
|
| 1245 | + if (isset($taxonomies[$post_taxonomy])) {
|
|
| 1246 | + echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>'; |
|
| 1247 | + } |
|
| 1248 | 1248 | |
| 1249 | - if (isset($taxonomies[$post_type . '_tags'])) |
|
| 1250 | - echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>'; |
|
| 1249 | + if (isset($taxonomies[$post_type . '_tags'])) |
|
| 1250 | + echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>'; |
|
| 1251 | 1251 | |
| 1252 | - ?> |
|
| 1252 | + ?> |
|
| 1253 | 1253 | </p><?php |
| 1254 | 1254 | } |
| 1255 | 1255 | |
@@ -1271,126 +1271,126 @@ discard block |
||
| 1271 | 1271 | function geodir_action_details_micordata($post='') |
| 1272 | 1272 | {
|
| 1273 | 1273 | |
| 1274 | - global $preview; |
|
| 1275 | - if(empty($post)){global $post;}
|
|
| 1276 | - if ($preview || !geodir_is_page('detail')) {
|
|
| 1277 | - return; |
|
| 1278 | - } |
|
| 1279 | - |
|
| 1280 | - // url |
|
| 1281 | - $c_url = geodir_curPageURL(); |
|
| 1282 | - |
|
| 1283 | - // post reviews |
|
| 1284 | - $post_reviews = get_comments(array('post_id' => $post->ID, 'status' => 'approve'));
|
|
| 1285 | - if (empty($post_reviews)) {
|
|
| 1286 | - $reviews = ''; |
|
| 1287 | - } else {
|
|
| 1288 | - foreach ($post_reviews as $review) {
|
|
| 1289 | - $reviews[] = array( |
|
| 1290 | - "@type" => "Review", |
|
| 1291 | - "author" => $review->comment_author, |
|
| 1292 | - "datePublished" => $review->comment_date, |
|
| 1293 | - "description" => $review->comment_content, |
|
| 1294 | - "reviewRating" => array( |
|
| 1295 | - "@type" => "Rating", |
|
| 1296 | - "bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score. |
|
| 1297 | - "ratingValue" => geodir_get_commentoverall($review->comment_ID), |
|
| 1298 | - "worstRating" => "1" |
|
| 1299 | - ) |
|
| 1300 | - ); |
|
| 1301 | - } |
|
| 1302 | - |
|
| 1303 | - } |
|
| 1304 | - |
|
| 1305 | - // post images |
|
| 1306 | - $post_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
|
|
| 1307 | - if (empty($post_images)) {
|
|
| 1308 | - $images = ''; |
|
| 1309 | - } else {
|
|
| 1310 | - $i_arr = array(); |
|
| 1311 | - foreach ($post_images as $img) {
|
|
| 1312 | - $i_arr[] = $img->src; |
|
| 1313 | - } |
|
| 1314 | - |
|
| 1315 | - if (count($i_arr) == 1) {
|
|
| 1316 | - $images = $i_arr[0]; |
|
| 1317 | - } else {
|
|
| 1318 | - $images = $i_arr; |
|
| 1319 | - } |
|
| 1320 | - |
|
| 1321 | - } |
|
| 1322 | - //print_r($post); |
|
| 1323 | - // external links |
|
| 1324 | - $external_links = array(); |
|
| 1325 | - $external_links[] = $post->geodir_website; |
|
| 1326 | - $external_links[] = $post->geodir_twitter; |
|
| 1327 | - $external_links[] = $post->geodir_facebook; |
|
| 1328 | - $external_links = array_filter($external_links); |
|
| 1329 | - |
|
| 1330 | - if(!empty($external_links)){
|
|
| 1331 | - $external_links = array_values($external_links); |
|
| 1332 | - } |
|
| 1333 | - |
|
| 1334 | - // reviews |
|
| 1335 | - $comment_count = geodir_get_review_count_total($post->ID); |
|
| 1336 | - $post_avgratings = geodir_get_post_rating($post->ID); |
|
| 1337 | - |
|
| 1338 | - // schema type |
|
| 1339 | - $schema_type = 'LocalBusiness'; |
|
| 1340 | - if(isset($post->default_category) && $post->default_category){
|
|
| 1341 | - $schema_type = get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type); |
|
| 1342 | - if(!$schema_type && $post->post_type=='gd_event'){$schema_type = 'Event';}
|
|
| 1343 | - } |
|
| 1344 | - |
|
| 1345 | - $schema = array(); |
|
| 1346 | - $schema['@context'] = "http://schema.org"; |
|
| 1347 | - $schema['@type'] = $schema_type; |
|
| 1348 | - $schema['name'] = $post->post_name; |
|
| 1349 | - $schema['description'] = wp_strip_all_tags( $post->post_content, true ); |
|
| 1350 | - $schema['telephone'] = $post->geodir_contact; |
|
| 1351 | - $schema['url'] = $c_url; |
|
| 1352 | - $schema['sameAs'] = $external_links; |
|
| 1353 | - $schema['image'] = $images; |
|
| 1354 | - $schema['address'] = array( |
|
| 1355 | - "@type" => "PostalAddress", |
|
| 1356 | - "streetAddress" => $post->post_address, |
|
| 1357 | - "addressLocality" => $post->post_city, |
|
| 1358 | - "addressRegion" => $post->post_region, |
|
| 1359 | - "addressCountry" => $post->post_country, |
|
| 1360 | - "postalCode" => $post->post_zip |
|
| 1361 | - ); |
|
| 1362 | - |
|
| 1363 | - if($post->post_latitude && $post->post_longitude) {
|
|
| 1364 | - $schema['geo'] = array( |
|
| 1365 | - "@type" => "GeoCoordinates", |
|
| 1366 | - "latitude" => $post->post_latitude, |
|
| 1367 | - "longitude" => $post->post_longitude |
|
| 1368 | - ); |
|
| 1369 | - } |
|
| 1370 | - |
|
| 1371 | - if($post_avgratings) {
|
|
| 1372 | - $schema['aggregateRating'] = array( |
|
| 1373 | - "@type" => "AggregateRating", |
|
| 1374 | - "ratingValue" => $post_avgratings, |
|
| 1375 | - "bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score. |
|
| 1376 | - "worstRating" => "1", |
|
| 1377 | - "ratingCount" => $comment_count |
|
| 1378 | - ); |
|
| 1379 | - } |
|
| 1380 | - $schema['review'] = $reviews; |
|
| 1381 | - |
|
| 1382 | - /** |
|
| 1383 | - * Allow the schema JSON-LD info to be filtered. |
|
| 1384 | - * |
|
| 1385 | - * @since 1.5.4 |
|
| 1386 | - * @since 1.5.7 Added $post variable. |
|
| 1387 | - * @param array $schema The array of schema data to be filtered. |
|
| 1388 | - * @param object $post The post object. |
|
| 1389 | - */ |
|
| 1390 | - $schema = apply_filters('geodir_details_schema', $schema,$post);
|
|
| 1391 | - |
|
| 1392 | - |
|
| 1393 | - echo '<script type="application/ld+json">' . json_encode($schema) . '</script>'; |
|
| 1274 | + global $preview; |
|
| 1275 | + if(empty($post)){global $post;}
|
|
| 1276 | + if ($preview || !geodir_is_page('detail')) {
|
|
| 1277 | + return; |
|
| 1278 | + } |
|
| 1279 | + |
|
| 1280 | + // url |
|
| 1281 | + $c_url = geodir_curPageURL(); |
|
| 1282 | + |
|
| 1283 | + // post reviews |
|
| 1284 | + $post_reviews = get_comments(array('post_id' => $post->ID, 'status' => 'approve'));
|
|
| 1285 | + if (empty($post_reviews)) {
|
|
| 1286 | + $reviews = ''; |
|
| 1287 | + } else {
|
|
| 1288 | + foreach ($post_reviews as $review) {
|
|
| 1289 | + $reviews[] = array( |
|
| 1290 | + "@type" => "Review", |
|
| 1291 | + "author" => $review->comment_author, |
|
| 1292 | + "datePublished" => $review->comment_date, |
|
| 1293 | + "description" => $review->comment_content, |
|
| 1294 | + "reviewRating" => array( |
|
| 1295 | + "@type" => "Rating", |
|
| 1296 | + "bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score. |
|
| 1297 | + "ratingValue" => geodir_get_commentoverall($review->comment_ID), |
|
| 1298 | + "worstRating" => "1" |
|
| 1299 | + ) |
|
| 1300 | + ); |
|
| 1301 | + } |
|
| 1302 | + |
|
| 1303 | + } |
|
| 1304 | + |
|
| 1305 | + // post images |
|
| 1306 | + $post_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
|
|
| 1307 | + if (empty($post_images)) {
|
|
| 1308 | + $images = ''; |
|
| 1309 | + } else {
|
|
| 1310 | + $i_arr = array(); |
|
| 1311 | + foreach ($post_images as $img) {
|
|
| 1312 | + $i_arr[] = $img->src; |
|
| 1313 | + } |
|
| 1314 | + |
|
| 1315 | + if (count($i_arr) == 1) {
|
|
| 1316 | + $images = $i_arr[0]; |
|
| 1317 | + } else {
|
|
| 1318 | + $images = $i_arr; |
|
| 1319 | + } |
|
| 1320 | + |
|
| 1321 | + } |
|
| 1322 | + //print_r($post); |
|
| 1323 | + // external links |
|
| 1324 | + $external_links = array(); |
|
| 1325 | + $external_links[] = $post->geodir_website; |
|
| 1326 | + $external_links[] = $post->geodir_twitter; |
|
| 1327 | + $external_links[] = $post->geodir_facebook; |
|
| 1328 | + $external_links = array_filter($external_links); |
|
| 1329 | + |
|
| 1330 | + if(!empty($external_links)){
|
|
| 1331 | + $external_links = array_values($external_links); |
|
| 1332 | + } |
|
| 1333 | + |
|
| 1334 | + // reviews |
|
| 1335 | + $comment_count = geodir_get_review_count_total($post->ID); |
|
| 1336 | + $post_avgratings = geodir_get_post_rating($post->ID); |
|
| 1337 | + |
|
| 1338 | + // schema type |
|
| 1339 | + $schema_type = 'LocalBusiness'; |
|
| 1340 | + if(isset($post->default_category) && $post->default_category){
|
|
| 1341 | + $schema_type = get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type); |
|
| 1342 | + if(!$schema_type && $post->post_type=='gd_event'){$schema_type = 'Event';}
|
|
| 1343 | + } |
|
| 1344 | + |
|
| 1345 | + $schema = array(); |
|
| 1346 | + $schema['@context'] = "http://schema.org"; |
|
| 1347 | + $schema['@type'] = $schema_type; |
|
| 1348 | + $schema['name'] = $post->post_name; |
|
| 1349 | + $schema['description'] = wp_strip_all_tags( $post->post_content, true ); |
|
| 1350 | + $schema['telephone'] = $post->geodir_contact; |
|
| 1351 | + $schema['url'] = $c_url; |
|
| 1352 | + $schema['sameAs'] = $external_links; |
|
| 1353 | + $schema['image'] = $images; |
|
| 1354 | + $schema['address'] = array( |
|
| 1355 | + "@type" => "PostalAddress", |
|
| 1356 | + "streetAddress" => $post->post_address, |
|
| 1357 | + "addressLocality" => $post->post_city, |
|
| 1358 | + "addressRegion" => $post->post_region, |
|
| 1359 | + "addressCountry" => $post->post_country, |
|
| 1360 | + "postalCode" => $post->post_zip |
|
| 1361 | + ); |
|
| 1362 | + |
|
| 1363 | + if($post->post_latitude && $post->post_longitude) {
|
|
| 1364 | + $schema['geo'] = array( |
|
| 1365 | + "@type" => "GeoCoordinates", |
|
| 1366 | + "latitude" => $post->post_latitude, |
|
| 1367 | + "longitude" => $post->post_longitude |
|
| 1368 | + ); |
|
| 1369 | + } |
|
| 1370 | + |
|
| 1371 | + if($post_avgratings) {
|
|
| 1372 | + $schema['aggregateRating'] = array( |
|
| 1373 | + "@type" => "AggregateRating", |
|
| 1374 | + "ratingValue" => $post_avgratings, |
|
| 1375 | + "bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score. |
|
| 1376 | + "worstRating" => "1", |
|
| 1377 | + "ratingCount" => $comment_count |
|
| 1378 | + ); |
|
| 1379 | + } |
|
| 1380 | + $schema['review'] = $reviews; |
|
| 1381 | + |
|
| 1382 | + /** |
|
| 1383 | + * Allow the schema JSON-LD info to be filtered. |
|
| 1384 | + * |
|
| 1385 | + * @since 1.5.4 |
|
| 1386 | + * @since 1.5.7 Added $post variable. |
|
| 1387 | + * @param array $schema The array of schema data to be filtered. |
|
| 1388 | + * @param object $post The post object. |
|
| 1389 | + */ |
|
| 1390 | + $schema = apply_filters('geodir_details_schema', $schema,$post);
|
|
| 1391 | + |
|
| 1392 | + |
|
| 1393 | + echo '<script type="application/ld+json">' . json_encode($schema) . '</script>'; |
|
| 1394 | 1394 | |
| 1395 | 1395 | } |
| 1396 | 1396 | |
@@ -1408,7 +1408,7 @@ discard block |
||
| 1408 | 1408 | */ |
| 1409 | 1409 | function geodir_action_details_next_prev() |
| 1410 | 1410 | {
|
| 1411 | - ?> |
|
| 1411 | + ?> |
|
| 1412 | 1412 | <div class="geodir-pos_navigation clearfix"> |
| 1413 | 1413 | <div |
| 1414 | 1414 | class="geodir-post_left"><?php previous_post_link('%link', '' . __('Previous', 'geodirectory'), false) ?></div>
|
@@ -1426,15 +1426,15 @@ discard block |
||
| 1426 | 1426 | */ |
| 1427 | 1427 | function geodir_action_before_single_post() |
| 1428 | 1428 | {
|
| 1429 | - global $post; |
|
| 1430 | - /** |
|
| 1431 | - * Called at the very start fo the details page output, before the title section. |
|
| 1432 | - * |
|
| 1433 | - * @since 1.0.0 |
|
| 1434 | - * @param object $post The current post object. |
|
| 1435 | - * @global WP_Post|null $post The current post, if available. |
|
| 1436 | - */ |
|
| 1437 | - do_action('geodir_before_single_post', $post); // extra action
|
|
| 1429 | + global $post; |
|
| 1430 | + /** |
|
| 1431 | + * Called at the very start fo the details page output, before the title section. |
|
| 1432 | + * |
|
| 1433 | + * @since 1.0.0 |
|
| 1434 | + * @param object $post The current post object. |
|
| 1435 | + * @global WP_Post|null $post The current post, if available. |
|
| 1436 | + */ |
|
| 1437 | + do_action('geodir_before_single_post', $post); // extra action
|
|
| 1438 | 1438 | } |
| 1439 | 1439 | |
| 1440 | 1440 | /** |
@@ -1445,13 +1445,13 @@ discard block |
||
| 1445 | 1445 | */ |
| 1446 | 1446 | function geodir_action_after_single_post($post) |
| 1447 | 1447 | {
|
| 1448 | - /** |
|
| 1449 | - * Called on the details page after the details page tabs section and before the next/prev buttons. |
|
| 1450 | - * |
|
| 1451 | - * @since 1.0.0 |
|
| 1452 | - * @param object $post The current post object. |
|
| 1453 | - */ |
|
| 1454 | - do_action('geodir_after_single_post', $post); // extra action
|
|
| 1448 | + /** |
|
| 1449 | + * Called on the details page after the details page tabs section and before the next/prev buttons. |
|
| 1450 | + * |
|
| 1451 | + * @since 1.0.0 |
|
| 1452 | + * @param object $post The current post object. |
|
| 1453 | + */ |
|
| 1454 | + do_action('geodir_after_single_post', $post); // extra action
|
|
| 1455 | 1455 | } |
| 1456 | 1456 | |
| 1457 | 1457 | add_action('geodir_details_main_content', 'geodir_action_before_single_post', 10);
|
@@ -1477,167 +1477,167 @@ discard block |
||
| 1477 | 1477 | */ |
| 1478 | 1478 | function geodir_action_listings_title() |
| 1479 | 1479 | {
|
| 1480 | - global $wp, $term; |
|
| 1481 | - |
|
| 1482 | - $gd_post_type = geodir_get_current_posttype(); |
|
| 1483 | - $post_type_info = get_post_type_object($gd_post_type); |
|
| 1484 | - |
|
| 1485 | - $add_string_in_title = __('All', 'geodirectory') . ' ';
|
|
| 1486 | - if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
|
|
| 1487 | - $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
|
|
| 1488 | - } |
|
| 1489 | - |
|
| 1490 | - $list_title = $add_string_in_title . __(ucfirst($post_type_info->labels->name), 'geodirectory'); |
|
| 1491 | - $single_name = $post_type_info->labels->singular_name; |
|
| 1492 | - |
|
| 1493 | - $taxonomy = geodir_get_taxonomies($gd_post_type, true); |
|
| 1480 | + global $wp, $term; |
|
| 1494 | 1481 | |
| 1495 | - $gd_country = get_query_var('gd_country');
|
|
| 1496 | - $gd_region = get_query_var('gd_region');
|
|
| 1497 | - $gd_city = get_query_var('gd_city');
|
|
| 1482 | + $gd_post_type = geodir_get_current_posttype(); |
|
| 1483 | + $post_type_info = get_post_type_object($gd_post_type); |
|
| 1498 | 1484 | |
| 1499 | - if (!empty($term)) {
|
|
| 1500 | - $location_name = ''; |
|
| 1501 | - if ($gd_country != '' || $gd_region != '' || $gd_city != '') {
|
|
| 1502 | - if ($gd_country != '') {
|
|
| 1503 | - $location_name = geodir_sanitize_location_name('gd_country', $gd_country);
|
|
| 1504 | - } |
|
| 1505 | - |
|
| 1506 | - if ($gd_region != '') {
|
|
| 1507 | - $location_name = geodir_sanitize_location_name('gd_region', $gd_region);
|
|
| 1508 | - } |
|
| 1509 | - |
|
| 1510 | - if ($gd_city != '') {
|
|
| 1511 | - $location_name = geodir_sanitize_location_name('gd_city', $gd_city);
|
|
| 1512 | - } |
|
| 1513 | - } |
|
| 1514 | - |
|
| 1515 | - $current_term = get_term_by('slug', $term, $taxonomy[0]);
|
|
| 1516 | - if (!empty($current_term)) {
|
|
| 1517 | - $current_term_name = __(ucfirst($current_term->name), 'geodirectory'); |
|
| 1518 | - if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
|
|
| 1519 | - $location_last_char = substr($location_name, -1); |
|
| 1520 | - $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
|
|
| 1521 | - $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
|
|
| 1522 | - } else {
|
|
| 1523 | - $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
|
|
| 1524 | - } |
|
| 1525 | - } else {
|
|
| 1526 | - if (count($taxonomy) > 1) {
|
|
| 1527 | - $current_term = get_term_by('slug', $term, $taxonomy[1]);
|
|
| 1528 | - |
|
| 1529 | - if (!empty($current_term)) {
|
|
| 1530 | - $current_term_name = __(ucfirst($current_term->name), 'geodirectory'); |
|
| 1531 | - if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
|
|
| 1532 | - $location_last_char = substr($location_name, -1); |
|
| 1533 | - $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
|
|
| 1534 | - $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
|
|
| 1535 | - } else {
|
|
| 1536 | - $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
|
|
| 1537 | - } |
|
| 1538 | - } |
|
| 1539 | - } |
|
| 1540 | - } |
|
| 1485 | + $add_string_in_title = __('All', 'geodirectory') . ' ';
|
|
| 1486 | + if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
|
|
| 1487 | + $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
|
|
| 1488 | + } |
|
| 1541 | 1489 | |
| 1542 | - } else {
|
|
| 1543 | - $gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : ''; |
|
| 1544 | - $gd_region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : ''; |
|
| 1545 | - $gd_city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : ''; |
|
| 1490 | + $list_title = $add_string_in_title . __(ucfirst($post_type_info->labels->name), 'geodirectory'); |
|
| 1491 | + $single_name = $post_type_info->labels->singular_name; |
|
| 1546 | 1492 | |
| 1547 | - $gd_country_actual = $gd_region_actual = $gd_city_actual = ''; |
|
| 1493 | + $taxonomy = geodir_get_taxonomies($gd_post_type, true); |
|
| 1548 | 1494 | |
| 1549 | - if (function_exists('get_actual_location_name')) {
|
|
| 1550 | - $gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
|
|
| 1551 | - $gd_region_actual = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
|
|
| 1552 | - $gd_city_actual = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
|
|
| 1553 | - } |
|
| 1495 | + $gd_country = get_query_var('gd_country');
|
|
| 1496 | + $gd_region = get_query_var('gd_region');
|
|
| 1497 | + $gd_city = get_query_var('gd_city');
|
|
| 1554 | 1498 | |
| 1555 | - if ($gd_city != '') {
|
|
| 1556 | - if ($gd_city_actual != '') {
|
|
| 1557 | - $gd_city = $gd_city_actual; |
|
| 1558 | - } else {
|
|
| 1559 | - $gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
|
|
| 1560 | - $gd_city = preg_replace('/[_-]/', ' ', $gd_city);
|
|
| 1561 | - $gd_city = __(geodir_ucwords($gd_city), 'geodirectory'); |
|
| 1562 | - } |
|
| 1563 | - |
|
| 1564 | - $list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'";
|
|
| 1565 | - } else if ($gd_region != '') {
|
|
| 1566 | - if ($gd_region_actual != '') {
|
|
| 1567 | - $gd_region = $gd_region_actual; |
|
| 1568 | - } else {
|
|
| 1569 | - $gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
|
|
| 1570 | - $gd_region = preg_replace('/[_-]/', ' ', $gd_region);
|
|
| 1571 | - $gd_region = __(geodir_ucwords($gd_region), 'geodirectory'); |
|
| 1572 | - } |
|
| 1573 | - |
|
| 1574 | - $list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'";
|
|
| 1575 | - } else if ($gd_country != '') {
|
|
| 1576 | - if ($gd_country_actual != '') {
|
|
| 1577 | - $gd_country = $gd_country_actual; |
|
| 1578 | - } else {
|
|
| 1579 | - $gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
|
|
| 1580 | - $gd_country = preg_replace('/[_-]/', ' ', $gd_country);
|
|
| 1581 | - $gd_country = __(geodir_ucwords($gd_country), 'geodirectory'); |
|
| 1582 | - } |
|
| 1583 | - |
|
| 1584 | - $list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'";
|
|
| 1585 | - } |
|
| 1586 | - } |
|
| 1587 | - |
|
| 1588 | - if (is_search()) {
|
|
| 1589 | - $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
|
|
| 1590 | - } |
|
| 1591 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 1592 | - $class = apply_filters('geodir_page_title_class', 'entry-title fn');
|
|
| 1593 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 1594 | - $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
|
|
| 1595 | - |
|
| 1596 | - |
|
| 1597 | - $title = $list_title; |
|
| 1598 | - if(geodir_is_page('pt')){
|
|
| 1599 | - $gd_page = 'pt'; |
|
| 1600 | - $title = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
|
|
| 1601 | - } |
|
| 1602 | - elseif(geodir_is_page('listing')){
|
|
| 1603 | - $gd_page = 'listing'; |
|
| 1604 | - global $wp_query; |
|
| 1605 | - $current_term = $wp_query->get_queried_object(); |
|
| 1606 | - if (strpos($current_term->taxonomy,'_tags') !== false) {
|
|
| 1607 | - $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
|
|
| 1608 | - }else{
|
|
| 1609 | - $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
|
|
| 1610 | - } |
|
| 1499 | + if (!empty($term)) {
|
|
| 1500 | + $location_name = ''; |
|
| 1501 | + if ($gd_country != '' || $gd_region != '' || $gd_city != '') {
|
|
| 1502 | + if ($gd_country != '') {
|
|
| 1503 | + $location_name = geodir_sanitize_location_name('gd_country', $gd_country);
|
|
| 1504 | + } |
|
| 1611 | 1505 | |
| 1612 | - } |
|
| 1613 | - elseif(geodir_is_page('author')){
|
|
| 1614 | - $gd_page = 'author'; |
|
| 1615 | - if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
|
|
| 1616 | - $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
|
|
| 1617 | - }else{
|
|
| 1618 | - $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
|
|
| 1619 | - } |
|
| 1506 | + if ($gd_region != '') {
|
|
| 1507 | + $location_name = geodir_sanitize_location_name('gd_region', $gd_region);
|
|
| 1508 | + } |
|
| 1620 | 1509 | |
| 1621 | - } |
|
| 1510 | + if ($gd_city != '') {
|
|
| 1511 | + $location_name = geodir_sanitize_location_name('gd_city', $gd_city);
|
|
| 1512 | + } |
|
| 1513 | + } |
|
| 1514 | + |
|
| 1515 | + $current_term = get_term_by('slug', $term, $taxonomy[0]);
|
|
| 1516 | + if (!empty($current_term)) {
|
|
| 1517 | + $current_term_name = __(ucfirst($current_term->name), 'geodirectory'); |
|
| 1518 | + if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
|
|
| 1519 | + $location_last_char = substr($location_name, -1); |
|
| 1520 | + $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
|
|
| 1521 | + $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
|
|
| 1522 | + } else {
|
|
| 1523 | + $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
|
|
| 1524 | + } |
|
| 1525 | + } else {
|
|
| 1526 | + if (count($taxonomy) > 1) {
|
|
| 1527 | + $current_term = get_term_by('slug', $term, $taxonomy[1]);
|
|
| 1528 | + |
|
| 1529 | + if (!empty($current_term)) {
|
|
| 1530 | + $current_term_name = __(ucfirst($current_term->name), 'geodirectory'); |
|
| 1531 | + if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
|
|
| 1532 | + $location_last_char = substr($location_name, -1); |
|
| 1533 | + $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
|
|
| 1534 | + $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
|
|
| 1535 | + } else {
|
|
| 1536 | + $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
|
|
| 1537 | + } |
|
| 1538 | + } |
|
| 1539 | + } |
|
| 1540 | + } |
|
| 1541 | + |
|
| 1542 | + } else {
|
|
| 1543 | + $gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : ''; |
|
| 1544 | + $gd_region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : ''; |
|
| 1545 | + $gd_city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : ''; |
|
| 1546 | + |
|
| 1547 | + $gd_country_actual = $gd_region_actual = $gd_city_actual = ''; |
|
| 1548 | + |
|
| 1549 | + if (function_exists('get_actual_location_name')) {
|
|
| 1550 | + $gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
|
|
| 1551 | + $gd_region_actual = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
|
|
| 1552 | + $gd_city_actual = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
|
|
| 1553 | + } |
|
| 1554 | + |
|
| 1555 | + if ($gd_city != '') {
|
|
| 1556 | + if ($gd_city_actual != '') {
|
|
| 1557 | + $gd_city = $gd_city_actual; |
|
| 1558 | + } else {
|
|
| 1559 | + $gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
|
|
| 1560 | + $gd_city = preg_replace('/[_-]/', ' ', $gd_city);
|
|
| 1561 | + $gd_city = __(geodir_ucwords($gd_city), 'geodirectory'); |
|
| 1562 | + } |
|
| 1622 | 1563 | |
| 1564 | + $list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'";
|
|
| 1565 | + } else if ($gd_region != '') {
|
|
| 1566 | + if ($gd_region_actual != '') {
|
|
| 1567 | + $gd_region = $gd_region_actual; |
|
| 1568 | + } else {
|
|
| 1569 | + $gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
|
|
| 1570 | + $gd_region = preg_replace('/[_-]/', ' ', $gd_region);
|
|
| 1571 | + $gd_region = __(geodir_ucwords($gd_region), 'geodirectory'); |
|
| 1572 | + } |
|
| 1623 | 1573 | |
| 1624 | - /** |
|
| 1625 | - * Filter page title to replace variables. |
|
| 1626 | - * |
|
| 1627 | - * @since 1.5.4 |
|
| 1628 | - * @param string $title The page title including variables. |
|
| 1629 | - * @param string $gd_page The GeoDirectory page type if any. |
|
| 1630 | - */ |
|
| 1631 | - $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 1574 | + $list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'";
|
|
| 1575 | + } else if ($gd_country != '') {
|
|
| 1576 | + if ($gd_country_actual != '') {
|
|
| 1577 | + $gd_country = $gd_country_actual; |
|
| 1578 | + } else {
|
|
| 1579 | + $gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
|
|
| 1580 | + $gd_country = preg_replace('/[_-]/', ' ', $gd_country);
|
|
| 1581 | + $gd_country = __(geodir_ucwords($gd_country), 'geodirectory'); |
|
| 1582 | + } |
|
| 1632 | 1583 | |
| 1633 | - echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
|
| 1634 | - /** |
|
| 1635 | - * Filter the listing page title. |
|
| 1636 | - * |
|
| 1637 | - * @since 1.0.0 |
|
| 1638 | - * @param string $list_title The title for the category page. |
|
| 1639 | - */ |
|
| 1640 | - apply_filters('geodir_listing_page_title', $title) . '</h1></header>';
|
|
| 1584 | + $list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'";
|
|
| 1585 | + } |
|
| 1586 | + } |
|
| 1587 | + |
|
| 1588 | + if (is_search()) {
|
|
| 1589 | + $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
|
|
| 1590 | + } |
|
| 1591 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 1592 | + $class = apply_filters('geodir_page_title_class', 'entry-title fn');
|
|
| 1593 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 1594 | + $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
|
|
| 1595 | + |
|
| 1596 | + |
|
| 1597 | + $title = $list_title; |
|
| 1598 | + if(geodir_is_page('pt')){
|
|
| 1599 | + $gd_page = 'pt'; |
|
| 1600 | + $title = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
|
|
| 1601 | + } |
|
| 1602 | + elseif(geodir_is_page('listing')){
|
|
| 1603 | + $gd_page = 'listing'; |
|
| 1604 | + global $wp_query; |
|
| 1605 | + $current_term = $wp_query->get_queried_object(); |
|
| 1606 | + if (strpos($current_term->taxonomy,'_tags') !== false) {
|
|
| 1607 | + $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
|
|
| 1608 | + }else{
|
|
| 1609 | + $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
|
|
| 1610 | + } |
|
| 1611 | + |
|
| 1612 | + } |
|
| 1613 | + elseif(geodir_is_page('author')){
|
|
| 1614 | + $gd_page = 'author'; |
|
| 1615 | + if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
|
|
| 1616 | + $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
|
|
| 1617 | + }else{
|
|
| 1618 | + $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
|
|
| 1619 | + } |
|
| 1620 | + |
|
| 1621 | + } |
|
| 1622 | + |
|
| 1623 | + |
|
| 1624 | + /** |
|
| 1625 | + * Filter page title to replace variables. |
|
| 1626 | + * |
|
| 1627 | + * @since 1.5.4 |
|
| 1628 | + * @param string $title The page title including variables. |
|
| 1629 | + * @param string $gd_page The GeoDirectory page type if any. |
|
| 1630 | + */ |
|
| 1631 | + $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 1632 | + |
|
| 1633 | + echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
|
| 1634 | + /** |
|
| 1635 | + * Filter the listing page title. |
|
| 1636 | + * |
|
| 1637 | + * @since 1.0.0 |
|
| 1638 | + * @param string $list_title The title for the category page. |
|
| 1639 | + */ |
|
| 1640 | + apply_filters('geodir_listing_page_title', $title) . '</h1></header>';
|
|
| 1641 | 1641 | } |
| 1642 | 1642 | |
| 1643 | 1643 | add_action('geodir_listings_page_description', 'geodir_action_listings_description', 10);
|
@@ -1650,33 +1650,33 @@ discard block |
||
| 1650 | 1650 | */ |
| 1651 | 1651 | function geodir_action_listings_description() |
| 1652 | 1652 | {
|
| 1653 | - global $wp_query; |
|
| 1654 | - $current_term = $wp_query->get_queried_object(); |
|
| 1655 | - |
|
| 1656 | - $gd_post_type = geodir_get_current_posttype(); |
|
| 1657 | - if (isset($current_term->term_id) && $current_term->term_id != '') {
|
|
| 1658 | - |
|
| 1659 | - $term_desc = term_description($current_term->term_id, $gd_post_type . '_tags'); |
|
| 1660 | - $saved_data = stripslashes(get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type)); |
|
| 1661 | - if ($term_desc && !$saved_data) {
|
|
| 1662 | - $saved_data = $term_desc; |
|
| 1663 | - } |
|
| 1664 | - /** |
|
| 1665 | - * Apply the core filter `the_content` filter to the variable string. |
|
| 1666 | - * |
|
| 1667 | - * This is a WordPress core filter that does many things. |
|
| 1668 | - * |
|
| 1669 | - * @since 1.0.0 |
|
| 1670 | - * @param string $var The string to apply the filter to. |
|
| 1671 | - */ |
|
| 1672 | - $cat_description = apply_filters('the_content', $saved_data);
|
|
| 1673 | - if ($cat_description) {
|
|
| 1674 | - ?> |
|
| 1653 | + global $wp_query; |
|
| 1654 | + $current_term = $wp_query->get_queried_object(); |
|
| 1655 | + |
|
| 1656 | + $gd_post_type = geodir_get_current_posttype(); |
|
| 1657 | + if (isset($current_term->term_id) && $current_term->term_id != '') {
|
|
| 1658 | + |
|
| 1659 | + $term_desc = term_description($current_term->term_id, $gd_post_type . '_tags'); |
|
| 1660 | + $saved_data = stripslashes(get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type)); |
|
| 1661 | + if ($term_desc && !$saved_data) {
|
|
| 1662 | + $saved_data = $term_desc; |
|
| 1663 | + } |
|
| 1664 | + /** |
|
| 1665 | + * Apply the core filter `the_content` filter to the variable string. |
|
| 1666 | + * |
|
| 1667 | + * This is a WordPress core filter that does many things. |
|
| 1668 | + * |
|
| 1669 | + * @since 1.0.0 |
|
| 1670 | + * @param string $var The string to apply the filter to. |
|
| 1671 | + */ |
|
| 1672 | + $cat_description = apply_filters('the_content', $saved_data);
|
|
| 1673 | + if ($cat_description) {
|
|
| 1674 | + ?> |
|
| 1675 | 1675 | |
| 1676 | 1676 | <div class="term_description"><?php echo $cat_description;?></div> <?php |
| 1677 | - } |
|
| 1677 | + } |
|
| 1678 | 1678 | |
| 1679 | - } |
|
| 1679 | + } |
|
| 1680 | 1680 | } |
| 1681 | 1681 | |
| 1682 | 1682 | // action for adding the listings page top widget area |
@@ -1695,11 +1695,11 @@ discard block |
||
| 1695 | 1695 | */ |
| 1696 | 1696 | function geodir_action_geodir_sidebar_listings_top() |
| 1697 | 1697 | {
|
| 1698 | - if (get_option('geodir_show_listing_top_section')) { ?>
|
|
| 1698 | + if (get_option('geodir_show_listing_top_section')) { ?>
|
|
| 1699 | 1699 | <div |
| 1700 | 1700 | class="<?php |
| 1701 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 1702 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_top'); ?>">
|
|
| 1701 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 1702 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_top'); ?>">
|
|
| 1703 | 1703 | <?php dynamic_sidebar('geodir_listing_top'); ?>
|
| 1704 | 1704 | </div><!-- clearfix ends here--> |
| 1705 | 1705 | <?php } |
@@ -1722,35 +1722,35 @@ discard block |
||
| 1722 | 1722 | */ |
| 1723 | 1723 | function geodir_action_sidebar_left_open($type = '', $id = '', $class = '', $itemtype = '') |
| 1724 | 1724 | {
|
| 1725 | - if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
|
|
| 1726 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 1727 | - } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
|
|
| 1728 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 1729 | - } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
|
|
| 1730 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 1731 | - } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
|
|
| 1732 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 1733 | - } else {
|
|
| 1734 | - $width_css = ''; |
|
| 1735 | - } |
|
| 1736 | - |
|
| 1737 | - $tc = get_option('theme_compatibility_setting');
|
|
| 1738 | - if (!empty($tc['geodir_sidebar_left_open_replace'])) {
|
|
| 1739 | - $text = $tc['geodir_sidebar_left_open_replace']; |
|
| 1740 | - } else {
|
|
| 1741 | - $text = '<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>'; |
|
| 1742 | - } |
|
| 1743 | - |
|
| 1744 | - if (!empty($tc['geodir_sidebar_left_open_id'])) {
|
|
| 1745 | - $id = $tc['geodir_sidebar_left_open_id']; |
|
| 1746 | - } |
|
| 1747 | - if (!empty($tc['geodir_sidebar_left_open_class'])) {
|
|
| 1748 | - $class = $tc['geodir_sidebar_left_open_class']; |
|
| 1749 | - } |
|
| 1750 | - |
|
| 1751 | - $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
|
|
| 1752 | - |
|
| 1753 | - echo $text; |
|
| 1725 | + if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
|
|
| 1726 | + $width_css = 'style="width:' . $width . '%;"'; |
|
| 1727 | + } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
|
|
| 1728 | + $width_css = 'style="width:' . $width . '%;"'; |
|
| 1729 | + } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
|
|
| 1730 | + $width_css = 'style="width:' . $width . '%;"'; |
|
| 1731 | + } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
|
|
| 1732 | + $width_css = 'style="width:' . $width . '%;"'; |
|
| 1733 | + } else {
|
|
| 1734 | + $width_css = ''; |
|
| 1735 | + } |
|
| 1736 | + |
|
| 1737 | + $tc = get_option('theme_compatibility_setting');
|
|
| 1738 | + if (!empty($tc['geodir_sidebar_left_open_replace'])) {
|
|
| 1739 | + $text = $tc['geodir_sidebar_left_open_replace']; |
|
| 1740 | + } else {
|
|
| 1741 | + $text = '<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>'; |
|
| 1742 | + } |
|
| 1743 | + |
|
| 1744 | + if (!empty($tc['geodir_sidebar_left_open_id'])) {
|
|
| 1745 | + $id = $tc['geodir_sidebar_left_open_id']; |
|
| 1746 | + } |
|
| 1747 | + if (!empty($tc['geodir_sidebar_left_open_class'])) {
|
|
| 1748 | + $class = $tc['geodir_sidebar_left_open_class']; |
|
| 1749 | + } |
|
| 1750 | + |
|
| 1751 | + $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
|
|
| 1752 | + |
|
| 1753 | + echo $text; |
|
| 1754 | 1754 | } |
| 1755 | 1755 | |
| 1756 | 1756 | // action for adding the primary div closing tag |
@@ -1766,13 +1766,13 @@ discard block |
||
| 1766 | 1766 | */ |
| 1767 | 1767 | function geodir_action_sidebar_left_close($type = '') |
| 1768 | 1768 | {
|
| 1769 | - $tc = get_option('theme_compatibility_setting');
|
|
| 1770 | - if (!empty($tc['geodir_sidebar_left_close_replace'])) {
|
|
| 1771 | - $text = $tc['geodir_sidebar_left_close_replace']; |
|
| 1772 | - } else {
|
|
| 1773 | - $text = '</aside><!-- sidebar ends here-->'; |
|
| 1774 | - } |
|
| 1775 | - echo $text; |
|
| 1769 | + $tc = get_option('theme_compatibility_setting');
|
|
| 1770 | + if (!empty($tc['geodir_sidebar_left_close_replace'])) {
|
|
| 1771 | + $text = $tc['geodir_sidebar_left_close_replace']; |
|
| 1772 | + } else {
|
|
| 1773 | + $text = '</aside><!-- sidebar ends here-->'; |
|
| 1774 | + } |
|
| 1775 | + echo $text; |
|
| 1776 | 1776 | } |
| 1777 | 1777 | |
| 1778 | 1778 | /** |
@@ -1785,7 +1785,7 @@ discard block |
||
| 1785 | 1785 | */ |
| 1786 | 1786 | function geodir_listing_left_section() |
| 1787 | 1787 | {
|
| 1788 | - if (get_option('geodir_show_listing_left_section')) { ?>
|
|
| 1788 | + if (get_option('geodir_show_listing_left_section')) { ?>
|
|
| 1789 | 1789 | <div class="geodir-content-left geodir-sidebar-wrap"> |
| 1790 | 1790 | <?php dynamic_sidebar('geodir_listing_left_sidebar'); ?>
|
| 1791 | 1791 | </div><!-- end geodir-content-left --> |
@@ -1803,20 +1803,20 @@ discard block |
||
| 1803 | 1803 | */ |
| 1804 | 1804 | function geodir_action_listings_sidebar_left() |
| 1805 | 1805 | {
|
| 1806 | - if (get_option('geodir_show_listing_left_section')) {
|
|
| 1807 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 1808 | - do_action('geodir_sidebar_left_open', 'listings-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
|
|
| 1809 | - /** |
|
| 1810 | - * Calls the listings page (category) left sidebar content. |
|
| 1811 | - * |
|
| 1812 | - * All the content for the listings page left sidebar is added via this hook. |
|
| 1813 | - * |
|
| 1814 | - * @since 1.0.0 |
|
| 1815 | - */ |
|
| 1816 | - do_action('geodir_listings_sidebar_left_inside');
|
|
| 1817 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 1818 | - do_action('geodir_sidebar_left_close', 'listings-page');
|
|
| 1819 | - } |
|
| 1806 | + if (get_option('geodir_show_listing_left_section')) {
|
|
| 1807 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 1808 | + do_action('geodir_sidebar_left_open', 'listings-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
|
|
| 1809 | + /** |
|
| 1810 | + * Calls the listings page (category) left sidebar content. |
|
| 1811 | + * |
|
| 1812 | + * All the content for the listings page left sidebar is added via this hook. |
|
| 1813 | + * |
|
| 1814 | + * @since 1.0.0 |
|
| 1815 | + */ |
|
| 1816 | + do_action('geodir_listings_sidebar_left_inside');
|
|
| 1817 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 1818 | + do_action('geodir_sidebar_left_close', 'listings-page');
|
|
| 1819 | + } |
|
| 1820 | 1820 | } |
| 1821 | 1821 | |
| 1822 | 1822 | /** |
@@ -1829,7 +1829,7 @@ discard block |
||
| 1829 | 1829 | */ |
| 1830 | 1830 | function geodir_listing_right_section() |
| 1831 | 1831 | {
|
| 1832 | - if (get_option('geodir_show_listing_right_section')) { ?>
|
|
| 1832 | + if (get_option('geodir_show_listing_right_section')) { ?>
|
|
| 1833 | 1833 | <div class="geodir-content-right geodir-sidebar-wrap"> |
| 1834 | 1834 | <?php dynamic_sidebar('geodir_listing_right_sidebar'); ?>
|
| 1835 | 1835 | </div><!-- end geodir-content-right --> |
@@ -1847,20 +1847,20 @@ discard block |
||
| 1847 | 1847 | */ |
| 1848 | 1848 | function geodir_action_listings_sidebar_right() |
| 1849 | 1849 | {
|
| 1850 | - if (get_option('geodir_show_listing_right_section')) {
|
|
| 1851 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 1852 | - do_action('geodir_sidebar_right_open', 'listings-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
|
|
| 1853 | - /** |
|
| 1854 | - * Calls the listings page (category) right sidebar content. |
|
| 1855 | - * |
|
| 1856 | - * All the content for the listings page right sidebar is added via this hook. |
|
| 1857 | - * |
|
| 1858 | - * @since 1.0.0 |
|
| 1859 | - */ |
|
| 1860 | - do_action('geodir_listings_sidebar_right_inside');
|
|
| 1861 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 1862 | - do_action('geodir_sidebar_right_close', 'listings-page');
|
|
| 1863 | - } |
|
| 1850 | + if (get_option('geodir_show_listing_right_section')) {
|
|
| 1851 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 1852 | + do_action('geodir_sidebar_right_open', 'listings-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
|
|
| 1853 | + /** |
|
| 1854 | + * Calls the listings page (category) right sidebar content. |
|
| 1855 | + * |
|
| 1856 | + * All the content for the listings page right sidebar is added via this hook. |
|
| 1857 | + * |
|
| 1858 | + * @since 1.0.0 |
|
| 1859 | + */ |
|
| 1860 | + do_action('geodir_listings_sidebar_right_inside');
|
|
| 1861 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 1862 | + do_action('geodir_sidebar_right_close', 'listings-page');
|
|
| 1863 | + } |
|
| 1864 | 1864 | } |
| 1865 | 1865 | |
| 1866 | 1866 | |
@@ -1877,23 +1877,23 @@ discard block |
||
| 1877 | 1877 | */ |
| 1878 | 1878 | function geodir_action_main_content_open($type = '', $id = '', $class = '') |
| 1879 | 1879 | {
|
| 1880 | - $tc = get_option('theme_compatibility_setting');
|
|
| 1881 | - if (!empty($tc['geodir_main_content_open_replace'])) {
|
|
| 1882 | - $text = $tc['geodir_main_content_open_replace']; |
|
| 1883 | - } else {
|
|
| 1884 | - $text = '<main id="[id]" class="[class]" role="main">'; |
|
| 1885 | - } |
|
| 1880 | + $tc = get_option('theme_compatibility_setting');
|
|
| 1881 | + if (!empty($tc['geodir_main_content_open_replace'])) {
|
|
| 1882 | + $text = $tc['geodir_main_content_open_replace']; |
|
| 1883 | + } else {
|
|
| 1884 | + $text = '<main id="[id]" class="[class]" role="main">'; |
|
| 1885 | + } |
|
| 1886 | 1886 | |
| 1887 | - if (!empty($tc['geodir_main_content_open_id'])) {
|
|
| 1888 | - $id = $tc['geodir_main_content_open_id']; |
|
| 1889 | - } |
|
| 1890 | - if (!empty($tc['geodir_main_content_open_class'])) {
|
|
| 1891 | - $class = $tc['geodir_main_content_open_class']; |
|
| 1892 | - } |
|
| 1887 | + if (!empty($tc['geodir_main_content_open_id'])) {
|
|
| 1888 | + $id = $tc['geodir_main_content_open_id']; |
|
| 1889 | + } |
|
| 1890 | + if (!empty($tc['geodir_main_content_open_class'])) {
|
|
| 1891 | + $class = $tc['geodir_main_content_open_class']; |
|
| 1892 | + } |
|
| 1893 | 1893 | |
| 1894 | - $text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
|
|
| 1894 | + $text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
|
|
| 1895 | 1895 | |
| 1896 | - echo $text; |
|
| 1896 | + echo $text; |
|
| 1897 | 1897 | } |
| 1898 | 1898 | |
| 1899 | 1899 | // action for adding the primary div closing tag |
@@ -1906,13 +1906,13 @@ discard block |
||
| 1906 | 1906 | */ |
| 1907 | 1907 | function geodir_action_main_content_close() |
| 1908 | 1908 | {
|
| 1909 | - $tc = get_option('theme_compatibility_setting');
|
|
| 1910 | - if (!empty($tc['geodir_main_content_close_replace'])) {
|
|
| 1911 | - $text = $tc['geodir_main_content_close_replace']; |
|
| 1912 | - } else {
|
|
| 1913 | - $text = '</main><!-- main ends here-->'; |
|
| 1914 | - } |
|
| 1915 | - echo $text; |
|
| 1909 | + $tc = get_option('theme_compatibility_setting');
|
|
| 1910 | + if (!empty($tc['geodir_main_content_close_replace'])) {
|
|
| 1911 | + $text = $tc['geodir_main_content_close_replace']; |
|
| 1912 | + } else {
|
|
| 1913 | + $text = '</main><!-- main ends here-->'; |
|
| 1914 | + } |
|
| 1915 | + echo $text; |
|
| 1916 | 1916 | } |
| 1917 | 1917 | |
| 1918 | 1918 | /** |
@@ -1924,14 +1924,14 @@ discard block |
||
| 1924 | 1924 | */ |
| 1925 | 1925 | function geodir_action_listings_content_inside() |
| 1926 | 1926 | {
|
| 1927 | - global $gridview_columns; |
|
| 1928 | - $listing_view = get_option('geodir_listing_view');
|
|
| 1929 | - if (strstr($listing_view, 'gridview')) {
|
|
| 1930 | - $gridview_columns = $listing_view; |
|
| 1931 | - $listing_view_exp = explode('_', $listing_view);
|
|
| 1932 | - $listing_view = $listing_view_exp[0]; |
|
| 1933 | - } |
|
| 1934 | - geodir_get_template_part('listing', 'listview');
|
|
| 1927 | + global $gridview_columns; |
|
| 1928 | + $listing_view = get_option('geodir_listing_view');
|
|
| 1929 | + if (strstr($listing_view, 'gridview')) {
|
|
| 1930 | + $gridview_columns = $listing_view; |
|
| 1931 | + $listing_view_exp = explode('_', $listing_view);
|
|
| 1932 | + $listing_view = $listing_view_exp[0]; |
|
| 1933 | + } |
|
| 1934 | + geodir_get_template_part('listing', 'listview');
|
|
| 1935 | 1935 | } |
| 1936 | 1936 | |
| 1937 | 1937 | add_action('geodir_listings_content_inside', 'geodir_action_listings_content_inside', 10);
|
@@ -1947,47 +1947,47 @@ discard block |
||
| 1947 | 1947 | */ |
| 1948 | 1948 | function geodir_action_listings_content() |
| 1949 | 1949 | {
|
| 1950 | - /** |
|
| 1951 | - * This is used to add HTML opening wrappers to the main content of most pages including listings, author, search, home etc. |
|
| 1952 | - * |
|
| 1953 | - * @since 1.0.0 |
|
| 1954 | - * @param string $type The page type. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
| 1955 | - * @param string $id The id for the div. Usually 'geodir-main-content'. |
|
| 1956 | - * @param string $class The class for the div. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
| 1957 | - * @see 'geodir_main_content_close' Where the oposing closing tag is added. |
|
| 1958 | - */ |
|
| 1959 | - do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page');
|
|
| 1960 | - $extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page');
|
|
| 1961 | - echo '<div class="clearfix '.$extra_class.'">'; |
|
| 1962 | - /** |
|
| 1963 | - * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages. |
|
| 1964 | - * |
|
| 1965 | - * @since 1.0.0 |
|
| 1966 | - */ |
|
| 1967 | - do_action('geodir_before_listing');
|
|
| 1968 | - echo '</div>'; |
|
| 1969 | - |
|
| 1970 | - /** |
|
| 1971 | - * This actions calls the listings list content. Used on listings pages and search and author pages. |
|
| 1972 | - * |
|
| 1973 | - * @since 1.0.0 |
|
| 1974 | - */ |
|
| 1975 | - do_action('geodir_listings_content_inside');
|
|
| 1976 | - |
|
| 1977 | - /** |
|
| 1978 | - * Called after the listings content, inside the outer wrapper HTML. Used on listings pages and search and author pages. |
|
| 1979 | - * |
|
| 1980 | - * @since 1.0.0 |
|
| 1981 | - */ |
|
| 1982 | - do_action('geodir_after_listing');
|
|
| 1983 | - |
|
| 1984 | - /** |
|
| 1985 | - * This is used to add HTML closing wrappers to the main content of most pages including listings, author, search, home etc. |
|
| 1986 | - * |
|
| 1987 | - * @since 1.0.0 |
|
| 1988 | - * @see 'geodir_main_content_open' Where the oposing opening tag is added. |
|
| 1989 | - */ |
|
| 1990 | - do_action('geodir_main_content_close', 'listings-page');
|
|
| 1950 | + /** |
|
| 1951 | + * This is used to add HTML opening wrappers to the main content of most pages including listings, author, search, home etc. |
|
| 1952 | + * |
|
| 1953 | + * @since 1.0.0 |
|
| 1954 | + * @param string $type The page type. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
| 1955 | + * @param string $id The id for the div. Usually 'geodir-main-content'. |
|
| 1956 | + * @param string $class The class for the div. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
| 1957 | + * @see 'geodir_main_content_close' Where the oposing closing tag is added. |
|
| 1958 | + */ |
|
| 1959 | + do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page');
|
|
| 1960 | + $extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page');
|
|
| 1961 | + echo '<div class="clearfix '.$extra_class.'">'; |
|
| 1962 | + /** |
|
| 1963 | + * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages. |
|
| 1964 | + * |
|
| 1965 | + * @since 1.0.0 |
|
| 1966 | + */ |
|
| 1967 | + do_action('geodir_before_listing');
|
|
| 1968 | + echo '</div>'; |
|
| 1969 | + |
|
| 1970 | + /** |
|
| 1971 | + * This actions calls the listings list content. Used on listings pages and search and author pages. |
|
| 1972 | + * |
|
| 1973 | + * @since 1.0.0 |
|
| 1974 | + */ |
|
| 1975 | + do_action('geodir_listings_content_inside');
|
|
| 1976 | + |
|
| 1977 | + /** |
|
| 1978 | + * Called after the listings content, inside the outer wrapper HTML. Used on listings pages and search and author pages. |
|
| 1979 | + * |
|
| 1980 | + * @since 1.0.0 |
|
| 1981 | + */ |
|
| 1982 | + do_action('geodir_after_listing');
|
|
| 1983 | + |
|
| 1984 | + /** |
|
| 1985 | + * This is used to add HTML closing wrappers to the main content of most pages including listings, author, search, home etc. |
|
| 1986 | + * |
|
| 1987 | + * @since 1.0.0 |
|
| 1988 | + * @see 'geodir_main_content_open' Where the oposing opening tag is added. |
|
| 1989 | + */ |
|
| 1990 | + do_action('geodir_main_content_close', 'listings-page');
|
|
| 1991 | 1991 | } |
| 1992 | 1992 | |
| 1993 | 1993 | |
@@ -2002,10 +2002,10 @@ discard block |
||
| 2002 | 2002 | */ |
| 2003 | 2003 | function geodir_action_sidebar_listings_bottom_section() |
| 2004 | 2004 | {
|
| 2005 | - if (get_option('geodir_show_listing_bottom_section')) { ?>
|
|
| 2005 | + if (get_option('geodir_show_listing_bottom_section')) { ?>
|
|
| 2006 | 2006 | <div class="<?php |
| 2007 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2008 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_bottom'); ?>">
|
|
| 2007 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2008 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_bottom'); ?>">
|
|
| 2009 | 2009 | <?php dynamic_sidebar('geodir_listing_bottom'); ?>
|
| 2010 | 2010 | </div><!-- clearfix ends here--> |
| 2011 | 2011 | <?php } |
@@ -2025,38 +2025,38 @@ discard block |
||
| 2025 | 2025 | */ |
| 2026 | 2026 | function geodir_action_add_listing_page_title() |
| 2027 | 2027 | {
|
| 2028 | - if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '') |
|
| 2029 | - $listing_type = sanitize_text_field($_REQUEST['listing_type']); |
|
| 2030 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2031 | - $class = apply_filters('geodir_page_title_class', 'entry-title fn');
|
|
| 2032 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2033 | - $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
|
|
| 2034 | - |
|
| 2035 | - $title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
|
|
| 2036 | - |
|
| 2037 | - if(geodir_is_page('add-listing')){
|
|
| 2038 | - $gd_page = 'add-listing'; |
|
| 2039 | - if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
|
|
| 2040 | - $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
|
|
| 2041 | - }elseif(isset($listing_type)){
|
|
| 2042 | - $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
|
|
| 2043 | - } |
|
| 2028 | + if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '') |
|
| 2029 | + $listing_type = sanitize_text_field($_REQUEST['listing_type']); |
|
| 2030 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2031 | + $class = apply_filters('geodir_page_title_class', 'entry-title fn');
|
|
| 2032 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2033 | + $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
|
|
| 2034 | + |
|
| 2035 | + $title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
|
|
| 2044 | 2036 | |
| 2045 | - } |
|
| 2037 | + if(geodir_is_page('add-listing')){
|
|
| 2038 | + $gd_page = 'add-listing'; |
|
| 2039 | + if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
|
|
| 2040 | + $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
|
|
| 2041 | + }elseif(isset($listing_type)){
|
|
| 2042 | + $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
|
|
| 2043 | + } |
|
| 2046 | 2044 | |
| 2045 | + } |
|
| 2047 | 2046 | |
| 2048 | - /** |
|
| 2049 | - * Filter page title to replace variables. |
|
| 2050 | - * |
|
| 2051 | - * @since 1.5.4 |
|
| 2052 | - * @param string $title The page title including variables. |
|
| 2053 | - * @param string $gd_page The GeoDirectory page type if any. |
|
| 2054 | - */ |
|
| 2055 | - $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 2056 | 2047 | |
| 2057 | - echo '<header class="' . $class_header . '"><h1 class="' . $class . '">'; |
|
| 2058 | - echo $title; |
|
| 2059 | - echo '</h1></header>'; |
|
| 2048 | + /** |
|
| 2049 | + * Filter page title to replace variables. |
|
| 2050 | + * |
|
| 2051 | + * @since 1.5.4 |
|
| 2052 | + * @param string $title The page title including variables. |
|
| 2053 | + * @param string $gd_page The GeoDirectory page type if any. |
|
| 2054 | + */ |
|
| 2055 | + $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 2056 | + |
|
| 2057 | + echo '<header class="' . $class_header . '"><h1 class="' . $class . '">'; |
|
| 2058 | + echo $title; |
|
| 2059 | + echo '</h1></header>'; |
|
| 2060 | 2060 | } |
| 2061 | 2061 | |
| 2062 | 2062 | add_action('geodir_add_listing_page_mandatory', 'geodir_action_add_listing_page_mandatory', 10);
|
@@ -2087,54 +2087,54 @@ discard block |
||
| 2087 | 2087 | */ |
| 2088 | 2088 | function geodir_action_add_listing_form() |
| 2089 | 2089 | {
|
| 2090 | - global $cat_display, $post_cat, $current_user, $gd_session; |
|
| 2091 | - $page_id = get_the_ID(); |
|
| 2092 | - $post = ''; |
|
| 2093 | - $title = ''; |
|
| 2094 | - $desc = ''; |
|
| 2095 | - $kw_tags = ''; |
|
| 2096 | - $required_msg = ''; |
|
| 2097 | - $submit_button = ''; |
|
| 2098 | - |
|
| 2099 | - $ajax_action = isset($_REQUEST['ajax_action']) ? $_REQUEST['ajax_action'] : 'add'; |
|
| 2100 | - |
|
| 2101 | - $thumb_img_arr = array(); |
|
| 2102 | - $curImages = ''; |
|
| 2103 | - |
|
| 2104 | - if (isset($_REQUEST['backandedit'])) {
|
|
| 2105 | - global $post; |
|
| 2106 | - $post = (object)$gd_session->get('listing');
|
|
| 2107 | - $listing_type = $post->listing_type; |
|
| 2108 | - $title = $post->post_title; |
|
| 2109 | - $desc = $post->post_desc; |
|
| 2110 | - $post_cat = $post->post_category; |
|
| 2111 | - |
|
| 2112 | - $kw_tags = $post->post_tags; |
|
| 2113 | - $curImages = isset($post->post_images) ? $post->post_images : ''; |
|
| 2114 | - } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 2115 | - global $post, $post_images; |
|
| 2116 | - |
|
| 2117 | - $post = geodir_get_post_info($_REQUEST['pid']); |
|
| 2118 | - $thumb_img_arr = geodir_get_images($post->ID); |
|
| 2119 | - if ($thumb_img_arr) {
|
|
| 2120 | - foreach ($thumb_img_arr as $post_img) {
|
|
| 2121 | - $curImages .= $post_img->src . ','; |
|
| 2122 | - } |
|
| 2123 | - } |
|
| 2124 | - |
|
| 2125 | - $listing_type = $post->post_type; |
|
| 2126 | - $title = $post->post_title; |
|
| 2127 | - $desc = $post->post_content; |
|
| 2128 | - $kw_tags = $post->post_tags; |
|
| 2129 | - $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
|
|
| 2130 | - } else {
|
|
| 2131 | - $listing_type = sanitize_text_field($_REQUEST['listing_type']); |
|
| 2132 | - } |
|
| 2133 | - |
|
| 2134 | - if ($current_user->ID != '0') {
|
|
| 2135 | - $user_login = true; |
|
| 2136 | - } |
|
| 2137 | - ?> |
|
| 2090 | + global $cat_display, $post_cat, $current_user, $gd_session; |
|
| 2091 | + $page_id = get_the_ID(); |
|
| 2092 | + $post = ''; |
|
| 2093 | + $title = ''; |
|
| 2094 | + $desc = ''; |
|
| 2095 | + $kw_tags = ''; |
|
| 2096 | + $required_msg = ''; |
|
| 2097 | + $submit_button = ''; |
|
| 2098 | + |
|
| 2099 | + $ajax_action = isset($_REQUEST['ajax_action']) ? $_REQUEST['ajax_action'] : 'add'; |
|
| 2100 | + |
|
| 2101 | + $thumb_img_arr = array(); |
|
| 2102 | + $curImages = ''; |
|
| 2103 | + |
|
| 2104 | + if (isset($_REQUEST['backandedit'])) {
|
|
| 2105 | + global $post; |
|
| 2106 | + $post = (object)$gd_session->get('listing');
|
|
| 2107 | + $listing_type = $post->listing_type; |
|
| 2108 | + $title = $post->post_title; |
|
| 2109 | + $desc = $post->post_desc; |
|
| 2110 | + $post_cat = $post->post_category; |
|
| 2111 | + |
|
| 2112 | + $kw_tags = $post->post_tags; |
|
| 2113 | + $curImages = isset($post->post_images) ? $post->post_images : ''; |
|
| 2114 | + } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 2115 | + global $post, $post_images; |
|
| 2116 | + |
|
| 2117 | + $post = geodir_get_post_info($_REQUEST['pid']); |
|
| 2118 | + $thumb_img_arr = geodir_get_images($post->ID); |
|
| 2119 | + if ($thumb_img_arr) {
|
|
| 2120 | + foreach ($thumb_img_arr as $post_img) {
|
|
| 2121 | + $curImages .= $post_img->src . ','; |
|
| 2122 | + } |
|
| 2123 | + } |
|
| 2124 | + |
|
| 2125 | + $listing_type = $post->post_type; |
|
| 2126 | + $title = $post->post_title; |
|
| 2127 | + $desc = $post->post_content; |
|
| 2128 | + $kw_tags = $post->post_tags; |
|
| 2129 | + $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
|
|
| 2130 | + } else {
|
|
| 2131 | + $listing_type = sanitize_text_field($_REQUEST['listing_type']); |
|
| 2132 | + } |
|
| 2133 | + |
|
| 2134 | + if ($current_user->ID != '0') {
|
|
| 2135 | + $user_login = true; |
|
| 2136 | + } |
|
| 2137 | + ?> |
|
| 2138 | 2138 | <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id());?>" method="post" enctype="multipart/form-data"> |
| 2139 | 2139 | <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type);?>"/> |
| 2140 | 2140 | <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type);?>"/> |
@@ -2145,27 +2145,27 @@ discard block |
||
| 2145 | 2145 | <?php } if (isset($_REQUEST['backandedit'])) { ?>
|
| 2146 | 2146 | <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']);?>"/> |
| 2147 | 2147 | <?php |
| 2148 | - } |
|
| 2149 | - /** |
|
| 2150 | - * Called at the very top of the add listing page form for frontend. |
|
| 2151 | - * |
|
| 2152 | - * This is called just before the "Enter Listing Details" text. |
|
| 2153 | - * |
|
| 2154 | - * @since 1.0.0 |
|
| 2155 | - */ |
|
| 2156 | - do_action('geodir_before_detail_fields');
|
|
| 2157 | - ?> |
|
| 2148 | + } |
|
| 2149 | + /** |
|
| 2150 | + * Called at the very top of the add listing page form for frontend. |
|
| 2151 | + * |
|
| 2152 | + * This is called just before the "Enter Listing Details" text. |
|
| 2153 | + * |
|
| 2154 | + * @since 1.0.0 |
|
| 2155 | + */ |
|
| 2156 | + do_action('geodir_before_detail_fields');
|
|
| 2157 | + ?> |
|
| 2158 | 2158 | <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT;?></h5> |
| 2159 | 2159 | <?php |
| 2160 | - /** |
|
| 2161 | - * Called at the top of the add listing page form for frontend. |
|
| 2162 | - * |
|
| 2163 | - * This is called after the "Enter Listing Details" text. |
|
| 2164 | - * |
|
| 2165 | - * @since 1.0.0 |
|
| 2166 | - */ |
|
| 2167 | - do_action('geodir_before_main_form_fields');
|
|
| 2168 | - ?> |
|
| 2160 | + /** |
|
| 2161 | + * Called at the top of the add listing page form for frontend. |
|
| 2162 | + * |
|
| 2163 | + * This is called after the "Enter Listing Details" text. |
|
| 2164 | + * |
|
| 2165 | + * @since 1.0.0 |
|
| 2166 | + */ |
|
| 2167 | + do_action('geodir_before_main_form_fields');
|
|
| 2168 | + ?> |
|
| 2169 | 2169 | <div id="geodir_post_title_row" class="required_field geodir_form_row clearfix gd-fieldset-details"> |
| 2170 | 2170 | <label><?php echo PLACE_TITLE_TEXT;?><span>*</span> </label> |
| 2171 | 2171 | <input type="text" field_type="text" name="post_title" id="post_title" class="geodir_textfield" |
@@ -2173,57 +2173,57 @@ discard block |
||
| 2173 | 2173 | <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory');?></span> |
| 2174 | 2174 | </div> |
| 2175 | 2175 | <?php |
| 2176 | - $show_editor = get_option('geodir_tiny_editor_on_add_listing');
|
|
| 2177 | - |
|
| 2178 | - $desc = $show_editor ? stripslashes($desc) : esc_attr(stripslashes($desc)); |
|
| 2179 | - $desc_limit = ''; |
|
| 2180 | - /** |
|
| 2181 | - * Filter the add listing description field character limit number. |
|
| 2182 | - * |
|
| 2183 | - * @since 1.0.0 |
|
| 2184 | - * @param int $desc_limit The amount of characters to limit the description to. |
|
| 2185 | - */ |
|
| 2186 | - $desc_limit = apply_filters('geodir_description_field_desc_limit', $desc_limit);
|
|
| 2187 | - /** |
|
| 2188 | - * Filter the add listing description field text. |
|
| 2189 | - * |
|
| 2190 | - * @since 1.0.0 |
|
| 2191 | - * @param string $desc The text for the description field. |
|
| 2192 | - * @param int $desc_limit The character limit numer if any. |
|
| 2193 | - */ |
|
| 2194 | - $desc = apply_filters('geodir_description_field_desc', $desc, $desc_limit);
|
|
| 2195 | - $desc_limit_msg = ''; |
|
| 2196 | - /** |
|
| 2197 | - * Filter the add listing description limit message. |
|
| 2198 | - * |
|
| 2199 | - * This is the message shown if there is a limit applied to the amount of characters the description can use. |
|
| 2200 | - * |
|
| 2201 | - * @since 1.0.0 |
|
| 2202 | - * @param string $desc_limit_msg The limit message string if any. |
|
| 2203 | - * @param int $desc_limit The character limit numer if any. |
|
| 2204 | - */ |
|
| 2205 | - $desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
|
|
| 2176 | + $show_editor = get_option('geodir_tiny_editor_on_add_listing');
|
|
| 2177 | + |
|
| 2178 | + $desc = $show_editor ? stripslashes($desc) : esc_attr(stripslashes($desc)); |
|
| 2179 | + $desc_limit = ''; |
|
| 2180 | + /** |
|
| 2181 | + * Filter the add listing description field character limit number. |
|
| 2182 | + * |
|
| 2183 | + * @since 1.0.0 |
|
| 2184 | + * @param int $desc_limit The amount of characters to limit the description to. |
|
| 2185 | + */ |
|
| 2186 | + $desc_limit = apply_filters('geodir_description_field_desc_limit', $desc_limit);
|
|
| 2187 | + /** |
|
| 2188 | + * Filter the add listing description field text. |
|
| 2189 | + * |
|
| 2190 | + * @since 1.0.0 |
|
| 2191 | + * @param string $desc The text for the description field. |
|
| 2192 | + * @param int $desc_limit The character limit numer if any. |
|
| 2193 | + */ |
|
| 2194 | + $desc = apply_filters('geodir_description_field_desc', $desc, $desc_limit);
|
|
| 2195 | + $desc_limit_msg = ''; |
|
| 2196 | + /** |
|
| 2197 | + * Filter the add listing description limit message. |
|
| 2198 | + * |
|
| 2199 | + * This is the message shown if there is a limit applied to the amount of characters the description can use. |
|
| 2200 | + * |
|
| 2201 | + * @since 1.0.0 |
|
| 2202 | + * @param string $desc_limit_msg The limit message string if any. |
|
| 2203 | + * @param int $desc_limit The character limit numer if any. |
|
| 2204 | + */ |
|
| 2205 | + $desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
|
|
| 2206 | 2206 | |
| 2207 | - $desc_class = ''; |
|
| 2208 | - if ($desc_limit === '' || (int)$desc_limit > 0) {
|
|
| 2209 | - /** |
|
| 2210 | - * Called on the add listing page form for frontend just before the description field. |
|
| 2211 | - * |
|
| 2212 | - * @since 1.0.0 |
|
| 2213 | - */ |
|
| 2214 | - do_action('geodir_before_description_field');
|
|
| 2207 | + $desc_class = ''; |
|
| 2208 | + if ($desc_limit === '' || (int)$desc_limit > 0) {
|
|
| 2209 | + /** |
|
| 2210 | + * Called on the add listing page form for frontend just before the description field. |
|
| 2211 | + * |
|
| 2212 | + * @since 1.0.0 |
|
| 2213 | + */ |
|
| 2214 | + do_action('geodir_before_description_field');
|
|
| 2215 | 2215 | |
| 2216 | - $desc_class = ' required_field'; |
|
| 2217 | - } else {
|
|
| 2218 | - $desc_class = ' hidden'; |
|
| 2219 | - } |
|
| 2220 | - ?> |
|
| 2216 | + $desc_class = ' required_field'; |
|
| 2217 | + } else {
|
|
| 2218 | + $desc_class = ' hidden'; |
|
| 2219 | + } |
|
| 2220 | + ?> |
|
| 2221 | 2221 | <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class;?>"> |
| 2222 | 2222 | <label><?php echo PLACE_DESC_TEXT;?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
|
| 2223 | 2223 | <?php |
| 2224 | - if (!empty($show_editor) && in_array($listing_type, $show_editor)) {
|
|
| 2225 | - $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
|
|
| 2226 | - ?> |
|
| 2224 | + if (!empty($show_editor) && in_array($listing_type, $show_editor)) {
|
|
| 2225 | + $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
|
|
| 2226 | + ?> |
|
| 2227 | 2227 | <div class="editor" field_id="post_desc" field_type="editor"> |
| 2228 | 2228 | <?php wp_editor($desc, "post_desc", $editor_settings); ?> |
| 2229 | 2229 | </div> |
@@ -2237,56 +2237,56 @@ discard block |
||
| 2237 | 2237 | <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory');?></span> |
| 2238 | 2238 | </div> |
| 2239 | 2239 | <?php |
| 2240 | - if ($desc_limit === '' || (int)$desc_limit > 0) {
|
|
| 2241 | - /** |
|
| 2242 | - * Called on the add listing page form for frontend just after the description field. |
|
| 2243 | - * |
|
| 2244 | - * @since 1.0.0 |
|
| 2245 | - */ |
|
| 2246 | - do_action('geodir_after_description_field');
|
|
| 2247 | - } |
|
| 2240 | + if ($desc_limit === '' || (int)$desc_limit > 0) {
|
|
| 2241 | + /** |
|
| 2242 | + * Called on the add listing page form for frontend just after the description field. |
|
| 2243 | + * |
|
| 2244 | + * @since 1.0.0 |
|
| 2245 | + */ |
|
| 2246 | + do_action('geodir_after_description_field');
|
|
| 2247 | + } |
|
| 2248 | 2248 | |
| 2249 | - $kw_tags = esc_attr(stripslashes($kw_tags)); |
|
| 2250 | - $kw_tags_count = TAGKW_TEXT_COUNT; |
|
| 2251 | - $kw_tags_msg = TAGKW_MSG; |
|
| 2252 | - /** |
|
| 2253 | - * Filter the add listing tags character limit. |
|
| 2254 | - * |
|
| 2255 | - * @since 1.0.0 |
|
| 2256 | - * @param int $kw_tags_count The character count limit if any. |
|
| 2257 | - */ |
|
| 2258 | - $kw_tags_count = apply_filters('geodir_listing_tags_field_tags_count', $kw_tags_count);
|
|
| 2259 | - /** |
|
| 2260 | - * Filter the add listing tags field value. |
|
| 2261 | - * |
|
| 2262 | - * You can use the $_REQUEST values to check if this is a go back and edit value etc. |
|
| 2263 | - * |
|
| 2264 | - * @since 1.0.0 |
|
| 2265 | - * @param string $kw_tags The tag field value, usually a comma separated list of tags. |
|
| 2266 | - * @param int $kw_tags_count The character count limit if any. |
|
| 2267 | - */ |
|
| 2268 | - $kw_tags = apply_filters('geodir_listing_tags_field_tags', $kw_tags, $kw_tags_count);
|
|
| 2269 | - /** |
|
| 2270 | - * Filter the add listing tags field message text. |
|
| 2271 | - * |
|
| 2272 | - * @since 1.0.0 |
|
| 2273 | - * @param string $kw_tags_msg The message shown under the field. |
|
| 2274 | - * @param int $kw_tags_count The character count limit if any. |
|
| 2275 | - */ |
|
| 2276 | - $kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
|
|
| 2249 | + $kw_tags = esc_attr(stripslashes($kw_tags)); |
|
| 2250 | + $kw_tags_count = TAGKW_TEXT_COUNT; |
|
| 2251 | + $kw_tags_msg = TAGKW_MSG; |
|
| 2252 | + /** |
|
| 2253 | + * Filter the add listing tags character limit. |
|
| 2254 | + * |
|
| 2255 | + * @since 1.0.0 |
|
| 2256 | + * @param int $kw_tags_count The character count limit if any. |
|
| 2257 | + */ |
|
| 2258 | + $kw_tags_count = apply_filters('geodir_listing_tags_field_tags_count', $kw_tags_count);
|
|
| 2259 | + /** |
|
| 2260 | + * Filter the add listing tags field value. |
|
| 2261 | + * |
|
| 2262 | + * You can use the $_REQUEST values to check if this is a go back and edit value etc. |
|
| 2263 | + * |
|
| 2264 | + * @since 1.0.0 |
|
| 2265 | + * @param string $kw_tags The tag field value, usually a comma separated list of tags. |
|
| 2266 | + * @param int $kw_tags_count The character count limit if any. |
|
| 2267 | + */ |
|
| 2268 | + $kw_tags = apply_filters('geodir_listing_tags_field_tags', $kw_tags, $kw_tags_count);
|
|
| 2269 | + /** |
|
| 2270 | + * Filter the add listing tags field message text. |
|
| 2271 | + * |
|
| 2272 | + * @since 1.0.0 |
|
| 2273 | + * @param string $kw_tags_msg The message shown under the field. |
|
| 2274 | + * @param int $kw_tags_count The character count limit if any. |
|
| 2275 | + */ |
|
| 2276 | + $kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
|
|
| 2277 | 2277 | |
| 2278 | - $tags_class = ''; |
|
| 2279 | - if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
|
|
| 2280 | - /** |
|
| 2281 | - * Called on the add listing page form for frontend just before the tags field. |
|
| 2282 | - * |
|
| 2283 | - * @since 1.0.0 |
|
| 2284 | - */ |
|
| 2285 | - do_action('geodir_before_listing_tags_field');
|
|
| 2286 | - } else {
|
|
| 2287 | - $tags_class = ' hidden'; |
|
| 2288 | - } |
|
| 2289 | - ?> |
|
| 2278 | + $tags_class = ''; |
|
| 2279 | + if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
|
|
| 2280 | + /** |
|
| 2281 | + * Called on the add listing page form for frontend just before the tags field. |
|
| 2282 | + * |
|
| 2283 | + * @since 1.0.0 |
|
| 2284 | + */ |
|
| 2285 | + do_action('geodir_before_listing_tags_field');
|
|
| 2286 | + } else {
|
|
| 2287 | + $tags_class = ' hidden'; |
|
| 2288 | + } |
|
| 2289 | + ?> |
|
| 2290 | 2290 | <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class;?>"> |
| 2291 | 2291 | <label><?php echo TAGKW_TEXT; ?></label> |
| 2292 | 2292 | <input name="post_tags" id="post_tags" value="<?php echo $kw_tags; ?>" type="text" class="geodir_textfield" |
@@ -2294,90 +2294,90 @@ discard block |
||
| 2294 | 2294 | <span class="geodir_message_note"><?php echo $kw_tags_msg;?></span> |
| 2295 | 2295 | </div> |
| 2296 | 2296 | <?php |
| 2297 | - if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
|
|
| 2298 | - /** |
|
| 2299 | - * Called on the add listing page form for frontend just after the tags field. |
|
| 2300 | - * |
|
| 2301 | - * @since 1.0.0 |
|
| 2302 | - */ |
|
| 2303 | - do_action('geodir_after_listing_tags_field');
|
|
| 2304 | - } |
|
| 2297 | + if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
|
|
| 2298 | + /** |
|
| 2299 | + * Called on the add listing page form for frontend just after the tags field. |
|
| 2300 | + * |
|
| 2301 | + * @since 1.0.0 |
|
| 2302 | + */ |
|
| 2303 | + do_action('geodir_after_listing_tags_field');
|
|
| 2304 | + } |
|
| 2305 | 2305 | |
| 2306 | - $package_info = array(); |
|
| 2307 | - $package_info = geodir_post_package_info($package_info, $post); |
|
| 2306 | + $package_info = array(); |
|
| 2307 | + $package_info = geodir_post_package_info($package_info, $post); |
|
| 2308 | 2308 | |
| 2309 | - geodir_get_custom_fields_html($package_info->pid, 'all', $listing_type); |
|
| 2309 | + geodir_get_custom_fields_html($package_info->pid, 'all', $listing_type); |
|
| 2310 | 2310 | |
| 2311 | - // adjust values here |
|
| 2312 | - $id = "post_images"; // this will be the name of form field. Image url(s) will be submitted in $_POST using this key. So if $id == �img1� then $_POST[�img1�] will have all the image urls |
|
| 2311 | + // adjust values here |
|
| 2312 | + $id = "post_images"; // this will be the name of form field. Image url(s) will be submitted in $_POST using this key. So if $id == �img1� then $_POST[�img1�] will have all the image urls |
|
| 2313 | 2313 | |
| 2314 | - $multiple = true; // allow multiple files upload |
|
| 2314 | + $multiple = true; // allow multiple files upload |
|
| 2315 | 2315 | |
| 2316 | - $width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels) |
|
| 2316 | + $width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels) |
|
| 2317 | 2317 | |
| 2318 | - $height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels) |
|
| 2318 | + $height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels) |
|
| 2319 | 2319 | |
| 2320 | - $thumb_img_arr = array(); |
|
| 2321 | - $totImg = 0; |
|
| 2322 | - if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
|
|
| 2323 | - $post = (object)$gd_session->get('listing');
|
|
| 2324 | - if (isset($post->post_images)) |
|
| 2325 | - $curImages = trim($post->post_images, ","); |
|
| 2320 | + $thumb_img_arr = array(); |
|
| 2321 | + $totImg = 0; |
|
| 2322 | + if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
|
|
| 2323 | + $post = (object)$gd_session->get('listing');
|
|
| 2324 | + if (isset($post->post_images)) |
|
| 2325 | + $curImages = trim($post->post_images, ","); |
|
| 2326 | 2326 | |
| 2327 | 2327 | |
| 2328 | - if ($curImages != '') {
|
|
| 2329 | - $curImages_array = explode(',', $curImages);
|
|
| 2330 | - $totImg = count($curImages_array); |
|
| 2331 | - } |
|
| 2332 | - |
|
| 2333 | - $listing_type = $post->listing_type; |
|
| 2328 | + if ($curImages != '') {
|
|
| 2329 | + $curImages_array = explode(',', $curImages);
|
|
| 2330 | + $totImg = count($curImages_array); |
|
| 2331 | + } |
|
| 2334 | 2332 | |
| 2335 | - } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 2336 | - $post = geodir_get_post_info((int)$_REQUEST['pid']); |
|
| 2337 | - $listing_type = $post->post_type; |
|
| 2338 | - $thumb_img_arr = geodir_get_images($_REQUEST['pid']); |
|
| 2333 | + $listing_type = $post->listing_type; |
|
| 2339 | 2334 | |
| 2340 | - } else {
|
|
| 2341 | - $listing_type = sanitize_text_field($_REQUEST['listing_type']); |
|
| 2342 | - } |
|
| 2335 | + } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 2336 | + $post = geodir_get_post_info((int)$_REQUEST['pid']); |
|
| 2337 | + $listing_type = $post->post_type; |
|
| 2338 | + $thumb_img_arr = geodir_get_images($_REQUEST['pid']); |
|
| 2343 | 2339 | |
| 2340 | + } else {
|
|
| 2341 | + $listing_type = sanitize_text_field($_REQUEST['listing_type']); |
|
| 2342 | + } |
|
| 2344 | 2343 | |
| 2345 | - if (!empty($thumb_img_arr)) {
|
|
| 2346 | - foreach ($thumb_img_arr as $img) {
|
|
| 2347 | - //$curImages = $img->src.","; |
|
| 2348 | - } |
|
| 2349 | 2344 | |
| 2350 | - $totImg = count((array)$thumb_img_arr); |
|
| 2351 | - } |
|
| 2345 | + if (!empty($thumb_img_arr)) {
|
|
| 2346 | + foreach ($thumb_img_arr as $img) {
|
|
| 2347 | + //$curImages = $img->src.","; |
|
| 2348 | + } |
|
| 2352 | 2349 | |
| 2353 | - if ($curImages != '') |
|
| 2354 | - $svalue = $curImages; // this will be initial value of the above form field. Image urls. |
|
| 2355 | - else |
|
| 2356 | - $svalue = ''; |
|
| 2357 | - |
|
| 2358 | - $image_limit = $package_info->image_limit; |
|
| 2359 | - $show_image_input_box = ($image_limit != '0'); |
|
| 2360 | - /** |
|
| 2361 | - * Filter to be able to show/hide the image upload section of the add listing form. |
|
| 2362 | - * |
|
| 2363 | - * @since 1.0.0 |
|
| 2364 | - * @param bool $show_image_input_box Set true to show. Set false to not show. |
|
| 2365 | - * @param string $listing_type The custom post type slug. |
|
| 2366 | - */ |
|
| 2367 | - $show_image_input_box = apply_filters('geodir_image_uploader_on_add_listing', $show_image_input_box, $listing_type);
|
|
| 2368 | - if ($show_image_input_box) {
|
|
| 2369 | - ?> |
|
| 2350 | + $totImg = count((array)$thumb_img_arr); |
|
| 2351 | + } |
|
| 2352 | + |
|
| 2353 | + if ($curImages != '') |
|
| 2354 | + $svalue = $curImages; // this will be initial value of the above form field. Image urls. |
|
| 2355 | + else |
|
| 2356 | + $svalue = ''; |
|
| 2357 | + |
|
| 2358 | + $image_limit = $package_info->image_limit; |
|
| 2359 | + $show_image_input_box = ($image_limit != '0'); |
|
| 2360 | + /** |
|
| 2361 | + * Filter to be able to show/hide the image upload section of the add listing form. |
|
| 2362 | + * |
|
| 2363 | + * @since 1.0.0 |
|
| 2364 | + * @param bool $show_image_input_box Set true to show. Set false to not show. |
|
| 2365 | + * @param string $listing_type The custom post type slug. |
|
| 2366 | + */ |
|
| 2367 | + $show_image_input_box = apply_filters('geodir_image_uploader_on_add_listing', $show_image_input_box, $listing_type);
|
|
| 2368 | + if ($show_image_input_box) {
|
|
| 2369 | + ?> |
|
| 2370 | 2370 | |
| 2371 | 2371 | <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT;?> |
| 2372 | 2372 | <?php if ($image_limit == 1) {
|
| 2373 | - echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
|
|
| 2374 | - } ?> |
|
| 2373 | + echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
|
|
| 2374 | + } ?> |
|
| 2375 | 2375 | <?php if ($image_limit > 1) {
|
| 2376 | - echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
|
|
| 2377 | - } ?> |
|
| 2376 | + echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
|
|
| 2377 | + } ?> |
|
| 2378 | 2378 | <?php if ($image_limit == '') {
|
| 2379 | - echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
|
|
| 2380 | - } ?> |
|
| 2379 | + echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
|
|
| 2380 | + } ?> |
|
| 2381 | 2381 | </h5> |
| 2382 | 2382 | |
| 2383 | 2383 | <div class="geodir_form_row clearfix" id="<?php echo $id; ?>dropbox" |
@@ -2415,12 +2415,12 @@ discard block |
||
| 2415 | 2415 | <?php } ?> |
| 2416 | 2416 | |
| 2417 | 2417 | <?php |
| 2418 | - /** |
|
| 2419 | - * Called on the add listing page form for frontend just after the image upload field. |
|
| 2420 | - * |
|
| 2421 | - * @since 1.0.0 |
|
| 2422 | - */ |
|
| 2423 | - do_action('geodir_after_main_form_fields');?>
|
|
| 2418 | + /** |
|
| 2419 | + * Called on the add listing page form for frontend just after the image upload field. |
|
| 2420 | + * |
|
| 2421 | + * @since 1.0.0 |
|
| 2422 | + */ |
|
| 2423 | + do_action('geodir_after_main_form_fields');?>
|
|
| 2424 | 2424 | |
| 2425 | 2425 | |
| 2426 | 2426 | <!-- add captcha code --> |
@@ -2449,7 +2449,7 @@ discard block |
||
| 2449 | 2449 | |
| 2450 | 2450 | </form> |
| 2451 | 2451 | <?php |
| 2452 | - wp_reset_query(); |
|
| 2452 | + wp_reset_query(); |
|
| 2453 | 2453 | } |
| 2454 | 2454 | |
| 2455 | 2455 | /** |
@@ -2460,7 +2460,7 @@ discard block |
||
| 2460 | 2460 | */ |
| 2461 | 2461 | function geodir_add_listing_sidebar_widget_area() |
| 2462 | 2462 | {
|
| 2463 | - dynamic_sidebar('geodir_add_listing_sidebar');
|
|
| 2463 | + dynamic_sidebar('geodir_add_listing_sidebar');
|
|
| 2464 | 2464 | } |
| 2465 | 2465 | |
| 2466 | 2466 | add_action('geodir_add_listing_sidebar_inside', 'geodir_add_listing_sidebar_widget_area', 10);
|
@@ -2475,16 +2475,16 @@ discard block |
||
| 2475 | 2475 | */ |
| 2476 | 2476 | function geodir_action_add_listing_sidebar() |
| 2477 | 2477 | {
|
| 2478 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2479 | - do_action('geodir_sidebar_right_open', 'add-listing-page', 'geodir-sidebar', 'geodir-sidebar-right', 'http://schema.org/WPSideBar');
|
|
| 2480 | - /** |
|
| 2481 | - * This is used to add the content to the add listing page sidebar. |
|
| 2482 | - * |
|
| 2483 | - * @since 1.0.0 |
|
| 2484 | - */ |
|
| 2485 | - do_action('geodir_add_listing_sidebar_inside');
|
|
| 2486 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2487 | - do_action('geodir_sidebar_right_close', 'details-page');
|
|
| 2478 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2479 | + do_action('geodir_sidebar_right_open', 'add-listing-page', 'geodir-sidebar', 'geodir-sidebar-right', 'http://schema.org/WPSideBar');
|
|
| 2480 | + /** |
|
| 2481 | + * This is used to add the content to the add listing page sidebar. |
|
| 2482 | + * |
|
| 2483 | + * @since 1.0.0 |
|
| 2484 | + */ |
|
| 2485 | + do_action('geodir_add_listing_sidebar_inside');
|
|
| 2486 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2487 | + do_action('geodir_sidebar_right_close', 'details-page');
|
|
| 2488 | 2488 | } |
| 2489 | 2489 | |
| 2490 | 2490 | ############################################### |
@@ -2501,11 +2501,11 @@ discard block |
||
| 2501 | 2501 | */ |
| 2502 | 2502 | function geodir_action_geodir_sidebar_signup_top() |
| 2503 | 2503 | {
|
| 2504 | - ?> |
|
| 2504 | + ?> |
|
| 2505 | 2505 | <div |
| 2506 | 2506 | class="<?php |
| 2507 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2508 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
|
|
| 2507 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2508 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
|
|
| 2509 | 2509 | <?php dynamic_sidebar('Reg/Login Top Section');?>
|
| 2510 | 2510 | </div><!-- clearfix ends here--> |
| 2511 | 2511 | <?php |
@@ -2524,9 +2524,9 @@ discard block |
||
| 2524 | 2524 | function geodir_action_signup_forms() |
| 2525 | 2525 | {
|
| 2526 | 2526 | |
| 2527 | - global $user_login; |
|
| 2527 | + global $user_login; |
|
| 2528 | 2528 | |
| 2529 | - ?> |
|
| 2529 | + ?> |
|
| 2530 | 2530 | <script type="text/javascript"> |
| 2531 | 2531 | <?php if ( $user_login ) { ?>
|
| 2532 | 2532 | setTimeout(function () {
|
@@ -2562,65 +2562,65 @@ discard block |
||
| 2562 | 2562 | <?php } ?> |
| 2563 | 2563 | </script><?php |
| 2564 | 2564 | |
| 2565 | - global $errors; |
|
| 2566 | - if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim') |
|
| 2567 | - $errors->add('claim_login', LOGIN_CLAIM);
|
|
| 2568 | - |
|
| 2569 | - if (!empty($errors)) {
|
|
| 2570 | - foreach ($errors as $errorsObj) {
|
|
| 2571 | - foreach ($errorsObj as $key => $val) {
|
|
| 2572 | - for ($i = 0; $i < count($val); $i++) {
|
|
| 2573 | - echo "<div class=sucess_msg>" . $val[$i] . '</div>'; |
|
| 2574 | - $registration_error_msg = 1; |
|
| 2575 | - } |
|
| 2576 | - } |
|
| 2577 | - } |
|
| 2578 | - } |
|
| 2565 | + global $errors; |
|
| 2566 | + if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim') |
|
| 2567 | + $errors->add('claim_login', LOGIN_CLAIM);
|
|
| 2568 | + |
|
| 2569 | + if (!empty($errors)) {
|
|
| 2570 | + foreach ($errors as $errorsObj) {
|
|
| 2571 | + foreach ($errorsObj as $key => $val) {
|
|
| 2572 | + for ($i = 0; $i < count($val); $i++) {
|
|
| 2573 | + echo "<div class=sucess_msg>" . $val[$i] . '</div>'; |
|
| 2574 | + $registration_error_msg = 1; |
|
| 2575 | + } |
|
| 2576 | + } |
|
| 2577 | + } |
|
| 2578 | + } |
|
| 2579 | 2579 | |
| 2580 | - if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_in') {
|
|
| 2581 | - ?> |
|
| 2580 | + if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_in') {
|
|
| 2581 | + ?> |
|
| 2582 | 2582 | |
| 2583 | 2583 | <div class="login_form"> |
| 2584 | 2584 | <?php |
| 2585 | - /** |
|
| 2586 | - * Contains login form template. |
|
| 2587 | - * |
|
| 2588 | - * @since 1.0.0 |
|
| 2589 | - */ |
|
| 2590 | - include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?> |
|
| 2585 | + /** |
|
| 2586 | + * Contains login form template. |
|
| 2587 | + * |
|
| 2588 | + * @since 1.0.0 |
|
| 2589 | + */ |
|
| 2590 | + include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?> |
|
| 2591 | 2591 | </div> |
| 2592 | 2592 | |
| 2593 | 2593 | <?php } elseif (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_up') { ?>
|
| 2594 | 2594 | |
| 2595 | 2595 | <div class="registration_form"> |
| 2596 | 2596 | <?php |
| 2597 | - /** |
|
| 2598 | - * Contains registration form template. |
|
| 2599 | - * |
|
| 2600 | - * @since 1.0.0 |
|
| 2601 | - */ |
|
| 2602 | - include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?> |
|
| 2597 | + /** |
|
| 2598 | + * Contains registration form template. |
|
| 2599 | + * |
|
| 2600 | + * @since 1.0.0 |
|
| 2601 | + */ |
|
| 2602 | + include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?> |
|
| 2603 | 2603 | </div> |
| 2604 | 2604 | |
| 2605 | 2605 | <?php } else { ?>
|
| 2606 | 2606 | |
| 2607 | 2607 | <div class="login_form_l"> |
| 2608 | 2608 | <?php |
| 2609 | - /** |
|
| 2610 | - * Contains login form template. |
|
| 2611 | - * |
|
| 2612 | - * @since 1.0.0 |
|
| 2613 | - */ |
|
| 2614 | - include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?> |
|
| 2609 | + /** |
|
| 2610 | + * Contains login form template. |
|
| 2611 | + * |
|
| 2612 | + * @since 1.0.0 |
|
| 2613 | + */ |
|
| 2614 | + include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?> |
|
| 2615 | 2615 | </div> |
| 2616 | 2616 | <div class="registration_form_r"> |
| 2617 | 2617 | <?php |
| 2618 | - /** |
|
| 2619 | - * Contains registration form template. |
|
| 2620 | - * |
|
| 2621 | - * @since 1.0.0 |
|
| 2622 | - */ |
|
| 2623 | - include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?> |
|
| 2618 | + /** |
|
| 2619 | + * Contains registration form template. |
|
| 2620 | + * |
|
| 2621 | + * @since 1.0.0 |
|
| 2622 | + */ |
|
| 2623 | + include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?> |
|
| 2624 | 2624 | </div> |
| 2625 | 2625 | |
| 2626 | 2626 | <?php }?> |
@@ -2651,66 +2651,66 @@ discard block |
||
| 2651 | 2651 | */ |
| 2652 | 2652 | function geodir_action_author_page_title() |
| 2653 | 2653 | {
|
| 2654 | - global $term; |
|
| 2654 | + global $term; |
|
| 2655 | 2655 | |
| 2656 | - $gd_post_type = geodir_get_current_posttype(); |
|
| 2657 | - $post_type_info = get_post_type_object($gd_post_type); |
|
| 2656 | + $gd_post_type = geodir_get_current_posttype(); |
|
| 2657 | + $post_type_info = get_post_type_object($gd_post_type); |
|
| 2658 | 2658 | |
| 2659 | - $add_string_in_title = __('All', 'geodirectory') . ' ';
|
|
| 2660 | - if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
|
|
| 2661 | - $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
|
|
| 2662 | - } |
|
| 2659 | + $add_string_in_title = __('All', 'geodirectory') . ' ';
|
|
| 2660 | + if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
|
|
| 2661 | + $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
|
|
| 2662 | + } |
|
| 2663 | 2663 | |
| 2664 | - $list_title = $add_string_in_title . $post_type_info->labels->name; |
|
| 2665 | - $single_name = $post_type_info->labels->singular_name; |
|
| 2664 | + $list_title = $add_string_in_title . $post_type_info->labels->name; |
|
| 2665 | + $single_name = $post_type_info->labels->singular_name; |
|
| 2666 | 2666 | |
| 2667 | - $taxonomy = geodir_get_taxonomies($gd_post_type); |
|
| 2667 | + $taxonomy = geodir_get_taxonomies($gd_post_type); |
|
| 2668 | 2668 | |
| 2669 | - if (!empty($term)) {
|
|
| 2670 | - $current_term = get_term_by('slug', $term, $taxonomy[0]);
|
|
| 2671 | - if (!empty($current_term)) |
|
| 2672 | - $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
|
|
| 2673 | - } |
|
| 2669 | + if (!empty($term)) {
|
|
| 2670 | + $current_term = get_term_by('slug', $term, $taxonomy[0]);
|
|
| 2671 | + if (!empty($current_term)) |
|
| 2672 | + $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
|
|
| 2673 | + } |
|
| 2674 | 2674 | |
| 2675 | 2675 | |
| 2676 | - if (is_search()) {
|
|
| 2677 | - $list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
|
|
| 2676 | + if (is_search()) {
|
|
| 2677 | + $list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
|
|
| 2678 | 2678 | |
| 2679 | - } |
|
| 2680 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2681 | - $class = apply_filters('geodir_page_title_class', 'entry-title fn');
|
|
| 2682 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2683 | - $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
|
|
| 2679 | + } |
|
| 2680 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2681 | + $class = apply_filters('geodir_page_title_class', 'entry-title fn');
|
|
| 2682 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2683 | + $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
|
|
| 2684 | 2684 | |
| 2685 | - $title = $list_title; |
|
| 2686 | - if(geodir_is_page('author')){
|
|
| 2687 | - $gd_page = 'author'; |
|
| 2688 | - if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
|
|
| 2689 | - $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
|
|
| 2690 | - }else{
|
|
| 2691 | - $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
|
|
| 2692 | - } |
|
| 2685 | + $title = $list_title; |
|
| 2686 | + if(geodir_is_page('author')){
|
|
| 2687 | + $gd_page = 'author'; |
|
| 2688 | + if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
|
|
| 2689 | + $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
|
|
| 2690 | + }else{
|
|
| 2691 | + $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
|
|
| 2692 | + } |
|
| 2693 | 2693 | |
| 2694 | - } |
|
| 2694 | + } |
|
| 2695 | 2695 | |
| 2696 | 2696 | |
| 2697 | - /** |
|
| 2698 | - * Filter page title to replace variables. |
|
| 2699 | - * |
|
| 2700 | - * @since 1.5.4 |
|
| 2701 | - * @param string $title The page title including variables. |
|
| 2702 | - * @param string $gd_page The GeoDirectory page type if any. |
|
| 2703 | - */ |
|
| 2704 | - $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 2697 | + /** |
|
| 2698 | + * Filter page title to replace variables. |
|
| 2699 | + * |
|
| 2700 | + * @since 1.5.4 |
|
| 2701 | + * @param string $title The page title including variables. |
|
| 2702 | + * @param string $gd_page The GeoDirectory page type if any. |
|
| 2703 | + */ |
|
| 2704 | + $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 2705 | 2705 | |
| 2706 | - echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
|
| 2707 | - /** |
|
| 2708 | - * Filter the author page title text. |
|
| 2709 | - * |
|
| 2710 | - * @since 1.0.0 |
|
| 2711 | - * @param string $list_title The title for the page. |
|
| 2712 | - */ |
|
| 2713 | - apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
|
|
| 2706 | + echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
|
| 2707 | + /** |
|
| 2708 | + * Filter the author page title text. |
|
| 2709 | + * |
|
| 2710 | + * @since 1.0.0 |
|
| 2711 | + * @param string $list_title The title for the page. |
|
| 2712 | + */ |
|
| 2713 | + apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
|
|
| 2714 | 2714 | } |
| 2715 | 2715 | |
| 2716 | 2716 | |
@@ -2728,11 +2728,11 @@ discard block |
||
| 2728 | 2728 | */ |
| 2729 | 2729 | function geodir_action_geodir_sidebar_author_top() |
| 2730 | 2730 | {
|
| 2731 | - if (get_option('geodir_show_author_top_section')) { ?>
|
|
| 2731 | + if (get_option('geodir_show_author_top_section')) { ?>
|
|
| 2732 | 2732 | <div |
| 2733 | 2733 | class="<?php |
| 2734 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2735 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_top'); ?>">
|
|
| 2734 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2735 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_top'); ?>">
|
|
| 2736 | 2736 | <?php dynamic_sidebar('geodir_author_top'); ?>
|
| 2737 | 2737 | </div><!-- clearfix ends here--> |
| 2738 | 2738 | <?php } |
@@ -2748,7 +2748,7 @@ discard block |
||
| 2748 | 2748 | */ |
| 2749 | 2749 | function geodir_author_left_section() |
| 2750 | 2750 | {
|
| 2751 | - if (get_option('geodir_show_author_left_section')) { ?>
|
|
| 2751 | + if (get_option('geodir_show_author_left_section')) { ?>
|
|
| 2752 | 2752 | <div class="geodir-content-left geodir-sidebar-wrap"> |
| 2753 | 2753 | <?php dynamic_sidebar('geodir_author_left_sidebar'); ?>
|
| 2754 | 2754 | </div><!-- end geodir-content-left --> |
@@ -2769,19 +2769,19 @@ discard block |
||
| 2769 | 2769 | */ |
| 2770 | 2770 | function geodir_action_author_sidebar_left() |
| 2771 | 2771 | {
|
| 2772 | - if (get_option('geodir_show_author_left_section')) {
|
|
| 2772 | + if (get_option('geodir_show_author_left_section')) {
|
|
| 2773 | 2773 | // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='') |
| 2774 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2775 | - do_action('geodir_sidebar_left_open', 'author-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
|
|
| 2776 | - /** |
|
| 2777 | - * This is used to add the content to the author page left sidebar (if active). |
|
| 2778 | - * |
|
| 2779 | - * @since 1.0.0 |
|
| 2780 | - */ |
|
| 2781 | - do_action('geodir_author_sidebar_left_inside');
|
|
| 2782 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2783 | - do_action('geodir_sidebar_left_close', 'author-page');
|
|
| 2784 | - } |
|
| 2774 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2775 | + do_action('geodir_sidebar_left_open', 'author-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
|
|
| 2776 | + /** |
|
| 2777 | + * This is used to add the content to the author page left sidebar (if active). |
|
| 2778 | + * |
|
| 2779 | + * @since 1.0.0 |
|
| 2780 | + */ |
|
| 2781 | + do_action('geodir_author_sidebar_left_inside');
|
|
| 2782 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2783 | + do_action('geodir_sidebar_left_close', 'author-page');
|
|
| 2784 | + } |
|
| 2785 | 2785 | } |
| 2786 | 2786 | |
| 2787 | 2787 | /** |
@@ -2794,7 +2794,7 @@ discard block |
||
| 2794 | 2794 | */ |
| 2795 | 2795 | function geodir_author_right_section() |
| 2796 | 2796 | {
|
| 2797 | - if (get_option('geodir_show_author_right_section')) { ?>
|
|
| 2797 | + if (get_option('geodir_show_author_right_section')) { ?>
|
|
| 2798 | 2798 | <div class="geodir-content-right geodir-sidebar-wrap"> |
| 2799 | 2799 | <?php dynamic_sidebar('geodir_author_right_sidebar'); ?>
|
| 2800 | 2800 | </div><!-- end geodir-content-right --> |
@@ -2814,18 +2814,18 @@ discard block |
||
| 2814 | 2814 | */ |
| 2815 | 2815 | function geodir_action_author_sidebar_right() |
| 2816 | 2816 | {
|
| 2817 | - if (get_option('geodir_show_author_right_section')) {
|
|
| 2818 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2819 | - do_action('geodir_sidebar_right_open', 'author-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
|
|
| 2820 | - /** |
|
| 2821 | - * This is used to add the content to the author page right sidebar (if active). |
|
| 2822 | - * |
|
| 2823 | - * @since 1.0.0 |
|
| 2824 | - */ |
|
| 2825 | - do_action('geodir_author_sidebar_right_inside');
|
|
| 2826 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2827 | - do_action('geodir_sidebar_right_close', 'author-page');
|
|
| 2828 | - } |
|
| 2817 | + if (get_option('geodir_show_author_right_section')) {
|
|
| 2818 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2819 | + do_action('geodir_sidebar_right_open', 'author-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
|
|
| 2820 | + /** |
|
| 2821 | + * This is used to add the content to the author page right sidebar (if active). |
|
| 2822 | + * |
|
| 2823 | + * @since 1.0.0 |
|
| 2824 | + */ |
|
| 2825 | + do_action('geodir_author_sidebar_right_inside');
|
|
| 2826 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2827 | + do_action('geodir_sidebar_right_close', 'author-page');
|
|
| 2828 | + } |
|
| 2829 | 2829 | } |
| 2830 | 2830 | |
| 2831 | 2831 | /** |
@@ -2837,14 +2837,14 @@ discard block |
||
| 2837 | 2837 | */ |
| 2838 | 2838 | function geodir_action_author_content_inside() |
| 2839 | 2839 | {
|
| 2840 | - global $gridview_columns; |
|
| 2841 | - $listing_view = get_option('geodir_author_view');
|
|
| 2842 | - if (strstr($listing_view, 'gridview')) {
|
|
| 2843 | - $gridview_columns = $listing_view; |
|
| 2844 | - $listing_view_exp = explode('_', $listing_view);
|
|
| 2845 | - $listing_view = $listing_view_exp[0]; |
|
| 2846 | - } |
|
| 2847 | - geodir_get_template_part('listing', 'listview');
|
|
| 2840 | + global $gridview_columns; |
|
| 2841 | + $listing_view = get_option('geodir_author_view');
|
|
| 2842 | + if (strstr($listing_view, 'gridview')) {
|
|
| 2843 | + $gridview_columns = $listing_view; |
|
| 2844 | + $listing_view_exp = explode('_', $listing_view);
|
|
| 2845 | + $listing_view = $listing_view_exp[0]; |
|
| 2846 | + } |
|
| 2847 | + geodir_get_template_part('listing', 'listview');
|
|
| 2848 | 2848 | } |
| 2849 | 2849 | |
| 2850 | 2850 | add_action('geodir_author_content_inside', 'geodir_action_author_content_inside', 10);
|
@@ -2859,22 +2859,22 @@ discard block |
||
| 2859 | 2859 | */ |
| 2860 | 2860 | function geodir_action_author_content() |
| 2861 | 2861 | {
|
| 2862 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2863 | - do_action('geodir_main_content_open', 'author-page', 'geodir-main-content', 'author-page');
|
|
| 2864 | - echo '<div class="clearfix">'; |
|
| 2865 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2866 | - do_action('geodir_before_listing');
|
|
| 2867 | - echo '</div>'; |
|
| 2868 | - /** |
|
| 2869 | - * This is used to add the content to the author page main content. |
|
| 2870 | - * |
|
| 2871 | - * @since 1.0.0 |
|
| 2872 | - */ |
|
| 2873 | - do_action('geodir_author_content_inside');
|
|
| 2874 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2875 | - do_action('geodir_after_listing');
|
|
| 2876 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2877 | - do_action('geodir_main_content_close', 'author-page');
|
|
| 2862 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2863 | + do_action('geodir_main_content_open', 'author-page', 'geodir-main-content', 'author-page');
|
|
| 2864 | + echo '<div class="clearfix">'; |
|
| 2865 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2866 | + do_action('geodir_before_listing');
|
|
| 2867 | + echo '</div>'; |
|
| 2868 | + /** |
|
| 2869 | + * This is used to add the content to the author page main content. |
|
| 2870 | + * |
|
| 2871 | + * @since 1.0.0 |
|
| 2872 | + */ |
|
| 2873 | + do_action('geodir_author_content_inside');
|
|
| 2874 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2875 | + do_action('geodir_after_listing');
|
|
| 2876 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2877 | + do_action('geodir_main_content_close', 'author-page');
|
|
| 2878 | 2878 | } |
| 2879 | 2879 | |
| 2880 | 2880 | add_action('geodir_sidebar_author_bottom_section', 'geodir_action_sidebar_author_bottom_section', 10);
|
@@ -2888,11 +2888,11 @@ discard block |
||
| 2888 | 2888 | */ |
| 2889 | 2889 | function geodir_action_sidebar_author_bottom_section() |
| 2890 | 2890 | {
|
| 2891 | - if (get_option('geodir_show_author_bottom_section')) { ?>
|
|
| 2891 | + if (get_option('geodir_show_author_bottom_section')) { ?>
|
|
| 2892 | 2892 | <div |
| 2893 | 2893 | class="<?php |
| 2894 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2895 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_bottom'); ?>">
|
|
| 2894 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2895 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_bottom'); ?>">
|
|
| 2896 | 2896 | <?php dynamic_sidebar('geodir_author_bottom'); ?>
|
| 2897 | 2897 | </div><!-- clearfix ends here--> |
| 2898 | 2898 | <?php } |
@@ -2911,23 +2911,23 @@ discard block |
||
| 2911 | 2911 | */ |
| 2912 | 2912 | function geodir_action_search_page_title() |
| 2913 | 2913 | {
|
| 2914 | - $gd_post_type = geodir_get_current_posttype(); |
|
| 2915 | - $post_type_info = get_post_type_object($gd_post_type); |
|
| 2914 | + $gd_post_type = geodir_get_current_posttype(); |
|
| 2915 | + $post_type_info = get_post_type_object($gd_post_type); |
|
| 2916 | 2916 | |
| 2917 | - $pt_name = ''; |
|
| 2918 | - if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
|
|
| 2917 | + $pt_name = ''; |
|
| 2918 | + if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
|
|
| 2919 | 2919 | |
| 2920 | - if (is_search()) {
|
|
| 2921 | - $list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
|
|
| 2920 | + if (is_search()) {
|
|
| 2921 | + $list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
|
|
| 2922 | 2922 | |
| 2923 | - } |
|
| 2924 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2925 | - $class = apply_filters('geodir_page_title_class', 'entry-title fn');
|
|
| 2926 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2927 | - $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
|
|
| 2928 | - echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
|
| 2929 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2930 | - apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
|
|
| 2923 | + } |
|
| 2924 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2925 | + $class = apply_filters('geodir_page_title_class', 'entry-title fn');
|
|
| 2926 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2927 | + $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
|
|
| 2928 | + echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
|
| 2929 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2930 | + apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
|
|
| 2931 | 2931 | } |
| 2932 | 2932 | |
| 2933 | 2933 | // action for adding the listings page top widget area |
@@ -2943,11 +2943,11 @@ discard block |
||
| 2943 | 2943 | */ |
| 2944 | 2944 | function geodir_action_geodir_sidebar_search_top() |
| 2945 | 2945 | {
|
| 2946 | - if (get_option('geodir_show_search_top_section')) { ?>
|
|
| 2946 | + if (get_option('geodir_show_search_top_section')) { ?>
|
|
| 2947 | 2947 | <div |
| 2948 | 2948 | class="<?php |
| 2949 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2950 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_top'); ?>">
|
|
| 2949 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2950 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_top'); ?>">
|
|
| 2951 | 2951 | <?php dynamic_sidebar('geodir_search_top'); ?>
|
| 2952 | 2952 | </div><!-- clearfix ends here--> |
| 2953 | 2953 | <?php } |
@@ -2963,7 +2963,7 @@ discard block |
||
| 2963 | 2963 | */ |
| 2964 | 2964 | function geodir_search_left_section() |
| 2965 | 2965 | {
|
| 2966 | - if (get_option('geodir_show_search_left_section')) { ?>
|
|
| 2966 | + if (get_option('geodir_show_search_left_section')) { ?>
|
|
| 2967 | 2967 | <div class="geodir-content-left geodir-sidebar-wrap"> |
| 2968 | 2968 | <?php dynamic_sidebar('geodir_search_left_sidebar'); ?>
|
| 2969 | 2969 | </div><!-- end geodir-content-left --> |
@@ -2983,19 +2983,19 @@ discard block |
||
| 2983 | 2983 | */ |
| 2984 | 2984 | function geodir_action_search_sidebar_left() |
| 2985 | 2985 | {
|
| 2986 | - if (get_option('geodir_show_search_left_section')) {
|
|
| 2986 | + if (get_option('geodir_show_search_left_section')) {
|
|
| 2987 | 2987 | // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='') |
| 2988 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2989 | - do_action('geodir_sidebar_left_open', 'search-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
|
|
| 2990 | - /** |
|
| 2991 | - * This is used to add the content to the search page left sidebar (if active). |
|
| 2992 | - * |
|
| 2993 | - * @since 1.0.0 |
|
| 2994 | - */ |
|
| 2995 | - do_action('geodir_search_sidebar_left_inside');
|
|
| 2996 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2997 | - do_action('geodir_sidebar_left_close', 'search-page');
|
|
| 2998 | - } |
|
| 2988 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2989 | + do_action('geodir_sidebar_left_open', 'search-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
|
|
| 2990 | + /** |
|
| 2991 | + * This is used to add the content to the search page left sidebar (if active). |
|
| 2992 | + * |
|
| 2993 | + * @since 1.0.0 |
|
| 2994 | + */ |
|
| 2995 | + do_action('geodir_search_sidebar_left_inside');
|
|
| 2996 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2997 | + do_action('geodir_sidebar_left_close', 'search-page');
|
|
| 2998 | + } |
|
| 2999 | 2999 | } |
| 3000 | 3000 | |
| 3001 | 3001 | /** |
@@ -3008,7 +3008,7 @@ discard block |
||
| 3008 | 3008 | */ |
| 3009 | 3009 | function geodir_search_right_section() |
| 3010 | 3010 | {
|
| 3011 | - if (get_option('geodir_show_search_right_section')) { ?>
|
|
| 3011 | + if (get_option('geodir_show_search_right_section')) { ?>
|
|
| 3012 | 3012 | <div class="geodir-content-right geodir-sidebar-wrap"> |
| 3013 | 3013 | <?php dynamic_sidebar('geodir_search_right_sidebar'); ?>
|
| 3014 | 3014 | </div><!-- end geodir-content-right --> |
@@ -3028,18 +3028,18 @@ discard block |
||
| 3028 | 3028 | */ |
| 3029 | 3029 | function geodir_action_search_sidebar_right() |
| 3030 | 3030 | {
|
| 3031 | - if (get_option('geodir_show_search_right_section')) {
|
|
| 3032 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3033 | - do_action('geodir_sidebar_right_open', 'search-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
|
|
| 3034 | - /** |
|
| 3035 | - * This is used to add the content to the search page right sidebar (if active). |
|
| 3036 | - * |
|
| 3037 | - * @since 1.0.0 |
|
| 3038 | - */ |
|
| 3039 | - do_action('geodir_search_sidebar_right_inside');
|
|
| 3040 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3041 | - do_action('geodir_sidebar_right_close', 'search-page');
|
|
| 3042 | - } |
|
| 3031 | + if (get_option('geodir_show_search_right_section')) {
|
|
| 3032 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3033 | + do_action('geodir_sidebar_right_open', 'search-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
|
|
| 3034 | + /** |
|
| 3035 | + * This is used to add the content to the search page right sidebar (if active). |
|
| 3036 | + * |
|
| 3037 | + * @since 1.0.0 |
|
| 3038 | + */ |
|
| 3039 | + do_action('geodir_search_sidebar_right_inside');
|
|
| 3040 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3041 | + do_action('geodir_sidebar_right_close', 'search-page');
|
|
| 3042 | + } |
|
| 3043 | 3043 | } |
| 3044 | 3044 | |
| 3045 | 3045 | |
@@ -3054,11 +3054,11 @@ discard block |
||
| 3054 | 3054 | */ |
| 3055 | 3055 | function geodir_action_sidebar_search_bottom_section() |
| 3056 | 3056 | {
|
| 3057 | - if (get_option('geodir_show_search_bottom_section')) { ?>
|
|
| 3057 | + if (get_option('geodir_show_search_bottom_section')) { ?>
|
|
| 3058 | 3058 | <div |
| 3059 | 3059 | class="<?php |
| 3060 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3061 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_bottom'); ?>">
|
|
| 3060 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3061 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_bottom'); ?>">
|
|
| 3062 | 3062 | <?php dynamic_sidebar('geodir_search_bottom'); ?>
|
| 3063 | 3063 | </div><!-- clearfix ends here--> |
| 3064 | 3064 | <?php } |
@@ -3073,14 +3073,14 @@ discard block |
||
| 3073 | 3073 | */ |
| 3074 | 3074 | function geodir_action_search_content_inside() |
| 3075 | 3075 | {
|
| 3076 | - global $gridview_columns; |
|
| 3077 | - $listing_view = get_option('geodir_search_view');
|
|
| 3078 | - if (strstr($listing_view, 'gridview')) {
|
|
| 3079 | - $gridview_columns = $listing_view; |
|
| 3080 | - $listing_view_exp = explode('_', $listing_view);
|
|
| 3081 | - $listing_view = $listing_view_exp[0]; |
|
| 3082 | - } |
|
| 3083 | - geodir_get_template_part('listing', 'listview');
|
|
| 3076 | + global $gridview_columns; |
|
| 3077 | + $listing_view = get_option('geodir_search_view');
|
|
| 3078 | + if (strstr($listing_view, 'gridview')) {
|
|
| 3079 | + $gridview_columns = $listing_view; |
|
| 3080 | + $listing_view_exp = explode('_', $listing_view);
|
|
| 3081 | + $listing_view = $listing_view_exp[0]; |
|
| 3082 | + } |
|
| 3083 | + geodir_get_template_part('listing', 'listview');
|
|
| 3084 | 3084 | } |
| 3085 | 3085 | |
| 3086 | 3086 | add_action('geodir_search_content_inside', 'geodir_action_search_content_inside', 10);
|
@@ -3096,22 +3096,22 @@ discard block |
||
| 3096 | 3096 | */ |
| 3097 | 3097 | function geodir_action_search_content() |
| 3098 | 3098 | {
|
| 3099 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3100 | - do_action('geodir_main_content_open', 'search-page', 'geodir-main-content', 'search-page');
|
|
| 3101 | - echo '<div class="clearfix">'; |
|
| 3102 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3103 | - do_action('geodir_before_listing');
|
|
| 3104 | - echo '</div>'; |
|
| 3105 | - /** |
|
| 3106 | - * This is used to add the content to the search page main content. |
|
| 3107 | - * |
|
| 3108 | - * @since 1.0.0 |
|
| 3109 | - */ |
|
| 3110 | - do_action('geodir_search_content_inside');
|
|
| 3111 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3112 | - do_action('geodir_after_listing');
|
|
| 3113 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3114 | - do_action('geodir_main_content_close', 'search-page');
|
|
| 3099 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3100 | + do_action('geodir_main_content_open', 'search-page', 'geodir-main-content', 'search-page');
|
|
| 3101 | + echo '<div class="clearfix">'; |
|
| 3102 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3103 | + do_action('geodir_before_listing');
|
|
| 3104 | + echo '</div>'; |
|
| 3105 | + /** |
|
| 3106 | + * This is used to add the content to the search page main content. |
|
| 3107 | + * |
|
| 3108 | + * @since 1.0.0 |
|
| 3109 | + */ |
|
| 3110 | + do_action('geodir_search_content_inside');
|
|
| 3111 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3112 | + do_action('geodir_after_listing');
|
|
| 3113 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3114 | + do_action('geodir_main_content_close', 'search-page');
|
|
| 3115 | 3115 | } |
| 3116 | 3116 | |
| 3117 | 3117 | ############################################### |
@@ -3134,11 +3134,11 @@ discard block |
||
| 3134 | 3134 | */ |
| 3135 | 3135 | function geodir_action_geodir_sidebar_home_top() |
| 3136 | 3136 | {
|
| 3137 | - if (get_option('geodir_show_home_top_section')) { ?>
|
|
| 3137 | + if (get_option('geodir_show_home_top_section')) { ?>
|
|
| 3138 | 3138 | <div |
| 3139 | 3139 | class="<?php |
| 3140 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3141 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_top'); ?>">
|
|
| 3140 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3141 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_top'); ?>">
|
|
| 3142 | 3142 | <?php dynamic_sidebar('geodir_home_top'); ?>
|
| 3143 | 3143 | </div><!-- clearfix ends here--> |
| 3144 | 3144 | <?php } |
@@ -3154,7 +3154,7 @@ discard block |
||
| 3154 | 3154 | */ |
| 3155 | 3155 | function geodir_home_left_section() |
| 3156 | 3156 | {
|
| 3157 | - if (get_option('geodir_show_home_left_section')) { ?>
|
|
| 3157 | + if (get_option('geodir_show_home_left_section')) { ?>
|
|
| 3158 | 3158 | <div class="geodir-content-left geodir-sidebar-wrap"> |
| 3159 | 3159 | <?php dynamic_sidebar('geodir_home_left'); ?>
|
| 3160 | 3160 | </div><!-- end geodir-content-left --> |
@@ -3176,19 +3176,19 @@ discard block |
||
| 3176 | 3176 | */ |
| 3177 | 3177 | function geodir_action_home_sidebar_left() |
| 3178 | 3178 | {
|
| 3179 | - if (get_option('geodir_show_home_left_section')) {
|
|
| 3179 | + if (get_option('geodir_show_home_left_section')) {
|
|
| 3180 | 3180 | // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='') |
| 3181 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3182 | - do_action('geodir_sidebar_left_open', 'home-page', 'geodir-sidebar-left', 'geodir-sidebar geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
|
|
| 3183 | - /** |
|
| 3184 | - * This is used to add the content to the home page left sidebar (if active). |
|
| 3185 | - * |
|
| 3186 | - * @since 1.0.0 |
|
| 3187 | - */ |
|
| 3188 | - do_action('geodir_home_sidebar_left_inside');
|
|
| 3189 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3190 | - do_action('geodir_sidebar_left_close', 'home-page');
|
|
| 3191 | - } |
|
| 3181 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3182 | + do_action('geodir_sidebar_left_open', 'home-page', 'geodir-sidebar-left', 'geodir-sidebar geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
|
|
| 3183 | + /** |
|
| 3184 | + * This is used to add the content to the home page left sidebar (if active). |
|
| 3185 | + * |
|
| 3186 | + * @since 1.0.0 |
|
| 3187 | + */ |
|
| 3188 | + do_action('geodir_home_sidebar_left_inside');
|
|
| 3189 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3190 | + do_action('geodir_sidebar_left_close', 'home-page');
|
|
| 3191 | + } |
|
| 3192 | 3192 | } |
| 3193 | 3193 | |
| 3194 | 3194 | /** |
@@ -3201,7 +3201,7 @@ discard block |
||
| 3201 | 3201 | */ |
| 3202 | 3202 | function geodir_home_right_section() |
| 3203 | 3203 | {
|
| 3204 | - if (get_option('geodir_show_home_right_section')) { ?>
|
|
| 3204 | + if (get_option('geodir_show_home_right_section')) { ?>
|
|
| 3205 | 3205 | <div class="geodir-content-right geodir-sidebar-wrap"> |
| 3206 | 3206 | <?php dynamic_sidebar('geodir_home_right'); ?>
|
| 3207 | 3207 | </div><!-- end geodir-content-right --> |
@@ -3222,18 +3222,18 @@ discard block |
||
| 3222 | 3222 | */ |
| 3223 | 3223 | function geodir_action_home_sidebar_right() |
| 3224 | 3224 | {
|
| 3225 | - if (get_option('geodir_show_home_right_section')) {
|
|
| 3226 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3227 | - do_action('geodir_sidebar_right_open', 'home-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
|
|
| 3228 | - /** |
|
| 3229 | - * This is used to add the content to the home page right sidebar (if active). |
|
| 3230 | - * |
|
| 3231 | - * @since 1.0.0 |
|
| 3232 | - */ |
|
| 3233 | - do_action('geodir_home_sidebar_right_inside');
|
|
| 3234 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3235 | - do_action('geodir_sidebar_right_close', 'home-page');
|
|
| 3236 | - } |
|
| 3225 | + if (get_option('geodir_show_home_right_section')) {
|
|
| 3226 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3227 | + do_action('geodir_sidebar_right_open', 'home-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
|
|
| 3228 | + /** |
|
| 3229 | + * This is used to add the content to the home page right sidebar (if active). |
|
| 3230 | + * |
|
| 3231 | + * @since 1.0.0 |
|
| 3232 | + */ |
|
| 3233 | + do_action('geodir_home_sidebar_right_inside');
|
|
| 3234 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3235 | + do_action('geodir_sidebar_right_close', 'home-page');
|
|
| 3236 | + } |
|
| 3237 | 3237 | } |
| 3238 | 3238 | |
| 3239 | 3239 | /** |
@@ -3244,7 +3244,7 @@ discard block |
||
| 3244 | 3244 | */ |
| 3245 | 3245 | function geodir_action_home_content_inside() |
| 3246 | 3246 | {
|
| 3247 | - dynamic_sidebar('geodir_home_content');
|
|
| 3247 | + dynamic_sidebar('geodir_home_content');
|
|
| 3248 | 3248 | } |
| 3249 | 3249 | |
| 3250 | 3250 | add_action('geodir_home_content_inside', 'geodir_action_home_content_inside', 10);
|
@@ -3259,28 +3259,28 @@ discard block |
||
| 3259 | 3259 | */ |
| 3260 | 3260 | function geodir_action_home_content() |
| 3261 | 3261 | {
|
| 3262 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3263 | - do_action('geodir_main_content_open', 'home-page', 'geodir-main-content', 'home-page');
|
|
| 3264 | - /** |
|
| 3265 | - * This called before the home page main content. |
|
| 3266 | - * |
|
| 3267 | - * @since 1.0.0 |
|
| 3268 | - */ |
|
| 3269 | - do_action('geodir_before_home_content');
|
|
| 3270 | - /** |
|
| 3271 | - * This is used to add the content to the home page main content. |
|
| 3272 | - * |
|
| 3273 | - * @since 1.0.0 |
|
| 3274 | - */ |
|
| 3275 | - do_action('geodir_home_content_inside');
|
|
| 3276 | - /** |
|
| 3277 | - * This is called after the homepage main content. |
|
| 3278 | - * |
|
| 3279 | - * @since 1.0.0 |
|
| 3280 | - */ |
|
| 3281 | - do_action('geodir_after_home_content');
|
|
| 3282 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3283 | - do_action('geodir_main_content_close', 'home-page');
|
|
| 3262 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3263 | + do_action('geodir_main_content_open', 'home-page', 'geodir-main-content', 'home-page');
|
|
| 3264 | + /** |
|
| 3265 | + * This called before the home page main content. |
|
| 3266 | + * |
|
| 3267 | + * @since 1.0.0 |
|
| 3268 | + */ |
|
| 3269 | + do_action('geodir_before_home_content');
|
|
| 3270 | + /** |
|
| 3271 | + * This is used to add the content to the home page main content. |
|
| 3272 | + * |
|
| 3273 | + * @since 1.0.0 |
|
| 3274 | + */ |
|
| 3275 | + do_action('geodir_home_content_inside');
|
|
| 3276 | + /** |
|
| 3277 | + * This is called after the homepage main content. |
|
| 3278 | + * |
|
| 3279 | + * @since 1.0.0 |
|
| 3280 | + */ |
|
| 3281 | + do_action('geodir_after_home_content');
|
|
| 3282 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3283 | + do_action('geodir_main_content_close', 'home-page');
|
|
| 3284 | 3284 | } |
| 3285 | 3285 | |
| 3286 | 3286 | add_action('geodir_sidebar_location_bottom_section', 'geodir_action_sidebar_home_bottom_section', 10);
|
@@ -3295,11 +3295,11 @@ discard block |
||
| 3295 | 3295 | */ |
| 3296 | 3296 | function geodir_action_sidebar_home_bottom_section() |
| 3297 | 3297 | {
|
| 3298 | - if (get_option('geodir_show_home_bottom_section')) { ?>
|
|
| 3298 | + if (get_option('geodir_show_home_bottom_section')) { ?>
|
|
| 3299 | 3299 | <div |
| 3300 | 3300 | class="<?php |
| 3301 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3302 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_bottom'); ?>">
|
|
| 3301 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3302 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_bottom'); ?>">
|
|
| 3303 | 3303 | <?php dynamic_sidebar('geodir_home_bottom'); ?>
|
| 3304 | 3304 | </div><!-- clearfix ends here--> |
| 3305 | 3305 | <?php } |
@@ -3327,13 +3327,13 @@ discard block |
||
| 3327 | 3327 | */ |
| 3328 | 3328 | function geodir_filter_listing_page_title($list_title) |
| 3329 | 3329 | {
|
| 3330 | - if (is_search() && trim(get_search_query()) == '') {
|
|
| 3331 | - $gd_post_type = geodir_get_current_posttype(); |
|
| 3332 | - $post_type_info = get_post_type_object($gd_post_type); |
|
| 3330 | + if (is_search() && trim(get_search_query()) == '') {
|
|
| 3331 | + $gd_post_type = geodir_get_current_posttype(); |
|
| 3332 | + $post_type_info = get_post_type_object($gd_post_type); |
|
| 3333 | 3333 | |
| 3334 | - $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
|
|
| 3335 | - } |
|
| 3336 | - return $list_title; |
|
| 3334 | + $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
|
|
| 3335 | + } |
|
| 3336 | + return $list_title; |
|
| 3337 | 3337 | } |
| 3338 | 3338 | |
| 3339 | 3339 | add_action('geodir_message_not_found_on_listing', 'geodir_display_message_not_found_on_listing');
|
@@ -676,7 +676,7 @@ discard block |
||
| 676 | 676 | } |
| 677 | 677 | } |
| 678 | 678 | |
| 679 | - $post = (object)$_REQUEST; |
|
| 679 | + $post = (object) $_REQUEST; |
|
| 680 | 680 | |
| 681 | 681 | |
| 682 | 682 | if (isset($post->video)) {
|
@@ -1019,7 +1019,7 @@ discard block |
||
| 1019 | 1019 | $height = !empty($sizes) && isset($sizes[1]) ? $sizes[1] : 0; |
| 1020 | 1020 | |
| 1021 | 1021 | if ($image && $width && $height) {
|
| 1022 | - $image = (object)array('src' => $image, 'width' => $width, 'height' => $height);
|
|
| 1022 | + $image = (object) array('src' => $image, 'width' => $width, 'height' => $height);
|
|
| 1023 | 1023 | } |
| 1024 | 1024 | |
| 1025 | 1025 | if (isset($image->src)) {
|
@@ -1052,9 +1052,9 @@ discard block |
||
| 1052 | 1052 | } else {
|
| 1053 | 1053 | $spacer_height = ((400 - $image->height) / 2); |
| 1054 | 1054 | } |
| 1055 | - $caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : ''; |
|
| 1055 | + $caption = ''; //(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : ''; |
|
| 1056 | 1056 | $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />'; |
| 1057 | - $main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>'; |
|
| 1057 | + $main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />' . $caption . '</li>'; |
|
| 1058 | 1058 | $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>'; |
| 1059 | 1059 | $slides++; |
| 1060 | 1060 | } |
@@ -1090,7 +1090,7 @@ discard block |
||
| 1090 | 1090 | */ |
| 1091 | 1091 | function geodir_action_details_taxonomies() |
| 1092 | 1092 | {
|
| 1093 | - global $preview, $post;?> |
|
| 1093 | + global $preview, $post; ?> |
|
| 1094 | 1094 | <p class="geodir_post_taxomomies clearfix"> |
| 1095 | 1095 | <?php |
| 1096 | 1096 | $taxonomies = array(); |
@@ -1168,12 +1168,12 @@ discard block |
||
| 1168 | 1168 | * @param string $tag_link The tag link html. |
| 1169 | 1169 | * @param object $term The tag term object. |
| 1170 | 1170 | */ |
| 1171 | - $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
|
|
| 1171 | + $tag_link = apply_filters('geodir_details_taxonomies_tag_link', $tag_link, $term);
|
|
| 1172 | 1172 | $links[] = $tag_link; |
| 1173 | 1173 | } else {
|
| 1174 | 1174 | $tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>"; |
| 1175 | 1175 | /** This action is documented in geodirectory-template_actions.php */ |
| 1176 | - $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
|
|
| 1176 | + $tag_link = apply_filters('geodir_details_taxonomies_tag_link', $tag_link, $term);
|
|
| 1177 | 1177 | $links[] = $tag_link; |
| 1178 | 1178 | } |
| 1179 | 1179 | $terms[] = $term; |
@@ -1183,7 +1183,7 @@ discard block |
||
| 1183 | 1183 | if (!isset($listing_label)) {
|
| 1184 | 1184 | $listing_label = ''; |
| 1185 | 1185 | } |
| 1186 | - $taxonomies[$post_type . '_tags'] = wp_sprintf('%s: %l', geodir_ucwords($listing_label . ' ' . __('Tags', 'geodirectory')), $links, (object)$terms);
|
|
| 1186 | + $taxonomies[$post_type . '_tags'] = wp_sprintf('%s: %l', geodir_ucwords($listing_label . ' ' . __('Tags', 'geodirectory')), $links, (object) $terms);
|
|
| 1187 | 1187 | endif; |
| 1188 | 1188 | |
| 1189 | 1189 | } |
@@ -1219,7 +1219,7 @@ discard block |
||
| 1219 | 1219 | * @param string $term_link The link html to the category. |
| 1220 | 1220 | * @param object $term The category term object. |
| 1221 | 1221 | */ |
| 1222 | - $term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term);
|
|
| 1222 | + $term_link = apply_filters('geodir_details_taxonomies_cat_link', $term_link, $term);
|
|
| 1223 | 1223 | $links[] = $term_link; |
| 1224 | 1224 | $terms[] = $term; |
| 1225 | 1225 | } |
@@ -1237,7 +1237,7 @@ discard block |
||
| 1237 | 1237 | if (!isset($listing_label)) {
|
| 1238 | 1238 | $listing_label = ''; |
| 1239 | 1239 | } |
| 1240 | - $taxonomies[$post_taxonomy] = wp_sprintf('%s: %l', geodir_ucwords($listing_label . ' ' . __('Category', 'geodirectory')), $links, (object)$terms);
|
|
| 1240 | + $taxonomies[$post_taxonomy] = wp_sprintf('%s: %l', geodir_ucwords($listing_label . ' ' . __('Category', 'geodirectory')), $links, (object) $terms);
|
|
| 1241 | 1241 | |
| 1242 | 1242 | } |
| 1243 | 1243 | |
@@ -1268,11 +1268,11 @@ discard block |
||
| 1268 | 1268 | * @param object $post Optional. The post object or blank. |
| 1269 | 1269 | * @package GeoDirectory |
| 1270 | 1270 | */ |
| 1271 | -function geodir_action_details_micordata($post='') |
|
| 1271 | +function geodir_action_details_micordata($post = '') |
|
| 1272 | 1272 | {
|
| 1273 | 1273 | |
| 1274 | 1274 | global $preview; |
| 1275 | - if(empty($post)){global $post;}
|
|
| 1275 | + if (empty($post)) {global $post; }
|
|
| 1276 | 1276 | if ($preview || !geodir_is_page('detail')) {
|
| 1277 | 1277 | return; |
| 1278 | 1278 | } |
@@ -1293,7 +1293,7 @@ discard block |
||
| 1293 | 1293 | "description" => $review->comment_content, |
| 1294 | 1294 | "reviewRating" => array( |
| 1295 | 1295 | "@type" => "Rating", |
| 1296 | - "bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score. |
|
| 1296 | + "bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score. |
|
| 1297 | 1297 | "ratingValue" => geodir_get_commentoverall($review->comment_ID), |
| 1298 | 1298 | "worstRating" => "1" |
| 1299 | 1299 | ) |
@@ -1321,13 +1321,13 @@ discard block |
||
| 1321 | 1321 | } |
| 1322 | 1322 | //print_r($post); |
| 1323 | 1323 | // external links |
| 1324 | - $external_links = array(); |
|
| 1324 | + $external_links = array(); |
|
| 1325 | 1325 | $external_links[] = $post->geodir_website; |
| 1326 | 1326 | $external_links[] = $post->geodir_twitter; |
| 1327 | 1327 | $external_links[] = $post->geodir_facebook; |
| 1328 | 1328 | $external_links = array_filter($external_links); |
| 1329 | 1329 | |
| 1330 | - if(!empty($external_links)){
|
|
| 1330 | + if (!empty($external_links)) {
|
|
| 1331 | 1331 | $external_links = array_values($external_links); |
| 1332 | 1332 | } |
| 1333 | 1333 | |
@@ -1337,16 +1337,16 @@ discard block |
||
| 1337 | 1337 | |
| 1338 | 1338 | // schema type |
| 1339 | 1339 | $schema_type = 'LocalBusiness'; |
| 1340 | - if(isset($post->default_category) && $post->default_category){
|
|
| 1340 | + if (isset($post->default_category) && $post->default_category) {
|
|
| 1341 | 1341 | $schema_type = get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type); |
| 1342 | - if(!$schema_type && $post->post_type=='gd_event'){$schema_type = 'Event';}
|
|
| 1342 | + if (!$schema_type && $post->post_type == 'gd_event') {$schema_type = 'Event'; }
|
|
| 1343 | 1343 | } |
| 1344 | 1344 | |
| 1345 | 1345 | $schema = array(); |
| 1346 | 1346 | $schema['@context'] = "http://schema.org"; |
| 1347 | 1347 | $schema['@type'] = $schema_type; |
| 1348 | 1348 | $schema['name'] = $post->post_name; |
| 1349 | - $schema['description'] = wp_strip_all_tags( $post->post_content, true ); |
|
| 1349 | + $schema['description'] = wp_strip_all_tags($post->post_content, true); |
|
| 1350 | 1350 | $schema['telephone'] = $post->geodir_contact; |
| 1351 | 1351 | $schema['url'] = $c_url; |
| 1352 | 1352 | $schema['sameAs'] = $external_links; |
@@ -1360,7 +1360,7 @@ discard block |
||
| 1360 | 1360 | "postalCode" => $post->post_zip |
| 1361 | 1361 | ); |
| 1362 | 1362 | |
| 1363 | - if($post->post_latitude && $post->post_longitude) {
|
|
| 1363 | + if ($post->post_latitude && $post->post_longitude) {
|
|
| 1364 | 1364 | $schema['geo'] = array( |
| 1365 | 1365 | "@type" => "GeoCoordinates", |
| 1366 | 1366 | "latitude" => $post->post_latitude, |
@@ -1368,7 +1368,7 @@ discard block |
||
| 1368 | 1368 | ); |
| 1369 | 1369 | } |
| 1370 | 1370 | |
| 1371 | - if($post_avgratings) {
|
|
| 1371 | + if ($post_avgratings) {
|
|
| 1372 | 1372 | $schema['aggregateRating'] = array( |
| 1373 | 1373 | "@type" => "AggregateRating", |
| 1374 | 1374 | "ratingValue" => $post_avgratings, |
@@ -1387,7 +1387,7 @@ discard block |
||
| 1387 | 1387 | * @param array $schema The array of schema data to be filtered. |
| 1388 | 1388 | * @param object $post The post object. |
| 1389 | 1389 | */ |
| 1390 | - $schema = apply_filters('geodir_details_schema', $schema,$post);
|
|
| 1390 | + $schema = apply_filters('geodir_details_schema', $schema, $post);
|
|
| 1391 | 1391 | |
| 1392 | 1392 | |
| 1393 | 1393 | echo '<script type="application/ld+json">' . json_encode($schema) . '</script>'; |
@@ -1595,26 +1595,26 @@ discard block |
||
| 1595 | 1595 | |
| 1596 | 1596 | |
| 1597 | 1597 | $title = $list_title; |
| 1598 | - if(geodir_is_page('pt')){
|
|
| 1598 | + if (geodir_is_page('pt')) {
|
|
| 1599 | 1599 | $gd_page = 'pt'; |
| 1600 | - $title = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
|
|
| 1600 | + $title = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
|
|
| 1601 | 1601 | } |
| 1602 | - elseif(geodir_is_page('listing')){
|
|
| 1602 | + elseif (geodir_is_page('listing')) {
|
|
| 1603 | 1603 | $gd_page = 'listing'; |
| 1604 | 1604 | global $wp_query; |
| 1605 | 1605 | $current_term = $wp_query->get_queried_object(); |
| 1606 | - if (strpos($current_term->taxonomy,'_tags') !== false) {
|
|
| 1606 | + if (strpos($current_term->taxonomy, '_tags') !== false) {
|
|
| 1607 | 1607 | $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
|
| 1608 | - }else{
|
|
| 1608 | + } else {
|
|
| 1609 | 1609 | $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
|
| 1610 | 1610 | } |
| 1611 | 1611 | |
| 1612 | 1612 | } |
| 1613 | - elseif(geodir_is_page('author')){
|
|
| 1613 | + elseif (geodir_is_page('author')) {
|
|
| 1614 | 1614 | $gd_page = 'author'; |
| 1615 | - if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
|
|
| 1615 | + if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
|
|
| 1616 | 1616 | $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
|
| 1617 | - }else{
|
|
| 1617 | + } else {
|
|
| 1618 | 1618 | $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
|
| 1619 | 1619 | } |
| 1620 | 1620 | |
@@ -1628,7 +1628,7 @@ discard block |
||
| 1628 | 1628 | * @param string $title The page title including variables. |
| 1629 | 1629 | * @param string $gd_page The GeoDirectory page type if any. |
| 1630 | 1630 | */ |
| 1631 | - $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 1631 | + $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 1632 | 1632 | |
| 1633 | 1633 | echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
| 1634 | 1634 | /** |
@@ -1673,7 +1673,7 @@ discard block |
||
| 1673 | 1673 | if ($cat_description) {
|
| 1674 | 1674 | ?> |
| 1675 | 1675 | |
| 1676 | - <div class="term_description"><?php echo $cat_description;?></div> <?php |
|
| 1676 | + <div class="term_description"><?php echo $cat_description; ?></div> <?php |
|
| 1677 | 1677 | } |
| 1678 | 1678 | |
| 1679 | 1679 | } |
@@ -1958,7 +1958,7 @@ discard block |
||
| 1958 | 1958 | */ |
| 1959 | 1959 | do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page');
|
| 1960 | 1960 | $extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page');
|
| 1961 | - echo '<div class="clearfix '.$extra_class.'">'; |
|
| 1961 | + echo '<div class="clearfix ' . $extra_class . '">'; |
|
| 1962 | 1962 | /** |
| 1963 | 1963 | * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages. |
| 1964 | 1964 | * |
@@ -2034,11 +2034,11 @@ discard block |
||
| 2034 | 2034 | |
| 2035 | 2035 | $title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
|
| 2036 | 2036 | |
| 2037 | - if(geodir_is_page('add-listing')){
|
|
| 2037 | + if (geodir_is_page('add-listing')) {
|
|
| 2038 | 2038 | $gd_page = 'add-listing'; |
| 2039 | - if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
|
|
| 2039 | + if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 2040 | 2040 | $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
|
| 2041 | - }elseif(isset($listing_type)){
|
|
| 2041 | + }elseif (isset($listing_type)) {
|
|
| 2042 | 2042 | $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
|
| 2043 | 2043 | } |
| 2044 | 2044 | |
@@ -2052,7 +2052,7 @@ discard block |
||
| 2052 | 2052 | * @param string $title The page title including variables. |
| 2053 | 2053 | * @param string $gd_page The GeoDirectory page type if any. |
| 2054 | 2054 | */ |
| 2055 | - $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 2055 | + $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 2056 | 2056 | |
| 2057 | 2057 | echo '<header class="' . $class_header . '"><h1 class="' . $class . '">'; |
| 2058 | 2058 | echo $title; |
@@ -2068,7 +2068,7 @@ discard block |
||
| 2068 | 2068 | */ |
| 2069 | 2069 | function geodir_action_add_listing_page_mandatory() |
| 2070 | 2070 | {?>
|
| 2071 | - <p class="geodir-note "><span class="geodir-required">*</span> <?php echo INDICATES_MANDATORY_FIELDS_TEXT;?></p> |
|
| 2071 | + <p class="geodir-note "><span class="geodir-required">*</span> <?php echo INDICATES_MANDATORY_FIELDS_TEXT; ?></p> |
|
| 2072 | 2072 | <?php |
| 2073 | 2073 | } |
| 2074 | 2074 | |
@@ -2103,7 +2103,7 @@ discard block |
||
| 2103 | 2103 | |
| 2104 | 2104 | if (isset($_REQUEST['backandedit'])) {
|
| 2105 | 2105 | global $post; |
| 2106 | - $post = (object)$gd_session->get('listing');
|
|
| 2106 | + $post = (object) $gd_session->get('listing');
|
|
| 2107 | 2107 | $listing_type = $post->listing_type; |
| 2108 | 2108 | $title = $post->post_title; |
| 2109 | 2109 | $desc = $post->post_desc; |
@@ -2135,15 +2135,15 @@ discard block |
||
| 2135 | 2135 | $user_login = true; |
| 2136 | 2136 | } |
| 2137 | 2137 | ?> |
| 2138 | - <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id());?>" method="post" enctype="multipart/form-data"> |
|
| 2139 | - <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type);?>"/> |
|
| 2140 | - <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type);?>"/> |
|
| 2138 | + <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id()); ?>" method="post" enctype="multipart/form-data"> |
|
| 2139 | + <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type); ?>"/> |
|
| 2140 | + <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type); ?>"/> |
|
| 2141 | 2141 | <?php if ($page_id) { ?>
|
| 2142 | - <input type="hidden" name="add_listing_page_id" value="<?php echo $page_id;?>"/> |
|
| 2142 | + <input type="hidden" name="add_listing_page_id" value="<?php echo $page_id; ?>"/> |
|
| 2143 | 2143 | <?php } if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { ?>
|
| 2144 | - <input type="hidden" name="pid" value="<?php echo sanitize_text_field($_REQUEST['pid']);?>"/> |
|
| 2144 | + <input type="hidden" name="pid" value="<?php echo sanitize_text_field($_REQUEST['pid']); ?>"/> |
|
| 2145 | 2145 | <?php } if (isset($_REQUEST['backandedit'])) { ?>
|
| 2146 | - <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']);?>"/> |
|
| 2146 | + <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']); ?>"/> |
|
| 2147 | 2147 | <?php |
| 2148 | 2148 | } |
| 2149 | 2149 | /** |
@@ -2155,7 +2155,7 @@ discard block |
||
| 2155 | 2155 | */ |
| 2156 | 2156 | do_action('geodir_before_detail_fields');
|
| 2157 | 2157 | ?> |
| 2158 | - <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT;?></h5> |
|
| 2158 | + <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT; ?></h5> |
|
| 2159 | 2159 | <?php |
| 2160 | 2160 | /** |
| 2161 | 2161 | * Called at the top of the add listing page form for frontend. |
@@ -2167,10 +2167,10 @@ discard block |
||
| 2167 | 2167 | do_action('geodir_before_main_form_fields');
|
| 2168 | 2168 | ?> |
| 2169 | 2169 | <div id="geodir_post_title_row" class="required_field geodir_form_row clearfix gd-fieldset-details"> |
| 2170 | - <label><?php echo PLACE_TITLE_TEXT;?><span>*</span> </label> |
|
| 2170 | + <label><?php echo PLACE_TITLE_TEXT; ?><span>*</span> </label> |
|
| 2171 | 2171 | <input type="text" field_type="text" name="post_title" id="post_title" class="geodir_textfield" |
| 2172 | 2172 | value="<?php echo esc_attr(stripslashes($title)); ?>"/> |
| 2173 | - <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory');?></span> |
|
| 2173 | + <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span> |
|
| 2174 | 2174 | </div> |
| 2175 | 2175 | <?php |
| 2176 | 2176 | $show_editor = get_option('geodir_tiny_editor_on_add_listing');
|
@@ -2205,7 +2205,7 @@ discard block |
||
| 2205 | 2205 | $desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
|
| 2206 | 2206 | |
| 2207 | 2207 | $desc_class = ''; |
| 2208 | - if ($desc_limit === '' || (int)$desc_limit > 0) {
|
|
| 2208 | + if ($desc_limit === '' || (int) $desc_limit > 0) {
|
|
| 2209 | 2209 | /** |
| 2210 | 2210 | * Called on the add listing page form for frontend just before the description field. |
| 2211 | 2211 | * |
@@ -2218,8 +2218,8 @@ discard block |
||
| 2218 | 2218 | $desc_class = ' hidden'; |
| 2219 | 2219 | } |
| 2220 | 2220 | ?> |
| 2221 | - <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class;?>"> |
|
| 2222 | - <label><?php echo PLACE_DESC_TEXT;?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
|
|
| 2221 | + <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class; ?>"> |
|
| 2222 | + <label><?php echo PLACE_DESC_TEXT; ?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
|
|
| 2223 | 2223 | <?php |
| 2224 | 2224 | if (!empty($show_editor) && in_array($listing_type, $show_editor)) {
|
| 2225 | 2225 | $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
|
@@ -2228,16 +2228,16 @@ discard block |
||
| 2228 | 2228 | <?php wp_editor($desc, "post_desc", $editor_settings); ?> |
| 2229 | 2229 | </div> |
| 2230 | 2230 | <?php if ($desc_limit != '') { ?>
|
| 2231 | - <script type="text/javascript">jQuery('textarea#post_desc').attr('maxlength', "<?php echo $desc_limit;?>");</script>
|
|
| 2231 | + <script type="text/javascript">jQuery('textarea#post_desc').attr('maxlength', "<?php echo $desc_limit; ?>");</script>
|
|
| 2232 | 2232 | <?php } } else { ?>
|
| 2233 | 2233 | <textarea field_type="textarea" name="post_desc" id="post_desc" class="geodir_textarea" maxlength="<?php echo $desc_limit; ?>"><?php echo $desc; ?></textarea> |
| 2234 | 2234 | <?php } if ($desc_limit_msg != '') { ?>
|
| 2235 | 2235 | <span class="geodir_message_note"><?php echo $desc_limit_msg; ?></span> |
| 2236 | 2236 | <?php } ?> |
| 2237 | - <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory');?></span> |
|
| 2237 | + <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory'); ?></span> |
|
| 2238 | 2238 | </div> |
| 2239 | 2239 | <?php |
| 2240 | - if ($desc_limit === '' || (int)$desc_limit > 0) {
|
|
| 2240 | + if ($desc_limit === '' || (int) $desc_limit > 0) {
|
|
| 2241 | 2241 | /** |
| 2242 | 2242 | * Called on the add listing page form for frontend just after the description field. |
| 2243 | 2243 | * |
@@ -2276,7 +2276,7 @@ discard block |
||
| 2276 | 2276 | $kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
|
| 2277 | 2277 | |
| 2278 | 2278 | $tags_class = ''; |
| 2279 | - if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
|
|
| 2279 | + if ($kw_tags_count === '' || (int) $kw_tags_count > 0) {
|
|
| 2280 | 2280 | /** |
| 2281 | 2281 | * Called on the add listing page form for frontend just before the tags field. |
| 2282 | 2282 | * |
@@ -2287,14 +2287,14 @@ discard block |
||
| 2287 | 2287 | $tags_class = ' hidden'; |
| 2288 | 2288 | } |
| 2289 | 2289 | ?> |
| 2290 | - <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class;?>"> |
|
| 2290 | + <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class; ?>"> |
|
| 2291 | 2291 | <label><?php echo TAGKW_TEXT; ?></label> |
| 2292 | 2292 | <input name="post_tags" id="post_tags" value="<?php echo $kw_tags; ?>" type="text" class="geodir_textfield" |
| 2293 | - maxlength="<?php echo $kw_tags_count;?>"/> |
|
| 2294 | - <span class="geodir_message_note"><?php echo $kw_tags_msg;?></span> |
|
| 2293 | + maxlength="<?php echo $kw_tags_count; ?>"/> |
|
| 2294 | + <span class="geodir_message_note"><?php echo $kw_tags_msg; ?></span> |
|
| 2295 | 2295 | </div> |
| 2296 | 2296 | <?php |
| 2297 | - if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
|
|
| 2297 | + if ($kw_tags_count === '' || (int) $kw_tags_count > 0) {
|
|
| 2298 | 2298 | /** |
| 2299 | 2299 | * Called on the add listing page form for frontend just after the tags field. |
| 2300 | 2300 | * |
@@ -2320,7 +2320,7 @@ discard block |
||
| 2320 | 2320 | $thumb_img_arr = array(); |
| 2321 | 2321 | $totImg = 0; |
| 2322 | 2322 | if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
|
| 2323 | - $post = (object)$gd_session->get('listing');
|
|
| 2323 | + $post = (object) $gd_session->get('listing');
|
|
| 2324 | 2324 | if (isset($post->post_images)) |
| 2325 | 2325 | $curImages = trim($post->post_images, ","); |
| 2326 | 2326 | |
@@ -2333,7 +2333,7 @@ discard block |
||
| 2333 | 2333 | $listing_type = $post->listing_type; |
| 2334 | 2334 | |
| 2335 | 2335 | } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
| 2336 | - $post = geodir_get_post_info((int)$_REQUEST['pid']); |
|
| 2336 | + $post = geodir_get_post_info((int) $_REQUEST['pid']); |
|
| 2337 | 2337 | $listing_type = $post->post_type; |
| 2338 | 2338 | $thumb_img_arr = geodir_get_images($_REQUEST['pid']); |
| 2339 | 2339 | |
@@ -2347,7 +2347,7 @@ discard block |
||
| 2347 | 2347 | //$curImages = $img->src.","; |
| 2348 | 2348 | } |
| 2349 | 2349 | |
| 2350 | - $totImg = count((array)$thumb_img_arr); |
|
| 2350 | + $totImg = count((array) $thumb_img_arr); |
|
| 2351 | 2351 | } |
| 2352 | 2352 | |
| 2353 | 2353 | if ($curImages != '') |
@@ -2368,7 +2368,7 @@ discard block |
||
| 2368 | 2368 | if ($show_image_input_box) {
|
| 2369 | 2369 | ?> |
| 2370 | 2370 | |
| 2371 | - <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT;?> |
|
| 2371 | + <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT; ?> |
|
| 2372 | 2372 | <?php if ($image_limit == 1) {
|
| 2373 | 2373 | echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
|
| 2374 | 2374 | } ?> |
@@ -2391,7 +2391,7 @@ discard block |
||
| 2391 | 2391 | <div |
| 2392 | 2392 | class="plupload-upload-uic hide-if-no-js <?php if ($multiple): ?>plupload-upload-uic-multiple<?php endif; ?>" |
| 2393 | 2393 | id="<?php echo $id; ?>plupload-upload-ui"> |
| 2394 | - <h4><?php _e('Drop files to upload', 'geodirectory');?></h4><br/>
|
|
| 2394 | + <h4><?php _e('Drop files to upload', 'geodirectory'); ?></h4><br/>
|
|
| 2395 | 2395 | <input id="<?php echo $id; ?>plupload-browse-button" type="button" |
| 2396 | 2396 | value="<?php esc_attr_e('Select Files', 'geodirectory'); ?>" class="geodir_button"/>
|
| 2397 | 2397 | <span class="ajaxnonceplu" |
@@ -2408,7 +2408,7 @@ discard block |
||
| 2408 | 2408 | id="<?php echo $id; ?>plupload-thumbs" style="border-top:1px solid #ccc; padding-top:10px;"> |
| 2409 | 2409 | </div> |
| 2410 | 2410 | <span |
| 2411 | - id="upload-msg"><?php _e('Please drag & drop the images to rearrange the order', 'geodirectory');?></span>
|
|
| 2411 | + id="upload-msg"><?php _e('Please drag & drop the images to rearrange the order', 'geodirectory'); ?></span>
|
|
| 2412 | 2412 | <span id="<?php echo $id; ?>upload-error" style="display:none"></span> |
| 2413 | 2413 | </div> |
| 2414 | 2414 | |
@@ -2420,7 +2420,7 @@ discard block |
||
| 2420 | 2420 | * |
| 2421 | 2421 | * @since 1.0.0 |
| 2422 | 2422 | */ |
| 2423 | - do_action('geodir_after_main_form_fields');?>
|
|
| 2423 | + do_action('geodir_after_main_form_fields'); ?>
|
|
| 2424 | 2424 | |
| 2425 | 2425 | |
| 2426 | 2426 | <!-- add captcha code --> |
@@ -2431,7 +2431,7 @@ discard block |
||
| 2431 | 2431 | </script> |
| 2432 | 2432 | <noscript> |
| 2433 | 2433 | <div> |
| 2434 | - <label><?php _e('Type 64 into this box', 'geodirectory');?></label>
|
|
| 2434 | + <label><?php _e('Type 64 into this box', 'geodirectory'); ?></label>
|
|
| 2435 | 2435 | <input type="text" id="geodir_spamblocker_top_form" name="geodir_spamblocker" value="" maxlength="10"/> |
| 2436 | 2436 | </div> |
| 2437 | 2437 | </noscript> |
@@ -2441,10 +2441,10 @@ discard block |
||
| 2441 | 2441 | <!-- end captcha code --> |
| 2442 | 2442 | |
| 2443 | 2443 | <div id="geodir-add-listing-submit" class="geodir_form_row clear_both" style="padding:2px;text-align:center;"> |
| 2444 | - <input type="submit" value="<?php echo PRO_PREVIEW_BUTTON;?>" |
|
| 2445 | - class="geodir_button" <?php echo $submit_button;?>/> |
|
| 2444 | + <input type="submit" value="<?php echo PRO_PREVIEW_BUTTON; ?>" |
|
| 2445 | + class="geodir_button" <?php echo $submit_button; ?>/> |
|
| 2446 | 2446 | <span class="geodir_message_note" |
| 2447 | - style="padding-left:0px;"> <?php _e('Note: You will be able to see a preview in the next page', 'geodirectory');?></span>
|
|
| 2447 | + style="padding-left:0px;"> <?php _e('Note: You will be able to see a preview in the next page', 'geodirectory'); ?></span>
|
|
| 2448 | 2448 | </div> |
| 2449 | 2449 | |
| 2450 | 2450 | </form> |
@@ -2506,7 +2506,7 @@ discard block |
||
| 2506 | 2506 | class="<?php |
| 2507 | 2507 | /** This action is documented in geodirectory_template_actions.php */ |
| 2508 | 2508 | echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
|
| 2509 | - <?php dynamic_sidebar('Reg/Login Top Section');?>
|
|
| 2509 | + <?php dynamic_sidebar('Reg/Login Top Section'); ?>
|
|
| 2510 | 2510 | </div><!-- clearfix ends here--> |
| 2511 | 2511 | <?php |
| 2512 | 2512 | } |
@@ -2528,7 +2528,7 @@ discard block |
||
| 2528 | 2528 | |
| 2529 | 2529 | ?> |
| 2530 | 2530 | <script type="text/javascript"> |
| 2531 | - <?php if ( $user_login ) { ?>
|
|
| 2531 | + <?php if ($user_login) { ?>
|
|
| 2532 | 2532 | setTimeout(function () {
|
| 2533 | 2533 | try {
|
| 2534 | 2534 | d = document.getElementById('user_pass');
|
@@ -2545,7 +2545,7 @@ discard block |
||
| 2545 | 2545 | <?php } ?> |
| 2546 | 2546 | </script> |
| 2547 | 2547 | <script type="text/javascript"> |
| 2548 | - <?php if ( $user_login ) { ?>
|
|
| 2548 | + <?php if ($user_login) { ?>
|
|
| 2549 | 2549 | setTimeout(function () {
|
| 2550 | 2550 | try {
|
| 2551 | 2551 | d = document.getElementById('user_pass');
|
@@ -2683,11 +2683,11 @@ discard block |
||
| 2683 | 2683 | $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
|
| 2684 | 2684 | |
| 2685 | 2685 | $title = $list_title; |
| 2686 | - if(geodir_is_page('author')){
|
|
| 2686 | + if (geodir_is_page('author')) {
|
|
| 2687 | 2687 | $gd_page = 'author'; |
| 2688 | - if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
|
|
| 2688 | + if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
|
|
| 2689 | 2689 | $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
|
| 2690 | - }else{
|
|
| 2690 | + } else {
|
|
| 2691 | 2691 | $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
|
| 2692 | 2692 | } |
| 2693 | 2693 | |
@@ -2701,7 +2701,7 @@ discard block |
||
| 2701 | 2701 | * @param string $title The page title including variables. |
| 2702 | 2702 | * @param string $gd_page The GeoDirectory page type if any. |
| 2703 | 2703 | */ |
| 2704 | - $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 2704 | + $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 2705 | 2705 | |
| 2706 | 2706 | echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
| 2707 | 2707 | /** |
@@ -2915,7 +2915,7 @@ discard block |
||
| 2915 | 2915 | $post_type_info = get_post_type_object($gd_post_type); |
| 2916 | 2916 | |
| 2917 | 2917 | $pt_name = ''; |
| 2918 | - if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
|
|
| 2918 | + if (isset($post_type_info->labels->name)) {$pt_name = $post_type_info->labels->name; }
|
|
| 2919 | 2919 | |
| 2920 | 2920 | if (is_search()) {
|
| 2921 | 2921 | $list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
|
@@ -714,8 +714,9 @@ discard block |
||
| 714 | 714 | |
| 715 | 715 | if (isset($post->post_default_category) && $post->post_default_category == $cat_id) {
|
| 716 | 716 | if ($term_icon_url = get_tax_meta($cat_id, 'ct_cat_icon', false, $post_type)) {
|
| 717 | - if (isset($term_icon_url['src']) && $term_icon_url['src'] != '') |
|
| 718 | - $term_icon = $term_icon_url['src']; |
|
| 717 | + if (isset($term_icon_url['src']) && $term_icon_url['src'] != '') { |
|
| 718 | + $term_icon = $term_icon_url['src']; |
|
| 719 | + } |
|
| 719 | 720 | break; |
| 720 | 721 | } |
| 721 | 722 | } |
@@ -1246,8 +1247,9 @@ discard block |
||
| 1246 | 1247 | echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>'; |
| 1247 | 1248 | } |
| 1248 | 1249 | |
| 1249 | - if (isset($taxonomies[$post_type . '_tags'])) |
|
| 1250 | - echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>'; |
|
| 1250 | + if (isset($taxonomies[$post_type . '_tags'])) { |
|
| 1251 | + echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>'; |
|
| 1252 | + } |
|
| 1251 | 1253 | |
| 1252 | 1254 | ?> |
| 1253 | 1255 | </p><?php |
@@ -1598,23 +1600,21 @@ discard block |
||
| 1598 | 1600 | if(geodir_is_page('pt')){
|
| 1599 | 1601 | $gd_page = 'pt'; |
| 1600 | 1602 | $title = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
|
| 1601 | - } |
|
| 1602 | - elseif(geodir_is_page('listing')){
|
|
| 1603 | + } elseif(geodir_is_page('listing')){
|
|
| 1603 | 1604 | $gd_page = 'listing'; |
| 1604 | 1605 | global $wp_query; |
| 1605 | 1606 | $current_term = $wp_query->get_queried_object(); |
| 1606 | 1607 | if (strpos($current_term->taxonomy,'_tags') !== false) {
|
| 1607 | 1608 | $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
|
| 1608 | - }else{
|
|
| 1609 | + } else{
|
|
| 1609 | 1610 | $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
|
| 1610 | 1611 | } |
| 1611 | 1612 | |
| 1612 | - } |
|
| 1613 | - elseif(geodir_is_page('author')){
|
|
| 1613 | + } elseif(geodir_is_page('author')){
|
|
| 1614 | 1614 | $gd_page = 'author'; |
| 1615 | 1615 | if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
|
| 1616 | 1616 | $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
|
| 1617 | - }else{
|
|
| 1617 | + } else{
|
|
| 1618 | 1618 | $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
|
| 1619 | 1619 | } |
| 1620 | 1620 | |
@@ -2025,8 +2025,9 @@ discard block |
||
| 2025 | 2025 | */ |
| 2026 | 2026 | function geodir_action_add_listing_page_title() |
| 2027 | 2027 | {
|
| 2028 | - if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '') |
|
| 2029 | - $listing_type = sanitize_text_field($_REQUEST['listing_type']); |
|
| 2028 | + if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '') { |
|
| 2029 | + $listing_type = sanitize_text_field($_REQUEST['listing_type']); |
|
| 2030 | + } |
|
| 2030 | 2031 | /** This action is documented in geodirectory_template_actions.php */ |
| 2031 | 2032 | $class = apply_filters('geodir_page_title_class', 'entry-title fn');
|
| 2032 | 2033 | /** This action is documented in geodirectory_template_actions.php */ |
@@ -2038,7 +2039,7 @@ discard block |
||
| 2038 | 2039 | $gd_page = 'add-listing'; |
| 2039 | 2040 | if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
|
| 2040 | 2041 | $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
|
| 2041 | - }elseif(isset($listing_type)){
|
|
| 2042 | + } elseif(isset($listing_type)){
|
|
| 2042 | 2043 | $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
|
| 2043 | 2044 | } |
| 2044 | 2045 | |
@@ -2321,8 +2322,9 @@ discard block |
||
| 2321 | 2322 | $totImg = 0; |
| 2322 | 2323 | if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
|
| 2323 | 2324 | $post = (object)$gd_session->get('listing');
|
| 2324 | - if (isset($post->post_images)) |
|
| 2325 | - $curImages = trim($post->post_images, ","); |
|
| 2325 | + if (isset($post->post_images)) { |
|
| 2326 | + $curImages = trim($post->post_images, ","); |
|
| 2327 | + } |
|
| 2326 | 2328 | |
| 2327 | 2329 | |
| 2328 | 2330 | if ($curImages != '') {
|
@@ -2350,10 +2352,13 @@ discard block |
||
| 2350 | 2352 | $totImg = count((array)$thumb_img_arr); |
| 2351 | 2353 | } |
| 2352 | 2354 | |
| 2353 | - if ($curImages != '') |
|
| 2354 | - $svalue = $curImages; // this will be initial value of the above form field. Image urls. |
|
| 2355 | - else |
|
| 2356 | - $svalue = ''; |
|
| 2355 | + if ($curImages != '') { |
|
| 2356 | + $svalue = $curImages; |
|
| 2357 | + } |
|
| 2358 | + // this will be initial value of the above form field. Image urls. |
|
| 2359 | + else { |
|
| 2360 | + $svalue = ''; |
|
| 2361 | + } |
|
| 2357 | 2362 | |
| 2358 | 2363 | $image_limit = $package_info->image_limit; |
| 2359 | 2364 | $show_image_input_box = ($image_limit != '0'); |
@@ -2563,8 +2568,9 @@ discard block |
||
| 2563 | 2568 | </script><?php |
| 2564 | 2569 | |
| 2565 | 2570 | global $errors; |
| 2566 | - if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim') |
|
| 2567 | - $errors->add('claim_login', LOGIN_CLAIM);
|
|
| 2571 | + if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim') { |
|
| 2572 | + $errors->add('claim_login', LOGIN_CLAIM); |
|
| 2573 | + } |
|
| 2568 | 2574 | |
| 2569 | 2575 | if (!empty($errors)) {
|
| 2570 | 2576 | foreach ($errors as $errorsObj) {
|
@@ -2668,8 +2674,9 @@ discard block |
||
| 2668 | 2674 | |
| 2669 | 2675 | if (!empty($term)) {
|
| 2670 | 2676 | $current_term = get_term_by('slug', $term, $taxonomy[0]);
|
| 2671 | - if (!empty($current_term)) |
|
| 2672 | - $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
|
|
| 2677 | + if (!empty($current_term)) { |
|
| 2678 | + $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'"; |
|
| 2679 | + } |
|
| 2673 | 2680 | } |
| 2674 | 2681 | |
| 2675 | 2682 | |
@@ -2687,7 +2694,7 @@ discard block |
||
| 2687 | 2694 | $gd_page = 'author'; |
| 2688 | 2695 | if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
|
| 2689 | 2696 | $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
|
| 2690 | - }else{
|
|
| 2697 | + } else{
|
|
| 2691 | 2698 | $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
|
| 2692 | 2699 | } |
| 2693 | 2700 | |