@@ -14,37 +14,37 @@ discard block |
||
| 14 | 14 | */ |
| 15 | 15 | class geodir_recent_reviews_widget extends WP_Widget |
| 16 | 16 | {
|
| 17 | - /** |
|
| 17 | + /** |
|
| 18 | 18 | * Register the recent reviews widget. |
| 19 | 19 | * |
| 20 | 20 | * @since 1.0.0 |
| 21 | - * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
|
| 21 | + * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
|
| 22 | 22 | */ |
| 23 | - public function __construct() {
|
|
| 24 | - $widget_ops = array('classname' => 'geodir_recent_reviews', 'description' => __('GD > Recent Reviews', 'geodirectory'));
|
|
| 25 | - parent::__construct( |
|
| 26 | - 'geodir_recent_reviews', // Base ID |
|
| 27 | - __('GD > Recent Reviews', 'geodirectory'), // Name
|
|
| 28 | - $widget_ops// Args |
|
| 29 | - ); |
|
| 30 | - } |
|
| 23 | + public function __construct() {
|
|
| 24 | + $widget_ops = array('classname' => 'geodir_recent_reviews', 'description' => __('GD > Recent Reviews', 'geodirectory'));
|
|
| 25 | + parent::__construct( |
|
| 26 | + 'geodir_recent_reviews', // Base ID |
|
| 27 | + __('GD > Recent Reviews', 'geodirectory'), // Name
|
|
| 28 | + $widget_ops// Args |
|
| 29 | + ); |
|
| 30 | + } |
|
| 31 | 31 | |
| 32 | 32 | /** |
| 33 | 33 | * Front-end display content for recent reviews widget. |
| 34 | 34 | * |
| 35 | 35 | * @since 1.0.0 |
| 36 | - * @since 1.5.1 Declare function public. |
|
| 36 | + * @since 1.5.1 Declare function public. |
|
| 37 | 37 | * |
| 38 | 38 | * @param array $args Widget arguments. |
| 39 | 39 | * @param array $instance Saved values from database. |
| 40 | 40 | */ |
| 41 | 41 | public function widget($args, $instance) |
| 42 | - {
|
|
| 43 | - // prints the widget |
|
| 44 | - extract($args, EXTR_SKIP); |
|
| 42 | + {
|
|
| 43 | + // prints the widget |
|
| 44 | + extract($args, EXTR_SKIP); |
|
| 45 | 45 | |
| 46 | - /** This filter is documented in geodirectory_widgets.php */ |
|
| 47 | - $title = empty($instance['title']) ? '' : apply_filters('widget_title', __($instance['title'], 'geodirectory'));
|
|
| 46 | + /** This filter is documented in geodirectory_widgets.php */ |
|
| 47 | + $title = empty($instance['title']) ? '' : apply_filters('widget_title', __($instance['title'], 'geodirectory'));
|
|
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | 50 | * Filter the number of reviews to display. |
@@ -63,35 +63,35 @@ discard block |
||
| 63 | 63 | * @param int $g_size Height and width of the avatar image in pixels. Default 30. |
| 64 | 64 | */ |
| 65 | 65 | $g_size = apply_filters('geodir_recent_reviews_g_size', 30);
|
| 66 | - /** |
|
| 67 | - * Filter the excerpt length |
|
| 68 | - * |
|
| 69 | - * @since 1.0.0 |
|
| 70 | - * |
|
| 71 | - * @param int $excerpt_length Excerpt length. Default 100. |
|
| 72 | - */ |
|
| 73 | - $excerpt_length = apply_filters('geodir_recent_reviews_excerpt_length', 100);
|
|
| 74 | - $comments_li = geodir_get_recent_reviews($g_size, $count, $excerpt_length, false); |
|
| 66 | + /** |
|
| 67 | + * Filter the excerpt length |
|
| 68 | + * |
|
| 69 | + * @since 1.0.0 |
|
| 70 | + * |
|
| 71 | + * @param int $excerpt_length Excerpt length. Default 100. |
|
| 72 | + */ |
|
| 73 | + $excerpt_length = apply_filters('geodir_recent_reviews_excerpt_length', 100);
|
|
| 74 | + $comments_li = geodir_get_recent_reviews($g_size, $count, $excerpt_length, false); |
|
| 75 | 75 | |
| 76 | - if ($comments_li) {
|
|
| 77 | - echo $before_widget; |
|
| 78 | - ?> |
|
| 76 | + if ($comments_li) {
|
|
| 77 | + echo $before_widget; |
|
| 78 | + ?> |
|
| 79 | 79 | <div class="widget geodir_recent_reviews_section"> |
| 80 | 80 | <?php if ($title) {
|
| 81 | - echo $before_title . $title . $after_title; |
|
| 82 | - } ?> |
|
| 81 | + echo $before_title . $title . $after_title; |
|
| 82 | + } ?> |
|
| 83 | 83 | <ul class="geodir_recent_reviews"><?php echo $comments_li; ?></ul> |
| 84 | 84 | </div> |
| 85 | 85 | <?php |
| 86 | - echo $after_widget; |
|
| 87 | - } |
|
| 88 | - } |
|
| 86 | + echo $after_widget; |
|
| 87 | + } |
|
| 88 | + } |
|
| 89 | 89 | |
| 90 | 90 | /** |
| 91 | 91 | * Sanitize recent reviews widget form values as they are saved. |
| 92 | 92 | * |
| 93 | 93 | * @since 1.0.0 |
| 94 | - * @since 1.5.1 Declare function public. |
|
| 94 | + * @since 1.5.1 Declare function public. |
|
| 95 | 95 | * |
| 96 | 96 | * @param array $new_instance Values just sent to be saved. |
| 97 | 97 | * @param array $old_instance Previously saved values from database. |
@@ -99,29 +99,29 @@ discard block |
||
| 99 | 99 | * @return array Updated safe values to be saved. |
| 100 | 100 | */ |
| 101 | 101 | public function update($new_instance, $old_instance) |
| 102 | - {
|
|
| 103 | - //save the widget |
|
| 104 | - $instance = $old_instance; |
|
| 105 | - $instance['title'] = strip_tags($new_instance['title']); |
|
| 106 | - $instance['count'] = strip_tags($new_instance['count']); |
|
| 107 | - return $instance; |
|
| 108 | - } |
|
| 102 | + {
|
|
| 103 | + //save the widget |
|
| 104 | + $instance = $old_instance; |
|
| 105 | + $instance['title'] = strip_tags($new_instance['title']); |
|
| 106 | + $instance['count'] = strip_tags($new_instance['count']); |
|
| 107 | + return $instance; |
|
| 108 | + } |
|
| 109 | 109 | |
| 110 | 110 | /** |
| 111 | 111 | * Back-end recent reviews widget settings form. |
| 112 | 112 | * |
| 113 | 113 | * @since 1.0.0 |
| 114 | - * @since 1.5.1 Declare function public. |
|
| 114 | + * @since 1.5.1 Declare function public. |
|
| 115 | 115 | * |
| 116 | 116 | * @param array $instance Previously saved values from database. |
| 117 | 117 | */ |
| 118 | 118 | public function form($instance) |
| 119 | - {
|
|
| 120 | - //widgetform in backend |
|
| 121 | - $instance = wp_parse_args((array)$instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'count' => ''));
|
|
| 122 | - $title = strip_tags($instance['title']); |
|
| 123 | - $count = strip_tags($instance['count']); |
|
| 124 | - ?> |
|
| 119 | + {
|
|
| 120 | + //widgetform in backend |
|
| 121 | + $instance = wp_parse_args((array)$instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'count' => ''));
|
|
| 122 | + $title = strip_tags($instance['title']); |
|
| 123 | + $count = strip_tags($instance['count']); |
|
| 124 | + ?> |
|
| 125 | 125 | <p><label for="<?php echo $this->get_field_id('title'); ?>">Widget Title: <input class="widefat"
|
| 126 | 126 | id="<?php echo $this->get_field_id('title'); ?>"
|
| 127 | 127 | name="<?php echo $this->get_field_name('title'); ?>"
|
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | value="<?php echo esc_attr($count); ?>"/></label> |
| 136 | 136 | </p> |
| 137 | 137 | <?php |
| 138 | - } |
|
| 138 | + } |
|
| 139 | 139 | } // class geodir_recent_reviews_widget |
| 140 | 140 | |
| 141 | 141 | register_widget('geodir_recent_reviews_widget'); |
| 142 | 142 | \ No newline at end of file |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | ?> |
| 79 | 79 | <div class="widget geodir_recent_reviews_section"> |
| 80 | 80 | <?php if ($title) {
|
| 81 | - echo $before_title . $title . $after_title; |
|
| 81 | + echo $before_title.$title.$after_title; |
|
| 82 | 82 | } ?> |
| 83 | 83 | <ul class="geodir_recent_reviews"><?php echo $comments_li; ?></ul> |
| 84 | 84 | </div> |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | public function form($instance) |
| 119 | 119 | {
|
| 120 | 120 | //widgetform in backend |
| 121 | - $instance = wp_parse_args((array)$instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'count' => ''));
|
|
| 121 | + $instance = wp_parse_args((array) $instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'count' => ''));
|
|
| 122 | 122 | $title = strip_tags($instance['title']); |
| 123 | 123 | $count = strip_tags($instance['count']); |
| 124 | 124 | ?> |
@@ -245,13 +245,14 @@ discard block |
||
| 245 | 245 | */ |
| 246 | 246 | function geodir_add_async_forscript($url) |
| 247 | 247 | {
|
| 248 | - if (strpos($url, '#asyncload')===false) |
|
| 249 | - return $url; |
|
| 250 | - else if (is_admin()) |
|
| 251 | - return str_replace('#asyncload', '', $url);
|
|
| 252 | - else |
|
| 253 | - return str_replace('#asyncload', '', $url)."' async='async";
|
|
| 254 | -} |
|
| 248 | + if (strpos($url, '#asyncload')===false) { |
|
| 249 | + return $url; |
|
| 250 | + } else if (is_admin()) { |
|
| 251 | + return str_replace('#asyncload', '', $url); |
|
| 252 | + } else { |
|
| 253 | + return str_replace('#asyncload', '', $url)."' async='async"; |
|
| 254 | + } |
|
| 255 | + } |
|
| 255 | 256 | add_filter('clean_url', 'geodir_add_async_forscript', 11, 1);
|
| 256 | 257 | |
| 257 | 258 | /** |
@@ -298,7 +299,7 @@ discard block |
||
| 298 | 299 | wp_register_style('geodir-chosen-style', geodir_plugin_url() . '/geodirectory-assets/css/chosen.css', array(), GEODIRECTORY_VERSION);
|
| 299 | 300 | wp_enqueue_style('geodir-chosen-style');
|
| 300 | 301 | |
| 301 | - }else{
|
|
| 302 | + } else{
|
|
| 302 | 303 | wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
|
| 303 | 304 | wp_enqueue_style('geodir-core-scss');
|
| 304 | 305 | |
@@ -359,8 +360,10 @@ discard block |
||
| 359 | 360 | |
| 360 | 361 | $half_pages_to_show = round($pages_to_show / 2); |
| 361 | 362 | |
| 362 | - if (geodir_is_page('home') || (get_option('geodir_set_as_home') && is_home())) // dont apply default pagination for geodirectory home page.
|
|
| 363 | - return; |
|
| 363 | + if (geodir_is_page('home') || (get_option('geodir_set_as_home') && is_home())) { |
|
| 364 | + // dont apply default pagination for geodirectory home page. |
|
| 365 | + return; |
|
| 366 | + } |
|
| 364 | 367 | |
| 365 | 368 | if (!is_single()) {
|
| 366 | 369 | if (function_exists('geodir_location_geo_home_link')) {
|
@@ -433,11 +436,21 @@ discard block |
||
| 433 | 436 | } |
| 434 | 437 | $dist_dif = 1000; |
| 435 | 438 | |
| 436 | - if ($dist <= 5000) $dist_dif = 500; |
|
| 437 | - if ($dist <= 1000) $dist_dif = 100; |
|
| 438 | - if ($dist <= 500) $dist_dif = 50; |
|
| 439 | - if ($dist <= 100) $dist_dif = 10; |
|
| 440 | - if ($dist <= 50) $dist_dif = 5; |
|
| 439 | + if ($dist <= 5000) { |
|
| 440 | + $dist_dif = 500; |
|
| 441 | + } |
|
| 442 | + if ($dist <= 1000) { |
|
| 443 | + $dist_dif = 100; |
|
| 444 | + } |
|
| 445 | + if ($dist <= 500) { |
|
| 446 | + $dist_dif = 50; |
|
| 447 | + } |
|
| 448 | + if ($dist <= 100) { |
|
| 449 | + $dist_dif = 10; |
|
| 450 | + } |
|
| 451 | + if ($dist <= 50) { |
|
| 452 | + $dist_dif = 5; |
|
| 453 | + } |
|
| 441 | 454 | |
| 442 | 455 | ?> |
| 443 | 456 | <script type="text/javascript"> |
@@ -499,18 +512,23 @@ discard block |
||
| 499 | 512 | {
|
| 500 | 513 | |
| 501 | 514 | $default_search_for_text = SEARCH_FOR_TEXT; |
| 502 | - if (get_option('geodir_search_field_default_text'))
|
|
| 503 | - $default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory');
|
|
| 515 | + if (get_option('geodir_search_field_default_text')) { |
|
| 516 | + $default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory'); |
|
| 517 | + } |
|
| 504 | 518 | |
| 505 | 519 | $default_near_text = NEAR_TEXT; |
| 506 | - if (get_option('geodir_near_field_default_text'))
|
|
| 507 | - $default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory');
|
|
| 520 | + if (get_option('geodir_near_field_default_text')) { |
|
| 521 | + $default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory'); |
|
| 522 | + } |
|
| 508 | 523 | |
| 509 | 524 | ?> |
| 510 | 525 | |
| 511 | 526 | |
| 512 | 527 | <script type="text/javascript"> |
| 513 | - var default_location = '<?php if($search_location = geodir_get_default_location()) echo $search_location->city ;?>'; |
|
| 528 | + var default_location = '<?php if($search_location = geodir_get_default_location()) { |
|
| 529 | + echo $search_location->city ; |
|
| 530 | +} |
|
| 531 | +?>'; |
|
| 514 | 532 | var latlng; |
| 515 | 533 | var Sgeocoder; |
| 516 | 534 | var address; |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | */ |
| 23 | 23 | function geodir_core_dequeue_script() |
| 24 | 24 | {
|
| 25 | - wp_dequeue_script('flexslider');
|
|
| 25 | + wp_dequeue_script('flexslider');
|
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | add_action('wp_print_scripts', 'geodir_core_dequeue_script', 100);
|
@@ -35,143 +35,143 @@ discard block |
||
| 35 | 35 | */ |
| 36 | 36 | function geodir_templates_scripts() |
| 37 | 37 | {
|
| 38 | - $is_detail_page = false; |
|
| 39 | - |
|
| 40 | - if((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview') )) {
|
|
| 41 | - $is_detail_page = true; |
|
| 42 | - } |
|
| 43 | - |
|
| 44 | - wp_enqueue_script('jquery');
|
|
| 45 | - |
|
| 46 | - wp_register_script('geodirectory-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory.min.js#asyncload', array(), GEODIRECTORY_VERSION);
|
|
| 47 | - wp_enqueue_script('geodirectory-script');
|
|
| 48 | - |
|
| 49 | - |
|
| 50 | - $geodir_vars_data = array( |
|
| 51 | - 'siteurl' => get_option('siteurl'),
|
|
| 52 | - 'geodir_plugin_url' => geodir_plugin_url(), |
|
| 53 | - 'geodir_ajax_url' => geodir_get_ajax_url(), |
|
| 54 | - 'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'),
|
|
| 55 | - 'is_rtl' => is_rtl() ? 1 : 0 // fix rtl issue |
|
| 56 | - ); |
|
| 57 | - |
|
| 58 | - /** |
|
| 59 | - * Filter the `geodir_var` data array that outputs the wp_localize_script() translations and variables. |
|
| 60 | - * |
|
| 61 | - * This is used by addons to add JS translatable variables. |
|
| 62 | - * |
|
| 63 | - * @since 1.4.4 |
|
| 64 | - * @param array $geodir_vars_data {
|
|
| 65 | - * geodir var data used by addons to add JS translatable variables. |
|
| 66 | - * |
|
| 67 | - * @type string $siteurl Site url. |
|
| 68 | - * @type string $geodir_plugin_url Geodirectory core plugin url. |
|
| 69 | - * @type string $geodir_ajax_url Geodirectory plugin ajax url. |
|
| 70 | - * @type int $geodir_gd_modal Disable GD modal that displays slideshow images in popup?. |
|
| 71 | - * @type int $is_rtl Checks if current locale is RTL. |
|
| 72 | - * |
|
| 73 | - * } |
|
| 74 | - */ |
|
| 75 | - $geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data);
|
|
| 76 | - |
|
| 77 | - wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data);
|
|
| 78 | - |
|
| 79 | - wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION,true);
|
|
| 80 | - if($is_detail_page){wp_enqueue_script('geodirectory-jquery-flexslider-js');}
|
|
| 81 | - |
|
| 82 | - wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true);
|
|
| 83 | - wp_enqueue_script('geodirectory-lightbox-jquery');
|
|
| 84 | - |
|
| 85 | - wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true);
|
|
| 86 | - if ($is_detail_page) {
|
|
| 87 | - wp_enqueue_script('geodirectory-jquery-simplemodal');
|
|
| 88 | - } |
|
| 89 | - |
|
| 90 | - $map_lang = "&language=" . geodir_get_map_default_language(); |
|
| 91 | - /** |
|
| 92 | - * Filter the variables that are added to the end of the google maps script call. |
|
| 93 | - * |
|
| 94 | - * This i used to change things like google maps language etc. |
|
| 95 | - * |
|
| 96 | - * @since 1.0.0 |
|
| 97 | - * @param string $var The string to filter, default is empty string. |
|
| 98 | - */ |
|
| 99 | - $map_extra = apply_filters('geodir_googlemap_script_extra', '');
|
|
| 100 | - wp_enqueue_script('geodirectory-googlemap-script', '//maps.google.com/maps/api/js?' . $map_lang . $map_extra, '', NULL);
|
|
| 38 | + $is_detail_page = false; |
|
| 39 | + |
|
| 40 | + if((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview') )) {
|
|
| 41 | + $is_detail_page = true; |
|
| 42 | + } |
|
| 43 | + |
|
| 44 | + wp_enqueue_script('jquery');
|
|
| 45 | + |
|
| 46 | + wp_register_script('geodirectory-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory.min.js#asyncload', array(), GEODIRECTORY_VERSION);
|
|
| 47 | + wp_enqueue_script('geodirectory-script');
|
|
| 48 | + |
|
| 49 | + |
|
| 50 | + $geodir_vars_data = array( |
|
| 51 | + 'siteurl' => get_option('siteurl'),
|
|
| 52 | + 'geodir_plugin_url' => geodir_plugin_url(), |
|
| 53 | + 'geodir_ajax_url' => geodir_get_ajax_url(), |
|
| 54 | + 'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'),
|
|
| 55 | + 'is_rtl' => is_rtl() ? 1 : 0 // fix rtl issue |
|
| 56 | + ); |
|
| 57 | + |
|
| 58 | + /** |
|
| 59 | + * Filter the `geodir_var` data array that outputs the wp_localize_script() translations and variables. |
|
| 60 | + * |
|
| 61 | + * This is used by addons to add JS translatable variables. |
|
| 62 | + * |
|
| 63 | + * @since 1.4.4 |
|
| 64 | + * @param array $geodir_vars_data {
|
|
| 65 | + * geodir var data used by addons to add JS translatable variables. |
|
| 66 | + * |
|
| 67 | + * @type string $siteurl Site url. |
|
| 68 | + * @type string $geodir_plugin_url Geodirectory core plugin url. |
|
| 69 | + * @type string $geodir_ajax_url Geodirectory plugin ajax url. |
|
| 70 | + * @type int $geodir_gd_modal Disable GD modal that displays slideshow images in popup?. |
|
| 71 | + * @type int $is_rtl Checks if current locale is RTL. |
|
| 72 | + * |
|
| 73 | + * } |
|
| 74 | + */ |
|
| 75 | + $geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data);
|
|
| 76 | + |
|
| 77 | + wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data);
|
|
| 78 | + |
|
| 79 | + wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION,true);
|
|
| 80 | + if($is_detail_page){wp_enqueue_script('geodirectory-jquery-flexslider-js');}
|
|
| 81 | + |
|
| 82 | + wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true);
|
|
| 83 | + wp_enqueue_script('geodirectory-lightbox-jquery');
|
|
| 84 | + |
|
| 85 | + wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true);
|
|
| 86 | + if ($is_detail_page) {
|
|
| 87 | + wp_enqueue_script('geodirectory-jquery-simplemodal');
|
|
| 88 | + } |
|
| 89 | + |
|
| 90 | + $map_lang = "&language=" . geodir_get_map_default_language(); |
|
| 91 | + /** |
|
| 92 | + * Filter the variables that are added to the end of the google maps script call. |
|
| 93 | + * |
|
| 94 | + * This i used to change things like google maps language etc. |
|
| 95 | + * |
|
| 96 | + * @since 1.0.0 |
|
| 97 | + * @param string $var The string to filter, default is empty string. |
|
| 98 | + */ |
|
| 99 | + $map_extra = apply_filters('geodir_googlemap_script_extra', '');
|
|
| 100 | + wp_enqueue_script('geodirectory-googlemap-script', '//maps.google.com/maps/api/js?' . $map_lang . $map_extra, '', NULL);
|
|
| 101 | 101 | |
| 102 | - wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true);
|
|
| 103 | - wp_enqueue_script('geodirectory-goMap-script');
|
|
| 104 | - |
|
| 105 | - |
|
| 106 | - wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 107 | - wp_enqueue_script('chosen');
|
|
| 108 | - |
|
| 109 | - wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 110 | - wp_enqueue_script('geodirectory-choose-ajax');
|
|
| 111 | - |
|
| 112 | - wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.min.js#asyncload', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
|
|
| 113 | - |
|
| 114 | - if (is_page() && geodir_is_page('add-listing')) {
|
|
| 115 | - // SCRIPT FOR UPLOAD |
|
| 116 | - wp_enqueue_script('plupload-all');
|
|
| 117 | - wp_enqueue_script('jquery-ui-sortable');
|
|
| 118 | - |
|
| 119 | - wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true);
|
|
| 120 | - wp_enqueue_script('geodirectory-plupload-script');
|
|
| 121 | - // SCRIPT FOR UPLOAD END |
|
| 122 | - |
|
| 123 | - // 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 |
|
| 124 | - if (str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
|
|
| 125 | - $ajax_url = admin_url('admin-ajax.php');
|
|
| 126 | - } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
|
|
| 127 | - $ajax_url = admin_url('admin-ajax.php');
|
|
| 128 | - } elseif (str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
|
|
| 129 | - $ajax_url = str_replace("https", "http", admin_url('admin-ajax.php'));
|
|
| 130 | - } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
|
|
| 131 | - $ajax_url = str_replace("http", "https", admin_url('admin-ajax.php'));
|
|
| 132 | - } else {
|
|
| 133 | - $ajax_url = admin_url('admin-ajax.php');
|
|
| 134 | - } |
|
| 102 | + wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true);
|
|
| 103 | + wp_enqueue_script('geodirectory-goMap-script');
|
|
| 104 | + |
|
| 105 | + |
|
| 106 | + wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 107 | + wp_enqueue_script('chosen');
|
|
| 108 | + |
|
| 109 | + wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 110 | + wp_enqueue_script('geodirectory-choose-ajax');
|
|
| 111 | + |
|
| 112 | + wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.min.js#asyncload', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
|
|
| 113 | + |
|
| 114 | + if (is_page() && geodir_is_page('add-listing')) {
|
|
| 115 | + // SCRIPT FOR UPLOAD |
|
| 116 | + wp_enqueue_script('plupload-all');
|
|
| 117 | + wp_enqueue_script('jquery-ui-sortable');
|
|
| 118 | + |
|
| 119 | + wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true);
|
|
| 120 | + wp_enqueue_script('geodirectory-plupload-script');
|
|
| 121 | + // SCRIPT FOR UPLOAD END |
|
| 122 | + |
|
| 123 | + // 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 |
|
| 124 | + if (str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
|
|
| 125 | + $ajax_url = admin_url('admin-ajax.php');
|
|
| 126 | + } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
|
|
| 127 | + $ajax_url = admin_url('admin-ajax.php');
|
|
| 128 | + } elseif (str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
|
|
| 129 | + $ajax_url = str_replace("https", "http", admin_url('admin-ajax.php'));
|
|
| 130 | + } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
|
|
| 131 | + $ajax_url = str_replace("http", "https", admin_url('admin-ajax.php'));
|
|
| 132 | + } else {
|
|
| 133 | + $ajax_url = admin_url('admin-ajax.php');
|
|
| 134 | + } |
|
| 135 | 135 | |
| 136 | - // place js config array for plupload |
|
| 137 | - $plupload_init = array( |
|
| 138 | - 'runtimes' => 'html5,silverlight,flash,browserplus,gears,html4', |
|
| 139 | - 'browse_button' => 'plupload-browse-button', // will be adjusted per uploader |
|
| 140 | - 'container' => 'plupload-upload-ui', // will be adjusted per uploader |
|
| 141 | - 'drop_element' => 'dropbox', // will be adjusted per uploader |
|
| 142 | - 'file_data_name' => 'async-upload', // will be adjusted per uploader |
|
| 143 | - 'multiple_queues' => true, |
|
| 144 | - 'max_file_size' => geodir_max_upload_size(), |
|
| 145 | - 'url' => $ajax_url, |
|
| 146 | - 'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'),
|
|
| 147 | - 'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'),
|
|
| 148 | - 'filters' => array(array('title' => __('Allowed Files', 'geodirectory'), 'extensions' => '*')),
|
|
| 149 | - 'multipart' => true, |
|
| 150 | - 'urlstream_upload' => true, |
|
| 151 | - 'multi_selection' => false, // will be added per uploader |
|
| 152 | - // additional post data to send to our ajax hook |
|
| 153 | - 'multipart_params' => array( |
|
| 154 | - '_ajax_nonce' => "", // will be added per uploader |
|
| 155 | - 'action' => 'plupload_action', // the ajax action name |
|
| 156 | - 'imgid' => 0 // will be added per uploader |
|
| 157 | - ) |
|
| 158 | - ); |
|
| 159 | - $base_plupload_config = json_encode($plupload_init); |
|
| 160 | - |
|
| 161 | - $gd_plupload_init = array('base_plupload_config' => $base_plupload_config,
|
|
| 162 | - 'upload_img_size' => geodir_max_upload_size()); |
|
| 163 | - |
|
| 164 | - wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init);
|
|
| 165 | - |
|
| 166 | - wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation.min.js#asyncload');
|
|
| 167 | - } // End if for add place page |
|
| 168 | - |
|
| 169 | - wp_register_script('geodirectory-post-custom-js', geodir_plugin_url() . '/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
|
|
| 170 | - if ($is_detail_page) {
|
|
| 136 | + // place js config array for plupload |
|
| 137 | + $plupload_init = array( |
|
| 138 | + 'runtimes' => 'html5,silverlight,flash,browserplus,gears,html4', |
|
| 139 | + 'browse_button' => 'plupload-browse-button', // will be adjusted per uploader |
|
| 140 | + 'container' => 'plupload-upload-ui', // will be adjusted per uploader |
|
| 141 | + 'drop_element' => 'dropbox', // will be adjusted per uploader |
|
| 142 | + 'file_data_name' => 'async-upload', // will be adjusted per uploader |
|
| 143 | + 'multiple_queues' => true, |
|
| 144 | + 'max_file_size' => geodir_max_upload_size(), |
|
| 145 | + 'url' => $ajax_url, |
|
| 146 | + 'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'),
|
|
| 147 | + 'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'),
|
|
| 148 | + 'filters' => array(array('title' => __('Allowed Files', 'geodirectory'), 'extensions' => '*')),
|
|
| 149 | + 'multipart' => true, |
|
| 150 | + 'urlstream_upload' => true, |
|
| 151 | + 'multi_selection' => false, // will be added per uploader |
|
| 152 | + // additional post data to send to our ajax hook |
|
| 153 | + 'multipart_params' => array( |
|
| 154 | + '_ajax_nonce' => "", // will be added per uploader |
|
| 155 | + 'action' => 'plupload_action', // the ajax action name |
|
| 156 | + 'imgid' => 0 // will be added per uploader |
|
| 157 | + ) |
|
| 158 | + ); |
|
| 159 | + $base_plupload_config = json_encode($plupload_init); |
|
| 160 | + |
|
| 161 | + $gd_plupload_init = array('base_plupload_config' => $base_plupload_config,
|
|
| 162 | + 'upload_img_size' => geodir_max_upload_size()); |
|
| 163 | + |
|
| 164 | + wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init);
|
|
| 165 | + |
|
| 166 | + wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation.min.js#asyncload');
|
|
| 167 | + } // End if for add place page |
|
| 168 | + |
|
| 169 | + wp_register_script('geodirectory-post-custom-js', geodir_plugin_url() . '/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
|
|
| 170 | + if ($is_detail_page) {
|
|
| 171 | 171 | wp_enqueue_script('geodirectory-post-custom-js');
|
| 172 | 172 | } |
| 173 | 173 | |
| 174 | - // font awesome rating script |
|
| 174 | + // font awesome rating script |
|
| 175 | 175 | if (get_option('geodir_reviewrating_enable_font_awesome')) {
|
| 176 | 176 | wp_register_script('geodir-barrating-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true);
|
| 177 | 177 | wp_enqueue_script('geodir-barrating-js');
|
@@ -180,11 +180,11 @@ discard block |
||
| 180 | 180 | wp_enqueue_script('geodir-jRating-js');
|
| 181 | 181 | } |
| 182 | 182 | |
| 183 | - wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.js#asyncload', array(), GEODIRECTORY_VERSION, true);
|
|
| 184 | - wp_enqueue_script('geodir-on-document-load');
|
|
| 183 | + wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.js#asyncload', array(), GEODIRECTORY_VERSION, true);
|
|
| 184 | + wp_enqueue_script('geodir-on-document-load');
|
|
| 185 | 185 | |
| 186 | - wp_register_script('google-geometa', geodir_plugin_url() . '/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
|
|
| 187 | - wp_enqueue_script('google-geometa');
|
|
| 186 | + wp_register_script('google-geometa', geodir_plugin_url() . '/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
|
|
| 187 | + wp_enqueue_script('google-geometa');
|
|
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | /** |
@@ -198,8 +198,8 @@ discard block |
||
| 198 | 198 | */ |
| 199 | 199 | function geodir_header_scripts() |
| 200 | 200 | {
|
| 201 | - echo '<style>' . stripslashes(get_option('geodir_coustem_css')) . '</style>';
|
|
| 202 | - echo stripslashes(get_option('geodir_header_scripts'));
|
|
| 201 | + echo '<style>' . stripslashes(get_option('geodir_coustem_css')) . '</style>';
|
|
| 202 | + echo stripslashes(get_option('geodir_header_scripts'));
|
|
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | function geodir_footer_scripts() |
| 216 | 216 | {
|
| 217 | 217 | echo stripslashes(get_option('geodir_ga_tracking_code'));
|
| 218 | - echo stripslashes(get_option('geodir_footer_scripts'));
|
|
| 218 | + echo stripslashes(get_option('geodir_footer_scripts'));
|
|
| 219 | 219 | } |
| 220 | 220 | |
| 221 | 221 | |
@@ -229,12 +229,12 @@ discard block |
||
| 229 | 229 | */ |
| 230 | 230 | function geodir_add_async_forscript($url) |
| 231 | 231 | {
|
| 232 | - if (strpos($url, '#asyncload')===false) |
|
| 233 | - return $url; |
|
| 234 | - else if (is_admin()) |
|
| 235 | - return str_replace('#asyncload', '', $url);
|
|
| 236 | - else |
|
| 237 | - return str_replace('#asyncload', '', $url)."' async='async";
|
|
| 232 | + if (strpos($url, '#asyncload')===false) |
|
| 233 | + return $url; |
|
| 234 | + else if (is_admin()) |
|
| 235 | + return str_replace('#asyncload', '', $url);
|
|
| 236 | + else |
|
| 237 | + return str_replace('#asyncload', '', $url)."' async='async";
|
|
| 238 | 238 | } |
| 239 | 239 | add_filter('clean_url', 'geodir_add_async_forscript', 11, 1);
|
| 240 | 240 | |
@@ -248,55 +248,55 @@ discard block |
||
| 248 | 248 | {
|
| 249 | 249 | |
| 250 | 250 | |
| 251 | - if(get_option('geodir_scss_core')) {
|
|
| 251 | + if(get_option('geodir_scss_core')) {
|
|
| 252 | 252 | |
| 253 | 253 | |
| 254 | - wp_register_style('geodirectory-frontend-style', geodir_plugin_url() . '/geodirectory-assets/css/style.css', array(), GEODIRECTORY_VERSION);
|
|
| 255 | - wp_enqueue_style('geodirectory-frontend-style');
|
|
| 254 | + wp_register_style('geodirectory-frontend-style', geodir_plugin_url() . '/geodirectory-assets/css/style.css', array(), GEODIRECTORY_VERSION);
|
|
| 255 | + wp_enqueue_style('geodirectory-frontend-style');
|
|
| 256 | 256 | |
| 257 | - wp_register_style('geodirectory-media-style', geodir_plugin_url() . '/geodirectory-assets/css/media.css', array(), GEODIRECTORY_VERSION);
|
|
| 258 | - wp_enqueue_style('geodirectory-media-style');
|
|
| 257 | + wp_register_style('geodirectory-media-style', geodir_plugin_url() . '/geodirectory-assets/css/media.css', array(), GEODIRECTORY_VERSION);
|
|
| 258 | + wp_enqueue_style('geodirectory-media-style');
|
|
| 259 | 259 | |
| 260 | 260 | |
| 261 | - wp_register_style('geodirectory-jquery-ui-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery-ui.css', array(), GEODIRECTORY_VERSION);
|
|
| 262 | - wp_enqueue_style('geodirectory-jquery-ui-css');
|
|
| 261 | + wp_register_style('geodirectory-jquery-ui-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery-ui.css', array(), GEODIRECTORY_VERSION);
|
|
| 262 | + wp_enqueue_style('geodirectory-jquery-ui-css');
|
|
| 263 | 263 | |
| 264 | - wp_register_style('geodirectory-jquery-ui-timepicker-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery.ui.timepicker.css', array(), GEODIRECTORY_VERSION);
|
|
| 265 | - wp_enqueue_style('geodirectory-jquery-ui-timepicker-css');
|
|
| 264 | + wp_register_style('geodirectory-jquery-ui-timepicker-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery.ui.timepicker.css', array(), GEODIRECTORY_VERSION);
|
|
| 265 | + wp_enqueue_style('geodirectory-jquery-ui-timepicker-css');
|
|
| 266 | 266 | |
| 267 | - wp_register_style('geodirectory-flexslider-css', geodir_plugin_url() . '/geodirectory-assets/css/flexslider.css', array(), GEODIRECTORY_VERSION);
|
|
| 268 | - wp_enqueue_style('geodirectory-flexslider-css');
|
|
| 267 | + wp_register_style('geodirectory-flexslider-css', geodir_plugin_url() . '/geodirectory-assets/css/flexslider.css', array(), GEODIRECTORY_VERSION);
|
|
| 268 | + wp_enqueue_style('geodirectory-flexslider-css');
|
|
| 269 | 269 | |
| 270 | - wp_register_style('geodirectory-thic-box-css', geodir_plugin_url() . '/geodirectory-assets/css/thic-box.css', array(), GEODIRECTORY_VERSION);
|
|
| 271 | - wp_enqueue_style('geodirectory-thic-box-css');
|
|
| 270 | + wp_register_style('geodirectory-thic-box-css', geodir_plugin_url() . '/geodirectory-assets/css/thic-box.css', array(), GEODIRECTORY_VERSION);
|
|
| 271 | + wp_enqueue_style('geodirectory-thic-box-css');
|
|
| 272 | 272 | |
| 273 | - wp_register_style('geodirectory-pluplodar-css', geodir_plugin_url() . '/geodirectory-assets/css/pluploader.css', array(), GEODIRECTORY_VERSION);
|
|
| 274 | - wp_enqueue_style('geodirectory-pluplodar-css');
|
|
| 273 | + wp_register_style('geodirectory-pluplodar-css', geodir_plugin_url() . '/geodirectory-assets/css/pluploader.css', array(), GEODIRECTORY_VERSION);
|
|
| 274 | + wp_enqueue_style('geodirectory-pluplodar-css');
|
|
| 275 | 275 | |
| 276 | - wp_register_style('geodirectory-lightbox-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery.lightbox-0.5.css', array(), GEODIRECTORY_VERSION);
|
|
| 277 | - wp_enqueue_style('geodirectory-lightbox-css');
|
|
| 276 | + wp_register_style('geodirectory-lightbox-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery.lightbox-0.5.css', array(), GEODIRECTORY_VERSION);
|
|
| 277 | + wp_enqueue_style('geodirectory-lightbox-css');
|
|
| 278 | 278 | |
| 279 | - wp_register_style('geodir-rating-style', geodir_plugin_url() . '/geodirectory-assets/css/jRating.jquery.css', array(), GEODIRECTORY_VERSION);
|
|
| 280 | - wp_enqueue_style('geodir-rating-style');
|
|
| 279 | + wp_register_style('geodir-rating-style', geodir_plugin_url() . '/geodirectory-assets/css/jRating.jquery.css', array(), GEODIRECTORY_VERSION);
|
|
| 280 | + wp_enqueue_style('geodir-rating-style');
|
|
| 281 | 281 | |
| 282 | - wp_register_style('geodir-chosen-style', geodir_plugin_url() . '/geodirectory-assets/css/chosen.css', array(), GEODIRECTORY_VERSION);
|
|
| 283 | - wp_enqueue_style('geodir-chosen-style');
|
|
| 282 | + wp_register_style('geodir-chosen-style', geodir_plugin_url() . '/geodirectory-assets/css/chosen.css', array(), GEODIRECTORY_VERSION);
|
|
| 283 | + wp_enqueue_style('geodir-chosen-style');
|
|
| 284 | 284 | |
| 285 | - }else{
|
|
| 286 | - wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
|
|
| 287 | - wp_enqueue_style('geodir-core-scss');
|
|
| 285 | + }else{
|
|
| 286 | + wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
|
|
| 287 | + wp_enqueue_style('geodir-core-scss');
|
|
| 288 | 288 | |
| 289 | - wp_register_style('geodir-core-scss-footer', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
|
|
| 289 | + wp_register_style('geodir-core-scss-footer', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
|
|
| 290 | 290 | |
| 291 | - } |
|
| 291 | + } |
|
| 292 | 292 | |
| 293 | - if(is_rtl()){
|
|
| 294 | - wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
|
|
| 295 | - wp_enqueue_style('geodirectory-frontend-rtl-style');
|
|
| 296 | - } |
|
| 293 | + if(is_rtl()){
|
|
| 294 | + wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
|
|
| 295 | + wp_enqueue_style('geodirectory-frontend-rtl-style');
|
|
| 296 | + } |
|
| 297 | 297 | |
| 298 | - wp_register_style('geodirectory-font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css', array(), GEODIRECTORY_VERSION);
|
|
| 299 | - wp_enqueue_style('geodirectory-font-awesome');
|
|
| 298 | + wp_register_style('geodirectory-font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css', array(), GEODIRECTORY_VERSION);
|
|
| 299 | + wp_enqueue_style('geodirectory-font-awesome');
|
|
| 300 | 300 | |
| 301 | 301 | |
| 302 | 302 | } |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | */ |
| 311 | 311 | function geodir_get_sidebar() |
| 312 | 312 | {
|
| 313 | - get_sidebar('geodirectory');
|
|
| 313 | + get_sidebar('geodirectory');
|
|
| 314 | 314 | } |
| 315 | 315 | |
| 316 | 316 | /** |
@@ -329,122 +329,122 @@ discard block |
||
| 329 | 329 | * @param bool $always_show Do you want to show the pagination always? Default: false. |
| 330 | 330 | */ |
| 331 | 331 | function geodir_pagination($before = '', $after = '', $prelabel = '', $nxtlabel = '', $pages_to_show = 5, $always_show = false) {
|
| 332 | - global $wp_query, $posts_per_page, $wpdb, $paged, $blog_id; |
|
| 332 | + global $wp_query, $posts_per_page, $wpdb, $paged, $blog_id; |
|
| 333 | 333 | |
| 334 | - if (empty($prelabel)) {
|
|
| 335 | - $prelabel = '<strong>«</strong>'; |
|
| 336 | - } |
|
| 334 | + if (empty($prelabel)) {
|
|
| 335 | + $prelabel = '<strong>«</strong>'; |
|
| 336 | + } |
|
| 337 | 337 | |
| 338 | - if (empty($nxtlabel)) {
|
|
| 339 | - $nxtlabel = '<strong>»</strong>'; |
|
| 340 | - } |
|
| 338 | + if (empty($nxtlabel)) {
|
|
| 339 | + $nxtlabel = '<strong>»</strong>'; |
|
| 340 | + } |
|
| 341 | 341 | |
| 342 | - $half_pages_to_show = round($pages_to_show / 2); |
|
| 342 | + $half_pages_to_show = round($pages_to_show / 2); |
|
| 343 | 343 | |
| 344 | - if (geodir_is_page('home') || (get_option('geodir_set_as_home') && is_home())) // dont apply default pagination for geodirectory home page.
|
|
| 345 | - return; |
|
| 344 | + if (geodir_is_page('home') || (get_option('geodir_set_as_home') && is_home())) // dont apply default pagination for geodirectory home page.
|
|
| 345 | + return; |
|
| 346 | 346 | |
| 347 | - if (!is_single()) {
|
|
| 348 | - if (function_exists('geodir_location_geo_home_link')) {
|
|
| 349 | - remove_filter('home_url', 'geodir_location_geo_home_link', 100000);
|
|
| 350 | - } |
|
| 351 | - $numposts = $wp_query->found_posts; |
|
| 347 | + if (!is_single()) {
|
|
| 348 | + if (function_exists('geodir_location_geo_home_link')) {
|
|
| 349 | + remove_filter('home_url', 'geodir_location_geo_home_link', 100000);
|
|
| 350 | + } |
|
| 351 | + $numposts = $wp_query->found_posts; |
|
| 352 | 352 | |
| 353 | - $max_page = ceil($numposts / $posts_per_page); |
|
| 353 | + $max_page = ceil($numposts / $posts_per_page); |
|
| 354 | 354 | |
| 355 | - if (empty($paged)) {
|
|
| 356 | - $paged = 1; |
|
| 357 | - } |
|
| 355 | + if (empty($paged)) {
|
|
| 356 | + $paged = 1; |
|
| 357 | + } |
|
| 358 | 358 | |
| 359 | - $post_type = geodir_get_current_posttype(); |
|
| 360 | - $listing_type_name = get_post_type_plural_label($post_type); |
|
| 361 | - if (geodir_is_page('listing') || geodir_is_page('search')) {
|
|
| 362 | - $term = array(); |
|
| 359 | + $post_type = geodir_get_current_posttype(); |
|
| 360 | + $listing_type_name = get_post_type_plural_label($post_type); |
|
| 361 | + if (geodir_is_page('listing') || geodir_is_page('search')) {
|
|
| 362 | + $term = array(); |
|
| 363 | 363 | |
| 364 | - if (is_tax()) {
|
|
| 365 | - $term_id = get_queried_object_id(); |
|
| 366 | - $taxonomy = get_query_var('taxonomy');
|
|
| 364 | + if (is_tax()) {
|
|
| 365 | + $term_id = get_queried_object_id(); |
|
| 366 | + $taxonomy = get_query_var('taxonomy');
|
|
| 367 | 367 | |
| 368 | - if ($term_id && $post_type && get_query_var('taxonomy') == $post_type . 'category' ) {
|
|
| 369 | - $term = get_term($term_id, $post_type . 'category'); |
|
| 370 | - } |
|
| 371 | - } |
|
| 368 | + if ($term_id && $post_type && get_query_var('taxonomy') == $post_type . 'category' ) {
|
|
| 369 | + $term = get_term($term_id, $post_type . 'category'); |
|
| 370 | + } |
|
| 371 | + } |
|
| 372 | 372 | |
| 373 | - if (geodir_is_page('search') && !empty($_REQUEST['s' . $post_type . 'category'])) {
|
|
| 374 | - $taxonomy_search = $_REQUEST['s' . $post_type . 'category']; |
|
| 373 | + if (geodir_is_page('search') && !empty($_REQUEST['s' . $post_type . 'category'])) {
|
|
| 374 | + $taxonomy_search = $_REQUEST['s' . $post_type . 'category']; |
|
| 375 | 375 | |
| 376 | - if (!is_array($taxonomy_search)) {
|
|
| 377 | - $term = get_term((int)$taxonomy_search, $post_type . 'category'); |
|
| 378 | - } else if(is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
|
|
| 379 | - $term = get_term((int)$taxonomy_search[0], $post_type . 'category'); |
|
| 380 | - } |
|
| 381 | - } |
|
| 376 | + if (!is_array($taxonomy_search)) {
|
|
| 377 | + $term = get_term((int)$taxonomy_search, $post_type . 'category'); |
|
| 378 | + } else if(is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
|
|
| 379 | + $term = get_term((int)$taxonomy_search[0], $post_type . 'category'); |
|
| 380 | + } |
|
| 381 | + } |
|
| 382 | 382 | |
| 383 | - if (!empty($term) && !is_wp_error($term)) {
|
|
| 384 | - $listing_type_name = $term->name; |
|
| 385 | - } |
|
| 386 | - } |
|
| 383 | + if (!empty($term) && !is_wp_error($term)) {
|
|
| 384 | + $listing_type_name = $term->name; |
|
| 385 | + } |
|
| 386 | + } |
|
| 387 | 387 | |
| 388 | - if ($max_page > 1 || $always_show) {
|
|
| 389 | - // Extra pagination info |
|
| 390 | - $geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
|
|
| 391 | - $start_no = ( $paged - 1 ) * $posts_per_page + 1; |
|
| 392 | - $end_no = min($paged * $posts_per_page, $numposts); |
|
| 388 | + if ($max_page > 1 || $always_show) {
|
|
| 389 | + // Extra pagination info |
|
| 390 | + $geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
|
|
| 391 | + $start_no = ( $paged - 1 ) * $posts_per_page + 1; |
|
| 392 | + $end_no = min($paged * $posts_per_page, $numposts); |
|
| 393 | 393 | |
| 394 | - if ($geodir_pagination_more_info != '') {
|
|
| 395 | - if ($listing_type_name) {
|
|
| 396 | - $listing_type_name = __($listing_type_name, 'geodirectory'); |
|
| 397 | - $pegination_desc = wp_sprintf(__('Showing %s %d-%d of %d', 'geodirectory'), $listing_type_name, $start_no, $end_no, $numposts);
|
|
| 398 | - } else {
|
|
| 399 | - $pegination_desc = wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts);
|
|
| 400 | - } |
|
| 401 | - $pagination_info = '<div class="gd-pagination-details">' . $pegination_desc . '</div>'; |
|
| 402 | - /** |
|
| 403 | - * Adds an extra pagination info above/under pagination. |
|
| 404 | - * |
|
| 405 | - * @since 1.5.9 |
|
| 406 | - * |
|
| 407 | - * @param string $pagination_info Extra pagination info content. |
|
| 408 | - * @param string $listing_type_name Listing results type. |
|
| 409 | - * @param string $start_no First result number. |
|
| 410 | - * @param string $end_no Last result number. |
|
| 411 | - * @param string $numposts Total number of listings. |
|
| 412 | - * @param string $post_type The post type. |
|
| 413 | - */ |
|
| 414 | - $pagination_info = apply_filters('geodir_pagination_advance_info', $pagination_info, $listing_type_name, $start_no, $end_no, $numposts, $post_type);
|
|
| 394 | + if ($geodir_pagination_more_info != '') {
|
|
| 395 | + if ($listing_type_name) {
|
|
| 396 | + $listing_type_name = __($listing_type_name, 'geodirectory'); |
|
| 397 | + $pegination_desc = wp_sprintf(__('Showing %s %d-%d of %d', 'geodirectory'), $listing_type_name, $start_no, $end_no, $numposts);
|
|
| 398 | + } else {
|
|
| 399 | + $pegination_desc = wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts);
|
|
| 400 | + } |
|
| 401 | + $pagination_info = '<div class="gd-pagination-details">' . $pegination_desc . '</div>'; |
|
| 402 | + /** |
|
| 403 | + * Adds an extra pagination info above/under pagination. |
|
| 404 | + * |
|
| 405 | + * @since 1.5.9 |
|
| 406 | + * |
|
| 407 | + * @param string $pagination_info Extra pagination info content. |
|
| 408 | + * @param string $listing_type_name Listing results type. |
|
| 409 | + * @param string $start_no First result number. |
|
| 410 | + * @param string $end_no Last result number. |
|
| 411 | + * @param string $numposts Total number of listings. |
|
| 412 | + * @param string $post_type The post type. |
|
| 413 | + */ |
|
| 414 | + $pagination_info = apply_filters('geodir_pagination_advance_info', $pagination_info, $listing_type_name, $start_no, $end_no, $numposts, $post_type);
|
|
| 415 | 415 | |
| 416 | - if ($geodir_pagination_more_info == 'before') {
|
|
| 417 | - $before = $before . $pagination_info; |
|
| 418 | - } else if ($geodir_pagination_more_info == 'after') {
|
|
| 419 | - $after = $pagination_info . $after; |
|
| 420 | - } |
|
| 421 | - } |
|
| 416 | + if ($geodir_pagination_more_info == 'before') {
|
|
| 417 | + $before = $before . $pagination_info; |
|
| 418 | + } else if ($geodir_pagination_more_info == 'after') {
|
|
| 419 | + $after = $pagination_info . $after; |
|
| 420 | + } |
|
| 421 | + } |
|
| 422 | 422 | |
| 423 | - echo "$before <div class='Navi'>"; |
|
| 424 | - if ($paged >= ($pages_to_show - 1)) {
|
|
| 425 | - echo '<a href="' . str_replace('&paged', '&paged', get_pagenum_link()) . '">«</a>';
|
|
| 426 | - } |
|
| 427 | - previous_posts_link($prelabel); |
|
| 428 | - for ($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) {
|
|
| 429 | - if ($i >= 1 && $i <= $max_page) {
|
|
| 430 | - if ($i == $paged) {
|
|
| 431 | - echo "<strong class='on'>$i</strong>"; |
|
| 432 | - } else {
|
|
| 433 | - echo ' <a href="' . str_replace('&paged', '&paged', get_pagenum_link($i)) . '">' . $i . '</a> ';
|
|
| 434 | - } |
|
| 435 | - } |
|
| 436 | - } |
|
| 437 | - next_posts_link($nxtlabel, $max_page); |
|
| 438 | - if (($paged + $half_pages_to_show) < ($max_page)) {
|
|
| 439 | - echo '<a href="' . str_replace('&paged', '&paged', get_pagenum_link($max_page)) . '">»</a>';
|
|
| 440 | - } |
|
| 441 | - echo "</div> $after"; |
|
| 442 | - } |
|
| 423 | + echo "$before <div class='Navi'>"; |
|
| 424 | + if ($paged >= ($pages_to_show - 1)) {
|
|
| 425 | + echo '<a href="' . str_replace('&paged', '&paged', get_pagenum_link()) . '">«</a>';
|
|
| 426 | + } |
|
| 427 | + previous_posts_link($prelabel); |
|
| 428 | + for ($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) {
|
|
| 429 | + if ($i >= 1 && $i <= $max_page) {
|
|
| 430 | + if ($i == $paged) {
|
|
| 431 | + echo "<strong class='on'>$i</strong>"; |
|
| 432 | + } else {
|
|
| 433 | + echo ' <a href="' . str_replace('&paged', '&paged', get_pagenum_link($i)) . '">' . $i . '</a> ';
|
|
| 434 | + } |
|
| 435 | + } |
|
| 436 | + } |
|
| 437 | + next_posts_link($nxtlabel, $max_page); |
|
| 438 | + if (($paged + $half_pages_to_show) < ($max_page)) {
|
|
| 439 | + echo '<a href="' . str_replace('&paged', '&paged', get_pagenum_link($max_page)) . '">»</a>';
|
|
| 440 | + } |
|
| 441 | + echo "</div> $after"; |
|
| 442 | + } |
|
| 443 | 443 | |
| 444 | - if (function_exists('geodir_location_geo_home_link')) {
|
|
| 445 | - add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2);
|
|
| 446 | - } |
|
| 447 | - } |
|
| 444 | + if (function_exists('geodir_location_geo_home_link')) {
|
|
| 445 | + add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2);
|
|
| 446 | + } |
|
| 447 | + } |
|
| 448 | 448 | } |
| 449 | 449 | |
| 450 | 450 | /** |
@@ -455,20 +455,20 @@ discard block |
||
| 455 | 455 | */ |
| 456 | 456 | function geodir_listingsearch_scripts() |
| 457 | 457 | {
|
| 458 | - if (get_option('gd_search_dist') != '') {
|
|
| 459 | - $dist = get_option('gd_search_dist');
|
|
| 460 | - } else {
|
|
| 461 | - $dist = 500; |
|
| 462 | - } |
|
| 463 | - $dist_dif = 1000; |
|
| 464 | - |
|
| 465 | - if ($dist <= 5000) $dist_dif = 500; |
|
| 466 | - if ($dist <= 1000) $dist_dif = 100; |
|
| 467 | - if ($dist <= 500) $dist_dif = 50; |
|
| 468 | - if ($dist <= 100) $dist_dif = 10; |
|
| 469 | - if ($dist <= 50) $dist_dif = 5; |
|
| 470 | - |
|
| 471 | - ?> |
|
| 458 | + if (get_option('gd_search_dist') != '') {
|
|
| 459 | + $dist = get_option('gd_search_dist');
|
|
| 460 | + } else {
|
|
| 461 | + $dist = 500; |
|
| 462 | + } |
|
| 463 | + $dist_dif = 1000; |
|
| 464 | + |
|
| 465 | + if ($dist <= 5000) $dist_dif = 500; |
|
| 466 | + if ($dist <= 1000) $dist_dif = 100; |
|
| 467 | + if ($dist <= 500) $dist_dif = 50; |
|
| 468 | + if ($dist <= 100) $dist_dif = 10; |
|
| 469 | + if ($dist <= 50) $dist_dif = 5; |
|
| 470 | + |
|
| 471 | + ?> |
|
| 472 | 472 | <script type="text/javascript"> |
| 473 | 473 | |
| 474 | 474 | jQuery(function ($) {
|
@@ -527,15 +527,15 @@ discard block |
||
| 527 | 527 | function geodir_add_sharelocation_scripts() |
| 528 | 528 | {
|
| 529 | 529 | |
| 530 | - $default_search_for_text = SEARCH_FOR_TEXT; |
|
| 531 | - if (get_option('geodir_search_field_default_text'))
|
|
| 532 | - $default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory');
|
|
| 530 | + $default_search_for_text = SEARCH_FOR_TEXT; |
|
| 531 | + if (get_option('geodir_search_field_default_text'))
|
|
| 532 | + $default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory');
|
|
| 533 | 533 | |
| 534 | - $default_near_text = NEAR_TEXT; |
|
| 535 | - if (get_option('geodir_near_field_default_text'))
|
|
| 536 | - $default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory');
|
|
| 534 | + $default_near_text = NEAR_TEXT; |
|
| 535 | + if (get_option('geodir_near_field_default_text'))
|
|
| 536 | + $default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory');
|
|
| 537 | 537 | |
| 538 | - ?> |
|
| 538 | + ?> |
|
| 539 | 539 | |
| 540 | 540 | |
| 541 | 541 | <script type="text/javascript"> |
@@ -613,14 +613,14 @@ discard block |
||
| 613 | 613 | } else {
|
| 614 | 614 | |
| 615 | 615 | Sgeocoder.geocode({'address': address<?php
|
| 616 | - if($near_add = get_option('geodir_search_near_addition')){echo '+", '.$near_add.'"';}
|
|
| 617 | - if($near_add2 = |
|
| 618 | - /** |
|
| 619 | - * Adds any extra info to the near search box query when trying to geolocate it via google api. |
|
| 620 | - * |
|
| 621 | - * @since 1.0.0 |
|
| 622 | - */ |
|
| 623 | - apply_filters('geodir_search_near_addition','')){echo $near_add2;}//gt_advanced_near_search();?>},
|
|
| 616 | + if($near_add = get_option('geodir_search_near_addition')){echo '+", '.$near_add.'"';}
|
|
| 617 | + if($near_add2 = |
|
| 618 | + /** |
|
| 619 | + * Adds any extra info to the near search box query when trying to geolocate it via google api. |
|
| 620 | + * |
|
| 621 | + * @since 1.0.0 |
|
| 622 | + */ |
|
| 623 | + apply_filters('geodir_search_near_addition','')){echo $near_add2;}//gt_advanced_near_search();?>},
|
|
| 624 | 624 | function (results, status) {
|
| 625 | 625 | if (status == google.maps.GeocoderStatus.OK) {
|
| 626 | 626 | updateSearchPosition(results[0].geometry.location, $form); |
@@ -699,30 +699,30 @@ discard block |
||
| 699 | 699 | */ |
| 700 | 700 | function geodir_show_badges_on_image($which, $post, $link) |
| 701 | 701 | {
|
| 702 | - $return = ''; |
|
| 703 | - switch ($which) {
|
|
| 704 | - case 'featured': |
|
| 705 | - /** |
|
| 706 | - * Filter the featured image badge html that appears in the listings pages over the thumbnail. |
|
| 707 | - * |
|
| 708 | - * @since 1.0.0 |
|
| 709 | - * @param object $post The post object. |
|
| 710 | - * @param string $link The link to the post. |
|
| 711 | - */ |
|
| 712 | - $return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img"> </span></a>',$post,$link);
|
|
| 713 | - break; |
|
| 714 | - case 'new' : |
|
| 715 | - /** |
|
| 716 | - * Filter the new image badge html that appears in the listings pages over the thumbnail. |
|
| 717 | - * |
|
| 718 | - * @since 1.0.0 |
|
| 719 | - * @param object $post The post object. |
|
| 720 | - * @param string $link The link to the post. |
|
| 721 | - */ |
|
| 722 | - $return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing"> </span></a>',$post,$link);
|
|
| 723 | - break; |
|
| 724 | - |
|
| 725 | - } |
|
| 702 | + $return = ''; |
|
| 703 | + switch ($which) {
|
|
| 704 | + case 'featured': |
|
| 705 | + /** |
|
| 706 | + * Filter the featured image badge html that appears in the listings pages over the thumbnail. |
|
| 707 | + * |
|
| 708 | + * @since 1.0.0 |
|
| 709 | + * @param object $post The post object. |
|
| 710 | + * @param string $link The link to the post. |
|
| 711 | + */ |
|
| 712 | + $return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img"> </span></a>',$post,$link);
|
|
| 713 | + break; |
|
| 714 | + case 'new' : |
|
| 715 | + /** |
|
| 716 | + * Filter the new image badge html that appears in the listings pages over the thumbnail. |
|
| 717 | + * |
|
| 718 | + * @since 1.0.0 |
|
| 719 | + * @param object $post The post object. |
|
| 720 | + * @param string $link The link to the post. |
|
| 721 | + */ |
|
| 722 | + $return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing"> </span></a>',$post,$link);
|
|
| 723 | + break; |
|
| 724 | + |
|
| 725 | + } |
|
| 726 | 726 | |
| 727 | - return $return; |
|
| 727 | + return $return; |
|
| 728 | 728 | } |
@@ -37,13 +37,13 @@ discard block |
||
| 37 | 37 | {
|
| 38 | 38 | $is_detail_page = false; |
| 39 | 39 | |
| 40 | - if((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview') )) {
|
|
| 40 | + if ((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview'))) {
|
|
| 41 | 41 | $is_detail_page = true; |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | wp_enqueue_script('jquery');
|
| 45 | 45 | |
| 46 | - wp_register_script('geodirectory-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory.min.js#asyncload', array(), GEODIRECTORY_VERSION);
|
|
| 46 | + wp_register_script('geodirectory-script', geodir_plugin_url().'/geodirectory-assets/js/geodirectory.min.js#asyncload', array(), GEODIRECTORY_VERSION);
|
|
| 47 | 47 | wp_enqueue_script('geodirectory-script');
|
| 48 | 48 | |
| 49 | 49 | |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | 'siteurl' => get_option('siteurl'),
|
| 52 | 52 | 'geodir_plugin_url' => geodir_plugin_url(), |
| 53 | 53 | 'geodir_ajax_url' => geodir_get_ajax_url(), |
| 54 | - 'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'),
|
|
| 54 | + 'geodir_gd_modal' => (int) get_option('geodir_disable_gb_modal'),
|
|
| 55 | 55 | 'is_rtl' => is_rtl() ? 1 : 0 // fix rtl issue |
| 56 | 56 | ); |
| 57 | 57 | |
@@ -72,22 +72,22 @@ discard block |
||
| 72 | 72 | * |
| 73 | 73 | * } |
| 74 | 74 | */ |
| 75 | - $geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data);
|
|
| 75 | + $geodir_vars_data = apply_filters('geodir_vars_data', $geodir_vars_data);
|
|
| 76 | 76 | |
| 77 | 77 | wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data);
|
| 78 | 78 | |
| 79 | - wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION,true);
|
|
| 80 | - if($is_detail_page){wp_enqueue_script('geodirectory-jquery-flexslider-js');}
|
|
| 79 | + wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION, true);
|
|
| 80 | + if ($is_detail_page) {wp_enqueue_script('geodirectory-jquery-flexslider-js'); }
|
|
| 81 | 81 | |
| 82 | - wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true);
|
|
| 82 | + wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url().'/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION, true);
|
|
| 83 | 83 | wp_enqueue_script('geodirectory-lightbox-jquery');
|
| 84 | 84 | |
| 85 | - wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true);
|
|
| 85 | + wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url().'/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION, true);
|
|
| 86 | 86 | if ($is_detail_page) {
|
| 87 | 87 | wp_enqueue_script('geodirectory-jquery-simplemodal');
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | - $map_lang = "&language=" . geodir_get_map_default_language(); |
|
| 90 | + $map_lang = "&language=".geodir_get_map_default_language(); |
|
| 91 | 91 | /** |
| 92 | 92 | * Filter the variables that are added to the end of the google maps script call. |
| 93 | 93 | * |
@@ -97,26 +97,26 @@ discard block |
||
| 97 | 97 | * @param string $var The string to filter, default is empty string. |
| 98 | 98 | */ |
| 99 | 99 | $map_extra = apply_filters('geodir_googlemap_script_extra', '');
|
| 100 | - wp_enqueue_script('geodirectory-googlemap-script', '//maps.google.com/maps/api/js?' . $map_lang . $map_extra, '', NULL);
|
|
| 100 | + wp_enqueue_script('geodirectory-googlemap-script', '//maps.google.com/maps/api/js?'.$map_lang.$map_extra, '', NULL);
|
|
| 101 | 101 | |
| 102 | - wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true);
|
|
| 102 | + wp_register_script('geodirectory-goMap-script', geodir_plugin_url().'/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION, true);
|
|
| 103 | 103 | wp_enqueue_script('geodirectory-goMap-script');
|
| 104 | 104 | |
| 105 | 105 | |
| 106 | - wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 106 | + wp_register_script('chosen', geodir_plugin_url().'/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 107 | 107 | wp_enqueue_script('chosen');
|
| 108 | 108 | |
| 109 | - wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 109 | + wp_register_script('geodirectory-choose-ajax', geodir_plugin_url().'/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 110 | 110 | wp_enqueue_script('geodirectory-choose-ajax');
|
| 111 | 111 | |
| 112 | - wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.min.js#asyncload', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
|
|
| 112 | + wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.ui.timepicker.min.js#asyncload', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
|
|
| 113 | 113 | |
| 114 | 114 | if (is_page() && geodir_is_page('add-listing')) {
|
| 115 | 115 | // SCRIPT FOR UPLOAD |
| 116 | 116 | wp_enqueue_script('plupload-all');
|
| 117 | 117 | wp_enqueue_script('jquery-ui-sortable');
|
| 118 | 118 | |
| 119 | - wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true);
|
|
| 119 | + wp_register_script('geodirectory-plupload-script', geodir_plugin_url().'/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
|
|
| 120 | 120 | wp_enqueue_script('geodirectory-plupload-script');
|
| 121 | 121 | // SCRIPT FOR UPLOAD END |
| 122 | 122 | |
@@ -163,27 +163,27 @@ discard block |
||
| 163 | 163 | |
| 164 | 164 | wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init);
|
| 165 | 165 | |
| 166 | - wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation.min.js#asyncload');
|
|
| 166 | + wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url().'/geodirectory-assets/js/listing_validation.min.js#asyncload');
|
|
| 167 | 167 | } // End if for add place page |
| 168 | 168 | |
| 169 | - wp_register_script('geodirectory-post-custom-js', geodir_plugin_url() . '/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
|
|
| 169 | + wp_register_script('geodirectory-post-custom-js', geodir_plugin_url().'/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
|
|
| 170 | 170 | if ($is_detail_page) {
|
| 171 | 171 | wp_enqueue_script('geodirectory-post-custom-js');
|
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | // font awesome rating script |
| 175 | 175 | if (get_option('geodir_reviewrating_enable_font_awesome')) {
|
| 176 | - wp_register_script('geodir-barrating-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true);
|
|
| 176 | + wp_register_script('geodir-barrating-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true);
|
|
| 177 | 177 | wp_enqueue_script('geodir-barrating-js');
|
| 178 | 178 | } else { // default rating script
|
| 179 | - wp_register_script('geodir-jRating-js', geodir_plugin_url() . '/geodirectory-assets/js/jRating.jquery.min.js', array(), GEODIRECTORY_VERSION, true);
|
|
| 179 | + wp_register_script('geodir-jRating-js', geodir_plugin_url().'/geodirectory-assets/js/jRating.jquery.min.js', array(), GEODIRECTORY_VERSION, true);
|
|
| 180 | 180 | wp_enqueue_script('geodir-jRating-js');
|
| 181 | 181 | } |
| 182 | 182 | |
| 183 | - wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.js#asyncload', array(), GEODIRECTORY_VERSION, true);
|
|
| 183 | + wp_register_script('geodir-on-document-load', geodir_plugin_url().'/geodirectory-assets/js/on_document_load.js#asyncload', array(), GEODIRECTORY_VERSION, true);
|
|
| 184 | 184 | wp_enqueue_script('geodir-on-document-load');
|
| 185 | 185 | |
| 186 | - wp_register_script('google-geometa', geodir_plugin_url() . '/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
|
|
| 186 | + wp_register_script('google-geometa', geodir_plugin_url().'/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
|
|
| 187 | 187 | wp_enqueue_script('google-geometa');
|
| 188 | 188 | } |
| 189 | 189 | |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | */ |
| 199 | 199 | function geodir_header_scripts() |
| 200 | 200 | {
|
| 201 | - echo '<style>' . stripslashes(get_option('geodir_coustem_css')) . '</style>';
|
|
| 201 | + echo '<style>'.stripslashes(get_option('geodir_coustem_css')).'</style>';
|
|
| 202 | 202 | echo stripslashes(get_option('geodir_header_scripts'));
|
| 203 | 203 | } |
| 204 | 204 | |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | */ |
| 230 | 230 | function geodir_add_async_forscript($url) |
| 231 | 231 | {
|
| 232 | - if (strpos($url, '#asyncload')===false) |
|
| 232 | + if (strpos($url, '#asyncload') === false) |
|
| 233 | 233 | return $url; |
| 234 | 234 | else if (is_admin()) |
| 235 | 235 | return str_replace('#asyncload', '', $url);
|
@@ -248,50 +248,50 @@ discard block |
||
| 248 | 248 | {
|
| 249 | 249 | |
| 250 | 250 | |
| 251 | - if(get_option('geodir_scss_core')) {
|
|
| 251 | + if (get_option('geodir_scss_core')) {
|
|
| 252 | 252 | |
| 253 | 253 | |
| 254 | - wp_register_style('geodirectory-frontend-style', geodir_plugin_url() . '/geodirectory-assets/css/style.css', array(), GEODIRECTORY_VERSION);
|
|
| 254 | + wp_register_style('geodirectory-frontend-style', geodir_plugin_url().'/geodirectory-assets/css/style.css', array(), GEODIRECTORY_VERSION);
|
|
| 255 | 255 | wp_enqueue_style('geodirectory-frontend-style');
|
| 256 | 256 | |
| 257 | - wp_register_style('geodirectory-media-style', geodir_plugin_url() . '/geodirectory-assets/css/media.css', array(), GEODIRECTORY_VERSION);
|
|
| 257 | + wp_register_style('geodirectory-media-style', geodir_plugin_url().'/geodirectory-assets/css/media.css', array(), GEODIRECTORY_VERSION);
|
|
| 258 | 258 | wp_enqueue_style('geodirectory-media-style');
|
| 259 | 259 | |
| 260 | 260 | |
| 261 | - wp_register_style('geodirectory-jquery-ui-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery-ui.css', array(), GEODIRECTORY_VERSION);
|
|
| 261 | + wp_register_style('geodirectory-jquery-ui-css', geodir_plugin_url().'/geodirectory-assets/css/jquery-ui.css', array(), GEODIRECTORY_VERSION);
|
|
| 262 | 262 | wp_enqueue_style('geodirectory-jquery-ui-css');
|
| 263 | 263 | |
| 264 | - wp_register_style('geodirectory-jquery-ui-timepicker-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery.ui.timepicker.css', array(), GEODIRECTORY_VERSION);
|
|
| 264 | + wp_register_style('geodirectory-jquery-ui-timepicker-css', geodir_plugin_url().'/geodirectory-assets/css/jquery.ui.timepicker.css', array(), GEODIRECTORY_VERSION);
|
|
| 265 | 265 | wp_enqueue_style('geodirectory-jquery-ui-timepicker-css');
|
| 266 | 266 | |
| 267 | - wp_register_style('geodirectory-flexslider-css', geodir_plugin_url() . '/geodirectory-assets/css/flexslider.css', array(), GEODIRECTORY_VERSION);
|
|
| 267 | + wp_register_style('geodirectory-flexslider-css', geodir_plugin_url().'/geodirectory-assets/css/flexslider.css', array(), GEODIRECTORY_VERSION);
|
|
| 268 | 268 | wp_enqueue_style('geodirectory-flexslider-css');
|
| 269 | 269 | |
| 270 | - wp_register_style('geodirectory-thic-box-css', geodir_plugin_url() . '/geodirectory-assets/css/thic-box.css', array(), GEODIRECTORY_VERSION);
|
|
| 270 | + wp_register_style('geodirectory-thic-box-css', geodir_plugin_url().'/geodirectory-assets/css/thic-box.css', array(), GEODIRECTORY_VERSION);
|
|
| 271 | 271 | wp_enqueue_style('geodirectory-thic-box-css');
|
| 272 | 272 | |
| 273 | - wp_register_style('geodirectory-pluplodar-css', geodir_plugin_url() . '/geodirectory-assets/css/pluploader.css', array(), GEODIRECTORY_VERSION);
|
|
| 273 | + wp_register_style('geodirectory-pluplodar-css', geodir_plugin_url().'/geodirectory-assets/css/pluploader.css', array(), GEODIRECTORY_VERSION);
|
|
| 274 | 274 | wp_enqueue_style('geodirectory-pluplodar-css');
|
| 275 | 275 | |
| 276 | - wp_register_style('geodirectory-lightbox-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery.lightbox-0.5.css', array(), GEODIRECTORY_VERSION);
|
|
| 276 | + wp_register_style('geodirectory-lightbox-css', geodir_plugin_url().'/geodirectory-assets/css/jquery.lightbox-0.5.css', array(), GEODIRECTORY_VERSION);
|
|
| 277 | 277 | wp_enqueue_style('geodirectory-lightbox-css');
|
| 278 | 278 | |
| 279 | - wp_register_style('geodir-rating-style', geodir_plugin_url() . '/geodirectory-assets/css/jRating.jquery.css', array(), GEODIRECTORY_VERSION);
|
|
| 279 | + wp_register_style('geodir-rating-style', geodir_plugin_url().'/geodirectory-assets/css/jRating.jquery.css', array(), GEODIRECTORY_VERSION);
|
|
| 280 | 280 | wp_enqueue_style('geodir-rating-style');
|
| 281 | 281 | |
| 282 | - wp_register_style('geodir-chosen-style', geodir_plugin_url() . '/geodirectory-assets/css/chosen.css', array(), GEODIRECTORY_VERSION);
|
|
| 282 | + wp_register_style('geodir-chosen-style', geodir_plugin_url().'/geodirectory-assets/css/chosen.css', array(), GEODIRECTORY_VERSION);
|
|
| 283 | 283 | wp_enqueue_style('geodir-chosen-style');
|
| 284 | 284 | |
| 285 | - }else{
|
|
| 286 | - wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
|
|
| 285 | + } else {
|
|
| 286 | + wp_register_style('geodir-core-scss', geodir_plugin_url().'/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
|
|
| 287 | 287 | wp_enqueue_style('geodir-core-scss');
|
| 288 | 288 | |
| 289 | - wp_register_style('geodir-core-scss-footer', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
|
|
| 289 | + wp_register_style('geodir-core-scss-footer', geodir_plugin_url().'/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
|
|
| 290 | 290 | |
| 291 | 291 | } |
| 292 | 292 | |
| 293 | - if(is_rtl()){
|
|
| 294 | - wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
|
|
| 293 | + if (is_rtl()) {
|
|
| 294 | + wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url().'/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
|
|
| 295 | 295 | wp_enqueue_style('geodirectory-frontend-rtl-style');
|
| 296 | 296 | } |
| 297 | 297 | |
@@ -365,18 +365,18 @@ discard block |
||
| 365 | 365 | $term_id = get_queried_object_id(); |
| 366 | 366 | $taxonomy = get_query_var('taxonomy');
|
| 367 | 367 | |
| 368 | - if ($term_id && $post_type && get_query_var('taxonomy') == $post_type . 'category' ) {
|
|
| 369 | - $term = get_term($term_id, $post_type . 'category'); |
|
| 368 | + if ($term_id && $post_type && get_query_var('taxonomy') == $post_type.'category') {
|
|
| 369 | + $term = get_term($term_id, $post_type.'category'); |
|
| 370 | 370 | } |
| 371 | 371 | } |
| 372 | 372 | |
| 373 | - if (geodir_is_page('search') && !empty($_REQUEST['s' . $post_type . 'category'])) {
|
|
| 374 | - $taxonomy_search = $_REQUEST['s' . $post_type . 'category']; |
|
| 373 | + if (geodir_is_page('search') && !empty($_REQUEST['s'.$post_type.'category'])) {
|
|
| 374 | + $taxonomy_search = $_REQUEST['s'.$post_type.'category']; |
|
| 375 | 375 | |
| 376 | 376 | if (!is_array($taxonomy_search)) {
|
| 377 | - $term = get_term((int)$taxonomy_search, $post_type . 'category'); |
|
| 378 | - } else if(is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
|
|
| 379 | - $term = get_term((int)$taxonomy_search[0], $post_type . 'category'); |
|
| 377 | + $term = get_term((int) $taxonomy_search, $post_type.'category'); |
|
| 378 | + } else if (is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
|
|
| 379 | + $term = get_term((int) $taxonomy_search[0], $post_type.'category'); |
|
| 380 | 380 | } |
| 381 | 381 | } |
| 382 | 382 | |
@@ -388,7 +388,7 @@ discard block |
||
| 388 | 388 | if ($max_page > 1 || $always_show) {
|
| 389 | 389 | // Extra pagination info |
| 390 | 390 | $geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
|
| 391 | - $start_no = ( $paged - 1 ) * $posts_per_page + 1; |
|
| 391 | + $start_no = ($paged - 1) * $posts_per_page + 1; |
|
| 392 | 392 | $end_no = min($paged * $posts_per_page, $numposts); |
| 393 | 393 | |
| 394 | 394 | if ($geodir_pagination_more_info != '') {
|
@@ -398,7 +398,7 @@ discard block |
||
| 398 | 398 | } else {
|
| 399 | 399 | $pegination_desc = wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts);
|
| 400 | 400 | } |
| 401 | - $pagination_info = '<div class="gd-pagination-details">' . $pegination_desc . '</div>'; |
|
| 401 | + $pagination_info = '<div class="gd-pagination-details">'.$pegination_desc.'</div>'; |
|
| 402 | 402 | /** |
| 403 | 403 | * Adds an extra pagination info above/under pagination. |
| 404 | 404 | * |
@@ -414,15 +414,15 @@ discard block |
||
| 414 | 414 | $pagination_info = apply_filters('geodir_pagination_advance_info', $pagination_info, $listing_type_name, $start_no, $end_no, $numposts, $post_type);
|
| 415 | 415 | |
| 416 | 416 | if ($geodir_pagination_more_info == 'before') {
|
| 417 | - $before = $before . $pagination_info; |
|
| 417 | + $before = $before.$pagination_info; |
|
| 418 | 418 | } else if ($geodir_pagination_more_info == 'after') {
|
| 419 | - $after = $pagination_info . $after; |
|
| 419 | + $after = $pagination_info.$after; |
|
| 420 | 420 | } |
| 421 | 421 | } |
| 422 | 422 | |
| 423 | 423 | echo "$before <div class='Navi'>"; |
| 424 | 424 | if ($paged >= ($pages_to_show - 1)) {
|
| 425 | - echo '<a href="' . str_replace('&paged', '&paged', get_pagenum_link()) . '">«</a>';
|
|
| 425 | + echo '<a href="'.str_replace('&paged', '&paged', get_pagenum_link()).'">«</a>';
|
|
| 426 | 426 | } |
| 427 | 427 | previous_posts_link($prelabel); |
| 428 | 428 | for ($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) {
|
@@ -430,13 +430,13 @@ discard block |
||
| 430 | 430 | if ($i == $paged) {
|
| 431 | 431 | echo "<strong class='on'>$i</strong>"; |
| 432 | 432 | } else {
|
| 433 | - echo ' <a href="' . str_replace('&paged', '&paged', get_pagenum_link($i)) . '">' . $i . '</a> ';
|
|
| 433 | + echo ' <a href="'.str_replace('&paged', '&paged', get_pagenum_link($i)).'">'.$i.'</a> ';
|
|
| 434 | 434 | } |
| 435 | 435 | } |
| 436 | 436 | } |
| 437 | 437 | next_posts_link($nxtlabel, $max_page); |
| 438 | 438 | if (($paged + $half_pages_to_show) < ($max_page)) {
|
| 439 | - echo '<a href="' . str_replace('&paged', '&paged', get_pagenum_link($max_page)) . '">»</a>';
|
|
| 439 | + echo '<a href="'.str_replace('&paged', '&paged', get_pagenum_link($max_page)).'">»</a>';
|
|
| 440 | 440 | } |
| 441 | 441 | echo "</div> $after"; |
| 442 | 442 | } |
@@ -474,7 +474,7 @@ discard block |
||
| 474 | 474 | jQuery(function ($) {
|
| 475 | 475 | $("#distance_slider").slider({
|
| 476 | 476 | range: true, |
| 477 | - values: [0, <?php echo ($_REQUEST['sdist']!='') ? sanitize_text_field($_REQUEST['sdist']) : "0"; ?>], |
|
| 477 | + values: [0, <?php echo ($_REQUEST['sdist'] != '') ? sanitize_text_field($_REQUEST['sdist']) : "0"; ?>], |
|
| 478 | 478 | min: 0, |
| 479 | 479 | max: <?php echo $dist; ?>, |
| 480 | 480 | step: <?php echo $dist_dif; ?>, |
@@ -539,7 +539,7 @@ discard block |
||
| 539 | 539 | |
| 540 | 540 | |
| 541 | 541 | <script type="text/javascript"> |
| 542 | - var default_location = '<?php if($search_location = geodir_get_default_location()) echo $search_location->city ;?>'; |
|
| 542 | + var default_location = '<?php if ($search_location = geodir_get_default_location()) echo $search_location->city; ?>'; |
|
| 543 | 543 | var latlng; |
| 544 | 544 | var Sgeocoder; |
| 545 | 545 | var address; |
@@ -552,7 +552,7 @@ discard block |
||
| 552 | 552 | var $form = jQuery(this).closest('form');
|
| 553 | 553 | |
| 554 | 554 | if (jQuery("#sdist input[type='radio']:checked").length != 0) dist = jQuery("#sdist input[type='radio']:checked").val();
|
| 555 | - if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == '<?php echo $default_search_for_text;?>') jQuery('.search_text', $form).val(s);
|
|
| 555 | + if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == '<?php echo $default_search_for_text; ?>') jQuery('.search_text', $form).val(s);
|
|
| 556 | 556 | |
| 557 | 557 | // Disable location based search for disabled location post type. |
| 558 | 558 | if (jQuery('.search_by_post', $form).val() != '' && typeof gd_cpt_no_location == 'function') {
|
@@ -566,7 +566,7 @@ discard block |
||
| 566 | 566 | } |
| 567 | 567 | } |
| 568 | 568 | |
| 569 | - if (dist > 0 || (jQuery('select[name="sort_by"]').val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest') || (jQuery(".snear", $form).val() != '' && jQuery(".snear", $form).val() != '<?php echo $default_near_text;?>')) {
|
|
| 569 | + if (dist > 0 || (jQuery('select[name="sort_by"]').val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest') || (jQuery(".snear", $form).val() != '' && jQuery(".snear", $form).val() != '<?php echo $default_near_text; ?>')) {
|
|
| 570 | 570 | geodir_setsearch($form); |
| 571 | 571 | } else {
|
| 572 | 572 | jQuery(".snear", $form).val('');
|
@@ -586,7 +586,7 @@ discard block |
||
| 586 | 586 | }); |
| 587 | 587 | |
| 588 | 588 | function geodir_setsearch($form) {
|
| 589 | - if ((dist > 0 || (jQuery('select[name="sort_by"]', $form).val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest')) && (jQuery(".snear", $form).val() == '' || jQuery(".snear", $form).val() == '<?php echo $default_near_text;?>')) jQuery(".snear", $form).val(default_location);
|
|
| 589 | + if ((dist > 0 || (jQuery('select[name="sort_by"]', $form).val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest')) && (jQuery(".snear", $form).val() == '' || jQuery(".snear", $form).val() == '<?php echo $default_near_text; ?>')) jQuery(".snear", $form).val(default_location);
|
|
| 590 | 590 | geocodeAddress($form); |
| 591 | 591 | } |
| 592 | 592 | |
@@ -599,8 +599,8 @@ discard block |
||
| 599 | 599 | function geocodeAddress($form) {
|
| 600 | 600 | Sgeocoder = new google.maps.Geocoder(); // Call the geocode function |
| 601 | 601 | |
| 602 | - if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != '' ) || jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) {
|
|
| 603 | - if (jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) {
|
|
| 602 | + if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != '' ) || jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) {
|
|
| 603 | + if (jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) {
|
|
| 604 | 604 | jQuery(".snear", $form).val('');
|
| 605 | 605 | } |
| 606 | 606 | jQuery($form).submit(); |
@@ -608,24 +608,24 @@ discard block |
||
| 608 | 608 | |
| 609 | 609 | var address = jQuery(".snear", $form).val();
|
| 610 | 610 | |
| 611 | - if (jQuery('.snear', $form).val() == '<?php echo $default_near_text;?>') {
|
|
| 611 | + if (jQuery('.snear', $form).val() == '<?php echo $default_near_text; ?>') {
|
|
| 612 | 612 | initialise2(); |
| 613 | 613 | } else {
|
| 614 | 614 | |
| 615 | 615 | Sgeocoder.geocode({'address': address<?php
|
| 616 | - if($near_add = get_option('geodir_search_near_addition')){echo '+", '.$near_add.'"';}
|
|
| 617 | - if($near_add2 = |
|
| 616 | + if ($near_add = get_option('geodir_search_near_addition')) {echo '+", '.$near_add.'"'; }
|
|
| 617 | + if ($near_add2 = |
|
| 618 | 618 | /** |
| 619 | 619 | * Adds any extra info to the near search box query when trying to geolocate it via google api. |
| 620 | 620 | * |
| 621 | 621 | * @since 1.0.0 |
| 622 | 622 | */ |
| 623 | - apply_filters('geodir_search_near_addition','')){echo $near_add2;}//gt_advanced_near_search();?>},
|
|
| 623 | + apply_filters('geodir_search_near_addition', '')) {echo $near_add2; }//gt_advanced_near_search();?>},
|
|
| 624 | 624 | function (results, status) {
|
| 625 | 625 | if (status == google.maps.GeocoderStatus.OK) {
|
| 626 | 626 | updateSearchPosition(results[0].geometry.location, $form); |
| 627 | 627 | } else {
|
| 628 | - alert("<?php _e('Search was not successful for the following reason:','geodirectory');?>" + status);
|
|
| 628 | + alert("<?php _e('Search was not successful for the following reason:', 'geodirectory'); ?>" + status);
|
|
| 629 | 629 | } |
| 630 | 630 | }); |
| 631 | 631 | } |
@@ -656,19 +656,19 @@ discard block |
||
| 656 | 656 | var msg; |
| 657 | 657 | switch (err.code) {
|
| 658 | 658 | case err.UNKNOWN_ERROR: |
| 659 | - msg = "<?php _e('Unable to find your location','geodirectory');?>";
|
|
| 659 | + msg = "<?php _e('Unable to find your location', 'geodirectory'); ?>";
|
|
| 660 | 660 | break; |
| 661 | 661 | case err.PERMISSION_DENINED: |
| 662 | - msg = "<?php _e('Permission denied in finding your location','geodirectory');?>";
|
|
| 662 | + msg = "<?php _e('Permission denied in finding your location', 'geodirectory'); ?>";
|
|
| 663 | 663 | break; |
| 664 | 664 | case err.POSITION_UNAVAILABLE: |
| 665 | - msg = "<?php _e('Your location is currently unknown','geodirectory');?>";
|
|
| 665 | + msg = "<?php _e('Your location is currently unknown', 'geodirectory'); ?>";
|
|
| 666 | 666 | break; |
| 667 | 667 | case err.BREAK: |
| 668 | - msg = "<?php _e('Attempt to find location took too long','geodirectory');?>";
|
|
| 668 | + msg = "<?php _e('Attempt to find location took too long', 'geodirectory'); ?>";
|
|
| 669 | 669 | break; |
| 670 | 670 | default: |
| 671 | - msg = "<?php _e('Location detection not supported in browser','geodirectory');?>";
|
|
| 671 | + msg = "<?php _e('Location detection not supported in browser', 'geodirectory'); ?>";
|
|
| 672 | 672 | } |
| 673 | 673 | jQuery('#info').html(msg);
|
| 674 | 674 | } |
@@ -709,7 +709,7 @@ discard block |
||
| 709 | 709 | * @param object $post The post object. |
| 710 | 710 | * @param string $link The link to the post. |
| 711 | 711 | */ |
| 712 | - $return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img"> </span></a>',$post,$link);
|
|
| 712 | + $return = apply_filters('geodir_featured_badge_on_image', '<a href="'.$link.'"><span class="geodir_featured_img"> </span></a>', $post, $link);
|
|
| 713 | 713 | break; |
| 714 | 714 | case 'new' : |
| 715 | 715 | /** |
@@ -719,7 +719,7 @@ discard block |
||
| 719 | 719 | * @param object $post The post object. |
| 720 | 720 | * @param string $link The link to the post. |
| 721 | 721 | */ |
| 722 | - $return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing"> </span></a>',$post,$link);
|
|
| 722 | + $return = apply_filters('geodir_new_badge_on_image', '<a href="'.$link.'"><span class="geodir_new_listing"> </span></a>', $post, $link);
|
|
| 723 | 723 | break; |
| 724 | 724 | |
| 725 | 725 | } |
@@ -118,10 +118,11 @@ discard block |
||
| 118 | 118 | $instance['listing_width'] = strip_tags($new_instance['listing_width']); |
| 119 | 119 | $instance['list_sort'] = strip_tags($new_instance['list_sort']); |
| 120 | 120 | $instance['character_count'] = $new_instance['character_count']; |
| 121 | - if (isset($new_instance['add_location_filter']) && $new_instance['add_location_filter'] != '') |
|
| 122 | - $instance['add_location_filter'] = strip_tags($new_instance['add_location_filter']); |
|
| 123 | - else |
|
| 124 | - $instance['add_location_filter'] = '0'; |
|
| 121 | + if (isset($new_instance['add_location_filter']) && $new_instance['add_location_filter'] != '') { |
|
| 122 | + $instance['add_location_filter'] = strip_tags($new_instance['add_location_filter']); |
|
| 123 | + } else { |
|
| 124 | + $instance['add_location_filter'] = '0'; |
|
| 125 | + } |
|
| 125 | 126 | |
| 126 | 127 | return $instance; |
| 127 | 128 | } |
@@ -279,7 +280,10 @@ discard block |
||
| 279 | 280 | <label for="<?php echo $this->get_field_id('add_location_filter'); ?>"> |
| 280 | 281 | <?php _e('Enable Location Filter:', 'geodirectory');?> |
| 281 | 282 | <input type="checkbox" id="<?php echo $this->get_field_id('add_location_filter'); ?>" |
| 282 | - name="<?php echo $this->get_field_name('add_location_filter'); ?>" <?php if ($add_location_filter) echo 'checked="checked"';?> |
|
| 283 | + name="<?php echo $this->get_field_name('add_location_filter'); ?>" <?php if ($add_location_filter) { |
|
| 284 | + echo 'checked="checked"'; |
|
| 285 | +} |
|
| 286 | +?> |
|
| 283 | 287 | value="1"/> |
| 284 | 288 | </label> |
| 285 | 289 | </p> |
@@ -51,11 +51,11 @@ discard block |
||
| 51 | 51 | * @param string $instance ['tab_layout'] Best of widget tab layout name. |
| 52 | 52 | */ |
| 53 | 53 | $tab_layout = empty($instance['tab_layout']) ? 'bestof-tabs-on-top' : apply_filters('bestof_widget_tab_layout', $instance['tab_layout']); |
| 54 | - echo '<div class="bestof-widget-tab-layout ' . $tab_layout . '">'; |
|
| 54 | + echo '<div class="bestof-widget-tab-layout '.$tab_layout.'">'; |
|
| 55 | 55 | echo $before_widget; |
| 56 | 56 | $loc_terms = geodir_get_current_location_terms(); |
| 57 | 57 | if (!empty($loc_terms)) { |
| 58 | - $cur_location = ' : ' . geodir_ucwords(str_replace('-', ' ', end($loc_terms))); |
|
| 58 | + $cur_location = ' : '.geodir_ucwords(str_replace('-', ' ', end($loc_terms))); |
|
| 59 | 59 | } else { |
| 60 | 60 | $cur_location = ''; |
| 61 | 61 | } |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | * |
| 77 | 77 | * @param string $instance ['title'] The widget title. |
| 78 | 78 | */ |
| 79 | - $title = empty($instance['title']) ? wp_sprintf(__('Best of %s', 'geodirectory'), get_bloginfo('name') . $cur_location) : apply_filters('bestof_widget_title', __($instance['title'], 'geodirectory')); |
|
| 79 | + $title = empty($instance['title']) ? wp_sprintf(__('Best of %s', 'geodirectory'), get_bloginfo('name').$cur_location) : apply_filters('bestof_widget_title', __($instance['title'], 'geodirectory')); |
|
| 80 | 80 | |
| 81 | 81 | /** |
| 82 | 82 | * Filter the post type. |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | |
| 205 | - echo $before_title . __($title,'geodirectory') . $after_title; |
|
| 205 | + echo $before_title.__($title, 'geodirectory').$after_title; |
|
| 206 | 206 | |
| 207 | 207 | //term navigation - start |
| 208 | 208 | echo '<div class="geodir-tabs gd-bestof-tabs" id="gd-bestof-tabs" style="position:relative;">'; |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | $is_dropdown = ($tab_layout == 'bestof-tabs-as-dropdown') ? true : false; |
| 214 | 214 | |
| 215 | 215 | if ($is_dropdown) { |
| 216 | - $nav_html .= '<select id="geodir_bestof_tab_dd" class="chosen_select" name="geodir_bestof_tab_dd" data-placeholder="' . esc_attr(__('Select Category', 'geodirectory')) . '">'; |
|
| 216 | + $nav_html .= '<select id="geodir_bestof_tab_dd" class="chosen_select" name="geodir_bestof_tab_dd" data-placeholder="'.esc_attr(__('Select Category', 'geodirectory')).'">'; |
|
| 217 | 217 | } else { |
| 218 | 218 | $nav_html .= '<dl class="geodir-tab-head geodir-bestof-cat-list">'; |
| 219 | 219 | $nav_html .= '<dt></dt>'; |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | } |
| 231 | 231 | if ($is_dropdown) { |
| 232 | 232 | $selected = ($cat_count == 1) ? 'selected="selected"' : ''; |
| 233 | - $nav_html .= '<option ' . $selected . ' value="' . $cat->term_id . '">' . geodir_ucwords($cat->name) . '</option>'; |
|
| 233 | + $nav_html .= '<option '.$selected.' value="'.$cat->term_id.'">'.geodir_ucwords($cat->name).'</option>'; |
|
| 234 | 234 | } else { |
| 235 | 235 | if ($cat_count == 1) { |
| 236 | 236 | $nav_html .= '<dd class="geodir-tab-active">'; |
@@ -238,8 +238,8 @@ discard block |
||
| 238 | 238 | $nav_html .= '<dd class="">'; |
| 239 | 239 | } |
| 240 | 240 | $term_icon_url = !empty($term_icon) && isset($term_icon[$cat->term_id]) ? $term_icon[$cat->term_id] : ''; |
| 241 | - $nav_html .= '<a data-termid="' . $cat->term_id . '" href="' . get_term_link($cat, $cat->taxonomy) . '">'; |
|
| 242 | - $nav_html .= '<img alt="' . $cat->name . ' icon" class="bestof-cat-icon" src="' . $term_icon_url . '"/>'; |
|
| 241 | + $nav_html .= '<a data-termid="'.$cat->term_id.'" href="'.get_term_link($cat, $cat->taxonomy).'">'; |
|
| 242 | + $nav_html .= '<img alt="'.$cat->name.' icon" class="bestof-cat-icon" src="'.$term_icon_url.'"/>'; |
|
| 243 | 243 | $nav_html .= '<span>'; |
| 244 | 244 | $nav_html .= geodir_ucwords($cat->name); |
| 245 | 245 | $nav_html .= '<small>'; |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | if ($num_reviews == 0) { |
| 249 | 249 | $reviews = __('No Reviews', 'geodirectory'); |
| 250 | 250 | } elseif ($num_reviews > 1) { |
| 251 | - $reviews = $num_reviews . __(' Reviews', 'geodirectory'); |
|
| 251 | + $reviews = $num_reviews.__(' Reviews', 'geodirectory'); |
|
| 252 | 252 | } else { |
| 253 | 253 | $reviews = __('1 Review', 'geodirectory'); |
| 254 | 254 | } |
@@ -321,7 +321,7 @@ discard block |
||
| 321 | 321 | */ |
| 322 | 322 | $view_all_link = apply_filters('geodir_bestof_widget_view_all_link', $view_all_link, $post_type, $first_term); |
| 323 | 323 | |
| 324 | - echo '<h3 class="bestof-cat-title">' . wp_sprintf(__('Best of %s', 'geodirectory'), $first_term->name) . '<a href="' . esc_url($view_all_link) . '">' . __("View all", 'geodirectory') . '</a></h3>'; |
|
| 324 | + echo '<h3 class="bestof-cat-title">'.wp_sprintf(__('Best of %s', 'geodirectory'), $first_term->name).'<a href="'.esc_url($view_all_link).'">'.__("View all", 'geodirectory').'</a></h3>'; |
|
| 325 | 325 | } |
| 326 | 326 | if ($excerpt_type == 'show-reviews') { |
| 327 | 327 | add_filter('get_the_excerpt', 'best_of_show_review_in_excerpt'); |
@@ -378,7 +378,7 @@ discard block |
||
| 378 | 378 | */ |
| 379 | 379 | public function form($instance) |
| 380 | 380 | { |
| 381 | - $instance = wp_parse_args((array)$instance, |
|
| 381 | + $instance = wp_parse_args((array) $instance, |
|
| 382 | 382 | array( |
| 383 | 383 | 'title' => '', |
| 384 | 384 | 'post_type' => '', |
@@ -403,7 +403,7 @@ discard block |
||
| 403 | 403 | |
| 404 | 404 | ?> |
| 405 | 405 | <p> |
| 406 | - <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'geodirectory');?> |
|
| 406 | + <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'geodirectory'); ?> |
|
| 407 | 407 | |
| 408 | 408 | <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" |
| 409 | 409 | name="<?php echo $this->get_field_name('title'); ?>" type="text" |
@@ -413,7 +413,7 @@ discard block |
||
| 413 | 413 | |
| 414 | 414 | <p> |
| 415 | 415 | <label |
| 416 | - for="<?php echo $this->get_field_id('post_type'); ?>"><?php _e('Post Type:', 'geodirectory');?> |
|
| 416 | + for="<?php echo $this->get_field_id('post_type'); ?>"><?php _e('Post Type:', 'geodirectory'); ?> |
|
| 417 | 417 | |
| 418 | 418 | <?php $postypes = geodir_get_posttypes(); |
| 419 | 419 | /** |
@@ -445,7 +445,7 @@ discard block |
||
| 445 | 445 | <p> |
| 446 | 446 | |
| 447 | 447 | <label |
| 448 | - for="<?php echo $this->get_field_id('post_limit'); ?>"><?php _e('Number of posts:', 'geodirectory');?> |
|
| 448 | + for="<?php echo $this->get_field_id('post_limit'); ?>"><?php _e('Number of posts:', 'geodirectory'); ?> |
|
| 449 | 449 | |
| 450 | 450 | <input class="widefat" id="<?php echo $this->get_field_id('post_limit'); ?>" |
| 451 | 451 | name="<?php echo $this->get_field_name('post_limit'); ?>" type="text" |
@@ -456,7 +456,7 @@ discard block |
||
| 456 | 456 | <p> |
| 457 | 457 | |
| 458 | 458 | <label |
| 459 | - for="<?php echo $this->get_field_id('categ_limit'); ?>"><?php _e('Number of categories:', 'geodirectory');?> |
|
| 459 | + for="<?php echo $this->get_field_id('categ_limit'); ?>"><?php _e('Number of categories:', 'geodirectory'); ?> |
|
| 460 | 460 | |
| 461 | 461 | <input class="widefat" id="<?php echo $this->get_field_id('categ_limit'); ?>" |
| 462 | 462 | name="<?php echo $this->get_field_name('categ_limit'); ?>" type="text" |
@@ -466,7 +466,7 @@ discard block |
||
| 466 | 466 | |
| 467 | 467 | <p> |
| 468 | 468 | <label |
| 469 | - for="<?php echo $this->get_field_id('character_count'); ?>"><?php _e('Post Content excerpt character count :', 'geodirectory');?> |
|
| 469 | + for="<?php echo $this->get_field_id('character_count'); ?>"><?php _e('Post Content excerpt character count :', 'geodirectory'); ?> |
|
| 470 | 470 | <input class="widefat" id="<?php echo $this->get_field_id('character_count'); ?>" |
| 471 | 471 | name="<?php echo $this->get_field_name('character_count'); ?>" type="text" |
| 472 | 472 | value="<?php echo esc_attr($character_count); ?>"/> |
@@ -474,7 +474,7 @@ discard block |
||
| 474 | 474 | </p> |
| 475 | 475 | <p> |
| 476 | 476 | <label |
| 477 | - for="<?php echo $this->get_field_id('tab_layout'); ?>"><?php _e('Tab Layout:', 'geodirectory');?> |
|
| 477 | + for="<?php echo $this->get_field_id('tab_layout'); ?>"><?php _e('Tab Layout:', 'geodirectory'); ?> |
|
| 478 | 478 | |
| 479 | 479 | <select class="widefat" id="<?php echo $this->get_field_id('tab_layout'); ?>" |
| 480 | 480 | name="<?php echo $this->get_field_name('tab_layout'); ?>"> |
@@ -495,7 +495,7 @@ discard block |
||
| 495 | 495 | |
| 496 | 496 | <p> |
| 497 | 497 | <label |
| 498 | - for="<?php echo $this->get_field_id('excerpt_type'); ?>"><?php _e('Excerpt Type:', 'geodirectory');?> |
|
| 498 | + for="<?php echo $this->get_field_id('excerpt_type'); ?>"><?php _e('Excerpt Type:', 'geodirectory'); ?> |
|
| 499 | 499 | |
| 500 | 500 | <select class="widefat" id="<?php echo $this->get_field_id('excerpt_type'); ?>" |
| 501 | 501 | name="<?php echo $this->get_field_name('excerpt_type'); ?>"> |
@@ -512,9 +512,9 @@ discard block |
||
| 512 | 512 | |
| 513 | 513 | <p> |
| 514 | 514 | <label for="<?php echo $this->get_field_id('add_location_filter'); ?>"> |
| 515 | - <?php _e('Enable Location Filter:', 'geodirectory');?> |
|
| 515 | + <?php _e('Enable Location Filter:', 'geodirectory'); ?> |
|
| 516 | 516 | <input type="checkbox" id="<?php echo $this->get_field_id('add_location_filter'); ?>" |
| 517 | - name="<?php echo $this->get_field_name('add_location_filter'); ?>" <?php if ($add_location_filter) echo 'checked="checked"';?> |
|
| 517 | + name="<?php echo $this->get_field_name('add_location_filter'); ?>" <?php if ($add_location_filter) echo 'checked="checked"'; ?> |
|
| 518 | 518 | value="1"/> |
| 519 | 519 | </label> |
| 520 | 520 | </p> |
@@ -662,7 +662,7 @@ discard block |
||
| 662 | 662 | /** This filter is documented in geodirectory-widgets/geodirectory_bestof_widget.php */ |
| 663 | 663 | $view_all_link = apply_filters('geodir_bestof_widget_view_all_link', $view_all_link, $post_type, $term); |
| 664 | 664 | |
| 665 | - echo '<h3 class="bestof-cat-title">' . wp_sprintf(__('Best of %s', 'geodirectory'), $term->name) . '<a href="' . esc_url($view_all_link) . '">' . __("View all", 'geodirectory') . '</a></h3>'; |
|
| 665 | + echo '<h3 class="bestof-cat-title">'.wp_sprintf(__('Best of %s', 'geodirectory'), $term->name).'<a href="'.esc_url($view_all_link).'">'.__("View all", 'geodirectory').'</a></h3>'; |
|
| 666 | 666 | } |
| 667 | 667 | if ($excerpt_type == 'show-reviews') { |
| 668 | 668 | add_filter('get_the_excerpt', 'best_of_show_review_in_excerpt'); |
@@ -14,280 +14,280 @@ discard block |
||
| 14 | 14 | */ |
| 15 | 15 | class geodir_bestof_widget extends WP_Widget |
| 16 | 16 | { |
| 17 | - /** |
|
| 18 | - * Register the best of widget with WordPress. |
|
| 19 | - * |
|
| 20 | - * @since 1.3.9 |
|
| 21 | - * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
|
| 22 | - */ |
|
| 23 | - public function __construct() |
|
| 24 | - { |
|
| 25 | - $widget_ops = array('classname' => 'geodir_bestof_widget', 'description' => __('GD > Best of widget', 'geodirectory')); |
|
| 26 | - parent::__construct( |
|
| 27 | - 'bestof_widget', // Base ID |
|
| 28 | - __('GD > Best of widget', 'geodirectory'), // Name |
|
| 29 | - $widget_ops// Args |
|
| 30 | - ); |
|
| 31 | - } |
|
| 32 | - |
|
| 33 | - /** |
|
| 34 | - * Front-end display content for best of widget. |
|
| 35 | - * |
|
| 36 | - * @since 1.3.9 |
|
| 37 | - * @since 1.5.1 Added filter to view all link. |
|
| 38 | - * @since 1.5.1 Declare function public. |
|
| 39 | - * |
|
| 40 | - * @param array $args Widget arguments. |
|
| 41 | - * @param array $instance Saved values from database. |
|
| 42 | - */ |
|
| 43 | - public function widget($args, $instance) |
|
| 44 | - { |
|
| 45 | - extract($args); |
|
| 46 | - /** |
|
| 47 | - * Filter the best of widget tab layout. |
|
| 48 | - * |
|
| 49 | - * @since 1.3.9 |
|
| 50 | - * |
|
| 51 | - * @param string $instance ['tab_layout'] Best of widget tab layout name. |
|
| 52 | - */ |
|
| 53 | - $tab_layout = empty($instance['tab_layout']) ? 'bestof-tabs-on-top' : apply_filters('bestof_widget_tab_layout', $instance['tab_layout']); |
|
| 54 | - echo '<div class="bestof-widget-tab-layout ' . $tab_layout . '">'; |
|
| 55 | - echo $before_widget; |
|
| 56 | - $loc_terms = geodir_get_current_location_terms(); |
|
| 57 | - if (!empty($loc_terms)) { |
|
| 58 | - $cur_location = ' : ' . geodir_ucwords(str_replace('-', ' ', end($loc_terms))); |
|
| 59 | - } else { |
|
| 60 | - $cur_location = ''; |
|
| 61 | - } |
|
| 62 | - |
|
| 63 | - /** |
|
| 64 | - * Filter the current location name. |
|
| 65 | - * |
|
| 66 | - * @since 1.3.9 |
|
| 67 | - * |
|
| 68 | - * @param string $cur_location Current location name. |
|
| 69 | - */ |
|
| 70 | - $cur_location = apply_filters('bestof_widget_cur_location', $cur_location); |
|
| 71 | - |
|
| 72 | - /** |
|
| 73 | - * Filter the widget title. |
|
| 74 | - * |
|
| 75 | - * @since 1.3.9 |
|
| 76 | - * |
|
| 77 | - * @param string $instance ['title'] The widget title. |
|
| 78 | - */ |
|
| 79 | - $title = empty($instance['title']) ? wp_sprintf(__('Best of %s', 'geodirectory'), get_bloginfo('name') . $cur_location) : apply_filters('bestof_widget_title', __($instance['title'], 'geodirectory')); |
|
| 80 | - |
|
| 81 | - /** |
|
| 82 | - * Filter the post type. |
|
| 83 | - * |
|
| 84 | - * @since 1.3.9 |
|
| 85 | - * |
|
| 86 | - * @param string $instance ['post_type'] The post type. |
|
| 87 | - */ |
|
| 88 | - $post_type = empty($instance['post_type']) ? 'gd_place' : apply_filters('bestof_widget_post_type', $instance['post_type']); |
|
| 89 | - |
|
| 90 | - /** |
|
| 91 | - * Filter the excerpt type. |
|
| 92 | - * |
|
| 93 | - * @since 1.5.4 |
|
| 94 | - * |
|
| 95 | - * @param string $instance ['excerpt_type'] The excerpt type. |
|
| 96 | - */ |
|
| 97 | - $excerpt_type = empty($instance['excerpt_type']) ? 'show-desc' : apply_filters('bestof_widget_excerpt_type', $instance['excerpt_type']); |
|
| 98 | - |
|
| 99 | - |
|
| 100 | - /** |
|
| 101 | - * Filter the listing limit. |
|
| 102 | - * |
|
| 103 | - * @since 1.3.9 |
|
| 104 | - * |
|
| 105 | - * @param int $instance ['post_limit'] No. of posts to display. |
|
| 106 | - */ |
|
| 107 | - $post_limit = empty($instance['post_limit']) ? '5' : apply_filters('bestof_widget_post_limit', $instance['post_limit']); |
|
| 108 | - |
|
| 109 | - /** |
|
| 110 | - * Filter the category limit. |
|
| 111 | - * |
|
| 112 | - * @since 1.3.9 |
|
| 113 | - * |
|
| 114 | - * @param int $instance ['categ_limit'] No. of categories to display. |
|
| 115 | - */ |
|
| 116 | - $categ_limit = empty($instance['categ_limit']) ? '3' : apply_filters('bestof_widget_categ_limit', $instance['categ_limit']); |
|
| 117 | - $use_viewing_post_type = !empty($instance['use_viewing_post_type']) ? true : false; |
|
| 118 | - |
|
| 119 | - /** |
|
| 120 | - * Filter the use of location filter. |
|
| 121 | - * |
|
| 122 | - * @since 1.3.9 |
|
| 123 | - * |
|
| 124 | - * @param int|bool $instance ['add_location_filter'] Filter listings using current location. |
|
| 125 | - */ |
|
| 126 | - $add_location_filter = empty($instance['add_location_filter']) ? '1' : apply_filters('bestof_widget_location_filter', $instance['add_location_filter']); |
|
| 127 | - |
|
| 128 | - // set post type to current viewing post type |
|
| 129 | - if ($use_viewing_post_type) { |
|
| 130 | - $current_post_type = geodir_get_current_posttype(); |
|
| 131 | - if ($current_post_type != '' && $current_post_type != $post_type) { |
|
| 132 | - $post_type = $current_post_type; |
|
| 133 | - } |
|
| 134 | - } |
|
| 135 | - |
|
| 136 | - if (isset($instance['character_count'])) { |
|
| 137 | - /** |
|
| 138 | - * Filter the widget's excerpt character count. |
|
| 139 | - * |
|
| 140 | - * @since 1.3.9 |
|
| 141 | - * |
|
| 142 | - * @param int $instance ['character_count'] Excerpt character count. |
|
| 143 | - */ |
|
| 144 | - $character_count = apply_filters('bestof_widget_list_character_count', $instance['character_count']); |
|
| 145 | - } else { |
|
| 146 | - $character_count = ''; |
|
| 147 | - } |
|
| 148 | - |
|
| 149 | - $category_taxonomy = geodir_get_taxonomies($post_type); |
|
| 150 | - |
|
| 151 | - $term_args = array( |
|
| 152 | - 'hide_empty' => true, |
|
| 153 | - 'parent' => 0 |
|
| 154 | - ); |
|
| 155 | - |
|
| 156 | - if (is_tax()) { |
|
| 157 | - $taxonomy = get_query_var('taxonomy'); |
|
| 158 | - $cur_term = get_query_var('term'); |
|
| 159 | - $term_data = get_term_by('name', $cur_term, $taxonomy); |
|
| 160 | - $term_args['parent'] = $term_data->term_id; |
|
| 161 | - } |
|
| 162 | - |
|
| 163 | - $terms = get_terms($category_taxonomy[0], $term_args); |
|
| 164 | - |
|
| 165 | - $term_reviews = geodir_count_reviews_by_terms(); |
|
| 166 | - $a_terms = array(); |
|
| 167 | - foreach ($terms as $term) { |
|
| 168 | - |
|
| 169 | - |
|
| 170 | - if ($term->count > 0) { |
|
| 171 | - if (isset($term_reviews[$term->term_id])) { |
|
| 172 | - $term->review_count = $term_reviews[$term->term_id]; |
|
| 173 | - } else { |
|
| 174 | - $term->review_count = '0'; |
|
| 175 | - } |
|
| 176 | - |
|
| 177 | - $a_terms[] = $term; |
|
| 178 | - } |
|
| 179 | - |
|
| 180 | - } |
|
| 181 | - |
|
| 182 | - |
|
| 183 | - $terms = geodir_sort_terms($a_terms, 'review_count'); |
|
| 184 | - |
|
| 185 | - $query_args = array( |
|
| 186 | - 'posts_per_page' => $post_limit, |
|
| 187 | - 'is_geodir_loop' => true, |
|
| 188 | - 'post_type' => $post_type, |
|
| 189 | - 'gd_location' => $add_location_filter ? true : false, |
|
| 190 | - 'order_by' => 'high_review' |
|
| 191 | - ); |
|
| 192 | - if ($character_count >= 0) { |
|
| 193 | - $query_args['excerpt_length'] = $character_count; |
|
| 194 | - } |
|
| 195 | - |
|
| 196 | - $layout = array(); |
|
| 197 | - if ($tab_layout == 'bestof-tabs-as-dropdown') { |
|
| 198 | - $layout[] = $tab_layout; |
|
| 199 | - } else { |
|
| 200 | - $layout[] = 'bestof-tabs-as-dropdown'; |
|
| 201 | - $layout[] = $tab_layout; |
|
| 202 | - } |
|
| 203 | - |
|
| 204 | - |
|
| 205 | - echo $before_title . __($title,'geodirectory') . $after_title; |
|
| 206 | - |
|
| 207 | - //term navigation - start |
|
| 208 | - echo '<div class="geodir-tabs gd-bestof-tabs" id="gd-bestof-tabs" style="position:relative;">'; |
|
| 209 | - |
|
| 210 | - $final_html = ''; |
|
| 211 | - foreach ($layout as $tab_layout) { |
|
| 212 | - $nav_html = ''; |
|
| 213 | - $is_dropdown = ($tab_layout == 'bestof-tabs-as-dropdown') ? true : false; |
|
| 214 | - |
|
| 215 | - if ($is_dropdown) { |
|
| 216 | - $nav_html .= '<select id="geodir_bestof_tab_dd" class="chosen_select" name="geodir_bestof_tab_dd" data-placeholder="' . esc_attr(__('Select Category', 'geodirectory')) . '">'; |
|
| 217 | - } else { |
|
| 218 | - $nav_html .= '<dl class="geodir-tab-head geodir-bestof-cat-list">'; |
|
| 219 | - $nav_html .= '<dt></dt>'; |
|
| 220 | - } |
|
| 221 | - |
|
| 222 | - |
|
| 223 | - $term_icon = geodir_get_term_icon(); |
|
| 224 | - $cat_count = 0; |
|
| 225 | - if (!empty($terms)) { |
|
| 226 | - foreach ($terms as $cat) { |
|
| 227 | - $cat_count++; |
|
| 228 | - if ($cat_count > $categ_limit) { |
|
| 229 | - break; |
|
| 230 | - } |
|
| 231 | - if ($is_dropdown) { |
|
| 232 | - $selected = ($cat_count == 1) ? 'selected="selected"' : ''; |
|
| 233 | - $nav_html .= '<option ' . $selected . ' value="' . $cat->term_id . '">' . geodir_ucwords($cat->name) . '</option>'; |
|
| 234 | - } else { |
|
| 235 | - if ($cat_count == 1) { |
|
| 236 | - $nav_html .= '<dd class="geodir-tab-active">'; |
|
| 237 | - } else { |
|
| 238 | - $nav_html .= '<dd class="">'; |
|
| 239 | - } |
|
| 240 | - $term_icon_url = !empty($term_icon) && isset($term_icon[$cat->term_id]) ? $term_icon[$cat->term_id] : ''; |
|
| 241 | - $nav_html .= '<a data-termid="' . $cat->term_id . '" href="' . get_term_link($cat, $cat->taxonomy) . '">'; |
|
| 242 | - $nav_html .= '<img alt="' . $cat->name . ' icon" class="bestof-cat-icon" src="' . $term_icon_url . '"/>'; |
|
| 243 | - $nav_html .= '<span>'; |
|
| 244 | - $nav_html .= geodir_ucwords($cat->name); |
|
| 245 | - $nav_html .= '<small>'; |
|
| 246 | - if (isset($cat->review_count)) { |
|
| 247 | - $num_reviews = $cat->review_count; |
|
| 248 | - if ($num_reviews == 0) { |
|
| 249 | - $reviews = __('No Reviews', 'geodirectory'); |
|
| 250 | - } elseif ($num_reviews > 1) { |
|
| 251 | - $reviews = $num_reviews . __(' Reviews', 'geodirectory'); |
|
| 252 | - } else { |
|
| 253 | - $reviews = __('1 Review', 'geodirectory'); |
|
| 254 | - } |
|
| 255 | - $nav_html .= $reviews; |
|
| 256 | - } |
|
| 257 | - $nav_html .= '</small>'; |
|
| 258 | - $nav_html .= '</span>'; |
|
| 259 | - $nav_html .= '</a>'; |
|
| 260 | - $nav_html .= '</dd>'; |
|
| 261 | - } |
|
| 262 | - } |
|
| 263 | - } |
|
| 264 | - |
|
| 265 | - if ($is_dropdown) { |
|
| 266 | - $nav_html .= '</select>'; |
|
| 267 | - } else { |
|
| 268 | - $nav_html .= '</dl>'; |
|
| 269 | - } |
|
| 270 | - $final_html .= $nav_html; |
|
| 271 | - } |
|
| 272 | - if ($terms) { |
|
| 273 | - echo $final_html; |
|
| 274 | - } |
|
| 275 | - echo '</div>'; |
|
| 276 | - //term navigation - end |
|
| 277 | - |
|
| 278 | - //first term listings by default - start |
|
| 279 | - $first_term = ''; |
|
| 280 | - if ($terms) { |
|
| 281 | - $first_term = $terms[0]; |
|
| 282 | - $tax_query = array( |
|
| 283 | - 'taxonomy' => $category_taxonomy[0], |
|
| 284 | - 'field' => 'id', |
|
| 285 | - 'terms' => $first_term->term_id |
|
| 286 | - ); |
|
| 287 | - $query_args['tax_query'] = array($tax_query); |
|
| 288 | - } |
|
| 289 | - |
|
| 290 | - ?> |
|
| 17 | + /** |
|
| 18 | + * Register the best of widget with WordPress. |
|
| 19 | + * |
|
| 20 | + * @since 1.3.9 |
|
| 21 | + * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
|
| 22 | + */ |
|
| 23 | + public function __construct() |
|
| 24 | + { |
|
| 25 | + $widget_ops = array('classname' => 'geodir_bestof_widget', 'description' => __('GD > Best of widget', 'geodirectory')); |
|
| 26 | + parent::__construct( |
|
| 27 | + 'bestof_widget', // Base ID |
|
| 28 | + __('GD > Best of widget', 'geodirectory'), // Name |
|
| 29 | + $widget_ops// Args |
|
| 30 | + ); |
|
| 31 | + } |
|
| 32 | + |
|
| 33 | + /** |
|
| 34 | + * Front-end display content for best of widget. |
|
| 35 | + * |
|
| 36 | + * @since 1.3.9 |
|
| 37 | + * @since 1.5.1 Added filter to view all link. |
|
| 38 | + * @since 1.5.1 Declare function public. |
|
| 39 | + * |
|
| 40 | + * @param array $args Widget arguments. |
|
| 41 | + * @param array $instance Saved values from database. |
|
| 42 | + */ |
|
| 43 | + public function widget($args, $instance) |
|
| 44 | + { |
|
| 45 | + extract($args); |
|
| 46 | + /** |
|
| 47 | + * Filter the best of widget tab layout. |
|
| 48 | + * |
|
| 49 | + * @since 1.3.9 |
|
| 50 | + * |
|
| 51 | + * @param string $instance ['tab_layout'] Best of widget tab layout name. |
|
| 52 | + */ |
|
| 53 | + $tab_layout = empty($instance['tab_layout']) ? 'bestof-tabs-on-top' : apply_filters('bestof_widget_tab_layout', $instance['tab_layout']); |
|
| 54 | + echo '<div class="bestof-widget-tab-layout ' . $tab_layout . '">'; |
|
| 55 | + echo $before_widget; |
|
| 56 | + $loc_terms = geodir_get_current_location_terms(); |
|
| 57 | + if (!empty($loc_terms)) { |
|
| 58 | + $cur_location = ' : ' . geodir_ucwords(str_replace('-', ' ', end($loc_terms))); |
|
| 59 | + } else { |
|
| 60 | + $cur_location = ''; |
|
| 61 | + } |
|
| 62 | + |
|
| 63 | + /** |
|
| 64 | + * Filter the current location name. |
|
| 65 | + * |
|
| 66 | + * @since 1.3.9 |
|
| 67 | + * |
|
| 68 | + * @param string $cur_location Current location name. |
|
| 69 | + */ |
|
| 70 | + $cur_location = apply_filters('bestof_widget_cur_location', $cur_location); |
|
| 71 | + |
|
| 72 | + /** |
|
| 73 | + * Filter the widget title. |
|
| 74 | + * |
|
| 75 | + * @since 1.3.9 |
|
| 76 | + * |
|
| 77 | + * @param string $instance ['title'] The widget title. |
|
| 78 | + */ |
|
| 79 | + $title = empty($instance['title']) ? wp_sprintf(__('Best of %s', 'geodirectory'), get_bloginfo('name') . $cur_location) : apply_filters('bestof_widget_title', __($instance['title'], 'geodirectory')); |
|
| 80 | + |
|
| 81 | + /** |
|
| 82 | + * Filter the post type. |
|
| 83 | + * |
|
| 84 | + * @since 1.3.9 |
|
| 85 | + * |
|
| 86 | + * @param string $instance ['post_type'] The post type. |
|
| 87 | + */ |
|
| 88 | + $post_type = empty($instance['post_type']) ? 'gd_place' : apply_filters('bestof_widget_post_type', $instance['post_type']); |
|
| 89 | + |
|
| 90 | + /** |
|
| 91 | + * Filter the excerpt type. |
|
| 92 | + * |
|
| 93 | + * @since 1.5.4 |
|
| 94 | + * |
|
| 95 | + * @param string $instance ['excerpt_type'] The excerpt type. |
|
| 96 | + */ |
|
| 97 | + $excerpt_type = empty($instance['excerpt_type']) ? 'show-desc' : apply_filters('bestof_widget_excerpt_type', $instance['excerpt_type']); |
|
| 98 | + |
|
| 99 | + |
|
| 100 | + /** |
|
| 101 | + * Filter the listing limit. |
|
| 102 | + * |
|
| 103 | + * @since 1.3.9 |
|
| 104 | + * |
|
| 105 | + * @param int $instance ['post_limit'] No. of posts to display. |
|
| 106 | + */ |
|
| 107 | + $post_limit = empty($instance['post_limit']) ? '5' : apply_filters('bestof_widget_post_limit', $instance['post_limit']); |
|
| 108 | + |
|
| 109 | + /** |
|
| 110 | + * Filter the category limit. |
|
| 111 | + * |
|
| 112 | + * @since 1.3.9 |
|
| 113 | + * |
|
| 114 | + * @param int $instance ['categ_limit'] No. of categories to display. |
|
| 115 | + */ |
|
| 116 | + $categ_limit = empty($instance['categ_limit']) ? '3' : apply_filters('bestof_widget_categ_limit', $instance['categ_limit']); |
|
| 117 | + $use_viewing_post_type = !empty($instance['use_viewing_post_type']) ? true : false; |
|
| 118 | + |
|
| 119 | + /** |
|
| 120 | + * Filter the use of location filter. |
|
| 121 | + * |
|
| 122 | + * @since 1.3.9 |
|
| 123 | + * |
|
| 124 | + * @param int|bool $instance ['add_location_filter'] Filter listings using current location. |
|
| 125 | + */ |
|
| 126 | + $add_location_filter = empty($instance['add_location_filter']) ? '1' : apply_filters('bestof_widget_location_filter', $instance['add_location_filter']); |
|
| 127 | + |
|
| 128 | + // set post type to current viewing post type |
|
| 129 | + if ($use_viewing_post_type) { |
|
| 130 | + $current_post_type = geodir_get_current_posttype(); |
|
| 131 | + if ($current_post_type != '' && $current_post_type != $post_type) { |
|
| 132 | + $post_type = $current_post_type; |
|
| 133 | + } |
|
| 134 | + } |
|
| 135 | + |
|
| 136 | + if (isset($instance['character_count'])) { |
|
| 137 | + /** |
|
| 138 | + * Filter the widget's excerpt character count. |
|
| 139 | + * |
|
| 140 | + * @since 1.3.9 |
|
| 141 | + * |
|
| 142 | + * @param int $instance ['character_count'] Excerpt character count. |
|
| 143 | + */ |
|
| 144 | + $character_count = apply_filters('bestof_widget_list_character_count', $instance['character_count']); |
|
| 145 | + } else { |
|
| 146 | + $character_count = ''; |
|
| 147 | + } |
|
| 148 | + |
|
| 149 | + $category_taxonomy = geodir_get_taxonomies($post_type); |
|
| 150 | + |
|
| 151 | + $term_args = array( |
|
| 152 | + 'hide_empty' => true, |
|
| 153 | + 'parent' => 0 |
|
| 154 | + ); |
|
| 155 | + |
|
| 156 | + if (is_tax()) { |
|
| 157 | + $taxonomy = get_query_var('taxonomy'); |
|
| 158 | + $cur_term = get_query_var('term'); |
|
| 159 | + $term_data = get_term_by('name', $cur_term, $taxonomy); |
|
| 160 | + $term_args['parent'] = $term_data->term_id; |
|
| 161 | + } |
|
| 162 | + |
|
| 163 | + $terms = get_terms($category_taxonomy[0], $term_args); |
|
| 164 | + |
|
| 165 | + $term_reviews = geodir_count_reviews_by_terms(); |
|
| 166 | + $a_terms = array(); |
|
| 167 | + foreach ($terms as $term) { |
|
| 168 | + |
|
| 169 | + |
|
| 170 | + if ($term->count > 0) { |
|
| 171 | + if (isset($term_reviews[$term->term_id])) { |
|
| 172 | + $term->review_count = $term_reviews[$term->term_id]; |
|
| 173 | + } else { |
|
| 174 | + $term->review_count = '0'; |
|
| 175 | + } |
|
| 176 | + |
|
| 177 | + $a_terms[] = $term; |
|
| 178 | + } |
|
| 179 | + |
|
| 180 | + } |
|
| 181 | + |
|
| 182 | + |
|
| 183 | + $terms = geodir_sort_terms($a_terms, 'review_count'); |
|
| 184 | + |
|
| 185 | + $query_args = array( |
|
| 186 | + 'posts_per_page' => $post_limit, |
|
| 187 | + 'is_geodir_loop' => true, |
|
| 188 | + 'post_type' => $post_type, |
|
| 189 | + 'gd_location' => $add_location_filter ? true : false, |
|
| 190 | + 'order_by' => 'high_review' |
|
| 191 | + ); |
|
| 192 | + if ($character_count >= 0) { |
|
| 193 | + $query_args['excerpt_length'] = $character_count; |
|
| 194 | + } |
|
| 195 | + |
|
| 196 | + $layout = array(); |
|
| 197 | + if ($tab_layout == 'bestof-tabs-as-dropdown') { |
|
| 198 | + $layout[] = $tab_layout; |
|
| 199 | + } else { |
|
| 200 | + $layout[] = 'bestof-tabs-as-dropdown'; |
|
| 201 | + $layout[] = $tab_layout; |
|
| 202 | + } |
|
| 203 | + |
|
| 204 | + |
|
| 205 | + echo $before_title . __($title,'geodirectory') . $after_title; |
|
| 206 | + |
|
| 207 | + //term navigation - start |
|
| 208 | + echo '<div class="geodir-tabs gd-bestof-tabs" id="gd-bestof-tabs" style="position:relative;">'; |
|
| 209 | + |
|
| 210 | + $final_html = ''; |
|
| 211 | + foreach ($layout as $tab_layout) { |
|
| 212 | + $nav_html = ''; |
|
| 213 | + $is_dropdown = ($tab_layout == 'bestof-tabs-as-dropdown') ? true : false; |
|
| 214 | + |
|
| 215 | + if ($is_dropdown) { |
|
| 216 | + $nav_html .= '<select id="geodir_bestof_tab_dd" class="chosen_select" name="geodir_bestof_tab_dd" data-placeholder="' . esc_attr(__('Select Category', 'geodirectory')) . '">'; |
|
| 217 | + } else { |
|
| 218 | + $nav_html .= '<dl class="geodir-tab-head geodir-bestof-cat-list">'; |
|
| 219 | + $nav_html .= '<dt></dt>'; |
|
| 220 | + } |
|
| 221 | + |
|
| 222 | + |
|
| 223 | + $term_icon = geodir_get_term_icon(); |
|
| 224 | + $cat_count = 0; |
|
| 225 | + if (!empty($terms)) { |
|
| 226 | + foreach ($terms as $cat) { |
|
| 227 | + $cat_count++; |
|
| 228 | + if ($cat_count > $categ_limit) { |
|
| 229 | + break; |
|
| 230 | + } |
|
| 231 | + if ($is_dropdown) { |
|
| 232 | + $selected = ($cat_count == 1) ? 'selected="selected"' : ''; |
|
| 233 | + $nav_html .= '<option ' . $selected . ' value="' . $cat->term_id . '">' . geodir_ucwords($cat->name) . '</option>'; |
|
| 234 | + } else { |
|
| 235 | + if ($cat_count == 1) { |
|
| 236 | + $nav_html .= '<dd class="geodir-tab-active">'; |
|
| 237 | + } else { |
|
| 238 | + $nav_html .= '<dd class="">'; |
|
| 239 | + } |
|
| 240 | + $term_icon_url = !empty($term_icon) && isset($term_icon[$cat->term_id]) ? $term_icon[$cat->term_id] : ''; |
|
| 241 | + $nav_html .= '<a data-termid="' . $cat->term_id . '" href="' . get_term_link($cat, $cat->taxonomy) . '">'; |
|
| 242 | + $nav_html .= '<img alt="' . $cat->name . ' icon" class="bestof-cat-icon" src="' . $term_icon_url . '"/>'; |
|
| 243 | + $nav_html .= '<span>'; |
|
| 244 | + $nav_html .= geodir_ucwords($cat->name); |
|
| 245 | + $nav_html .= '<small>'; |
|
| 246 | + if (isset($cat->review_count)) { |
|
| 247 | + $num_reviews = $cat->review_count; |
|
| 248 | + if ($num_reviews == 0) { |
|
| 249 | + $reviews = __('No Reviews', 'geodirectory'); |
|
| 250 | + } elseif ($num_reviews > 1) { |
|
| 251 | + $reviews = $num_reviews . __(' Reviews', 'geodirectory'); |
|
| 252 | + } else { |
|
| 253 | + $reviews = __('1 Review', 'geodirectory'); |
|
| 254 | + } |
|
| 255 | + $nav_html .= $reviews; |
|
| 256 | + } |
|
| 257 | + $nav_html .= '</small>'; |
|
| 258 | + $nav_html .= '</span>'; |
|
| 259 | + $nav_html .= '</a>'; |
|
| 260 | + $nav_html .= '</dd>'; |
|
| 261 | + } |
|
| 262 | + } |
|
| 263 | + } |
|
| 264 | + |
|
| 265 | + if ($is_dropdown) { |
|
| 266 | + $nav_html .= '</select>'; |
|
| 267 | + } else { |
|
| 268 | + $nav_html .= '</dl>'; |
|
| 269 | + } |
|
| 270 | + $final_html .= $nav_html; |
|
| 271 | + } |
|
| 272 | + if ($terms) { |
|
| 273 | + echo $final_html; |
|
| 274 | + } |
|
| 275 | + echo '</div>'; |
|
| 276 | + //term navigation - end |
|
| 277 | + |
|
| 278 | + //first term listings by default - start |
|
| 279 | + $first_term = ''; |
|
| 280 | + if ($terms) { |
|
| 281 | + $first_term = $terms[0]; |
|
| 282 | + $tax_query = array( |
|
| 283 | + 'taxonomy' => $category_taxonomy[0], |
|
| 284 | + 'field' => 'id', |
|
| 285 | + 'terms' => $first_term->term_id |
|
| 286 | + ); |
|
| 287 | + $query_args['tax_query'] = array($tax_query); |
|
| 288 | + } |
|
| 289 | + |
|
| 290 | + ?> |
|
| 291 | 291 | <input type="hidden" id="bestof_widget_post_type" name="bestof_widget_post_type" |
| 292 | 292 | value="<?php echo $post_type; ?>"> |
| 293 | 293 | <input type="hidden" id="bestof_widget_excerpt_type" name="bestof_widget_excerpt_type" |
@@ -298,110 +298,110 @@ discard block |
||
| 298 | 298 | value="<?php echo $category_taxonomy[0]; ?>"> |
| 299 | 299 | <input type="hidden" id="bestof_widget_location_filter" name="bestof_widget_location_filter" |
| 300 | 300 | value="<?php if ($add_location_filter) { |
| 301 | - echo 1; |
|
| 302 | - } else { |
|
| 303 | - echo 0; |
|
| 304 | - } ?>"> |
|
| 301 | + echo 1; |
|
| 302 | + } else { |
|
| 303 | + echo 0; |
|
| 304 | + } ?>"> |
|
| 305 | 305 | <input type="hidden" id="bestof_widget_char_count" name="bestof_widget_char_count" |
| 306 | 306 | value="<?php echo $character_count; ?>"> |
| 307 | 307 | <div class="geo-bestof-contentwrap geodir-tabs-content" style="position: relative; z-index: 0;"> |
| 308 | 308 | <p id="geodir-bestof-loading" class="geodir-bestof-loading"><i class="fa fa-cog fa-spin"></i></p> |
| 309 | 309 | <?php |
| 310 | - echo '<div id="geodir-bestof-places">'; |
|
| 311 | - if ($terms) { |
|
| 312 | - $view_all_link = add_query_arg(array('sort_by' => 'rating_count_desc'), get_term_link($first_term, $first_term->taxonomy)); |
|
| 313 | - /** |
|
| 314 | - * Filter the page link to view all lisitngs. |
|
| 315 | - * |
|
| 316 | - * @since 1.5.1 |
|
| 317 | - * |
|
| 318 | - * @param array $view_all_link View all listings page link. |
|
| 319 | - * @param array $post_type The Post type. |
|
| 320 | - * @param array $first_term The category term object. |
|
| 321 | - */ |
|
| 322 | - $view_all_link = apply_filters('geodir_bestof_widget_view_all_link', $view_all_link, $post_type, $first_term); |
|
| 323 | - |
|
| 324 | - echo '<h3 class="bestof-cat-title">' . wp_sprintf(__('Best of %s', 'geodirectory'), $first_term->name) . '<a href="' . esc_url($view_all_link) . '">' . __("View all", 'geodirectory') . '</a></h3>'; |
|
| 325 | - } |
|
| 326 | - if ($excerpt_type == 'show-reviews') { |
|
| 327 | - add_filter('get_the_excerpt', 'best_of_show_review_in_excerpt'); |
|
| 328 | - } |
|
| 329 | - geodir_bestof_places_by_term($query_args); |
|
| 330 | - if ($excerpt_type == 'show-reviews') { |
|
| 331 | - remove_filter('get_the_excerpt', 'best_of_show_review_in_excerpt'); |
|
| 332 | - } |
|
| 333 | - echo "</div>"; |
|
| 334 | - ?> |
|
| 310 | + echo '<div id="geodir-bestof-places">'; |
|
| 311 | + if ($terms) { |
|
| 312 | + $view_all_link = add_query_arg(array('sort_by' => 'rating_count_desc'), get_term_link($first_term, $first_term->taxonomy)); |
|
| 313 | + /** |
|
| 314 | + * Filter the page link to view all lisitngs. |
|
| 315 | + * |
|
| 316 | + * @since 1.5.1 |
|
| 317 | + * |
|
| 318 | + * @param array $view_all_link View all listings page link. |
|
| 319 | + * @param array $post_type The Post type. |
|
| 320 | + * @param array $first_term The category term object. |
|
| 321 | + */ |
|
| 322 | + $view_all_link = apply_filters('geodir_bestof_widget_view_all_link', $view_all_link, $post_type, $first_term); |
|
| 323 | + |
|
| 324 | + echo '<h3 class="bestof-cat-title">' . wp_sprintf(__('Best of %s', 'geodirectory'), $first_term->name) . '<a href="' . esc_url($view_all_link) . '">' . __("View all", 'geodirectory') . '</a></h3>'; |
|
| 325 | + } |
|
| 326 | + if ($excerpt_type == 'show-reviews') { |
|
| 327 | + add_filter('get_the_excerpt', 'best_of_show_review_in_excerpt'); |
|
| 328 | + } |
|
| 329 | + geodir_bestof_places_by_term($query_args); |
|
| 330 | + if ($excerpt_type == 'show-reviews') { |
|
| 331 | + remove_filter('get_the_excerpt', 'best_of_show_review_in_excerpt'); |
|
| 332 | + } |
|
| 333 | + echo "</div>"; |
|
| 334 | + ?> |
|
| 335 | 335 | </div> |
| 336 | 336 | <?php //first term listings by default - end |
| 337 | - ?> |
|
| 337 | + ?> |
|
| 338 | 338 | <?php echo $after_widget; |
| 339 | - echo "</div>"; |
|
| 340 | - } |
|
| 341 | - |
|
| 342 | - /** |
|
| 343 | - * Sanitize best of widget form values as they are saved. |
|
| 344 | - * |
|
| 345 | - * @since 1.3.9 |
|
| 346 | - * @since 1.5.1 Declare function public. |
|
| 347 | - * |
|
| 348 | - * @param array $new_instance Values just sent to be saved. |
|
| 349 | - * @param array $old_instance Previously saved values from database. |
|
| 350 | - * |
|
| 351 | - * @return array Updated safe values to be saved. |
|
| 352 | - */ |
|
| 353 | - public function update($new_instance, $old_instance) |
|
| 354 | - { |
|
| 355 | - $instance = $old_instance; |
|
| 356 | - $instance['title'] = strip_tags($new_instance['title']); |
|
| 357 | - $instance['post_type'] = strip_tags($new_instance['post_type']); |
|
| 358 | - $instance['post_limit'] = strip_tags($new_instance['post_limit']); |
|
| 359 | - $instance['categ_limit'] = strip_tags($new_instance['categ_limit']); |
|
| 360 | - $instance['character_count'] = $new_instance['character_count']; |
|
| 361 | - $instance['tab_layout'] = $new_instance['tab_layout']; |
|
| 362 | - $instance['excerpt_type'] = $new_instance['excerpt_type']; |
|
| 363 | - if (isset($new_instance['add_location_filter']) && $new_instance['add_location_filter'] != '') |
|
| 364 | - $instance['add_location_filter'] = strip_tags($new_instance['add_location_filter']); |
|
| 365 | - else |
|
| 366 | - $instance['add_location_filter'] = '0'; |
|
| 367 | - $instance['use_viewing_post_type'] = isset($new_instance['use_viewing_post_type']) && $new_instance['use_viewing_post_type'] ? 1 : 0; |
|
| 368 | - return $instance; |
|
| 369 | - } |
|
| 370 | - |
|
| 371 | - /** |
|
| 372 | - * Back-end best of widget settings form. |
|
| 373 | - * |
|
| 374 | - * @since 1.3.9 |
|
| 375 | - * @since 1.5.1 Declare function public. |
|
| 376 | - * |
|
| 377 | - * @param array $instance Previously saved values from database. |
|
| 378 | - */ |
|
| 379 | - public function form($instance) |
|
| 380 | - { |
|
| 381 | - $instance = wp_parse_args((array)$instance, |
|
| 382 | - array( |
|
| 383 | - 'title' => '', |
|
| 384 | - 'post_type' => '', |
|
| 385 | - 'post_limit' => '5', |
|
| 386 | - 'categ_limit' => '3', |
|
| 387 | - 'character_count' => '20', |
|
| 388 | - 'add_location_filter' => '1', |
|
| 389 | - 'tab_layout' => 'bestof-tabs-on-top', |
|
| 390 | - 'excerpt_type' => 'show-desc', |
|
| 391 | - 'use_viewing_post_type' => '' |
|
| 392 | - ) |
|
| 393 | - ); |
|
| 394 | - $title = strip_tags($instance['title']); |
|
| 395 | - $post_type = strip_tags($instance['post_type']); |
|
| 396 | - $post_limit = strip_tags($instance['post_limit']); |
|
| 397 | - $categ_limit = strip_tags($instance['categ_limit']); |
|
| 398 | - $character_count = strip_tags($instance['character_count']); |
|
| 399 | - $tab_layout = strip_tags($instance['tab_layout']); |
|
| 400 | - $excerpt_type = strip_tags($instance['excerpt_type']); |
|
| 401 | - $add_location_filter = strip_tags($instance['add_location_filter']); |
|
| 402 | - $use_viewing_post_type = isset($instance['use_viewing_post_type']) && $instance['use_viewing_post_type'] ? true : false; |
|
| 403 | - |
|
| 404 | - ?> |
|
| 339 | + echo "</div>"; |
|
| 340 | + } |
|
| 341 | + |
|
| 342 | + /** |
|
| 343 | + * Sanitize best of widget form values as they are saved. |
|
| 344 | + * |
|
| 345 | + * @since 1.3.9 |
|
| 346 | + * @since 1.5.1 Declare function public. |
|
| 347 | + * |
|
| 348 | + * @param array $new_instance Values just sent to be saved. |
|
| 349 | + * @param array $old_instance Previously saved values from database. |
|
| 350 | + * |
|
| 351 | + * @return array Updated safe values to be saved. |
|
| 352 | + */ |
|
| 353 | + public function update($new_instance, $old_instance) |
|
| 354 | + { |
|
| 355 | + $instance = $old_instance; |
|
| 356 | + $instance['title'] = strip_tags($new_instance['title']); |
|
| 357 | + $instance['post_type'] = strip_tags($new_instance['post_type']); |
|
| 358 | + $instance['post_limit'] = strip_tags($new_instance['post_limit']); |
|
| 359 | + $instance['categ_limit'] = strip_tags($new_instance['categ_limit']); |
|
| 360 | + $instance['character_count'] = $new_instance['character_count']; |
|
| 361 | + $instance['tab_layout'] = $new_instance['tab_layout']; |
|
| 362 | + $instance['excerpt_type'] = $new_instance['excerpt_type']; |
|
| 363 | + if (isset($new_instance['add_location_filter']) && $new_instance['add_location_filter'] != '') |
|
| 364 | + $instance['add_location_filter'] = strip_tags($new_instance['add_location_filter']); |
|
| 365 | + else |
|
| 366 | + $instance['add_location_filter'] = '0'; |
|
| 367 | + $instance['use_viewing_post_type'] = isset($new_instance['use_viewing_post_type']) && $new_instance['use_viewing_post_type'] ? 1 : 0; |
|
| 368 | + return $instance; |
|
| 369 | + } |
|
| 370 | + |
|
| 371 | + /** |
|
| 372 | + * Back-end best of widget settings form. |
|
| 373 | + * |
|
| 374 | + * @since 1.3.9 |
|
| 375 | + * @since 1.5.1 Declare function public. |
|
| 376 | + * |
|
| 377 | + * @param array $instance Previously saved values from database. |
|
| 378 | + */ |
|
| 379 | + public function form($instance) |
|
| 380 | + { |
|
| 381 | + $instance = wp_parse_args((array)$instance, |
|
| 382 | + array( |
|
| 383 | + 'title' => '', |
|
| 384 | + 'post_type' => '', |
|
| 385 | + 'post_limit' => '5', |
|
| 386 | + 'categ_limit' => '3', |
|
| 387 | + 'character_count' => '20', |
|
| 388 | + 'add_location_filter' => '1', |
|
| 389 | + 'tab_layout' => 'bestof-tabs-on-top', |
|
| 390 | + 'excerpt_type' => 'show-desc', |
|
| 391 | + 'use_viewing_post_type' => '' |
|
| 392 | + ) |
|
| 393 | + ); |
|
| 394 | + $title = strip_tags($instance['title']); |
|
| 395 | + $post_type = strip_tags($instance['post_type']); |
|
| 396 | + $post_limit = strip_tags($instance['post_limit']); |
|
| 397 | + $categ_limit = strip_tags($instance['categ_limit']); |
|
| 398 | + $character_count = strip_tags($instance['character_count']); |
|
| 399 | + $tab_layout = strip_tags($instance['tab_layout']); |
|
| 400 | + $excerpt_type = strip_tags($instance['excerpt_type']); |
|
| 401 | + $add_location_filter = strip_tags($instance['add_location_filter']); |
|
| 402 | + $use_viewing_post_type = isset($instance['use_viewing_post_type']) && $instance['use_viewing_post_type'] ? true : false; |
|
| 403 | + |
|
| 404 | + ?> |
|
| 405 | 405 | <p> |
| 406 | 406 | <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'geodirectory');?> |
| 407 | 407 | |
@@ -416,14 +416,14 @@ discard block |
||
| 416 | 416 | for="<?php echo $this->get_field_id('post_type'); ?>"><?php _e('Post Type:', 'geodirectory');?> |
| 417 | 417 | |
| 418 | 418 | <?php $postypes = geodir_get_posttypes(); |
| 419 | - /** |
|
| 420 | - * Filter the post types to display in widget. |
|
| 421 | - * |
|
| 422 | - * @since 1.3.9 |
|
| 423 | - * |
|
| 424 | - * @param array $postypes Post types array. |
|
| 425 | - */ |
|
| 426 | - $postypes = apply_filters('geodir_post_type_list_in_p_widget', $postypes); ?> |
|
| 419 | + /** |
|
| 420 | + * Filter the post types to display in widget. |
|
| 421 | + * |
|
| 422 | + * @since 1.3.9 |
|
| 423 | + * |
|
| 424 | + * @param array $postypes Post types array. |
|
| 425 | + */ |
|
| 426 | + $postypes = apply_filters('geodir_post_type_list_in_p_widget', $postypes); ?> |
|
| 427 | 427 | |
| 428 | 428 | <select class="widefat" id="<?php echo $this->get_field_id('post_type'); ?>" |
| 429 | 429 | name="<?php echo $this->get_field_name('post_type'); ?>" |
@@ -432,9 +432,9 @@ discard block |
||
| 432 | 432 | <?php foreach ($postypes as $postypes_obj) { ?> |
| 433 | 433 | |
| 434 | 434 | <option <?php if ($post_type == $postypes_obj) { |
| 435 | - echo 'selected="selected"'; |
|
| 436 | - } ?> value="<?php echo $postypes_obj; ?>"><?php $extvalue = explode('_', $postypes_obj); |
|
| 437 | - echo ucfirst($extvalue[1]); ?></option> |
|
| 435 | + echo 'selected="selected"'; |
|
| 436 | + } ?> value="<?php echo $postypes_obj; ?>"><?php $extvalue = explode('_', $postypes_obj); |
|
| 437 | + echo ucfirst($extvalue[1]); ?></option> |
|
| 438 | 438 | |
| 439 | 439 | <?php } ?> |
| 440 | 440 | |
@@ -480,14 +480,14 @@ discard block |
||
| 480 | 480 | name="<?php echo $this->get_field_name('tab_layout'); ?>"> |
| 481 | 481 | |
| 482 | 482 | <option <?php if ($tab_layout == 'bestof-tabs-on-top') { |
| 483 | - echo 'selected="selected"'; |
|
| 484 | - } ?> value="bestof-tabs-on-top"><?php _e('Tabs on Top', 'geodirectory'); ?></option> |
|
| 483 | + echo 'selected="selected"'; |
|
| 484 | + } ?> value="bestof-tabs-on-top"><?php _e('Tabs on Top', 'geodirectory'); ?></option> |
|
| 485 | 485 | <option <?php if ($tab_layout == 'bestof-tabs-on-left') { |
| 486 | - echo 'selected="selected"'; |
|
| 487 | - } ?> value="bestof-tabs-on-left"><?php _e('Tabs on Left', 'geodirectory'); ?></option> |
|
| 486 | + echo 'selected="selected"'; |
|
| 487 | + } ?> value="bestof-tabs-on-left"><?php _e('Tabs on Left', 'geodirectory'); ?></option> |
|
| 488 | 488 | <option <?php if ($tab_layout == 'bestof-tabs-as-dropdown') { |
| 489 | - echo 'selected="selected"'; |
|
| 490 | - } ?> |
|
| 489 | + echo 'selected="selected"'; |
|
| 490 | + } ?> |
|
| 491 | 491 | value="bestof-tabs-as-dropdown"><?php _e('Tabs as Dropdown', 'geodirectory'); ?></option> |
| 492 | 492 | </select> |
| 493 | 493 | </label> |
@@ -501,11 +501,11 @@ discard block |
||
| 501 | 501 | name="<?php echo $this->get_field_name('excerpt_type'); ?>"> |
| 502 | 502 | |
| 503 | 503 | <option <?php if ($excerpt_type == 'show-desc') { |
| 504 | - echo 'selected="selected"'; |
|
| 505 | - } ?> value="show-desc"><?php _e('Show Description', 'geodirectory'); ?></option> |
|
| 504 | + echo 'selected="selected"'; |
|
| 505 | + } ?> value="show-desc"><?php _e('Show Description', 'geodirectory'); ?></option> |
|
| 506 | 506 | <option <?php if ($excerpt_type == 'show-reviews') { |
| 507 | - echo 'selected="selected"'; |
|
| 508 | - } ?> value="show-reviews"><?php _e('Show Reviews if Available', 'geodirectory'); ?></option> |
|
| 507 | + echo 'selected="selected"'; |
|
| 508 | + } ?> value="show-reviews"><?php _e('Show Reviews if Available', 'geodirectory'); ?></option> |
|
| 509 | 509 | </select> |
| 510 | 510 | </label> |
| 511 | 511 | </p> |
@@ -524,12 +524,12 @@ discard block |
||
| 524 | 524 | for="<?php echo $this->get_field_id('use_viewing_post_type'); ?>"><?php _e('Use current viewing post type:', 'geodirectory'); ?> |
| 525 | 525 | <input type="checkbox" id="<?php echo $this->get_field_id('use_viewing_post_type'); ?>" |
| 526 | 526 | name="<?php echo $this->get_field_name('use_viewing_post_type'); ?>" <?php if ($use_viewing_post_type) { |
| 527 | - echo 'checked="checked"'; |
|
| 528 | - } ?> value="1"/> |
|
| 527 | + echo 'checked="checked"'; |
|
| 528 | + } ?> value="1"/> |
|
| 529 | 529 | </label> |
| 530 | 530 | </p> |
| 531 | 531 | <?php |
| 532 | - } |
|
| 532 | + } |
|
| 533 | 533 | } // class geodir_bestof_widget |
| 534 | 534 | |
| 535 | 535 | register_widget('geodir_bestof_widget'); |
@@ -549,68 +549,68 @@ discard block |
||
| 549 | 549 | */ |
| 550 | 550 | function geodir_bestof_places_by_term($query_args) |
| 551 | 551 | { |
| 552 | - global $gd_session; |
|
| 553 | - |
|
| 554 | - /** |
|
| 555 | - * This action called before querying widget listings. |
|
| 556 | - * |
|
| 557 | - * @since 1.0.0 |
|
| 558 | - */ |
|
| 559 | - do_action('geodir_bestof_get_widget_listings_before'); |
|
| 560 | - |
|
| 561 | - $widget_listings = geodir_get_widget_listings($query_args); |
|
| 562 | - |
|
| 563 | - /** |
|
| 564 | - * This action called after querying widget listings. |
|
| 565 | - * |
|
| 566 | - * @since 1.0.0 |
|
| 567 | - */ |
|
| 568 | - do_action('geodir_bestof_get_widget_listings_after'); |
|
| 569 | - |
|
| 570 | - $character_count = isset($query_args['excerpt_length']) ? $query_args['excerpt_length'] : ''; |
|
| 571 | - |
|
| 572 | - if (!isset($character_count)) { |
|
| 573 | - /** This filter is documented in geodirectory-widgets/geodirectory_bestof_widget.php */ |
|
| 574 | - $character_count = $character_count == '' ? 50 : apply_filters('bestof_widget_character_count', $character_count); |
|
| 575 | - } |
|
| 576 | - |
|
| 577 | - /** This filter is documented in geodirectory-functions/general_functions.php */ |
|
| 578 | - $template = apply_filters("geodir_template_part-widget-listing-listview", geodir_locate_template('widget-listing-listview')); |
|
| 579 | - |
|
| 580 | - global $post, $map_jason, $map_canvas_arr, $gridview_columns_widget, $geodir_is_widget_listing; |
|
| 581 | - $current_post = $post; |
|
| 582 | - $current_map_jason = $map_jason; |
|
| 583 | - $current_map_canvas_arr = $map_canvas_arr; |
|
| 584 | - $current_grid_view = $gridview_columns_widget; |
|
| 585 | - $gridview_columns_widget = null; |
|
| 586 | - |
|
| 587 | - $gd_listing_view_set = $gd_session->get('gd_listing_view') ? true : false; |
|
| 588 | - $gd_listing_view_old = $gd_listing_view_set ? $gd_session->get('gd_listing_view') : ''; |
|
| 589 | - |
|
| 590 | - $gd_session->set('gd_listing_view', '1'); |
|
| 591 | - $geodir_is_widget_listing = true; |
|
| 592 | - |
|
| 593 | - /** |
|
| 594 | - * Includes the template for the listing listview. |
|
| 595 | - * |
|
| 596 | - * @since 1.3.9 |
|
| 597 | - */ |
|
| 598 | - include($template); |
|
| 599 | - |
|
| 600 | - $geodir_is_widget_listing = false; |
|
| 601 | - |
|
| 602 | - $GLOBALS['post'] = $current_post; |
|
| 603 | - if (!empty($current_post)) { |
|
| 604 | - setup_postdata($current_post); |
|
| 605 | - } |
|
| 606 | - if ($gd_listing_view_set) { // Set back previous value |
|
| 607 | - $gd_session->set('gd_listing_view', $gd_listing_view_old); |
|
| 608 | - } else { |
|
| 609 | - $gd_session->un_set('gd_listing_view'); |
|
| 610 | - } |
|
| 611 | - $map_jason = $current_map_jason; |
|
| 612 | - $map_canvas_arr = $current_map_canvas_arr; |
|
| 613 | - $gridview_columns_widget = $current_grid_view; |
|
| 552 | + global $gd_session; |
|
| 553 | + |
|
| 554 | + /** |
|
| 555 | + * This action called before querying widget listings. |
|
| 556 | + * |
|
| 557 | + * @since 1.0.0 |
|
| 558 | + */ |
|
| 559 | + do_action('geodir_bestof_get_widget_listings_before'); |
|
| 560 | + |
|
| 561 | + $widget_listings = geodir_get_widget_listings($query_args); |
|
| 562 | + |
|
| 563 | + /** |
|
| 564 | + * This action called after querying widget listings. |
|
| 565 | + * |
|
| 566 | + * @since 1.0.0 |
|
| 567 | + */ |
|
| 568 | + do_action('geodir_bestof_get_widget_listings_after'); |
|
| 569 | + |
|
| 570 | + $character_count = isset($query_args['excerpt_length']) ? $query_args['excerpt_length'] : ''; |
|
| 571 | + |
|
| 572 | + if (!isset($character_count)) { |
|
| 573 | + /** This filter is documented in geodirectory-widgets/geodirectory_bestof_widget.php */ |
|
| 574 | + $character_count = $character_count == '' ? 50 : apply_filters('bestof_widget_character_count', $character_count); |
|
| 575 | + } |
|
| 576 | + |
|
| 577 | + /** This filter is documented in geodirectory-functions/general_functions.php */ |
|
| 578 | + $template = apply_filters("geodir_template_part-widget-listing-listview", geodir_locate_template('widget-listing-listview')); |
|
| 579 | + |
|
| 580 | + global $post, $map_jason, $map_canvas_arr, $gridview_columns_widget, $geodir_is_widget_listing; |
|
| 581 | + $current_post = $post; |
|
| 582 | + $current_map_jason = $map_jason; |
|
| 583 | + $current_map_canvas_arr = $map_canvas_arr; |
|
| 584 | + $current_grid_view = $gridview_columns_widget; |
|
| 585 | + $gridview_columns_widget = null; |
|
| 586 | + |
|
| 587 | + $gd_listing_view_set = $gd_session->get('gd_listing_view') ? true : false; |
|
| 588 | + $gd_listing_view_old = $gd_listing_view_set ? $gd_session->get('gd_listing_view') : ''; |
|
| 589 | + |
|
| 590 | + $gd_session->set('gd_listing_view', '1'); |
|
| 591 | + $geodir_is_widget_listing = true; |
|
| 592 | + |
|
| 593 | + /** |
|
| 594 | + * Includes the template for the listing listview. |
|
| 595 | + * |
|
| 596 | + * @since 1.3.9 |
|
| 597 | + */ |
|
| 598 | + include($template); |
|
| 599 | + |
|
| 600 | + $geodir_is_widget_listing = false; |
|
| 601 | + |
|
| 602 | + $GLOBALS['post'] = $current_post; |
|
| 603 | + if (!empty($current_post)) { |
|
| 604 | + setup_postdata($current_post); |
|
| 605 | + } |
|
| 606 | + if ($gd_listing_view_set) { // Set back previous value |
|
| 607 | + $gd_session->set('gd_listing_view', $gd_listing_view_old); |
|
| 608 | + } else { |
|
| 609 | + $gd_session->un_set('gd_listing_view'); |
|
| 610 | + } |
|
| 611 | + $map_jason = $current_map_jason; |
|
| 612 | + $map_canvas_arr = $current_map_canvas_arr; |
|
| 613 | + $gridview_columns_widget = $current_grid_view; |
|
| 614 | 614 | } |
| 615 | 615 | |
| 616 | 616 | //Ajax functions |
@@ -627,51 +627,51 @@ discard block |
||
| 627 | 627 | */ |
| 628 | 628 | function geodir_bestof_callback() |
| 629 | 629 | { |
| 630 | - check_ajax_referer('geodir-bestof-nonce', 'geodir_bestof_nonce'); |
|
| 631 | - //set variables |
|
| 632 | - $post_type = strip_tags(esc_sql($_POST['post_type'])); |
|
| 633 | - $post_limit = strip_tags(esc_sql($_POST['post_limit'])); |
|
| 634 | - $character_count = strip_tags(esc_sql($_POST['char_count'])); |
|
| 635 | - $taxonomy = strip_tags(esc_sql($_POST['taxonomy'])); |
|
| 636 | - $add_location_filter = strip_tags(esc_sql($_POST['add_location_filter'])); |
|
| 637 | - $term_id = strip_tags(esc_sql($_POST['term_id'])); |
|
| 638 | - $excerpt_type = strip_tags(esc_sql($_POST['excerpt_type'])); |
|
| 639 | - |
|
| 640 | - $query_args = array( |
|
| 641 | - 'posts_per_page' => $post_limit, |
|
| 642 | - 'is_geodir_loop' => true, |
|
| 643 | - 'post_type' => $post_type, |
|
| 644 | - 'gd_location' => $add_location_filter ? true : false, |
|
| 645 | - 'order_by' => 'high_review' |
|
| 646 | - ); |
|
| 647 | - |
|
| 648 | - if ($character_count >= 0) { |
|
| 649 | - $query_args['excerpt_length'] = $character_count; |
|
| 650 | - } |
|
| 651 | - |
|
| 652 | - $tax_query = array( |
|
| 653 | - 'taxonomy' => $taxonomy, |
|
| 654 | - 'field' => 'id', |
|
| 655 | - 'terms' => $term_id |
|
| 656 | - ); |
|
| 657 | - |
|
| 658 | - $query_args['tax_query'] = array($tax_query); |
|
| 659 | - if ($term_id && $taxonomy) { |
|
| 660 | - $term = get_term_by('id', $term_id, $taxonomy); |
|
| 661 | - $view_all_link = add_query_arg(array('sort_by' => 'rating_count_desc'), get_term_link($term)); |
|
| 662 | - /** This filter is documented in geodirectory-widgets/geodirectory_bestof_widget.php */ |
|
| 663 | - $view_all_link = apply_filters('geodir_bestof_widget_view_all_link', $view_all_link, $post_type, $term); |
|
| 664 | - |
|
| 665 | - echo '<h3 class="bestof-cat-title">' . wp_sprintf(__('Best of %s', 'geodirectory'), $term->name) . '<a href="' . esc_url($view_all_link) . '">' . __("View all", 'geodirectory') . '</a></h3>'; |
|
| 666 | - } |
|
| 667 | - if ($excerpt_type == 'show-reviews') { |
|
| 668 | - add_filter('get_the_excerpt', 'best_of_show_review_in_excerpt'); |
|
| 669 | - } |
|
| 670 | - geodir_bestof_places_by_term($query_args); |
|
| 671 | - if ($excerpt_type == 'show-reviews') { |
|
| 672 | - remove_filter('get_the_excerpt', 'best_of_show_review_in_excerpt'); |
|
| 673 | - } |
|
| 674 | - gd_die(); |
|
| 630 | + check_ajax_referer('geodir-bestof-nonce', 'geodir_bestof_nonce'); |
|
| 631 | + //set variables |
|
| 632 | + $post_type = strip_tags(esc_sql($_POST['post_type'])); |
|
| 633 | + $post_limit = strip_tags(esc_sql($_POST['post_limit'])); |
|
| 634 | + $character_count = strip_tags(esc_sql($_POST['char_count'])); |
|
| 635 | + $taxonomy = strip_tags(esc_sql($_POST['taxonomy'])); |
|
| 636 | + $add_location_filter = strip_tags(esc_sql($_POST['add_location_filter'])); |
|
| 637 | + $term_id = strip_tags(esc_sql($_POST['term_id'])); |
|
| 638 | + $excerpt_type = strip_tags(esc_sql($_POST['excerpt_type'])); |
|
| 639 | + |
|
| 640 | + $query_args = array( |
|
| 641 | + 'posts_per_page' => $post_limit, |
|
| 642 | + 'is_geodir_loop' => true, |
|
| 643 | + 'post_type' => $post_type, |
|
| 644 | + 'gd_location' => $add_location_filter ? true : false, |
|
| 645 | + 'order_by' => 'high_review' |
|
| 646 | + ); |
|
| 647 | + |
|
| 648 | + if ($character_count >= 0) { |
|
| 649 | + $query_args['excerpt_length'] = $character_count; |
|
| 650 | + } |
|
| 651 | + |
|
| 652 | + $tax_query = array( |
|
| 653 | + 'taxonomy' => $taxonomy, |
|
| 654 | + 'field' => 'id', |
|
| 655 | + 'terms' => $term_id |
|
| 656 | + ); |
|
| 657 | + |
|
| 658 | + $query_args['tax_query'] = array($tax_query); |
|
| 659 | + if ($term_id && $taxonomy) { |
|
| 660 | + $term = get_term_by('id', $term_id, $taxonomy); |
|
| 661 | + $view_all_link = add_query_arg(array('sort_by' => 'rating_count_desc'), get_term_link($term)); |
|
| 662 | + /** This filter is documented in geodirectory-widgets/geodirectory_bestof_widget.php */ |
|
| 663 | + $view_all_link = apply_filters('geodir_bestof_widget_view_all_link', $view_all_link, $post_type, $term); |
|
| 664 | + |
|
| 665 | + echo '<h3 class="bestof-cat-title">' . wp_sprintf(__('Best of %s', 'geodirectory'), $term->name) . '<a href="' . esc_url($view_all_link) . '">' . __("View all", 'geodirectory') . '</a></h3>'; |
|
| 666 | + } |
|
| 667 | + if ($excerpt_type == 'show-reviews') { |
|
| 668 | + add_filter('get_the_excerpt', 'best_of_show_review_in_excerpt'); |
|
| 669 | + } |
|
| 670 | + geodir_bestof_places_by_term($query_args); |
|
| 671 | + if ($excerpt_type == 'show-reviews') { |
|
| 672 | + remove_filter('get_the_excerpt', 'best_of_show_review_in_excerpt'); |
|
| 673 | + } |
|
| 674 | + gd_die(); |
|
| 675 | 675 | } |
| 676 | 676 | |
| 677 | 677 | //Javascript |
@@ -684,8 +684,8 @@ discard block |
||
| 684 | 684 | */ |
| 685 | 685 | function geodir_bestof_js() |
| 686 | 686 | { |
| 687 | - $ajax_nonce = wp_create_nonce("geodir-bestof-nonce"); |
|
| 688 | - ?> |
|
| 687 | + $ajax_nonce = wp_create_nonce("geodir-bestof-nonce"); |
|
| 688 | + ?> |
|
| 689 | 689 | <script type="text/javascript"> |
| 690 | 690 | jQuery(document).ready(function () { |
| 691 | 691 | jQuery('.geodir-bestof-cat-list a, #geodir_bestof_tab_dd').on("click change", function (e) { |
@@ -758,18 +758,18 @@ discard block |
||
| 758 | 758 | |
| 759 | 759 | function best_of_show_review_in_excerpt($excerpt) |
| 760 | 760 | { |
| 761 | - global $wpdb, $post; |
|
| 762 | - $review_table = GEODIR_REVIEW_TABLE; |
|
| 763 | - $request = "SELECT comment_ID FROM $review_table WHERE post_id = $post->ID ORDER BY post_date DESC, id DESC LIMIT 1"; |
|
| 764 | - $comments = $wpdb->get_results($request); |
|
| 765 | - |
|
| 766 | - if ($comments) { |
|
| 767 | - foreach ($comments as $comment) { |
|
| 768 | - // Set the extra comment info needed. |
|
| 769 | - $comment_extra = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID =$comment->comment_ID"); |
|
| 770 | - $comment_content = $comment_extra->comment_content; |
|
| 771 | - $excerpt = strip_tags($comment_content); |
|
| 772 | - } |
|
| 773 | - } |
|
| 774 | - return $excerpt; |
|
| 761 | + global $wpdb, $post; |
|
| 762 | + $review_table = GEODIR_REVIEW_TABLE; |
|
| 763 | + $request = "SELECT comment_ID FROM $review_table WHERE post_id = $post->ID ORDER BY post_date DESC, id DESC LIMIT 1"; |
|
| 764 | + $comments = $wpdb->get_results($request); |
|
| 765 | + |
|
| 766 | + if ($comments) { |
|
| 767 | + foreach ($comments as $comment) { |
|
| 768 | + // Set the extra comment info needed. |
|
| 769 | + $comment_extra = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID =$comment->comment_ID"); |
|
| 770 | + $comment_content = $comment_extra->comment_content; |
|
| 771 | + $excerpt = strip_tags($comment_content); |
|
| 772 | + } |
|
| 773 | + } |
|
| 774 | + return $excerpt; |
|
| 775 | 775 | } |
| 776 | 776 | \ No newline at end of file |
@@ -7,33 +7,33 @@ discard block |
||
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | 9 | if (!function_exists('geodir_admin_panel')) {
|
| 10 | - /** |
|
| 11 | - * GeoDirectory Backend Admin Panel. |
|
| 12 | - * |
|
| 13 | - * Handles the display of the main GeoDirectory admin panel. |
|
| 14 | - * |
|
| 15 | - * @since 1.0.0 |
|
| 16 | - * @package GeoDirectory |
|
| 17 | - * @global string $current_tab Current tab in geodirectory settings. |
|
| 18 | - * @global object $geodirectory GeoDirectory plugin object. |
|
| 19 | - */ |
|
| 20 | - function geodir_admin_panel() |
|
| 21 | - {
|
|
| 22 | - global $geodirectory; |
|
| 23 | - global $current_tab; |
|
| 24 | - |
|
| 25 | - |
|
| 26 | - ?> |
|
| 10 | + /** |
|
| 11 | + * GeoDirectory Backend Admin Panel. |
|
| 12 | + * |
|
| 13 | + * Handles the display of the main GeoDirectory admin panel. |
|
| 14 | + * |
|
| 15 | + * @since 1.0.0 |
|
| 16 | + * @package GeoDirectory |
|
| 17 | + * @global string $current_tab Current tab in geodirectory settings. |
|
| 18 | + * @global object $geodirectory GeoDirectory plugin object. |
|
| 19 | + */ |
|
| 20 | + function geodir_admin_panel() |
|
| 21 | + {
|
|
| 22 | + global $geodirectory; |
|
| 23 | + global $current_tab; |
|
| 24 | + |
|
| 25 | + |
|
| 26 | + ?> |
|
| 27 | 27 | |
| 28 | 28 | <div id="gd-wrapper-main" class="wrap geodirectory"> |
| 29 | 29 | <?php |
| 30 | - /** |
|
| 31 | - * Called just after the opening wrapper div for the GD settings page in the admin area. |
|
| 32 | - * |
|
| 33 | - * @since 1.0.0 |
|
| 34 | - */ |
|
| 35 | - do_action('geodir_before_admin_panel');
|
|
| 36 | - ?> |
|
| 30 | + /** |
|
| 31 | + * Called just after the opening wrapper div for the GD settings page in the admin area. |
|
| 32 | + * |
|
| 33 | + * @since 1.0.0 |
|
| 34 | + */ |
|
| 35 | + do_action('geodir_before_admin_panel');
|
|
| 36 | + ?> |
|
| 37 | 37 | |
| 38 | 38 | <div class="gd-wrapper gd-wrapper-vr clearfix"> |
| 39 | 39 | |
@@ -44,75 +44,75 @@ discard block |
||
| 44 | 44 | alt="geo-logo" class="geo-logoalter"/> |
| 45 | 45 | <ul> |
| 46 | 46 | <?php |
| 47 | - $tabs = array(); |
|
| 48 | - /** |
|
| 49 | - * Filter the GD admin settings tabs on the left of the admin menu. |
|
| 50 | - * |
|
| 51 | - * @since 1.0.0 |
|
| 52 | - * @param array $tabs The array of tabs to display. |
|
| 53 | - */ |
|
| 54 | - $tabs = apply_filters('geodir_settings_tabs_array', $tabs);
|
|
| 55 | - update_option('geodir_tabs', $tabs);// Important to show settings menu dropdown
|
|
| 56 | - |
|
| 57 | - foreach ($tabs as $name => $args) : |
|
| 58 | - $label = $args['label']; |
|
| 59 | - |
|
| 60 | - |
|
| 61 | - $query_string = ''; |
|
| 62 | - if (isset($args['subtabs']) && !empty($args['subtabs'])): |
|
| 63 | - |
|
| 64 | - $subtabs = $args['subtabs']; |
|
| 65 | - |
|
| 66 | - $query_string = '&subtab=' . $subtabs[0]['subtab']; |
|
| 67 | - |
|
| 68 | - endif; |
|
| 69 | - |
|
| 70 | - |
|
| 71 | - $tab_link = admin_url('admin.php?page=geodirectory&tab=' . $name . $query_string);
|
|
| 72 | - |
|
| 73 | - if (isset($args['url']) && $args['url'] != '') {
|
|
| 74 | - $tab_link = $args['url']; |
|
| 75 | - } |
|
| 76 | - |
|
| 77 | - if (!empty($args['request'])) |
|
| 78 | - $tab_link = geodir_getlink($tab_link, $args['request']); |
|
| 79 | - |
|
| 80 | - if (isset($args['target']) && $args['target'] != '') {
|
|
| 81 | - $tab_target = " target='" . sanitize_text_field($args['target']) . "' "; |
|
| 82 | - } else |
|
| 83 | - $tab_target = ''; |
|
| 84 | - |
|
| 85 | - $tab_active = ''; |
|
| 86 | - if ($current_tab == $name) |
|
| 87 | - $tab_active = ' class="tab-active" '; |
|
| 88 | - /** |
|
| 89 | - * Called before the individual settings tabs are output. |
|
| 90 | - * |
|
| 91 | - * @since 1.0.0 |
|
| 92 | - * @param string $name The name of the settings tab. |
|
| 93 | - * @see 'geodir_after_settings_tabs' |
|
| 94 | - */ |
|
| 95 | - do_action('geodir_before_settings_tabs', $name);
|
|
| 96 | - echo '<li ' . $tab_active . ' ><a href="' . esc_url($tab_link) . '" ' . $tab_target . ' >' . $label . '</a></li>'; |
|
| 97 | - /** |
|
| 98 | - * Called after the individual settings tabs are output. |
|
| 99 | - * |
|
| 100 | - * @since 1.0.0 |
|
| 101 | - * @param string $name The name of the settings tab. |
|
| 102 | - * @see 'geodir_before_settings_tabs' |
|
| 103 | - */ |
|
| 104 | - do_action('geodir_after_settings_tabs', $name);
|
|
| 105 | - endforeach; |
|
| 106 | - |
|
| 107 | - /** |
|
| 108 | - * Called after the GD settings tabs have been output. |
|
| 109 | - * |
|
| 110 | - * Called before the closing `ul` so can be used to add new settings tab links. |
|
| 111 | - * |
|
| 112 | - * @since 1.0.0 |
|
| 113 | - */ |
|
| 114 | - do_action('geodir_settings_tabs');
|
|
| 115 | - ?> |
|
| 47 | + $tabs = array(); |
|
| 48 | + /** |
|
| 49 | + * Filter the GD admin settings tabs on the left of the admin menu. |
|
| 50 | + * |
|
| 51 | + * @since 1.0.0 |
|
| 52 | + * @param array $tabs The array of tabs to display. |
|
| 53 | + */ |
|
| 54 | + $tabs = apply_filters('geodir_settings_tabs_array', $tabs);
|
|
| 55 | + update_option('geodir_tabs', $tabs);// Important to show settings menu dropdown
|
|
| 56 | + |
|
| 57 | + foreach ($tabs as $name => $args) : |
|
| 58 | + $label = $args['label']; |
|
| 59 | + |
|
| 60 | + |
|
| 61 | + $query_string = ''; |
|
| 62 | + if (isset($args['subtabs']) && !empty($args['subtabs'])): |
|
| 63 | + |
|
| 64 | + $subtabs = $args['subtabs']; |
|
| 65 | + |
|
| 66 | + $query_string = '&subtab=' . $subtabs[0]['subtab']; |
|
| 67 | + |
|
| 68 | + endif; |
|
| 69 | + |
|
| 70 | + |
|
| 71 | + $tab_link = admin_url('admin.php?page=geodirectory&tab=' . $name . $query_string);
|
|
| 72 | + |
|
| 73 | + if (isset($args['url']) && $args['url'] != '') {
|
|
| 74 | + $tab_link = $args['url']; |
|
| 75 | + } |
|
| 76 | + |
|
| 77 | + if (!empty($args['request'])) |
|
| 78 | + $tab_link = geodir_getlink($tab_link, $args['request']); |
|
| 79 | + |
|
| 80 | + if (isset($args['target']) && $args['target'] != '') {
|
|
| 81 | + $tab_target = " target='" . sanitize_text_field($args['target']) . "' "; |
|
| 82 | + } else |
|
| 83 | + $tab_target = ''; |
|
| 84 | + |
|
| 85 | + $tab_active = ''; |
|
| 86 | + if ($current_tab == $name) |
|
| 87 | + $tab_active = ' class="tab-active" '; |
|
| 88 | + /** |
|
| 89 | + * Called before the individual settings tabs are output. |
|
| 90 | + * |
|
| 91 | + * @since 1.0.0 |
|
| 92 | + * @param string $name The name of the settings tab. |
|
| 93 | + * @see 'geodir_after_settings_tabs' |
|
| 94 | + */ |
|
| 95 | + do_action('geodir_before_settings_tabs', $name);
|
|
| 96 | + echo '<li ' . $tab_active . ' ><a href="' . esc_url($tab_link) . '" ' . $tab_target . ' >' . $label . '</a></li>'; |
|
| 97 | + /** |
|
| 98 | + * Called after the individual settings tabs are output. |
|
| 99 | + * |
|
| 100 | + * @since 1.0.0 |
|
| 101 | + * @param string $name The name of the settings tab. |
|
| 102 | + * @see 'geodir_before_settings_tabs' |
|
| 103 | + */ |
|
| 104 | + do_action('geodir_after_settings_tabs', $name);
|
|
| 105 | + endforeach; |
|
| 106 | + |
|
| 107 | + /** |
|
| 108 | + * Called after the GD settings tabs have been output. |
|
| 109 | + * |
|
| 110 | + * Called before the closing `ul` so can be used to add new settings tab links. |
|
| 111 | + * |
|
| 112 | + * @since 1.0.0 |
|
| 113 | + */ |
|
| 114 | + do_action('geodir_settings_tabs');
|
|
| 115 | + ?> |
|
| 116 | 116 | </ul> |
| 117 | 117 | </div> |
| 118 | 118 | <!--gd-left-nav ends here--> |
@@ -121,52 +121,52 @@ discard block |
||
| 121 | 121 | <div class="gd-tabs-main"> |
| 122 | 122 | |
| 123 | 123 | <?php |
| 124 | - unset($subtabs); |
|
| 125 | - if (isset($tabs[$current_tab]['subtabs'])) |
|
| 126 | - $subtabs = $tabs[$current_tab]['subtabs']; |
|
| 127 | - $form_action = ''; |
|
| 124 | + unset($subtabs); |
|
| 125 | + if (isset($tabs[$current_tab]['subtabs'])) |
|
| 126 | + $subtabs = $tabs[$current_tab]['subtabs']; |
|
| 127 | + $form_action = ''; |
|
| 128 | 128 | |
| 129 | - if (!empty($subtabs)): |
|
| 130 | - ?> |
|
| 129 | + if (!empty($subtabs)): |
|
| 130 | + ?> |
|
| 131 | 131 | <dl class="gd-tab-head"> |
| 132 | 132 | <?php |
| 133 | - foreach ($subtabs as $sub) {
|
|
| 134 | - $subtab_active = ''; |
|
| 135 | - if (isset($_REQUEST['subtab']) && $sub['subtab'] == $_REQUEST['subtab']) {
|
|
| 136 | - $subtab_active = 'class="gd-tab-active"'; |
|
| 137 | - $form_action = isset($sub['form_action']) ? $sub['form_action'] : ''; |
|
| 138 | - } |
|
| 139 | - |
|
| 140 | - $sub_tabs_link = admin_url() . 'admin.php?page=geodirectory&tab=' . $current_tab . '&subtab=' . $sub['subtab']; |
|
| 141 | - if (isset($sub['request']) && is_array($sub['request']) && !empty($sub['request'])) {
|
|
| 142 | - $sub_tabs_link = geodir_getlink($sub_tabs_link, $sub['request']); |
|
| 143 | - } |
|
| 144 | - echo '<dd ' . $subtab_active . ' id="claim_listing"><a href="' . esc_url($sub_tabs_link) . '" >' . sanitize_text_field($sub['label']) . '</a></dd>'; |
|
| 145 | - } |
|
| 146 | - ?> |
|
| 133 | + foreach ($subtabs as $sub) {
|
|
| 134 | + $subtab_active = ''; |
|
| 135 | + if (isset($_REQUEST['subtab']) && $sub['subtab'] == $_REQUEST['subtab']) {
|
|
| 136 | + $subtab_active = 'class="gd-tab-active"'; |
|
| 137 | + $form_action = isset($sub['form_action']) ? $sub['form_action'] : ''; |
|
| 138 | + } |
|
| 139 | + |
|
| 140 | + $sub_tabs_link = admin_url() . 'admin.php?page=geodirectory&tab=' . $current_tab . '&subtab=' . $sub['subtab']; |
|
| 141 | + if (isset($sub['request']) && is_array($sub['request']) && !empty($sub['request'])) {
|
|
| 142 | + $sub_tabs_link = geodir_getlink($sub_tabs_link, $sub['request']); |
|
| 143 | + } |
|
| 144 | + echo '<dd ' . $subtab_active . ' id="claim_listing"><a href="' . esc_url($sub_tabs_link) . '" >' . sanitize_text_field($sub['label']) . '</a></dd>'; |
|
| 145 | + } |
|
| 146 | + ?> |
|
| 147 | 147 | </dl> |
| 148 | 148 | |
| 149 | 149 | <?php endif; ?> |
| 150 | 150 | <div class="gd-tab-content <?php if (empty($subtabs)) {
|
| 151 | - echo "inner_contet_tabs"; |
|
| 152 | - } ?>"> |
|
| 151 | + echo "inner_contet_tabs"; |
|
| 152 | + } ?>"> |
|
| 153 | 153 | <form method="post" id="mainform" |
| 154 | 154 | class="geodir_optionform <?php echo $current_tab . ' '; ?><?php if (isset($sub['subtab'])) {
|
| 155 | - echo sanitize_text_field($sub['subtab']); |
|
| 156 | - } ?>" action="<?php echo $form_action; ?>" enctype="multipart/form-data"> |
|
| 155 | + echo sanitize_text_field($sub['subtab']); |
|
| 156 | + } ?>" action="<?php echo $form_action; ?>" enctype="multipart/form-data"> |
|
| 157 | 157 | <input type="hidden" class="active_tab" name="active_tab" |
| 158 | 158 | value="<?php if (isset($_REQUEST['active_tab'])) {
|
| 159 | - echo sanitize_text_field($_REQUEST['active_tab']); |
|
| 160 | - } ?>"/> |
|
| 159 | + echo sanitize_text_field($_REQUEST['active_tab']); |
|
| 160 | + } ?>"/> |
|
| 161 | 161 | <?php wp_nonce_field('geodir-settings', '_wpnonce', true, true); ?>
|
| 162 | 162 | <?php wp_nonce_field('geodir-settings-' . $current_tab, '_wpnonce-' . $current_tab, true, true); ?>
|
| 163 | 163 | <?php |
| 164 | - /** |
|
| 165 | - * Used to call the content of each GD settings tab page. |
|
| 166 | - * |
|
| 167 | - * @since 1.0.0 |
|
| 168 | - */ |
|
| 169 | - do_action('geodir_admin_option_form', $current_tab); ?>
|
|
| 164 | + /** |
|
| 165 | + * Used to call the content of each GD settings tab page. |
|
| 166 | + * |
|
| 167 | + * @since 1.0.0 |
|
| 168 | + */ |
|
| 169 | + do_action('geodir_admin_option_form', $current_tab); ?>
|
|
| 170 | 170 | </form> |
| 171 | 171 | </div> |
| 172 | 172 | |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | </script> |
| 268 | 268 | <?php |
| 269 | 269 | |
| 270 | - } |
|
| 270 | + } |
|
| 271 | 271 | } |
| 272 | 272 | |
| 273 | 273 | |
@@ -283,48 +283,48 @@ discard block |
||
| 283 | 283 | function geodir_admin_option_form($tab_name) |
| 284 | 284 | {
|
| 285 | 285 | |
| 286 | - //echo $tab_name.'_array.php' ; |
|
| 287 | - global $geodir_settings, $is_default, $mapzoom; |
|
| 288 | - if (file_exists(dirname(__FILE__) . '/option-pages/' . $tab_name . '_array.php')) {
|
|
| 289 | - /** |
|
| 290 | - * Contains settings array for given tab. |
|
| 291 | - * |
|
| 292 | - * @since 1.0.0 |
|
| 293 | - * @package GeoDirectory |
|
| 294 | - */ |
|
| 295 | - include_once('option-pages/' . $tab_name . '_array.php');
|
|
| 296 | - } |
|
| 297 | - |
|
| 298 | - $listing_type = isset($_REQUEST['listing_type']) ? $_REQUEST['listing_type'] : ''; |
|
| 299 | - |
|
| 300 | - switch ($tab_name) {
|
|
| 301 | - |
|
| 302 | - case 'general_settings': |
|
| 303 | - |
|
| 304 | - geodir_admin_fields($geodir_settings['general_settings']); |
|
| 305 | - /** |
|
| 306 | - * |
|
| 307 | - * Update Taxonomy Options * |
|
| 308 | - * |
|
| 309 | - **/ |
|
| 310 | - /*add_action('updated_option_place_prefix','update_listing_prefix');
|
|
| 286 | + //echo $tab_name.'_array.php' ; |
|
| 287 | + global $geodir_settings, $is_default, $mapzoom; |
|
| 288 | + if (file_exists(dirname(__FILE__) . '/option-pages/' . $tab_name . '_array.php')) {
|
|
| 289 | + /** |
|
| 290 | + * Contains settings array for given tab. |
|
| 291 | + * |
|
| 292 | + * @since 1.0.0 |
|
| 293 | + * @package GeoDirectory |
|
| 294 | + */ |
|
| 295 | + include_once('option-pages/' . $tab_name . '_array.php');
|
|
| 296 | + } |
|
| 297 | + |
|
| 298 | + $listing_type = isset($_REQUEST['listing_type']) ? $_REQUEST['listing_type'] : ''; |
|
| 299 | + |
|
| 300 | + switch ($tab_name) {
|
|
| 301 | + |
|
| 302 | + case 'general_settings': |
|
| 303 | + |
|
| 304 | + geodir_admin_fields($geodir_settings['general_settings']); |
|
| 305 | + /** |
|
| 306 | + * |
|
| 307 | + * Update Taxonomy Options * |
|
| 308 | + * |
|
| 309 | + **/ |
|
| 310 | + /*add_action('updated_option_place_prefix','update_listing_prefix');
|
|
| 311 | 311 | function update_listing_prefix(){
|
| 312 | 312 | geodir_register_defaults(); |
| 313 | 313 | }*/ |
| 314 | 314 | |
| 315 | - if (isset($_REQUEST['active_tab']) && ($_REQUEST['active_tab'] == 'dummy_data_settings' || $_REQUEST['active_tab'] == 'csv_upload_settings')) |
|
| 316 | - $hide_save_button = "style='display:none;'"; |
|
| 317 | - else |
|
| 318 | - $hide_save_button = ''; |
|
| 315 | + if (isset($_REQUEST['active_tab']) && ($_REQUEST['active_tab'] == 'dummy_data_settings' || $_REQUEST['active_tab'] == 'csv_upload_settings')) |
|
| 316 | + $hide_save_button = "style='display:none;'"; |
|
| 317 | + else |
|
| 318 | + $hide_save_button = ''; |
|
| 319 | 319 | |
| 320 | - /** |
|
| 321 | - * Filter weather the default save button in the GD admin settings pages should be shown. |
|
| 322 | - * |
|
| 323 | - * @since 1.0.0 |
|
| 324 | - * @param string $hide_save_button The style element, either blank or: style='display:none;'. |
|
| 325 | - */ |
|
| 326 | - $hide_save_button = apply_filters('geodir_hide_save_button', $hide_save_button);
|
|
| 327 | - ?> |
|
| 320 | + /** |
|
| 321 | + * Filter weather the default save button in the GD admin settings pages should be shown. |
|
| 322 | + * |
|
| 323 | + * @since 1.0.0 |
|
| 324 | + * @param string $hide_save_button The style element, either blank or: style='display:none;'. |
|
| 325 | + */ |
|
| 326 | + $hide_save_button = apply_filters('geodir_hide_save_button', $hide_save_button);
|
|
| 327 | + ?> |
|
| 328 | 328 | |
| 329 | 329 | <p class="submit"> |
| 330 | 330 | <input <?php echo $hide_save_button;?> name="save" class="button-primary" type="submit" value="<?php _e('Save changes', 'geodirectory'); ?>" />
|
@@ -334,36 +334,36 @@ discard block |
||
| 334 | 334 | </div> |
| 335 | 335 | |
| 336 | 336 | <?php break; |
| 337 | - case 'design_settings' : |
|
| 338 | - geodir_admin_fields($geodir_settings['design_settings']); |
|
| 337 | + case 'design_settings' : |
|
| 338 | + geodir_admin_fields($geodir_settings['design_settings']); |
|
| 339 | 339 | |
| 340 | 340 | |
| 341 | 341 | |
| 342 | - ?> |
|
| 342 | + ?> |
|
| 343 | 343 | <p class="submit"> |
| 344 | 344 | <input name="save" class="button-primary" type="submit" value="<?php _e('Save changes', 'geodirectory'); ?>" />
|
| 345 | 345 | <input type="hidden" name="subtab" id="last_tab" /> |
| 346 | 346 | </p> |
| 347 | 347 | </div> |
| 348 | 348 | <?php break; |
| 349 | - case 'permalink_settings' : |
|
| 350 | - geodir_admin_fields($geodir_settings['permalink_settings']); ?> |
|
| 349 | + case 'permalink_settings' : |
|
| 350 | + geodir_admin_fields($geodir_settings['permalink_settings']); ?> |
|
| 351 | 351 | <p class="submit"> |
| 352 | 352 | <input name="save" class="button-primary" type="submit" value="<?php _e('Save changes', 'geodirectory'); ?>" />
|
| 353 | 353 | <input type="hidden" name="subtab" id="last_tab" /> |
| 354 | 354 | </p> |
| 355 | 355 | </div> |
| 356 | 356 | <?php break; |
| 357 | - case 'title_meta_settings' : |
|
| 358 | - geodir_admin_fields($geodir_settings['title_meta_settings']); ?> |
|
| 357 | + case 'title_meta_settings' : |
|
| 358 | + geodir_admin_fields($geodir_settings['title_meta_settings']); ?> |
|
| 359 | 359 | <p class="submit"> |
| 360 | 360 | <input name="save" class="button-primary" type="submit" value="<?php _e('Save changes', 'geodirectory'); ?>" />
|
| 361 | 361 | <input type="hidden" name="subtab" id="last_tab" /> |
| 362 | 362 | </p> |
| 363 | 363 | </div> |
| 364 | 364 | <?php break; |
| 365 | - case 'notifications_settings' : |
|
| 366 | - geodir_admin_fields($geodir_settings['notifications_settings']); ?> |
|
| 365 | + case 'notifications_settings' : |
|
| 366 | + geodir_admin_fields($geodir_settings['notifications_settings']); ?> |
|
| 367 | 367 | |
| 368 | 368 | <p class="submit"> |
| 369 | 369 | |
@@ -373,36 +373,36 @@ discard block |
||
| 373 | 373 | </div> |
| 374 | 374 | |
| 375 | 375 | <?php break; |
| 376 | - case 'default_location_settings' : |
|
| 377 | - ?> |
|
| 376 | + case 'default_location_settings' : |
|
| 377 | + ?> |
|
| 378 | 378 | <div class="inner_content_tab_main"> |
| 379 | 379 | <div class="gd-content-heading"> |
| 380 | 380 | <?php global $wpdb; |
| 381 | 381 | |
| 382 | 382 | |
| 383 | - $location_result = geodir_get_default_location(); |
|
| 383 | + $location_result = geodir_get_default_location(); |
|
| 384 | 384 | |
| 385 | - $prefix = ''; |
|
| 385 | + $prefix = ''; |
|
| 386 | 386 | |
| 387 | 387 | |
| 388 | - $lat = isset($location_result->city_latitude) ? $location_result->city_latitude : ''; |
|
| 389 | - $lng = isset($location_result->city_longitude) ? $location_result->city_longitude : ''; |
|
| 390 | - $city = isset($location_result->city) ? $location_result->city : ''; |
|
| 391 | - $region = isset($location_result->region) ? $location_result->region : ''; |
|
| 392 | - $country = isset($location_result->country) ? $location_result->country : ''; |
|
| 388 | + $lat = isset($location_result->city_latitude) ? $location_result->city_latitude : ''; |
|
| 389 | + $lng = isset($location_result->city_longitude) ? $location_result->city_longitude : ''; |
|
| 390 | + $city = isset($location_result->city) ? $location_result->city : ''; |
|
| 391 | + $region = isset($location_result->region) ? $location_result->region : ''; |
|
| 392 | + $country = isset($location_result->country) ? $location_result->country : ''; |
|
| 393 | 393 | |
| 394 | 394 | |
| 395 | - $map_title = __("Set Address On Map", 'geodirectory');
|
|
| 395 | + $map_title = __("Set Address On Map", 'geodirectory');
|
|
| 396 | 396 | |
| 397 | - ?> |
|
| 397 | + ?> |
|
| 398 | 398 | |
| 399 | 399 | <h3><?php _e('Set Default Location', 'geodirectory');?></h3>
|
| 400 | 400 | |
| 401 | 401 | <input type="hidden" name="add_location" value="location"> |
| 402 | 402 | |
| 403 | 403 | <input type="hidden" name="update_city" value="<?php if (isset($location_result->location_id)) {
|
| 404 | - echo $location_result->location_id; |
|
| 405 | - } ?>"> |
|
| 404 | + echo $location_result->location_id; |
|
| 405 | + } ?>"> |
|
| 406 | 406 | |
| 407 | 407 | <input type="hidden" name="address" id="<?php echo $prefix;?>address" value=""> |
| 408 | 408 | |
@@ -415,8 +415,8 @@ discard block |
||
| 415 | 415 | <input class="require" type="text" size="80" style="width:440px" |
| 416 | 416 | id="<?php echo $prefix;?>city" name="city" |
| 417 | 417 | value="<?php if (isset($location_result->city)) {
|
| 418 | - echo $location_result->city; |
|
| 419 | - } ?>"/> |
|
| 418 | + echo $location_result->city; |
|
| 419 | + } ?>"/> |
|
| 420 | 420 | |
| 421 | 421 | <div |
| 422 | 422 | class="gd-location_message_error"> <?php _e('This field is required.', 'geodirectory'); ?></div>
|
@@ -431,8 +431,8 @@ discard block |
||
| 431 | 431 | <input class="require" type="text" size="80" style="width:440px" |
| 432 | 432 | id="<?php echo $prefix;?>region" name="region" |
| 433 | 433 | value="<?php if (isset($location_result->region)) {
|
| 434 | - echo $location_result->region; |
|
| 435 | - } ?>"/> |
|
| 434 | + echo $location_result->region; |
|
| 435 | + } ?>"/> |
|
| 436 | 436 | |
| 437 | 437 | <div |
| 438 | 438 | class="gd-location_message_error"> <?php _e('This field is required.', 'geodirectory'); ?></div>
|
@@ -446,8 +446,8 @@ discard block |
||
| 446 | 446 | <div class="gtd-formfeild required" style="padding-top:10px;"> |
| 447 | 447 | <?php |
| 448 | 448 | |
| 449 | - $country_result = isset($location_result->country) ? $location_result->country : ''; |
|
| 450 | - ?> |
|
| 449 | + $country_result = isset($location_result->country) ? $location_result->country : ''; |
|
| 450 | + ?> |
|
| 451 | 451 | <select id="<?php echo $prefix ?>country" class="chosen_select" |
| 452 | 452 | data-location_type="country" name="<?php echo $prefix ?>country" |
| 453 | 453 | data-placeholder="<?php _e('Choose a country.', 'geodirectory');?>"
|
@@ -470,12 +470,12 @@ discard block |
||
| 470 | 470 | scope="row"><?php _e('Set Location on Map', 'geodirectory');?></th>
|
| 471 | 471 | <td class="forminp"> |
| 472 | 472 | <?php |
| 473 | - /** |
|
| 474 | - * Contains add listing page map functions. |
|
| 475 | - * |
|
| 476 | - * @since 1.0.0 |
|
| 477 | - */ |
|
| 478 | - include(geodir_plugin_path() . "/geodirectory-functions/map-functions/map_on_add_listing_page.php");?> |
|
| 473 | + /** |
|
| 474 | + * Contains add listing page map functions. |
|
| 475 | + * |
|
| 476 | + * @since 1.0.0 |
|
| 477 | + */ |
|
| 478 | + include(geodir_plugin_path() . "/geodirectory-functions/map-functions/map_on_add_listing_page.php");?> |
|
| 479 | 479 | </td> |
| 480 | 480 | </tr> |
| 481 | 481 | <tr valign="top" class="single_select_page"> |
@@ -485,8 +485,8 @@ discard block |
||
| 485 | 485 | <input type="text" class="require" size="80" style="width:440px" |
| 486 | 486 | id="<?php echo $prefix;?>latitude" name="latitude" |
| 487 | 487 | value="<?php if (isset($location_result->city_latitude)) {
|
| 488 | - echo $location_result->city_latitude; |
|
| 489 | - } ?>"/> |
|
| 488 | + echo $location_result->city_latitude; |
|
| 489 | + } ?>"/> |
|
| 490 | 490 | |
| 491 | 491 | <div |
| 492 | 492 | class="gd-location_message_error"><?php _e('This field is required.', 'geodirectory'); ?></div>
|
@@ -502,8 +502,8 @@ discard block |
||
| 502 | 502 | <input type="text" class="require" size="80" style="width:440px" |
| 503 | 503 | id="<?php echo $prefix;?>longitude" name="longitude" |
| 504 | 504 | value="<?php if (isset($location_result->city_longitude)) {
|
| 505 | - echo $location_result->city_longitude; |
|
| 506 | - } ?>"/> |
|
| 505 | + echo $location_result->city_longitude; |
|
| 506 | + } ?>"/> |
|
| 507 | 507 | |
| 508 | 508 | <div |
| 509 | 509 | class="gd-location_message_error"><?php _e('This field is required.', 'geodirectory'); ?></div>
|
@@ -535,22 +535,22 @@ discard block |
||
| 535 | 535 | </div> |
| 536 | 536 | </div> |
| 537 | 537 | <?php break; |
| 538 | - case $listing_type . '_fields_settings' : |
|
| 538 | + case $listing_type . '_fields_settings' : |
|
| 539 | 539 | |
| 540 | - geodir_custom_post_type_form(); |
|
| 540 | + geodir_custom_post_type_form(); |
|
| 541 | 541 | |
| 542 | - break; |
|
| 543 | - case 'tools_settings' : |
|
| 544 | - geodir_diagnostic_tools_setting_page(); |
|
| 545 | - break; |
|
| 546 | - case 'compatibility_settings' : |
|
| 547 | - geodir_theme_compatibility_setting_page(); |
|
| 548 | - break; |
|
| 542 | + break; |
|
| 543 | + case 'tools_settings' : |
|
| 544 | + geodir_diagnostic_tools_setting_page(); |
|
| 545 | + break; |
|
| 546 | + case 'compatibility_settings' : |
|
| 547 | + geodir_theme_compatibility_setting_page(); |
|
| 548 | + break; |
|
| 549 | 549 | case 'import_export' : |
| 550 | - geodir_import_export_page(); |
|
| 551 | - break; |
|
| 550 | + geodir_import_export_page(); |
|
| 551 | + break; |
|
| 552 | 552 | |
| 553 | - }// end of switch |
|
| 553 | + }// end of switch |
|
| 554 | 554 | } |
| 555 | 555 | |
| 556 | 556 | |
@@ -590,170 +590,170 @@ discard block |
||
| 590 | 590 | function geodir_update_options_compatibility_settings() |
| 591 | 591 | {
|
| 592 | 592 | |
| 593 | - global $wpdb; |
|
| 593 | + global $wpdb; |
|
| 594 | 594 | |
| 595 | 595 | |
| 596 | - $theme_settings = array(); |
|
| 596 | + $theme_settings = array(); |
|
| 597 | 597 | |
| 598 | - $theme_settings['geodir_wrapper_open_id'] = $_POST['geodir_wrapper_open_id']; |
|
| 599 | - $theme_settings['geodir_wrapper_open_class'] = $_POST['geodir_wrapper_open_class']; |
|
| 600 | - $theme_settings['geodir_wrapper_open_replace'] = stripslashes($_POST['geodir_wrapper_open_replace']); |
|
| 598 | + $theme_settings['geodir_wrapper_open_id'] = $_POST['geodir_wrapper_open_id']; |
|
| 599 | + $theme_settings['geodir_wrapper_open_class'] = $_POST['geodir_wrapper_open_class']; |
|
| 600 | + $theme_settings['geodir_wrapper_open_replace'] = stripslashes($_POST['geodir_wrapper_open_replace']); |
|
| 601 | 601 | |
| 602 | - $theme_settings['geodir_wrapper_close_replace'] = stripslashes($_POST['geodir_wrapper_close_replace']); |
|
| 602 | + $theme_settings['geodir_wrapper_close_replace'] = stripslashes($_POST['geodir_wrapper_close_replace']); |
|
| 603 | 603 | |
| 604 | - $theme_settings['geodir_wrapper_content_open_id'] = $_POST['geodir_wrapper_content_open_id']; |
|
| 605 | - $theme_settings['geodir_wrapper_content_open_class'] = $_POST['geodir_wrapper_content_open_class']; |
|
| 606 | - $theme_settings['geodir_wrapper_content_open_replace'] = stripslashes($_POST['geodir_wrapper_content_open_replace']); |
|
| 604 | + $theme_settings['geodir_wrapper_content_open_id'] = $_POST['geodir_wrapper_content_open_id']; |
|
| 605 | + $theme_settings['geodir_wrapper_content_open_class'] = $_POST['geodir_wrapper_content_open_class']; |
|
| 606 | + $theme_settings['geodir_wrapper_content_open_replace'] = stripslashes($_POST['geodir_wrapper_content_open_replace']); |
|
| 607 | 607 | |
| 608 | - $theme_settings['geodir_wrapper_content_close_replace'] = stripslashes($_POST['geodir_wrapper_content_close_replace']); |
|
| 608 | + $theme_settings['geodir_wrapper_content_close_replace'] = stripslashes($_POST['geodir_wrapper_content_close_replace']); |
|
| 609 | 609 | |
| 610 | - $theme_settings['geodir_article_open_id'] = $_POST['geodir_article_open_id']; |
|
| 611 | - $theme_settings['geodir_article_open_class'] = $_POST['geodir_article_open_class']; |
|
| 612 | - $theme_settings['geodir_article_open_replace'] = stripslashes($_POST['geodir_article_open_replace']); |
|
| 610 | + $theme_settings['geodir_article_open_id'] = $_POST['geodir_article_open_id']; |
|
| 611 | + $theme_settings['geodir_article_open_class'] = $_POST['geodir_article_open_class']; |
|
| 612 | + $theme_settings['geodir_article_open_replace'] = stripslashes($_POST['geodir_article_open_replace']); |
|
| 613 | 613 | |
| 614 | - $theme_settings['geodir_article_close_replace'] = stripslashes($_POST['geodir_article_close_replace']); |
|
| 614 | + $theme_settings['geodir_article_close_replace'] = stripslashes($_POST['geodir_article_close_replace']); |
|
| 615 | 615 | |
| 616 | - $theme_settings['geodir_sidebar_right_open_id'] = $_POST['geodir_sidebar_right_open_id']; |
|
| 617 | - $theme_settings['geodir_sidebar_right_open_class'] = $_POST['geodir_sidebar_right_open_class']; |
|
| 618 | - $theme_settings['geodir_sidebar_right_open_replace'] = stripslashes($_POST['geodir_sidebar_right_open_replace']); |
|
| 616 | + $theme_settings['geodir_sidebar_right_open_id'] = $_POST['geodir_sidebar_right_open_id']; |
|
| 617 | + $theme_settings['geodir_sidebar_right_open_class'] = $_POST['geodir_sidebar_right_open_class']; |
|
| 618 | + $theme_settings['geodir_sidebar_right_open_replace'] = stripslashes($_POST['geodir_sidebar_right_open_replace']); |
|
| 619 | 619 | |
| 620 | - $theme_settings['geodir_sidebar_right_close_replace'] = stripslashes($_POST['geodir_sidebar_right_close_replace']); |
|
| 620 | + $theme_settings['geodir_sidebar_right_close_replace'] = stripslashes($_POST['geodir_sidebar_right_close_replace']); |
|
| 621 | 621 | |
| 622 | - $theme_settings['geodir_sidebar_left_open_id'] = $_POST['geodir_sidebar_left_open_id']; |
|
| 623 | - $theme_settings['geodir_sidebar_left_open_class'] = $_POST['geodir_sidebar_left_open_class']; |
|
| 624 | - $theme_settings['geodir_sidebar_left_open_replace'] = stripslashes($_POST['geodir_sidebar_left_open_replace']); |
|
| 622 | + $theme_settings['geodir_sidebar_left_open_id'] = $_POST['geodir_sidebar_left_open_id']; |
|
| 623 | + $theme_settings['geodir_sidebar_left_open_class'] = $_POST['geodir_sidebar_left_open_class']; |
|
| 624 | + $theme_settings['geodir_sidebar_left_open_replace'] = stripslashes($_POST['geodir_sidebar_left_open_replace']); |
|
| 625 | 625 | |
| 626 | - $theme_settings['geodir_sidebar_left_close_replace'] = stripslashes($_POST['geodir_sidebar_left_close_replace']); |
|
| 626 | + $theme_settings['geodir_sidebar_left_close_replace'] = stripslashes($_POST['geodir_sidebar_left_close_replace']); |
|
| 627 | 627 | |
| 628 | - $theme_settings['geodir_main_content_open_id'] = $_POST['geodir_main_content_open_id']; |
|
| 629 | - $theme_settings['geodir_main_content_open_class'] = $_POST['geodir_main_content_open_class']; |
|
| 630 | - $theme_settings['geodir_main_content_open_replace'] = stripslashes($_POST['geodir_main_content_open_replace']); |
|
| 628 | + $theme_settings['geodir_main_content_open_id'] = $_POST['geodir_main_content_open_id']; |
|
| 629 | + $theme_settings['geodir_main_content_open_class'] = $_POST['geodir_main_content_open_class']; |
|
| 630 | + $theme_settings['geodir_main_content_open_replace'] = stripslashes($_POST['geodir_main_content_open_replace']); |
|
| 631 | 631 | |
| 632 | - $theme_settings['geodir_main_content_close_replace'] = stripslashes($_POST['geodir_main_content_close_replace']); |
|
| 632 | + $theme_settings['geodir_main_content_close_replace'] = stripslashes($_POST['geodir_main_content_close_replace']); |
|
| 633 | 633 | |
| 634 | 634 | // Other Actions |
| 635 | - $theme_settings['geodir_top_content_add'] = stripslashes($_POST['geodir_top_content_add']); |
|
| 636 | - $theme_settings['geodir_before_main_content_add'] = stripslashes($_POST['geodir_before_main_content_add']); |
|
| 635 | + $theme_settings['geodir_top_content_add'] = stripslashes($_POST['geodir_top_content_add']); |
|
| 636 | + $theme_settings['geodir_before_main_content_add'] = stripslashes($_POST['geodir_before_main_content_add']); |
|
| 637 | 637 | |
| 638 | 638 | // Filters |
| 639 | - $theme_settings['geodir_full_page_class_filter'] = stripslashes($_POST['geodir_full_page_class_filter']); |
|
| 640 | - $theme_settings['geodir_before_widget_filter'] = stripslashes($_POST['geodir_before_widget_filter']); |
|
| 641 | - $theme_settings['geodir_after_widget_filter'] = stripslashes($_POST['geodir_after_widget_filter']); |
|
| 642 | - $theme_settings['geodir_before_title_filter'] = stripslashes($_POST['geodir_before_title_filter']); |
|
| 643 | - $theme_settings['geodir_after_title_filter'] = stripslashes($_POST['geodir_after_title_filter']); |
|
| 644 | - $theme_settings['geodir_menu_li_class_filter'] = stripslashes($_POST['geodir_menu_li_class_filter']); |
|
| 645 | - $theme_settings['geodir_sub_menu_ul_class_filter'] = stripslashes($_POST['geodir_sub_menu_ul_class_filter']); |
|
| 646 | - $theme_settings['geodir_sub_menu_li_class_filter'] = stripslashes($_POST['geodir_sub_menu_li_class_filter']); |
|
| 647 | - $theme_settings['geodir_menu_a_class_filter'] = stripslashes($_POST['geodir_menu_a_class_filter']); |
|
| 648 | - $theme_settings['geodir_sub_menu_a_class_filter'] = stripslashes($_POST['geodir_sub_menu_a_class_filter']); |
|
| 639 | + $theme_settings['geodir_full_page_class_filter'] = stripslashes($_POST['geodir_full_page_class_filter']); |
|
| 640 | + $theme_settings['geodir_before_widget_filter'] = stripslashes($_POST['geodir_before_widget_filter']); |
|
| 641 | + $theme_settings['geodir_after_widget_filter'] = stripslashes($_POST['geodir_after_widget_filter']); |
|
| 642 | + $theme_settings['geodir_before_title_filter'] = stripslashes($_POST['geodir_before_title_filter']); |
|
| 643 | + $theme_settings['geodir_after_title_filter'] = stripslashes($_POST['geodir_after_title_filter']); |
|
| 644 | + $theme_settings['geodir_menu_li_class_filter'] = stripslashes($_POST['geodir_menu_li_class_filter']); |
|
| 645 | + $theme_settings['geodir_sub_menu_ul_class_filter'] = stripslashes($_POST['geodir_sub_menu_ul_class_filter']); |
|
| 646 | + $theme_settings['geodir_sub_menu_li_class_filter'] = stripslashes($_POST['geodir_sub_menu_li_class_filter']); |
|
| 647 | + $theme_settings['geodir_menu_a_class_filter'] = stripslashes($_POST['geodir_menu_a_class_filter']); |
|
| 648 | + $theme_settings['geodir_sub_menu_a_class_filter'] = stripslashes($_POST['geodir_sub_menu_a_class_filter']); |
|
| 649 | 649 | //location manager filters |
| 650 | - $theme_settings['geodir_location_switcher_menu_li_class_filter'] = stripslashes($_POST['geodir_location_switcher_menu_li_class_filter']); |
|
| 651 | - $theme_settings['geodir_location_switcher_menu_a_class_filter'] = stripslashes($_POST['geodir_location_switcher_menu_a_class_filter']); |
|
| 652 | - $theme_settings['geodir_location_switcher_menu_sub_ul_class_filter'] = stripslashes($_POST['geodir_location_switcher_menu_sub_ul_class_filter']); |
|
| 653 | - $theme_settings['geodir_location_switcher_menu_sub_li_class_filter'] = stripslashes($_POST['geodir_location_switcher_menu_sub_li_class_filter']); |
|
| 650 | + $theme_settings['geodir_location_switcher_menu_li_class_filter'] = stripslashes($_POST['geodir_location_switcher_menu_li_class_filter']); |
|
| 651 | + $theme_settings['geodir_location_switcher_menu_a_class_filter'] = stripslashes($_POST['geodir_location_switcher_menu_a_class_filter']); |
|
| 652 | + $theme_settings['geodir_location_switcher_menu_sub_ul_class_filter'] = stripslashes($_POST['geodir_location_switcher_menu_sub_ul_class_filter']); |
|
| 653 | + $theme_settings['geodir_location_switcher_menu_sub_li_class_filter'] = stripslashes($_POST['geodir_location_switcher_menu_sub_li_class_filter']); |
|
| 654 | 654 | |
| 655 | 655 | |
| 656 | 656 | // theme required css |
| 657 | - $theme_settings['geodir_theme_compat_css'] = stripslashes($_POST['geodir_theme_compat_css']); |
|
| 657 | + $theme_settings['geodir_theme_compat_css'] = stripslashes($_POST['geodir_theme_compat_css']); |
|
| 658 | 658 | |
| 659 | 659 | // theme required js |
| 660 | - $theme_settings['geodir_theme_compat_js'] = stripslashes($_POST['geodir_theme_compat_js']); |
|
| 660 | + $theme_settings['geodir_theme_compat_js'] = stripslashes($_POST['geodir_theme_compat_js']); |
|
| 661 | 661 | |
| 662 | 662 | // theme compat name |
| 663 | - $theme_settings['gd_theme_compat'] = $_POST['gd_theme_compat']; |
|
| 664 | - if ($theme_settings['gd_theme_compat'] == '') {
|
|
| 665 | - update_option('gd_theme_compat', '');
|
|
| 666 | - update_option('theme_compatibility_setting', '');
|
|
| 667 | - return; |
|
| 668 | - } |
|
| 663 | + $theme_settings['gd_theme_compat'] = $_POST['gd_theme_compat']; |
|
| 664 | + if ($theme_settings['gd_theme_compat'] == '') {
|
|
| 665 | + update_option('gd_theme_compat', '');
|
|
| 666 | + update_option('theme_compatibility_setting', '');
|
|
| 667 | + return; |
|
| 668 | + } |
|
| 669 | 669 | |
| 670 | 670 | // theme default options |
| 671 | - $theme_settings['geodir_theme_compat_default_options'] = ''; |
|
| 671 | + $theme_settings['geodir_theme_compat_default_options'] = ''; |
|
| 672 | 672 | |
| 673 | 673 | |
| 674 | 674 | //suported theme code |
| 675 | - $theme_settings['geodir_theme_compat_code'] = false; |
|
| 676 | - |
|
| 677 | - $theme = wp_get_theme(); |
|
| 678 | - |
|
| 679 | - if ($theme->parent()) {
|
|
| 680 | - $theme_name = str_replace(" ", "_", $theme->parent()->get('Name'));
|
|
| 681 | - } else {
|
|
| 682 | - $theme_name = str_replace(" ", "_", $theme->get('Name'));
|
|
| 683 | - } |
|
| 684 | - |
|
| 685 | - if (in_array($theme_name, array('Avada', 'Enfold', 'X', 'Divi', 'Genesis', 'Jupiter', 'Multi_News'))) {// list of themes that have php files
|
|
| 686 | - $theme_settings['geodir_theme_compat_code'] = $theme_name; |
|
| 687 | - } |
|
| 688 | - |
|
| 689 | - |
|
| 690 | - $theme_name = $theme_name . "_custom"; |
|
| 691 | - $theme_arr = get_option('gd_theme_compats');
|
|
| 692 | - update_option('gd_theme_compat', $theme_name);
|
|
| 693 | - /** |
|
| 694 | - * Called before the theme compatibility settings are saved to the DB. |
|
| 695 | - * |
|
| 696 | - * @since 1.4.0 |
|
| 697 | - * @param array $theme_settings {
|
|
| 698 | - * Attributes of the theme compatibility settings array. |
|
| 699 | - * |
|
| 700 | - * @type string $geodir_wrapper_open_id Geodir wrapper open html id. |
|
| 701 | - * @type string $geodir_wrapper_open_class Geodir wrapper open html class. |
|
| 702 | - * @type string $geodir_wrapper_open_replace Geodir wrapper open content replace. |
|
| 703 | - * @type string $geodir_wrapper_close_replace Geodir wrapper close content replace. |
|
| 704 | - * @type string $geodir_wrapper_content_open_id Geodir wrapper content open html id. |
|
| 705 | - * @type string $geodir_wrapper_content_open_class Geodir wrapper content open html class. |
|
| 706 | - * @type string $geodir_wrapper_content_open_replace Geodir wrapper content open content replace. |
|
| 707 | - * @type string $geodir_wrapper_content_close_replace Geodir wrapper content close content replace. |
|
| 708 | - * @type string $geodir_article_open_id Geodir article open html id. |
|
| 709 | - * @type string $geodir_article_open_class Geodir article open html class. |
|
| 710 | - * @type string $geodir_article_open_replace Geodir article open content replace. |
|
| 711 | - * @type string $geodir_article_close_replace Geodir article close content replace. |
|
| 712 | - * @type string $geodir_sidebar_right_open_id Geodir sidebar right open html id. |
|
| 713 | - * @type string $geodir_sidebar_right_open_class Geodir sidebar right open html class. |
|
| 714 | - * @type string $geodir_sidebar_right_open_replace Geodir sidebar right open content replace. |
|
| 715 | - * @type string $geodir_sidebar_right_close_replace Geodir sidebar right close content replace. |
|
| 716 | - * @type string $geodir_sidebar_left_open_id Geodir sidebar left open html id. |
|
| 717 | - * @type string $geodir_sidebar_left_open_class Geodir sidebar left open html class. |
|
| 718 | - * @type string $geodir_sidebar_left_open_replace Geodir sidebar left open content replace. |
|
| 719 | - * @type string $geodir_sidebar_left_close_replace Geodir sidebar left close content replace. |
|
| 720 | - * @type string $geodir_main_content_open_id Geodir main content open html id. |
|
| 721 | - * @type string $geodir_main_content_open_class Geodir main content open html class. |
|
| 722 | - * @type string $geodir_main_content_open_replace Geodir main content open content replace. |
|
| 723 | - * @type string $geodir_main_content_close_replace Geodir main content close content replace. |
|
| 724 | - * @type string $geodir_top_content_add Geodir top content add. |
|
| 725 | - * @type string $geodir_before_main_content_add Geodir before main content add. |
|
| 726 | - * @type string $geodir_full_page_class_filter Geodir full page class filter. |
|
| 727 | - * @type string $geodir_before_widget_filter Geodir before widget filter. |
|
| 728 | - * @type string $geodir_after_widget_filter Geodir after widget filter. |
|
| 729 | - * @type string $geodir_before_title_filter Geodir before title filter. |
|
| 730 | - * @type string $geodir_after_title_filter Geodir after title filter. |
|
| 731 | - * @type string $geodir_menu_li_class_filter Geodir menu li class filter. |
|
| 732 | - * @type string $geodir_sub_menu_ul_class_filter Geodir sub menu ul class filter. |
|
| 733 | - * @type string $geodir_sub_menu_li_class_filter Geodir sub menu li class filter. |
|
| 734 | - * @type string $geodir_menu_a_class_filter Geodir menu a class filter. |
|
| 735 | - * @type string $geodir_sub_menu_a_class_filter Geodir sub menu a class filter. |
|
| 736 | - * @type string $geodir_location_switcher_menu_li_class_filter Geodir location switcher menu li class filter. |
|
| 737 | - * @type string $geodir_location_switcher_menu_a_class_filter Geodir location switcher menu a class filter. |
|
| 738 | - * @type string $geodir_location_switcher_menu_sub_ul_class_filter Geodir location switcher menu sub ul class filter. |
|
| 739 | - * @type string $geodir_location_switcher_menu_sub_li_class_filter Geodir location switcher menu sub li class filter. |
|
| 740 | - * @type string $geodir_theme_compat_css Geodir theme compatibility css. |
|
| 741 | - * @type string $geodir_theme_compat_js Geodir theme compatibility js. |
|
| 742 | - * @type string $gd_theme_compat Gd theme compatibility. |
|
| 743 | - * @type string $geodir_theme_compat_default_options Geodir theme compatibility default options. |
|
| 744 | - * @type bool $geodir_theme_compat_code Geodir theme compatibility code Ex: 'Avada. |
|
| 745 | - * |
|
| 746 | - * } |
|
| 747 | - */ |
|
| 748 | - do_action('gd_compat_save_settings', $theme_settings);
|
|
| 675 | + $theme_settings['geodir_theme_compat_code'] = false; |
|
| 676 | + |
|
| 677 | + $theme = wp_get_theme(); |
|
| 678 | + |
|
| 679 | + if ($theme->parent()) {
|
|
| 680 | + $theme_name = str_replace(" ", "_", $theme->parent()->get('Name'));
|
|
| 681 | + } else {
|
|
| 682 | + $theme_name = str_replace(" ", "_", $theme->get('Name'));
|
|
| 683 | + } |
|
| 684 | + |
|
| 685 | + if (in_array($theme_name, array('Avada', 'Enfold', 'X', 'Divi', 'Genesis', 'Jupiter', 'Multi_News'))) {// list of themes that have php files
|
|
| 686 | + $theme_settings['geodir_theme_compat_code'] = $theme_name; |
|
| 687 | + } |
|
| 688 | + |
|
| 689 | + |
|
| 690 | + $theme_name = $theme_name . "_custom"; |
|
| 691 | + $theme_arr = get_option('gd_theme_compats');
|
|
| 692 | + update_option('gd_theme_compat', $theme_name);
|
|
| 693 | + /** |
|
| 694 | + * Called before the theme compatibility settings are saved to the DB. |
|
| 695 | + * |
|
| 696 | + * @since 1.4.0 |
|
| 697 | + * @param array $theme_settings {
|
|
| 698 | + * Attributes of the theme compatibility settings array. |
|
| 699 | + * |
|
| 700 | + * @type string $geodir_wrapper_open_id Geodir wrapper open html id. |
|
| 701 | + * @type string $geodir_wrapper_open_class Geodir wrapper open html class. |
|
| 702 | + * @type string $geodir_wrapper_open_replace Geodir wrapper open content replace. |
|
| 703 | + * @type string $geodir_wrapper_close_replace Geodir wrapper close content replace. |
|
| 704 | + * @type string $geodir_wrapper_content_open_id Geodir wrapper content open html id. |
|
| 705 | + * @type string $geodir_wrapper_content_open_class Geodir wrapper content open html class. |
|
| 706 | + * @type string $geodir_wrapper_content_open_replace Geodir wrapper content open content replace. |
|
| 707 | + * @type string $geodir_wrapper_content_close_replace Geodir wrapper content close content replace. |
|
| 708 | + * @type string $geodir_article_open_id Geodir article open html id. |
|
| 709 | + * @type string $geodir_article_open_class Geodir article open html class. |
|
| 710 | + * @type string $geodir_article_open_replace Geodir article open content replace. |
|
| 711 | + * @type string $geodir_article_close_replace Geodir article close content replace. |
|
| 712 | + * @type string $geodir_sidebar_right_open_id Geodir sidebar right open html id. |
|
| 713 | + * @type string $geodir_sidebar_right_open_class Geodir sidebar right open html class. |
|
| 714 | + * @type string $geodir_sidebar_right_open_replace Geodir sidebar right open content replace. |
|
| 715 | + * @type string $geodir_sidebar_right_close_replace Geodir sidebar right close content replace. |
|
| 716 | + * @type string $geodir_sidebar_left_open_id Geodir sidebar left open html id. |
|
| 717 | + * @type string $geodir_sidebar_left_open_class Geodir sidebar left open html class. |
|
| 718 | + * @type string $geodir_sidebar_left_open_replace Geodir sidebar left open content replace. |
|
| 719 | + * @type string $geodir_sidebar_left_close_replace Geodir sidebar left close content replace. |
|
| 720 | + * @type string $geodir_main_content_open_id Geodir main content open html id. |
|
| 721 | + * @type string $geodir_main_content_open_class Geodir main content open html class. |
|
| 722 | + * @type string $geodir_main_content_open_replace Geodir main content open content replace. |
|
| 723 | + * @type string $geodir_main_content_close_replace Geodir main content close content replace. |
|
| 724 | + * @type string $geodir_top_content_add Geodir top content add. |
|
| 725 | + * @type string $geodir_before_main_content_add Geodir before main content add. |
|
| 726 | + * @type string $geodir_full_page_class_filter Geodir full page class filter. |
|
| 727 | + * @type string $geodir_before_widget_filter Geodir before widget filter. |
|
| 728 | + * @type string $geodir_after_widget_filter Geodir after widget filter. |
|
| 729 | + * @type string $geodir_before_title_filter Geodir before title filter. |
|
| 730 | + * @type string $geodir_after_title_filter Geodir after title filter. |
|
| 731 | + * @type string $geodir_menu_li_class_filter Geodir menu li class filter. |
|
| 732 | + * @type string $geodir_sub_menu_ul_class_filter Geodir sub menu ul class filter. |
|
| 733 | + * @type string $geodir_sub_menu_li_class_filter Geodir sub menu li class filter. |
|
| 734 | + * @type string $geodir_menu_a_class_filter Geodir menu a class filter. |
|
| 735 | + * @type string $geodir_sub_menu_a_class_filter Geodir sub menu a class filter. |
|
| 736 | + * @type string $geodir_location_switcher_menu_li_class_filter Geodir location switcher menu li class filter. |
|
| 737 | + * @type string $geodir_location_switcher_menu_a_class_filter Geodir location switcher menu a class filter. |
|
| 738 | + * @type string $geodir_location_switcher_menu_sub_ul_class_filter Geodir location switcher menu sub ul class filter. |
|
| 739 | + * @type string $geodir_location_switcher_menu_sub_li_class_filter Geodir location switcher menu sub li class filter. |
|
| 740 | + * @type string $geodir_theme_compat_css Geodir theme compatibility css. |
|
| 741 | + * @type string $geodir_theme_compat_js Geodir theme compatibility js. |
|
| 742 | + * @type string $gd_theme_compat Gd theme compatibility. |
|
| 743 | + * @type string $geodir_theme_compat_default_options Geodir theme compatibility default options. |
|
| 744 | + * @type bool $geodir_theme_compat_code Geodir theme compatibility code Ex: 'Avada. |
|
| 745 | + * |
|
| 746 | + * } |
|
| 747 | + */ |
|
| 748 | + do_action('gd_compat_save_settings', $theme_settings);
|
|
| 749 | 749 | |
| 750 | 750 | //if($_POST['gd_theme_compat'])== |
| 751 | - $theme_arr[$theme_name] = $theme_settings; |
|
| 752 | - update_option('gd_theme_compats', $theme_arr);
|
|
| 751 | + $theme_arr[$theme_name] = $theme_settings; |
|
| 752 | + update_option('gd_theme_compats', $theme_arr);
|
|
| 753 | 753 | |
| 754 | 754 | |
| 755 | 755 | //print_r($theme_settings);exit; |
| 756 | - update_option('theme_compatibility_setting', $theme_settings);
|
|
| 756 | + update_option('theme_compatibility_setting', $theme_settings);
|
|
| 757 | 757 | |
| 758 | 758 | } |
| 759 | 759 | |
@@ -766,12 +766,12 @@ discard block |
||
| 766 | 766 | */ |
| 767 | 767 | function geodir_theme_compatibility_setting_page() |
| 768 | 768 | {
|
| 769 | - global $wpdb; |
|
| 770 | - $tc = get_option('theme_compatibility_setting');
|
|
| 771 | - //print_r($tc); |
|
| 772 | - //print_r(wp_get_theme()); |
|
| 769 | + global $wpdb; |
|
| 770 | + $tc = get_option('theme_compatibility_setting');
|
|
| 771 | + //print_r($tc); |
|
| 772 | + //print_r(wp_get_theme()); |
|
| 773 | 773 | |
| 774 | - ?> |
|
| 774 | + ?> |
|
| 775 | 775 | <div class="inner_content_tab_main"> |
| 776 | 776 | <div class="gd-content-heading"> |
| 777 | 777 | |
@@ -813,21 +813,21 @@ discard block |
||
| 813 | 813 | <option value=""><?php _e('Select Theme', 'geodirectory');?></option>
|
| 814 | 814 | <option value="custom"><?php _e('Custom', 'geodirectory');?></option>
|
| 815 | 815 | <?php |
| 816 | - $theme_arr = get_option('gd_theme_compats');
|
|
| 817 | - $theme_active = get_option('gd_theme_compat');
|
|
| 818 | - if (is_array($theme_arr)) {
|
|
| 819 | - foreach ($theme_arr as $key => $theme) {
|
|
| 820 | - $sel = ''; |
|
| 821 | - if ($theme_active == $key) {
|
|
| 822 | - $sel = "selected"; |
|
| 823 | - } |
|
| 824 | - echo "<option $sel>$key</option>"; |
|
| 825 | - } |
|
| 816 | + $theme_arr = get_option('gd_theme_compats');
|
|
| 817 | + $theme_active = get_option('gd_theme_compat');
|
|
| 818 | + if (is_array($theme_arr)) {
|
|
| 819 | + foreach ($theme_arr as $key => $theme) {
|
|
| 820 | + $sel = ''; |
|
| 821 | + if ($theme_active == $key) {
|
|
| 822 | + $sel = "selected"; |
|
| 823 | + } |
|
| 824 | + echo "<option $sel>$key</option>"; |
|
| 825 | + } |
|
| 826 | 826 | |
| 827 | 827 | |
| 828 | - } |
|
| 828 | + } |
|
| 829 | 829 | |
| 830 | - ?> |
|
| 830 | + ?> |
|
| 831 | 831 | </select> |
| 832 | 832 | <button onclick="gd_comp_export();" type="button" |
| 833 | 833 | class="button-primary"><?php _e('Export', 'geodirectory');?></button>
|
@@ -936,11 +936,11 @@ discard block |
||
| 936 | 936 | <small>geodir_wrapper_open</small> |
| 937 | 937 | </td> |
| 938 | 938 | <td><input value="<?php if (isset($tc['geodir_wrapper_open_id'])) {
|
| 939 | - echo $tc['geodir_wrapper_open_id']; |
|
| 940 | - }?>" type="text" name="geodir_wrapper_open_id" placeholder="geodir-wrapper"/></td> |
|
| 939 | + echo $tc['geodir_wrapper_open_id']; |
|
| 940 | + }?>" type="text" name="geodir_wrapper_open_id" placeholder="geodir-wrapper"/></td> |
|
| 941 | 941 | <td><input value="<?php if (isset($tc['geodir_wrapper_open_class'])) {
|
| 942 | - echo $tc['geodir_wrapper_open_class']; |
|
| 943 | - }?>" type="text" name="geodir_wrapper_open_class" placeholder=""/></td> |
|
| 942 | + echo $tc['geodir_wrapper_open_class']; |
|
| 943 | + }?>" type="text" name="geodir_wrapper_open_class" placeholder=""/></td> |
|
| 944 | 944 | </tr> |
| 945 | 945 | |
| 946 | 946 | <tr class="gd-theme-comp-out"> |
@@ -948,8 +948,8 @@ discard block |
||
| 948 | 948 | <span><?php _e('Output:', 'geodirectory');?></span>
|
| 949 | 949 | <textarea name="geodir_wrapper_open_replace" |
| 950 | 950 | placeholder='<div id="[id]" class="[class]">'><?php if (isset($tc['geodir_wrapper_open_replace'])) {
|
| 951 | - echo $tc['geodir_wrapper_open_replace']; |
|
| 952 | - }?></textarea> |
|
| 951 | + echo $tc['geodir_wrapper_open_replace']; |
|
| 952 | + }?></textarea> |
|
| 953 | 953 | </td> |
| 954 | 954 | </tr> |
| 955 | 955 | |
@@ -969,8 +969,8 @@ discard block |
||
| 969 | 969 | <span><?php _e('Output:', 'geodirectory');?></span>
|
| 970 | 970 | <textarea name="geodir_wrapper_close_replace" |
| 971 | 971 | placeholder='</div><!-- wrapper ends here-->'><?php if (isset($tc['geodir_wrapper_close_replace'])) {
|
| 972 | - echo $tc['geodir_wrapper_close_replace']; |
|
| 973 | - }?></textarea> |
|
| 972 | + echo $tc['geodir_wrapper_close_replace']; |
|
| 973 | + }?></textarea> |
|
| 974 | 974 | </td> |
| 975 | 975 | </tr> |
| 976 | 976 | |
@@ -980,12 +980,12 @@ discard block |
||
| 980 | 980 | <small>geodir_wrapper_content_open</small> |
| 981 | 981 | </td> |
| 982 | 982 | <td><input value="<?php if (isset($tc['geodir_wrapper_content_open_id'])) {
|
| 983 | - echo $tc['geodir_wrapper_content_open_id']; |
|
| 984 | - }?>" type="text" name="geodir_wrapper_content_open_id" placeholder="geodir-wrapper-content"/> |
|
| 983 | + echo $tc['geodir_wrapper_content_open_id']; |
|
| 984 | + }?>" type="text" name="geodir_wrapper_content_open_id" placeholder="geodir-wrapper-content"/> |
|
| 985 | 985 | </td> |
| 986 | 986 | <td><input value="<?php if (isset($tc['geodir_wrapper_content_open_class'])) {
|
| 987 | - echo $tc['geodir_wrapper_content_open_class']; |
|
| 988 | - }?>" type="text" name="geodir_wrapper_content_open_class" placeholder=""/></td> |
|
| 987 | + echo $tc['geodir_wrapper_content_open_class']; |
|
| 988 | + }?>" type="text" name="geodir_wrapper_content_open_class" placeholder=""/></td> |
|
| 989 | 989 | </tr> |
| 990 | 990 | |
| 991 | 991 | <tr class="gd-theme-comp-out"> |
@@ -993,8 +993,8 @@ discard block |
||
| 993 | 993 | <span><?php _e('Output:', 'geodirectory');?></span>
|
| 994 | 994 | <textarea name="geodir_wrapper_content_open_replace" |
| 995 | 995 | placeholder='<div id="[id]" class="[class]" role="main" [width_css]>'><?php if (isset($tc['geodir_wrapper_content_open_replace'])) {
|
| 996 | - echo $tc['geodir_wrapper_content_open_replace']; |
|
| 997 | - }?></textarea> |
|
| 996 | + echo $tc['geodir_wrapper_content_open_replace']; |
|
| 997 | + }?></textarea> |
|
| 998 | 998 | </td> |
| 999 | 999 | </tr> |
| 1000 | 1000 | |
@@ -1014,8 +1014,8 @@ discard block |
||
| 1014 | 1014 | <span><?php _e('Output:', 'geodirectory');?></span>
|
| 1015 | 1015 | <textarea name="geodir_wrapper_content_close_replace" |
| 1016 | 1016 | placeholder='</div><!-- content ends here-->'><?php if (isset($tc['geodir_wrapper_content_close_replace'])) {
|
| 1017 | - echo $tc['geodir_wrapper_content_close_replace']; |
|
| 1018 | - }?></textarea> |
|
| 1017 | + echo $tc['geodir_wrapper_content_close_replace']; |
|
| 1018 | + }?></textarea> |
|
| 1019 | 1019 | </td> |
| 1020 | 1020 | </tr> |
| 1021 | 1021 | |
@@ -1024,11 +1024,11 @@ discard block |
||
| 1024 | 1024 | <small>geodir_article_open</small> |
| 1025 | 1025 | </td> |
| 1026 | 1026 | <td><input value="<?php if (isset($tc['geodir_article_open_id'])) {
|
| 1027 | - echo $tc['geodir_article_open_id']; |
|
| 1028 | - }?>" type="text" name="geodir_article_open_id" placeholder="geodir-wrapper-content"/></td> |
|
| 1027 | + echo $tc['geodir_article_open_id']; |
|
| 1028 | + }?>" type="text" name="geodir_article_open_id" placeholder="geodir-wrapper-content"/></td> |
|
| 1029 | 1029 | <td><input value="<?php if (isset($tc['geodir_article_open_class'])) {
|
| 1030 | - echo $tc['geodir_article_open_class']; |
|
| 1031 | - }?>" type="text" name="geodir_article_open_class" placeholder=""/></td> |
|
| 1030 | + echo $tc['geodir_article_open_class']; |
|
| 1031 | + }?>" type="text" name="geodir_article_open_class" placeholder=""/></td> |
|
| 1032 | 1032 | </tr> |
| 1033 | 1033 | |
| 1034 | 1034 | <tr class="gd-theme-comp-out"> |
@@ -1036,8 +1036,8 @@ discard block |
||
| 1036 | 1036 | <span><?php _e('Output:', 'geodirectory');?></span>
|
| 1037 | 1037 | <textarea name="geodir_article_open_replace" |
| 1038 | 1038 | placeholder='<article id="[id]" class="[class]" itemscope itemtype="[itemtype]">'><?php if (isset($tc['geodir_article_open_replace'])) {
|
| 1039 | - echo $tc['geodir_article_open_replace']; |
|
| 1040 | - }?></textarea> |
|
| 1039 | + echo $tc['geodir_article_open_replace']; |
|
| 1040 | + }?></textarea> |
|
| 1041 | 1041 | </td> |
| 1042 | 1042 | </tr> |
| 1043 | 1043 | |
@@ -1056,8 +1056,8 @@ discard block |
||
| 1056 | 1056 | <span><?php _e('Output:', 'geodirectory');?></span>
|
| 1057 | 1057 | <textarea name="geodir_article_close_replace" |
| 1058 | 1058 | placeholder='</article><!-- article ends here-->'><?php if (isset($tc['geodir_article_close_replace'])) {
|
| 1059 | - echo $tc['geodir_article_close_replace']; |
|
| 1060 | - }?></textarea> |
|
| 1059 | + echo $tc['geodir_article_close_replace']; |
|
| 1060 | + }?></textarea> |
|
| 1061 | 1061 | </td> |
| 1062 | 1062 | </tr> |
| 1063 | 1063 | |
@@ -1066,11 +1066,11 @@ discard block |
||
| 1066 | 1066 | <small>geodir_sidebar_right_open</small> |
| 1067 | 1067 | </td> |
| 1068 | 1068 | <td><input value="<?php if (isset($tc['geodir_sidebar_right_open_id'])) {
|
| 1069 | - echo $tc['geodir_sidebar_right_open_id']; |
|
| 1070 | - }?>" type="text" name="geodir_sidebar_right_open_id" placeholder="geodir-sidebar-right"/></td> |
|
| 1069 | + echo $tc['geodir_sidebar_right_open_id']; |
|
| 1070 | + }?>" type="text" name="geodir_sidebar_right_open_id" placeholder="geodir-sidebar-right"/></td> |
|
| 1071 | 1071 | <td><input value="<?php if (isset($tc['geodir_sidebar_right_open_class'])) {
|
| 1072 | - echo $tc['geodir_sidebar_right_open_class']; |
|
| 1073 | - }?>" type="text" name="geodir_sidebar_right_open_class" |
|
| 1072 | + echo $tc['geodir_sidebar_right_open_class']; |
|
| 1073 | + }?>" type="text" name="geodir_sidebar_right_open_class" |
|
| 1074 | 1074 | placeholder="geodir-sidebar-right geodir-listings-sidebar-right"/></td> |
| 1075 | 1075 | </tr> |
| 1076 | 1076 | |
@@ -1079,8 +1079,8 @@ discard block |
||
| 1079 | 1079 | <span><?php _e('Output:', 'geodirectory');?></span>
|
| 1080 | 1080 | <textarea name="geodir_sidebar_right_open_replace" |
| 1081 | 1081 | placeholder='<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>'><?php if (isset($tc['geodir_sidebar_right_open_replace'])) {
|
| 1082 | - echo $tc['geodir_sidebar_right_open_replace']; |
|
| 1083 | - }?></textarea> |
|
| 1082 | + echo $tc['geodir_sidebar_right_open_replace']; |
|
| 1083 | + }?></textarea> |
|
| 1084 | 1084 | </td> |
| 1085 | 1085 | </tr> |
| 1086 | 1086 | |
@@ -1099,8 +1099,8 @@ discard block |
||
| 1099 | 1099 | <span><?php _e('Output:', 'geodirectory');?></span>
|
| 1100 | 1100 | <textarea name="geodir_sidebar_right_close_replace" |
| 1101 | 1101 | placeholder='</aside><!-- sidebar ends here-->'><?php if (isset($tc['geodir_sidebar_right_close_replace'])) {
|
| 1102 | - echo $tc['geodir_sidebar_right_close_replace']; |
|
| 1103 | - }?></textarea> |
|
| 1102 | + echo $tc['geodir_sidebar_right_close_replace']; |
|
| 1103 | + }?></textarea> |
|
| 1104 | 1104 | </td> |
| 1105 | 1105 | </tr> |
| 1106 | 1106 | |
@@ -1110,11 +1110,11 @@ discard block |
||
| 1110 | 1110 | <small>geodir_sidebar_left_open</small> |
| 1111 | 1111 | </td> |
| 1112 | 1112 | <td><input value="<?php if (isset($tc['geodir_sidebar_left_open_id'])) {
|
| 1113 | - echo $tc['geodir_sidebar_left_open_id']; |
|
| 1114 | - }?>" type="text" name="geodir_sidebar_left_open_id" placeholder="geodir-sidebar-left"/></td> |
|
| 1113 | + echo $tc['geodir_sidebar_left_open_id']; |
|
| 1114 | + }?>" type="text" name="geodir_sidebar_left_open_id" placeholder="geodir-sidebar-left"/></td> |
|
| 1115 | 1115 | <td><input value="<?php if (isset($tc['geodir_sidebar_left_open_class'])) {
|
| 1116 | - echo $tc['geodir_sidebar_left_open_class']; |
|
| 1117 | - }?>" type="text" name="geodir_sidebar_left_open_class" |
|
| 1116 | + echo $tc['geodir_sidebar_left_open_class']; |
|
| 1117 | + }?>" type="text" name="geodir_sidebar_left_open_class" |
|
| 1118 | 1118 | placeholder="geodir-sidebar-left geodir-listings-sidebar-left"/></td> |
| 1119 | 1119 | </tr> |
| 1120 | 1120 | |
@@ -1123,8 +1123,8 @@ discard block |
||
| 1123 | 1123 | <span><?php _e('Output:', 'geodirectory');?></span>
|
| 1124 | 1124 | <textarea name="geodir_sidebar_left_open_replace" |
| 1125 | 1125 | placeholder='<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>'><?php if (isset($tc['geodir_sidebar_left_open_replace'])) {
|
| 1126 | - echo $tc['geodir_sidebar_left_open_replace']; |
|
| 1127 | - }?></textarea> |
|
| 1126 | + echo $tc['geodir_sidebar_left_open_replace']; |
|
| 1127 | + }?></textarea> |
|
| 1128 | 1128 | </td> |
| 1129 | 1129 | </tr> |
| 1130 | 1130 | |
@@ -1143,8 +1143,8 @@ discard block |
||
| 1143 | 1143 | <span><?php _e('Output:', 'geodirectory');?></span>
|
| 1144 | 1144 | <textarea name="geodir_sidebar_left_close_replace" |
| 1145 | 1145 | placeholder='</aside><!-- sidebar ends here-->'><?php if (isset($tc['geodir_sidebar_left_close_replace'])) {
|
| 1146 | - echo $tc['geodir_sidebar_left_close_replace']; |
|
| 1147 | - }?></textarea> |
|
| 1146 | + echo $tc['geodir_sidebar_left_close_replace']; |
|
| 1147 | + }?></textarea> |
|
| 1148 | 1148 | </td> |
| 1149 | 1149 | </tr> |
| 1150 | 1150 | |
@@ -1153,11 +1153,11 @@ discard block |
||
| 1153 | 1153 | <small>geodir_main_content_open</small> |
| 1154 | 1154 | </td> |
| 1155 | 1155 | <td><input value="<?php if (isset($tc['geodir_main_content_open_id'])) {
|
| 1156 | - echo $tc['geodir_main_content_open_id']; |
|
| 1157 | - }?>" type="text" name="geodir_main_content_open_id" placeholder="geodir-main-content"/></td> |
|
| 1156 | + echo $tc['geodir_main_content_open_id']; |
|
| 1157 | + }?>" type="text" name="geodir_main_content_open_id" placeholder="geodir-main-content"/></td> |
|
| 1158 | 1158 | <td><input value="<?php if (isset($tc['geodir_main_content_open_class'])) {
|
| 1159 | - echo $tc['geodir_main_content_open_class']; |
|
| 1160 | - }?>" type="text" name="geodir_main_content_open_class" placeholder="CURRENT-PAGE-page"/></td> |
|
| 1159 | + echo $tc['geodir_main_content_open_class']; |
|
| 1160 | + }?>" type="text" name="geodir_main_content_open_class" placeholder="CURRENT-PAGE-page"/></td> |
|
| 1161 | 1161 | </tr> |
| 1162 | 1162 | |
| 1163 | 1163 | <tr class="gd-theme-comp-out"> |
@@ -1165,8 +1165,8 @@ discard block |
||
| 1165 | 1165 | <span><?php _e('Output:', 'geodirectory');?></span>
|
| 1166 | 1166 | <textarea name="geodir_main_content_open_replace" |
| 1167 | 1167 | placeholder='<main id="[id]" class="[class]" role="main">'><?php if (isset($tc['geodir_main_content_open_replace'])) {
|
| 1168 | - echo $tc['geodir_main_content_open_replace']; |
|
| 1169 | - }?></textarea> |
|
| 1168 | + echo $tc['geodir_main_content_open_replace']; |
|
| 1169 | + }?></textarea> |
|
| 1170 | 1170 | </td> |
| 1171 | 1171 | </tr> |
| 1172 | 1172 | |
@@ -1185,8 +1185,8 @@ discard block |
||
| 1185 | 1185 | <span><?php _e('Output:', 'geodirectory');?></span>
|
| 1186 | 1186 | <textarea name="geodir_main_content_close_replace" |
| 1187 | 1187 | placeholder='</main><!-- main ends here-->'><?php if (isset($tc['geodir_main_content_close_replace'])) {
|
| 1188 | - echo $tc['geodir_main_content_close_replace']; |
|
| 1189 | - }?></textarea> |
|
| 1188 | + echo $tc['geodir_main_content_close_replace']; |
|
| 1189 | + }?></textarea> |
|
| 1190 | 1190 | </td> |
| 1191 | 1191 | </tr> |
| 1192 | 1192 | |
@@ -1210,8 +1210,8 @@ discard block |
||
| 1210 | 1210 | </td> |
| 1211 | 1211 | <td><textarea name="geodir_top_content_add" |
| 1212 | 1212 | placeholder=''><?php if (isset($tc['geodir_top_content_add'])) {
|
| 1213 | - echo $tc['geodir_top_content_add']; |
|
| 1214 | - }?></textarea></td> |
|
| 1213 | + echo $tc['geodir_top_content_add']; |
|
| 1214 | + }?></textarea></td> |
|
| 1215 | 1215 | </tr> |
| 1216 | 1216 | |
| 1217 | 1217 | <tr> |
@@ -1220,8 +1220,8 @@ discard block |
||
| 1220 | 1220 | </td> |
| 1221 | 1221 | <td><textarea name="geodir_before_main_content_add" |
| 1222 | 1222 | placeholder=''><?php if (isset($tc['geodir_before_main_content_add'])) {
|
| 1223 | - echo $tc['geodir_before_main_content_add']; |
|
| 1224 | - }?></textarea></td> |
|
| 1223 | + echo $tc['geodir_before_main_content_add']; |
|
| 1224 | + }?></textarea></td> |
|
| 1225 | 1225 | </tr> |
| 1226 | 1226 | |
| 1227 | 1227 | |
@@ -1244,8 +1244,8 @@ discard block |
||
| 1244 | 1244 | </td> |
| 1245 | 1245 | <td><textarea name="geodir_full_page_class_filter" |
| 1246 | 1246 | placeholder='geodir_full_page clearfix'><?php if (isset($tc['geodir_full_page_class_filter'])) {
|
| 1247 | - echo $tc['geodir_full_page_class_filter']; |
|
| 1248 | - }?></textarea></td> |
|
| 1247 | + echo $tc['geodir_full_page_class_filter']; |
|
| 1248 | + }?></textarea></td> |
|
| 1249 | 1249 | </tr> |
| 1250 | 1250 | |
| 1251 | 1251 | <tr> |
@@ -1254,8 +1254,8 @@ discard block |
||
| 1254 | 1254 | </td> |
| 1255 | 1255 | <td><textarea name="geodir_before_widget_filter" |
| 1256 | 1256 | placeholder='<section id="%1$s" class="widget geodir-widget %2$s">'><?php if (isset($tc['geodir_before_widget_filter'])) {
|
| 1257 | - echo $tc['geodir_before_widget_filter']; |
|
| 1258 | - }?></textarea></td> |
|
| 1257 | + echo $tc['geodir_before_widget_filter']; |
|
| 1258 | + }?></textarea></td> |
|
| 1259 | 1259 | </tr> |
| 1260 | 1260 | |
| 1261 | 1261 | <tr> |
@@ -1264,8 +1264,8 @@ discard block |
||
| 1264 | 1264 | </td> |
| 1265 | 1265 | <td><textarea name="geodir_after_widget_filter" |
| 1266 | 1266 | placeholder='</section>'><?php if (isset($tc['geodir_after_widget_filter'])) {
|
| 1267 | - echo $tc['geodir_after_widget_filter']; |
|
| 1268 | - }?></textarea></td> |
|
| 1267 | + echo $tc['geodir_after_widget_filter']; |
|
| 1268 | + }?></textarea></td> |
|
| 1269 | 1269 | </tr> |
| 1270 | 1270 | |
| 1271 | 1271 | <tr> |
@@ -1274,8 +1274,8 @@ discard block |
||
| 1274 | 1274 | </td> |
| 1275 | 1275 | <td><textarea name="geodir_before_title_filter" |
| 1276 | 1276 | placeholder='<h3 class="widget-title">'><?php if (isset($tc['geodir_before_title_filter'])) {
|
| 1277 | - echo $tc['geodir_before_title_filter']; |
|
| 1278 | - }?></textarea></td> |
|
| 1277 | + echo $tc['geodir_before_title_filter']; |
|
| 1278 | + }?></textarea></td> |
|
| 1279 | 1279 | </tr> |
| 1280 | 1280 | |
| 1281 | 1281 | <tr> |
@@ -1284,8 +1284,8 @@ discard block |
||
| 1284 | 1284 | </td> |
| 1285 | 1285 | <td><textarea name="geodir_after_title_filter" |
| 1286 | 1286 | placeholder='</h3>'><?php if (isset($tc['geodir_after_title_filter'])) {
|
| 1287 | - echo $tc['geodir_after_title_filter']; |
|
| 1288 | - }?></textarea></td> |
|
| 1287 | + echo $tc['geodir_after_title_filter']; |
|
| 1288 | + }?></textarea></td> |
|
| 1289 | 1289 | </tr> |
| 1290 | 1290 | |
| 1291 | 1291 | <tr> |
@@ -1294,8 +1294,8 @@ discard block |
||
| 1294 | 1294 | </td> |
| 1295 | 1295 | <td><textarea name="geodir_menu_li_class_filter" |
| 1296 | 1296 | placeholder='menu-item'><?php if (isset($tc['geodir_menu_li_class_filter'])) {
|
| 1297 | - echo $tc['geodir_menu_li_class_filter']; |
|
| 1298 | - }?></textarea></td> |
|
| 1297 | + echo $tc['geodir_menu_li_class_filter']; |
|
| 1298 | + }?></textarea></td> |
|
| 1299 | 1299 | </tr> |
| 1300 | 1300 | |
| 1301 | 1301 | <tr> |
@@ -1304,8 +1304,8 @@ discard block |
||
| 1304 | 1304 | </td> |
| 1305 | 1305 | <td><textarea name="geodir_sub_menu_ul_class_filter" |
| 1306 | 1306 | placeholder='sub-menu'><?php if (isset($tc['geodir_sub_menu_ul_class_filter'])) {
|
| 1307 | - echo $tc['geodir_sub_menu_ul_class_filter']; |
|
| 1308 | - }?></textarea></td> |
|
| 1307 | + echo $tc['geodir_sub_menu_ul_class_filter']; |
|
| 1308 | + }?></textarea></td> |
|
| 1309 | 1309 | </tr> |
| 1310 | 1310 | |
| 1311 | 1311 | <tr> |
@@ -1314,8 +1314,8 @@ discard block |
||
| 1314 | 1314 | </td> |
| 1315 | 1315 | <td><textarea name="geodir_sub_menu_li_class_filter" |
| 1316 | 1316 | placeholder='menu-item'><?php if (isset($tc['geodir_sub_menu_li_class_filter'])) {
|
| 1317 | - echo $tc['geodir_sub_menu_li_class_filter']; |
|
| 1318 | - }?></textarea></td> |
|
| 1317 | + echo $tc['geodir_sub_menu_li_class_filter']; |
|
| 1318 | + }?></textarea></td> |
|
| 1319 | 1319 | </tr> |
| 1320 | 1320 | |
| 1321 | 1321 | <tr> |
@@ -1324,8 +1324,8 @@ discard block |
||
| 1324 | 1324 | </td> |
| 1325 | 1325 | <td><textarea name="geodir_menu_a_class_filter" |
| 1326 | 1326 | placeholder=''><?php if (isset($tc['geodir_menu_a_class_filter'])) {
|
| 1327 | - echo $tc['geodir_menu_a_class_filter']; |
|
| 1328 | - }?></textarea></td> |
|
| 1327 | + echo $tc['geodir_menu_a_class_filter']; |
|
| 1328 | + }?></textarea></td> |
|
| 1329 | 1329 | </tr> |
| 1330 | 1330 | |
| 1331 | 1331 | <tr> |
@@ -1334,8 +1334,8 @@ discard block |
||
| 1334 | 1334 | </td> |
| 1335 | 1335 | <td><textarea name="geodir_sub_menu_a_class_filter" |
| 1336 | 1336 | placeholder=''><?php if (isset($tc['geodir_sub_menu_a_class_filter'])) {
|
| 1337 | - echo $tc['geodir_sub_menu_a_class_filter']; |
|
| 1338 | - }?></textarea></td> |
|
| 1337 | + echo $tc['geodir_sub_menu_a_class_filter']; |
|
| 1338 | + }?></textarea></td> |
|
| 1339 | 1339 | </tr> |
| 1340 | 1340 | |
| 1341 | 1341 | |
@@ -1345,8 +1345,8 @@ discard block |
||
| 1345 | 1345 | </td> |
| 1346 | 1346 | <td><textarea name="geodir_location_switcher_menu_li_class_filter" |
| 1347 | 1347 | placeholder='menu-item menu-item-type-social menu-item-type-social gd-location-switcher'><?php if (isset($tc['geodir_location_switcher_menu_li_class_filter'])) {
|
| 1348 | - echo $tc['geodir_location_switcher_menu_li_class_filter']; |
|
| 1349 | - }?></textarea></td> |
|
| 1348 | + echo $tc['geodir_location_switcher_menu_li_class_filter']; |
|
| 1349 | + }?></textarea></td> |
|
| 1350 | 1350 | </tr> |
| 1351 | 1351 | |
| 1352 | 1352 | <tr> |
@@ -1355,8 +1355,8 @@ discard block |
||
| 1355 | 1355 | </td> |
| 1356 | 1356 | <td><textarea name="geodir_location_switcher_menu_a_class_filter" |
| 1357 | 1357 | placeholder=''><?php if (isset($tc['geodir_location_switcher_menu_a_class_filter'])) {
|
| 1358 | - echo $tc['geodir_location_switcher_menu_a_class_filter']; |
|
| 1359 | - }?></textarea></td> |
|
| 1358 | + echo $tc['geodir_location_switcher_menu_a_class_filter']; |
|
| 1359 | + }?></textarea></td> |
|
| 1360 | 1360 | </tr> |
| 1361 | 1361 | |
| 1362 | 1362 | <tr> |
@@ -1365,8 +1365,8 @@ discard block |
||
| 1365 | 1365 | </td> |
| 1366 | 1366 | <td><textarea name="geodir_location_switcher_menu_sub_ul_class_filter" |
| 1367 | 1367 | placeholder='sub-menu'><?php if (isset($tc['geodir_location_switcher_menu_sub_ul_class_filter'])) {
|
| 1368 | - echo $tc['geodir_location_switcher_menu_sub_ul_class_filter']; |
|
| 1369 | - }?></textarea></td> |
|
| 1368 | + echo $tc['geodir_location_switcher_menu_sub_ul_class_filter']; |
|
| 1369 | + }?></textarea></td> |
|
| 1370 | 1370 | </tr> |
| 1371 | 1371 | |
| 1372 | 1372 | <tr> |
@@ -1375,21 +1375,21 @@ discard block |
||
| 1375 | 1375 | </td> |
| 1376 | 1376 | <td><textarea name="geodir_location_switcher_menu_sub_li_class_filter" |
| 1377 | 1377 | placeholder='menu-item gd-location-switcher-menu-item'><?php if (isset($tc['geodir_location_switcher_menu_sub_li_class_filter'])) {
|
| 1378 | - echo $tc['geodir_location_switcher_menu_sub_li_class_filter']; |
|
| 1379 | - }?></textarea></td> |
|
| 1378 | + echo $tc['geodir_location_switcher_menu_sub_li_class_filter']; |
|
| 1379 | + }?></textarea></td> |
|
| 1380 | 1380 | </tr> |
| 1381 | 1381 | |
| 1382 | 1382 | |
| 1383 | 1383 | |
| 1384 | 1384 | <?php |
| 1385 | - /** |
|
| 1386 | - * Allows more filter setting to be added to theme compatibility settings page. |
|
| 1387 | - * |
|
| 1388 | - * Called after the last setting in "Other filters" section of theme compatibility settings. |
|
| 1389 | - * |
|
| 1390 | - * @since 1.4.0 |
|
| 1391 | - */ |
|
| 1392 | - do_action('gd_compat_other_filters');?>
|
|
| 1385 | + /** |
|
| 1386 | + * Allows more filter setting to be added to theme compatibility settings page. |
|
| 1387 | + * |
|
| 1388 | + * Called after the last setting in "Other filters" section of theme compatibility settings. |
|
| 1389 | + * |
|
| 1390 | + * @since 1.4.0 |
|
| 1391 | + */ |
|
| 1392 | + do_action('gd_compat_other_filters');?>
|
|
| 1393 | 1393 | |
| 1394 | 1394 | </tbody> |
| 1395 | 1395 | </table> |
@@ -1402,8 +1402,8 @@ discard block |
||
| 1402 | 1402 | <tr> |
| 1403 | 1403 | <td><textarea name="geodir_theme_compat_css" |
| 1404 | 1404 | placeholder=''><?php if (isset($tc['geodir_theme_compat_css'])) {
|
| 1405 | - echo $tc['geodir_theme_compat_css']; |
|
| 1406 | - }?></textarea></td> |
|
| 1405 | + echo $tc['geodir_theme_compat_css']; |
|
| 1406 | + }?></textarea></td> |
|
| 1407 | 1407 | </tr> |
| 1408 | 1408 | |
| 1409 | 1409 | |
@@ -1417,8 +1417,8 @@ discard block |
||
| 1417 | 1417 | <tr> |
| 1418 | 1418 | <td><textarea name="geodir_theme_compat_js" |
| 1419 | 1419 | placeholder=''><?php if (isset($tc['geodir_theme_compat_js'])) {
|
| 1420 | - echo $tc['geodir_theme_compat_js']; |
|
| 1421 | - }?></textarea></td> |
|
| 1420 | + echo $tc['geodir_theme_compat_js']; |
|
| 1421 | + }?></textarea></td> |
|
| 1422 | 1422 | </tr> |
| 1423 | 1423 | |
| 1424 | 1424 | |
@@ -1445,23 +1445,23 @@ discard block |
||
| 1445 | 1445 | */ |
| 1446 | 1446 | function geodir_custom_post_type_form() |
| 1447 | 1447 | {
|
| 1448 | - $listing_type = ($_REQUEST['listing_type'] != '') ? $_REQUEST['listing_type'] : 'gd_place'; |
|
| 1448 | + $listing_type = ($_REQUEST['listing_type'] != '') ? $_REQUEST['listing_type'] : 'gd_place'; |
|
| 1449 | 1449 | |
| 1450 | - $sub_tab = ($_REQUEST['subtab'] != '') ? $_REQUEST['subtab'] : ''; |
|
| 1450 | + $sub_tab = ($_REQUEST['subtab'] != '') ? $_REQUEST['subtab'] : ''; |
|
| 1451 | 1451 | |
| 1452 | 1452 | |
| 1453 | - ?> |
|
| 1453 | + ?> |
|
| 1454 | 1454 | |
| 1455 | 1455 | <div class="gd-content-heading"> |
| 1456 | 1456 | <?php |
| 1457 | - /** |
|
| 1458 | - * Filter custom fields panel heading. |
|
| 1459 | - * |
|
| 1460 | - * @since 1.0.0 |
|
| 1461 | - * @param string $sub_tab Sub tab name. |
|
| 1462 | - * @param string $listing_type Post type. |
|
| 1463 | - */ |
|
| 1464 | - ?> |
|
| 1457 | + /** |
|
| 1458 | + * Filter custom fields panel heading. |
|
| 1459 | + * |
|
| 1460 | + * @since 1.0.0 |
|
| 1461 | + * @param string $sub_tab Sub tab name. |
|
| 1462 | + * @param string $listing_type Post type. |
|
| 1463 | + */ |
|
| 1464 | + ?> |
|
| 1465 | 1465 | <h3><?php echo apply_filters('geodir_custom_fields_panel_head', '', $sub_tab, $listing_type);?></h3>
|
| 1466 | 1466 | </div> |
| 1467 | 1467 | <div id="container_general" class="clearfix"> |
@@ -1469,25 +1469,25 @@ discard block |
||
| 1469 | 1469 | |
| 1470 | 1470 | <div class="side-sortables" id="geodir-available-fields"> |
| 1471 | 1471 | <?php |
| 1472 | - /** |
|
| 1473 | - * Filter custom field available fields heading. |
|
| 1474 | - * |
|
| 1475 | - * @since 1.0.0 |
|
| 1476 | - * @param string $sub_tab Sub tab name. |
|
| 1477 | - * @param string $listing_type Post type. |
|
| 1478 | - */ |
|
| 1479 | - ?> |
|
| 1472 | + /** |
|
| 1473 | + * Filter custom field available fields heading. |
|
| 1474 | + * |
|
| 1475 | + * @since 1.0.0 |
|
| 1476 | + * @param string $sub_tab Sub tab name. |
|
| 1477 | + * @param string $listing_type Post type. |
|
| 1478 | + */ |
|
| 1479 | + ?> |
|
| 1480 | 1480 | <h3 class="hndle"><span><?php echo apply_filters('geodir_cf_panel_available_fields_head', '', $sub_tab, $listing_type);?>
|
| 1481 | 1481 | </span></h3> |
| 1482 | 1482 | <?php |
| 1483 | - /** |
|
| 1484 | - * Filter custom field available fields note text. |
|
| 1485 | - * |
|
| 1486 | - * @since 1.0.0 |
|
| 1487 | - * @param string $sub_tab Sub tab name. |
|
| 1488 | - * @param string $listing_type Post type. |
|
| 1489 | - */ |
|
| 1490 | - ?> |
|
| 1483 | + /** |
|
| 1484 | + * Filter custom field available fields note text. |
|
| 1485 | + * |
|
| 1486 | + * @since 1.0.0 |
|
| 1487 | + * @param string $sub_tab Sub tab name. |
|
| 1488 | + * @param string $listing_type Post type. |
|
| 1489 | + */ |
|
| 1490 | + ?> |
|
| 1491 | 1491 | <p><?php echo apply_filters('geodir_cf_panel_available_fields_note', '', $sub_tab, $listing_type);?></p>
|
| 1492 | 1492 | |
| 1493 | 1493 | <div class="inside"> |
@@ -1495,13 +1495,13 @@ discard block |
||
| 1495 | 1495 | <div id="gt-form-builder-tab" class="gt-tabs-panel"> |
| 1496 | 1496 | |
| 1497 | 1497 | <?php |
| 1498 | - /** |
|
| 1499 | - * Adds the available fields to the custom fields settings page per post type. |
|
| 1500 | - * |
|
| 1501 | - * @since 1.0.0 |
|
| 1502 | - * @param string $sub_tab The current settings tab name. |
|
| 1503 | - */ |
|
| 1504 | - do_action('geodir_manage_available_fields', $sub_tab); ?>
|
|
| 1498 | + /** |
|
| 1499 | + * Adds the available fields to the custom fields settings page per post type. |
|
| 1500 | + * |
|
| 1501 | + * @since 1.0.0 |
|
| 1502 | + * @param string $sub_tab The current settings tab name. |
|
| 1503 | + */ |
|
| 1504 | + do_action('geodir_manage_available_fields', $sub_tab); ?>
|
|
| 1505 | 1505 | |
| 1506 | 1506 | <div style="clear:both"></div> |
| 1507 | 1507 | </div> |
@@ -1514,25 +1514,25 @@ discard block |
||
| 1514 | 1514 | <div class="side-sortables" id="geodir-selected-fields"> |
| 1515 | 1515 | <h3 class="hndle"> |
| 1516 | 1516 | <?php |
| 1517 | - /** |
|
| 1518 | - * Filter custom field selected fields heading. |
|
| 1519 | - * |
|
| 1520 | - * @since 1.0.0 |
|
| 1521 | - * @param string $sub_tab Sub tab name. |
|
| 1522 | - * @param string $listing_type Post type. |
|
| 1523 | - */ |
|
| 1524 | - ?> |
|
| 1517 | + /** |
|
| 1518 | + * Filter custom field selected fields heading. |
|
| 1519 | + * |
|
| 1520 | + * @since 1.0.0 |
|
| 1521 | + * @param string $sub_tab Sub tab name. |
|
| 1522 | + * @param string $listing_type Post type. |
|
| 1523 | + */ |
|
| 1524 | + ?> |
|
| 1525 | 1525 | <span><?php echo apply_filters('geodir_cf_panel_selected_fields_head', '', $sub_tab, $listing_type);?></span>
|
| 1526 | 1526 | </h3> |
| 1527 | 1527 | <?php |
| 1528 | - /** |
|
| 1529 | - * Filter custom field selected fields note text. |
|
| 1530 | - * |
|
| 1531 | - * @since 1.0.0 |
|
| 1532 | - * @param string $sub_tab Sub tab name. |
|
| 1533 | - * @param string $listing_type Post type. |
|
| 1534 | - */ |
|
| 1535 | - ?> |
|
| 1528 | + /** |
|
| 1529 | + * Filter custom field selected fields note text. |
|
| 1530 | + * |
|
| 1531 | + * @since 1.0.0 |
|
| 1532 | + * @param string $sub_tab Sub tab name. |
|
| 1533 | + * @param string $listing_type Post type. |
|
| 1534 | + */ |
|
| 1535 | + ?> |
|
| 1536 | 1536 | <p><?php echo apply_filters('geodir_cf_panel_selected_fields_note', '', $sub_tab, $listing_type);?></p>
|
| 1537 | 1537 | |
| 1538 | 1538 | <div class="inside"> |
@@ -1540,13 +1540,13 @@ discard block |
||
| 1540 | 1540 | <div id="gt-form-builder-tab" class="gt-tabs-panel"> |
| 1541 | 1541 | <div class="field_row_main"> |
| 1542 | 1542 | <?php |
| 1543 | - /** |
|
| 1544 | - * Adds the selected fields and setting to the custom fields settings page per post type. |
|
| 1545 | - * |
|
| 1546 | - * @since 1.0.0 |
|
| 1547 | - * @param string $sub_tab The current settings tab name. |
|
| 1548 | - */ |
|
| 1549 | - do_action('geodir_manage_selected_fields', $sub_tab); ?>
|
|
| 1543 | + /** |
|
| 1544 | + * Adds the selected fields and setting to the custom fields settings page per post type. |
|
| 1545 | + * |
|
| 1546 | + * @since 1.0.0 |
|
| 1547 | + * @param string $sub_tab The current settings tab name. |
|
| 1548 | + */ |
|
| 1549 | + do_action('geodir_manage_selected_fields', $sub_tab); ?>
|
|
| 1550 | 1550 | </div> |
| 1551 | 1551 | <div style="clear:both"></div> |
| 1552 | 1552 | </div> |
@@ -1569,7 +1569,7 @@ discard block |
||
| 1569 | 1569 | */ |
| 1570 | 1570 | function geodir_diagnostic_tools_setting_page() |
| 1571 | 1571 | {
|
| 1572 | - ?> |
|
| 1572 | + ?> |
|
| 1573 | 1573 | <div class="inner_content_tab_main"> |
| 1574 | 1574 | <div class="gd-content-heading"> |
| 1575 | 1575 | |
@@ -1671,13 +1671,13 @@ discard block |
||
| 1671 | 1671 | </td> |
| 1672 | 1672 | </tr> |
| 1673 | 1673 | <?php |
| 1674 | - /** |
|
| 1675 | - * Allows you to add more setting to the GD>Tools settings page. |
|
| 1676 | - * |
|
| 1677 | - * Called after the last setting on the GD>Tools page. |
|
| 1678 | - * @since 1.0.0 |
|
| 1679 | - */ |
|
| 1680 | - do_action('geodir_diagnostic_tool');?>
|
|
| 1674 | + /** |
|
| 1675 | + * Allows you to add more setting to the GD>Tools settings page. |
|
| 1676 | + * |
|
| 1677 | + * Called after the last setting on the GD>Tools page. |
|
| 1678 | + * @since 1.0.0 |
|
| 1679 | + */ |
|
| 1680 | + do_action('geodir_diagnostic_tool');?>
|
|
| 1681 | 1681 | |
| 1682 | 1682 | </tbody> |
| 1683 | 1683 | </table> |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | * @param array $tabs The array of tabs to display. |
| 53 | 53 | */ |
| 54 | 54 | $tabs = apply_filters('geodir_settings_tabs_array', $tabs);
|
| 55 | - update_option('geodir_tabs', $tabs);// Important to show settings menu dropdown
|
|
| 55 | + update_option('geodir_tabs', $tabs); // Important to show settings menu dropdown
|
|
| 56 | 56 | |
| 57 | 57 | foreach ($tabs as $name => $args) : |
| 58 | 58 | $label = $args['label']; |
@@ -63,12 +63,12 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | $subtabs = $args['subtabs']; |
| 65 | 65 | |
| 66 | - $query_string = '&subtab=' . $subtabs[0]['subtab']; |
|
| 66 | + $query_string = '&subtab='.$subtabs[0]['subtab']; |
|
| 67 | 67 | |
| 68 | 68 | endif; |
| 69 | 69 | |
| 70 | 70 | |
| 71 | - $tab_link = admin_url('admin.php?page=geodirectory&tab=' . $name . $query_string);
|
|
| 71 | + $tab_link = admin_url('admin.php?page=geodirectory&tab='.$name.$query_string);
|
|
| 72 | 72 | |
| 73 | 73 | if (isset($args['url']) && $args['url'] != '') {
|
| 74 | 74 | $tab_link = $args['url']; |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | $tab_link = geodir_getlink($tab_link, $args['request']); |
| 79 | 79 | |
| 80 | 80 | if (isset($args['target']) && $args['target'] != '') {
|
| 81 | - $tab_target = " target='" . sanitize_text_field($args['target']) . "' "; |
|
| 81 | + $tab_target = " target='".sanitize_text_field($args['target'])."' "; |
|
| 82 | 82 | } else |
| 83 | 83 | $tab_target = ''; |
| 84 | 84 | |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | * @see 'geodir_after_settings_tabs' |
| 94 | 94 | */ |
| 95 | 95 | do_action('geodir_before_settings_tabs', $name);
|
| 96 | - echo '<li ' . $tab_active . ' ><a href="' . esc_url($tab_link) . '" ' . $tab_target . ' >' . $label . '</a></li>'; |
|
| 96 | + echo '<li '.$tab_active.' ><a href="'.esc_url($tab_link).'" '.$tab_target.' >'.$label.'</a></li>'; |
|
| 97 | 97 | /** |
| 98 | 98 | * Called after the individual settings tabs are output. |
| 99 | 99 | * |
@@ -137,11 +137,11 @@ discard block |
||
| 137 | 137 | $form_action = isset($sub['form_action']) ? $sub['form_action'] : ''; |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | - $sub_tabs_link = admin_url() . 'admin.php?page=geodirectory&tab=' . $current_tab . '&subtab=' . $sub['subtab']; |
|
| 140 | + $sub_tabs_link = admin_url().'admin.php?page=geodirectory&tab='.$current_tab.'&subtab='.$sub['subtab']; |
|
| 141 | 141 | if (isset($sub['request']) && is_array($sub['request']) && !empty($sub['request'])) {
|
| 142 | 142 | $sub_tabs_link = geodir_getlink($sub_tabs_link, $sub['request']); |
| 143 | 143 | } |
| 144 | - echo '<dd ' . $subtab_active . ' id="claim_listing"><a href="' . esc_url($sub_tabs_link) . '" >' . sanitize_text_field($sub['label']) . '</a></dd>'; |
|
| 144 | + echo '<dd '.$subtab_active.' id="claim_listing"><a href="'.esc_url($sub_tabs_link).'" >'.sanitize_text_field($sub['label']).'</a></dd>'; |
|
| 145 | 145 | } |
| 146 | 146 | ?> |
| 147 | 147 | </dl> |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | echo "inner_contet_tabs"; |
| 152 | 152 | } ?>"> |
| 153 | 153 | <form method="post" id="mainform" |
| 154 | - class="geodir_optionform <?php echo $current_tab . ' '; ?><?php if (isset($sub['subtab'])) {
|
|
| 154 | + class="geodir_optionform <?php echo $current_tab.' '; ?><?php if (isset($sub['subtab'])) {
|
|
| 155 | 155 | echo sanitize_text_field($sub['subtab']); |
| 156 | 156 | } ?>" action="<?php echo $form_action; ?>" enctype="multipart/form-data"> |
| 157 | 157 | <input type="hidden" class="active_tab" name="active_tab" |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | echo sanitize_text_field($_REQUEST['active_tab']); |
| 160 | 160 | } ?>"/> |
| 161 | 161 | <?php wp_nonce_field('geodir-settings', '_wpnonce', true, true); ?>
|
| 162 | - <?php wp_nonce_field('geodir-settings-' . $current_tab, '_wpnonce-' . $current_tab, true, true); ?>
|
|
| 162 | + <?php wp_nonce_field('geodir-settings-'.$current_tab, '_wpnonce-'.$current_tab, true, true); ?>
|
|
| 163 | 163 | <?php |
| 164 | 164 | /** |
| 165 | 165 | * Used to call the content of each GD settings tab page. |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | jQuery('#last_tab').val( jQuery(this).attr('href') );
|
| 190 | 190 | return false;*/ |
| 191 | 191 | }); |
| 192 | - <?php if (isset($_GET['subtab']) && $_GET['subtab']) echo 'jQuery(\'ul.subsubsub li a[href="#' . sanitize_text_field($_GET['subtab']) . '"]\').click();'; ?> |
|
| 192 | + <?php if (isset($_GET['subtab']) && $_GET['subtab']) echo 'jQuery(\'ul.subsubsub li a[href="#'.sanitize_text_field($_GET['subtab']).'"]\').click();'; ?> |
|
| 193 | 193 | // Countries |
| 194 | 194 | jQuery('select#geodirectory_allowed_countries').change(function () {
|
| 195 | 195 | if (jQuery(this).val() == "specific") {
|
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | jQuery('.geodirectory-nav-tab-wrapper a').click(function () {
|
| 223 | 223 | if (changed) {
|
| 224 | 224 | window.onbeforeunload = function () {
|
| 225 | - return '<?php echo __( 'The changes you made will be lost if you navigate away from this page.', 'geodirectory'); ?>'; |
|
| 225 | + return '<?php echo __('The changes you made will be lost if you navigate away from this page.', 'geodirectory'); ?>';
|
|
| 226 | 226 | } |
| 227 | 227 | } else {
|
| 228 | 228 | window.onbeforeunload = ''; |
@@ -285,14 +285,14 @@ discard block |
||
| 285 | 285 | |
| 286 | 286 | //echo $tab_name.'_array.php' ; |
| 287 | 287 | global $geodir_settings, $is_default, $mapzoom; |
| 288 | - if (file_exists(dirname(__FILE__) . '/option-pages/' . $tab_name . '_array.php')) {
|
|
| 288 | + if (file_exists(dirname(__FILE__).'/option-pages/'.$tab_name.'_array.php')) {
|
|
| 289 | 289 | /** |
| 290 | 290 | * Contains settings array for given tab. |
| 291 | 291 | * |
| 292 | 292 | * @since 1.0.0 |
| 293 | 293 | * @package GeoDirectory |
| 294 | 294 | */ |
| 295 | - include_once('option-pages/' . $tab_name . '_array.php');
|
|
| 295 | + include_once('option-pages/'.$tab_name.'_array.php');
|
|
| 296 | 296 | } |
| 297 | 297 | |
| 298 | 298 | $listing_type = isset($_REQUEST['listing_type']) ? $_REQUEST['listing_type'] : ''; |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | ?> |
| 328 | 328 | |
| 329 | 329 | <p class="submit"> |
| 330 | - <input <?php echo $hide_save_button;?> name="save" class="button-primary" type="submit" value="<?php _e('Save changes', 'geodirectory'); ?>" />
|
|
| 330 | + <input <?php echo $hide_save_button; ?> name="save" class="button-primary" type="submit" value="<?php _e('Save changes', 'geodirectory'); ?>" />
|
|
| 331 | 331 | <input type="hidden" name="subtab" id="last_tab" /> |
| 332 | 332 | </p> |
| 333 | 333 | |
@@ -396,7 +396,7 @@ discard block |
||
| 396 | 396 | |
| 397 | 397 | ?> |
| 398 | 398 | |
| 399 | - <h3><?php _e('Set Default Location', 'geodirectory');?></h3>
|
|
| 399 | + <h3><?php _e('Set Default Location', 'geodirectory'); ?></h3>
|
|
| 400 | 400 | |
| 401 | 401 | <input type="hidden" name="add_location" value="location"> |
| 402 | 402 | |
@@ -404,16 +404,16 @@ discard block |
||
| 404 | 404 | echo $location_result->location_id; |
| 405 | 405 | } ?>"> |
| 406 | 406 | |
| 407 | - <input type="hidden" name="address" id="<?php echo $prefix;?>address" value=""> |
|
| 407 | + <input type="hidden" name="address" id="<?php echo $prefix; ?>address" value=""> |
|
| 408 | 408 | |
| 409 | 409 | <table class="form-table default_location_form"> |
| 410 | 410 | <tbody> |
| 411 | 411 | <tr valign="top" class="single_select_page"> |
| 412 | - <th class="titledesc" scope="row"><?php _e('City', 'geodirectory');?></th>
|
|
| 412 | + <th class="titledesc" scope="row"><?php _e('City', 'geodirectory'); ?></th>
|
|
| 413 | 413 | <td class="forminp"> |
| 414 | 414 | <div class="gtd-formfeild required"> |
| 415 | 415 | <input class="require" type="text" size="80" style="width:440px" |
| 416 | - id="<?php echo $prefix;?>city" name="city" |
|
| 416 | + id="<?php echo $prefix; ?>city" name="city" |
|
| 417 | 417 | value="<?php if (isset($location_result->city)) {
|
| 418 | 418 | echo $location_result->city; |
| 419 | 419 | } ?>"/> |
@@ -425,11 +425,11 @@ discard block |
||
| 425 | 425 | </td> |
| 426 | 426 | </tr> |
| 427 | 427 | <tr valign="top" class="single_select_page"> |
| 428 | - <th class="titledesc" scope="row"><?php _e('Region', 'geodirectory');?></th>
|
|
| 428 | + <th class="titledesc" scope="row"><?php _e('Region', 'geodirectory'); ?></th>
|
|
| 429 | 429 | <td class="forminp"> |
| 430 | 430 | <div class="gtd-formfeild required"> |
| 431 | 431 | <input class="require" type="text" size="80" style="width:440px" |
| 432 | - id="<?php echo $prefix;?>region" name="region" |
|
| 432 | + id="<?php echo $prefix; ?>region" name="region" |
|
| 433 | 433 | value="<?php if (isset($location_result->region)) {
|
| 434 | 434 | echo $location_result->region; |
| 435 | 435 | } ?>"/> |
@@ -441,7 +441,7 @@ discard block |
||
| 441 | 441 | </td> |
| 442 | 442 | </tr> |
| 443 | 443 | <tr valign="top" class="single_select_page"> |
| 444 | - <th class="titledesc" scope="row"><?php _e('Country', 'geodirectory');?></th>
|
|
| 444 | + <th class="titledesc" scope="row"><?php _e('Country', 'geodirectory'); ?></th>
|
|
| 445 | 445 | <td class="forminp"> |
| 446 | 446 | <div class="gtd-formfeild required" style="padding-top:10px;"> |
| 447 | 447 | <?php |
@@ -450,7 +450,7 @@ discard block |
||
| 450 | 450 | ?> |
| 451 | 451 | <select id="<?php echo $prefix ?>country" class="chosen_select" |
| 452 | 452 | data-location_type="country" name="<?php echo $prefix ?>country" |
| 453 | - data-placeholder="<?php _e('Choose a country.', 'geodirectory');?>"
|
|
| 453 | + data-placeholder="<?php _e('Choose a country.', 'geodirectory'); ?>"
|
|
| 454 | 454 | data-addsearchtermonnorecord="1" data-ajaxchosen="0" data-autoredirect="0" |
| 455 | 455 | data-showeverywhere="0"> |
| 456 | 456 | <?php geodir_get_country_dl($country, $prefix); ?> |
@@ -467,7 +467,7 @@ discard block |
||
| 467 | 467 | </tr> |
| 468 | 468 | <tr valign="top" class="single_select_page"> |
| 469 | 469 | <th class="titledesc" |
| 470 | - scope="row"><?php _e('Set Location on Map', 'geodirectory');?></th>
|
|
| 470 | + scope="row"><?php _e('Set Location on Map', 'geodirectory'); ?></th>
|
|
| 471 | 471 | <td class="forminp"> |
| 472 | 472 | <?php |
| 473 | 473 | /** |
@@ -475,15 +475,15 @@ discard block |
||
| 475 | 475 | * |
| 476 | 476 | * @since 1.0.0 |
| 477 | 477 | */ |
| 478 | - include(geodir_plugin_path() . "/geodirectory-functions/map-functions/map_on_add_listing_page.php");?> |
|
| 478 | + include(geodir_plugin_path()."/geodirectory-functions/map-functions/map_on_add_listing_page.php"); ?> |
|
| 479 | 479 | </td> |
| 480 | 480 | </tr> |
| 481 | 481 | <tr valign="top" class="single_select_page"> |
| 482 | - <th class="titledesc" scope="row"><?php _e('City Latitude', 'geodirectory');?></th>
|
|
| 482 | + <th class="titledesc" scope="row"><?php _e('City Latitude', 'geodirectory'); ?></th>
|
|
| 483 | 483 | <td class="forminp"> |
| 484 | 484 | <div class="gtd-formfeild required" style="padding-top:10px;"> |
| 485 | 485 | <input type="text" class="require" size="80" style="width:440px" |
| 486 | - id="<?php echo $prefix;?>latitude" name="latitude" |
|
| 486 | + id="<?php echo $prefix; ?>latitude" name="latitude" |
|
| 487 | 487 | value="<?php if (isset($location_result->city_latitude)) {
|
| 488 | 488 | echo $location_result->city_latitude; |
| 489 | 489 | } ?>"/> |
@@ -496,11 +496,11 @@ discard block |
||
| 496 | 496 | </tr> |
| 497 | 497 | <tr valign="top" class="single_select_page"> |
| 498 | 498 | <th class="titledesc" |
| 499 | - scope="row"><?php _e('City Longitude', 'geodirectory');?></th>
|
|
| 499 | + scope="row"><?php _e('City Longitude', 'geodirectory'); ?></th>
|
|
| 500 | 500 | <td class="forminp"> |
| 501 | 501 | <div class="gtd-formfeild required" style="padding-top:10px;"> |
| 502 | 502 | <input type="text" class="require" size="80" style="width:440px" |
| 503 | - id="<?php echo $prefix;?>longitude" name="longitude" |
|
| 503 | + id="<?php echo $prefix; ?>longitude" name="longitude" |
|
| 504 | 504 | value="<?php if (isset($location_result->city_longitude)) {
|
| 505 | 505 | echo $location_result->city_longitude; |
| 506 | 506 | } ?>"/> |
@@ -535,7 +535,7 @@ discard block |
||
| 535 | 535 | </div> |
| 536 | 536 | </div> |
| 537 | 537 | <?php break; |
| 538 | - case $listing_type . '_fields_settings' : |
|
| 538 | + case $listing_type.'_fields_settings' : |
|
| 539 | 539 | |
| 540 | 540 | geodir_custom_post_type_form(); |
| 541 | 541 | |
@@ -687,7 +687,7 @@ discard block |
||
| 687 | 687 | } |
| 688 | 688 | |
| 689 | 689 | |
| 690 | - $theme_name = $theme_name . "_custom"; |
|
| 690 | + $theme_name = $theme_name."_custom"; |
|
| 691 | 691 | $theme_arr = get_option('gd_theme_compats');
|
| 692 | 692 | update_option('gd_theme_compat', $theme_name);
|
| 693 | 693 | /** |
@@ -776,7 +776,7 @@ discard block |
||
| 776 | 776 | <div class="gd-content-heading"> |
| 777 | 777 | |
| 778 | 778 | |
| 779 | - <h3><?php _e('Theme Compatability Settings', 'geodirectory');?></h3>
|
|
| 779 | + <h3><?php _e('Theme Compatability Settings', 'geodirectory'); ?></h3>
|
|
| 780 | 780 | <style> |
| 781 | 781 | .gd-theme-compat-table {
|
| 782 | 782 | width: 100%; |
@@ -807,11 +807,11 @@ discard block |
||
| 807 | 807 | </div> |
| 808 | 808 | <?php }?> |
| 809 | 809 | |
| 810 | - <h4><?php _e('Select Theme Compatibility Pack', 'geodirectory');?></h4>
|
|
| 810 | + <h4><?php _e('Select Theme Compatibility Pack', 'geodirectory'); ?></h4>
|
|
| 811 | 811 | |
| 812 | 812 | <select name="gd_theme_compat" id="gd_theme_compat"> |
| 813 | - <option value=""><?php _e('Select Theme', 'geodirectory');?></option>
|
|
| 814 | - <option value="custom"><?php _e('Custom', 'geodirectory');?></option>
|
|
| 813 | + <option value=""><?php _e('Select Theme', 'geodirectory'); ?></option>
|
|
| 814 | + <option value="custom"><?php _e('Custom', 'geodirectory'); ?></option>
|
|
| 815 | 815 | <?php |
| 816 | 816 | $theme_arr = get_option('gd_theme_compats');
|
| 817 | 817 | $theme_active = get_option('gd_theme_compat');
|
@@ -830,20 +830,20 @@ discard block |
||
| 830 | 830 | ?> |
| 831 | 831 | </select> |
| 832 | 832 | <button onclick="gd_comp_export();" type="button" |
| 833 | - class="button-primary"><?php _e('Export', 'geodirectory');?></button>
|
|
| 833 | + class="button-primary"><?php _e('Export', 'geodirectory'); ?></button>
|
|
| 834 | 834 | <button onclick="gd_comp_import();" type="button" |
| 835 | - class="button-primary"><?php _e('Import', 'geodirectory');?></button>
|
|
| 835 | + class="button-primary"><?php _e('Import', 'geodirectory'); ?></button>
|
|
| 836 | 836 | |
| 837 | 837 | <div class="gd-comp-import-export"> |
| 838 | 838 | <textarea id="gd-import-export-theme-comp" |
| 839 | - placeholder="<?php _e('Paste the JSON code here and then click import again', 'geodirectory');?>"></textarea>
|
|
| 839 | + placeholder="<?php _e('Paste the JSON code here and then click import again', 'geodirectory'); ?>"></textarea>
|
|
| 840 | 840 | </div> |
| 841 | 841 | <script> |
| 842 | 842 | |
| 843 | 843 | function gd_comp_export() {
|
| 844 | 844 | theme = jQuery('#gd_theme_compat').val();
|
| 845 | 845 | if (theme == '' || theme == 'custom') {
|
| 846 | - alert("<?php _e('Please select a theme to export','geodirectory');?>");
|
|
| 846 | + alert("<?php _e('Please select a theme to export', 'geodirectory'); ?>");
|
|
| 847 | 847 | return false; |
| 848 | 848 | } |
| 849 | 849 | jQuery('.gd-comp-import-export').show();
|
@@ -877,9 +877,9 @@ discard block |
||
| 877 | 877 | |
| 878 | 878 | jQuery.post(ajaxurl, data, function (response) {
|
| 879 | 879 | if (response == '0') {
|
| 880 | - alert("<?php _e('Something went wrong','geodirectory');?>");
|
|
| 880 | + alert("<?php _e('Something went wrong', 'geodirectory'); ?>");
|
|
| 881 | 881 | } else {
|
| 882 | - alert("<?php _e('Theme Compatibility Imported','geodirectory');?>");
|
|
| 882 | + alert("<?php _e('Theme Compatibility Imported', 'geodirectory'); ?>");
|
|
| 883 | 883 | jQuery('#gd-import-export-theme-comp').val('');
|
| 884 | 884 | jQuery('.gd-comp-import-export').hide();
|
| 885 | 885 | jQuery('#gd_theme_compat').append(new Option(response, response));
|
@@ -920,14 +920,14 @@ discard block |
||
| 920 | 920 | |
| 921 | 921 | </script> |
| 922 | 922 | |
| 923 | - <h4><?php _e('Main Wrapper Actions', 'geodirectory');?></h4>
|
|
| 923 | + <h4><?php _e('Main Wrapper Actions', 'geodirectory'); ?></h4>
|
|
| 924 | 924 | |
| 925 | 925 | <table class="form-table gd-theme-compat-table"> |
| 926 | 926 | <tbody> |
| 927 | 927 | <tr> |
| 928 | - <td><strong><?php _e('Hook', 'geodirectory');?></strong></td>
|
|
| 929 | - <td><strong><?php _e('ID', 'geodirectory');?></strong></td>
|
|
| 930 | - <td><strong><?php _e('Class', 'geodirectory');?></strong></td>
|
|
| 928 | + <td><strong><?php _e('Hook', 'geodirectory'); ?></strong></td>
|
|
| 929 | + <td><strong><?php _e('ID', 'geodirectory'); ?></strong></td>
|
|
| 930 | + <td><strong><?php _e('Class', 'geodirectory'); ?></strong></td>
|
|
| 931 | 931 | </tr> |
| 932 | 932 | |
| 933 | 933 | |
@@ -945,7 +945,7 @@ discard block |
||
| 945 | 945 | |
| 946 | 946 | <tr class="gd-theme-comp-out"> |
| 947 | 947 | <td colspan="3"> |
| 948 | - <span><?php _e('Output:', 'geodirectory');?></span>
|
|
| 948 | + <span><?php _e('Output:', 'geodirectory'); ?></span>
|
|
| 949 | 949 | <textarea name="geodir_wrapper_open_replace" |
| 950 | 950 | placeholder='<div id="[id]" class="[class]">'><?php if (isset($tc['geodir_wrapper_open_replace'])) {
|
| 951 | 951 | echo $tc['geodir_wrapper_open_replace']; |
@@ -959,14 +959,14 @@ discard block |
||
| 959 | 959 | <small>geodir_wrapper_close</small> |
| 960 | 960 | </td> |
| 961 | 961 | <td><input disabled="disabled" type="text" name="geodir_wrapper_open_id" |
| 962 | - placeholder="<?php _e('Not used', 'geodirectory');?>"/></td>
|
|
| 962 | + placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td>
|
|
| 963 | 963 | <td><input disabled="disabled" type="text" name="geodir_wrapper_open_class" |
| 964 | - placeholder="<?php _e('Not used', 'geodirectory');?>"/></td>
|
|
| 964 | + placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td>
|
|
| 965 | 965 | </tr> |
| 966 | 966 | |
| 967 | 967 | <tr class="gd-theme-comp-out"> |
| 968 | 968 | <td colspan="3"> |
| 969 | - <span><?php _e('Output:', 'geodirectory');?></span>
|
|
| 969 | + <span><?php _e('Output:', 'geodirectory'); ?></span>
|
|
| 970 | 970 | <textarea name="geodir_wrapper_close_replace" |
| 971 | 971 | placeholder='</div><!-- wrapper ends here-->'><?php if (isset($tc['geodir_wrapper_close_replace'])) {
|
| 972 | 972 | echo $tc['geodir_wrapper_close_replace']; |
@@ -990,7 +990,7 @@ discard block |
||
| 990 | 990 | |
| 991 | 991 | <tr class="gd-theme-comp-out"> |
| 992 | 992 | <td colspan="3"> |
| 993 | - <span><?php _e('Output:', 'geodirectory');?></span>
|
|
| 993 | + <span><?php _e('Output:', 'geodirectory'); ?></span>
|
|
| 994 | 994 | <textarea name="geodir_wrapper_content_open_replace" |
| 995 | 995 | placeholder='<div id="[id]" class="[class]" role="main" [width_css]>'><?php if (isset($tc['geodir_wrapper_content_open_replace'])) {
|
| 996 | 996 | echo $tc['geodir_wrapper_content_open_replace']; |
@@ -1004,14 +1004,14 @@ discard block |
||
| 1004 | 1004 | <small>geodir_wrapper_content_close</small> |
| 1005 | 1005 | </td> |
| 1006 | 1006 | <td><input disabled="disabled" type="text" name="geodir_wrapper_content_close_id" |
| 1007 | - placeholder="<?php _e('Not used', 'geodirectory');?>"/></td>
|
|
| 1007 | + placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td>
|
|
| 1008 | 1008 | <td><input disabled="disabled" type="text" name="geodir_wrapper_content_close_class" |
| 1009 | - placeholder="<?php _e('Not used', 'geodirectory');?>"/></td>
|
|
| 1009 | + placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td>
|
|
| 1010 | 1010 | </tr> |
| 1011 | 1011 | |
| 1012 | 1012 | <tr class="gd-theme-comp-out"> |
| 1013 | 1013 | <td colspan="3"> |
| 1014 | - <span><?php _e('Output:', 'geodirectory');?></span>
|
|
| 1014 | + <span><?php _e('Output:', 'geodirectory'); ?></span>
|
|
| 1015 | 1015 | <textarea name="geodir_wrapper_content_close_replace" |
| 1016 | 1016 | placeholder='</div><!-- content ends here-->'><?php if (isset($tc['geodir_wrapper_content_close_replace'])) {
|
| 1017 | 1017 | echo $tc['geodir_wrapper_content_close_replace']; |
@@ -1033,7 +1033,7 @@ discard block |
||
| 1033 | 1033 | |
| 1034 | 1034 | <tr class="gd-theme-comp-out"> |
| 1035 | 1035 | <td colspan="3"> |
| 1036 | - <span><?php _e('Output:', 'geodirectory');?></span>
|
|
| 1036 | + <span><?php _e('Output:', 'geodirectory'); ?></span>
|
|
| 1037 | 1037 | <textarea name="geodir_article_open_replace" |
| 1038 | 1038 | placeholder='<article id="[id]" class="[class]" itemscope itemtype="[itemtype]">'><?php if (isset($tc['geodir_article_open_replace'])) {
|
| 1039 | 1039 | echo $tc['geodir_article_open_replace']; |
@@ -1046,14 +1046,14 @@ discard block |
||
| 1046 | 1046 | <small>geodir_article_close</small> |
| 1047 | 1047 | </td> |
| 1048 | 1048 | <td><input disabled="disabled" type="text" name="geodir_article_close_id" |
| 1049 | - placeholder="<?php _e('Not used', 'geodirectory');?>"/></td>
|
|
| 1049 | + placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td>
|
|
| 1050 | 1050 | <td><input disabled="disabled" type="text" name="geodir_article_close_class" |
| 1051 | - placeholder="<?php _e('Not used', 'geodirectory');?>"/></td>
|
|
| 1051 | + placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td>
|
|
| 1052 | 1052 | </tr> |
| 1053 | 1053 | |
| 1054 | 1054 | <tr class="gd-theme-comp-out"> |
| 1055 | 1055 | <td colspan="3"> |
| 1056 | - <span><?php _e('Output:', 'geodirectory');?></span>
|
|
| 1056 | + <span><?php _e('Output:', 'geodirectory'); ?></span>
|
|
| 1057 | 1057 | <textarea name="geodir_article_close_replace" |
| 1058 | 1058 | placeholder='</article><!-- article ends here-->'><?php if (isset($tc['geodir_article_close_replace'])) {
|
| 1059 | 1059 | echo $tc['geodir_article_close_replace']; |
@@ -1076,7 +1076,7 @@ discard block |
||
| 1076 | 1076 | |
| 1077 | 1077 | <tr class="gd-theme-comp-out"> |
| 1078 | 1078 | <td colspan="3"> |
| 1079 | - <span><?php _e('Output:', 'geodirectory');?></span>
|
|
| 1079 | + <span><?php _e('Output:', 'geodirectory'); ?></span>
|
|
| 1080 | 1080 | <textarea name="geodir_sidebar_right_open_replace" |
| 1081 | 1081 | placeholder='<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>'><?php if (isset($tc['geodir_sidebar_right_open_replace'])) {
|
| 1082 | 1082 | echo $tc['geodir_sidebar_right_open_replace']; |
@@ -1089,14 +1089,14 @@ discard block |
||
| 1089 | 1089 | <small>geodir_sidebar_right_close</small> |
| 1090 | 1090 | </td> |
| 1091 | 1091 | <td><input disabled="disabled" type="text" name="geodir_sidebar_right_close_id" |
| 1092 | - placeholder="<?php _e('Not used', 'geodirectory');?>"/></td>
|
|
| 1092 | + placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td>
|
|
| 1093 | 1093 | <td><input disabled="disabled" type="text" name="geodir_sidebar_right_close_class" |
| 1094 | - placeholder="<?php _e('Not used', 'geodirectory');?>"/></td>
|
|
| 1094 | + placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td>
|
|
| 1095 | 1095 | </tr> |
| 1096 | 1096 | |
| 1097 | 1097 | <tr class="gd-theme-comp-out"> |
| 1098 | 1098 | <td colspan="3"> |
| 1099 | - <span><?php _e('Output:', 'geodirectory');?></span>
|
|
| 1099 | + <span><?php _e('Output:', 'geodirectory'); ?></span>
|
|
| 1100 | 1100 | <textarea name="geodir_sidebar_right_close_replace" |
| 1101 | 1101 | placeholder='</aside><!-- sidebar ends here-->'><?php if (isset($tc['geodir_sidebar_right_close_replace'])) {
|
| 1102 | 1102 | echo $tc['geodir_sidebar_right_close_replace']; |
@@ -1120,7 +1120,7 @@ discard block |
||
| 1120 | 1120 | |
| 1121 | 1121 | <tr class="gd-theme-comp-out"> |
| 1122 | 1122 | <td colspan="3"> |
| 1123 | - <span><?php _e('Output:', 'geodirectory');?></span>
|
|
| 1123 | + <span><?php _e('Output:', 'geodirectory'); ?></span>
|
|
| 1124 | 1124 | <textarea name="geodir_sidebar_left_open_replace" |
| 1125 | 1125 | placeholder='<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>'><?php if (isset($tc['geodir_sidebar_left_open_replace'])) {
|
| 1126 | 1126 | echo $tc['geodir_sidebar_left_open_replace']; |
@@ -1133,14 +1133,14 @@ discard block |
||
| 1133 | 1133 | <small>geodir_sidebar_left_close</small> |
| 1134 | 1134 | </td> |
| 1135 | 1135 | <td><input disabled="disabled" type="text" name="geodir_sidebar_left_close_id" |
| 1136 | - placeholder="<?php _e('Not used', 'geodirectory');?>"/></td>
|
|
| 1136 | + placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td>
|
|
| 1137 | 1137 | <td><input disabled="disabled" type="text" name="geodir_sidebar_left_close_class" |
| 1138 | - placeholder="<?php _e('Not used', 'geodirectory');?>"/></td>
|
|
| 1138 | + placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td>
|
|
| 1139 | 1139 | </tr> |
| 1140 | 1140 | |
| 1141 | 1141 | <tr class="gd-theme-comp-out"> |
| 1142 | 1142 | <td colspan="3"> |
| 1143 | - <span><?php _e('Output:', 'geodirectory');?></span>
|
|
| 1143 | + <span><?php _e('Output:', 'geodirectory'); ?></span>
|
|
| 1144 | 1144 | <textarea name="geodir_sidebar_left_close_replace" |
| 1145 | 1145 | placeholder='</aside><!-- sidebar ends here-->'><?php if (isset($tc['geodir_sidebar_left_close_replace'])) {
|
| 1146 | 1146 | echo $tc['geodir_sidebar_left_close_replace']; |
@@ -1162,7 +1162,7 @@ discard block |
||
| 1162 | 1162 | |
| 1163 | 1163 | <tr class="gd-theme-comp-out"> |
| 1164 | 1164 | <td colspan="3"> |
| 1165 | - <span><?php _e('Output:', 'geodirectory');?></span>
|
|
| 1165 | + <span><?php _e('Output:', 'geodirectory'); ?></span>
|
|
| 1166 | 1166 | <textarea name="geodir_main_content_open_replace" |
| 1167 | 1167 | placeholder='<main id="[id]" class="[class]" role="main">'><?php if (isset($tc['geodir_main_content_open_replace'])) {
|
| 1168 | 1168 | echo $tc['geodir_main_content_open_replace']; |
@@ -1175,14 +1175,14 @@ discard block |
||
| 1175 | 1175 | <small>geodir_main_content_close</small> |
| 1176 | 1176 | </td> |
| 1177 | 1177 | <td><input disabled="disabled" type="text" name="geodir_main_content_close_id" |
| 1178 | - placeholder="<?php _e('Not used', 'geodirectory');?>"/></td>
|
|
| 1178 | + placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td>
|
|
| 1179 | 1179 | <td><input disabled="disabled" type="text" name="geodir_main_content_close_class" |
| 1180 | - placeholder="<?php _e('Not used', 'geodirectory');?>"/></td>
|
|
| 1180 | + placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td>
|
|
| 1181 | 1181 | </tr> |
| 1182 | 1182 | |
| 1183 | 1183 | <tr class="gd-theme-comp-out"> |
| 1184 | 1184 | <td colspan="3"> |
| 1185 | - <span><?php _e('Output:', 'geodirectory');?></span>
|
|
| 1185 | + <span><?php _e('Output:', 'geodirectory'); ?></span>
|
|
| 1186 | 1186 | <textarea name="geodir_main_content_close_replace" |
| 1187 | 1187 | placeholder='</main><!-- main ends here-->'><?php if (isset($tc['geodir_main_content_close_replace'])) {
|
| 1188 | 1188 | echo $tc['geodir_main_content_close_replace']; |
@@ -1194,13 +1194,13 @@ discard block |
||
| 1194 | 1194 | </tbody> |
| 1195 | 1195 | </table> |
| 1196 | 1196 | |
| 1197 | - <h4><?php _e('Other Actions', 'geodirectory');?></h4>
|
|
| 1197 | + <h4><?php _e('Other Actions', 'geodirectory'); ?></h4>
|
|
| 1198 | 1198 | |
| 1199 | 1199 | <table class="form-table gd-theme-compat-table"> |
| 1200 | 1200 | <tbody> |
| 1201 | 1201 | <tr> |
| 1202 | - <td><strong><?php _e('Hook', 'geodirectory');?></strong></td>
|
|
| 1203 | - <td><strong><?php _e('Content', 'geodirectory');?></strong></td>
|
|
| 1202 | + <td><strong><?php _e('Hook', 'geodirectory'); ?></strong></td>
|
|
| 1203 | + <td><strong><?php _e('Content', 'geodirectory'); ?></strong></td>
|
|
| 1204 | 1204 | </tr> |
| 1205 | 1205 | |
| 1206 | 1206 | |
@@ -1229,13 +1229,13 @@ discard block |
||
| 1229 | 1229 | </table> |
| 1230 | 1230 | |
| 1231 | 1231 | |
| 1232 | - <h4><?php _e('Other Filters', 'geodirectory');?></h4>
|
|
| 1232 | + <h4><?php _e('Other Filters', 'geodirectory'); ?></h4>
|
|
| 1233 | 1233 | |
| 1234 | 1234 | <table class="form-table gd-theme-compat-table"> |
| 1235 | 1235 | <tbody> |
| 1236 | 1236 | <tr> |
| 1237 | - <td><strong><?php _e('Filter', 'geodirectory');?></strong></td>
|
|
| 1238 | - <td><strong><?php _e('Content', 'geodirectory');?></strong></td>
|
|
| 1237 | + <td><strong><?php _e('Filter', 'geodirectory'); ?></strong></td>
|
|
| 1238 | + <td><strong><?php _e('Content', 'geodirectory'); ?></strong></td>
|
|
| 1239 | 1239 | </tr> |
| 1240 | 1240 | |
| 1241 | 1241 | <tr> |
@@ -1389,13 +1389,13 @@ discard block |
||
| 1389 | 1389 | * |
| 1390 | 1390 | * @since 1.4.0 |
| 1391 | 1391 | */ |
| 1392 | - do_action('gd_compat_other_filters');?>
|
|
| 1392 | + do_action('gd_compat_other_filters'); ?>
|
|
| 1393 | 1393 | |
| 1394 | 1394 | </tbody> |
| 1395 | 1395 | </table> |
| 1396 | 1396 | |
| 1397 | 1397 | |
| 1398 | - <h4><?php _e('Required CSS', 'geodirectory');?></h4>
|
|
| 1398 | + <h4><?php _e('Required CSS', 'geodirectory'); ?></h4>
|
|
| 1399 | 1399 | |
| 1400 | 1400 | <table class="form-table gd-theme-compat-table"> |
| 1401 | 1401 | <tbody> |
@@ -1410,7 +1410,7 @@ discard block |
||
| 1410 | 1410 | </tbody> |
| 1411 | 1411 | </table> |
| 1412 | 1412 | |
| 1413 | - <h4><?php _e('Required JS', 'geodirectory');?></h4>
|
|
| 1413 | + <h4><?php _e('Required JS', 'geodirectory'); ?></h4>
|
|
| 1414 | 1414 | |
| 1415 | 1415 | <table class="form-table gd-theme-compat-table"> |
| 1416 | 1416 | <tbody> |
@@ -1428,7 +1428,7 @@ discard block |
||
| 1428 | 1428 | |
| 1429 | 1429 | <p class="submit"> |
| 1430 | 1430 | <input name="save" class="button-primary" type="submit" |
| 1431 | - value="<?php _e('Save changes', 'geodirectory');?>">
|
|
| 1431 | + value="<?php _e('Save changes', 'geodirectory'); ?>">
|
|
| 1432 | 1432 | </p> |
| 1433 | 1433 | |
| 1434 | 1434 | </div> |
@@ -1462,7 +1462,7 @@ discard block |
||
| 1462 | 1462 | * @param string $listing_type Post type. |
| 1463 | 1463 | */ |
| 1464 | 1464 | ?> |
| 1465 | - <h3><?php echo apply_filters('geodir_custom_fields_panel_head', '', $sub_tab, $listing_type);?></h3>
|
|
| 1465 | + <h3><?php echo apply_filters('geodir_custom_fields_panel_head', '', $sub_tab, $listing_type); ?></h3>
|
|
| 1466 | 1466 | </div> |
| 1467 | 1467 | <div id="container_general" class="clearfix"> |
| 1468 | 1468 | <div class="general-form-builder-frame"> |
@@ -1477,7 +1477,7 @@ discard block |
||
| 1477 | 1477 | * @param string $listing_type Post type. |
| 1478 | 1478 | */ |
| 1479 | 1479 | ?> |
| 1480 | - <h3 class="hndle"><span><?php echo apply_filters('geodir_cf_panel_available_fields_head', '', $sub_tab, $listing_type);?>
|
|
| 1480 | + <h3 class="hndle"><span><?php echo apply_filters('geodir_cf_panel_available_fields_head', '', $sub_tab, $listing_type); ?>
|
|
| 1481 | 1481 | </span></h3> |
| 1482 | 1482 | <?php |
| 1483 | 1483 | /** |
@@ -1488,7 +1488,7 @@ discard block |
||
| 1488 | 1488 | * @param string $listing_type Post type. |
| 1489 | 1489 | */ |
| 1490 | 1490 | ?> |
| 1491 | - <p><?php echo apply_filters('geodir_cf_panel_available_fields_note', '', $sub_tab, $listing_type);?></p>
|
|
| 1491 | + <p><?php echo apply_filters('geodir_cf_panel_available_fields_note', '', $sub_tab, $listing_type); ?></p>
|
|
| 1492 | 1492 | |
| 1493 | 1493 | <div class="inside"> |
| 1494 | 1494 | |
@@ -1522,7 +1522,7 @@ discard block |
||
| 1522 | 1522 | * @param string $listing_type Post type. |
| 1523 | 1523 | */ |
| 1524 | 1524 | ?> |
| 1525 | - <span><?php echo apply_filters('geodir_cf_panel_selected_fields_head', '', $sub_tab, $listing_type);?></span>
|
|
| 1525 | + <span><?php echo apply_filters('geodir_cf_panel_selected_fields_head', '', $sub_tab, $listing_type); ?></span>
|
|
| 1526 | 1526 | </h3> |
| 1527 | 1527 | <?php |
| 1528 | 1528 | /** |
@@ -1533,7 +1533,7 @@ discard block |
||
| 1533 | 1533 | * @param string $listing_type Post type. |
| 1534 | 1534 | */ |
| 1535 | 1535 | ?> |
| 1536 | - <p><?php echo apply_filters('geodir_cf_panel_selected_fields_note', '', $sub_tab, $listing_type);?></p>
|
|
| 1536 | + <p><?php echo apply_filters('geodir_cf_panel_selected_fields_note', '', $sub_tab, $listing_type); ?></p>
|
|
| 1537 | 1537 | |
| 1538 | 1538 | <div class="inside"> |
| 1539 | 1539 | |
@@ -1574,7 +1574,7 @@ discard block |
||
| 1574 | 1574 | <div class="gd-content-heading"> |
| 1575 | 1575 | |
| 1576 | 1576 | |
| 1577 | - <h3><?php _e('GD Diagnostic Tools', 'geodirectory');?></h3>
|
|
| 1577 | + <h3><?php _e('GD Diagnostic Tools', 'geodirectory'); ?></h3>
|
|
| 1578 | 1578 | <style> |
| 1579 | 1579 | .gd-tools-table {
|
| 1580 | 1580 | width: 100%; |
@@ -1593,81 +1593,81 @@ discard block |
||
| 1593 | 1593 | <table class="form-table gd-tools-table"> |
| 1594 | 1594 | <tbody> |
| 1595 | 1595 | <tr> |
| 1596 | - <td><strong><?php _e('Tool', 'geodirectory');?></strong></td>
|
|
| 1597 | - <td><strong><?php _e('Description', 'geodirectory');?></strong></td>
|
|
| 1598 | - <td><strong><?php _e('Action', 'geodirectory');?></strong></td>
|
|
| 1596 | + <td><strong><?php _e('Tool', 'geodirectory'); ?></strong></td>
|
|
| 1597 | + <td><strong><?php _e('Description', 'geodirectory'); ?></strong></td>
|
|
| 1598 | + <td><strong><?php _e('Action', 'geodirectory'); ?></strong></td>
|
|
| 1599 | 1599 | </tr> |
| 1600 | 1600 | |
| 1601 | 1601 | |
| 1602 | 1602 | <tr> |
| 1603 | - <td><?php _e('GD pages check', 'geodirectory');?></td>
|
|
| 1603 | + <td><?php _e('GD pages check', 'geodirectory'); ?></td>
|
|
| 1604 | 1604 | <td> |
| 1605 | - <small><?php _e('Checks if the GD pages are installed correctly or not.', 'geodirectory');?></small>
|
|
| 1605 | + <small><?php _e('Checks if the GD pages are installed correctly or not.', 'geodirectory'); ?></small>
|
|
| 1606 | 1606 | </td> |
| 1607 | 1607 | <td> |
| 1608 | - <input type="button" value="<?php _e('Run', 'geodirectory');?>"
|
|
| 1608 | + <input type="button" value="<?php _e('Run', 'geodirectory'); ?>"
|
|
| 1609 | 1609 | class="button-primary geodir_diagnosis_button" data-diagnose="default_pages"/> |
| 1610 | 1610 | </td> |
| 1611 | 1611 | </tr> |
| 1612 | 1612 | |
| 1613 | 1613 | |
| 1614 | 1614 | <tr> |
| 1615 | - <td><?php _e('Multisite DB conversion check', 'geodirectory');?></td>
|
|
| 1615 | + <td><?php _e('Multisite DB conversion check', 'geodirectory'); ?></td>
|
|
| 1616 | 1616 | <td> |
| 1617 | - <small><?php _e('Checks if the GD database tables have been converted to use multisite correctly.', 'geodirectory');?></small>
|
|
| 1617 | + <small><?php _e('Checks if the GD database tables have been converted to use multisite correctly.', 'geodirectory'); ?></small>
|
|
| 1618 | 1618 | </td> |
| 1619 | - <td><input type="button" value="<?php _e('Run', 'geodirectory');?>"
|
|
| 1619 | + <td><input type="button" value="<?php _e('Run', 'geodirectory'); ?>"
|
|
| 1620 | 1620 | class="button-primary geodir_diagnosis_button" data-diagnose="multisite_conversion"/> |
| 1621 | 1621 | </td> |
| 1622 | 1622 | </tr> |
| 1623 | 1623 | |
| 1624 | 1624 | <tr> |
| 1625 | - <td><?php _e('Ratings check', 'geodirectory');?></td>
|
|
| 1625 | + <td><?php _e('Ratings check', 'geodirectory'); ?></td>
|
|
| 1626 | 1626 | <td> |
| 1627 | - <small><?php _e('Checks ratings for correct location and content settings', 'geodirectory');?></small>
|
|
| 1627 | + <small><?php _e('Checks ratings for correct location and content settings', 'geodirectory'); ?></small>
|
|
| 1628 | 1628 | </td> |
| 1629 | - <td><input type="button" value="<?php _e('Run', 'geodirectory');?>"
|
|
| 1629 | + <td><input type="button" value="<?php _e('Run', 'geodirectory'); ?>"
|
|
| 1630 | 1630 | class="button-primary geodir_diagnosis_button" data-diagnose="ratings"/> |
| 1631 | 1631 | </td> |
| 1632 | 1632 | </tr> |
| 1633 | 1633 | |
| 1634 | 1634 | <tr> |
| 1635 | - <td><?php _e('Sync GD tags', 'geodirectory');?></td>
|
|
| 1635 | + <td><?php _e('Sync GD tags', 'geodirectory'); ?></td>
|
|
| 1636 | 1636 | <td> |
| 1637 | - <small><?php _e('This tool can be used when tags are showing in the backend but missing from the front end.', 'geodirectory');?></small>
|
|
| 1637 | + <small><?php _e('This tool can be used when tags are showing in the backend but missing from the front end.', 'geodirectory'); ?></small>
|
|
| 1638 | 1638 | </td> |
| 1639 | - <td><input type="button" value="<?php _e('Run', 'geodirectory');?>"
|
|
| 1639 | + <td><input type="button" value="<?php _e('Run', 'geodirectory'); ?>"
|
|
| 1640 | 1640 | class="button-primary geodir_diagnosis_button" data-diagnose="tags_sync"/> |
| 1641 | 1641 | </td> |
| 1642 | 1642 | </tr> |
| 1643 | 1643 | |
| 1644 | 1644 | <tr> |
| 1645 | - <td><?php _e('Sync GD Categories', 'geodirectory');?></td>
|
|
| 1645 | + <td><?php _e('Sync GD Categories', 'geodirectory'); ?></td>
|
|
| 1646 | 1646 | <td> |
| 1647 | - <small><?php _e('This tool can be used when categories are missing from the details table but showing in other places in the backend (only checks posts with missing category info in details table)', 'geodirectory');?></small>
|
|
| 1647 | + <small><?php _e('This tool can be used when categories are missing from the details table but showing in other places in the backend (only checks posts with missing category info in details table)', 'geodirectory'); ?></small>
|
|
| 1648 | 1648 | </td> |
| 1649 | - <td><input type="button" value="<?php _e('Run', 'geodirectory');?>"
|
|
| 1649 | + <td><input type="button" value="<?php _e('Run', 'geodirectory'); ?>"
|
|
| 1650 | 1650 | class="button-primary geodir_diagnosis_button" data-diagnose="cats_sync"/> |
| 1651 | 1651 | </td> |
| 1652 | 1652 | </tr> |
| 1653 | 1653 | |
| 1654 | 1654 | |
| 1655 | 1655 | <tr> |
| 1656 | - <td><?php _e('Clear all GD version numbers', 'geodirectory');?></td>
|
|
| 1656 | + <td><?php _e('Clear all GD version numbers', 'geodirectory'); ?></td>
|
|
| 1657 | 1657 | <td> |
| 1658 | - <small><?php _e('This tool will clear all GD version numbers so any upgrade functions will run again.', 'geodirectory');?></small>
|
|
| 1658 | + <small><?php _e('This tool will clear all GD version numbers so any upgrade functions will run again.', 'geodirectory'); ?></small>
|
|
| 1659 | 1659 | </td> |
| 1660 | - <td><input type="button" value="<?php _e('Run', 'geodirectory');?>"
|
|
| 1660 | + <td><input type="button" value="<?php _e('Run', 'geodirectory'); ?>"
|
|
| 1661 | 1661 | class="button-primary geodir_diagnosis_button" data-diagnose="version_clear"/> |
| 1662 | 1662 | </td> |
| 1663 | 1663 | </tr> |
| 1664 | 1664 | <tr> |
| 1665 | - <td><?php _e('Load custom fields translation', 'geodirectory');?></td>
|
|
| 1665 | + <td><?php _e('Load custom fields translation', 'geodirectory'); ?></td>
|
|
| 1666 | 1666 | <td> |
| 1667 | - <small><?php _e('This tool will load strings from the database into a file to translate via po editor.Ex: custom fields', 'geodirectory');?></small>
|
|
| 1667 | + <small><?php _e('This tool will load strings from the database into a file to translate via po editor.Ex: custom fields', 'geodirectory'); ?></small>
|
|
| 1668 | 1668 | </td> |
| 1669 | 1669 | <td> |
| 1670 | - <input type="button" value="<?php _e('Run', 'geodirectory');?>" class="button-primary geodir_diagnosis_button" data-diagnose="load_db_language"/>
|
|
| 1670 | + <input type="button" value="<?php _e('Run', 'geodirectory'); ?>" class="button-primary geodir_diagnosis_button" data-diagnose="load_db_language"/>
|
|
| 1671 | 1671 | </td> |
| 1672 | 1672 | </tr> |
| 1673 | 1673 | <?php |
@@ -1677,7 +1677,7 @@ discard block |
||
| 1677 | 1677 | * Called after the last setting on the GD>Tools page. |
| 1678 | 1678 | * @since 1.0.0 |
| 1679 | 1679 | */ |
| 1680 | - do_action('geodir_diagnostic_tool');?>
|
|
| 1680 | + do_action('geodir_diagnostic_tool'); ?>
|
|
| 1681 | 1681 | |
| 1682 | 1682 | </tbody> |
| 1683 | 1683 | </table> |
@@ -74,17 +74,20 @@ discard block |
||
| 74 | 74 | $tab_link = $args['url']; |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | - if (!empty($args['request'])) |
|
| 78 | - $tab_link = geodir_getlink($tab_link, $args['request']); |
|
| 77 | + if (!empty($args['request'])) { |
|
| 78 | + $tab_link = geodir_getlink($tab_link, $args['request']); |
|
| 79 | + } |
|
| 79 | 80 | |
| 80 | 81 | if (isset($args['target']) && $args['target'] != '') {
|
| 81 | 82 | $tab_target = " target='" . sanitize_text_field($args['target']) . "' "; |
| 82 | - } else |
|
| 83 | - $tab_target = ''; |
|
| 83 | + } else { |
|
| 84 | + $tab_target = ''; |
|
| 85 | + } |
|
| 84 | 86 | |
| 85 | 87 | $tab_active = ''; |
| 86 | - if ($current_tab == $name) |
|
| 87 | - $tab_active = ' class="tab-active" '; |
|
| 88 | + if ($current_tab == $name) { |
|
| 89 | + $tab_active = ' class="tab-active" '; |
|
| 90 | + } |
|
| 88 | 91 | /** |
| 89 | 92 | * Called before the individual settings tabs are output. |
| 90 | 93 | * |
@@ -122,8 +125,9 @@ discard block |
||
| 122 | 125 | |
| 123 | 126 | <?php |
| 124 | 127 | unset($subtabs); |
| 125 | - if (isset($tabs[$current_tab]['subtabs'])) |
|
| 126 | - $subtabs = $tabs[$current_tab]['subtabs']; |
|
| 128 | + if (isset($tabs[$current_tab]['subtabs'])) { |
|
| 129 | + $subtabs = $tabs[$current_tab]['subtabs']; |
|
| 130 | + } |
|
| 127 | 131 | $form_action = ''; |
| 128 | 132 | |
| 129 | 133 | if (!empty($subtabs)): |
@@ -189,7 +193,10 @@ discard block |
||
| 189 | 193 | jQuery('#last_tab').val( jQuery(this).attr('href') );
|
| 190 | 194 | return false;*/ |
| 191 | 195 | }); |
| 192 | - <?php if (isset($_GET['subtab']) && $_GET['subtab']) echo 'jQuery(\'ul.subsubsub li a[href="#' . sanitize_text_field($_GET['subtab']) . '"]\').click();'; ?> |
|
| 196 | + <?php if (isset($_GET['subtab']) && $_GET['subtab']) { |
|
| 197 | + echo 'jQuery(\'ul.subsubsub li a[href="#' . sanitize_text_field($_GET['subtab']) . '"]\').click();'; |
|
| 198 | +} |
|
| 199 | +?> |
|
| 193 | 200 | // Countries |
| 194 | 201 | jQuery('select#geodirectory_allowed_countries').change(function () {
|
| 195 | 202 | if (jQuery(this).val() == "specific") {
|
@@ -312,10 +319,11 @@ discard block |
||
| 312 | 319 | geodir_register_defaults(); |
| 313 | 320 | }*/ |
| 314 | 321 | |
| 315 | - if (isset($_REQUEST['active_tab']) && ($_REQUEST['active_tab'] == 'dummy_data_settings' || $_REQUEST['active_tab'] == 'csv_upload_settings')) |
|
| 316 | - $hide_save_button = "style='display:none;'"; |
|
| 317 | - else |
|
| 318 | - $hide_save_button = ''; |
|
| 322 | + if (isset($_REQUEST['active_tab']) && ($_REQUEST['active_tab'] == 'dummy_data_settings' || $_REQUEST['active_tab'] == 'csv_upload_settings')) { |
|
| 323 | + $hide_save_button = "style='display:none;'"; |
|
| 324 | + } else { |
|
| 325 | + $hide_save_button = ''; |
|
| 326 | + } |
|
| 319 | 327 | |
| 320 | 328 | /** |
| 321 | 329 | * Filter weather the default save button in the GD admin settings pages should be shown. |
@@ -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 | |
@@ -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; |
|
| 985 | + global $preview, $post; |
|
| 986 | 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 |
|
| 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 | 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'));
|
|
| 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'));
|
|
| 991 | 991 | |
| 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 | - } |
|
| 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,176 +1090,176 @@ 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, 'geodirectory'); |
|
| 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 Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $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, 'geodirectory'); |
|
| 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 Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $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 | - } |
|
| 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; |
|
| 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; |
|
| 1234 | 1234 | |
| 1235 | - } |
|
| 1235 | + } |
|
| 1236 | 1236 | |
| 1237 | - if (!isset($listing_label)) {
|
|
| 1238 | - $listing_label = ''; |
|
| 1239 | - } |
|
| 1240 | - $taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
|
|
| 1237 | + if (!isset($listing_label)) {
|
|
| 1238 | + $listing_label = ''; |
|
| 1239 | + } |
|
| 1240 | + $taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
|
|
| 1241 | 1241 | |
| 1242 | - } |
|
| 1242 | + } |
|
| 1243 | 1243 | |
| 1244 | - /** |
|
| 1245 | - * Filter the taxonomies array before output. |
|
| 1246 | - * |
|
| 1247 | - * @since 1.5.9 |
|
| 1248 | - * @param array $taxonomies The array of cats and tags. |
|
| 1249 | - * @param string $post_type The post type being output. |
|
| 1250 | - * @param string $listing_label The post type label. |
|
| 1251 | - * @param string $listing_label The post type label with ucwords function. |
|
| 1252 | - */ |
|
| 1253 | - $taxonomies = apply_filters('geodir_details_taxonomies_output',$taxonomies,$post_type,$listing_label,geodir_ucwords($listing_label));
|
|
| 1244 | + /** |
|
| 1245 | + * Filter the taxonomies array before output. |
|
| 1246 | + * |
|
| 1247 | + * @since 1.5.9 |
|
| 1248 | + * @param array $taxonomies The array of cats and tags. |
|
| 1249 | + * @param string $post_type The post type being output. |
|
| 1250 | + * @param string $listing_label The post type label. |
|
| 1251 | + * @param string $listing_label The post type label with ucwords function. |
|
| 1252 | + */ |
|
| 1253 | + $taxonomies = apply_filters('geodir_details_taxonomies_output',$taxonomies,$post_type,$listing_label,geodir_ucwords($listing_label));
|
|
| 1254 | 1254 | |
| 1255 | - if (isset($taxonomies[$post_taxonomy])) {
|
|
| 1256 | - echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>'; |
|
| 1257 | - } |
|
| 1255 | + if (isset($taxonomies[$post_taxonomy])) {
|
|
| 1256 | + echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>'; |
|
| 1257 | + } |
|
| 1258 | 1258 | |
| 1259 | - if (isset($taxonomies[$post_type . '_tags'])) |
|
| 1260 | - echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>'; |
|
| 1259 | + if (isset($taxonomies[$post_type . '_tags'])) |
|
| 1260 | + echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>'; |
|
| 1261 | 1261 | |
| 1262 | - ?> |
|
| 1262 | + ?> |
|
| 1263 | 1263 | </p><?php |
| 1264 | 1264 | } |
| 1265 | 1265 | |
@@ -1281,126 +1281,126 @@ discard block |
||
| 1281 | 1281 | function geodir_action_details_micordata($post='') |
| 1282 | 1282 | {
|
| 1283 | 1283 | |
| 1284 | - global $preview; |
|
| 1285 | - if(empty($post)){global $post;}
|
|
| 1286 | - if ($preview || !geodir_is_page('detail')) {
|
|
| 1287 | - return; |
|
| 1288 | - } |
|
| 1289 | - |
|
| 1290 | - // url |
|
| 1291 | - $c_url = geodir_curPageURL(); |
|
| 1292 | - |
|
| 1293 | - // post reviews |
|
| 1294 | - $post_reviews = get_comments(array('post_id' => $post->ID, 'status' => 'approve'));
|
|
| 1295 | - if (empty($post_reviews)) {
|
|
| 1296 | - $reviews = ''; |
|
| 1297 | - } else {
|
|
| 1298 | - foreach ($post_reviews as $review) {
|
|
| 1299 | - $reviews[] = array( |
|
| 1300 | - "@type" => "Review", |
|
| 1301 | - "author" => $review->comment_author, |
|
| 1302 | - "datePublished" => $review->comment_date, |
|
| 1303 | - "description" => $review->comment_content, |
|
| 1304 | - "reviewRating" => array( |
|
| 1305 | - "@type" => "Rating", |
|
| 1306 | - "bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score. |
|
| 1307 | - "ratingValue" => geodir_get_commentoverall($review->comment_ID), |
|
| 1308 | - "worstRating" => "1" |
|
| 1309 | - ) |
|
| 1310 | - ); |
|
| 1311 | - } |
|
| 1312 | - |
|
| 1313 | - } |
|
| 1314 | - |
|
| 1315 | - // post images |
|
| 1316 | - $post_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
|
|
| 1317 | - if (empty($post_images)) {
|
|
| 1318 | - $images = ''; |
|
| 1319 | - } else {
|
|
| 1320 | - $i_arr = array(); |
|
| 1321 | - foreach ($post_images as $img) {
|
|
| 1322 | - $i_arr[] = $img->src; |
|
| 1323 | - } |
|
| 1324 | - |
|
| 1325 | - if (count($i_arr) == 1) {
|
|
| 1326 | - $images = $i_arr[0]; |
|
| 1327 | - } else {
|
|
| 1328 | - $images = $i_arr; |
|
| 1329 | - } |
|
| 1330 | - |
|
| 1331 | - } |
|
| 1332 | - //print_r($post); |
|
| 1333 | - // external links |
|
| 1334 | - $external_links = array(); |
|
| 1335 | - $external_links[] = $post->geodir_website; |
|
| 1336 | - $external_links[] = $post->geodir_twitter; |
|
| 1337 | - $external_links[] = $post->geodir_facebook; |
|
| 1338 | - $external_links = array_filter($external_links); |
|
| 1339 | - |
|
| 1340 | - if(!empty($external_links)){
|
|
| 1341 | - $external_links = array_values($external_links); |
|
| 1342 | - } |
|
| 1343 | - |
|
| 1344 | - // reviews |
|
| 1345 | - $comment_count = geodir_get_review_count_total($post->ID); |
|
| 1346 | - $post_avgratings = geodir_get_post_rating($post->ID); |
|
| 1347 | - |
|
| 1348 | - // schema type |
|
| 1349 | - $schema_type = 'LocalBusiness'; |
|
| 1350 | - if(isset($post->default_category) && $post->default_category){
|
|
| 1351 | - $schema_type = get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type); |
|
| 1352 | - if(!$schema_type && $post->post_type=='gd_event'){$schema_type = 'Event';}
|
|
| 1353 | - } |
|
| 1354 | - |
|
| 1355 | - $schema = array(); |
|
| 1356 | - $schema['@context'] = "http://schema.org"; |
|
| 1357 | - $schema['@type'] = $schema_type; |
|
| 1358 | - $schema['name'] = $post->post_name; |
|
| 1359 | - $schema['description'] = wp_strip_all_tags( $post->post_content, true ); |
|
| 1360 | - $schema['telephone'] = $post->geodir_contact; |
|
| 1361 | - $schema['url'] = $c_url; |
|
| 1362 | - $schema['sameAs'] = $external_links; |
|
| 1363 | - $schema['image'] = $images; |
|
| 1364 | - $schema['address'] = array( |
|
| 1365 | - "@type" => "PostalAddress", |
|
| 1366 | - "streetAddress" => $post->post_address, |
|
| 1367 | - "addressLocality" => $post->post_city, |
|
| 1368 | - "addressRegion" => $post->post_region, |
|
| 1369 | - "addressCountry" => $post->post_country, |
|
| 1370 | - "postalCode" => $post->post_zip |
|
| 1371 | - ); |
|
| 1372 | - |
|
| 1373 | - if($post->post_latitude && $post->post_longitude) {
|
|
| 1374 | - $schema['geo'] = array( |
|
| 1375 | - "@type" => "GeoCoordinates", |
|
| 1376 | - "latitude" => $post->post_latitude, |
|
| 1377 | - "longitude" => $post->post_longitude |
|
| 1378 | - ); |
|
| 1379 | - } |
|
| 1380 | - |
|
| 1381 | - if($post_avgratings) {
|
|
| 1382 | - $schema['aggregateRating'] = array( |
|
| 1383 | - "@type" => "AggregateRating", |
|
| 1384 | - "ratingValue" => $post_avgratings, |
|
| 1385 | - "bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score. |
|
| 1386 | - "worstRating" => "1", |
|
| 1387 | - "ratingCount" => $comment_count |
|
| 1388 | - ); |
|
| 1389 | - } |
|
| 1390 | - $schema['review'] = $reviews; |
|
| 1391 | - |
|
| 1392 | - /** |
|
| 1393 | - * Allow the schema JSON-LD info to be filtered. |
|
| 1394 | - * |
|
| 1395 | - * @since 1.5.4 |
|
| 1396 | - * @since 1.5.7 Added $post variable. |
|
| 1397 | - * @param array $schema The array of schema data to be filtered. |
|
| 1398 | - * @param object $post The post object. |
|
| 1399 | - */ |
|
| 1400 | - $schema = apply_filters('geodir_details_schema', $schema,$post);
|
|
| 1401 | - |
|
| 1402 | - |
|
| 1403 | - echo '<script type="application/ld+json">' . json_encode($schema) . '</script>'; |
|
| 1284 | + global $preview; |
|
| 1285 | + if(empty($post)){global $post;}
|
|
| 1286 | + if ($preview || !geodir_is_page('detail')) {
|
|
| 1287 | + return; |
|
| 1288 | + } |
|
| 1289 | + |
|
| 1290 | + // url |
|
| 1291 | + $c_url = geodir_curPageURL(); |
|
| 1292 | + |
|
| 1293 | + // post reviews |
|
| 1294 | + $post_reviews = get_comments(array('post_id' => $post->ID, 'status' => 'approve'));
|
|
| 1295 | + if (empty($post_reviews)) {
|
|
| 1296 | + $reviews = ''; |
|
| 1297 | + } else {
|
|
| 1298 | + foreach ($post_reviews as $review) {
|
|
| 1299 | + $reviews[] = array( |
|
| 1300 | + "@type" => "Review", |
|
| 1301 | + "author" => $review->comment_author, |
|
| 1302 | + "datePublished" => $review->comment_date, |
|
| 1303 | + "description" => $review->comment_content, |
|
| 1304 | + "reviewRating" => array( |
|
| 1305 | + "@type" => "Rating", |
|
| 1306 | + "bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score. |
|
| 1307 | + "ratingValue" => geodir_get_commentoverall($review->comment_ID), |
|
| 1308 | + "worstRating" => "1" |
|
| 1309 | + ) |
|
| 1310 | + ); |
|
| 1311 | + } |
|
| 1312 | + |
|
| 1313 | + } |
|
| 1314 | + |
|
| 1315 | + // post images |
|
| 1316 | + $post_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
|
|
| 1317 | + if (empty($post_images)) {
|
|
| 1318 | + $images = ''; |
|
| 1319 | + } else {
|
|
| 1320 | + $i_arr = array(); |
|
| 1321 | + foreach ($post_images as $img) {
|
|
| 1322 | + $i_arr[] = $img->src; |
|
| 1323 | + } |
|
| 1324 | + |
|
| 1325 | + if (count($i_arr) == 1) {
|
|
| 1326 | + $images = $i_arr[0]; |
|
| 1327 | + } else {
|
|
| 1328 | + $images = $i_arr; |
|
| 1329 | + } |
|
| 1330 | + |
|
| 1331 | + } |
|
| 1332 | + //print_r($post); |
|
| 1333 | + // external links |
|
| 1334 | + $external_links = array(); |
|
| 1335 | + $external_links[] = $post->geodir_website; |
|
| 1336 | + $external_links[] = $post->geodir_twitter; |
|
| 1337 | + $external_links[] = $post->geodir_facebook; |
|
| 1338 | + $external_links = array_filter($external_links); |
|
| 1339 | + |
|
| 1340 | + if(!empty($external_links)){
|
|
| 1341 | + $external_links = array_values($external_links); |
|
| 1342 | + } |
|
| 1343 | + |
|
| 1344 | + // reviews |
|
| 1345 | + $comment_count = geodir_get_review_count_total($post->ID); |
|
| 1346 | + $post_avgratings = geodir_get_post_rating($post->ID); |
|
| 1347 | + |
|
| 1348 | + // schema type |
|
| 1349 | + $schema_type = 'LocalBusiness'; |
|
| 1350 | + if(isset($post->default_category) && $post->default_category){
|
|
| 1351 | + $schema_type = get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type); |
|
| 1352 | + if(!$schema_type && $post->post_type=='gd_event'){$schema_type = 'Event';}
|
|
| 1353 | + } |
|
| 1354 | + |
|
| 1355 | + $schema = array(); |
|
| 1356 | + $schema['@context'] = "http://schema.org"; |
|
| 1357 | + $schema['@type'] = $schema_type; |
|
| 1358 | + $schema['name'] = $post->post_name; |
|
| 1359 | + $schema['description'] = wp_strip_all_tags( $post->post_content, true ); |
|
| 1360 | + $schema['telephone'] = $post->geodir_contact; |
|
| 1361 | + $schema['url'] = $c_url; |
|
| 1362 | + $schema['sameAs'] = $external_links; |
|
| 1363 | + $schema['image'] = $images; |
|
| 1364 | + $schema['address'] = array( |
|
| 1365 | + "@type" => "PostalAddress", |
|
| 1366 | + "streetAddress" => $post->post_address, |
|
| 1367 | + "addressLocality" => $post->post_city, |
|
| 1368 | + "addressRegion" => $post->post_region, |
|
| 1369 | + "addressCountry" => $post->post_country, |
|
| 1370 | + "postalCode" => $post->post_zip |
|
| 1371 | + ); |
|
| 1372 | + |
|
| 1373 | + if($post->post_latitude && $post->post_longitude) {
|
|
| 1374 | + $schema['geo'] = array( |
|
| 1375 | + "@type" => "GeoCoordinates", |
|
| 1376 | + "latitude" => $post->post_latitude, |
|
| 1377 | + "longitude" => $post->post_longitude |
|
| 1378 | + ); |
|
| 1379 | + } |
|
| 1380 | + |
|
| 1381 | + if($post_avgratings) {
|
|
| 1382 | + $schema['aggregateRating'] = array( |
|
| 1383 | + "@type" => "AggregateRating", |
|
| 1384 | + "ratingValue" => $post_avgratings, |
|
| 1385 | + "bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score. |
|
| 1386 | + "worstRating" => "1", |
|
| 1387 | + "ratingCount" => $comment_count |
|
| 1388 | + ); |
|
| 1389 | + } |
|
| 1390 | + $schema['review'] = $reviews; |
|
| 1391 | + |
|
| 1392 | + /** |
|
| 1393 | + * Allow the schema JSON-LD info to be filtered. |
|
| 1394 | + * |
|
| 1395 | + * @since 1.5.4 |
|
| 1396 | + * @since 1.5.7 Added $post variable. |
|
| 1397 | + * @param array $schema The array of schema data to be filtered. |
|
| 1398 | + * @param object $post The post object. |
|
| 1399 | + */ |
|
| 1400 | + $schema = apply_filters('geodir_details_schema', $schema,$post);
|
|
| 1401 | + |
|
| 1402 | + |
|
| 1403 | + echo '<script type="application/ld+json">' . json_encode($schema) . '</script>'; |
|
| 1404 | 1404 | |
| 1405 | 1405 | } |
| 1406 | 1406 | |
@@ -1418,7 +1418,7 @@ discard block |
||
| 1418 | 1418 | */ |
| 1419 | 1419 | function geodir_action_details_next_prev() |
| 1420 | 1420 | {
|
| 1421 | - ?> |
|
| 1421 | + ?> |
|
| 1422 | 1422 | <div class="geodir-pos_navigation clearfix"> |
| 1423 | 1423 | <div |
| 1424 | 1424 | class="geodir-post_left"><?php previous_post_link('%link', '' . __('Previous', 'geodirectory'), false) ?></div>
|
@@ -1436,15 +1436,15 @@ discard block |
||
| 1436 | 1436 | */ |
| 1437 | 1437 | function geodir_action_before_single_post() |
| 1438 | 1438 | {
|
| 1439 | - global $post; |
|
| 1440 | - /** |
|
| 1441 | - * Called at the very start fo the details page output, before the title section. |
|
| 1442 | - * |
|
| 1443 | - * @since 1.0.0 |
|
| 1444 | - * @param object $post The current post object. |
|
| 1445 | - * @global WP_Post|null $post The current post, if available. |
|
| 1446 | - */ |
|
| 1447 | - do_action('geodir_before_single_post', $post); // extra action
|
|
| 1439 | + global $post; |
|
| 1440 | + /** |
|
| 1441 | + * Called at the very start fo the details page output, before the title section. |
|
| 1442 | + * |
|
| 1443 | + * @since 1.0.0 |
|
| 1444 | + * @param object $post The current post object. |
|
| 1445 | + * @global WP_Post|null $post The current post, if available. |
|
| 1446 | + */ |
|
| 1447 | + do_action('geodir_before_single_post', $post); // extra action
|
|
| 1448 | 1448 | } |
| 1449 | 1449 | |
| 1450 | 1450 | /** |
@@ -1455,13 +1455,13 @@ discard block |
||
| 1455 | 1455 | */ |
| 1456 | 1456 | function geodir_action_after_single_post($post) |
| 1457 | 1457 | {
|
| 1458 | - /** |
|
| 1459 | - * Called on the details page after the details page tabs section and before the next/prev buttons. |
|
| 1460 | - * |
|
| 1461 | - * @since 1.0.0 |
|
| 1462 | - * @param object $post The current post object. |
|
| 1463 | - */ |
|
| 1464 | - do_action('geodir_after_single_post', $post); // extra action
|
|
| 1458 | + /** |
|
| 1459 | + * Called on the details page after the details page tabs section and before the next/prev buttons. |
|
| 1460 | + * |
|
| 1461 | + * @since 1.0.0 |
|
| 1462 | + * @param object $post The current post object. |
|
| 1463 | + */ |
|
| 1464 | + do_action('geodir_after_single_post', $post); // extra action
|
|
| 1465 | 1465 | } |
| 1466 | 1466 | |
| 1467 | 1467 | add_action('geodir_details_main_content', 'geodir_action_before_single_post', 10);
|
@@ -1487,167 +1487,167 @@ discard block |
||
| 1487 | 1487 | */ |
| 1488 | 1488 | function geodir_action_listings_title() |
| 1489 | 1489 | {
|
| 1490 | - global $wp, $term; |
|
| 1491 | - |
|
| 1492 | - $gd_post_type = geodir_get_current_posttype(); |
|
| 1493 | - $post_type_info = get_post_type_object($gd_post_type); |
|
| 1494 | - |
|
| 1495 | - $add_string_in_title = __('All', 'geodirectory') . ' ';
|
|
| 1496 | - if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
|
|
| 1497 | - $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
|
|
| 1498 | - } |
|
| 1499 | - |
|
| 1500 | - $list_title = $add_string_in_title . __(ucfirst($post_type_info->labels->name), 'geodirectory'); |
|
| 1501 | - $single_name = $post_type_info->labels->singular_name; |
|
| 1502 | - |
|
| 1503 | - $taxonomy = geodir_get_taxonomies($gd_post_type, true); |
|
| 1504 | - |
|
| 1505 | - $gd_country = get_query_var('gd_country');
|
|
| 1506 | - $gd_region = get_query_var('gd_region');
|
|
| 1507 | - $gd_city = get_query_var('gd_city');
|
|
| 1508 | - |
|
| 1509 | - if (!empty($term)) {
|
|
| 1510 | - $location_name = ''; |
|
| 1511 | - if ($gd_country != '' || $gd_region != '' || $gd_city != '') {
|
|
| 1512 | - if ($gd_country != '') {
|
|
| 1513 | - $location_name = geodir_sanitize_location_name('gd_country', $gd_country);
|
|
| 1514 | - } |
|
| 1490 | + global $wp, $term; |
|
| 1515 | 1491 | |
| 1516 | - if ($gd_region != '') {
|
|
| 1517 | - $location_name = geodir_sanitize_location_name('gd_region', $gd_region);
|
|
| 1518 | - } |
|
| 1492 | + $gd_post_type = geodir_get_current_posttype(); |
|
| 1493 | + $post_type_info = get_post_type_object($gd_post_type); |
|
| 1519 | 1494 | |
| 1520 | - if ($gd_city != '') {
|
|
| 1521 | - $location_name = geodir_sanitize_location_name('gd_city', $gd_city);
|
|
| 1522 | - } |
|
| 1523 | - } |
|
| 1495 | + $add_string_in_title = __('All', 'geodirectory') . ' ';
|
|
| 1496 | + if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
|
|
| 1497 | + $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
|
|
| 1498 | + } |
|
| 1524 | 1499 | |
| 1525 | - $current_term = get_term_by('slug', $term, $taxonomy[0]);
|
|
| 1526 | - if (!empty($current_term)) {
|
|
| 1527 | - $current_term_name = __(ucfirst($current_term->name), 'geodirectory'); |
|
| 1528 | - if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
|
|
| 1529 | - $location_last_char = substr($location_name, -1); |
|
| 1530 | - $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
|
|
| 1531 | - $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
|
|
| 1532 | - } else {
|
|
| 1533 | - $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
|
|
| 1534 | - } |
|
| 1535 | - } else {
|
|
| 1536 | - if (count($taxonomy) > 1) {
|
|
| 1537 | - $current_term = get_term_by('slug', $term, $taxonomy[1]);
|
|
| 1538 | - |
|
| 1539 | - if (!empty($current_term)) {
|
|
| 1540 | - $current_term_name = __(ucfirst($current_term->name), 'geodirectory'); |
|
| 1541 | - if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
|
|
| 1542 | - $location_last_char = substr($location_name, -1); |
|
| 1543 | - $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
|
|
| 1544 | - $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
|
|
| 1545 | - } else {
|
|
| 1546 | - $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
|
|
| 1547 | - } |
|
| 1548 | - } |
|
| 1549 | - } |
|
| 1550 | - } |
|
| 1551 | - |
|
| 1552 | - } else {
|
|
| 1553 | - $gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : ''; |
|
| 1554 | - $gd_region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : ''; |
|
| 1555 | - $gd_city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : ''; |
|
| 1556 | - |
|
| 1557 | - $gd_country_actual = $gd_region_actual = $gd_city_actual = ''; |
|
| 1558 | - |
|
| 1559 | - if (function_exists('get_actual_location_name')) {
|
|
| 1560 | - $gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
|
|
| 1561 | - $gd_region_actual = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
|
|
| 1562 | - $gd_city_actual = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
|
|
| 1563 | - } |
|
| 1564 | - |
|
| 1565 | - if ($gd_city != '') {
|
|
| 1566 | - if ($gd_city_actual != '') {
|
|
| 1567 | - $gd_city = $gd_city_actual; |
|
| 1568 | - } else {
|
|
| 1569 | - $gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
|
|
| 1570 | - $gd_city = preg_replace('/[_-]/', ' ', $gd_city);
|
|
| 1571 | - $gd_city = __(geodir_ucwords($gd_city), 'geodirectory'); |
|
| 1572 | - } |
|
| 1500 | + $list_title = $add_string_in_title . __(ucfirst($post_type_info->labels->name), 'geodirectory'); |
|
| 1501 | + $single_name = $post_type_info->labels->singular_name; |
|
| 1573 | 1502 | |
| 1574 | - $list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'";
|
|
| 1575 | - } else if ($gd_region != '') {
|
|
| 1576 | - if ($gd_region_actual != '') {
|
|
| 1577 | - $gd_region = $gd_region_actual; |
|
| 1578 | - } else {
|
|
| 1579 | - $gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
|
|
| 1580 | - $gd_region = preg_replace('/[_-]/', ' ', $gd_region);
|
|
| 1581 | - $gd_region = __(geodir_ucwords($gd_region), 'geodirectory'); |
|
| 1582 | - } |
|
| 1503 | + $taxonomy = geodir_get_taxonomies($gd_post_type, true); |
|
| 1583 | 1504 | |
| 1584 | - $list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'";
|
|
| 1585 | - } else if ($gd_country != '') {
|
|
| 1586 | - if ($gd_country_actual != '') {
|
|
| 1587 | - $gd_country = $gd_country_actual; |
|
| 1588 | - } else {
|
|
| 1589 | - $gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
|
|
| 1590 | - $gd_country = preg_replace('/[_-]/', ' ', $gd_country);
|
|
| 1591 | - $gd_country = __(geodir_ucwords($gd_country), 'geodirectory'); |
|
| 1592 | - } |
|
| 1505 | + $gd_country = get_query_var('gd_country');
|
|
| 1506 | + $gd_region = get_query_var('gd_region');
|
|
| 1507 | + $gd_city = get_query_var('gd_city');
|
|
| 1593 | 1508 | |
| 1594 | - $list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'";
|
|
| 1595 | - } |
|
| 1596 | - } |
|
| 1597 | - |
|
| 1598 | - if (is_search()) {
|
|
| 1599 | - $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
|
|
| 1600 | - } |
|
| 1601 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 1602 | - $class = apply_filters('geodir_page_title_class', 'entry-title fn');
|
|
| 1603 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 1604 | - $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
|
|
| 1605 | - |
|
| 1606 | - |
|
| 1607 | - $title = $list_title; |
|
| 1608 | - if(geodir_is_page('pt')){
|
|
| 1609 | - $gd_page = 'pt'; |
|
| 1610 | - $title = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
|
|
| 1611 | - } |
|
| 1612 | - elseif(geodir_is_page('listing')){
|
|
| 1613 | - $gd_page = 'listing'; |
|
| 1614 | - global $wp_query; |
|
| 1615 | - $current_term = $wp_query->get_queried_object(); |
|
| 1616 | - if (strpos($current_term->taxonomy,'_tags') !== false) {
|
|
| 1617 | - $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
|
|
| 1618 | - }else{
|
|
| 1619 | - $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
|
|
| 1620 | - } |
|
| 1509 | + if (!empty($term)) {
|
|
| 1510 | + $location_name = ''; |
|
| 1511 | + if ($gd_country != '' || $gd_region != '' || $gd_city != '') {
|
|
| 1512 | + if ($gd_country != '') {
|
|
| 1513 | + $location_name = geodir_sanitize_location_name('gd_country', $gd_country);
|
|
| 1514 | + } |
|
| 1621 | 1515 | |
| 1622 | - } |
|
| 1623 | - elseif(geodir_is_page('author')){
|
|
| 1624 | - $gd_page = 'author'; |
|
| 1625 | - if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
|
|
| 1626 | - $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
|
|
| 1627 | - }else{
|
|
| 1628 | - $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
|
|
| 1629 | - } |
|
| 1516 | + if ($gd_region != '') {
|
|
| 1517 | + $location_name = geodir_sanitize_location_name('gd_region', $gd_region);
|
|
| 1518 | + } |
|
| 1630 | 1519 | |
| 1631 | - } |
|
| 1520 | + if ($gd_city != '') {
|
|
| 1521 | + $location_name = geodir_sanitize_location_name('gd_city', $gd_city);
|
|
| 1522 | + } |
|
| 1523 | + } |
|
| 1524 | + |
|
| 1525 | + $current_term = get_term_by('slug', $term, $taxonomy[0]);
|
|
| 1526 | + if (!empty($current_term)) {
|
|
| 1527 | + $current_term_name = __(ucfirst($current_term->name), 'geodirectory'); |
|
| 1528 | + if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
|
|
| 1529 | + $location_last_char = substr($location_name, -1); |
|
| 1530 | + $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
|
|
| 1531 | + $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
|
|
| 1532 | + } else {
|
|
| 1533 | + $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
|
|
| 1534 | + } |
|
| 1535 | + } else {
|
|
| 1536 | + if (count($taxonomy) > 1) {
|
|
| 1537 | + $current_term = get_term_by('slug', $term, $taxonomy[1]);
|
|
| 1538 | + |
|
| 1539 | + if (!empty($current_term)) {
|
|
| 1540 | + $current_term_name = __(ucfirst($current_term->name), 'geodirectory'); |
|
| 1541 | + if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
|
|
| 1542 | + $location_last_char = substr($location_name, -1); |
|
| 1543 | + $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
|
|
| 1544 | + $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
|
|
| 1545 | + } else {
|
|
| 1546 | + $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
|
|
| 1547 | + } |
|
| 1548 | + } |
|
| 1549 | + } |
|
| 1550 | + } |
|
| 1551 | + |
|
| 1552 | + } else {
|
|
| 1553 | + $gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : ''; |
|
| 1554 | + $gd_region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : ''; |
|
| 1555 | + $gd_city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : ''; |
|
| 1556 | + |
|
| 1557 | + $gd_country_actual = $gd_region_actual = $gd_city_actual = ''; |
|
| 1558 | + |
|
| 1559 | + if (function_exists('get_actual_location_name')) {
|
|
| 1560 | + $gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
|
|
| 1561 | + $gd_region_actual = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
|
|
| 1562 | + $gd_city_actual = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
|
|
| 1563 | + } |
|
| 1564 | + |
|
| 1565 | + if ($gd_city != '') {
|
|
| 1566 | + if ($gd_city_actual != '') {
|
|
| 1567 | + $gd_city = $gd_city_actual; |
|
| 1568 | + } else {
|
|
| 1569 | + $gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
|
|
| 1570 | + $gd_city = preg_replace('/[_-]/', ' ', $gd_city);
|
|
| 1571 | + $gd_city = __(geodir_ucwords($gd_city), 'geodirectory'); |
|
| 1572 | + } |
|
| 1632 | 1573 | |
| 1574 | + $list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'";
|
|
| 1575 | + } else if ($gd_region != '') {
|
|
| 1576 | + if ($gd_region_actual != '') {
|
|
| 1577 | + $gd_region = $gd_region_actual; |
|
| 1578 | + } else {
|
|
| 1579 | + $gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
|
|
| 1580 | + $gd_region = preg_replace('/[_-]/', ' ', $gd_region);
|
|
| 1581 | + $gd_region = __(geodir_ucwords($gd_region), 'geodirectory'); |
|
| 1582 | + } |
|
| 1633 | 1583 | |
| 1634 | - /** |
|
| 1635 | - * Filter page title to replace variables. |
|
| 1636 | - * |
|
| 1637 | - * @since 1.5.4 |
|
| 1638 | - * @param string $title The page title including variables. |
|
| 1639 | - * @param string $gd_page The GeoDirectory page type if any. |
|
| 1640 | - */ |
|
| 1641 | - $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 1584 | + $list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'";
|
|
| 1585 | + } else if ($gd_country != '') {
|
|
| 1586 | + if ($gd_country_actual != '') {
|
|
| 1587 | + $gd_country = $gd_country_actual; |
|
| 1588 | + } else {
|
|
| 1589 | + $gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
|
|
| 1590 | + $gd_country = preg_replace('/[_-]/', ' ', $gd_country);
|
|
| 1591 | + $gd_country = __(geodir_ucwords($gd_country), 'geodirectory'); |
|
| 1592 | + } |
|
| 1642 | 1593 | |
| 1643 | - echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
|
| 1644 | - /** |
|
| 1645 | - * Filter the listing page title. |
|
| 1646 | - * |
|
| 1647 | - * @since 1.0.0 |
|
| 1648 | - * @param string $list_title The title for the category page. |
|
| 1649 | - */ |
|
| 1650 | - apply_filters('geodir_listing_page_title', $title) . '</h1></header>';
|
|
| 1594 | + $list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'";
|
|
| 1595 | + } |
|
| 1596 | + } |
|
| 1597 | + |
|
| 1598 | + if (is_search()) {
|
|
| 1599 | + $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
|
|
| 1600 | + } |
|
| 1601 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 1602 | + $class = apply_filters('geodir_page_title_class', 'entry-title fn');
|
|
| 1603 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 1604 | + $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
|
|
| 1605 | + |
|
| 1606 | + |
|
| 1607 | + $title = $list_title; |
|
| 1608 | + if(geodir_is_page('pt')){
|
|
| 1609 | + $gd_page = 'pt'; |
|
| 1610 | + $title = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
|
|
| 1611 | + } |
|
| 1612 | + elseif(geodir_is_page('listing')){
|
|
| 1613 | + $gd_page = 'listing'; |
|
| 1614 | + global $wp_query; |
|
| 1615 | + $current_term = $wp_query->get_queried_object(); |
|
| 1616 | + if (strpos($current_term->taxonomy,'_tags') !== false) {
|
|
| 1617 | + $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
|
|
| 1618 | + }else{
|
|
| 1619 | + $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
|
|
| 1620 | + } |
|
| 1621 | + |
|
| 1622 | + } |
|
| 1623 | + elseif(geodir_is_page('author')){
|
|
| 1624 | + $gd_page = 'author'; |
|
| 1625 | + if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
|
|
| 1626 | + $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
|
|
| 1627 | + }else{
|
|
| 1628 | + $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
|
|
| 1629 | + } |
|
| 1630 | + |
|
| 1631 | + } |
|
| 1632 | + |
|
| 1633 | + |
|
| 1634 | + /** |
|
| 1635 | + * Filter page title to replace variables. |
|
| 1636 | + * |
|
| 1637 | + * @since 1.5.4 |
|
| 1638 | + * @param string $title The page title including variables. |
|
| 1639 | + * @param string $gd_page The GeoDirectory page type if any. |
|
| 1640 | + */ |
|
| 1641 | + $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 1642 | + |
|
| 1643 | + echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
|
| 1644 | + /** |
|
| 1645 | + * Filter the listing page title. |
|
| 1646 | + * |
|
| 1647 | + * @since 1.0.0 |
|
| 1648 | + * @param string $list_title The title for the category page. |
|
| 1649 | + */ |
|
| 1650 | + apply_filters('geodir_listing_page_title', $title) . '</h1></header>';
|
|
| 1651 | 1651 | } |
| 1652 | 1652 | |
| 1653 | 1653 | add_action('geodir_listings_page_description', 'geodir_action_listings_description', 10);
|
@@ -1660,33 +1660,33 @@ discard block |
||
| 1660 | 1660 | */ |
| 1661 | 1661 | function geodir_action_listings_description() |
| 1662 | 1662 | {
|
| 1663 | - global $wp_query; |
|
| 1664 | - $current_term = $wp_query->get_queried_object(); |
|
| 1665 | - |
|
| 1666 | - $gd_post_type = geodir_get_current_posttype(); |
|
| 1667 | - if (isset($current_term->term_id) && $current_term->term_id != '') {
|
|
| 1668 | - |
|
| 1669 | - $term_desc = term_description($current_term->term_id, $gd_post_type . '_tags'); |
|
| 1670 | - $saved_data = stripslashes(get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type)); |
|
| 1671 | - if ($term_desc && !$saved_data) {
|
|
| 1672 | - $saved_data = $term_desc; |
|
| 1673 | - } |
|
| 1674 | - /** |
|
| 1675 | - * Apply the core filter `the_content` filter to the variable string. |
|
| 1676 | - * |
|
| 1677 | - * This is a WordPress core filter that does many things. |
|
| 1678 | - * |
|
| 1679 | - * @since 1.0.0 |
|
| 1680 | - * @param string $var The string to apply the filter to. |
|
| 1681 | - */ |
|
| 1682 | - $cat_description = apply_filters('the_content', $saved_data);
|
|
| 1683 | - if ($cat_description) {
|
|
| 1684 | - ?> |
|
| 1663 | + global $wp_query; |
|
| 1664 | + $current_term = $wp_query->get_queried_object(); |
|
| 1665 | + |
|
| 1666 | + $gd_post_type = geodir_get_current_posttype(); |
|
| 1667 | + if (isset($current_term->term_id) && $current_term->term_id != '') {
|
|
| 1668 | + |
|
| 1669 | + $term_desc = term_description($current_term->term_id, $gd_post_type . '_tags'); |
|
| 1670 | + $saved_data = stripslashes(get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type)); |
|
| 1671 | + if ($term_desc && !$saved_data) {
|
|
| 1672 | + $saved_data = $term_desc; |
|
| 1673 | + } |
|
| 1674 | + /** |
|
| 1675 | + * Apply the core filter `the_content` filter to the variable string. |
|
| 1676 | + * |
|
| 1677 | + * This is a WordPress core filter that does many things. |
|
| 1678 | + * |
|
| 1679 | + * @since 1.0.0 |
|
| 1680 | + * @param string $var The string to apply the filter to. |
|
| 1681 | + */ |
|
| 1682 | + $cat_description = apply_filters('the_content', $saved_data);
|
|
| 1683 | + if ($cat_description) {
|
|
| 1684 | + ?> |
|
| 1685 | 1685 | |
| 1686 | 1686 | <div class="term_description"><?php echo $cat_description;?></div> <?php |
| 1687 | - } |
|
| 1687 | + } |
|
| 1688 | 1688 | |
| 1689 | - } |
|
| 1689 | + } |
|
| 1690 | 1690 | } |
| 1691 | 1691 | |
| 1692 | 1692 | // action for adding the listings page top widget area |
@@ -1705,11 +1705,11 @@ discard block |
||
| 1705 | 1705 | */ |
| 1706 | 1706 | function geodir_action_geodir_sidebar_listings_top() |
| 1707 | 1707 | {
|
| 1708 | - if (get_option('geodir_show_listing_top_section')) { ?>
|
|
| 1708 | + if (get_option('geodir_show_listing_top_section')) { ?>
|
|
| 1709 | 1709 | <div |
| 1710 | 1710 | class="<?php |
| 1711 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 1712 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_top'); ?>">
|
|
| 1711 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 1712 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_top'); ?>">
|
|
| 1713 | 1713 | <?php dynamic_sidebar('geodir_listing_top'); ?>
|
| 1714 | 1714 | </div><!-- clearfix ends here--> |
| 1715 | 1715 | <?php } |
@@ -1732,35 +1732,35 @@ discard block |
||
| 1732 | 1732 | */ |
| 1733 | 1733 | function geodir_action_sidebar_left_open($type = '', $id = '', $class = '', $itemtype = '') |
| 1734 | 1734 | {
|
| 1735 | - if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
|
|
| 1736 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 1737 | - } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
|
|
| 1738 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 1739 | - } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
|
|
| 1740 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 1741 | - } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
|
|
| 1742 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 1743 | - } else {
|
|
| 1744 | - $width_css = ''; |
|
| 1745 | - } |
|
| 1746 | - |
|
| 1747 | - $tc = get_option('theme_compatibility_setting');
|
|
| 1748 | - if (!empty($tc['geodir_sidebar_left_open_replace'])) {
|
|
| 1749 | - $text = $tc['geodir_sidebar_left_open_replace']; |
|
| 1750 | - } else {
|
|
| 1751 | - $text = '<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>'; |
|
| 1752 | - } |
|
| 1753 | - |
|
| 1754 | - if (!empty($tc['geodir_sidebar_left_open_id'])) {
|
|
| 1755 | - $id = $tc['geodir_sidebar_left_open_id']; |
|
| 1756 | - } |
|
| 1757 | - if (!empty($tc['geodir_sidebar_left_open_class'])) {
|
|
| 1758 | - $class = $tc['geodir_sidebar_left_open_class']; |
|
| 1759 | - } |
|
| 1760 | - |
|
| 1761 | - $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
|
|
| 1762 | - |
|
| 1763 | - echo $text; |
|
| 1735 | + if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
|
|
| 1736 | + $width_css = 'style="width:' . $width . '%;"'; |
|
| 1737 | + } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
|
|
| 1738 | + $width_css = 'style="width:' . $width . '%;"'; |
|
| 1739 | + } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
|
|
| 1740 | + $width_css = 'style="width:' . $width . '%;"'; |
|
| 1741 | + } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
|
|
| 1742 | + $width_css = 'style="width:' . $width . '%;"'; |
|
| 1743 | + } else {
|
|
| 1744 | + $width_css = ''; |
|
| 1745 | + } |
|
| 1746 | + |
|
| 1747 | + $tc = get_option('theme_compatibility_setting');
|
|
| 1748 | + if (!empty($tc['geodir_sidebar_left_open_replace'])) {
|
|
| 1749 | + $text = $tc['geodir_sidebar_left_open_replace']; |
|
| 1750 | + } else {
|
|
| 1751 | + $text = '<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>'; |
|
| 1752 | + } |
|
| 1753 | + |
|
| 1754 | + if (!empty($tc['geodir_sidebar_left_open_id'])) {
|
|
| 1755 | + $id = $tc['geodir_sidebar_left_open_id']; |
|
| 1756 | + } |
|
| 1757 | + if (!empty($tc['geodir_sidebar_left_open_class'])) {
|
|
| 1758 | + $class = $tc['geodir_sidebar_left_open_class']; |
|
| 1759 | + } |
|
| 1760 | + |
|
| 1761 | + $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
|
|
| 1762 | + |
|
| 1763 | + echo $text; |
|
| 1764 | 1764 | } |
| 1765 | 1765 | |
| 1766 | 1766 | // action for adding the primary div closing tag |
@@ -1776,13 +1776,13 @@ discard block |
||
| 1776 | 1776 | */ |
| 1777 | 1777 | function geodir_action_sidebar_left_close($type = '') |
| 1778 | 1778 | {
|
| 1779 | - $tc = get_option('theme_compatibility_setting');
|
|
| 1780 | - if (!empty($tc['geodir_sidebar_left_close_replace'])) {
|
|
| 1781 | - $text = $tc['geodir_sidebar_left_close_replace']; |
|
| 1782 | - } else {
|
|
| 1783 | - $text = '</aside><!-- sidebar ends here-->'; |
|
| 1784 | - } |
|
| 1785 | - echo $text; |
|
| 1779 | + $tc = get_option('theme_compatibility_setting');
|
|
| 1780 | + if (!empty($tc['geodir_sidebar_left_close_replace'])) {
|
|
| 1781 | + $text = $tc['geodir_sidebar_left_close_replace']; |
|
| 1782 | + } else {
|
|
| 1783 | + $text = '</aside><!-- sidebar ends here-->'; |
|
| 1784 | + } |
|
| 1785 | + echo $text; |
|
| 1786 | 1786 | } |
| 1787 | 1787 | |
| 1788 | 1788 | /** |
@@ -1795,7 +1795,7 @@ discard block |
||
| 1795 | 1795 | */ |
| 1796 | 1796 | function geodir_listing_left_section() |
| 1797 | 1797 | {
|
| 1798 | - if (get_option('geodir_show_listing_left_section')) { ?>
|
|
| 1798 | + if (get_option('geodir_show_listing_left_section')) { ?>
|
|
| 1799 | 1799 | <div class="geodir-content-left geodir-sidebar-wrap"> |
| 1800 | 1800 | <?php dynamic_sidebar('geodir_listing_left_sidebar'); ?>
|
| 1801 | 1801 | </div><!-- end geodir-content-left --> |
@@ -1813,20 +1813,20 @@ discard block |
||
| 1813 | 1813 | */ |
| 1814 | 1814 | function geodir_action_listings_sidebar_left() |
| 1815 | 1815 | {
|
| 1816 | - if (get_option('geodir_show_listing_left_section')) {
|
|
| 1817 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 1818 | - do_action('geodir_sidebar_left_open', 'listings-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
|
|
| 1819 | - /** |
|
| 1820 | - * Calls the listings page (category) left sidebar content. |
|
| 1821 | - * |
|
| 1822 | - * All the content for the listings page left sidebar is added via this hook. |
|
| 1823 | - * |
|
| 1824 | - * @since 1.0.0 |
|
| 1825 | - */ |
|
| 1826 | - do_action('geodir_listings_sidebar_left_inside');
|
|
| 1827 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 1828 | - do_action('geodir_sidebar_left_close', 'listings-page');
|
|
| 1829 | - } |
|
| 1816 | + if (get_option('geodir_show_listing_left_section')) {
|
|
| 1817 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 1818 | + do_action('geodir_sidebar_left_open', 'listings-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
|
|
| 1819 | + /** |
|
| 1820 | + * Calls the listings page (category) left sidebar content. |
|
| 1821 | + * |
|
| 1822 | + * All the content for the listings page left sidebar is added via this hook. |
|
| 1823 | + * |
|
| 1824 | + * @since 1.0.0 |
|
| 1825 | + */ |
|
| 1826 | + do_action('geodir_listings_sidebar_left_inside');
|
|
| 1827 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 1828 | + do_action('geodir_sidebar_left_close', 'listings-page');
|
|
| 1829 | + } |
|
| 1830 | 1830 | } |
| 1831 | 1831 | |
| 1832 | 1832 | /** |
@@ -1839,7 +1839,7 @@ discard block |
||
| 1839 | 1839 | */ |
| 1840 | 1840 | function geodir_listing_right_section() |
| 1841 | 1841 | {
|
| 1842 | - if (get_option('geodir_show_listing_right_section')) { ?>
|
|
| 1842 | + if (get_option('geodir_show_listing_right_section')) { ?>
|
|
| 1843 | 1843 | <div class="geodir-content-right geodir-sidebar-wrap"> |
| 1844 | 1844 | <?php dynamic_sidebar('geodir_listing_right_sidebar'); ?>
|
| 1845 | 1845 | </div><!-- end geodir-content-right --> |
@@ -1857,20 +1857,20 @@ discard block |
||
| 1857 | 1857 | */ |
| 1858 | 1858 | function geodir_action_listings_sidebar_right() |
| 1859 | 1859 | {
|
| 1860 | - if (get_option('geodir_show_listing_right_section')) {
|
|
| 1861 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 1862 | - do_action('geodir_sidebar_right_open', 'listings-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
|
|
| 1863 | - /** |
|
| 1864 | - * Calls the listings page (category) right sidebar content. |
|
| 1865 | - * |
|
| 1866 | - * All the content for the listings page right sidebar is added via this hook. |
|
| 1867 | - * |
|
| 1868 | - * @since 1.0.0 |
|
| 1869 | - */ |
|
| 1870 | - do_action('geodir_listings_sidebar_right_inside');
|
|
| 1871 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 1872 | - do_action('geodir_sidebar_right_close', 'listings-page');
|
|
| 1873 | - } |
|
| 1860 | + if (get_option('geodir_show_listing_right_section')) {
|
|
| 1861 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 1862 | + do_action('geodir_sidebar_right_open', 'listings-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
|
|
| 1863 | + /** |
|
| 1864 | + * Calls the listings page (category) right sidebar content. |
|
| 1865 | + * |
|
| 1866 | + * All the content for the listings page right sidebar is added via this hook. |
|
| 1867 | + * |
|
| 1868 | + * @since 1.0.0 |
|
| 1869 | + */ |
|
| 1870 | + do_action('geodir_listings_sidebar_right_inside');
|
|
| 1871 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 1872 | + do_action('geodir_sidebar_right_close', 'listings-page');
|
|
| 1873 | + } |
|
| 1874 | 1874 | } |
| 1875 | 1875 | |
| 1876 | 1876 | |
@@ -1887,23 +1887,23 @@ discard block |
||
| 1887 | 1887 | */ |
| 1888 | 1888 | function geodir_action_main_content_open($type = '', $id = '', $class = '') |
| 1889 | 1889 | {
|
| 1890 | - $tc = get_option('theme_compatibility_setting');
|
|
| 1891 | - if (!empty($tc['geodir_main_content_open_replace'])) {
|
|
| 1892 | - $text = $tc['geodir_main_content_open_replace']; |
|
| 1893 | - } else {
|
|
| 1894 | - $text = '<main id="[id]" class="[class]" role="main">'; |
|
| 1895 | - } |
|
| 1890 | + $tc = get_option('theme_compatibility_setting');
|
|
| 1891 | + if (!empty($tc['geodir_main_content_open_replace'])) {
|
|
| 1892 | + $text = $tc['geodir_main_content_open_replace']; |
|
| 1893 | + } else {
|
|
| 1894 | + $text = '<main id="[id]" class="[class]" role="main">'; |
|
| 1895 | + } |
|
| 1896 | 1896 | |
| 1897 | - if (!empty($tc['geodir_main_content_open_id'])) {
|
|
| 1898 | - $id = $tc['geodir_main_content_open_id']; |
|
| 1899 | - } |
|
| 1900 | - if (!empty($tc['geodir_main_content_open_class'])) {
|
|
| 1901 | - $class = $tc['geodir_main_content_open_class']; |
|
| 1902 | - } |
|
| 1897 | + if (!empty($tc['geodir_main_content_open_id'])) {
|
|
| 1898 | + $id = $tc['geodir_main_content_open_id']; |
|
| 1899 | + } |
|
| 1900 | + if (!empty($tc['geodir_main_content_open_class'])) {
|
|
| 1901 | + $class = $tc['geodir_main_content_open_class']; |
|
| 1902 | + } |
|
| 1903 | 1903 | |
| 1904 | - $text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
|
|
| 1904 | + $text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
|
|
| 1905 | 1905 | |
| 1906 | - echo $text; |
|
| 1906 | + echo $text; |
|
| 1907 | 1907 | } |
| 1908 | 1908 | |
| 1909 | 1909 | // action for adding the primary div closing tag |
@@ -1916,13 +1916,13 @@ discard block |
||
| 1916 | 1916 | */ |
| 1917 | 1917 | function geodir_action_main_content_close() |
| 1918 | 1918 | {
|
| 1919 | - $tc = get_option('theme_compatibility_setting');
|
|
| 1920 | - if (!empty($tc['geodir_main_content_close_replace'])) {
|
|
| 1921 | - $text = $tc['geodir_main_content_close_replace']; |
|
| 1922 | - } else {
|
|
| 1923 | - $text = '</main><!-- main ends here-->'; |
|
| 1924 | - } |
|
| 1925 | - echo $text; |
|
| 1919 | + $tc = get_option('theme_compatibility_setting');
|
|
| 1920 | + if (!empty($tc['geodir_main_content_close_replace'])) {
|
|
| 1921 | + $text = $tc['geodir_main_content_close_replace']; |
|
| 1922 | + } else {
|
|
| 1923 | + $text = '</main><!-- main ends here-->'; |
|
| 1924 | + } |
|
| 1925 | + echo $text; |
|
| 1926 | 1926 | } |
| 1927 | 1927 | |
| 1928 | 1928 | /** |
@@ -1934,14 +1934,14 @@ discard block |
||
| 1934 | 1934 | */ |
| 1935 | 1935 | function geodir_action_listings_content_inside() |
| 1936 | 1936 | {
|
| 1937 | - global $gridview_columns; |
|
| 1938 | - $listing_view = get_option('geodir_listing_view');
|
|
| 1939 | - if (strstr($listing_view, 'gridview')) {
|
|
| 1940 | - $gridview_columns = $listing_view; |
|
| 1941 | - $listing_view_exp = explode('_', $listing_view);
|
|
| 1942 | - $listing_view = $listing_view_exp[0]; |
|
| 1943 | - } |
|
| 1944 | - geodir_get_template_part('listing', 'listview');
|
|
| 1937 | + global $gridview_columns; |
|
| 1938 | + $listing_view = get_option('geodir_listing_view');
|
|
| 1939 | + if (strstr($listing_view, 'gridview')) {
|
|
| 1940 | + $gridview_columns = $listing_view; |
|
| 1941 | + $listing_view_exp = explode('_', $listing_view);
|
|
| 1942 | + $listing_view = $listing_view_exp[0]; |
|
| 1943 | + } |
|
| 1944 | + geodir_get_template_part('listing', 'listview');
|
|
| 1945 | 1945 | } |
| 1946 | 1946 | |
| 1947 | 1947 | add_action('geodir_listings_content_inside', 'geodir_action_listings_content_inside', 10);
|
@@ -1957,47 +1957,47 @@ discard block |
||
| 1957 | 1957 | */ |
| 1958 | 1958 | function geodir_action_listings_content() |
| 1959 | 1959 | {
|
| 1960 | - /** |
|
| 1961 | - * This is used to add HTML opening wrappers to the main content of most pages including listings, author, search, home etc. |
|
| 1962 | - * |
|
| 1963 | - * @since 1.0.0 |
|
| 1964 | - * @param string $type The page type. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
| 1965 | - * @param string $id The id for the div. Usually 'geodir-main-content'. |
|
| 1966 | - * @param string $class The class for the div. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
| 1967 | - * @see 'geodir_main_content_close' Where the oposing closing tag is added. |
|
| 1968 | - */ |
|
| 1969 | - do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page');
|
|
| 1970 | - $extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page');
|
|
| 1971 | - echo '<div class="clearfix '.$extra_class.'">'; |
|
| 1972 | - /** |
|
| 1973 | - * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages. |
|
| 1974 | - * |
|
| 1975 | - * @since 1.0.0 |
|
| 1976 | - */ |
|
| 1977 | - do_action('geodir_before_listing');
|
|
| 1978 | - echo '</div>'; |
|
| 1979 | - |
|
| 1980 | - /** |
|
| 1981 | - * This actions calls the listings list content. Used on listings pages and search and author pages. |
|
| 1982 | - * |
|
| 1983 | - * @since 1.0.0 |
|
| 1984 | - */ |
|
| 1985 | - do_action('geodir_listings_content_inside');
|
|
| 1986 | - |
|
| 1987 | - /** |
|
| 1988 | - * Called after the listings content, inside the outer wrapper HTML. Used on listings pages and search and author pages. |
|
| 1989 | - * |
|
| 1990 | - * @since 1.0.0 |
|
| 1991 | - */ |
|
| 1992 | - do_action('geodir_after_listing');
|
|
| 1993 | - |
|
| 1994 | - /** |
|
| 1995 | - * This is used to add HTML closing wrappers to the main content of most pages including listings, author, search, home etc. |
|
| 1996 | - * |
|
| 1997 | - * @since 1.0.0 |
|
| 1998 | - * @see 'geodir_main_content_open' Where the oposing opening tag is added. |
|
| 1999 | - */ |
|
| 2000 | - do_action('geodir_main_content_close', 'listings-page');
|
|
| 1960 | + /** |
|
| 1961 | + * This is used to add HTML opening wrappers to the main content of most pages including listings, author, search, home etc. |
|
| 1962 | + * |
|
| 1963 | + * @since 1.0.0 |
|
| 1964 | + * @param string $type The page type. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
| 1965 | + * @param string $id The id for the div. Usually 'geodir-main-content'. |
|
| 1966 | + * @param string $class The class for the div. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
| 1967 | + * @see 'geodir_main_content_close' Where the oposing closing tag is added. |
|
| 1968 | + */ |
|
| 1969 | + do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page');
|
|
| 1970 | + $extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page');
|
|
| 1971 | + echo '<div class="clearfix '.$extra_class.'">'; |
|
| 1972 | + /** |
|
| 1973 | + * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages. |
|
| 1974 | + * |
|
| 1975 | + * @since 1.0.0 |
|
| 1976 | + */ |
|
| 1977 | + do_action('geodir_before_listing');
|
|
| 1978 | + echo '</div>'; |
|
| 1979 | + |
|
| 1980 | + /** |
|
| 1981 | + * This actions calls the listings list content. Used on listings pages and search and author pages. |
|
| 1982 | + * |
|
| 1983 | + * @since 1.0.0 |
|
| 1984 | + */ |
|
| 1985 | + do_action('geodir_listings_content_inside');
|
|
| 1986 | + |
|
| 1987 | + /** |
|
| 1988 | + * Called after the listings content, inside the outer wrapper HTML. Used on listings pages and search and author pages. |
|
| 1989 | + * |
|
| 1990 | + * @since 1.0.0 |
|
| 1991 | + */ |
|
| 1992 | + do_action('geodir_after_listing');
|
|
| 1993 | + |
|
| 1994 | + /** |
|
| 1995 | + * This is used to add HTML closing wrappers to the main content of most pages including listings, author, search, home etc. |
|
| 1996 | + * |
|
| 1997 | + * @since 1.0.0 |
|
| 1998 | + * @see 'geodir_main_content_open' Where the oposing opening tag is added. |
|
| 1999 | + */ |
|
| 2000 | + do_action('geodir_main_content_close', 'listings-page');
|
|
| 2001 | 2001 | } |
| 2002 | 2002 | |
| 2003 | 2003 | |
@@ -2012,10 +2012,10 @@ discard block |
||
| 2012 | 2012 | */ |
| 2013 | 2013 | function geodir_action_sidebar_listings_bottom_section() |
| 2014 | 2014 | {
|
| 2015 | - if (get_option('geodir_show_listing_bottom_section')) { ?>
|
|
| 2015 | + if (get_option('geodir_show_listing_bottom_section')) { ?>
|
|
| 2016 | 2016 | <div class="<?php |
| 2017 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2018 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_bottom'); ?>">
|
|
| 2017 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2018 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_bottom'); ?>">
|
|
| 2019 | 2019 | <?php dynamic_sidebar('geodir_listing_bottom'); ?>
|
| 2020 | 2020 | </div><!-- clearfix ends here--> |
| 2021 | 2021 | <?php } |
@@ -2035,38 +2035,38 @@ discard block |
||
| 2035 | 2035 | */ |
| 2036 | 2036 | function geodir_action_add_listing_page_title() |
| 2037 | 2037 | {
|
| 2038 | - if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '') |
|
| 2039 | - $listing_type = sanitize_text_field($_REQUEST['listing_type']); |
|
| 2040 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2041 | - $class = apply_filters('geodir_page_title_class', 'entry-title fn');
|
|
| 2042 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2043 | - $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
|
|
| 2044 | - |
|
| 2045 | - $title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
|
|
| 2046 | - |
|
| 2047 | - if(geodir_is_page('add-listing')){
|
|
| 2048 | - $gd_page = 'add-listing'; |
|
| 2049 | - if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
|
|
| 2050 | - $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
|
|
| 2051 | - }elseif(isset($listing_type)){
|
|
| 2052 | - $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
|
|
| 2053 | - } |
|
| 2038 | + if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '') |
|
| 2039 | + $listing_type = sanitize_text_field($_REQUEST['listing_type']); |
|
| 2040 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2041 | + $class = apply_filters('geodir_page_title_class', 'entry-title fn');
|
|
| 2042 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2043 | + $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
|
|
| 2044 | + |
|
| 2045 | + $title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
|
|
| 2046 | + |
|
| 2047 | + if(geodir_is_page('add-listing')){
|
|
| 2048 | + $gd_page = 'add-listing'; |
|
| 2049 | + if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
|
|
| 2050 | + $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
|
|
| 2051 | + }elseif(isset($listing_type)){
|
|
| 2052 | + $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
|
|
| 2053 | + } |
|
| 2054 | 2054 | |
| 2055 | - } |
|
| 2055 | + } |
|
| 2056 | 2056 | |
| 2057 | 2057 | |
| 2058 | - /** |
|
| 2059 | - * Filter page title to replace variables. |
|
| 2060 | - * |
|
| 2061 | - * @since 1.5.4 |
|
| 2062 | - * @param string $title The page title including variables. |
|
| 2063 | - * @param string $gd_page The GeoDirectory page type if any. |
|
| 2064 | - */ |
|
| 2065 | - $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 2058 | + /** |
|
| 2059 | + * Filter page title to replace variables. |
|
| 2060 | + * |
|
| 2061 | + * @since 1.5.4 |
|
| 2062 | + * @param string $title The page title including variables. |
|
| 2063 | + * @param string $gd_page The GeoDirectory page type if any. |
|
| 2064 | + */ |
|
| 2065 | + $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 2066 | 2066 | |
| 2067 | - echo '<header class="' . $class_header . '"><h1 class="' . $class . '">'; |
|
| 2068 | - echo $title; |
|
| 2069 | - echo '</h1></header>'; |
|
| 2067 | + echo '<header class="' . $class_header . '"><h1 class="' . $class . '">'; |
|
| 2068 | + echo $title; |
|
| 2069 | + echo '</h1></header>'; |
|
| 2070 | 2070 | } |
| 2071 | 2071 | |
| 2072 | 2072 | add_action('geodir_add_listing_page_mandatory', 'geodir_action_add_listing_page_mandatory', 10);
|
@@ -2097,54 +2097,54 @@ discard block |
||
| 2097 | 2097 | */ |
| 2098 | 2098 | function geodir_action_add_listing_form() |
| 2099 | 2099 | {
|
| 2100 | - global $cat_display, $post_cat, $current_user, $gd_session; |
|
| 2101 | - $page_id = get_the_ID(); |
|
| 2102 | - $post = ''; |
|
| 2103 | - $title = ''; |
|
| 2104 | - $desc = ''; |
|
| 2105 | - $kw_tags = ''; |
|
| 2106 | - $required_msg = ''; |
|
| 2107 | - $submit_button = ''; |
|
| 2108 | - |
|
| 2109 | - $ajax_action = isset($_REQUEST['ajax_action']) ? $_REQUEST['ajax_action'] : 'add'; |
|
| 2110 | - |
|
| 2111 | - $thumb_img_arr = array(); |
|
| 2112 | - $curImages = ''; |
|
| 2113 | - |
|
| 2114 | - if (isset($_REQUEST['backandedit'])) {
|
|
| 2115 | - global $post; |
|
| 2116 | - $post = (object)$gd_session->get('listing');
|
|
| 2117 | - $listing_type = $post->listing_type; |
|
| 2118 | - $title = $post->post_title; |
|
| 2119 | - $desc = $post->post_desc; |
|
| 2120 | - $post_cat = $post->post_category; |
|
| 2121 | - |
|
| 2122 | - $kw_tags = $post->post_tags; |
|
| 2123 | - $curImages = isset($post->post_images) ? $post->post_images : ''; |
|
| 2124 | - } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 2125 | - global $post, $post_images; |
|
| 2126 | - |
|
| 2127 | - $post = geodir_get_post_info($_REQUEST['pid']); |
|
| 2128 | - $thumb_img_arr = geodir_get_images($post->ID); |
|
| 2129 | - if ($thumb_img_arr) {
|
|
| 2130 | - foreach ($thumb_img_arr as $post_img) {
|
|
| 2131 | - $curImages .= $post_img->src . ','; |
|
| 2132 | - } |
|
| 2133 | - } |
|
| 2134 | - |
|
| 2135 | - $listing_type = $post->post_type; |
|
| 2136 | - $title = $post->post_title; |
|
| 2137 | - $desc = $post->post_content; |
|
| 2138 | - $kw_tags = $post->post_tags; |
|
| 2139 | - $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
|
|
| 2140 | - } else {
|
|
| 2141 | - $listing_type = sanitize_text_field($_REQUEST['listing_type']); |
|
| 2142 | - } |
|
| 2143 | - |
|
| 2144 | - if ($current_user->ID != '0') {
|
|
| 2145 | - $user_login = true; |
|
| 2146 | - } |
|
| 2147 | - ?> |
|
| 2100 | + global $cat_display, $post_cat, $current_user, $gd_session; |
|
| 2101 | + $page_id = get_the_ID(); |
|
| 2102 | + $post = ''; |
|
| 2103 | + $title = ''; |
|
| 2104 | + $desc = ''; |
|
| 2105 | + $kw_tags = ''; |
|
| 2106 | + $required_msg = ''; |
|
| 2107 | + $submit_button = ''; |
|
| 2108 | + |
|
| 2109 | + $ajax_action = isset($_REQUEST['ajax_action']) ? $_REQUEST['ajax_action'] : 'add'; |
|
| 2110 | + |
|
| 2111 | + $thumb_img_arr = array(); |
|
| 2112 | + $curImages = ''; |
|
| 2113 | + |
|
| 2114 | + if (isset($_REQUEST['backandedit'])) {
|
|
| 2115 | + global $post; |
|
| 2116 | + $post = (object)$gd_session->get('listing');
|
|
| 2117 | + $listing_type = $post->listing_type; |
|
| 2118 | + $title = $post->post_title; |
|
| 2119 | + $desc = $post->post_desc; |
|
| 2120 | + $post_cat = $post->post_category; |
|
| 2121 | + |
|
| 2122 | + $kw_tags = $post->post_tags; |
|
| 2123 | + $curImages = isset($post->post_images) ? $post->post_images : ''; |
|
| 2124 | + } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 2125 | + global $post, $post_images; |
|
| 2126 | + |
|
| 2127 | + $post = geodir_get_post_info($_REQUEST['pid']); |
|
| 2128 | + $thumb_img_arr = geodir_get_images($post->ID); |
|
| 2129 | + if ($thumb_img_arr) {
|
|
| 2130 | + foreach ($thumb_img_arr as $post_img) {
|
|
| 2131 | + $curImages .= $post_img->src . ','; |
|
| 2132 | + } |
|
| 2133 | + } |
|
| 2134 | + |
|
| 2135 | + $listing_type = $post->post_type; |
|
| 2136 | + $title = $post->post_title; |
|
| 2137 | + $desc = $post->post_content; |
|
| 2138 | + $kw_tags = $post->post_tags; |
|
| 2139 | + $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
|
|
| 2140 | + } else {
|
|
| 2141 | + $listing_type = sanitize_text_field($_REQUEST['listing_type']); |
|
| 2142 | + } |
|
| 2143 | + |
|
| 2144 | + if ($current_user->ID != '0') {
|
|
| 2145 | + $user_login = true; |
|
| 2146 | + } |
|
| 2147 | + ?> |
|
| 2148 | 2148 | <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id());?>" method="post" enctype="multipart/form-data"> |
| 2149 | 2149 | <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type);?>"/> |
| 2150 | 2150 | <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type);?>"/> |
@@ -2155,27 +2155,27 @@ discard block |
||
| 2155 | 2155 | <?php } if (isset($_REQUEST['backandedit'])) { ?>
|
| 2156 | 2156 | <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']);?>"/> |
| 2157 | 2157 | <?php |
| 2158 | - } |
|
| 2159 | - /** |
|
| 2160 | - * Called at the very top of the add listing page form for frontend. |
|
| 2161 | - * |
|
| 2162 | - * This is called just before the "Enter Listing Details" text. |
|
| 2163 | - * |
|
| 2164 | - * @since 1.0.0 |
|
| 2165 | - */ |
|
| 2166 | - do_action('geodir_before_detail_fields');
|
|
| 2167 | - ?> |
|
| 2158 | + } |
|
| 2159 | + /** |
|
| 2160 | + * Called at the very top of the add listing page form for frontend. |
|
| 2161 | + * |
|
| 2162 | + * This is called just before the "Enter Listing Details" text. |
|
| 2163 | + * |
|
| 2164 | + * @since 1.0.0 |
|
| 2165 | + */ |
|
| 2166 | + do_action('geodir_before_detail_fields');
|
|
| 2167 | + ?> |
|
| 2168 | 2168 | <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT;?></h5> |
| 2169 | 2169 | <?php |
| 2170 | - /** |
|
| 2171 | - * Called at the top of the add listing page form for frontend. |
|
| 2172 | - * |
|
| 2173 | - * This is called after the "Enter Listing Details" text. |
|
| 2174 | - * |
|
| 2175 | - * @since 1.0.0 |
|
| 2176 | - */ |
|
| 2177 | - do_action('geodir_before_main_form_fields');
|
|
| 2178 | - ?> |
|
| 2170 | + /** |
|
| 2171 | + * Called at the top of the add listing page form for frontend. |
|
| 2172 | + * |
|
| 2173 | + * This is called after the "Enter Listing Details" text. |
|
| 2174 | + * |
|
| 2175 | + * @since 1.0.0 |
|
| 2176 | + */ |
|
| 2177 | + do_action('geodir_before_main_form_fields');
|
|
| 2178 | + ?> |
|
| 2179 | 2179 | <div id="geodir_post_title_row" class="required_field geodir_form_row clearfix gd-fieldset-details"> |
| 2180 | 2180 | <label><?php echo PLACE_TITLE_TEXT;?><span>*</span> </label> |
| 2181 | 2181 | <input type="text" field_type="text" name="post_title" id="post_title" class="geodir_textfield" |
@@ -2183,57 +2183,57 @@ discard block |
||
| 2183 | 2183 | <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory');?></span> |
| 2184 | 2184 | </div> |
| 2185 | 2185 | <?php |
| 2186 | - $show_editor = get_option('geodir_tiny_editor_on_add_listing');
|
|
| 2187 | - |
|
| 2188 | - $desc = $show_editor ? stripslashes($desc) : esc_attr(stripslashes($desc)); |
|
| 2189 | - $desc_limit = ''; |
|
| 2190 | - /** |
|
| 2191 | - * Filter the add listing description field character limit number. |
|
| 2192 | - * |
|
| 2193 | - * @since 1.0.0 |
|
| 2194 | - * @param int $desc_limit The amount of characters to limit the description to. |
|
| 2195 | - */ |
|
| 2196 | - $desc_limit = apply_filters('geodir_description_field_desc_limit', $desc_limit);
|
|
| 2197 | - /** |
|
| 2198 | - * Filter the add listing description field text. |
|
| 2199 | - * |
|
| 2200 | - * @since 1.0.0 |
|
| 2201 | - * @param string $desc The text for the description field. |
|
| 2202 | - * @param int $desc_limit The character limit numer if any. |
|
| 2203 | - */ |
|
| 2204 | - $desc = apply_filters('geodir_description_field_desc', $desc, $desc_limit);
|
|
| 2205 | - $desc_limit_msg = ''; |
|
| 2206 | - /** |
|
| 2207 | - * Filter the add listing description limit message. |
|
| 2208 | - * |
|
| 2209 | - * This is the message shown if there is a limit applied to the amount of characters the description can use. |
|
| 2210 | - * |
|
| 2211 | - * @since 1.0.0 |
|
| 2212 | - * @param string $desc_limit_msg The limit message string if any. |
|
| 2213 | - * @param int $desc_limit The character limit numer if any. |
|
| 2214 | - */ |
|
| 2215 | - $desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
|
|
| 2186 | + $show_editor = get_option('geodir_tiny_editor_on_add_listing');
|
|
| 2187 | + |
|
| 2188 | + $desc = $show_editor ? stripslashes($desc) : esc_attr(stripslashes($desc)); |
|
| 2189 | + $desc_limit = ''; |
|
| 2190 | + /** |
|
| 2191 | + * Filter the add listing description field character limit number. |
|
| 2192 | + * |
|
| 2193 | + * @since 1.0.0 |
|
| 2194 | + * @param int $desc_limit The amount of characters to limit the description to. |
|
| 2195 | + */ |
|
| 2196 | + $desc_limit = apply_filters('geodir_description_field_desc_limit', $desc_limit);
|
|
| 2197 | + /** |
|
| 2198 | + * Filter the add listing description field text. |
|
| 2199 | + * |
|
| 2200 | + * @since 1.0.0 |
|
| 2201 | + * @param string $desc The text for the description field. |
|
| 2202 | + * @param int $desc_limit The character limit numer if any. |
|
| 2203 | + */ |
|
| 2204 | + $desc = apply_filters('geodir_description_field_desc', $desc, $desc_limit);
|
|
| 2205 | + $desc_limit_msg = ''; |
|
| 2206 | + /** |
|
| 2207 | + * Filter the add listing description limit message. |
|
| 2208 | + * |
|
| 2209 | + * This is the message shown if there is a limit applied to the amount of characters the description can use. |
|
| 2210 | + * |
|
| 2211 | + * @since 1.0.0 |
|
| 2212 | + * @param string $desc_limit_msg The limit message string if any. |
|
| 2213 | + * @param int $desc_limit The character limit numer if any. |
|
| 2214 | + */ |
|
| 2215 | + $desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
|
|
| 2216 | 2216 | |
| 2217 | - $desc_class = ''; |
|
| 2218 | - if ($desc_limit === '' || (int)$desc_limit > 0) {
|
|
| 2219 | - /** |
|
| 2220 | - * Called on the add listing page form for frontend just before the description field. |
|
| 2221 | - * |
|
| 2222 | - * @since 1.0.0 |
|
| 2223 | - */ |
|
| 2224 | - do_action('geodir_before_description_field');
|
|
| 2217 | + $desc_class = ''; |
|
| 2218 | + if ($desc_limit === '' || (int)$desc_limit > 0) {
|
|
| 2219 | + /** |
|
| 2220 | + * Called on the add listing page form for frontend just before the description field. |
|
| 2221 | + * |
|
| 2222 | + * @since 1.0.0 |
|
| 2223 | + */ |
|
| 2224 | + do_action('geodir_before_description_field');
|
|
| 2225 | 2225 | |
| 2226 | - $desc_class = ' required_field'; |
|
| 2227 | - } else {
|
|
| 2228 | - $desc_class = ' hidden'; |
|
| 2229 | - } |
|
| 2230 | - ?> |
|
| 2226 | + $desc_class = ' required_field'; |
|
| 2227 | + } else {
|
|
| 2228 | + $desc_class = ' hidden'; |
|
| 2229 | + } |
|
| 2230 | + ?> |
|
| 2231 | 2231 | <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class;?>"> |
| 2232 | 2232 | <label><?php echo PLACE_DESC_TEXT;?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
|
| 2233 | 2233 | <?php |
| 2234 | - if (!empty($show_editor) && in_array($listing_type, $show_editor)) {
|
|
| 2235 | - $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
|
|
| 2236 | - ?> |
|
| 2234 | + if (!empty($show_editor) && in_array($listing_type, $show_editor)) {
|
|
| 2235 | + $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
|
|
| 2236 | + ?> |
|
| 2237 | 2237 | <div class="editor" field_id="post_desc" field_type="editor"> |
| 2238 | 2238 | <?php wp_editor($desc, "post_desc", $editor_settings); ?> |
| 2239 | 2239 | </div> |
@@ -2247,56 +2247,56 @@ discard block |
||
| 2247 | 2247 | <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory');?></span> |
| 2248 | 2248 | </div> |
| 2249 | 2249 | <?php |
| 2250 | - if ($desc_limit === '' || (int)$desc_limit > 0) {
|
|
| 2251 | - /** |
|
| 2252 | - * Called on the add listing page form for frontend just after the description field. |
|
| 2253 | - * |
|
| 2254 | - * @since 1.0.0 |
|
| 2255 | - */ |
|
| 2256 | - do_action('geodir_after_description_field');
|
|
| 2257 | - } |
|
| 2250 | + if ($desc_limit === '' || (int)$desc_limit > 0) {
|
|
| 2251 | + /** |
|
| 2252 | + * Called on the add listing page form for frontend just after the description field. |
|
| 2253 | + * |
|
| 2254 | + * @since 1.0.0 |
|
| 2255 | + */ |
|
| 2256 | + do_action('geodir_after_description_field');
|
|
| 2257 | + } |
|
| 2258 | 2258 | |
| 2259 | - $kw_tags = esc_attr(stripslashes($kw_tags)); |
|
| 2260 | - $kw_tags_count = TAGKW_TEXT_COUNT; |
|
| 2261 | - $kw_tags_msg = TAGKW_MSG; |
|
| 2262 | - /** |
|
| 2263 | - * Filter the add listing tags character limit. |
|
| 2264 | - * |
|
| 2265 | - * @since 1.0.0 |
|
| 2266 | - * @param int $kw_tags_count The character count limit if any. |
|
| 2267 | - */ |
|
| 2268 | - $kw_tags_count = apply_filters('geodir_listing_tags_field_tags_count', $kw_tags_count);
|
|
| 2269 | - /** |
|
| 2270 | - * Filter the add listing tags field value. |
|
| 2271 | - * |
|
| 2272 | - * You can use the $_REQUEST values to check if this is a go back and edit value etc. |
|
| 2273 | - * |
|
| 2274 | - * @since 1.0.0 |
|
| 2275 | - * @param string $kw_tags The tag field value, usually a comma separated list of tags. |
|
| 2276 | - * @param int $kw_tags_count The character count limit if any. |
|
| 2277 | - */ |
|
| 2278 | - $kw_tags = apply_filters('geodir_listing_tags_field_tags', $kw_tags, $kw_tags_count);
|
|
| 2279 | - /** |
|
| 2280 | - * Filter the add listing tags field message text. |
|
| 2281 | - * |
|
| 2282 | - * @since 1.0.0 |
|
| 2283 | - * @param string $kw_tags_msg The message shown under the field. |
|
| 2284 | - * @param int $kw_tags_count The character count limit if any. |
|
| 2285 | - */ |
|
| 2286 | - $kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
|
|
| 2259 | + $kw_tags = esc_attr(stripslashes($kw_tags)); |
|
| 2260 | + $kw_tags_count = TAGKW_TEXT_COUNT; |
|
| 2261 | + $kw_tags_msg = TAGKW_MSG; |
|
| 2262 | + /** |
|
| 2263 | + * Filter the add listing tags character limit. |
|
| 2264 | + * |
|
| 2265 | + * @since 1.0.0 |
|
| 2266 | + * @param int $kw_tags_count The character count limit if any. |
|
| 2267 | + */ |
|
| 2268 | + $kw_tags_count = apply_filters('geodir_listing_tags_field_tags_count', $kw_tags_count);
|
|
| 2269 | + /** |
|
| 2270 | + * Filter the add listing tags field value. |
|
| 2271 | + * |
|
| 2272 | + * You can use the $_REQUEST values to check if this is a go back and edit value etc. |
|
| 2273 | + * |
|
| 2274 | + * @since 1.0.0 |
|
| 2275 | + * @param string $kw_tags The tag field value, usually a comma separated list of tags. |
|
| 2276 | + * @param int $kw_tags_count The character count limit if any. |
|
| 2277 | + */ |
|
| 2278 | + $kw_tags = apply_filters('geodir_listing_tags_field_tags', $kw_tags, $kw_tags_count);
|
|
| 2279 | + /** |
|
| 2280 | + * Filter the add listing tags field message text. |
|
| 2281 | + * |
|
| 2282 | + * @since 1.0.0 |
|
| 2283 | + * @param string $kw_tags_msg The message shown under the field. |
|
| 2284 | + * @param int $kw_tags_count The character count limit if any. |
|
| 2285 | + */ |
|
| 2286 | + $kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
|
|
| 2287 | 2287 | |
| 2288 | - $tags_class = ''; |
|
| 2289 | - if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
|
|
| 2290 | - /** |
|
| 2291 | - * Called on the add listing page form for frontend just before the tags field. |
|
| 2292 | - * |
|
| 2293 | - * @since 1.0.0 |
|
| 2294 | - */ |
|
| 2295 | - do_action('geodir_before_listing_tags_field');
|
|
| 2296 | - } else {
|
|
| 2297 | - $tags_class = ' hidden'; |
|
| 2298 | - } |
|
| 2299 | - ?> |
|
| 2288 | + $tags_class = ''; |
|
| 2289 | + if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
|
|
| 2290 | + /** |
|
| 2291 | + * Called on the add listing page form for frontend just before the tags field. |
|
| 2292 | + * |
|
| 2293 | + * @since 1.0.0 |
|
| 2294 | + */ |
|
| 2295 | + do_action('geodir_before_listing_tags_field');
|
|
| 2296 | + } else {
|
|
| 2297 | + $tags_class = ' hidden'; |
|
| 2298 | + } |
|
| 2299 | + ?> |
|
| 2300 | 2300 | <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class;?>"> |
| 2301 | 2301 | <label><?php echo TAGKW_TEXT; ?></label> |
| 2302 | 2302 | <input name="post_tags" id="post_tags" value="<?php echo $kw_tags; ?>" type="text" class="geodir_textfield" |
@@ -2304,90 +2304,90 @@ discard block |
||
| 2304 | 2304 | <span class="geodir_message_note"><?php echo $kw_tags_msg;?></span> |
| 2305 | 2305 | </div> |
| 2306 | 2306 | <?php |
| 2307 | - if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
|
|
| 2308 | - /** |
|
| 2309 | - * Called on the add listing page form for frontend just after the tags field. |
|
| 2310 | - * |
|
| 2311 | - * @since 1.0.0 |
|
| 2312 | - */ |
|
| 2313 | - do_action('geodir_after_listing_tags_field');
|
|
| 2314 | - } |
|
| 2307 | + if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
|
|
| 2308 | + /** |
|
| 2309 | + * Called on the add listing page form for frontend just after the tags field. |
|
| 2310 | + * |
|
| 2311 | + * @since 1.0.0 |
|
| 2312 | + */ |
|
| 2313 | + do_action('geodir_after_listing_tags_field');
|
|
| 2314 | + } |
|
| 2315 | 2315 | |
| 2316 | - $package_info = array(); |
|
| 2317 | - $package_info = geodir_post_package_info($package_info, $post); |
|
| 2316 | + $package_info = array(); |
|
| 2317 | + $package_info = geodir_post_package_info($package_info, $post); |
|
| 2318 | 2318 | |
| 2319 | - geodir_get_custom_fields_html($package_info->pid, 'all', $listing_type); |
|
| 2319 | + geodir_get_custom_fields_html($package_info->pid, 'all', $listing_type); |
|
| 2320 | 2320 | |
| 2321 | - // adjust values here |
|
| 2322 | - $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 |
|
| 2321 | + // adjust values here |
|
| 2322 | + $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 |
|
| 2323 | 2323 | |
| 2324 | - $multiple = true; // allow multiple files upload |
|
| 2324 | + $multiple = true; // allow multiple files upload |
|
| 2325 | 2325 | |
| 2326 | - $width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels) |
|
| 2326 | + $width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels) |
|
| 2327 | 2327 | |
| 2328 | - $height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels) |
|
| 2328 | + $height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels) |
|
| 2329 | 2329 | |
| 2330 | - $thumb_img_arr = array(); |
|
| 2331 | - $totImg = 0; |
|
| 2332 | - if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
|
|
| 2333 | - $post = (object)$gd_session->get('listing');
|
|
| 2334 | - if (isset($post->post_images)) |
|
| 2335 | - $curImages = trim($post->post_images, ","); |
|
| 2330 | + $thumb_img_arr = array(); |
|
| 2331 | + $totImg = 0; |
|
| 2332 | + if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
|
|
| 2333 | + $post = (object)$gd_session->get('listing');
|
|
| 2334 | + if (isset($post->post_images)) |
|
| 2335 | + $curImages = trim($post->post_images, ","); |
|
| 2336 | 2336 | |
| 2337 | 2337 | |
| 2338 | - if ($curImages != '') {
|
|
| 2339 | - $curImages_array = explode(',', $curImages);
|
|
| 2340 | - $totImg = count($curImages_array); |
|
| 2341 | - } |
|
| 2342 | - |
|
| 2343 | - $listing_type = $post->listing_type; |
|
| 2338 | + if ($curImages != '') {
|
|
| 2339 | + $curImages_array = explode(',', $curImages);
|
|
| 2340 | + $totImg = count($curImages_array); |
|
| 2341 | + } |
|
| 2344 | 2342 | |
| 2345 | - } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 2346 | - $post = geodir_get_post_info((int)$_REQUEST['pid']); |
|
| 2347 | - $listing_type = $post->post_type; |
|
| 2348 | - $thumb_img_arr = geodir_get_images($_REQUEST['pid']); |
|
| 2343 | + $listing_type = $post->listing_type; |
|
| 2349 | 2344 | |
| 2350 | - } else {
|
|
| 2351 | - $listing_type = sanitize_text_field($_REQUEST['listing_type']); |
|
| 2352 | - } |
|
| 2345 | + } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 2346 | + $post = geodir_get_post_info((int)$_REQUEST['pid']); |
|
| 2347 | + $listing_type = $post->post_type; |
|
| 2348 | + $thumb_img_arr = geodir_get_images($_REQUEST['pid']); |
|
| 2353 | 2349 | |
| 2350 | + } else {
|
|
| 2351 | + $listing_type = sanitize_text_field($_REQUEST['listing_type']); |
|
| 2352 | + } |
|
| 2354 | 2353 | |
| 2355 | - if (!empty($thumb_img_arr)) {
|
|
| 2356 | - foreach ($thumb_img_arr as $img) {
|
|
| 2357 | - //$curImages = $img->src.","; |
|
| 2358 | - } |
|
| 2359 | 2354 | |
| 2360 | - $totImg = count((array)$thumb_img_arr); |
|
| 2361 | - } |
|
| 2355 | + if (!empty($thumb_img_arr)) {
|
|
| 2356 | + foreach ($thumb_img_arr as $img) {
|
|
| 2357 | + //$curImages = $img->src.","; |
|
| 2358 | + } |
|
| 2362 | 2359 | |
| 2363 | - if ($curImages != '') |
|
| 2364 | - $svalue = $curImages; // this will be initial value of the above form field. Image urls. |
|
| 2365 | - else |
|
| 2366 | - $svalue = ''; |
|
| 2367 | - |
|
| 2368 | - $image_limit = $package_info->image_limit; |
|
| 2369 | - $show_image_input_box = ($image_limit != '0'); |
|
| 2370 | - /** |
|
| 2371 | - * Filter to be able to show/hide the image upload section of the add listing form. |
|
| 2372 | - * |
|
| 2373 | - * @since 1.0.0 |
|
| 2374 | - * @param bool $show_image_input_box Set true to show. Set false to not show. |
|
| 2375 | - * @param string $listing_type The custom post type slug. |
|
| 2376 | - */ |
|
| 2377 | - $show_image_input_box = apply_filters('geodir_image_uploader_on_add_listing', $show_image_input_box, $listing_type);
|
|
| 2378 | - if ($show_image_input_box) {
|
|
| 2379 | - ?> |
|
| 2360 | + $totImg = count((array)$thumb_img_arr); |
|
| 2361 | + } |
|
| 2362 | + |
|
| 2363 | + if ($curImages != '') |
|
| 2364 | + $svalue = $curImages; // this will be initial value of the above form field. Image urls. |
|
| 2365 | + else |
|
| 2366 | + $svalue = ''; |
|
| 2367 | + |
|
| 2368 | + $image_limit = $package_info->image_limit; |
|
| 2369 | + $show_image_input_box = ($image_limit != '0'); |
|
| 2370 | + /** |
|
| 2371 | + * Filter to be able to show/hide the image upload section of the add listing form. |
|
| 2372 | + * |
|
| 2373 | + * @since 1.0.0 |
|
| 2374 | + * @param bool $show_image_input_box Set true to show. Set false to not show. |
|
| 2375 | + * @param string $listing_type The custom post type slug. |
|
| 2376 | + */ |
|
| 2377 | + $show_image_input_box = apply_filters('geodir_image_uploader_on_add_listing', $show_image_input_box, $listing_type);
|
|
| 2378 | + if ($show_image_input_box) {
|
|
| 2379 | + ?> |
|
| 2380 | 2380 | |
| 2381 | 2381 | <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT;?> |
| 2382 | 2382 | <?php if ($image_limit == 1) {
|
| 2383 | - echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
|
|
| 2384 | - } ?> |
|
| 2383 | + echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
|
|
| 2384 | + } ?> |
|
| 2385 | 2385 | <?php if ($image_limit > 1) {
|
| 2386 | - echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
|
|
| 2387 | - } ?> |
|
| 2386 | + echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
|
|
| 2387 | + } ?> |
|
| 2388 | 2388 | <?php if ($image_limit == '') {
|
| 2389 | - echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
|
|
| 2390 | - } ?> |
|
| 2389 | + echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
|
|
| 2390 | + } ?> |
|
| 2391 | 2391 | </h5> |
| 2392 | 2392 | |
| 2393 | 2393 | <div class="geodir_form_row clearfix" id="<?php echo $id; ?>dropbox" |
@@ -2425,12 +2425,12 @@ discard block |
||
| 2425 | 2425 | <?php } ?> |
| 2426 | 2426 | |
| 2427 | 2427 | <?php |
| 2428 | - /** |
|
| 2429 | - * Called on the add listing page form for frontend just after the image upload field. |
|
| 2430 | - * |
|
| 2431 | - * @since 1.0.0 |
|
| 2432 | - */ |
|
| 2433 | - do_action('geodir_after_main_form_fields');?>
|
|
| 2428 | + /** |
|
| 2429 | + * Called on the add listing page form for frontend just after the image upload field. |
|
| 2430 | + * |
|
| 2431 | + * @since 1.0.0 |
|
| 2432 | + */ |
|
| 2433 | + do_action('geodir_after_main_form_fields');?>
|
|
| 2434 | 2434 | |
| 2435 | 2435 | |
| 2436 | 2436 | <!-- add captcha code --> |
@@ -2459,7 +2459,7 @@ discard block |
||
| 2459 | 2459 | |
| 2460 | 2460 | </form> |
| 2461 | 2461 | <?php |
| 2462 | - wp_reset_query(); |
|
| 2462 | + wp_reset_query(); |
|
| 2463 | 2463 | } |
| 2464 | 2464 | |
| 2465 | 2465 | /** |
@@ -2470,7 +2470,7 @@ discard block |
||
| 2470 | 2470 | */ |
| 2471 | 2471 | function geodir_add_listing_sidebar_widget_area() |
| 2472 | 2472 | {
|
| 2473 | - dynamic_sidebar('geodir_add_listing_sidebar');
|
|
| 2473 | + dynamic_sidebar('geodir_add_listing_sidebar');
|
|
| 2474 | 2474 | } |
| 2475 | 2475 | |
| 2476 | 2476 | add_action('geodir_add_listing_sidebar_inside', 'geodir_add_listing_sidebar_widget_area', 10);
|
@@ -2485,16 +2485,16 @@ discard block |
||
| 2485 | 2485 | */ |
| 2486 | 2486 | function geodir_action_add_listing_sidebar() |
| 2487 | 2487 | {
|
| 2488 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2489 | - do_action('geodir_sidebar_right_open', 'add-listing-page', 'geodir-sidebar', 'geodir-sidebar-right', 'http://schema.org/WPSideBar');
|
|
| 2490 | - /** |
|
| 2491 | - * This is used to add the content to the add listing page sidebar. |
|
| 2492 | - * |
|
| 2493 | - * @since 1.0.0 |
|
| 2494 | - */ |
|
| 2495 | - do_action('geodir_add_listing_sidebar_inside');
|
|
| 2496 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2497 | - do_action('geodir_sidebar_right_close', 'details-page');
|
|
| 2488 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2489 | + do_action('geodir_sidebar_right_open', 'add-listing-page', 'geodir-sidebar', 'geodir-sidebar-right', 'http://schema.org/WPSideBar');
|
|
| 2490 | + /** |
|
| 2491 | + * This is used to add the content to the add listing page sidebar. |
|
| 2492 | + * |
|
| 2493 | + * @since 1.0.0 |
|
| 2494 | + */ |
|
| 2495 | + do_action('geodir_add_listing_sidebar_inside');
|
|
| 2496 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2497 | + do_action('geodir_sidebar_right_close', 'details-page');
|
|
| 2498 | 2498 | } |
| 2499 | 2499 | |
| 2500 | 2500 | ############################################### |
@@ -2511,11 +2511,11 @@ discard block |
||
| 2511 | 2511 | */ |
| 2512 | 2512 | function geodir_action_geodir_sidebar_signup_top() |
| 2513 | 2513 | {
|
| 2514 | - ?> |
|
| 2514 | + ?> |
|
| 2515 | 2515 | <div |
| 2516 | 2516 | class="<?php |
| 2517 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2518 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
|
|
| 2517 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2518 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
|
|
| 2519 | 2519 | <?php dynamic_sidebar('Reg/Login Top Section');?>
|
| 2520 | 2520 | </div><!-- clearfix ends here--> |
| 2521 | 2521 | <?php |
@@ -2534,9 +2534,9 @@ discard block |
||
| 2534 | 2534 | function geodir_action_signup_forms() |
| 2535 | 2535 | {
|
| 2536 | 2536 | |
| 2537 | - global $user_login; |
|
| 2537 | + global $user_login; |
|
| 2538 | 2538 | |
| 2539 | - ?> |
|
| 2539 | + ?> |
|
| 2540 | 2540 | <script type="text/javascript"> |
| 2541 | 2541 | <?php if ( $user_login ) { ?>
|
| 2542 | 2542 | setTimeout(function () {
|
@@ -2572,65 +2572,65 @@ discard block |
||
| 2572 | 2572 | <?php } ?> |
| 2573 | 2573 | </script><?php |
| 2574 | 2574 | |
| 2575 | - global $errors; |
|
| 2576 | - if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim') |
|
| 2577 | - $errors->add('claim_login', LOGIN_CLAIM);
|
|
| 2578 | - |
|
| 2579 | - if (!empty($errors)) {
|
|
| 2580 | - foreach ($errors as $errorsObj) {
|
|
| 2581 | - foreach ($errorsObj as $key => $val) {
|
|
| 2582 | - for ($i = 0; $i < count($val); $i++) {
|
|
| 2583 | - echo "<div class=sucess_msg>" . $val[$i] . '</div>'; |
|
| 2584 | - $registration_error_msg = 1; |
|
| 2585 | - } |
|
| 2586 | - } |
|
| 2587 | - } |
|
| 2588 | - } |
|
| 2575 | + global $errors; |
|
| 2576 | + if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim') |
|
| 2577 | + $errors->add('claim_login', LOGIN_CLAIM);
|
|
| 2578 | + |
|
| 2579 | + if (!empty($errors)) {
|
|
| 2580 | + foreach ($errors as $errorsObj) {
|
|
| 2581 | + foreach ($errorsObj as $key => $val) {
|
|
| 2582 | + for ($i = 0; $i < count($val); $i++) {
|
|
| 2583 | + echo "<div class=sucess_msg>" . $val[$i] . '</div>'; |
|
| 2584 | + $registration_error_msg = 1; |
|
| 2585 | + } |
|
| 2586 | + } |
|
| 2587 | + } |
|
| 2588 | + } |
|
| 2589 | 2589 | |
| 2590 | - if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_in') {
|
|
| 2591 | - ?> |
|
| 2590 | + if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_in') {
|
|
| 2591 | + ?> |
|
| 2592 | 2592 | |
| 2593 | 2593 | <div class="login_form"> |
| 2594 | 2594 | <?php |
| 2595 | - /** |
|
| 2596 | - * Contains login form template. |
|
| 2597 | - * |
|
| 2598 | - * @since 1.0.0 |
|
| 2599 | - */ |
|
| 2600 | - include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?> |
|
| 2595 | + /** |
|
| 2596 | + * Contains login form template. |
|
| 2597 | + * |
|
| 2598 | + * @since 1.0.0 |
|
| 2599 | + */ |
|
| 2600 | + include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?> |
|
| 2601 | 2601 | </div> |
| 2602 | 2602 | |
| 2603 | 2603 | <?php } elseif (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_up') { ?>
|
| 2604 | 2604 | |
| 2605 | 2605 | <div class="registration_form"> |
| 2606 | 2606 | <?php |
| 2607 | - /** |
|
| 2608 | - * Contains registration form template. |
|
| 2609 | - * |
|
| 2610 | - * @since 1.0.0 |
|
| 2611 | - */ |
|
| 2612 | - include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?> |
|
| 2607 | + /** |
|
| 2608 | + * Contains registration form template. |
|
| 2609 | + * |
|
| 2610 | + * @since 1.0.0 |
|
| 2611 | + */ |
|
| 2612 | + include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?> |
|
| 2613 | 2613 | </div> |
| 2614 | 2614 | |
| 2615 | 2615 | <?php } else { ?>
|
| 2616 | 2616 | |
| 2617 | 2617 | <div class="login_form_l"> |
| 2618 | 2618 | <?php |
| 2619 | - /** |
|
| 2620 | - * Contains login form template. |
|
| 2621 | - * |
|
| 2622 | - * @since 1.0.0 |
|
| 2623 | - */ |
|
| 2624 | - include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?> |
|
| 2619 | + /** |
|
| 2620 | + * Contains login form template. |
|
| 2621 | + * |
|
| 2622 | + * @since 1.0.0 |
|
| 2623 | + */ |
|
| 2624 | + include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?> |
|
| 2625 | 2625 | </div> |
| 2626 | 2626 | <div class="registration_form_r"> |
| 2627 | 2627 | <?php |
| 2628 | - /** |
|
| 2629 | - * Contains registration form template. |
|
| 2630 | - * |
|
| 2631 | - * @since 1.0.0 |
|
| 2632 | - */ |
|
| 2633 | - include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?> |
|
| 2628 | + /** |
|
| 2629 | + * Contains registration form template. |
|
| 2630 | + * |
|
| 2631 | + * @since 1.0.0 |
|
| 2632 | + */ |
|
| 2633 | + include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?> |
|
| 2634 | 2634 | </div> |
| 2635 | 2635 | |
| 2636 | 2636 | <?php }?> |
@@ -2661,66 +2661,66 @@ discard block |
||
| 2661 | 2661 | */ |
| 2662 | 2662 | function geodir_action_author_page_title() |
| 2663 | 2663 | {
|
| 2664 | - global $term; |
|
| 2664 | + global $term; |
|
| 2665 | 2665 | |
| 2666 | - $gd_post_type = geodir_get_current_posttype(); |
|
| 2667 | - $post_type_info = get_post_type_object($gd_post_type); |
|
| 2666 | + $gd_post_type = geodir_get_current_posttype(); |
|
| 2667 | + $post_type_info = get_post_type_object($gd_post_type); |
|
| 2668 | 2668 | |
| 2669 | - $add_string_in_title = __('All', 'geodirectory') . ' ';
|
|
| 2670 | - if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
|
|
| 2671 | - $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
|
|
| 2672 | - } |
|
| 2669 | + $add_string_in_title = __('All', 'geodirectory') . ' ';
|
|
| 2670 | + if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
|
|
| 2671 | + $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
|
|
| 2672 | + } |
|
| 2673 | 2673 | |
| 2674 | - $list_title = $add_string_in_title . $post_type_info->labels->name; |
|
| 2675 | - $single_name = $post_type_info->labels->singular_name; |
|
| 2674 | + $list_title = $add_string_in_title . $post_type_info->labels->name; |
|
| 2675 | + $single_name = $post_type_info->labels->singular_name; |
|
| 2676 | 2676 | |
| 2677 | - $taxonomy = geodir_get_taxonomies($gd_post_type); |
|
| 2677 | + $taxonomy = geodir_get_taxonomies($gd_post_type); |
|
| 2678 | 2678 | |
| 2679 | - if (!empty($term)) {
|
|
| 2680 | - $current_term = get_term_by('slug', $term, $taxonomy[0]);
|
|
| 2681 | - if (!empty($current_term)) |
|
| 2682 | - $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
|
|
| 2683 | - } |
|
| 2679 | + if (!empty($term)) {
|
|
| 2680 | + $current_term = get_term_by('slug', $term, $taxonomy[0]);
|
|
| 2681 | + if (!empty($current_term)) |
|
| 2682 | + $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
|
|
| 2683 | + } |
|
| 2684 | 2684 | |
| 2685 | 2685 | |
| 2686 | - if (is_search()) {
|
|
| 2687 | - $list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
|
|
| 2686 | + if (is_search()) {
|
|
| 2687 | + $list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
|
|
| 2688 | 2688 | |
| 2689 | - } |
|
| 2690 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2691 | - $class = apply_filters('geodir_page_title_class', 'entry-title fn');
|
|
| 2692 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2693 | - $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
|
|
| 2689 | + } |
|
| 2690 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2691 | + $class = apply_filters('geodir_page_title_class', 'entry-title fn');
|
|
| 2692 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2693 | + $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
|
|
| 2694 | 2694 | |
| 2695 | - $title = $list_title; |
|
| 2696 | - if(geodir_is_page('author')){
|
|
| 2697 | - $gd_page = 'author'; |
|
| 2698 | - if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
|
|
| 2699 | - $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
|
|
| 2700 | - }else{
|
|
| 2701 | - $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
|
|
| 2702 | - } |
|
| 2695 | + $title = $list_title; |
|
| 2696 | + if(geodir_is_page('author')){
|
|
| 2697 | + $gd_page = 'author'; |
|
| 2698 | + if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
|
|
| 2699 | + $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
|
|
| 2700 | + }else{
|
|
| 2701 | + $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
|
|
| 2702 | + } |
|
| 2703 | 2703 | |
| 2704 | - } |
|
| 2704 | + } |
|
| 2705 | 2705 | |
| 2706 | 2706 | |
| 2707 | - /** |
|
| 2708 | - * Filter page title to replace variables. |
|
| 2709 | - * |
|
| 2710 | - * @since 1.5.4 |
|
| 2711 | - * @param string $title The page title including variables. |
|
| 2712 | - * @param string $gd_page The GeoDirectory page type if any. |
|
| 2713 | - */ |
|
| 2714 | - $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 2707 | + /** |
|
| 2708 | + * Filter page title to replace variables. |
|
| 2709 | + * |
|
| 2710 | + * @since 1.5.4 |
|
| 2711 | + * @param string $title The page title including variables. |
|
| 2712 | + * @param string $gd_page The GeoDirectory page type if any. |
|
| 2713 | + */ |
|
| 2714 | + $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 2715 | 2715 | |
| 2716 | - echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
|
| 2717 | - /** |
|
| 2718 | - * Filter the author page title text. |
|
| 2719 | - * |
|
| 2720 | - * @since 1.0.0 |
|
| 2721 | - * @param string $list_title The title for the page. |
|
| 2722 | - */ |
|
| 2723 | - apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
|
|
| 2716 | + echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
|
| 2717 | + /** |
|
| 2718 | + * Filter the author page title text. |
|
| 2719 | + * |
|
| 2720 | + * @since 1.0.0 |
|
| 2721 | + * @param string $list_title The title for the page. |
|
| 2722 | + */ |
|
| 2723 | + apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
|
|
| 2724 | 2724 | } |
| 2725 | 2725 | |
| 2726 | 2726 | |
@@ -2738,11 +2738,11 @@ discard block |
||
| 2738 | 2738 | */ |
| 2739 | 2739 | function geodir_action_geodir_sidebar_author_top() |
| 2740 | 2740 | {
|
| 2741 | - if (get_option('geodir_show_author_top_section')) { ?>
|
|
| 2741 | + if (get_option('geodir_show_author_top_section')) { ?>
|
|
| 2742 | 2742 | <div |
| 2743 | 2743 | class="<?php |
| 2744 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2745 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_top'); ?>">
|
|
| 2744 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2745 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_top'); ?>">
|
|
| 2746 | 2746 | <?php dynamic_sidebar('geodir_author_top'); ?>
|
| 2747 | 2747 | </div><!-- clearfix ends here--> |
| 2748 | 2748 | <?php } |
@@ -2758,7 +2758,7 @@ discard block |
||
| 2758 | 2758 | */ |
| 2759 | 2759 | function geodir_author_left_section() |
| 2760 | 2760 | {
|
| 2761 | - if (get_option('geodir_show_author_left_section')) { ?>
|
|
| 2761 | + if (get_option('geodir_show_author_left_section')) { ?>
|
|
| 2762 | 2762 | <div class="geodir-content-left geodir-sidebar-wrap"> |
| 2763 | 2763 | <?php dynamic_sidebar('geodir_author_left_sidebar'); ?>
|
| 2764 | 2764 | </div><!-- end geodir-content-left --> |
@@ -2779,19 +2779,19 @@ discard block |
||
| 2779 | 2779 | */ |
| 2780 | 2780 | function geodir_action_author_sidebar_left() |
| 2781 | 2781 | {
|
| 2782 | - if (get_option('geodir_show_author_left_section')) {
|
|
| 2782 | + if (get_option('geodir_show_author_left_section')) {
|
|
| 2783 | 2783 | // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='') |
| 2784 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2785 | - do_action('geodir_sidebar_left_open', 'author-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
|
|
| 2786 | - /** |
|
| 2787 | - * This is used to add the content to the author page left sidebar (if active). |
|
| 2788 | - * |
|
| 2789 | - * @since 1.0.0 |
|
| 2790 | - */ |
|
| 2791 | - do_action('geodir_author_sidebar_left_inside');
|
|
| 2792 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2793 | - do_action('geodir_sidebar_left_close', 'author-page');
|
|
| 2794 | - } |
|
| 2784 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2785 | + do_action('geodir_sidebar_left_open', 'author-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
|
|
| 2786 | + /** |
|
| 2787 | + * This is used to add the content to the author page left sidebar (if active). |
|
| 2788 | + * |
|
| 2789 | + * @since 1.0.0 |
|
| 2790 | + */ |
|
| 2791 | + do_action('geodir_author_sidebar_left_inside');
|
|
| 2792 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2793 | + do_action('geodir_sidebar_left_close', 'author-page');
|
|
| 2794 | + } |
|
| 2795 | 2795 | } |
| 2796 | 2796 | |
| 2797 | 2797 | /** |
@@ -2804,7 +2804,7 @@ discard block |
||
| 2804 | 2804 | */ |
| 2805 | 2805 | function geodir_author_right_section() |
| 2806 | 2806 | {
|
| 2807 | - if (get_option('geodir_show_author_right_section')) { ?>
|
|
| 2807 | + if (get_option('geodir_show_author_right_section')) { ?>
|
|
| 2808 | 2808 | <div class="geodir-content-right geodir-sidebar-wrap"> |
| 2809 | 2809 | <?php dynamic_sidebar('geodir_author_right_sidebar'); ?>
|
| 2810 | 2810 | </div><!-- end geodir-content-right --> |
@@ -2824,18 +2824,18 @@ discard block |
||
| 2824 | 2824 | */ |
| 2825 | 2825 | function geodir_action_author_sidebar_right() |
| 2826 | 2826 | {
|
| 2827 | - if (get_option('geodir_show_author_right_section')) {
|
|
| 2828 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2829 | - do_action('geodir_sidebar_right_open', 'author-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
|
|
| 2830 | - /** |
|
| 2831 | - * This is used to add the content to the author page right sidebar (if active). |
|
| 2832 | - * |
|
| 2833 | - * @since 1.0.0 |
|
| 2834 | - */ |
|
| 2835 | - do_action('geodir_author_sidebar_right_inside');
|
|
| 2836 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2837 | - do_action('geodir_sidebar_right_close', 'author-page');
|
|
| 2838 | - } |
|
| 2827 | + if (get_option('geodir_show_author_right_section')) {
|
|
| 2828 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2829 | + do_action('geodir_sidebar_right_open', 'author-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
|
|
| 2830 | + /** |
|
| 2831 | + * This is used to add the content to the author page right sidebar (if active). |
|
| 2832 | + * |
|
| 2833 | + * @since 1.0.0 |
|
| 2834 | + */ |
|
| 2835 | + do_action('geodir_author_sidebar_right_inside');
|
|
| 2836 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2837 | + do_action('geodir_sidebar_right_close', 'author-page');
|
|
| 2838 | + } |
|
| 2839 | 2839 | } |
| 2840 | 2840 | |
| 2841 | 2841 | /** |
@@ -2847,14 +2847,14 @@ discard block |
||
| 2847 | 2847 | */ |
| 2848 | 2848 | function geodir_action_author_content_inside() |
| 2849 | 2849 | {
|
| 2850 | - global $gridview_columns; |
|
| 2851 | - $listing_view = get_option('geodir_author_view');
|
|
| 2852 | - if (strstr($listing_view, 'gridview')) {
|
|
| 2853 | - $gridview_columns = $listing_view; |
|
| 2854 | - $listing_view_exp = explode('_', $listing_view);
|
|
| 2855 | - $listing_view = $listing_view_exp[0]; |
|
| 2856 | - } |
|
| 2857 | - geodir_get_template_part('listing', 'listview');
|
|
| 2850 | + global $gridview_columns; |
|
| 2851 | + $listing_view = get_option('geodir_author_view');
|
|
| 2852 | + if (strstr($listing_view, 'gridview')) {
|
|
| 2853 | + $gridview_columns = $listing_view; |
|
| 2854 | + $listing_view_exp = explode('_', $listing_view);
|
|
| 2855 | + $listing_view = $listing_view_exp[0]; |
|
| 2856 | + } |
|
| 2857 | + geodir_get_template_part('listing', 'listview');
|
|
| 2858 | 2858 | } |
| 2859 | 2859 | |
| 2860 | 2860 | add_action('geodir_author_content_inside', 'geodir_action_author_content_inside', 10);
|
@@ -2869,22 +2869,22 @@ discard block |
||
| 2869 | 2869 | */ |
| 2870 | 2870 | function geodir_action_author_content() |
| 2871 | 2871 | {
|
| 2872 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2873 | - do_action('geodir_main_content_open', 'author-page', 'geodir-main-content', 'author-page');
|
|
| 2874 | - echo '<div class="clearfix">'; |
|
| 2875 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2876 | - do_action('geodir_before_listing');
|
|
| 2877 | - echo '</div>'; |
|
| 2878 | - /** |
|
| 2879 | - * This is used to add the content to the author page main content. |
|
| 2880 | - * |
|
| 2881 | - * @since 1.0.0 |
|
| 2882 | - */ |
|
| 2883 | - do_action('geodir_author_content_inside');
|
|
| 2884 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2885 | - do_action('geodir_after_listing');
|
|
| 2886 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2887 | - do_action('geodir_main_content_close', 'author-page');
|
|
| 2872 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2873 | + do_action('geodir_main_content_open', 'author-page', 'geodir-main-content', 'author-page');
|
|
| 2874 | + echo '<div class="clearfix">'; |
|
| 2875 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2876 | + do_action('geodir_before_listing');
|
|
| 2877 | + echo '</div>'; |
|
| 2878 | + /** |
|
| 2879 | + * This is used to add the content to the author page main content. |
|
| 2880 | + * |
|
| 2881 | + * @since 1.0.0 |
|
| 2882 | + */ |
|
| 2883 | + do_action('geodir_author_content_inside');
|
|
| 2884 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2885 | + do_action('geodir_after_listing');
|
|
| 2886 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2887 | + do_action('geodir_main_content_close', 'author-page');
|
|
| 2888 | 2888 | } |
| 2889 | 2889 | |
| 2890 | 2890 | add_action('geodir_sidebar_author_bottom_section', 'geodir_action_sidebar_author_bottom_section', 10);
|
@@ -2898,11 +2898,11 @@ discard block |
||
| 2898 | 2898 | */ |
| 2899 | 2899 | function geodir_action_sidebar_author_bottom_section() |
| 2900 | 2900 | {
|
| 2901 | - if (get_option('geodir_show_author_bottom_section')) { ?>
|
|
| 2901 | + if (get_option('geodir_show_author_bottom_section')) { ?>
|
|
| 2902 | 2902 | <div |
| 2903 | 2903 | class="<?php |
| 2904 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2905 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_bottom'); ?>">
|
|
| 2904 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2905 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_bottom'); ?>">
|
|
| 2906 | 2906 | <?php dynamic_sidebar('geodir_author_bottom'); ?>
|
| 2907 | 2907 | </div><!-- clearfix ends here--> |
| 2908 | 2908 | <?php } |
@@ -2921,23 +2921,23 @@ discard block |
||
| 2921 | 2921 | */ |
| 2922 | 2922 | function geodir_action_search_page_title() |
| 2923 | 2923 | {
|
| 2924 | - $gd_post_type = geodir_get_current_posttype(); |
|
| 2925 | - $post_type_info = get_post_type_object($gd_post_type); |
|
| 2924 | + $gd_post_type = geodir_get_current_posttype(); |
|
| 2925 | + $post_type_info = get_post_type_object($gd_post_type); |
|
| 2926 | 2926 | |
| 2927 | - $pt_name = ''; |
|
| 2928 | - if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
|
|
| 2927 | + $pt_name = ''; |
|
| 2928 | + if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
|
|
| 2929 | 2929 | |
| 2930 | - if (is_search()) {
|
|
| 2931 | - $list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
|
|
| 2930 | + if (is_search()) {
|
|
| 2931 | + $list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
|
|
| 2932 | 2932 | |
| 2933 | - } |
|
| 2934 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2935 | - $class = apply_filters('geodir_page_title_class', 'entry-title fn');
|
|
| 2936 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2937 | - $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
|
|
| 2938 | - echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
|
| 2939 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2940 | - apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
|
|
| 2933 | + } |
|
| 2934 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2935 | + $class = apply_filters('geodir_page_title_class', 'entry-title fn');
|
|
| 2936 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2937 | + $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
|
|
| 2938 | + echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
|
| 2939 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2940 | + apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
|
|
| 2941 | 2941 | } |
| 2942 | 2942 | |
| 2943 | 2943 | // action for adding the listings page top widget area |
@@ -2953,11 +2953,11 @@ discard block |
||
| 2953 | 2953 | */ |
| 2954 | 2954 | function geodir_action_geodir_sidebar_search_top() |
| 2955 | 2955 | {
|
| 2956 | - if (get_option('geodir_show_search_top_section')) { ?>
|
|
| 2956 | + if (get_option('geodir_show_search_top_section')) { ?>
|
|
| 2957 | 2957 | <div |
| 2958 | 2958 | class="<?php |
| 2959 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2960 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_top'); ?>">
|
|
| 2959 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2960 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_top'); ?>">
|
|
| 2961 | 2961 | <?php dynamic_sidebar('geodir_search_top'); ?>
|
| 2962 | 2962 | </div><!-- clearfix ends here--> |
| 2963 | 2963 | <?php } |
@@ -2973,7 +2973,7 @@ discard block |
||
| 2973 | 2973 | */ |
| 2974 | 2974 | function geodir_search_left_section() |
| 2975 | 2975 | {
|
| 2976 | - if (get_option('geodir_show_search_left_section')) { ?>
|
|
| 2976 | + if (get_option('geodir_show_search_left_section')) { ?>
|
|
| 2977 | 2977 | <div class="geodir-content-left geodir-sidebar-wrap"> |
| 2978 | 2978 | <?php dynamic_sidebar('geodir_search_left_sidebar'); ?>
|
| 2979 | 2979 | </div><!-- end geodir-content-left --> |
@@ -2993,19 +2993,19 @@ discard block |
||
| 2993 | 2993 | */ |
| 2994 | 2994 | function geodir_action_search_sidebar_left() |
| 2995 | 2995 | {
|
| 2996 | - if (get_option('geodir_show_search_left_section')) {
|
|
| 2996 | + if (get_option('geodir_show_search_left_section')) {
|
|
| 2997 | 2997 | // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='') |
| 2998 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2999 | - do_action('geodir_sidebar_left_open', 'search-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
|
|
| 3000 | - /** |
|
| 3001 | - * This is used to add the content to the search page left sidebar (if active). |
|
| 3002 | - * |
|
| 3003 | - * @since 1.0.0 |
|
| 3004 | - */ |
|
| 3005 | - do_action('geodir_search_sidebar_left_inside');
|
|
| 3006 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3007 | - do_action('geodir_sidebar_left_close', 'search-page');
|
|
| 3008 | - } |
|
| 2998 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2999 | + do_action('geodir_sidebar_left_open', 'search-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
|
|
| 3000 | + /** |
|
| 3001 | + * This is used to add the content to the search page left sidebar (if active). |
|
| 3002 | + * |
|
| 3003 | + * @since 1.0.0 |
|
| 3004 | + */ |
|
| 3005 | + do_action('geodir_search_sidebar_left_inside');
|
|
| 3006 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3007 | + do_action('geodir_sidebar_left_close', 'search-page');
|
|
| 3008 | + } |
|
| 3009 | 3009 | } |
| 3010 | 3010 | |
| 3011 | 3011 | /** |
@@ -3018,7 +3018,7 @@ discard block |
||
| 3018 | 3018 | */ |
| 3019 | 3019 | function geodir_search_right_section() |
| 3020 | 3020 | {
|
| 3021 | - if (get_option('geodir_show_search_right_section')) { ?>
|
|
| 3021 | + if (get_option('geodir_show_search_right_section')) { ?>
|
|
| 3022 | 3022 | <div class="geodir-content-right geodir-sidebar-wrap"> |
| 3023 | 3023 | <?php dynamic_sidebar('geodir_search_right_sidebar'); ?>
|
| 3024 | 3024 | </div><!-- end geodir-content-right --> |
@@ -3038,18 +3038,18 @@ discard block |
||
| 3038 | 3038 | */ |
| 3039 | 3039 | function geodir_action_search_sidebar_right() |
| 3040 | 3040 | {
|
| 3041 | - if (get_option('geodir_show_search_right_section')) {
|
|
| 3042 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3043 | - do_action('geodir_sidebar_right_open', 'search-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
|
|
| 3044 | - /** |
|
| 3045 | - * This is used to add the content to the search page right sidebar (if active). |
|
| 3046 | - * |
|
| 3047 | - * @since 1.0.0 |
|
| 3048 | - */ |
|
| 3049 | - do_action('geodir_search_sidebar_right_inside');
|
|
| 3050 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3051 | - do_action('geodir_sidebar_right_close', 'search-page');
|
|
| 3052 | - } |
|
| 3041 | + if (get_option('geodir_show_search_right_section')) {
|
|
| 3042 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3043 | + do_action('geodir_sidebar_right_open', 'search-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
|
|
| 3044 | + /** |
|
| 3045 | + * This is used to add the content to the search page right sidebar (if active). |
|
| 3046 | + * |
|
| 3047 | + * @since 1.0.0 |
|
| 3048 | + */ |
|
| 3049 | + do_action('geodir_search_sidebar_right_inside');
|
|
| 3050 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3051 | + do_action('geodir_sidebar_right_close', 'search-page');
|
|
| 3052 | + } |
|
| 3053 | 3053 | } |
| 3054 | 3054 | |
| 3055 | 3055 | |
@@ -3064,11 +3064,11 @@ discard block |
||
| 3064 | 3064 | */ |
| 3065 | 3065 | function geodir_action_sidebar_search_bottom_section() |
| 3066 | 3066 | {
|
| 3067 | - if (get_option('geodir_show_search_bottom_section')) { ?>
|
|
| 3067 | + if (get_option('geodir_show_search_bottom_section')) { ?>
|
|
| 3068 | 3068 | <div |
| 3069 | 3069 | class="<?php |
| 3070 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3071 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_bottom'); ?>">
|
|
| 3070 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3071 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_bottom'); ?>">
|
|
| 3072 | 3072 | <?php dynamic_sidebar('geodir_search_bottom'); ?>
|
| 3073 | 3073 | </div><!-- clearfix ends here--> |
| 3074 | 3074 | <?php } |
@@ -3083,14 +3083,14 @@ discard block |
||
| 3083 | 3083 | */ |
| 3084 | 3084 | function geodir_action_search_content_inside() |
| 3085 | 3085 | {
|
| 3086 | - global $gridview_columns; |
|
| 3087 | - $listing_view = get_option('geodir_search_view');
|
|
| 3088 | - if (strstr($listing_view, 'gridview')) {
|
|
| 3089 | - $gridview_columns = $listing_view; |
|
| 3090 | - $listing_view_exp = explode('_', $listing_view);
|
|
| 3091 | - $listing_view = $listing_view_exp[0]; |
|
| 3092 | - } |
|
| 3093 | - geodir_get_template_part('listing', 'listview');
|
|
| 3086 | + global $gridview_columns; |
|
| 3087 | + $listing_view = get_option('geodir_search_view');
|
|
| 3088 | + if (strstr($listing_view, 'gridview')) {
|
|
| 3089 | + $gridview_columns = $listing_view; |
|
| 3090 | + $listing_view_exp = explode('_', $listing_view);
|
|
| 3091 | + $listing_view = $listing_view_exp[0]; |
|
| 3092 | + } |
|
| 3093 | + geodir_get_template_part('listing', 'listview');
|
|
| 3094 | 3094 | } |
| 3095 | 3095 | |
| 3096 | 3096 | add_action('geodir_search_content_inside', 'geodir_action_search_content_inside', 10);
|
@@ -3106,22 +3106,22 @@ discard block |
||
| 3106 | 3106 | */ |
| 3107 | 3107 | function geodir_action_search_content() |
| 3108 | 3108 | {
|
| 3109 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3110 | - do_action('geodir_main_content_open', 'search-page', 'geodir-main-content', 'search-page');
|
|
| 3111 | - echo '<div class="clearfix">'; |
|
| 3112 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3113 | - do_action('geodir_before_listing');
|
|
| 3114 | - echo '</div>'; |
|
| 3115 | - /** |
|
| 3116 | - * This is used to add the content to the search page main content. |
|
| 3117 | - * |
|
| 3118 | - * @since 1.0.0 |
|
| 3119 | - */ |
|
| 3120 | - do_action('geodir_search_content_inside');
|
|
| 3121 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3122 | - do_action('geodir_after_listing');
|
|
| 3123 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3124 | - do_action('geodir_main_content_close', 'search-page');
|
|
| 3109 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3110 | + do_action('geodir_main_content_open', 'search-page', 'geodir-main-content', 'search-page');
|
|
| 3111 | + echo '<div class="clearfix">'; |
|
| 3112 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3113 | + do_action('geodir_before_listing');
|
|
| 3114 | + echo '</div>'; |
|
| 3115 | + /** |
|
| 3116 | + * This is used to add the content to the search page main content. |
|
| 3117 | + * |
|
| 3118 | + * @since 1.0.0 |
|
| 3119 | + */ |
|
| 3120 | + do_action('geodir_search_content_inside');
|
|
| 3121 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3122 | + do_action('geodir_after_listing');
|
|
| 3123 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3124 | + do_action('geodir_main_content_close', 'search-page');
|
|
| 3125 | 3125 | } |
| 3126 | 3126 | |
| 3127 | 3127 | ############################################### |
@@ -3144,11 +3144,11 @@ discard block |
||
| 3144 | 3144 | */ |
| 3145 | 3145 | function geodir_action_geodir_sidebar_home_top() |
| 3146 | 3146 | {
|
| 3147 | - if (get_option('geodir_show_home_top_section')) { ?>
|
|
| 3147 | + if (get_option('geodir_show_home_top_section')) { ?>
|
|
| 3148 | 3148 | <div |
| 3149 | 3149 | class="<?php |
| 3150 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3151 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_top'); ?>">
|
|
| 3150 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3151 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_top'); ?>">
|
|
| 3152 | 3152 | <?php dynamic_sidebar('geodir_home_top'); ?>
|
| 3153 | 3153 | </div><!-- clearfix ends here--> |
| 3154 | 3154 | <?php } |
@@ -3164,7 +3164,7 @@ discard block |
||
| 3164 | 3164 | */ |
| 3165 | 3165 | function geodir_home_left_section() |
| 3166 | 3166 | {
|
| 3167 | - if (get_option('geodir_show_home_left_section')) { ?>
|
|
| 3167 | + if (get_option('geodir_show_home_left_section')) { ?>
|
|
| 3168 | 3168 | <div class="geodir-content-left geodir-sidebar-wrap"> |
| 3169 | 3169 | <?php dynamic_sidebar('geodir_home_left'); ?>
|
| 3170 | 3170 | </div><!-- end geodir-content-left --> |
@@ -3186,19 +3186,19 @@ discard block |
||
| 3186 | 3186 | */ |
| 3187 | 3187 | function geodir_action_home_sidebar_left() |
| 3188 | 3188 | {
|
| 3189 | - if (get_option('geodir_show_home_left_section')) {
|
|
| 3189 | + if (get_option('geodir_show_home_left_section')) {
|
|
| 3190 | 3190 | // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='') |
| 3191 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3192 | - do_action('geodir_sidebar_left_open', 'home-page', 'geodir-sidebar-left', 'geodir-sidebar geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
|
|
| 3193 | - /** |
|
| 3194 | - * This is used to add the content to the home page left sidebar (if active). |
|
| 3195 | - * |
|
| 3196 | - * @since 1.0.0 |
|
| 3197 | - */ |
|
| 3198 | - do_action('geodir_home_sidebar_left_inside');
|
|
| 3199 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3200 | - do_action('geodir_sidebar_left_close', 'home-page');
|
|
| 3201 | - } |
|
| 3191 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3192 | + do_action('geodir_sidebar_left_open', 'home-page', 'geodir-sidebar-left', 'geodir-sidebar geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
|
|
| 3193 | + /** |
|
| 3194 | + * This is used to add the content to the home page left sidebar (if active). |
|
| 3195 | + * |
|
| 3196 | + * @since 1.0.0 |
|
| 3197 | + */ |
|
| 3198 | + do_action('geodir_home_sidebar_left_inside');
|
|
| 3199 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3200 | + do_action('geodir_sidebar_left_close', 'home-page');
|
|
| 3201 | + } |
|
| 3202 | 3202 | } |
| 3203 | 3203 | |
| 3204 | 3204 | /** |
@@ -3211,7 +3211,7 @@ discard block |
||
| 3211 | 3211 | */ |
| 3212 | 3212 | function geodir_home_right_section() |
| 3213 | 3213 | {
|
| 3214 | - if (get_option('geodir_show_home_right_section')) { ?>
|
|
| 3214 | + if (get_option('geodir_show_home_right_section')) { ?>
|
|
| 3215 | 3215 | <div class="geodir-content-right geodir-sidebar-wrap"> |
| 3216 | 3216 | <?php dynamic_sidebar('geodir_home_right'); ?>
|
| 3217 | 3217 | </div><!-- end geodir-content-right --> |
@@ -3232,18 +3232,18 @@ discard block |
||
| 3232 | 3232 | */ |
| 3233 | 3233 | function geodir_action_home_sidebar_right() |
| 3234 | 3234 | {
|
| 3235 | - if (get_option('geodir_show_home_right_section')) {
|
|
| 3236 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3237 | - do_action('geodir_sidebar_right_open', 'home-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
|
|
| 3238 | - /** |
|
| 3239 | - * This is used to add the content to the home page right sidebar (if active). |
|
| 3240 | - * |
|
| 3241 | - * @since 1.0.0 |
|
| 3242 | - */ |
|
| 3243 | - do_action('geodir_home_sidebar_right_inside');
|
|
| 3244 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3245 | - do_action('geodir_sidebar_right_close', 'home-page');
|
|
| 3246 | - } |
|
| 3235 | + if (get_option('geodir_show_home_right_section')) {
|
|
| 3236 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3237 | + do_action('geodir_sidebar_right_open', 'home-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
|
|
| 3238 | + /** |
|
| 3239 | + * This is used to add the content to the home page right sidebar (if active). |
|
| 3240 | + * |
|
| 3241 | + * @since 1.0.0 |
|
| 3242 | + */ |
|
| 3243 | + do_action('geodir_home_sidebar_right_inside');
|
|
| 3244 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3245 | + do_action('geodir_sidebar_right_close', 'home-page');
|
|
| 3246 | + } |
|
| 3247 | 3247 | } |
| 3248 | 3248 | |
| 3249 | 3249 | /** |
@@ -3254,7 +3254,7 @@ discard block |
||
| 3254 | 3254 | */ |
| 3255 | 3255 | function geodir_action_home_content_inside() |
| 3256 | 3256 | {
|
| 3257 | - dynamic_sidebar('geodir_home_content');
|
|
| 3257 | + dynamic_sidebar('geodir_home_content');
|
|
| 3258 | 3258 | } |
| 3259 | 3259 | |
| 3260 | 3260 | add_action('geodir_home_content_inside', 'geodir_action_home_content_inside', 10);
|
@@ -3269,28 +3269,28 @@ discard block |
||
| 3269 | 3269 | */ |
| 3270 | 3270 | function geodir_action_home_content() |
| 3271 | 3271 | {
|
| 3272 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3273 | - do_action('geodir_main_content_open', 'home-page', 'geodir-main-content', 'home-page');
|
|
| 3274 | - /** |
|
| 3275 | - * This called before the home page main content. |
|
| 3276 | - * |
|
| 3277 | - * @since 1.0.0 |
|
| 3278 | - */ |
|
| 3279 | - do_action('geodir_before_home_content');
|
|
| 3280 | - /** |
|
| 3281 | - * This is used to add the content to the home page main content. |
|
| 3282 | - * |
|
| 3283 | - * @since 1.0.0 |
|
| 3284 | - */ |
|
| 3285 | - do_action('geodir_home_content_inside');
|
|
| 3286 | - /** |
|
| 3287 | - * This is called after the homepage main content. |
|
| 3288 | - * |
|
| 3289 | - * @since 1.0.0 |
|
| 3290 | - */ |
|
| 3291 | - do_action('geodir_after_home_content');
|
|
| 3292 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3293 | - do_action('geodir_main_content_close', 'home-page');
|
|
| 3272 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3273 | + do_action('geodir_main_content_open', 'home-page', 'geodir-main-content', 'home-page');
|
|
| 3274 | + /** |
|
| 3275 | + * This called before the home page main content. |
|
| 3276 | + * |
|
| 3277 | + * @since 1.0.0 |
|
| 3278 | + */ |
|
| 3279 | + do_action('geodir_before_home_content');
|
|
| 3280 | + /** |
|
| 3281 | + * This is used to add the content to the home page main content. |
|
| 3282 | + * |
|
| 3283 | + * @since 1.0.0 |
|
| 3284 | + */ |
|
| 3285 | + do_action('geodir_home_content_inside');
|
|
| 3286 | + /** |
|
| 3287 | + * This is called after the homepage main content. |
|
| 3288 | + * |
|
| 3289 | + * @since 1.0.0 |
|
| 3290 | + */ |
|
| 3291 | + do_action('geodir_after_home_content');
|
|
| 3292 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3293 | + do_action('geodir_main_content_close', 'home-page');
|
|
| 3294 | 3294 | } |
| 3295 | 3295 | |
| 3296 | 3296 | add_action('geodir_sidebar_location_bottom_section', 'geodir_action_sidebar_home_bottom_section', 10);
|
@@ -3305,11 +3305,11 @@ discard block |
||
| 3305 | 3305 | */ |
| 3306 | 3306 | function geodir_action_sidebar_home_bottom_section() |
| 3307 | 3307 | {
|
| 3308 | - if (get_option('geodir_show_home_bottom_section')) { ?>
|
|
| 3308 | + if (get_option('geodir_show_home_bottom_section')) { ?>
|
|
| 3309 | 3309 | <div |
| 3310 | 3310 | class="<?php |
| 3311 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3312 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_bottom'); ?>">
|
|
| 3311 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3312 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_bottom'); ?>">
|
|
| 3313 | 3313 | <?php dynamic_sidebar('geodir_home_bottom'); ?>
|
| 3314 | 3314 | </div><!-- clearfix ends here--> |
| 3315 | 3315 | <?php } |
@@ -3337,13 +3337,13 @@ discard block |
||
| 3337 | 3337 | */ |
| 3338 | 3338 | function geodir_filter_listing_page_title($list_title) |
| 3339 | 3339 | {
|
| 3340 | - if (is_search() && trim(get_search_query()) == '') {
|
|
| 3341 | - $gd_post_type = geodir_get_current_posttype(); |
|
| 3342 | - $post_type_info = get_post_type_object($gd_post_type); |
|
| 3340 | + if (is_search() && trim(get_search_query()) == '') {
|
|
| 3341 | + $gd_post_type = geodir_get_current_posttype(); |
|
| 3342 | + $post_type_info = get_post_type_object($gd_post_type); |
|
| 3343 | 3343 | |
| 3344 | - $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
|
|
| 3345 | - } |
|
| 3346 | - return $list_title; |
|
| 3344 | + $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
|
|
| 3345 | + } |
|
| 3346 | + return $list_title; |
|
| 3347 | 3347 | } |
| 3348 | 3348 | |
| 3349 | 3349 | add_action('geodir_message_not_found_on_listing', 'geodir_display_message_not_found_on_listing');
|
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | |
| 283 | 283 | //php |
| 284 | 284 | if (!empty($tc['geodir_theme_compat_code'])) {
|
| 285 | - include_once('geodirectory-functions/compatibility/' . $tc['geodir_theme_compat_code'] . '.php');
|
|
| 285 | + include_once('geodirectory-functions/compatibility/'.$tc['geodir_theme_compat_code'].'.php');
|
|
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 | //geodir_full_page_class |
@@ -452,13 +452,13 @@ discard block |
||
| 452 | 452 | function geodir_action_wrapper_content_open($type = '', $id = '', $class = '') |
| 453 | 453 | {
|
| 454 | 454 | if ($type == 'home-page' && $width = get_option('geodir_width_home_contant_section')) {
|
| 455 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 455 | + $width_css = 'style="width:'.$width.'%;"'; |
|
| 456 | 456 | } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_contant_section')) {
|
| 457 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 457 | + $width_css = 'style="width:'.$width.'%;"'; |
|
| 458 | 458 | } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_contant_section')) {
|
| 459 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 459 | + $width_css = 'style="width:'.$width.'%;"'; |
|
| 460 | 460 | } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_contant_section')) {
|
| 461 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 461 | + $width_css = 'style="width:'.$width.'%;"'; |
|
| 462 | 462 | } else {
|
| 463 | 463 | $width_css = ''; |
| 464 | 464 | } |
@@ -572,13 +572,13 @@ discard block |
||
| 572 | 572 | function geodir_action_sidebar_right_open($type = '', $id = '', $class = '', $itemtype = '') |
| 573 | 573 | {
|
| 574 | 574 | if ($type == 'home-page' && $width = get_option('geodir_width_home_right_section')) {
|
| 575 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 575 | + $width_css = 'style="width:'.$width.'%;"'; |
|
| 576 | 576 | } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_right_section')) {
|
| 577 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 577 | + $width_css = 'style="width:'.$width.'%;"'; |
|
| 578 | 578 | } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_right_section')) {
|
| 579 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 579 | + $width_css = 'style="width:'.$width.'%;"'; |
|
| 580 | 580 | } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_right_section')) {
|
| 581 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 581 | + $width_css = 'style="width:'.$width.'%;"'; |
|
| 582 | 582 | } else {
|
| 583 | 583 | $width_css = ''; |
| 584 | 584 | } |
@@ -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)) {
|
@@ -735,10 +735,10 @@ discard block |
||
| 735 | 735 | |
| 736 | 736 | $json = '{';
|
| 737 | 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 . '"'; |
|
| 738 | + $json .= '"t": "'.$json_title.'",'; |
|
| 739 | + $json .= '"lt": "'.$post_latitude.'",'; |
|
| 740 | + $json .= '"ln": "'.$post_longitude.'",'; |
|
| 741 | + $json .= '"i":"'.$term_icon.'"'; |
|
| 742 | 742 | $json .= '}'; |
| 743 | 743 | |
| 744 | 744 | $post->marker_json = $json; |
@@ -965,7 +965,7 @@ discard block |
||
| 965 | 965 | * @param string $class The class to use. Default is 'entry-header'. |
| 966 | 966 | */ |
| 967 | 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>'; |
|
| 968 | + echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'.stripslashes(get_the_title()).'</h1></header>'; |
|
| 969 | 969 | } |
| 970 | 970 | |
| 971 | 971 | |
@@ -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)) {
|
@@ -1031,9 +1031,9 @@ discard block |
||
| 1031 | 1031 | |
| 1032 | 1032 | $image_title = isset($image->title) ? $image->title : ''; |
| 1033 | 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>'; |
|
| 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 | 1037 | $slides++; |
| 1038 | 1038 | } |
| 1039 | 1039 | } |
@@ -1052,10 +1052,10 @@ 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>' : ''; |
|
| 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>'; |
|
| 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 | 1059 | $slides++; |
| 1060 | 1060 | } |
| 1061 | 1061 | }// endfore |
@@ -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(); |
@@ -1099,11 +1099,11 @@ discard block |
||
| 1099 | 1099 | |
| 1100 | 1100 | if ($preview && !$is_backend_preview) {
|
| 1101 | 1101 | $post_type = $post->listing_type; |
| 1102 | - $post_taxonomy = $post_type . 'category'; |
|
| 1102 | + $post_taxonomy = $post_type.'category'; |
|
| 1103 | 1103 | $post->{$post_taxonomy} = $post->post_category[$post_taxonomy];
|
| 1104 | 1104 | } else {
|
| 1105 | 1105 | $post_type = $post->post_type; |
| 1106 | - $post_taxonomy = $post_type . 'category'; |
|
| 1106 | + $post_taxonomy = $post_type.'category'; |
|
| 1107 | 1107 | } |
| 1108 | 1108 | //{
|
| 1109 | 1109 | $post_type_info = get_post_type_object($post_type); |
@@ -1111,7 +1111,7 @@ discard block |
||
| 1111 | 1111 | |
| 1112 | 1112 | if (!empty($post->post_tags)) {
|
| 1113 | 1113 | |
| 1114 | - if (taxonomy_exists($post_type . '_tags')): |
|
| 1114 | + if (taxonomy_exists($post_type.'_tags')): |
|
| 1115 | 1115 | $links = array(); |
| 1116 | 1116 | $terms = array(); |
| 1117 | 1117 | // to limit post tags |
@@ -1137,8 +1137,8 @@ discard block |
||
| 1137 | 1137 | $post_term = trim($post_term); |
| 1138 | 1138 | |
| 1139 | 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');
|
|
| 1140 | + if ($insert_term = term_exists($post_term, $post_type.'_tags')) {
|
|
| 1141 | + $term = get_term_by('name', $post_term, $post_type.'_tags');
|
|
| 1142 | 1142 | } else {
|
| 1143 | 1143 | $post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL; |
| 1144 | 1144 | $post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL; |
@@ -1148,10 +1148,10 @@ discard block |
||
| 1148 | 1148 | $match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false; |
| 1149 | 1149 | if ($match_country || $match_region || $match_city) {
|
| 1150 | 1150 | $priority_location = true; |
| 1151 | - $term = get_term_by('name', $post_term, $post_type . '_tags');
|
|
| 1151 | + $term = get_term_by('name', $post_term, $post_type.'_tags');
|
|
| 1152 | 1152 | } else {
|
| 1153 | - $insert_term = wp_insert_term($post_term, $post_type . '_tags'); |
|
| 1154 | - $term = get_term_by('name', $post_term, $post_type . '_tags');
|
|
| 1153 | + $insert_term = wp_insert_term($post_term, $post_type.'_tags'); |
|
| 1154 | + $term = get_term_by('name', $post_term, $post_type.'_tags');
|
|
| 1155 | 1155 | } |
| 1156 | 1156 | } |
| 1157 | 1157 | |
@@ -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 | - $tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>"; |
|
| 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 Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
|
|
| 1186 | + $taxonomies[$post_type.'_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object) $terms);
|
|
| 1187 | 1187 | endif; |
| 1188 | 1188 | |
| 1189 | 1189 | } |
@@ -1211,7 +1211,7 @@ discard block |
||
| 1211 | 1211 | $term = get_term_by('id', $post_term, $post_taxonomy);
|
| 1212 | 1212 | |
| 1213 | 1213 | if (is_object($term)) {
|
| 1214 | - $term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>"; |
|
| 1214 | + $term_link = "<a href='".esc_attr(get_term_link($term, $post_taxonomy))."'>$term->name</a>"; |
|
| 1215 | 1215 | /** |
| 1216 | 1216 | * Filter the category name on the details page. |
| 1217 | 1217 | * |
@@ -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 Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
|
|
| 1240 | + $taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object) $terms);
|
|
| 1241 | 1241 | |
| 1242 | 1242 | } |
| 1243 | 1243 | |
@@ -1250,14 +1250,14 @@ discard block |
||
| 1250 | 1250 | * @param string $listing_label The post type label. |
| 1251 | 1251 | * @param string $listing_label The post type label with ucwords function. |
| 1252 | 1252 | */ |
| 1253 | - $taxonomies = apply_filters('geodir_details_taxonomies_output',$taxonomies,$post_type,$listing_label,geodir_ucwords($listing_label));
|
|
| 1253 | + $taxonomies = apply_filters('geodir_details_taxonomies_output', $taxonomies, $post_type, $listing_label, geodir_ucwords($listing_label));
|
|
| 1254 | 1254 | |
| 1255 | 1255 | if (isset($taxonomies[$post_taxonomy])) {
|
| 1256 | - echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>'; |
|
| 1256 | + echo '<span class="geodir-category">'.$taxonomies[$post_taxonomy].'</span>'; |
|
| 1257 | 1257 | } |
| 1258 | 1258 | |
| 1259 | - if (isset($taxonomies[$post_type . '_tags'])) |
|
| 1260 | - echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>'; |
|
| 1259 | + if (isset($taxonomies[$post_type.'_tags'])) |
|
| 1260 | + echo '<span class="geodir-tags">'.$taxonomies[$post_type.'_tags'].'</span>'; |
|
| 1261 | 1261 | |
| 1262 | 1262 | ?> |
| 1263 | 1263 | </p><?php |
@@ -1278,11 +1278,11 @@ discard block |
||
| 1278 | 1278 | * @param object $post Optional. The post object or blank. |
| 1279 | 1279 | * @package GeoDirectory |
| 1280 | 1280 | */ |
| 1281 | -function geodir_action_details_micordata($post='') |
|
| 1281 | +function geodir_action_details_micordata($post = '') |
|
| 1282 | 1282 | {
|
| 1283 | 1283 | |
| 1284 | 1284 | global $preview; |
| 1285 | - if(empty($post)){global $post;}
|
|
| 1285 | + if (empty($post)) {global $post; }
|
|
| 1286 | 1286 | if ($preview || !geodir_is_page('detail')) {
|
| 1287 | 1287 | return; |
| 1288 | 1288 | } |
@@ -1303,7 +1303,7 @@ discard block |
||
| 1303 | 1303 | "description" => $review->comment_content, |
| 1304 | 1304 | "reviewRating" => array( |
| 1305 | 1305 | "@type" => "Rating", |
| 1306 | - "bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score. |
|
| 1306 | + "bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score. |
|
| 1307 | 1307 | "ratingValue" => geodir_get_commentoverall($review->comment_ID), |
| 1308 | 1308 | "worstRating" => "1" |
| 1309 | 1309 | ) |
@@ -1331,13 +1331,13 @@ discard block |
||
| 1331 | 1331 | } |
| 1332 | 1332 | //print_r($post); |
| 1333 | 1333 | // external links |
| 1334 | - $external_links = array(); |
|
| 1334 | + $external_links = array(); |
|
| 1335 | 1335 | $external_links[] = $post->geodir_website; |
| 1336 | 1336 | $external_links[] = $post->geodir_twitter; |
| 1337 | 1337 | $external_links[] = $post->geodir_facebook; |
| 1338 | 1338 | $external_links = array_filter($external_links); |
| 1339 | 1339 | |
| 1340 | - if(!empty($external_links)){
|
|
| 1340 | + if (!empty($external_links)) {
|
|
| 1341 | 1341 | $external_links = array_values($external_links); |
| 1342 | 1342 | } |
| 1343 | 1343 | |
@@ -1347,16 +1347,16 @@ discard block |
||
| 1347 | 1347 | |
| 1348 | 1348 | // schema type |
| 1349 | 1349 | $schema_type = 'LocalBusiness'; |
| 1350 | - if(isset($post->default_category) && $post->default_category){
|
|
| 1350 | + if (isset($post->default_category) && $post->default_category) {
|
|
| 1351 | 1351 | $schema_type = get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type); |
| 1352 | - if(!$schema_type && $post->post_type=='gd_event'){$schema_type = 'Event';}
|
|
| 1352 | + if (!$schema_type && $post->post_type == 'gd_event') {$schema_type = 'Event'; }
|
|
| 1353 | 1353 | } |
| 1354 | 1354 | |
| 1355 | 1355 | $schema = array(); |
| 1356 | 1356 | $schema['@context'] = "http://schema.org"; |
| 1357 | 1357 | $schema['@type'] = $schema_type; |
| 1358 | 1358 | $schema['name'] = $post->post_name; |
| 1359 | - $schema['description'] = wp_strip_all_tags( $post->post_content, true ); |
|
| 1359 | + $schema['description'] = wp_strip_all_tags($post->post_content, true); |
|
| 1360 | 1360 | $schema['telephone'] = $post->geodir_contact; |
| 1361 | 1361 | $schema['url'] = $c_url; |
| 1362 | 1362 | $schema['sameAs'] = $external_links; |
@@ -1370,7 +1370,7 @@ discard block |
||
| 1370 | 1370 | "postalCode" => $post->post_zip |
| 1371 | 1371 | ); |
| 1372 | 1372 | |
| 1373 | - if($post->post_latitude && $post->post_longitude) {
|
|
| 1373 | + if ($post->post_latitude && $post->post_longitude) {
|
|
| 1374 | 1374 | $schema['geo'] = array( |
| 1375 | 1375 | "@type" => "GeoCoordinates", |
| 1376 | 1376 | "latitude" => $post->post_latitude, |
@@ -1378,7 +1378,7 @@ discard block |
||
| 1378 | 1378 | ); |
| 1379 | 1379 | } |
| 1380 | 1380 | |
| 1381 | - if($post_avgratings) {
|
|
| 1381 | + if ($post_avgratings) {
|
|
| 1382 | 1382 | $schema['aggregateRating'] = array( |
| 1383 | 1383 | "@type" => "AggregateRating", |
| 1384 | 1384 | "ratingValue" => $post_avgratings, |
@@ -1397,10 +1397,10 @@ discard block |
||
| 1397 | 1397 | * @param array $schema The array of schema data to be filtered. |
| 1398 | 1398 | * @param object $post The post object. |
| 1399 | 1399 | */ |
| 1400 | - $schema = apply_filters('geodir_details_schema', $schema,$post);
|
|
| 1400 | + $schema = apply_filters('geodir_details_schema', $schema, $post);
|
|
| 1401 | 1401 | |
| 1402 | 1402 | |
| 1403 | - echo '<script type="application/ld+json">' . json_encode($schema) . '</script>'; |
|
| 1403 | + echo '<script type="application/ld+json">'.json_encode($schema).'</script>'; |
|
| 1404 | 1404 | |
| 1405 | 1405 | } |
| 1406 | 1406 | |
@@ -1421,9 +1421,9 @@ discard block |
||
| 1421 | 1421 | ?> |
| 1422 | 1422 | <div class="geodir-pos_navigation clearfix"> |
| 1423 | 1423 | <div |
| 1424 | - class="geodir-post_left"><?php previous_post_link('%link', '' . __('Previous', 'geodirectory'), false) ?></div>
|
|
| 1424 | + class="geodir-post_left"><?php previous_post_link('%link', ''.__('Previous', 'geodirectory'), false) ?></div>
|
|
| 1425 | 1425 | <div |
| 1426 | - class="geodir-post_right"><?php next_post_link('%link', __('Next', 'geodirectory') . '', false) ?></div>
|
|
| 1426 | + class="geodir-post_right"><?php next_post_link('%link', __('Next', 'geodirectory').'', false) ?></div>
|
|
| 1427 | 1427 | </div><?php |
| 1428 | 1428 | } |
| 1429 | 1429 | |
@@ -1492,12 +1492,12 @@ discard block |
||
| 1492 | 1492 | $gd_post_type = geodir_get_current_posttype(); |
| 1493 | 1493 | $post_type_info = get_post_type_object($gd_post_type); |
| 1494 | 1494 | |
| 1495 | - $add_string_in_title = __('All', 'geodirectory') . ' ';
|
|
| 1495 | + $add_string_in_title = __('All', 'geodirectory').' ';
|
|
| 1496 | 1496 | if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
|
| 1497 | - $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
|
|
| 1497 | + $add_string_in_title = __('My Favorite', 'geodirectory').' ';
|
|
| 1498 | 1498 | } |
| 1499 | 1499 | |
| 1500 | - $list_title = $add_string_in_title . __(ucfirst($post_type_info->labels->name), 'geodirectory'); |
|
| 1500 | + $list_title = $add_string_in_title.__(ucfirst($post_type_info->labels->name), 'geodirectory'); |
|
| 1501 | 1501 | $single_name = $post_type_info->labels->singular_name; |
| 1502 | 1502 | |
| 1503 | 1503 | $taxonomy = geodir_get_taxonomies($gd_post_type, true); |
@@ -1525,12 +1525,12 @@ discard block |
||
| 1525 | 1525 | $current_term = get_term_by('slug', $term, $taxonomy[0]);
|
| 1526 | 1526 | if (!empty($current_term)) {
|
| 1527 | 1527 | $current_term_name = __(ucfirst($current_term->name), 'geodirectory'); |
| 1528 | - if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
|
|
| 1528 | + if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type.'category') {
|
|
| 1529 | 1529 | $location_last_char = substr($location_name, -1); |
| 1530 | 1530 | $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
|
| 1531 | - $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
|
|
| 1531 | + $list_title .= __(' in', 'geodirectory').' '.$location_name.$location_name_attach.' '.$current_term_name;
|
|
| 1532 | 1532 | } else {
|
| 1533 | - $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
|
|
| 1533 | + $list_title .= __(' in', 'geodirectory')." '".$current_term_name."'";
|
|
| 1534 | 1534 | } |
| 1535 | 1535 | } else {
|
| 1536 | 1536 | if (count($taxonomy) > 1) {
|
@@ -1538,12 +1538,12 @@ discard block |
||
| 1538 | 1538 | |
| 1539 | 1539 | if (!empty($current_term)) {
|
| 1540 | 1540 | $current_term_name = __(ucfirst($current_term->name), 'geodirectory'); |
| 1541 | - if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
|
|
| 1541 | + if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type.'category') {
|
|
| 1542 | 1542 | $location_last_char = substr($location_name, -1); |
| 1543 | 1543 | $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
|
| 1544 | - $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
|
|
| 1544 | + $list_title .= __(' in', 'geodirectory').' '.$location_name.$location_name_attach.' '.$current_term_name;
|
|
| 1545 | 1545 | } else {
|
| 1546 | - $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
|
|
| 1546 | + $list_title .= __(' in', 'geodirectory')." '".$current_term_name."'";
|
|
| 1547 | 1547 | } |
| 1548 | 1548 | } |
| 1549 | 1549 | } |
@@ -1571,7 +1571,7 @@ discard block |
||
| 1571 | 1571 | $gd_city = __(geodir_ucwords($gd_city), 'geodirectory'); |
| 1572 | 1572 | } |
| 1573 | 1573 | |
| 1574 | - $list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'";
|
|
| 1574 | + $list_title .= __(' in', 'geodirectory')." '".$gd_city."'";
|
|
| 1575 | 1575 | } else if ($gd_region != '') {
|
| 1576 | 1576 | if ($gd_region_actual != '') {
|
| 1577 | 1577 | $gd_region = $gd_region_actual; |
@@ -1581,7 +1581,7 @@ discard block |
||
| 1581 | 1581 | $gd_region = __(geodir_ucwords($gd_region), 'geodirectory'); |
| 1582 | 1582 | } |
| 1583 | 1583 | |
| 1584 | - $list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'";
|
|
| 1584 | + $list_title .= __(' in', 'geodirectory')." '".$gd_region."'";
|
|
| 1585 | 1585 | } else if ($gd_country != '') {
|
| 1586 | 1586 | if ($gd_country_actual != '') {
|
| 1587 | 1587 | $gd_country = $gd_country_actual; |
@@ -1591,12 +1591,12 @@ discard block |
||
| 1591 | 1591 | $gd_country = __(geodir_ucwords($gd_country), 'geodirectory'); |
| 1592 | 1592 | } |
| 1593 | 1593 | |
| 1594 | - $list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'";
|
|
| 1594 | + $list_title .= __(' in', 'geodirectory')." '".$gd_country."'";
|
|
| 1595 | 1595 | } |
| 1596 | 1596 | } |
| 1597 | 1597 | |
| 1598 | 1598 | if (is_search()) {
|
| 1599 | - $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
|
|
| 1599 | + $list_title = __('Search', 'geodirectory').' '.__(ucfirst($post_type_info->labels->name), 'geodirectory').__(' For :', 'geodirectory')." '".get_search_query()."'";
|
|
| 1600 | 1600 | } |
| 1601 | 1601 | /** This action is documented in geodirectory_template_actions.php */ |
| 1602 | 1602 | $class = apply_filters('geodir_page_title_class', 'entry-title fn');
|
@@ -1605,26 +1605,26 @@ discard block |
||
| 1605 | 1605 | |
| 1606 | 1606 | |
| 1607 | 1607 | $title = $list_title; |
| 1608 | - if(geodir_is_page('pt')){
|
|
| 1608 | + if (geodir_is_page('pt')) {
|
|
| 1609 | 1609 | $gd_page = 'pt'; |
| 1610 | - $title = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
|
|
| 1610 | + $title = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
|
|
| 1611 | 1611 | } |
| 1612 | - elseif(geodir_is_page('listing')){
|
|
| 1612 | + elseif (geodir_is_page('listing')) {
|
|
| 1613 | 1613 | $gd_page = 'listing'; |
| 1614 | 1614 | global $wp_query; |
| 1615 | 1615 | $current_term = $wp_query->get_queried_object(); |
| 1616 | - if (strpos($current_term->taxonomy,'_tags') !== false) {
|
|
| 1616 | + if (strpos($current_term->taxonomy, '_tags') !== false) {
|
|
| 1617 | 1617 | $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
|
| 1618 | - }else{
|
|
| 1618 | + } else {
|
|
| 1619 | 1619 | $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
|
| 1620 | 1620 | } |
| 1621 | 1621 | |
| 1622 | 1622 | } |
| 1623 | - elseif(geodir_is_page('author')){
|
|
| 1623 | + elseif (geodir_is_page('author')) {
|
|
| 1624 | 1624 | $gd_page = 'author'; |
| 1625 | - if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
|
|
| 1625 | + if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
|
|
| 1626 | 1626 | $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
|
| 1627 | - }else{
|
|
| 1627 | + } else {
|
|
| 1628 | 1628 | $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
|
| 1629 | 1629 | } |
| 1630 | 1630 | |
@@ -1638,16 +1638,16 @@ discard block |
||
| 1638 | 1638 | * @param string $title The page title including variables. |
| 1639 | 1639 | * @param string $gd_page The GeoDirectory page type if any. |
| 1640 | 1640 | */ |
| 1641 | - $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 1641 | + $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 1642 | 1642 | |
| 1643 | - echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
|
| 1643 | + echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'. |
|
| 1644 | 1644 | /** |
| 1645 | 1645 | * Filter the listing page title. |
| 1646 | 1646 | * |
| 1647 | 1647 | * @since 1.0.0 |
| 1648 | 1648 | * @param string $list_title The title for the category page. |
| 1649 | 1649 | */ |
| 1650 | - apply_filters('geodir_listing_page_title', $title) . '</h1></header>';
|
|
| 1650 | + apply_filters('geodir_listing_page_title', $title).'</h1></header>';
|
|
| 1651 | 1651 | } |
| 1652 | 1652 | |
| 1653 | 1653 | add_action('geodir_listings_page_description', 'geodir_action_listings_description', 10);
|
@@ -1666,7 +1666,7 @@ discard block |
||
| 1666 | 1666 | $gd_post_type = geodir_get_current_posttype(); |
| 1667 | 1667 | if (isset($current_term->term_id) && $current_term->term_id != '') {
|
| 1668 | 1668 | |
| 1669 | - $term_desc = term_description($current_term->term_id, $gd_post_type . '_tags'); |
|
| 1669 | + $term_desc = term_description($current_term->term_id, $gd_post_type.'_tags'); |
|
| 1670 | 1670 | $saved_data = stripslashes(get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type)); |
| 1671 | 1671 | if ($term_desc && !$saved_data) {
|
| 1672 | 1672 | $saved_data = $term_desc; |
@@ -1683,7 +1683,7 @@ discard block |
||
| 1683 | 1683 | if ($cat_description) {
|
| 1684 | 1684 | ?> |
| 1685 | 1685 | |
| 1686 | - <div class="term_description"><?php echo $cat_description;?></div> <?php |
|
| 1686 | + <div class="term_description"><?php echo $cat_description; ?></div> <?php |
|
| 1687 | 1687 | } |
| 1688 | 1688 | |
| 1689 | 1689 | } |
@@ -1733,13 +1733,13 @@ discard block |
||
| 1733 | 1733 | function geodir_action_sidebar_left_open($type = '', $id = '', $class = '', $itemtype = '') |
| 1734 | 1734 | {
|
| 1735 | 1735 | if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
|
| 1736 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 1736 | + $width_css = 'style="width:'.$width.'%;"'; |
|
| 1737 | 1737 | } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
|
| 1738 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 1738 | + $width_css = 'style="width:'.$width.'%;"'; |
|
| 1739 | 1739 | } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
|
| 1740 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 1740 | + $width_css = 'style="width:'.$width.'%;"'; |
|
| 1741 | 1741 | } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
|
| 1742 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 1742 | + $width_css = 'style="width:'.$width.'%;"'; |
|
| 1743 | 1743 | } else {
|
| 1744 | 1744 | $width_css = ''; |
| 1745 | 1745 | } |
@@ -2044,11 +2044,11 @@ discard block |
||
| 2044 | 2044 | |
| 2045 | 2045 | $title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
|
| 2046 | 2046 | |
| 2047 | - if(geodir_is_page('add-listing')){
|
|
| 2047 | + if (geodir_is_page('add-listing')) {
|
|
| 2048 | 2048 | $gd_page = 'add-listing'; |
| 2049 | - if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
|
|
| 2049 | + if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 2050 | 2050 | $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
|
| 2051 | - }elseif(isset($listing_type)){
|
|
| 2051 | + }elseif (isset($listing_type)) {
|
|
| 2052 | 2052 | $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
|
| 2053 | 2053 | } |
| 2054 | 2054 | |
@@ -2062,9 +2062,9 @@ discard block |
||
| 2062 | 2062 | * @param string $title The page title including variables. |
| 2063 | 2063 | * @param string $gd_page The GeoDirectory page type if any. |
| 2064 | 2064 | */ |
| 2065 | - $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 2065 | + $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 2066 | 2066 | |
| 2067 | - echo '<header class="' . $class_header . '"><h1 class="' . $class . '">'; |
|
| 2067 | + echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'; |
|
| 2068 | 2068 | echo $title; |
| 2069 | 2069 | echo '</h1></header>'; |
| 2070 | 2070 | } |
@@ -2078,7 +2078,7 @@ discard block |
||
| 2078 | 2078 | */ |
| 2079 | 2079 | function geodir_action_add_listing_page_mandatory() |
| 2080 | 2080 | {?>
|
| 2081 | - <p class="geodir-note "><span class="geodir-required">*</span> <?php echo INDICATES_MANDATORY_FIELDS_TEXT;?></p> |
|
| 2081 | + <p class="geodir-note "><span class="geodir-required">*</span> <?php echo INDICATES_MANDATORY_FIELDS_TEXT; ?></p> |
|
| 2082 | 2082 | <?php |
| 2083 | 2083 | } |
| 2084 | 2084 | |
@@ -2113,7 +2113,7 @@ discard block |
||
| 2113 | 2113 | |
| 2114 | 2114 | if (isset($_REQUEST['backandedit'])) {
|
| 2115 | 2115 | global $post; |
| 2116 | - $post = (object)$gd_session->get('listing');
|
|
| 2116 | + $post = (object) $gd_session->get('listing');
|
|
| 2117 | 2117 | $listing_type = $post->listing_type; |
| 2118 | 2118 | $title = $post->post_title; |
| 2119 | 2119 | $desc = $post->post_desc; |
@@ -2128,7 +2128,7 @@ discard block |
||
| 2128 | 2128 | $thumb_img_arr = geodir_get_images($post->ID); |
| 2129 | 2129 | if ($thumb_img_arr) {
|
| 2130 | 2130 | foreach ($thumb_img_arr as $post_img) {
|
| 2131 | - $curImages .= $post_img->src . ','; |
|
| 2131 | + $curImages .= $post_img->src.','; |
|
| 2132 | 2132 | } |
| 2133 | 2133 | } |
| 2134 | 2134 | |
@@ -2136,7 +2136,7 @@ discard block |
||
| 2136 | 2136 | $title = $post->post_title; |
| 2137 | 2137 | $desc = $post->post_content; |
| 2138 | 2138 | $kw_tags = $post->post_tags; |
| 2139 | - $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
|
|
| 2139 | + $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type.'_tags', array('fields' => 'names')));
|
|
| 2140 | 2140 | } else {
|
| 2141 | 2141 | $listing_type = sanitize_text_field($_REQUEST['listing_type']); |
| 2142 | 2142 | } |
@@ -2145,15 +2145,15 @@ discard block |
||
| 2145 | 2145 | $user_login = true; |
| 2146 | 2146 | } |
| 2147 | 2147 | ?> |
| 2148 | - <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id());?>" method="post" enctype="multipart/form-data"> |
|
| 2149 | - <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type);?>"/> |
|
| 2150 | - <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type);?>"/> |
|
| 2148 | + <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id()); ?>" method="post" enctype="multipart/form-data"> |
|
| 2149 | + <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type); ?>"/> |
|
| 2150 | + <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type); ?>"/> |
|
| 2151 | 2151 | <?php if ($page_id) { ?>
|
| 2152 | - <input type="hidden" name="add_listing_page_id" value="<?php echo $page_id;?>"/> |
|
| 2152 | + <input type="hidden" name="add_listing_page_id" value="<?php echo $page_id; ?>"/> |
|
| 2153 | 2153 | <?php } if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { ?>
|
| 2154 | - <input type="hidden" name="pid" value="<?php echo sanitize_text_field($_REQUEST['pid']);?>"/> |
|
| 2154 | + <input type="hidden" name="pid" value="<?php echo sanitize_text_field($_REQUEST['pid']); ?>"/> |
|
| 2155 | 2155 | <?php } if (isset($_REQUEST['backandedit'])) { ?>
|
| 2156 | - <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']);?>"/> |
|
| 2156 | + <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']); ?>"/> |
|
| 2157 | 2157 | <?php |
| 2158 | 2158 | } |
| 2159 | 2159 | /** |
@@ -2165,7 +2165,7 @@ discard block |
||
| 2165 | 2165 | */ |
| 2166 | 2166 | do_action('geodir_before_detail_fields');
|
| 2167 | 2167 | ?> |
| 2168 | - <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT;?></h5> |
|
| 2168 | + <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT; ?></h5> |
|
| 2169 | 2169 | <?php |
| 2170 | 2170 | /** |
| 2171 | 2171 | * Called at the top of the add listing page form for frontend. |
@@ -2177,10 +2177,10 @@ discard block |
||
| 2177 | 2177 | do_action('geodir_before_main_form_fields');
|
| 2178 | 2178 | ?> |
| 2179 | 2179 | <div id="geodir_post_title_row" class="required_field geodir_form_row clearfix gd-fieldset-details"> |
| 2180 | - <label><?php echo PLACE_TITLE_TEXT;?><span>*</span> </label> |
|
| 2180 | + <label><?php echo PLACE_TITLE_TEXT; ?><span>*</span> </label> |
|
| 2181 | 2181 | <input type="text" field_type="text" name="post_title" id="post_title" class="geodir_textfield" |
| 2182 | 2182 | value="<?php echo esc_attr(stripslashes($title)); ?>"/> |
| 2183 | - <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory');?></span> |
|
| 2183 | + <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span> |
|
| 2184 | 2184 | </div> |
| 2185 | 2185 | <?php |
| 2186 | 2186 | $show_editor = get_option('geodir_tiny_editor_on_add_listing');
|
@@ -2215,7 +2215,7 @@ discard block |
||
| 2215 | 2215 | $desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
|
| 2216 | 2216 | |
| 2217 | 2217 | $desc_class = ''; |
| 2218 | - if ($desc_limit === '' || (int)$desc_limit > 0) {
|
|
| 2218 | + if ($desc_limit === '' || (int) $desc_limit > 0) {
|
|
| 2219 | 2219 | /** |
| 2220 | 2220 | * Called on the add listing page form for frontend just before the description field. |
| 2221 | 2221 | * |
@@ -2228,8 +2228,8 @@ discard block |
||
| 2228 | 2228 | $desc_class = ' hidden'; |
| 2229 | 2229 | } |
| 2230 | 2230 | ?> |
| 2231 | - <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class;?>"> |
|
| 2232 | - <label><?php echo PLACE_DESC_TEXT;?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
|
|
| 2231 | + <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class; ?>"> |
|
| 2232 | + <label><?php echo PLACE_DESC_TEXT; ?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
|
|
| 2233 | 2233 | <?php |
| 2234 | 2234 | if (!empty($show_editor) && in_array($listing_type, $show_editor)) {
|
| 2235 | 2235 | $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
|
@@ -2238,16 +2238,16 @@ discard block |
||
| 2238 | 2238 | <?php wp_editor($desc, "post_desc", $editor_settings); ?> |
| 2239 | 2239 | </div> |
| 2240 | 2240 | <?php if ($desc_limit != '') { ?>
|
| 2241 | - <script type="text/javascript">jQuery('textarea#post_desc').attr('maxlength', "<?php echo $desc_limit;?>");</script>
|
|
| 2241 | + <script type="text/javascript">jQuery('textarea#post_desc').attr('maxlength', "<?php echo $desc_limit; ?>");</script>
|
|
| 2242 | 2242 | <?php } } else { ?>
|
| 2243 | 2243 | <textarea field_type="textarea" name="post_desc" id="post_desc" class="geodir_textarea" maxlength="<?php echo $desc_limit; ?>"><?php echo $desc; ?></textarea> |
| 2244 | 2244 | <?php } if ($desc_limit_msg != '') { ?>
|
| 2245 | 2245 | <span class="geodir_message_note"><?php echo $desc_limit_msg; ?></span> |
| 2246 | 2246 | <?php } ?> |
| 2247 | - <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory');?></span> |
|
| 2247 | + <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory'); ?></span> |
|
| 2248 | 2248 | </div> |
| 2249 | 2249 | <?php |
| 2250 | - if ($desc_limit === '' || (int)$desc_limit > 0) {
|
|
| 2250 | + if ($desc_limit === '' || (int) $desc_limit > 0) {
|
|
| 2251 | 2251 | /** |
| 2252 | 2252 | * Called on the add listing page form for frontend just after the description field. |
| 2253 | 2253 | * |
@@ -2286,7 +2286,7 @@ discard block |
||
| 2286 | 2286 | $kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
|
| 2287 | 2287 | |
| 2288 | 2288 | $tags_class = ''; |
| 2289 | - if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
|
|
| 2289 | + if ($kw_tags_count === '' || (int) $kw_tags_count > 0) {
|
|
| 2290 | 2290 | /** |
| 2291 | 2291 | * Called on the add listing page form for frontend just before the tags field. |
| 2292 | 2292 | * |
@@ -2297,14 +2297,14 @@ discard block |
||
| 2297 | 2297 | $tags_class = ' hidden'; |
| 2298 | 2298 | } |
| 2299 | 2299 | ?> |
| 2300 | - <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class;?>"> |
|
| 2300 | + <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class; ?>"> |
|
| 2301 | 2301 | <label><?php echo TAGKW_TEXT; ?></label> |
| 2302 | 2302 | <input name="post_tags" id="post_tags" value="<?php echo $kw_tags; ?>" type="text" class="geodir_textfield" |
| 2303 | - maxlength="<?php echo $kw_tags_count;?>"/> |
|
| 2304 | - <span class="geodir_message_note"><?php echo $kw_tags_msg;?></span> |
|
| 2303 | + maxlength="<?php echo $kw_tags_count; ?>"/> |
|
| 2304 | + <span class="geodir_message_note"><?php echo $kw_tags_msg; ?></span> |
|
| 2305 | 2305 | </div> |
| 2306 | 2306 | <?php |
| 2307 | - if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
|
|
| 2307 | + if ($kw_tags_count === '' || (int) $kw_tags_count > 0) {
|
|
| 2308 | 2308 | /** |
| 2309 | 2309 | * Called on the add listing page form for frontend just after the tags field. |
| 2310 | 2310 | * |
@@ -2330,7 +2330,7 @@ discard block |
||
| 2330 | 2330 | $thumb_img_arr = array(); |
| 2331 | 2331 | $totImg = 0; |
| 2332 | 2332 | if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
|
| 2333 | - $post = (object)$gd_session->get('listing');
|
|
| 2333 | + $post = (object) $gd_session->get('listing');
|
|
| 2334 | 2334 | if (isset($post->post_images)) |
| 2335 | 2335 | $curImages = trim($post->post_images, ","); |
| 2336 | 2336 | |
@@ -2343,7 +2343,7 @@ discard block |
||
| 2343 | 2343 | $listing_type = $post->listing_type; |
| 2344 | 2344 | |
| 2345 | 2345 | } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
| 2346 | - $post = geodir_get_post_info((int)$_REQUEST['pid']); |
|
| 2346 | + $post = geodir_get_post_info((int) $_REQUEST['pid']); |
|
| 2347 | 2347 | $listing_type = $post->post_type; |
| 2348 | 2348 | $thumb_img_arr = geodir_get_images($_REQUEST['pid']); |
| 2349 | 2349 | |
@@ -2357,7 +2357,7 @@ discard block |
||
| 2357 | 2357 | //$curImages = $img->src.","; |
| 2358 | 2358 | } |
| 2359 | 2359 | |
| 2360 | - $totImg = count((array)$thumb_img_arr); |
|
| 2360 | + $totImg = count((array) $thumb_img_arr); |
|
| 2361 | 2361 | } |
| 2362 | 2362 | |
| 2363 | 2363 | if ($curImages != '') |
@@ -2378,15 +2378,15 @@ discard block |
||
| 2378 | 2378 | if ($show_image_input_box) {
|
| 2379 | 2379 | ?> |
| 2380 | 2380 | |
| 2381 | - <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT;?> |
|
| 2381 | + <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT; ?> |
|
| 2382 | 2382 | <?php if ($image_limit == 1) {
|
| 2383 | - echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
|
|
| 2383 | + echo '<br /><small>('.__('You can upload', 'geodirectory').' '.$image_limit.' '.__('image with this package', 'geodirectory').')</small>';
|
|
| 2384 | 2384 | } ?> |
| 2385 | 2385 | <?php if ($image_limit > 1) {
|
| 2386 | - echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
|
|
| 2386 | + echo '<br /><small>('.__('You can upload', 'geodirectory').' '.$image_limit.' '.__('images with this package', 'geodirectory').')</small>';
|
|
| 2387 | 2387 | } ?> |
| 2388 | 2388 | <?php if ($image_limit == '') {
|
| 2389 | - echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
|
|
| 2389 | + echo '<br /><small>('.__('You can upload unlimited images with this package', 'geodirectory').')</small>';
|
|
| 2390 | 2390 | } ?> |
| 2391 | 2391 | </h5> |
| 2392 | 2392 | |
@@ -2401,11 +2401,11 @@ discard block |
||
| 2401 | 2401 | <div |
| 2402 | 2402 | class="plupload-upload-uic hide-if-no-js <?php if ($multiple): ?>plupload-upload-uic-multiple<?php endif; ?>" |
| 2403 | 2403 | id="<?php echo $id; ?>plupload-upload-ui"> |
| 2404 | - <h4><?php _e('Drop files to upload', 'geodirectory');?></h4><br/>
|
|
| 2404 | + <h4><?php _e('Drop files to upload', 'geodirectory'); ?></h4><br/>
|
|
| 2405 | 2405 | <input id="<?php echo $id; ?>plupload-browse-button" type="button" |
| 2406 | 2406 | value="<?php esc_attr_e('Select Files', 'geodirectory'); ?>" class="geodir_button"/>
|
| 2407 | 2407 | <span class="ajaxnonceplu" |
| 2408 | - id="ajaxnonceplu<?php echo wp_create_nonce($id . 'pluploadan'); ?>"></span> |
|
| 2408 | + id="ajaxnonceplu<?php echo wp_create_nonce($id.'pluploadan'); ?>"></span> |
|
| 2409 | 2409 | <?php if ($width && $height): ?> |
| 2410 | 2410 | <span class="plupload-resize"></span> |
| 2411 | 2411 | <span class="plupload-width" id="plupload-width<?php echo $width; ?>"></span> |
@@ -2418,7 +2418,7 @@ discard block |
||
| 2418 | 2418 | id="<?php echo $id; ?>plupload-thumbs" style="border-top:1px solid #ccc; padding-top:10px;"> |
| 2419 | 2419 | </div> |
| 2420 | 2420 | <span |
| 2421 | - id="upload-msg"><?php _e('Please drag & drop the images to rearrange the order', 'geodirectory');?></span>
|
|
| 2421 | + id="upload-msg"><?php _e('Please drag & drop the images to rearrange the order', 'geodirectory'); ?></span>
|
|
| 2422 | 2422 | <span id="<?php echo $id; ?>upload-error" style="display:none"></span> |
| 2423 | 2423 | </div> |
| 2424 | 2424 | |
@@ -2430,7 +2430,7 @@ discard block |
||
| 2430 | 2430 | * |
| 2431 | 2431 | * @since 1.0.0 |
| 2432 | 2432 | */ |
| 2433 | - do_action('geodir_after_main_form_fields');?>
|
|
| 2433 | + do_action('geodir_after_main_form_fields'); ?>
|
|
| 2434 | 2434 | |
| 2435 | 2435 | |
| 2436 | 2436 | <!-- add captcha code --> |
@@ -2441,7 +2441,7 @@ discard block |
||
| 2441 | 2441 | </script> |
| 2442 | 2442 | <noscript> |
| 2443 | 2443 | <div> |
| 2444 | - <label><?php _e('Type 64 into this box', 'geodirectory');?></label>
|
|
| 2444 | + <label><?php _e('Type 64 into this box', 'geodirectory'); ?></label>
|
|
| 2445 | 2445 | <input type="text" id="geodir_spamblocker_top_form" name="geodir_spamblocker" value="" maxlength="10"/> |
| 2446 | 2446 | </div> |
| 2447 | 2447 | </noscript> |
@@ -2451,10 +2451,10 @@ discard block |
||
| 2451 | 2451 | <!-- end captcha code --> |
| 2452 | 2452 | |
| 2453 | 2453 | <div id="geodir-add-listing-submit" class="geodir_form_row clear_both" style="padding:2px;text-align:center;"> |
| 2454 | - <input type="submit" value="<?php echo PRO_PREVIEW_BUTTON;?>" |
|
| 2455 | - class="geodir_button" <?php echo $submit_button;?>/> |
|
| 2454 | + <input type="submit" value="<?php echo PRO_PREVIEW_BUTTON; ?>" |
|
| 2455 | + class="geodir_button" <?php echo $submit_button; ?>/> |
|
| 2456 | 2456 | <span class="geodir_message_note" |
| 2457 | - style="padding-left:0px;"> <?php _e('Note: You will be able to see a preview in the next page', 'geodirectory');?></span>
|
|
| 2457 | + style="padding-left:0px;"> <?php _e('Note: You will be able to see a preview in the next page', 'geodirectory'); ?></span>
|
|
| 2458 | 2458 | </div> |
| 2459 | 2459 | |
| 2460 | 2460 | </form> |
@@ -2516,7 +2516,7 @@ discard block |
||
| 2516 | 2516 | class="<?php |
| 2517 | 2517 | /** This action is documented in geodirectory_template_actions.php */ |
| 2518 | 2518 | echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
|
| 2519 | - <?php dynamic_sidebar('Reg/Login Top Section');?>
|
|
| 2519 | + <?php dynamic_sidebar('Reg/Login Top Section'); ?>
|
|
| 2520 | 2520 | </div><!-- clearfix ends here--> |
| 2521 | 2521 | <?php |
| 2522 | 2522 | } |
@@ -2538,7 +2538,7 @@ discard block |
||
| 2538 | 2538 | |
| 2539 | 2539 | ?> |
| 2540 | 2540 | <script type="text/javascript"> |
| 2541 | - <?php if ( $user_login ) { ?>
|
|
| 2541 | + <?php if ($user_login) { ?>
|
|
| 2542 | 2542 | setTimeout(function () {
|
| 2543 | 2543 | try {
|
| 2544 | 2544 | d = document.getElementById('user_pass');
|
@@ -2555,7 +2555,7 @@ discard block |
||
| 2555 | 2555 | <?php } ?> |
| 2556 | 2556 | </script> |
| 2557 | 2557 | <script type="text/javascript"> |
| 2558 | - <?php if ( $user_login ) { ?>
|
|
| 2558 | + <?php if ($user_login) { ?>
|
|
| 2559 | 2559 | setTimeout(function () {
|
| 2560 | 2560 | try {
|
| 2561 | 2561 | d = document.getElementById('user_pass');
|
@@ -2580,7 +2580,7 @@ discard block |
||
| 2580 | 2580 | foreach ($errors as $errorsObj) {
|
| 2581 | 2581 | foreach ($errorsObj as $key => $val) {
|
| 2582 | 2582 | for ($i = 0; $i < count($val); $i++) {
|
| 2583 | - echo "<div class=sucess_msg>" . $val[$i] . '</div>'; |
|
| 2583 | + echo "<div class=sucess_msg>".$val[$i].'</div>'; |
|
| 2584 | 2584 | $registration_error_msg = 1; |
| 2585 | 2585 | } |
| 2586 | 2586 | } |
@@ -2597,7 +2597,7 @@ discard block |
||
| 2597 | 2597 | * |
| 2598 | 2598 | * @since 1.0.0 |
| 2599 | 2599 | */ |
| 2600 | - include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?> |
|
| 2600 | + include(geodir_plugin_path()."/geodirectory-templates/login_frm.php"); ?> |
|
| 2601 | 2601 | </div> |
| 2602 | 2602 | |
| 2603 | 2603 | <?php } elseif (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_up') { ?>
|
@@ -2609,7 +2609,7 @@ discard block |
||
| 2609 | 2609 | * |
| 2610 | 2610 | * @since 1.0.0 |
| 2611 | 2611 | */ |
| 2612 | - include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?> |
|
| 2612 | + include(geodir_plugin_path()."/geodirectory-templates/reg_frm.php"); ?> |
|
| 2613 | 2613 | </div> |
| 2614 | 2614 | |
| 2615 | 2615 | <?php } else { ?>
|
@@ -2621,7 +2621,7 @@ discard block |
||
| 2621 | 2621 | * |
| 2622 | 2622 | * @since 1.0.0 |
| 2623 | 2623 | */ |
| 2624 | - include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?> |
|
| 2624 | + include(geodir_plugin_path()."/geodirectory-templates/login_frm.php"); ?> |
|
| 2625 | 2625 | </div> |
| 2626 | 2626 | <div class="registration_form_r"> |
| 2627 | 2627 | <?php |
@@ -2630,7 +2630,7 @@ discard block |
||
| 2630 | 2630 | * |
| 2631 | 2631 | * @since 1.0.0 |
| 2632 | 2632 | */ |
| 2633 | - include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?> |
|
| 2633 | + include(geodir_plugin_path()."/geodirectory-templates/reg_frm.php"); ?> |
|
| 2634 | 2634 | </div> |
| 2635 | 2635 | |
| 2636 | 2636 | <?php }?> |
@@ -2666,12 +2666,12 @@ discard block |
||
| 2666 | 2666 | $gd_post_type = geodir_get_current_posttype(); |
| 2667 | 2667 | $post_type_info = get_post_type_object($gd_post_type); |
| 2668 | 2668 | |
| 2669 | - $add_string_in_title = __('All', 'geodirectory') . ' ';
|
|
| 2669 | + $add_string_in_title = __('All', 'geodirectory').' ';
|
|
| 2670 | 2670 | if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
|
| 2671 | - $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
|
|
| 2671 | + $add_string_in_title = __('My Favorite', 'geodirectory').' ';
|
|
| 2672 | 2672 | } |
| 2673 | 2673 | |
| 2674 | - $list_title = $add_string_in_title . $post_type_info->labels->name; |
|
| 2674 | + $list_title = $add_string_in_title.$post_type_info->labels->name; |
|
| 2675 | 2675 | $single_name = $post_type_info->labels->singular_name; |
| 2676 | 2676 | |
| 2677 | 2677 | $taxonomy = geodir_get_taxonomies($gd_post_type); |
@@ -2679,12 +2679,12 @@ discard block |
||
| 2679 | 2679 | if (!empty($term)) {
|
| 2680 | 2680 | $current_term = get_term_by('slug', $term, $taxonomy[0]);
|
| 2681 | 2681 | if (!empty($current_term)) |
| 2682 | - $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
|
|
| 2682 | + $list_title .= __(' in', 'geodirectory')." '".geodir_ucwords($current_term->name)."'";
|
|
| 2683 | 2683 | } |
| 2684 | 2684 | |
| 2685 | 2685 | |
| 2686 | 2686 | if (is_search()) {
|
| 2687 | - $list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
|
|
| 2687 | + $list_title = __('Search', 'geodirectory').' '.__($post_type_info->labels->name, 'geodirectory').__(' For :', 'geodirectory')." '".get_search_query()."'";
|
|
| 2688 | 2688 | |
| 2689 | 2689 | } |
| 2690 | 2690 | /** This action is documented in geodirectory_template_actions.php */ |
@@ -2693,11 +2693,11 @@ discard block |
||
| 2693 | 2693 | $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
|
| 2694 | 2694 | |
| 2695 | 2695 | $title = $list_title; |
| 2696 | - if(geodir_is_page('author')){
|
|
| 2696 | + if (geodir_is_page('author')) {
|
|
| 2697 | 2697 | $gd_page = 'author'; |
| 2698 | - if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
|
|
| 2698 | + if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
|
|
| 2699 | 2699 | $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
|
| 2700 | - }else{
|
|
| 2700 | + } else {
|
|
| 2701 | 2701 | $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
|
| 2702 | 2702 | } |
| 2703 | 2703 | |
@@ -2711,16 +2711,16 @@ discard block |
||
| 2711 | 2711 | * @param string $title The page title including variables. |
| 2712 | 2712 | * @param string $gd_page The GeoDirectory page type if any. |
| 2713 | 2713 | */ |
| 2714 | - $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 2714 | + $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 2715 | 2715 | |
| 2716 | - echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
|
| 2716 | + echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'. |
|
| 2717 | 2717 | /** |
| 2718 | 2718 | * Filter the author page title text. |
| 2719 | 2719 | * |
| 2720 | 2720 | * @since 1.0.0 |
| 2721 | 2721 | * @param string $list_title The title for the page. |
| 2722 | 2722 | */ |
| 2723 | - apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
|
|
| 2723 | + apply_filters('geodir_author_page_title_text', $title).'</h1></header>';
|
|
| 2724 | 2724 | } |
| 2725 | 2725 | |
| 2726 | 2726 | |
@@ -2925,19 +2925,19 @@ discard block |
||
| 2925 | 2925 | $post_type_info = get_post_type_object($gd_post_type); |
| 2926 | 2926 | |
| 2927 | 2927 | $pt_name = ''; |
| 2928 | - if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
|
|
| 2928 | + if (isset($post_type_info->labels->name)) {$pt_name = $post_type_info->labels->name; }
|
|
| 2929 | 2929 | |
| 2930 | 2930 | if (is_search()) {
|
| 2931 | - $list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
|
|
| 2931 | + $list_title = __('Search', 'geodirectory').' '.__($pt_name, 'geodirectory').__(' For :', 'geodirectory')." '".get_search_query()."'";
|
|
| 2932 | 2932 | |
| 2933 | 2933 | } |
| 2934 | 2934 | /** This action is documented in geodirectory_template_actions.php */ |
| 2935 | 2935 | $class = apply_filters('geodir_page_title_class', 'entry-title fn');
|
| 2936 | 2936 | /** This action is documented in geodirectory_template_actions.php */ |
| 2937 | 2937 | $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
|
| 2938 | - echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
|
| 2938 | + echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'. |
|
| 2939 | 2939 | /** This action is documented in geodirectory_template_actions.php */ |
| 2940 | - apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
|
|
| 2940 | + apply_filters('geodir_listing_page_title', wptexturize($list_title)).'</h1></header>';
|
|
| 2941 | 2941 | } |
| 2942 | 2942 | |
| 2943 | 2943 | // action for adding the listings page top widget area |
@@ -3341,7 +3341,7 @@ discard block |
||
| 3341 | 3341 | $gd_post_type = geodir_get_current_posttype(); |
| 3342 | 3342 | $post_type_info = get_post_type_object($gd_post_type); |
| 3343 | 3343 | |
| 3344 | - $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
|
|
| 3344 | + $list_title = __('Search', 'geodirectory').' '.__(ucfirst($post_type_info->labels->name), 'geodirectory').__(' :', 'geodirectory');
|
|
| 3345 | 3345 | } |
| 3346 | 3346 | return $list_title; |
| 3347 | 3347 | } |
@@ -16,7 +16,9 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | function geodir_session_start() |
| 18 | 18 | {
|
| 19 | - if (!session_id()) session_start(); |
|
| 19 | + if (!session_id()) { |
|
| 20 | + session_start(); |
|
| 21 | + } |
|
| 20 | 22 | global $geodir_add_location_url; |
| 21 | 23 | |
| 22 | 24 | $geodir_add_location_url = NULL; |
@@ -86,7 +88,9 @@ discard block |
||
| 86 | 88 | |
| 87 | 89 | if ((is_search() && isset($_REQUEST['geodir_search']) && $_REQUEST['geodir_search'] != '')): |
| 88 | 90 | |
| 89 | - if (isset($_REQUEST['scat']) && $_REQUEST['scat'] == 'all') $_REQUEST['scat'] = ''; |
|
| 91 | + if (isset($_REQUEST['scat']) && $_REQUEST['scat'] == 'all') { |
|
| 92 | + $_REQUEST['scat'] = ''; |
|
| 93 | + } |
|
| 90 | 94 | //if(isset($_REQUEST['s']) && $_REQUEST['s'] == '+') $_REQUEST['s'] = ''; |
| 91 | 95 | |
| 92 | 96 | if (isset($_REQUEST['sdist'])) {
|
@@ -198,8 +202,9 @@ discard block |
||
| 198 | 202 | add_filter('posts_fields', 'geodir_posts_fields', 1);
|
| 199 | 203 | add_filter('posts_join', 'geodir_posts_join', 1);
|
| 200 | 204 | geodir_post_where(); |
| 201 | - if (!is_admin()) |
|
| 202 | - add_filter('posts_orderby', 'geodir_posts_orderby', 1);
|
|
| 205 | + if (!is_admin()) { |
|
| 206 | + add_filter('posts_orderby', 'geodir_posts_orderby', 1); |
|
| 207 | + } |
|
| 203 | 208 | |
| 204 | 209 | // advanced filter for popular post view widget |
| 205 | 210 | global $wp_query; |
@@ -346,8 +351,9 @@ discard block |
||
| 346 | 351 | $sort_by = ''; |
| 347 | 352 | $orderby = ' '; |
| 348 | 353 | |
| 349 | - if (get_query_var('order_by'))
|
|
| 350 | - $sort_by = get_query_var('order_by');
|
|
| 354 | + if (get_query_var('order_by')) { |
|
| 355 | + $sort_by = get_query_var('order_by'); |
|
| 356 | + } |
|
| 351 | 357 | |
| 352 | 358 | /*if(isset($wp_query->tax_query->queries) && $wp_query->tax_query->queries){
|
| 353 | 359 | $current_term = $wp_query->get_queried_object(); |
@@ -367,14 +373,16 @@ discard block |
||
| 367 | 373 | $orderby .= " distance,"; |
| 368 | 374 | } |
| 369 | 375 | |
| 370 | - if (isset($_REQUEST['sort_by']) && $_REQUEST['sort_by'] != '' && is_main_query()) |
|
| 371 | - $sort_by = esc_attr($_REQUEST['sort_by']); |
|
| 376 | + if (isset($_REQUEST['sort_by']) && $_REQUEST['sort_by'] != '' && is_main_query()) { |
|
| 377 | + $sort_by = esc_attr($_REQUEST['sort_by']); |
|
| 378 | + } |
|
| 372 | 379 | |
| 373 | 380 | |
| 374 | 381 | if ($sort_by == '') {
|
| 375 | 382 | $default_sort = geodir_get_posts_default_sort($geodir_post_type); |
| 376 | - if (!empty($default_sort)) |
|
| 377 | - $sort_by = $default_sort; |
|
| 383 | + if (!empty($default_sort)) { |
|
| 384 | + $sort_by = $default_sort; |
|
| 385 | + } |
|
| 378 | 386 | } |
| 379 | 387 | |
| 380 | 388 | /* |
@@ -562,8 +570,9 @@ discard block |
||
| 562 | 570 | |
| 563 | 571 | add_filter('posts_where', 'searching_filter_where', 1);
|
| 564 | 572 | |
| 565 | - if ($snear != '') |
|
| 566 | - add_filter('posts_where', 'searching_filter_where', 1);
|
|
| 573 | + if ($snear != '') { |
|
| 574 | + add_filter('posts_where', 'searching_filter_where', 1); |
|
| 575 | + } |
|
| 567 | 576 | |
| 568 | 577 | add_filter('posts_orderby', 'geodir_posts_orderby', 1);
|
| 569 | 578 | |
@@ -731,10 +740,11 @@ discard block |
||
| 731 | 740 | } |
| 732 | 741 | |
| 733 | 742 | $better_search_terms = ''; |
| 734 | - if (isset($_REQUEST['stype'])) |
|
| 735 | - $post_types = esc_attr(wp_strip_all_tags($_REQUEST['stype'])); |
|
| 736 | - else |
|
| 737 | - $post_types = 'gd_place'; |
|
| 743 | + if (isset($_REQUEST['stype'])) { |
|
| 744 | + $post_types = esc_attr(wp_strip_all_tags($_REQUEST['stype'])); |
|
| 745 | + } else { |
|
| 746 | + $post_types = 'gd_place'; |
|
| 747 | + } |
|
| 738 | 748 | |
| 739 | 749 | if ($s != '') {
|
| 740 | 750 | $keywords = explode(" ", $s);
|
@@ -762,7 +772,7 @@ discard block |
||
| 762 | 772 | if($taxonomies) {
|
| 763 | 773 | $taxonomies = implode("','", $taxonomies);
|
| 764 | 774 | $taxonomies = "'" . $taxonomies . "'"; |
| 765 | - }else{$taxonomies='';}
|
|
| 775 | + } else{$taxonomies='';}
|
|
| 766 | 776 | |
| 767 | 777 | $content_where = $terms_where = ''; |
| 768 | 778 | if ($s != '') {
|
@@ -878,8 +888,9 @@ discard block |
||
| 878 | 888 | $user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true); |
| 879 | 889 | $user_fav_posts = !empty($user_fav_posts) && is_array($user_fav_posts) ? implode("','", $user_fav_posts) : '-1';
|
| 880 | 890 | $where .= " AND $wpdb->posts.ID IN ('$user_fav_posts')";
|
| 881 | - } else |
|
| 882 | - $where .= " AND $wpdb->posts.post_author = $user_id"; |
|
| 891 | + } else { |
|
| 892 | + $where .= " AND $wpdb->posts.post_author = $user_id"; |
|
| 893 | + } |
|
| 883 | 894 | |
| 884 | 895 | if ($user_id == (int)get_current_user_id()) {
|
| 885 | 896 | $where .= " AND $wpdb->posts.post_status IN ('publish','draft','pending') ";
|
@@ -16,10 +16,10 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | function geodir_session_start() |
| 18 | 18 | {
|
| 19 | - if (!session_id()) session_start(); |
|
| 20 | - global $geodir_add_location_url; |
|
| 19 | + if (!session_id()) session_start(); |
|
| 20 | + global $geodir_add_location_url; |
|
| 21 | 21 | |
| 22 | - $geodir_add_location_url = NULL; |
|
| 22 | + $geodir_add_location_url = NULL; |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | /** |
@@ -33,18 +33,18 @@ discard block |
||
| 33 | 33 | */ |
| 34 | 34 | function geodir_modified_query($query) |
| 35 | 35 | {
|
| 36 | - if ($query->is_main_query() && ( |
|
| 37 | - (geodir_is_page('add-listing') && isset($_REQUEST['pid']) && $_REQUEST['pid'] != '')
|
|
| 38 | - || geodir_is_page('listing')
|
|
| 39 | - || geodir_is_page('author')
|
|
| 40 | - || geodir_is_page('search')
|
|
| 41 | - || geodir_is_page('detail'))
|
|
| 42 | - ) {
|
|
| 43 | - |
|
| 44 | - $query->set('is_geodir_loop', true);
|
|
| 45 | - } |
|
| 36 | + if ($query->is_main_query() && ( |
|
| 37 | + (geodir_is_page('add-listing') && isset($_REQUEST['pid']) && $_REQUEST['pid'] != '')
|
|
| 38 | + || geodir_is_page('listing')
|
|
| 39 | + || geodir_is_page('author')
|
|
| 40 | + || geodir_is_page('search')
|
|
| 41 | + || geodir_is_page('detail'))
|
|
| 42 | + ) {
|
|
| 43 | + |
|
| 44 | + $query->set('is_geodir_loop', true);
|
|
| 45 | + } |
|
| 46 | 46 | |
| 47 | - return $query; |
|
| 47 | + return $query; |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | /** |
@@ -67,81 +67,81 @@ discard block |
||
| 67 | 67 | */ |
| 68 | 68 | function set_listing_request() |
| 69 | 69 | {
|
| 70 | - global $wp_query, $wpdb, $geodir_post_type, $table, $dist, $mylat, $mylon, $s, $snear, $s, $s_A, $s_SA; |
|
| 70 | + global $wp_query, $wpdb, $geodir_post_type, $table, $dist, $mylat, $mylon, $s, $snear, $s, $s_A, $s_SA; |
|
| 71 | 71 | |
| 72 | 72 | |
| 73 | - // fix woocommerce shop products filtered by language for GD + WPML + Woocommerce |
|
| 74 | - if (!geodir_is_geodir_page()) {
|
|
| 75 | - return; |
|
| 76 | - } |
|
| 73 | + // fix woocommerce shop products filtered by language for GD + WPML + Woocommerce |
|
| 74 | + if (!geodir_is_geodir_page()) {
|
|
| 75 | + return; |
|
| 76 | + } |
|
| 77 | 77 | |
| 78 | - /* remove all pre filters */ |
|
| 79 | - remove_all_filters('query');
|
|
| 80 | - remove_all_filters('posts_search');
|
|
| 81 | - remove_all_filters('posts_fields');
|
|
| 82 | - remove_all_filters('posts_join');
|
|
| 83 | - remove_all_filters('posts_orderby');
|
|
| 84 | - remove_all_filters('posts_where');
|
|
| 78 | + /* remove all pre filters */ |
|
| 79 | + remove_all_filters('query');
|
|
| 80 | + remove_all_filters('posts_search');
|
|
| 81 | + remove_all_filters('posts_fields');
|
|
| 82 | + remove_all_filters('posts_join');
|
|
| 83 | + remove_all_filters('posts_orderby');
|
|
| 84 | + remove_all_filters('posts_where');
|
|
| 85 | 85 | |
| 86 | 86 | |
| 87 | - if ((is_search() && isset($_REQUEST['geodir_search']) && $_REQUEST['geodir_search'] != '')): |
|
| 87 | + if ((is_search() && isset($_REQUEST['geodir_search']) && $_REQUEST['geodir_search'] != '')): |
|
| 88 | 88 | |
| 89 | - if (isset($_REQUEST['scat']) && $_REQUEST['scat'] == 'all') $_REQUEST['scat'] = ''; |
|
| 90 | - //if(isset($_REQUEST['s']) && $_REQUEST['s'] == '+') $_REQUEST['s'] = ''; |
|
| 89 | + if (isset($_REQUEST['scat']) && $_REQUEST['scat'] == 'all') $_REQUEST['scat'] = ''; |
|
| 90 | + //if(isset($_REQUEST['s']) && $_REQUEST['s'] == '+') $_REQUEST['s'] = ''; |
|
| 91 | 91 | |
| 92 | - if (isset($_REQUEST['sdist'])) {
|
|
| 93 | - ($_REQUEST['sdist'] != '0' && $_REQUEST['sdist'] != '') ? $dist = esc_attr($_REQUEST['sdist']) : $dist = 25000; |
|
| 94 | - } elseif (get_option('geodir_search_dist') != '') {
|
|
| 95 | - $dist = get_option('geodir_search_dist');
|
|
| 92 | + if (isset($_REQUEST['sdist'])) {
|
|
| 93 | + ($_REQUEST['sdist'] != '0' && $_REQUEST['sdist'] != '') ? $dist = esc_attr($_REQUEST['sdist']) : $dist = 25000; |
|
| 94 | + } elseif (get_option('geodir_search_dist') != '') {
|
|
| 95 | + $dist = get_option('geodir_search_dist');
|
|
| 96 | 96 | |
| 97 | - } else {
|
|
| 98 | - $dist = 25000; |
|
| 99 | - } // Distance |
|
| 97 | + } else {
|
|
| 98 | + $dist = 25000; |
|
| 99 | + } // Distance |
|
| 100 | 100 | |
| 101 | - if (isset($_REQUEST['sgeo_lat'])) {
|
|
| 102 | - $mylat = (float)esc_attr($_REQUEST['sgeo_lat']); |
|
| 103 | - } else {
|
|
| 104 | - $mylat = (float)geodir_get_current_city_lat(); |
|
| 105 | - } // Latatude |
|
| 101 | + if (isset($_REQUEST['sgeo_lat'])) {
|
|
| 102 | + $mylat = (float)esc_attr($_REQUEST['sgeo_lat']); |
|
| 103 | + } else {
|
|
| 104 | + $mylat = (float)geodir_get_current_city_lat(); |
|
| 105 | + } // Latatude |
|
| 106 | 106 | |
| 107 | - if (isset($_REQUEST['sgeo_lon'])) {
|
|
| 108 | - $mylon = (float)esc_attr($_REQUEST['sgeo_lon']); |
|
| 109 | - } else {
|
|
| 110 | - $mylon = (float)geodir_get_current_city_lng(); |
|
| 111 | - } // Distance |
|
| 107 | + if (isset($_REQUEST['sgeo_lon'])) {
|
|
| 108 | + $mylon = (float)esc_attr($_REQUEST['sgeo_lon']); |
|
| 109 | + } else {
|
|
| 110 | + $mylon = (float)geodir_get_current_city_lng(); |
|
| 111 | + } // Distance |
|
| 112 | 112 | |
| 113 | - if (isset($_REQUEST['snear'])) {
|
|
| 114 | - $snear = trim(esc_attr($_REQUEST['snear'])); |
|
| 115 | - } |
|
| 113 | + if (isset($_REQUEST['snear'])) {
|
|
| 114 | + $snear = trim(esc_attr($_REQUEST['snear'])); |
|
| 115 | + } |
|
| 116 | 116 | |
| 117 | - if (isset($_REQUEST['s'])) {
|
|
| 118 | - $s = trim(esc_attr(wp_strip_all_tags($_REQUEST['s']))); |
|
| 119 | - } |
|
| 117 | + if (isset($_REQUEST['s'])) {
|
|
| 118 | + $s = trim(esc_attr(wp_strip_all_tags($_REQUEST['s']))); |
|
| 119 | + } |
|
| 120 | 120 | |
| 121 | - if ($snear == 'NEAR ME') {
|
|
| 122 | - $ip = $_SERVER['REMOTE_ADDR']; |
|
| 123 | - $addr_details = unserialize(file_get_contents('http://www.geoplugin.net/php.gp?ip=' . $ip));
|
|
| 124 | - $mylat = stripslashes(ucfirst($addr_details[geoplugin_latitude])); |
|
| 125 | - $mylon = stripslashes(ucfirst($addr_details[geoplugin_longitude])); |
|
| 126 | - } |
|
| 121 | + if ($snear == 'NEAR ME') {
|
|
| 122 | + $ip = $_SERVER['REMOTE_ADDR']; |
|
| 123 | + $addr_details = unserialize(file_get_contents('http://www.geoplugin.net/php.gp?ip=' . $ip));
|
|
| 124 | + $mylat = stripslashes(ucfirst($addr_details[geoplugin_latitude])); |
|
| 125 | + $mylon = stripslashes(ucfirst($addr_details[geoplugin_longitude])); |
|
| 126 | + } |
|
| 127 | 127 | |
| 128 | 128 | |
| 129 | - if (strstr($s, ',')) {
|
|
| 130 | - $s_AA = str_replace(" ", "", $s);
|
|
| 131 | - $s_A = explode(",", $s_AA);
|
|
| 132 | - $s_A = implode('","', $s_A);
|
|
| 133 | - $s_A = '"' . $s_A . '"'; |
|
| 134 | - } else {
|
|
| 135 | - $s_A = '"' . $s . '"'; |
|
| 136 | - } |
|
| 129 | + if (strstr($s, ',')) {
|
|
| 130 | + $s_AA = str_replace(" ", "", $s);
|
|
| 131 | + $s_A = explode(",", $s_AA);
|
|
| 132 | + $s_A = implode('","', $s_A);
|
|
| 133 | + $s_A = '"' . $s_A . '"'; |
|
| 134 | + } else {
|
|
| 135 | + $s_A = '"' . $s . '"'; |
|
| 136 | + } |
|
| 137 | 137 | |
| 138 | - if (strstr($s, ' ')) {
|
|
| 139 | - $s_SA = explode(" ", $s);
|
|
| 140 | - } else {
|
|
| 141 | - $s_SA = ''; |
|
| 142 | - } |
|
| 138 | + if (strstr($s, ' ')) {
|
|
| 139 | + $s_SA = explode(" ", $s);
|
|
| 140 | + } else {
|
|
| 141 | + $s_SA = ''; |
|
| 142 | + } |
|
| 143 | 143 | |
| 144 | - endif; |
|
| 144 | + endif; |
|
| 145 | 145 | |
| 146 | 146 | |
| 147 | 147 | |
@@ -162,56 +162,56 @@ discard block |
||
| 162 | 162 | */ |
| 163 | 163 | function geodir_listing_loop_filter($query) |
| 164 | 164 | {
|
| 165 | - global $wp_query, $geodir_post_type, $table, $plugin_prefix, $table, $term; |
|
| 165 | + global $wp_query, $geodir_post_type, $table, $plugin_prefix, $table, $term; |
|
| 166 | 166 | |
| 167 | - // fix wp_reset_query for popular post view widget |
|
| 168 | - if (!geodir_is_geodir_page()) {
|
|
| 169 | - return; |
|
| 170 | - } |
|
| 167 | + // fix wp_reset_query for popular post view widget |
|
| 168 | + if (!geodir_is_geodir_page()) {
|
|
| 169 | + return; |
|
| 170 | + } |
|
| 171 | 171 | |
| 172 | - $geodir_post_type = geodir_get_current_posttype(); |
|
| 173 | - |
|
| 174 | - if (isset($wp_query->tax_query->queries) && $wp_query->tax_query->queries) {
|
|
| 175 | - $taxonomies = wp_list_pluck($wp_query->tax_query->queries, 'taxonomy'); |
|
| 176 | - |
|
| 177 | - if (isset($wp_query->query[$taxonomies[0]])) {
|
|
| 178 | - $request_term = explode("/", $wp_query->query[$taxonomies[0]]);
|
|
| 179 | - $request_term = end($request_term); |
|
| 180 | - if (!term_exists($request_term)) {
|
|
| 181 | - $args = array('number' => '1',);
|
|
| 182 | - $terms_arr = get_terms($taxonomies[0], $args); |
|
| 183 | - foreach ($terms_arr as $location_term) {
|
|
| 184 | - $term_arr = $location_term; |
|
| 185 | - $term_arr->name = geodir_ucwords(str_replace('-', ' ', $request_term));
|
|
| 186 | - } |
|
| 187 | - $wp_query->queried_object_id = 1; |
|
| 188 | - $wp_query->queried_object = $term_arr; |
|
| 189 | - //print_r($wp_query) ; |
|
| 190 | - } |
|
| 191 | - } |
|
| 172 | + $geodir_post_type = geodir_get_current_posttype(); |
|
| 173 | + |
|
| 174 | + if (isset($wp_query->tax_query->queries) && $wp_query->tax_query->queries) {
|
|
| 175 | + $taxonomies = wp_list_pluck($wp_query->tax_query->queries, 'taxonomy'); |
|
| 176 | + |
|
| 177 | + if (isset($wp_query->query[$taxonomies[0]])) {
|
|
| 178 | + $request_term = explode("/", $wp_query->query[$taxonomies[0]]);
|
|
| 179 | + $request_term = end($request_term); |
|
| 180 | + if (!term_exists($request_term)) {
|
|
| 181 | + $args = array('number' => '1',);
|
|
| 182 | + $terms_arr = get_terms($taxonomies[0], $args); |
|
| 183 | + foreach ($terms_arr as $location_term) {
|
|
| 184 | + $term_arr = $location_term; |
|
| 185 | + $term_arr->name = geodir_ucwords(str_replace('-', ' ', $request_term));
|
|
| 186 | + } |
|
| 187 | + $wp_query->queried_object_id = 1; |
|
| 188 | + $wp_query->queried_object = $term_arr; |
|
| 189 | + //print_r($wp_query) ; |
|
| 190 | + } |
|
| 191 | + } |
|
| 192 | 192 | |
| 193 | - } |
|
| 194 | - if (isset($query->query_vars['is_geodir_loop']) && $query->query_vars['is_geodir_loop']) {
|
|
| 195 | - |
|
| 196 | - $table = $plugin_prefix . $geodir_post_type . '_detail'; |
|
| 197 | - |
|
| 198 | - add_filter('posts_fields', 'geodir_posts_fields', 1);
|
|
| 199 | - add_filter('posts_join', 'geodir_posts_join', 1);
|
|
| 200 | - geodir_post_where(); |
|
| 201 | - if (!is_admin()) |
|
| 202 | - add_filter('posts_orderby', 'geodir_posts_orderby', 1);
|
|
| 203 | - |
|
| 204 | - // advanced filter for popular post view widget |
|
| 205 | - global $wp_query; |
|
| 206 | - if (!is_admin()) {
|
|
| 207 | - if (!empty($wp_query->query['with_pics_only'])) {
|
|
| 208 | - add_filter('posts_join', 'geodir_filter_widget_join', 1000);
|
|
| 209 | - } |
|
| 210 | - add_filter('posts_where', 'geodir_filter_widget_where', 1000);
|
|
| 211 | - } |
|
| 193 | + } |
|
| 194 | + if (isset($query->query_vars['is_geodir_loop']) && $query->query_vars['is_geodir_loop']) {
|
|
| 212 | 195 | |
| 213 | - } |
|
| 214 | - return $query; |
|
| 196 | + $table = $plugin_prefix . $geodir_post_type . '_detail'; |
|
| 197 | + |
|
| 198 | + add_filter('posts_fields', 'geodir_posts_fields', 1);
|
|
| 199 | + add_filter('posts_join', 'geodir_posts_join', 1);
|
|
| 200 | + geodir_post_where(); |
|
| 201 | + if (!is_admin()) |
|
| 202 | + add_filter('posts_orderby', 'geodir_posts_orderby', 1);
|
|
| 203 | + |
|
| 204 | + // advanced filter for popular post view widget |
|
| 205 | + global $wp_query; |
|
| 206 | + if (!is_admin()) {
|
|
| 207 | + if (!empty($wp_query->query['with_pics_only'])) {
|
|
| 208 | + add_filter('posts_join', 'geodir_filter_widget_join', 1000);
|
|
| 209 | + } |
|
| 210 | + add_filter('posts_where', 'geodir_filter_widget_where', 1000);
|
|
| 211 | + } |
|
| 212 | + |
|
| 213 | + } |
|
| 214 | + return $query; |
|
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | |
@@ -230,67 +230,67 @@ discard block |
||
| 230 | 230 | * @return string Modified fields query string. |
| 231 | 231 | */ |
| 232 | 232 | function geodir_posts_fields($fields) {
|
| 233 | - global $wp_query, $wpdb, $geodir_post_type, $table, $plugin_prefix, $dist, $mylat, $mylon, $snear, $gd_session; |
|
| 233 | + global $wp_query, $wpdb, $geodir_post_type, $table, $plugin_prefix, $dist, $mylat, $mylon, $snear, $gd_session; |
|
| 234 | 234 | |
| 235 | - // Filter-Location-Manager to add location table. |
|
| 236 | - $fields .= ", " . $table . ".* "; |
|
| 235 | + // Filter-Location-Manager to add location table. |
|
| 236 | + $fields .= ", " . $table . ".* "; |
|
| 237 | 237 | |
| 238 | 238 | if ($snear != '' || $gd_session->get('all_near_me')) {
|
| 239 | - $DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
|
|
| 239 | + $DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
|
|
| 240 | 240 | |
| 241 | 241 | if ($gd_session->get('all_near_me')) {
|
| 242 | - $mylat = $gd_session->get('user_lat');
|
|
| 243 | - $mylon = $gd_session->get('user_lon');
|
|
| 244 | - } |
|
| 245 | - |
|
| 246 | - $fields .= " , (" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) )))as distance ";
|
|
| 247 | - } |
|
| 248 | - |
|
| 249 | - global $s; |
|
| 250 | - if (is_search() && isset($_REQUEST['geodir_search']) && $s && trim($s) != '') {
|
|
| 251 | - $keywords = explode(" ", $s);
|
|
| 252 | - |
|
| 253 | - if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
|
|
| 254 | - foreach($keywords as $kkey=>$kword){
|
|
| 255 | - if(mb_strlen($kword, 'UTF-8')<=$klimit){
|
|
| 256 | - unset($keywords[$kkey]); |
|
| 257 | - } |
|
| 258 | - } |
|
| 259 | - } |
|
| 242 | + $mylat = $gd_session->get('user_lat');
|
|
| 243 | + $mylon = $gd_session->get('user_lon');
|
|
| 244 | + } |
|
| 260 | 245 | |
| 246 | + $fields .= " , (" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) )))as distance ";
|
|
| 247 | + } |
|
| 261 | 248 | |
| 262 | - if (count($keywords) > 1) {
|
|
| 263 | - $parts = array( |
|
| 264 | - 'AND' => 'gd_alltitlematch_part', |
|
| 265 | - 'OR' => 'gd_titlematch_part' |
|
| 266 | - ); |
|
| 267 | - $gd_titlematch_part = ""; |
|
| 268 | - foreach ($parts as $key => $part) {
|
|
| 269 | - $gd_titlematch_part .= " CASE WHEN "; |
|
| 270 | - $count = 0; |
|
| 271 | - foreach ($keywords as $keyword) {
|
|
| 272 | - $keyword = trim($keyword); |
|
| 273 | - $keyword = wp_specialchars_decode($keyword ,ENT_QUOTES); |
|
| 249 | + global $s; |
|
| 250 | + if (is_search() && isset($_REQUEST['geodir_search']) && $s && trim($s) != '') {
|
|
| 251 | + $keywords = explode(" ", $s);
|
|
| 252 | + |
|
| 253 | + if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
|
|
| 254 | + foreach($keywords as $kkey=>$kword){
|
|
| 255 | + if(mb_strlen($kword, 'UTF-8')<=$klimit){
|
|
| 256 | + unset($keywords[$kkey]); |
|
| 257 | + } |
|
| 258 | + } |
|
| 259 | + } |
|
| 260 | + |
|
| 261 | + |
|
| 262 | + if (count($keywords) > 1) {
|
|
| 263 | + $parts = array( |
|
| 264 | + 'AND' => 'gd_alltitlematch_part', |
|
| 265 | + 'OR' => 'gd_titlematch_part' |
|
| 266 | + ); |
|
| 267 | + $gd_titlematch_part = ""; |
|
| 268 | + foreach ($parts as $key => $part) {
|
|
| 269 | + $gd_titlematch_part .= " CASE WHEN "; |
|
| 270 | + $count = 0; |
|
| 271 | + foreach ($keywords as $keyword) {
|
|
| 272 | + $keyword = trim($keyword); |
|
| 273 | + $keyword = wp_specialchars_decode($keyword ,ENT_QUOTES); |
|
| 274 | 274 | $count++; |
| 275 | - if ($count < count($keywords)) {
|
|
| 276 | - // $gd_titlematch_part .= $wpdb->posts . ".post_title LIKE '%%" . $keyword . "%%' " . $key . " "; |
|
| 275 | + if ($count < count($keywords)) {
|
|
| 276 | + // $gd_titlematch_part .= $wpdb->posts . ".post_title LIKE '%%" . $keyword . "%%' " . $key . " "; |
|
| 277 | 277 | $gd_titlematch_part .= "( " . $wpdb->posts . ".post_title LIKE '" . $keyword . "' OR " . $wpdb->posts . ".post_title LIKE '" . $keyword . "%%' OR " . $wpdb->posts . ".post_title LIKE '%% " . $keyword . "%%' ) " . $key . " "; |
| 278 | - } else {
|
|
| 279 | - //$gd_titlematch_part .= $wpdb->posts . ".post_title LIKE '%%" . $keyword . "%%' "; |
|
| 278 | + } else {
|
|
| 279 | + //$gd_titlematch_part .= $wpdb->posts . ".post_title LIKE '%%" . $keyword . "%%' "; |
|
| 280 | 280 | $gd_titlematch_part .= "( " . $wpdb->posts . ".post_title LIKE '" . $keyword . "' OR " . $wpdb->posts . ".post_title LIKE '" . $keyword . "%%' OR " . $wpdb->posts . ".post_title LIKE '%% " . $keyword . "%%' ) "; |
| 281 | - } |
|
| 282 | - } |
|
| 283 | - $gd_titlematch_part .= "THEN 1 ELSE 0 END AS " . $part . ","; |
|
| 284 | - } |
|
| 285 | - } else {
|
|
| 286 | - $gd_titlematch_part = ""; |
|
| 287 | - } |
|
| 288 | - $s = stripslashes_deep( $s ); |
|
| 289 | - $s = wp_specialchars_decode($s,ENT_QUOTES); |
|
| 281 | + } |
|
| 282 | + } |
|
| 283 | + $gd_titlematch_part .= "THEN 1 ELSE 0 END AS " . $part . ","; |
|
| 284 | + } |
|
| 285 | + } else {
|
|
| 286 | + $gd_titlematch_part = ""; |
|
| 287 | + } |
|
| 288 | + $s = stripslashes_deep( $s ); |
|
| 289 | + $s = wp_specialchars_decode($s,ENT_QUOTES); |
|
| 290 | 290 | $fields .= $wpdb->prepare(", CASE WHEN " . $table . ".is_featured='1' THEN 1 ELSE 0 END AS gd_featured, CASE WHEN " . $wpdb->posts . ".post_title LIKE %s THEN 1 ELSE 0 END AS gd_exacttitle," . $gd_titlematch_part . " CASE WHEN ( " . $wpdb->posts . ".post_title LIKE %s OR " . $wpdb->posts . ".post_title LIKE %s OR " . $wpdb->posts . ".post_title LIKE %s ) THEN 1 ELSE 0 END AS gd_titlematch, CASE WHEN ( " . $wpdb->posts . ".post_content LIKE %s OR " . $wpdb->posts . ".post_content LIKE %s OR " . $wpdb->posts . ".post_content LIKE %s OR " . $wpdb->posts . ".post_content LIKE %s ) THEN 1 ELSE 0 END AS gd_content", array($s, $s, $s . '%', '% ' . $s . '%', $s, $s . ' %', '% ' . $s . ' %', '% ' . $s));
|
| 291 | - } |
|
| 291 | + } |
|
| 292 | 292 | |
| 293 | - return $fields; |
|
| 293 | + return $fields; |
|
| 294 | 294 | } |
| 295 | 295 | |
| 296 | 296 | |
@@ -307,26 +307,26 @@ discard block |
||
| 307 | 307 | */ |
| 308 | 308 | function geodir_posts_join($join) |
| 309 | 309 | {
|
| 310 | - global $wpdb, $geodir_post_type, $table, $table_prefix, $plugin_prefix; |
|
| 310 | + global $wpdb, $geodir_post_type, $table, $table_prefix, $plugin_prefix; |
|
| 311 | 311 | |
| 312 | - ########### WPML ########### |
|
| 312 | + ########### WPML ########### |
|
| 313 | 313 | |
| 314 | - if (function_exists('icl_object_id')) {
|
|
| 315 | - global $sitepress; |
|
| 316 | - $lang_code = ICL_LANGUAGE_CODE; |
|
| 317 | - $default_lang_code = $sitepress->get_default_language(); |
|
| 318 | - if ($lang_code) {
|
|
| 319 | - $join .= "JOIN " . $table_prefix . "icl_translations icl_t ON icl_t.element_id = " . $table_prefix . "posts.ID"; |
|
| 320 | - } |
|
| 314 | + if (function_exists('icl_object_id')) {
|
|
| 315 | + global $sitepress; |
|
| 316 | + $lang_code = ICL_LANGUAGE_CODE; |
|
| 317 | + $default_lang_code = $sitepress->get_default_language(); |
|
| 318 | + if ($lang_code) {
|
|
| 319 | + $join .= "JOIN " . $table_prefix . "icl_translations icl_t ON icl_t.element_id = " . $table_prefix . "posts.ID"; |
|
| 320 | + } |
|
| 321 | 321 | |
| 322 | - } |
|
| 323 | - ########### WPML ########### |
|
| 322 | + } |
|
| 323 | + ########### WPML ########### |
|
| 324 | 324 | |
| 325 | - $join .= " INNER JOIN " . $table . " ON (" . $table . ".post_id = $wpdb->posts.ID) ";
|
|
| 326 | - //===old code start |
|
| 327 | - //$join .= " INNER JOIN ".POST_LOCATION_TABLE." ON (".$table.".post_location_id = ".POST_LOCATION_TABLE.".location_id) " ;//===old code end
|
|
| 325 | + $join .= " INNER JOIN " . $table . " ON (" . $table . ".post_id = $wpdb->posts.ID) ";
|
|
| 326 | + //===old code start |
|
| 327 | + //$join .= " INNER JOIN ".POST_LOCATION_TABLE." ON (".$table.".post_location_id = ".POST_LOCATION_TABLE.".location_id) " ;//===old code end
|
|
| 328 | 328 | |
| 329 | - return $join; |
|
| 329 | + return $join; |
|
| 330 | 330 | } |
| 331 | 331 | |
| 332 | 332 | |
@@ -344,15 +344,15 @@ discard block |
||
| 344 | 344 | */ |
| 345 | 345 | function geodir_posts_orderby($orderby) |
| 346 | 346 | {
|
| 347 | - global $wpdb, $wp_query, $geodir_post_type, $table, $plugin_prefix, $snear, $default_sort; |
|
| 347 | + global $wpdb, $wp_query, $geodir_post_type, $table, $plugin_prefix, $snear, $default_sort; |
|
| 348 | 348 | |
| 349 | - $sort_by = ''; |
|
| 350 | - $orderby = ' '; |
|
| 349 | + $sort_by = ''; |
|
| 350 | + $orderby = ' '; |
|
| 351 | 351 | |
| 352 | - if (get_query_var('order_by'))
|
|
| 353 | - $sort_by = get_query_var('order_by');
|
|
| 352 | + if (get_query_var('order_by'))
|
|
| 353 | + $sort_by = get_query_var('order_by');
|
|
| 354 | 354 | |
| 355 | - /*if(isset($wp_query->tax_query->queries) && $wp_query->tax_query->queries){
|
|
| 355 | + /*if(isset($wp_query->tax_query->queries) && $wp_query->tax_query->queries){
|
|
| 356 | 356 | $current_term = $wp_query->get_queried_object(); |
| 357 | 357 | } |
| 358 | 358 | |
@@ -366,116 +366,116 @@ discard block |
||
| 366 | 366 | }*/ |
| 367 | 367 | |
| 368 | 368 | |
| 369 | - if ($snear != '') {
|
|
| 370 | - $orderby .= " distance,"; |
|
| 371 | - } |
|
| 369 | + if ($snear != '') {
|
|
| 370 | + $orderby .= " distance,"; |
|
| 371 | + } |
|
| 372 | 372 | |
| 373 | - if (isset($_REQUEST['sort_by']) && $_REQUEST['sort_by'] != '' && is_main_query()) |
|
| 374 | - $sort_by = esc_attr($_REQUEST['sort_by']); |
|
| 373 | + if (isset($_REQUEST['sort_by']) && $_REQUEST['sort_by'] != '' && is_main_query()) |
|
| 374 | + $sort_by = esc_attr($_REQUEST['sort_by']); |
|
| 375 | 375 | |
| 376 | 376 | |
| 377 | - if ($sort_by == '') {
|
|
| 378 | - $default_sort = geodir_get_posts_default_sort($geodir_post_type); |
|
| 379 | - if (!empty($default_sort)) |
|
| 380 | - $sort_by = $default_sort; |
|
| 381 | - } |
|
| 377 | + if ($sort_by == '') {
|
|
| 378 | + $default_sort = geodir_get_posts_default_sort($geodir_post_type); |
|
| 379 | + if (!empty($default_sort)) |
|
| 380 | + $sort_by = $default_sort; |
|
| 381 | + } |
|
| 382 | 382 | |
| 383 | - /* |
|
| 383 | + /* |
|
| 384 | 384 | if search by term & no location then order always "relevance" |
| 385 | 385 | if search by location then order always "nearest" |
| 386 | 386 | */ |
| 387 | - if (is_main_query() && geodir_is_page('search')) {
|
|
| 388 | - $search_term = get_query_var('s');
|
|
| 387 | + if (is_main_query() && geodir_is_page('search')) {
|
|
| 388 | + $search_term = get_query_var('s');
|
|
| 389 | 389 | |
| 390 | - if (trim($search_term) != '' && !isset($_REQUEST['sort_by'])) {
|
|
| 391 | - $sort_by = 'az'; |
|
| 392 | - } |
|
| 390 | + if (trim($search_term) != '' && !isset($_REQUEST['sort_by'])) {
|
|
| 391 | + $sort_by = 'az'; |
|
| 392 | + } |
|
| 393 | 393 | |
| 394 | - if ($snear != '') {
|
|
| 395 | - $sort_by = 'nearest'; |
|
| 396 | - } |
|
| 397 | - } |
|
| 394 | + if ($snear != '') {
|
|
| 395 | + $sort_by = 'nearest'; |
|
| 396 | + } |
|
| 397 | + } |
|
| 398 | 398 | |
| 399 | - switch ($sort_by): |
|
| 400 | - case 'newest': |
|
| 401 | - $orderby = "$wpdb->posts.post_date desc, "; |
|
| 402 | - break; |
|
| 403 | - case 'oldest': |
|
| 404 | - $orderby = "$wpdb->posts.post_date asc, "; |
|
| 405 | - break; |
|
| 406 | - case 'low_review': |
|
| 407 | - case 'rating_count_asc': |
|
| 408 | - $orderby = $table . ".rating_count ASC, " . $table . ".overall_rating ASC, "; |
|
| 409 | - break; |
|
| 410 | - case 'high_review': |
|
| 411 | - case 'rating_count_desc': |
|
| 399 | + switch ($sort_by): |
|
| 400 | + case 'newest': |
|
| 401 | + $orderby = "$wpdb->posts.post_date desc, "; |
|
| 402 | + break; |
|
| 403 | + case 'oldest': |
|
| 404 | + $orderby = "$wpdb->posts.post_date asc, "; |
|
| 405 | + break; |
|
| 406 | + case 'low_review': |
|
| 407 | + case 'rating_count_asc': |
|
| 408 | + $orderby = $table . ".rating_count ASC, " . $table . ".overall_rating ASC, "; |
|
| 409 | + break; |
|
| 410 | + case 'high_review': |
|
| 411 | + case 'rating_count_desc': |
|
| 412 | 412 | $orderby = $table . ".rating_count DESC, " . $table . ".overall_rating DESC, "; |
| 413 | - break; |
|
| 414 | - case 'low_rating': |
|
| 415 | - $orderby = "( " . $table . ".overall_rating ) ASC, " . $table . ".rating_count ASC, "; |
|
| 416 | - break; |
|
| 417 | - case 'high_rating': |
|
| 418 | - $orderby = " " . $table . ".overall_rating DESC, " . $table . ".rating_count DESC, "; |
|
| 419 | - break; |
|
| 420 | - case 'featured': |
|
| 421 | - $orderby = $table . ".is_featured asc, "; |
|
| 422 | - break; |
|
| 423 | - case 'nearest': |
|
| 424 | - $orderby = " distance asc, "; |
|
| 425 | - break; |
|
| 426 | - case 'farthest': |
|
| 427 | - $orderby = " distance desc, "; |
|
| 428 | - break; |
|
| 429 | - case 'random': |
|
| 430 | - $orderby = " rand(), "; |
|
| 431 | - break; |
|
| 432 | - case 'az': |
|
| 433 | - $orderby = "$wpdb->posts.post_title asc, "; |
|
| 434 | - break; |
|
| 435 | - default: |
|
| 436 | - |
|
| 437 | - break; |
|
| 438 | - endswitch; |
|
| 439 | - |
|
| 440 | - global $s; |
|
| 441 | - |
|
| 442 | - if (is_search() && isset($_REQUEST['geodir_search']) && $s && trim($s) != '') {
|
|
| 443 | - $keywords = explode(" ", $s);
|
|
| 444 | - if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
|
|
| 445 | - foreach($keywords as $kkey=>$kword){
|
|
| 446 | - if(mb_strlen($kword, 'UTF-8')<=$klimit){
|
|
| 447 | - unset($keywords[$kkey]); |
|
| 448 | - } |
|
| 449 | - } |
|
| 450 | - } |
|
| 451 | - if ($sort_by == 'nearest' || $sort_by == 'farthest') {
|
|
| 452 | - if (count($keywords) > 1) {
|
|
| 453 | - $orderby = $orderby . " ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, "; |
|
| 454 | - } else {
|
|
| 455 | - $orderby = $orderby . " ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, "; |
|
| 456 | - } |
|
| 457 | - } else {
|
|
| 458 | - if (count($keywords) > 1) {
|
|
| 459 | - $orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, " . $orderby; |
|
| 460 | - } else {
|
|
| 461 | - $orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, " . $orderby; |
|
| 462 | - } |
|
| 463 | - } |
|
| 464 | - } |
|
| 413 | + break; |
|
| 414 | + case 'low_rating': |
|
| 415 | + $orderby = "( " . $table . ".overall_rating ) ASC, " . $table . ".rating_count ASC, "; |
|
| 416 | + break; |
|
| 417 | + case 'high_rating': |
|
| 418 | + $orderby = " " . $table . ".overall_rating DESC, " . $table . ".rating_count DESC, "; |
|
| 419 | + break; |
|
| 420 | + case 'featured': |
|
| 421 | + $orderby = $table . ".is_featured asc, "; |
|
| 422 | + break; |
|
| 423 | + case 'nearest': |
|
| 424 | + $orderby = " distance asc, "; |
|
| 425 | + break; |
|
| 426 | + case 'farthest': |
|
| 427 | + $orderby = " distance desc, "; |
|
| 428 | + break; |
|
| 429 | + case 'random': |
|
| 430 | + $orderby = " rand(), "; |
|
| 431 | + break; |
|
| 432 | + case 'az': |
|
| 433 | + $orderby = "$wpdb->posts.post_title asc, "; |
|
| 434 | + break; |
|
| 435 | + default: |
|
| 436 | + |
|
| 437 | + break; |
|
| 438 | + endswitch; |
|
| 439 | + |
|
| 440 | + global $s; |
|
| 441 | + |
|
| 442 | + if (is_search() && isset($_REQUEST['geodir_search']) && $s && trim($s) != '') {
|
|
| 443 | + $keywords = explode(" ", $s);
|
|
| 444 | + if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
|
|
| 445 | + foreach($keywords as $kkey=>$kword){
|
|
| 446 | + if(mb_strlen($kword, 'UTF-8')<=$klimit){
|
|
| 447 | + unset($keywords[$kkey]); |
|
| 448 | + } |
|
| 449 | + } |
|
| 450 | + } |
|
| 451 | + if ($sort_by == 'nearest' || $sort_by == 'farthest') {
|
|
| 452 | + if (count($keywords) > 1) {
|
|
| 453 | + $orderby = $orderby . " ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, "; |
|
| 454 | + } else {
|
|
| 455 | + $orderby = $orderby . " ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, "; |
|
| 456 | + } |
|
| 457 | + } else {
|
|
| 458 | + if (count($keywords) > 1) {
|
|
| 459 | + $orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, " . $orderby; |
|
| 460 | + } else {
|
|
| 461 | + $orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, " . $orderby; |
|
| 462 | + } |
|
| 463 | + } |
|
| 464 | + } |
|
| 465 | 465 | |
| 466 | - /** |
|
| 467 | - * Filter order by SQL. |
|
| 468 | - * |
|
| 469 | - * @since 1.0.0 |
|
| 470 | - * @param string $orderby The orderby query string. |
|
| 471 | - * @param string $sort_by Sortby query string. |
|
| 472 | - * @param string $table Listing table name. |
|
| 473 | - */ |
|
| 474 | - $orderby = apply_filters('geodir_posts_order_by_sort', $orderby, $sort_by, $table);
|
|
| 466 | + /** |
|
| 467 | + * Filter order by SQL. |
|
| 468 | + * |
|
| 469 | + * @since 1.0.0 |
|
| 470 | + * @param string $orderby The orderby query string. |
|
| 471 | + * @param string $sort_by Sortby query string. |
|
| 472 | + * @param string $table Listing table name. |
|
| 473 | + */ |
|
| 474 | + $orderby = apply_filters('geodir_posts_order_by_sort', $orderby, $sort_by, $table);
|
|
| 475 | 475 | |
| 476 | - $orderby .= $table . ".is_featured asc, $wpdb->posts.post_date desc, $wpdb->posts.post_title "; |
|
| 476 | + $orderby .= $table . ".is_featured asc, $wpdb->posts.post_date desc, $wpdb->posts.post_title "; |
|
| 477 | 477 | |
| 478 | - return $orderby; |
|
| 478 | + return $orderby; |
|
| 479 | 479 | } |
| 480 | 480 | |
| 481 | 481 | |
@@ -493,53 +493,53 @@ discard block |
||
| 493 | 493 | function geodir_posts_order_by_custom_sort($orderby, $sort_by, $table) |
| 494 | 494 | {
|
| 495 | 495 | |
| 496 | - global $wpdb; |
|
| 496 | + global $wpdb; |
|
| 497 | 497 | |
| 498 | - if ($sort_by != '' && !is_search()) {
|
|
| 498 | + if ($sort_by != '' && !is_search()) {
|
|
| 499 | 499 | |
| 500 | - $sort_array = explode('_', $sort_by);
|
|
| 500 | + $sort_array = explode('_', $sort_by);
|
|
| 501 | 501 | |
| 502 | - $sort_by_count = count($sort_array); |
|
| 502 | + $sort_by_count = count($sort_array); |
|
| 503 | 503 | |
| 504 | - $order = $sort_array[$sort_by_count - 1]; |
|
| 504 | + $order = $sort_array[$sort_by_count - 1]; |
|
| 505 | 505 | |
| 506 | - if ($sort_by_count > 1 && ($order == 'asc' || $order == 'desc')) {
|
|
| 506 | + if ($sort_by_count > 1 && ($order == 'asc' || $order == 'desc')) {
|
|
| 507 | 507 | |
| 508 | - $sort_by = str_replace('_' . $order, '', $sort_by);
|
|
| 508 | + $sort_by = str_replace('_' . $order, '', $sort_by);
|
|
| 509 | 509 | |
| 510 | - switch ($sort_by): |
|
| 510 | + switch ($sort_by): |
|
| 511 | 511 | |
| 512 | - case 'post_date': |
|
| 513 | - case 'comment_count': |
|
| 512 | + case 'post_date': |
|
| 513 | + case 'comment_count': |
|
| 514 | 514 | |
| 515 | - $orderby = "$wpdb->posts." . $sort_by . " " . $order . ", ".$table . ".overall_rating " . $order . ", "; |
|
| 516 | - break; |
|
| 515 | + $orderby = "$wpdb->posts." . $sort_by . " " . $order . ", ".$table . ".overall_rating " . $order . ", "; |
|
| 516 | + break; |
|
| 517 | 517 | |
| 518 | - case 'distance': |
|
| 519 | - $orderby = $sort_by . " " . $order . ", "; |
|
| 520 | - break; |
|
| 518 | + case 'distance': |
|
| 519 | + $orderby = $sort_by . " " . $order . ", "; |
|
| 520 | + break; |
|
| 521 | 521 | |
| 522 | 522 | |
| 523 | - // sort by rating |
|
| 524 | - case 'overall_rating': |
|
| 525 | - $orderby = " " . $table . "." . $sort_by . " " . $order . ", " . $table . ".rating_count " . $order . ", "; |
|
| 523 | + // sort by rating |
|
| 524 | + case 'overall_rating': |
|
| 525 | + $orderby = " " . $table . "." . $sort_by . " " . $order . ", " . $table . ".rating_count " . $order . ", "; |
|
| 526 | 526 | |
| 527 | - break; |
|
| 527 | + break; |
|
| 528 | 528 | |
| 529 | 529 | |
| 530 | - default: |
|
| 531 | - if (geodir_column_exist($table, $sort_by)) {
|
|
| 530 | + default: |
|
| 531 | + if (geodir_column_exist($table, $sort_by)) {
|
|
| 532 | 532 | $orderby = $table . "." . $sort_by . " " . $order . ", "; |
| 533 | 533 | } |
| 534 | - break; |
|
| 534 | + break; |
|
| 535 | 535 | |
| 536 | - endswitch; |
|
| 536 | + endswitch; |
|
| 537 | 537 | |
| 538 | - } |
|
| 538 | + } |
|
| 539 | 539 | |
| 540 | - } |
|
| 540 | + } |
|
| 541 | 541 | |
| 542 | - return $orderby; |
|
| 542 | + return $orderby; |
|
| 543 | 543 | } |
| 544 | 544 | |
| 545 | 545 | /** |
@@ -554,34 +554,34 @@ discard block |
||
| 554 | 554 | {
|
| 555 | 555 | |
| 556 | 556 | |
| 557 | - global $wpdb, $geodir_post_type, $table, $s, $snear; |
|
| 557 | + global $wpdb, $geodir_post_type, $table, $s, $snear; |
|
| 558 | 558 | |
| 559 | - if (!is_admin()) {
|
|
| 559 | + if (!is_admin()) {
|
|
| 560 | 560 | |
| 561 | - if (geodir_is_page('add-listing') && isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 562 | - add_filter('posts_where', 'geodir_edit_listing_where', 1);
|
|
| 561 | + if (geodir_is_page('add-listing') && isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 562 | + add_filter('posts_where', 'geodir_edit_listing_where', 1);
|
|
| 563 | 563 | |
| 564 | - } elseif ((is_search() && $_REQUEST['geodir_search'])) {
|
|
| 564 | + } elseif ((is_search() && $_REQUEST['geodir_search'])) {
|
|
| 565 | 565 | |
| 566 | - add_filter('posts_where', 'searching_filter_where', 1);
|
|
| 566 | + add_filter('posts_where', 'searching_filter_where', 1);
|
|
| 567 | 567 | |
| 568 | - if ($snear != '') |
|
| 569 | - add_filter('posts_where', 'searching_filter_where', 1);
|
|
| 568 | + if ($snear != '') |
|
| 569 | + add_filter('posts_where', 'searching_filter_where', 1);
|
|
| 570 | 570 | |
| 571 | - add_filter('posts_orderby', 'geodir_posts_orderby', 1);
|
|
| 571 | + add_filter('posts_orderby', 'geodir_posts_orderby', 1);
|
|
| 572 | 572 | |
| 573 | - } elseif (geodir_is_page('author')) {
|
|
| 573 | + } elseif (geodir_is_page('author')) {
|
|
| 574 | 574 | |
| 575 | - add_filter('posts_where', 'author_filter_where', 1);
|
|
| 575 | + add_filter('posts_where', 'author_filter_where', 1);
|
|
| 576 | 576 | |
| 577 | - } |
|
| 577 | + } |
|
| 578 | 578 | |
| 579 | - //if (!geodir_is_page('detail'))
|
|
| 580 | - add_filter('posts_where', 'geodir_default_where', 1);/**/
|
|
| 579 | + //if (!geodir_is_page('detail'))
|
|
| 580 | + add_filter('posts_where', 'geodir_default_where', 1);/**/
|
|
| 581 | 581 | |
| 582 | - //add_filter( 'user_has_cap', 'geodir_preview_post_cap', 10, 3 );// let subscribers edit their own posts |
|
| 582 | + //add_filter( 'user_has_cap', 'geodir_preview_post_cap', 10, 3 );// let subscribers edit their own posts |
|
| 583 | 583 | |
| 584 | - } |
|
| 584 | + } |
|
| 585 | 585 | } |
| 586 | 586 | |
| 587 | 587 | /** |
@@ -596,13 +596,13 @@ discard block |
||
| 596 | 596 | */ |
| 597 | 597 | function geodir_preview_post_cap($allcaps, $caps, $args) |
| 598 | 598 | {
|
| 599 | - $user_id = get_current_user_id(); |
|
| 600 | - if ($user_id && isset($_REQUEST['post_type']) && $_REQUEST['post_type'] != '' && isset($_REQUEST['p']) && $_REQUEST['p'] != '' && $args[0] == 'edit_post' && $_REQUEST['p'] == $args[2]) {
|
|
| 599 | + $user_id = get_current_user_id(); |
|
| 600 | + if ($user_id && isset($_REQUEST['post_type']) && $_REQUEST['post_type'] != '' && isset($_REQUEST['p']) && $_REQUEST['p'] != '' && $args[0] == 'edit_post' && $_REQUEST['p'] == $args[2]) {
|
|
| 601 | 601 | |
| 602 | - $allcaps['edit_posts'] = true; |
|
| 603 | - } |
|
| 604 | - //print_r($allcaps); |
|
| 605 | - return $allcaps; |
|
| 602 | + $allcaps['edit_posts'] = true; |
|
| 603 | + } |
|
| 604 | + //print_r($allcaps); |
|
| 605 | + return $allcaps; |
|
| 606 | 606 | } |
| 607 | 607 | |
| 608 | 608 | |
@@ -617,9 +617,9 @@ discard block |
||
| 617 | 617 | */ |
| 618 | 618 | function geodir_edit_listing_where($where) |
| 619 | 619 | {
|
| 620 | - global $wpdb; |
|
| 621 | - $where = $wpdb->prepare(" AND $wpdb->posts.ID = %d ", $_REQUEST['pid']);
|
|
| 622 | - return $where; |
|
| 620 | + global $wpdb; |
|
| 621 | + $where = $wpdb->prepare(" AND $wpdb->posts.ID = %d ", $_REQUEST['pid']);
|
|
| 622 | + return $where; |
|
| 623 | 623 | } |
| 624 | 624 | |
| 625 | 625 | |
@@ -636,29 +636,29 @@ discard block |
||
| 636 | 636 | */ |
| 637 | 637 | function geodir_default_where($where) |
| 638 | 638 | {
|
| 639 | - global $wp_query, $wpdb; |
|
| 640 | - |
|
| 641 | - //print_r($wp_query); |
|
| 642 | - ########### WPML ########### |
|
| 643 | - |
|
| 644 | - if (function_exists('icl_object_id')) {
|
|
| 645 | - global $sitepress, $table_prefix; |
|
| 646 | - $lang_code = ICL_LANGUAGE_CODE; |
|
| 647 | - $default_lang_code = $sitepress->get_default_language(); |
|
| 648 | - $q_post_type = isset($wp_query->query['post_type']) ? $wp_query->query['post_type'] : ''; |
|
| 649 | - //echo '##########'.$q_post_type; |
|
| 650 | - if ($lang_code && $q_post_type) {
|
|
| 651 | - $where .= " AND icl_t.language_code = '$lang_code' AND icl_t.element_type IN('post_" . $q_post_type . "') ";
|
|
| 652 | - //$where .= " AND icl_t.language_code = '$lang_code' "; |
|
| 653 | - } |
|
| 639 | + global $wp_query, $wpdb; |
|
| 654 | 640 | |
| 655 | - } |
|
| 656 | - ########### WPML ########### |
|
| 641 | + //print_r($wp_query); |
|
| 642 | + ########### WPML ########### |
|
| 643 | + |
|
| 644 | + if (function_exists('icl_object_id')) {
|
|
| 645 | + global $sitepress, $table_prefix; |
|
| 646 | + $lang_code = ICL_LANGUAGE_CODE; |
|
| 647 | + $default_lang_code = $sitepress->get_default_language(); |
|
| 648 | + $q_post_type = isset($wp_query->query['post_type']) ? $wp_query->query['post_type'] : ''; |
|
| 649 | + //echo '##########'.$q_post_type; |
|
| 650 | + if ($lang_code && $q_post_type) {
|
|
| 651 | + $where .= " AND icl_t.language_code = '$lang_code' AND icl_t.element_type IN('post_" . $q_post_type . "') ";
|
|
| 652 | + //$where .= " AND icl_t.language_code = '$lang_code' "; |
|
| 653 | + } |
|
| 654 | + |
|
| 655 | + } |
|
| 656 | + ########### WPML ########### |
|
| 657 | 657 | |
| 658 | 658 | |
| 659 | - return $where = str_replace("0 = 1", "1=1", $where);
|
|
| 659 | + return $where = str_replace("0 = 1", "1=1", $where);
|
|
| 660 | 660 | |
| 661 | - /* ====== old code start === |
|
| 661 | + /* ====== old code start === |
|
| 662 | 662 | $where = str_replace("0 = 1", "1=1", $where);
|
| 663 | 663 | $country = get_query_var('gd_country');
|
| 664 | 664 | $region = get_query_var('gd_region');
|
@@ -699,108 +699,108 @@ discard block |
||
| 699 | 699 | * @return string Modified where query string. |
| 700 | 700 | */ |
| 701 | 701 | function searching_filter_where($where) {
|
| 702 | - global $wpdb, $geodir_post_type, $table, $plugin_prefix, $dist, $mylat, $mylon, $s, $snear, $s_A, $s_SA, $search_term, $gd_session; |
|
| 702 | + global $wpdb, $geodir_post_type, $table, $plugin_prefix, $dist, $mylat, $mylon, $s, $snear, $s_A, $s_SA, $search_term, $gd_session; |
|
| 703 | 703 | |
| 704 | - $search_term = 'OR'; |
|
| 705 | - $search_term = 'AND'; |
|
| 706 | - $geodir_custom_search = ''; |
|
| 707 | - $category_search_range = ''; |
|
| 704 | + $search_term = 'OR'; |
|
| 705 | + $search_term = 'AND'; |
|
| 706 | + $geodir_custom_search = ''; |
|
| 707 | + $category_search_range = ''; |
|
| 708 | 708 | |
| 709 | - if (is_single() && get_query_var('post_type')) {
|
|
| 709 | + if (is_single() && get_query_var('post_type')) {
|
|
| 710 | 710 | return $where; |
| 711 | 711 | } |
| 712 | 712 | |
| 713 | - if (is_tax()) {
|
|
| 713 | + if (is_tax()) {
|
|
| 714 | 714 | return $where; |
| 715 | 715 | } |
| 716 | 716 | |
| 717 | 717 | $s = trim($s); |
| 718 | - $s = wp_specialchars_decode($s ,ENT_QUOTES); |
|
| 719 | - $s_A = wp_specialchars_decode($s_A ,ENT_QUOTES); |
|
| 720 | - |
|
| 721 | - $where = ''; |
|
| 722 | - $better_search_terms = ''; |
|
| 723 | - if (isset($_REQUEST['stype'])) |
|
| 724 | - $post_types = esc_attr(wp_strip_all_tags($_REQUEST['stype'])); |
|
| 725 | - else |
|
| 726 | - $post_types = 'gd_place'; |
|
| 727 | - |
|
| 728 | - if ($s != '') {
|
|
| 729 | - $keywords = explode(" ", $s);
|
|
| 730 | - if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
|
|
| 731 | - foreach($keywords as $kkey=>$kword){
|
|
| 732 | - if(mb_strlen($kword, 'UTF-8')<=$klimit){
|
|
| 733 | - unset($keywords[$kkey]); |
|
| 734 | - } |
|
| 735 | - } |
|
| 736 | - } |
|
| 718 | + $s = wp_specialchars_decode($s ,ENT_QUOTES); |
|
| 719 | + $s_A = wp_specialchars_decode($s_A ,ENT_QUOTES); |
|
| 737 | 720 | |
| 738 | - if (!empty($keywords)) {
|
|
| 739 | - foreach ($keywords as $keyword) {
|
|
| 740 | - $keyword = trim($keyword); |
|
| 741 | - $keyword = wp_specialchars_decode($keyword ,ENT_QUOTES); |
|
| 742 | - if ($keyword != '') {
|
|
| 743 | - /** |
|
| 744 | - * Filter the search query keywords SQL. |
|
| 745 | - * |
|
| 746 | - * @since 1.5.9 |
|
| 747 | - * @package GeoDirectory |
|
| 748 | - * @param string $better_search_terms The query values, default: `' OR ( ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '" OR ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '%" OR ' . $wpdb->posts . '.post_title LIKE "% ' . $keyword . '%" )'`. |
|
| 749 | - * @param array $keywords The array of keywords for the query. |
|
| 750 | - * @param string $keyword The single keyword being searched. |
|
| 751 | - */ |
|
| 721 | + $where = ''; |
|
| 722 | + $better_search_terms = ''; |
|
| 723 | + if (isset($_REQUEST['stype'])) |
|
| 724 | + $post_types = esc_attr(wp_strip_all_tags($_REQUEST['stype'])); |
|
| 725 | + else |
|
| 726 | + $post_types = 'gd_place'; |
|
| 727 | + |
|
| 728 | + if ($s != '') {
|
|
| 729 | + $keywords = explode(" ", $s);
|
|
| 730 | + if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
|
|
| 731 | + foreach($keywords as $kkey=>$kword){
|
|
| 732 | + if(mb_strlen($kword, 'UTF-8')<=$klimit){
|
|
| 733 | + unset($keywords[$kkey]); |
|
| 734 | + } |
|
| 735 | + } |
|
| 736 | + } |
|
| 737 | + |
|
| 738 | + if (!empty($keywords)) {
|
|
| 739 | + foreach ($keywords as $keyword) {
|
|
| 740 | + $keyword = trim($keyword); |
|
| 741 | + $keyword = wp_specialchars_decode($keyword ,ENT_QUOTES); |
|
| 742 | + if ($keyword != '') {
|
|
| 743 | + /** |
|
| 744 | + * Filter the search query keywords SQL. |
|
| 745 | + * |
|
| 746 | + * @since 1.5.9 |
|
| 747 | + * @package GeoDirectory |
|
| 748 | + * @param string $better_search_terms The query values, default: `' OR ( ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '" OR ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '%" OR ' . $wpdb->posts . '.post_title LIKE "% ' . $keyword . '%" )'`. |
|
| 749 | + * @param array $keywords The array of keywords for the query. |
|
| 750 | + * @param string $keyword The single keyword being searched. |
|
| 751 | + */ |
|
| 752 | 752 | $better_search_terms .= apply_filters("geodir_search_better_search_terms",' OR ( ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '" OR ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '%" OR ' . $wpdb->posts . '.post_title LIKE "% ' . $keyword . '%" )',$keywords,$keyword);
|
| 753 | - } |
|
| 754 | - } |
|
| 755 | - } |
|
| 756 | - } |
|
| 753 | + } |
|
| 754 | + } |
|
| 755 | + } |
|
| 756 | + } |
|
| 757 | 757 | |
| 758 | - /* get taxonomy */ |
|
| 759 | - $taxonomies = geodir_get_taxonomies($post_types, true); |
|
| 760 | - if($taxonomies) {
|
|
| 761 | - $taxonomies = implode("','", $taxonomies);
|
|
| 762 | - $taxonomies = "'" . $taxonomies . "'"; |
|
| 763 | - }else{$taxonomies='';}
|
|
| 758 | + /* get taxonomy */ |
|
| 759 | + $taxonomies = geodir_get_taxonomies($post_types, true); |
|
| 760 | + if($taxonomies) {
|
|
| 761 | + $taxonomies = implode("','", $taxonomies);
|
|
| 762 | + $taxonomies = "'" . $taxonomies . "'"; |
|
| 763 | + }else{$taxonomies='';}
|
|
| 764 | 764 | |
| 765 | - $content_where = $terms_where = ''; |
|
| 765 | + $content_where = $terms_where = ''; |
|
| 766 | 766 | if ($s != '') {
|
| 767 | - /** |
|
| 768 | - * Filter the search query content where values. |
|
| 769 | - * |
|
| 770 | - * @since 1.5.0 |
|
| 771 | - * @package GeoDirectory |
|
| 772 | - * @param string $content_where The query values, default: `" OR ($wpdb->posts.post_content LIKE \"$s\" OR $wpdb->posts.post_content LIKE \"$s%\" OR $wpdb->posts.post_content LIKE \"% $s%\" OR $wpdb->posts.post_content LIKE \"%>$s%\" OR $wpdb->posts.post_content LIKE \"%\n$s%\") ") "`. |
|
| 773 | - */ |
|
| 767 | + /** |
|
| 768 | + * Filter the search query content where values. |
|
| 769 | + * |
|
| 770 | + * @since 1.5.0 |
|
| 771 | + * @package GeoDirectory |
|
| 772 | + * @param string $content_where The query values, default: `" OR ($wpdb->posts.post_content LIKE \"$s\" OR $wpdb->posts.post_content LIKE \"$s%\" OR $wpdb->posts.post_content LIKE \"% $s%\" OR $wpdb->posts.post_content LIKE \"%>$s%\" OR $wpdb->posts.post_content LIKE \"%\n$s%\") ") "`. |
|
| 773 | + */ |
|
| 774 | 774 | $content_where = apply_filters("geodir_search_content_where"," OR ($wpdb->posts.post_content LIKE \"$s\" OR $wpdb->posts.post_content LIKE \"$s%\" OR $wpdb->posts.post_content LIKE \"% $s%\" OR $wpdb->posts.post_content LIKE \"%>$s%\" OR $wpdb->posts.post_content LIKE \"%\n$s%\") ");
|
| 775 | - /** |
|
| 776 | - * Filter the search query term values. |
|
| 777 | - * |
|
| 778 | - * @since 1.5.0 |
|
| 779 | - * @package GeoDirectory |
|
| 780 | - * @param string $terms_where The separator, default: `" AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) "`. |
|
| 781 | - */ |
|
| 782 | - $terms_where = apply_filters("geodir_search_terms_where"," AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) ");
|
|
| 775 | + /** |
|
| 776 | + * Filter the search query term values. |
|
| 777 | + * |
|
| 778 | + * @since 1.5.0 |
|
| 779 | + * @package GeoDirectory |
|
| 780 | + * @param string $terms_where The separator, default: `" AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) "`. |
|
| 781 | + */ |
|
| 782 | + $terms_where = apply_filters("geodir_search_terms_where"," AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) ");
|
|
| 783 | 783 | } |
| 784 | 784 | |
| 785 | - if ($snear != '') {
|
|
| 785 | + if ($snear != '') {
|
|
| 786 | 786 | |
| 787 | 787 | |
| 788 | - if (is_numeric($gd_session->get('near_me_range')) && !isset($_REQUEST['sdist'])) {
|
|
| 789 | - $dist = $gd_session->get('near_me_range');
|
|
| 790 | - } |
|
| 791 | - $lon1 = $mylon - $dist / abs(cos(deg2rad($mylat)) * 69); |
|
| 792 | - $lon2 = $mylon + $dist / abs(cos(deg2rad($mylat)) * 69); |
|
| 793 | - $lat1 = $mylat - ($dist / 69); |
|
| 794 | - $lat2 = $mylat + ($dist / 69); |
|
| 788 | + if (is_numeric($gd_session->get('near_me_range')) && !isset($_REQUEST['sdist'])) {
|
|
| 789 | + $dist = $gd_session->get('near_me_range');
|
|
| 790 | + } |
|
| 791 | + $lon1 = $mylon - $dist / abs(cos(deg2rad($mylat)) * 69); |
|
| 792 | + $lon2 = $mylon + $dist / abs(cos(deg2rad($mylat)) * 69); |
|
| 793 | + $lat1 = $mylat - ($dist / 69); |
|
| 794 | + $lat2 = $mylat + ($dist / 69); |
|
| 795 | 795 | |
| 796 | - $rlon1 = is_numeric(min($lon1, $lon2)) ? min($lon1, $lon2) : ''; |
|
| 797 | - $rlon2 = is_numeric(max($lon1, $lon2)) ? max($lon1, $lon2) : ''; |
|
| 798 | - $rlat1 = is_numeric(min($lat1, $lat2)) ? min($lat1, $lat2) : ''; |
|
| 799 | - $rlat2 = is_numeric(max($lat1, $lat2)) ? max($lat1, $lat2) : ''; |
|
| 796 | + $rlon1 = is_numeric(min($lon1, $lon2)) ? min($lon1, $lon2) : ''; |
|
| 797 | + $rlon2 = is_numeric(max($lon1, $lon2)) ? max($lon1, $lon2) : ''; |
|
| 798 | + $rlat1 = is_numeric(min($lat1, $lat2)) ? min($lat1, $lat2) : ''; |
|
| 799 | + $rlat2 = is_numeric(max($lat1, $lat2)) ? max($lat1, $lat2) : ''; |
|
| 800 | 800 | |
| 801 | 801 | |
| 802 | 802 | |
| 803 | - $where .= " AND ( ( $wpdb->posts.post_title LIKE \"$s\" $better_search_terms) |
|
| 803 | + $where .= " AND ( ( $wpdb->posts.post_title LIKE \"$s\" $better_search_terms) |
|
| 804 | 804 | $content_where |
| 805 | 805 | OR ($wpdb->posts.ID IN( |
| 806 | 806 | SELECT $wpdb->term_relationships.object_id as post_id |
@@ -817,13 +817,13 @@ discard block |
||
| 817 | 817 | AND ( " . $table . ".post_latitude between $rlat1 and $rlat2 ) |
| 818 | 818 | AND ( " . $table . ".post_longitude between $rlon1 and $rlon2 ) "; |
| 819 | 819 | |
| 820 | - if (isset($_REQUEST['sdist']) && $_REQUEST['sdist'] != 'all') {
|
|
| 821 | - $DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
|
|
| 822 | - $where .= " AND CONVERT((" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) ))),DECIMAL(64,4)) <= " . $dist;
|
|
| 823 | - } |
|
| 820 | + if (isset($_REQUEST['sdist']) && $_REQUEST['sdist'] != 'all') {
|
|
| 821 | + $DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
|
|
| 822 | + $where .= " AND CONVERT((" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) ))),DECIMAL(64,4)) <= " . $dist;
|
|
| 823 | + } |
|
| 824 | 824 | |
| 825 | - } else {
|
|
| 826 | - $where .= " AND ( ( $wpdb->posts.post_title LIKE \"$s\" $better_search_terms) |
|
| 825 | + } else {
|
|
| 826 | + $where .= " AND ( ( $wpdb->posts.post_title LIKE \"$s\" $better_search_terms) |
|
| 827 | 827 | $content_where |
| 828 | 828 | OR ( $wpdb->posts.ID IN( |
| 829 | 829 | SELECT $wpdb->term_relationships.object_id as post_id |
@@ -837,19 +837,19 @@ discard block |
||
| 837 | 837 | ) |
| 838 | 838 | AND $wpdb->posts.post_type in ('$post_types')
|
| 839 | 839 | AND ($wpdb->posts.post_status = 'publish') "; |
| 840 | - } |
|
| 840 | + } |
|
| 841 | 841 | |
| 842 | 842 | ########### WPML ########### |
| 843 | - if ( function_exists( 'icl_object_id' ) ) {
|
|
| 843 | + if ( function_exists( 'icl_object_id' ) ) {
|
|
| 844 | 844 | $lang_code = ICL_LANGUAGE_CODE; |
| 845 | 845 | |
| 846 | 846 | if ($lang_code && $post_types) {
|
| 847 | - $where .= " AND icl_t.language_code = '".$lang_code."' AND icl_t.element_type IN('post_" . $post_types . "') ";
|
|
| 848 | - } |
|
| 849 | - } |
|
| 850 | - ########### WPML ########### |
|
| 847 | + $where .= " AND icl_t.language_code = '".$lang_code."' AND icl_t.element_type IN('post_" . $post_types . "') ";
|
|
| 848 | + } |
|
| 849 | + } |
|
| 850 | + ########### WPML ########### |
|
| 851 | 851 | |
| 852 | - return $where; |
|
| 852 | + return $where; |
|
| 853 | 853 | } |
| 854 | 854 | |
| 855 | 855 | |
@@ -864,45 +864,45 @@ discard block |
||
| 864 | 864 | * @return string Modified where query string. |
| 865 | 865 | */ |
| 866 | 866 | function author_filter_where($where) {
|
| 867 | - global $wpdb, $geodir_post_type, $table, $curr; |
|
| 867 | + global $wpdb, $geodir_post_type, $table, $curr; |
|
| 868 | 868 | |
| 869 | - $curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
|
|
| 870 | - $user_id = !empty($curauth->ID) ? (int)$curauth->ID : 0; |
|
| 869 | + $curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
|
|
| 870 | + $user_id = !empty($curauth->ID) ? (int)$curauth->ID : 0; |
|
| 871 | 871 | |
| 872 | - if (isset($_REQUEST['stype'])) {
|
|
| 873 | - $where = $wpdb->prepare(" AND $wpdb->posts.post_type IN (%s) ",$_REQUEST['stype']);
|
|
| 874 | - } else {
|
|
| 875 | - $where = " AND $wpdb->posts.post_type IN ('gd_place') ";
|
|
| 876 | - } |
|
| 872 | + if (isset($_REQUEST['stype'])) {
|
|
| 873 | + $where = $wpdb->prepare(" AND $wpdb->posts.post_type IN (%s) ",$_REQUEST['stype']);
|
|
| 874 | + } else {
|
|
| 875 | + $where = " AND $wpdb->posts.post_type IN ('gd_place') ";
|
|
| 876 | + } |
|
| 877 | 877 | |
| 878 | - if ($user_id > 0) {
|
|
| 879 | - if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
|
|
| 880 | - $user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true); |
|
| 881 | - $user_fav_posts = !empty($user_fav_posts) && is_array($user_fav_posts) ? implode("','", $user_fav_posts) : '-1';
|
|
| 882 | - $where .= " AND $wpdb->posts.ID IN ('$user_fav_posts')";
|
|
| 883 | - } else |
|
| 884 | - $where .= " AND $wpdb->posts.post_author = $user_id"; |
|
| 885 | - |
|
| 886 | - if ($user_id == (int)get_current_user_id()) {
|
|
| 887 | - $where .= " AND $wpdb->posts.post_status IN ('publish','draft','pending') ";
|
|
| 888 | - } else {
|
|
| 889 | - $where .= " AND $wpdb->posts.post_status = 'publish' "; |
|
| 890 | - } |
|
| 891 | - } else {
|
|
| 892 | - $where .= " AND $wpdb->posts.post_author = '-1' AND $wpdb->posts.post_status = 'publish' "; |
|
| 893 | - } |
|
| 878 | + if ($user_id > 0) {
|
|
| 879 | + if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
|
|
| 880 | + $user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true); |
|
| 881 | + $user_fav_posts = !empty($user_fav_posts) && is_array($user_fav_posts) ? implode("','", $user_fav_posts) : '-1';
|
|
| 882 | + $where .= " AND $wpdb->posts.ID IN ('$user_fav_posts')";
|
|
| 883 | + } else |
|
| 884 | + $where .= " AND $wpdb->posts.post_author = $user_id"; |
|
| 885 | + |
|
| 886 | + if ($user_id == (int)get_current_user_id()) {
|
|
| 887 | + $where .= " AND $wpdb->posts.post_status IN ('publish','draft','pending') ";
|
|
| 888 | + } else {
|
|
| 889 | + $where .= " AND $wpdb->posts.post_status = 'publish' "; |
|
| 890 | + } |
|
| 891 | + } else {
|
|
| 892 | + $where .= " AND $wpdb->posts.post_author = '-1' AND $wpdb->posts.post_status = 'publish' "; |
|
| 893 | + } |
|
| 894 | 894 | |
| 895 | - ########### WPML ########### |
|
| 896 | - if (function_exists('icl_object_id')) {
|
|
| 897 | - $lang_code = ICL_LANGUAGE_CODE; |
|
| 898 | - if ($lang_code) {
|
|
| 899 | - $where .= " AND icl_t.language_code='" . $lang_code . "' "; |
|
| 900 | - } |
|
| 895 | + ########### WPML ########### |
|
| 896 | + if (function_exists('icl_object_id')) {
|
|
| 897 | + $lang_code = ICL_LANGUAGE_CODE; |
|
| 898 | + if ($lang_code) {
|
|
| 899 | + $where .= " AND icl_t.language_code='" . $lang_code . "' "; |
|
| 900 | + } |
|
| 901 | 901 | |
| 902 | - } |
|
| 903 | - ########### WPML ########### |
|
| 902 | + } |
|
| 903 | + ########### WPML ########### |
|
| 904 | 904 | |
| 905 | - return $where; |
|
| 905 | + return $where; |
|
| 906 | 906 | } |
| 907 | 907 | |
| 908 | 908 | /** |
@@ -917,11 +917,11 @@ discard block |
||
| 917 | 917 | */ |
| 918 | 918 | function geodir_filter_widget_join($join) |
| 919 | 919 | {
|
| 920 | - global $wp_query, $table; |
|
| 921 | - if (!empty($wp_query->query['with_pics_only'])) {
|
|
| 922 | - $join .= " LEFT JOIN " . GEODIR_ATTACHMENT_TABLE . " ON ( " . GEODIR_ATTACHMENT_TABLE . ".post_id=" . $table . ".post_id AND " . GEODIR_ATTACHMENT_TABLE . ".mime_type LIKE '%image%' )"; |
|
| 923 | - } |
|
| 924 | - return $join; |
|
| 920 | + global $wp_query, $table; |
|
| 921 | + if (!empty($wp_query->query['with_pics_only'])) {
|
|
| 922 | + $join .= " LEFT JOIN " . GEODIR_ATTACHMENT_TABLE . " ON ( " . GEODIR_ATTACHMENT_TABLE . ".post_id=" . $table . ".post_id AND " . GEODIR_ATTACHMENT_TABLE . ".mime_type LIKE '%image%' )"; |
|
| 923 | + } |
|
| 924 | + return $join; |
|
| 925 | 925 | } |
| 926 | 926 | |
| 927 | 927 | /** |
@@ -936,18 +936,18 @@ discard block |
||
| 936 | 936 | */ |
| 937 | 937 | function geodir_filter_widget_where($where) |
| 938 | 938 | {
|
| 939 | - global $wp_query, $table; |
|
| 940 | - if (!empty($wp_query->query['show_featured_only'])) {
|
|
| 941 | - $where .= " AND " . $table . ".is_featured = '1'"; |
|
| 942 | - } |
|
| 943 | - if (!empty($wp_query->query['show_special_only'])) {
|
|
| 944 | - $where .= " AND ( " . $table . ".geodir_special_offers != '' AND " . $table . ".geodir_special_offers IS NOT NULL )"; |
|
| 945 | - } |
|
| 946 | - if (!empty($wp_query->query['with_pics_only'])) {
|
|
| 947 | - $where .= " AND " . GEODIR_ATTACHMENT_TABLE . ".ID IS NOT NULL GROUP BY " . $table . ".post_id"; |
|
| 948 | - } |
|
| 949 | - if (!empty($wp_query->query['with_videos_only'])) {
|
|
| 950 | - $where .= " AND ( " . $table . ".geodir_video != '' AND " . $table . ".geodir_video IS NOT NULL )"; |
|
| 951 | - } |
|
| 952 | - return $where; |
|
| 939 | + global $wp_query, $table; |
|
| 940 | + if (!empty($wp_query->query['show_featured_only'])) {
|
|
| 941 | + $where .= " AND " . $table . ".is_featured = '1'"; |
|
| 942 | + } |
|
| 943 | + if (!empty($wp_query->query['show_special_only'])) {
|
|
| 944 | + $where .= " AND ( " . $table . ".geodir_special_offers != '' AND " . $table . ".geodir_special_offers IS NOT NULL )"; |
|
| 945 | + } |
|
| 946 | + if (!empty($wp_query->query['with_pics_only'])) {
|
|
| 947 | + $where .= " AND " . GEODIR_ATTACHMENT_TABLE . ".ID IS NOT NULL GROUP BY " . $table . ".post_id"; |
|
| 948 | + } |
|
| 949 | + if (!empty($wp_query->query['with_videos_only'])) {
|
|
| 950 | + $where .= " AND ( " . $table . ".geodir_video != '' AND " . $table . ".geodir_video IS NOT NULL )"; |
|
| 951 | + } |
|
| 952 | + return $where; |
|
| 953 | 953 | } |
| 954 | 954 | \ No newline at end of file |
@@ -99,15 +99,15 @@ discard block |
||
| 99 | 99 | } // Distance |
| 100 | 100 | |
| 101 | 101 | if (isset($_REQUEST['sgeo_lat'])) {
|
| 102 | - $mylat = (float)esc_attr($_REQUEST['sgeo_lat']); |
|
| 102 | + $mylat = (float) esc_attr($_REQUEST['sgeo_lat']); |
|
| 103 | 103 | } else {
|
| 104 | - $mylat = (float)geodir_get_current_city_lat(); |
|
| 104 | + $mylat = (float) geodir_get_current_city_lat(); |
|
| 105 | 105 | } // Latatude |
| 106 | 106 | |
| 107 | 107 | if (isset($_REQUEST['sgeo_lon'])) {
|
| 108 | - $mylon = (float)esc_attr($_REQUEST['sgeo_lon']); |
|
| 108 | + $mylon = (float) esc_attr($_REQUEST['sgeo_lon']); |
|
| 109 | 109 | } else {
|
| 110 | - $mylon = (float)geodir_get_current_city_lng(); |
|
| 110 | + $mylon = (float) geodir_get_current_city_lng(); |
|
| 111 | 111 | } // Distance |
| 112 | 112 | |
| 113 | 113 | if (isset($_REQUEST['snear'])) {
|
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | |
| 121 | 121 | if ($snear == 'NEAR ME') {
|
| 122 | 122 | $ip = $_SERVER['REMOTE_ADDR']; |
| 123 | - $addr_details = unserialize(file_get_contents('http://www.geoplugin.net/php.gp?ip=' . $ip));
|
|
| 123 | + $addr_details = unserialize(file_get_contents('http://www.geoplugin.net/php.gp?ip='.$ip));
|
|
| 124 | 124 | $mylat = stripslashes(ucfirst($addr_details[geoplugin_latitude])); |
| 125 | 125 | $mylon = stripslashes(ucfirst($addr_details[geoplugin_longitude])); |
| 126 | 126 | } |
@@ -130,9 +130,9 @@ discard block |
||
| 130 | 130 | $s_AA = str_replace(" ", "", $s);
|
| 131 | 131 | $s_A = explode(",", $s_AA);
|
| 132 | 132 | $s_A = implode('","', $s_A);
|
| 133 | - $s_A = '"' . $s_A . '"'; |
|
| 133 | + $s_A = '"'.$s_A.'"'; |
|
| 134 | 134 | } else {
|
| 135 | - $s_A = '"' . $s . '"'; |
|
| 135 | + $s_A = '"'.$s.'"'; |
|
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | if (strstr($s, ' ')) {
|
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | } |
| 194 | 194 | if (isset($query->query_vars['is_geodir_loop']) && $query->query_vars['is_geodir_loop']) {
|
| 195 | 195 | |
| 196 | - $table = $plugin_prefix . $geodir_post_type . '_detail'; |
|
| 196 | + $table = $plugin_prefix.$geodir_post_type.'_detail'; |
|
| 197 | 197 | |
| 198 | 198 | add_filter('posts_fields', 'geodir_posts_fields', 1);
|
| 199 | 199 | add_filter('posts_join', 'geodir_posts_join', 1);
|
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | global $wp_query, $wpdb, $geodir_post_type, $table, $plugin_prefix, $dist, $mylat, $mylon, $snear, $gd_session; |
| 234 | 234 | |
| 235 | 235 | // Filter-Location-Manager to add location table. |
| 236 | - $fields .= ", " . $table . ".* "; |
|
| 236 | + $fields .= ", ".$table.".* "; |
|
| 237 | 237 | |
| 238 | 238 | if ($snear != '' || $gd_session->get('all_near_me')) {
|
| 239 | 239 | $DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
|
@@ -243,16 +243,16 @@ discard block |
||
| 243 | 243 | $mylon = $gd_session->get('user_lon');
|
| 244 | 244 | } |
| 245 | 245 | |
| 246 | - $fields .= " , (" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) )))as distance ";
|
|
| 246 | + $fields .= " , (".$DistanceRadius." * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(".$table.".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(".$table.".post_latitude) * pi()/180) *POWER(SIN(($mylon - ".$table.".post_longitude) * pi()/180 / 2), 2) )))as distance ";
|
|
| 247 | 247 | } |
| 248 | 248 | |
| 249 | 249 | global $s; |
| 250 | 250 | if (is_search() && isset($_REQUEST['geodir_search']) && $s && trim($s) != '') {
|
| 251 | 251 | $keywords = explode(" ", $s);
|
| 252 | 252 | |
| 253 | - if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
|
|
| 254 | - foreach($keywords as $kkey=>$kword){
|
|
| 255 | - if(mb_strlen($kword, 'UTF-8')<=$klimit){
|
|
| 253 | + if (is_array($keywords) && $klimit = get_option('geodir_search_word_limit')) {
|
|
| 254 | + foreach ($keywords as $kkey=>$kword) {
|
|
| 255 | + if (mb_strlen($kword, 'UTF-8') <= $klimit) {
|
|
| 256 | 256 | unset($keywords[$kkey]); |
| 257 | 257 | } |
| 258 | 258 | } |
@@ -270,24 +270,24 @@ discard block |
||
| 270 | 270 | $count = 0; |
| 271 | 271 | foreach ($keywords as $keyword) {
|
| 272 | 272 | $keyword = trim($keyword); |
| 273 | - $keyword = wp_specialchars_decode($keyword ,ENT_QUOTES); |
|
| 273 | + $keyword = wp_specialchars_decode($keyword, ENT_QUOTES); |
|
| 274 | 274 | $count++; |
| 275 | 275 | if ($count < count($keywords)) {
|
| 276 | 276 | // $gd_titlematch_part .= $wpdb->posts . ".post_title LIKE '%%" . $keyword . "%%' " . $key . " "; |
| 277 | - $gd_titlematch_part .= "( " . $wpdb->posts . ".post_title LIKE '" . $keyword . "' OR " . $wpdb->posts . ".post_title LIKE '" . $keyword . "%%' OR " . $wpdb->posts . ".post_title LIKE '%% " . $keyword . "%%' ) " . $key . " "; |
|
| 277 | + $gd_titlematch_part .= "( ".$wpdb->posts.".post_title LIKE '".$keyword."' OR ".$wpdb->posts.".post_title LIKE '".$keyword."%%' OR ".$wpdb->posts.".post_title LIKE '%% ".$keyword."%%' ) ".$key." "; |
|
| 278 | 278 | } else {
|
| 279 | 279 | //$gd_titlematch_part .= $wpdb->posts . ".post_title LIKE '%%" . $keyword . "%%' "; |
| 280 | - $gd_titlematch_part .= "( " . $wpdb->posts . ".post_title LIKE '" . $keyword . "' OR " . $wpdb->posts . ".post_title LIKE '" . $keyword . "%%' OR " . $wpdb->posts . ".post_title LIKE '%% " . $keyword . "%%' ) "; |
|
| 280 | + $gd_titlematch_part .= "( ".$wpdb->posts.".post_title LIKE '".$keyword."' OR ".$wpdb->posts.".post_title LIKE '".$keyword."%%' OR ".$wpdb->posts.".post_title LIKE '%% ".$keyword."%%' ) "; |
|
| 281 | 281 | } |
| 282 | 282 | } |
| 283 | - $gd_titlematch_part .= "THEN 1 ELSE 0 END AS " . $part . ","; |
|
| 283 | + $gd_titlematch_part .= "THEN 1 ELSE 0 END AS ".$part.","; |
|
| 284 | 284 | } |
| 285 | 285 | } else {
|
| 286 | 286 | $gd_titlematch_part = ""; |
| 287 | 287 | } |
| 288 | - $s = stripslashes_deep( $s ); |
|
| 289 | - $s = wp_specialchars_decode($s,ENT_QUOTES); |
|
| 290 | - $fields .= $wpdb->prepare(", CASE WHEN " . $table . ".is_featured='1' THEN 1 ELSE 0 END AS gd_featured, CASE WHEN " . $wpdb->posts . ".post_title LIKE %s THEN 1 ELSE 0 END AS gd_exacttitle," . $gd_titlematch_part . " CASE WHEN ( " . $wpdb->posts . ".post_title LIKE %s OR " . $wpdb->posts . ".post_title LIKE %s OR " . $wpdb->posts . ".post_title LIKE %s ) THEN 1 ELSE 0 END AS gd_titlematch, CASE WHEN ( " . $wpdb->posts . ".post_content LIKE %s OR " . $wpdb->posts . ".post_content LIKE %s OR " . $wpdb->posts . ".post_content LIKE %s OR " . $wpdb->posts . ".post_content LIKE %s ) THEN 1 ELSE 0 END AS gd_content", array($s, $s, $s . '%', '% ' . $s . '%', $s, $s . ' %', '% ' . $s . ' %', '% ' . $s));
|
|
| 288 | + $s = stripslashes_deep($s); |
|
| 289 | + $s = wp_specialchars_decode($s, ENT_QUOTES); |
|
| 290 | + $fields .= $wpdb->prepare(", CASE WHEN ".$table.".is_featured='1' THEN 1 ELSE 0 END AS gd_featured, CASE WHEN ".$wpdb->posts.".post_title LIKE %s THEN 1 ELSE 0 END AS gd_exacttitle,".$gd_titlematch_part." CASE WHEN ( ".$wpdb->posts.".post_title LIKE %s OR ".$wpdb->posts.".post_title LIKE %s OR ".$wpdb->posts.".post_title LIKE %s ) THEN 1 ELSE 0 END AS gd_titlematch, CASE WHEN ( ".$wpdb->posts.".post_content LIKE %s OR ".$wpdb->posts.".post_content LIKE %s OR ".$wpdb->posts.".post_content LIKE %s OR ".$wpdb->posts.".post_content LIKE %s ) THEN 1 ELSE 0 END AS gd_content", array($s, $s, $s.'%', '% '.$s.'%', $s, $s.' %', '% '.$s.' %', '% '.$s));
|
|
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | return $fields; |
@@ -316,13 +316,13 @@ discard block |
||
| 316 | 316 | $lang_code = ICL_LANGUAGE_CODE; |
| 317 | 317 | $default_lang_code = $sitepress->get_default_language(); |
| 318 | 318 | if ($lang_code) {
|
| 319 | - $join .= "JOIN " . $table_prefix . "icl_translations icl_t ON icl_t.element_id = " . $table_prefix . "posts.ID"; |
|
| 319 | + $join .= "JOIN ".$table_prefix."icl_translations icl_t ON icl_t.element_id = ".$table_prefix."posts.ID"; |
|
| 320 | 320 | } |
| 321 | 321 | |
| 322 | 322 | } |
| 323 | 323 | ########### WPML ########### |
| 324 | 324 | |
| 325 | - $join .= " INNER JOIN " . $table . " ON (" . $table . ".post_id = $wpdb->posts.ID) ";
|
|
| 325 | + $join .= " INNER JOIN ".$table." ON (".$table.".post_id = $wpdb->posts.ID) ";
|
|
| 326 | 326 | //===old code start |
| 327 | 327 | //$join .= " INNER JOIN ".POST_LOCATION_TABLE." ON (".$table.".post_location_id = ".POST_LOCATION_TABLE.".location_id) " ;//===old code end
|
| 328 | 328 | |
@@ -405,20 +405,20 @@ discard block |
||
| 405 | 405 | break; |
| 406 | 406 | case 'low_review': |
| 407 | 407 | case 'rating_count_asc': |
| 408 | - $orderby = $table . ".rating_count ASC, " . $table . ".overall_rating ASC, "; |
|
| 408 | + $orderby = $table.".rating_count ASC, ".$table.".overall_rating ASC, "; |
|
| 409 | 409 | break; |
| 410 | 410 | case 'high_review': |
| 411 | 411 | case 'rating_count_desc': |
| 412 | - $orderby = $table . ".rating_count DESC, " . $table . ".overall_rating DESC, "; |
|
| 412 | + $orderby = $table.".rating_count DESC, ".$table.".overall_rating DESC, "; |
|
| 413 | 413 | break; |
| 414 | 414 | case 'low_rating': |
| 415 | - $orderby = "( " . $table . ".overall_rating ) ASC, " . $table . ".rating_count ASC, "; |
|
| 415 | + $orderby = "( ".$table.".overall_rating ) ASC, ".$table.".rating_count ASC, "; |
|
| 416 | 416 | break; |
| 417 | 417 | case 'high_rating': |
| 418 | - $orderby = " " . $table . ".overall_rating DESC, " . $table . ".rating_count DESC, "; |
|
| 418 | + $orderby = " ".$table.".overall_rating DESC, ".$table.".rating_count DESC, "; |
|
| 419 | 419 | break; |
| 420 | 420 | case 'featured': |
| 421 | - $orderby = $table . ".is_featured asc, "; |
|
| 421 | + $orderby = $table.".is_featured asc, "; |
|
| 422 | 422 | break; |
| 423 | 423 | case 'nearest': |
| 424 | 424 | $orderby = " distance asc, "; |
@@ -441,24 +441,24 @@ discard block |
||
| 441 | 441 | |
| 442 | 442 | if (is_search() && isset($_REQUEST['geodir_search']) && $s && trim($s) != '') {
|
| 443 | 443 | $keywords = explode(" ", $s);
|
| 444 | - if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
|
|
| 445 | - foreach($keywords as $kkey=>$kword){
|
|
| 446 | - if(mb_strlen($kword, 'UTF-8')<=$klimit){
|
|
| 444 | + if (is_array($keywords) && $klimit = get_option('geodir_search_word_limit')) {
|
|
| 445 | + foreach ($keywords as $kkey=>$kword) {
|
|
| 446 | + if (mb_strlen($kword, 'UTF-8') <= $klimit) {
|
|
| 447 | 447 | unset($keywords[$kkey]); |
| 448 | 448 | } |
| 449 | 449 | } |
| 450 | 450 | } |
| 451 | 451 | if ($sort_by == 'nearest' || $sort_by == 'farthest') {
|
| 452 | 452 | if (count($keywords) > 1) {
|
| 453 | - $orderby = $orderby . " ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, "; |
|
| 453 | + $orderby = $orderby." ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, "; |
|
| 454 | 454 | } else {
|
| 455 | - $orderby = $orderby . " ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, "; |
|
| 455 | + $orderby = $orderby." ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, "; |
|
| 456 | 456 | } |
| 457 | 457 | } else {
|
| 458 | 458 | if (count($keywords) > 1) {
|
| 459 | - $orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, " . $orderby; |
|
| 459 | + $orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, ".$orderby; |
|
| 460 | 460 | } else {
|
| 461 | - $orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, " . $orderby; |
|
| 461 | + $orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, ".$orderby; |
|
| 462 | 462 | } |
| 463 | 463 | } |
| 464 | 464 | } |
@@ -473,7 +473,7 @@ discard block |
||
| 473 | 473 | */ |
| 474 | 474 | $orderby = apply_filters('geodir_posts_order_by_sort', $orderby, $sort_by, $table);
|
| 475 | 475 | |
| 476 | - $orderby .= $table . ".is_featured asc, $wpdb->posts.post_date desc, $wpdb->posts.post_title "; |
|
| 476 | + $orderby .= $table.".is_featured asc, $wpdb->posts.post_date desc, $wpdb->posts.post_title "; |
|
| 477 | 477 | |
| 478 | 478 | return $orderby; |
| 479 | 479 | } |
@@ -505,31 +505,31 @@ discard block |
||
| 505 | 505 | |
| 506 | 506 | if ($sort_by_count > 1 && ($order == 'asc' || $order == 'desc')) {
|
| 507 | 507 | |
| 508 | - $sort_by = str_replace('_' . $order, '', $sort_by);
|
|
| 508 | + $sort_by = str_replace('_'.$order, '', $sort_by);
|
|
| 509 | 509 | |
| 510 | 510 | switch ($sort_by): |
| 511 | 511 | |
| 512 | 512 | case 'post_date': |
| 513 | 513 | case 'comment_count': |
| 514 | 514 | |
| 515 | - $orderby = "$wpdb->posts." . $sort_by . " " . $order . ", ".$table . ".overall_rating " . $order . ", "; |
|
| 515 | + $orderby = "$wpdb->posts.".$sort_by." ".$order.", ".$table.".overall_rating ".$order.", "; |
|
| 516 | 516 | break; |
| 517 | 517 | |
| 518 | 518 | case 'distance': |
| 519 | - $orderby = $sort_by . " " . $order . ", "; |
|
| 519 | + $orderby = $sort_by." ".$order.", "; |
|
| 520 | 520 | break; |
| 521 | 521 | |
| 522 | 522 | |
| 523 | 523 | // sort by rating |
| 524 | 524 | case 'overall_rating': |
| 525 | - $orderby = " " . $table . "." . $sort_by . " " . $order . ", " . $table . ".rating_count " . $order . ", "; |
|
| 525 | + $orderby = " ".$table.".".$sort_by." ".$order.", ".$table.".rating_count ".$order.", "; |
|
| 526 | 526 | |
| 527 | 527 | break; |
| 528 | 528 | |
| 529 | 529 | |
| 530 | 530 | default: |
| 531 | 531 | if (geodir_column_exist($table, $sort_by)) {
|
| 532 | - $orderby = $table . "." . $sort_by . " " . $order . ", "; |
|
| 532 | + $orderby = $table.".".$sort_by." ".$order.", "; |
|
| 533 | 533 | } |
| 534 | 534 | break; |
| 535 | 535 | |
@@ -577,7 +577,7 @@ discard block |
||
| 577 | 577 | } |
| 578 | 578 | |
| 579 | 579 | //if (!geodir_is_page('detail'))
|
| 580 | - add_filter('posts_where', 'geodir_default_where', 1);/**/
|
|
| 580 | + add_filter('posts_where', 'geodir_default_where', 1); /**/
|
|
| 581 | 581 | |
| 582 | 582 | //add_filter( 'user_has_cap', 'geodir_preview_post_cap', 10, 3 );// let subscribers edit their own posts |
| 583 | 583 | |
@@ -648,7 +648,7 @@ discard block |
||
| 648 | 648 | $q_post_type = isset($wp_query->query['post_type']) ? $wp_query->query['post_type'] : ''; |
| 649 | 649 | //echo '##########'.$q_post_type; |
| 650 | 650 | if ($lang_code && $q_post_type) {
|
| 651 | - $where .= " AND icl_t.language_code = '$lang_code' AND icl_t.element_type IN('post_" . $q_post_type . "') ";
|
|
| 651 | + $where .= " AND icl_t.language_code = '$lang_code' AND icl_t.element_type IN('post_".$q_post_type."') ";
|
|
| 652 | 652 | //$where .= " AND icl_t.language_code = '$lang_code' "; |
| 653 | 653 | } |
| 654 | 654 | |
@@ -715,8 +715,8 @@ discard block |
||
| 715 | 715 | } |
| 716 | 716 | |
| 717 | 717 | $s = trim($s); |
| 718 | - $s = wp_specialchars_decode($s ,ENT_QUOTES); |
|
| 719 | - $s_A = wp_specialchars_decode($s_A ,ENT_QUOTES); |
|
| 718 | + $s = wp_specialchars_decode($s, ENT_QUOTES); |
|
| 719 | + $s_A = wp_specialchars_decode($s_A, ENT_QUOTES); |
|
| 720 | 720 | |
| 721 | 721 | $where = ''; |
| 722 | 722 | $better_search_terms = ''; |
@@ -727,9 +727,9 @@ discard block |
||
| 727 | 727 | |
| 728 | 728 | if ($s != '') {
|
| 729 | 729 | $keywords = explode(" ", $s);
|
| 730 | - if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
|
|
| 731 | - foreach($keywords as $kkey=>$kword){
|
|
| 732 | - if(mb_strlen($kword, 'UTF-8')<=$klimit){
|
|
| 730 | + if (is_array($keywords) && $klimit = get_option('geodir_search_word_limit')) {
|
|
| 731 | + foreach ($keywords as $kkey=>$kword) {
|
|
| 732 | + if (mb_strlen($kword, 'UTF-8') <= $klimit) {
|
|
| 733 | 733 | unset($keywords[$kkey]); |
| 734 | 734 | } |
| 735 | 735 | } |
@@ -738,7 +738,7 @@ discard block |
||
| 738 | 738 | if (!empty($keywords)) {
|
| 739 | 739 | foreach ($keywords as $keyword) {
|
| 740 | 740 | $keyword = trim($keyword); |
| 741 | - $keyword = wp_specialchars_decode($keyword ,ENT_QUOTES); |
|
| 741 | + $keyword = wp_specialchars_decode($keyword, ENT_QUOTES); |
|
| 742 | 742 | if ($keyword != '') {
|
| 743 | 743 | /** |
| 744 | 744 | * Filter the search query keywords SQL. |
@@ -749,7 +749,7 @@ discard block |
||
| 749 | 749 | * @param array $keywords The array of keywords for the query. |
| 750 | 750 | * @param string $keyword The single keyword being searched. |
| 751 | 751 | */ |
| 752 | - $better_search_terms .= apply_filters("geodir_search_better_search_terms",' OR ( ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '" OR ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '%" OR ' . $wpdb->posts . '.post_title LIKE "% ' . $keyword . '%" )',$keywords,$keyword);
|
|
| 752 | + $better_search_terms .= apply_filters("geodir_search_better_search_terms", ' OR ( '.$wpdb->posts.'.post_title LIKE "'.$keyword.'" OR '.$wpdb->posts.'.post_title LIKE "'.$keyword.'%" OR '.$wpdb->posts.'.post_title LIKE "% '.$keyword.'%" )', $keywords, $keyword);
|
|
| 753 | 753 | } |
| 754 | 754 | } |
| 755 | 755 | } |
@@ -757,10 +757,10 @@ discard block |
||
| 757 | 757 | |
| 758 | 758 | /* get taxonomy */ |
| 759 | 759 | $taxonomies = geodir_get_taxonomies($post_types, true); |
| 760 | - if($taxonomies) {
|
|
| 760 | + if ($taxonomies) {
|
|
| 761 | 761 | $taxonomies = implode("','", $taxonomies);
|
| 762 | - $taxonomies = "'" . $taxonomies . "'"; |
|
| 763 | - }else{$taxonomies='';}
|
|
| 762 | + $taxonomies = "'".$taxonomies."'"; |
|
| 763 | + } else {$taxonomies = ''; }
|
|
| 764 | 764 | |
| 765 | 765 | $content_where = $terms_where = ''; |
| 766 | 766 | if ($s != '') {
|
@@ -771,7 +771,7 @@ discard block |
||
| 771 | 771 | * @package GeoDirectory |
| 772 | 772 | * @param string $content_where The query values, default: `" OR ($wpdb->posts.post_content LIKE \"$s\" OR $wpdb->posts.post_content LIKE \"$s%\" OR $wpdb->posts.post_content LIKE \"% $s%\" OR $wpdb->posts.post_content LIKE \"%>$s%\" OR $wpdb->posts.post_content LIKE \"%\n$s%\") ") "`. |
| 773 | 773 | */ |
| 774 | - $content_where = apply_filters("geodir_search_content_where"," OR ($wpdb->posts.post_content LIKE \"$s\" OR $wpdb->posts.post_content LIKE \"$s%\" OR $wpdb->posts.post_content LIKE \"% $s%\" OR $wpdb->posts.post_content LIKE \"%>$s%\" OR $wpdb->posts.post_content LIKE \"%\n$s%\") ");
|
|
| 774 | + $content_where = apply_filters("geodir_search_content_where", " OR ($wpdb->posts.post_content LIKE \"$s\" OR $wpdb->posts.post_content LIKE \"$s%\" OR $wpdb->posts.post_content LIKE \"% $s%\" OR $wpdb->posts.post_content LIKE \"%>$s%\" OR $wpdb->posts.post_content LIKE \"%\n$s%\") ");
|
|
| 775 | 775 | /** |
| 776 | 776 | * Filter the search query term values. |
| 777 | 777 | * |
@@ -779,7 +779,7 @@ discard block |
||
| 779 | 779 | * @package GeoDirectory |
| 780 | 780 | * @param string $terms_where The separator, default: `" AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) "`. |
| 781 | 781 | */ |
| 782 | - $terms_where = apply_filters("geodir_search_terms_where"," AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) ");
|
|
| 782 | + $terms_where = apply_filters("geodir_search_terms_where", " AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) ");
|
|
| 783 | 783 | } |
| 784 | 784 | |
| 785 | 785 | if ($snear != '') {
|
@@ -814,12 +814,12 @@ discard block |
||
| 814 | 814 | ) |
| 815 | 815 | AND $wpdb->posts.post_type in ('{$post_types}')
|
| 816 | 816 | AND ($wpdb->posts.post_status = 'publish') |
| 817 | - AND ( " . $table . ".post_latitude between $rlat1 and $rlat2 ) |
|
| 818 | - AND ( " . $table . ".post_longitude between $rlon1 and $rlon2 ) "; |
|
| 817 | + AND ( ".$table.".post_latitude between $rlat1 and $rlat2 ) |
|
| 818 | + AND ( ".$table.".post_longitude between $rlon1 and $rlon2 ) "; |
|
| 819 | 819 | |
| 820 | 820 | if (isset($_REQUEST['sdist']) && $_REQUEST['sdist'] != 'all') {
|
| 821 | 821 | $DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
|
| 822 | - $where .= " AND CONVERT((" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) ))),DECIMAL(64,4)) <= " . $dist;
|
|
| 822 | + $where .= " AND CONVERT((".$DistanceRadius." * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(".$table.".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(".$table.".post_latitude) * pi()/180) *POWER(SIN(($mylon - ".$table.".post_longitude) * pi()/180 / 2), 2) ))),DECIMAL(64,4)) <= ".$dist;
|
|
| 823 | 823 | } |
| 824 | 824 | |
| 825 | 825 | } else {
|
@@ -840,11 +840,11 @@ discard block |
||
| 840 | 840 | } |
| 841 | 841 | |
| 842 | 842 | ########### WPML ########### |
| 843 | - if ( function_exists( 'icl_object_id' ) ) {
|
|
| 843 | + if (function_exists('icl_object_id')) {
|
|
| 844 | 844 | $lang_code = ICL_LANGUAGE_CODE; |
| 845 | 845 | |
| 846 | 846 | if ($lang_code && $post_types) {
|
| 847 | - $where .= " AND icl_t.language_code = '".$lang_code."' AND icl_t.element_type IN('post_" . $post_types . "') ";
|
|
| 847 | + $where .= " AND icl_t.language_code = '".$lang_code."' AND icl_t.element_type IN('post_".$post_types."') ";
|
|
| 848 | 848 | } |
| 849 | 849 | } |
| 850 | 850 | ########### WPML ########### |
@@ -867,10 +867,10 @@ discard block |
||
| 867 | 867 | global $wpdb, $geodir_post_type, $table, $curr; |
| 868 | 868 | |
| 869 | 869 | $curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
|
| 870 | - $user_id = !empty($curauth->ID) ? (int)$curauth->ID : 0; |
|
| 870 | + $user_id = !empty($curauth->ID) ? (int) $curauth->ID : 0; |
|
| 871 | 871 | |
| 872 | 872 | if (isset($_REQUEST['stype'])) {
|
| 873 | - $where = $wpdb->prepare(" AND $wpdb->posts.post_type IN (%s) ",$_REQUEST['stype']);
|
|
| 873 | + $where = $wpdb->prepare(" AND $wpdb->posts.post_type IN (%s) ", $_REQUEST['stype']);
|
|
| 874 | 874 | } else {
|
| 875 | 875 | $where = " AND $wpdb->posts.post_type IN ('gd_place') ";
|
| 876 | 876 | } |
@@ -883,7 +883,7 @@ discard block |
||
| 883 | 883 | } else |
| 884 | 884 | $where .= " AND $wpdb->posts.post_author = $user_id"; |
| 885 | 885 | |
| 886 | - if ($user_id == (int)get_current_user_id()) {
|
|
| 886 | + if ($user_id == (int) get_current_user_id()) {
|
|
| 887 | 887 | $where .= " AND $wpdb->posts.post_status IN ('publish','draft','pending') ";
|
| 888 | 888 | } else {
|
| 889 | 889 | $where .= " AND $wpdb->posts.post_status = 'publish' "; |
@@ -896,7 +896,7 @@ discard block |
||
| 896 | 896 | if (function_exists('icl_object_id')) {
|
| 897 | 897 | $lang_code = ICL_LANGUAGE_CODE; |
| 898 | 898 | if ($lang_code) {
|
| 899 | - $where .= " AND icl_t.language_code='" . $lang_code . "' "; |
|
| 899 | + $where .= " AND icl_t.language_code='".$lang_code."' "; |
|
| 900 | 900 | } |
| 901 | 901 | |
| 902 | 902 | } |
@@ -919,7 +919,7 @@ discard block |
||
| 919 | 919 | {
|
| 920 | 920 | global $wp_query, $table; |
| 921 | 921 | if (!empty($wp_query->query['with_pics_only'])) {
|
| 922 | - $join .= " LEFT JOIN " . GEODIR_ATTACHMENT_TABLE . " ON ( " . GEODIR_ATTACHMENT_TABLE . ".post_id=" . $table . ".post_id AND " . GEODIR_ATTACHMENT_TABLE . ".mime_type LIKE '%image%' )"; |
|
| 922 | + $join .= " LEFT JOIN ".GEODIR_ATTACHMENT_TABLE." ON ( ".GEODIR_ATTACHMENT_TABLE.".post_id=".$table.".post_id AND ".GEODIR_ATTACHMENT_TABLE.".mime_type LIKE '%image%' )"; |
|
| 923 | 923 | } |
| 924 | 924 | return $join; |
| 925 | 925 | } |
@@ -938,16 +938,16 @@ discard block |
||
| 938 | 938 | {
|
| 939 | 939 | global $wp_query, $table; |
| 940 | 940 | if (!empty($wp_query->query['show_featured_only'])) {
|
| 941 | - $where .= " AND " . $table . ".is_featured = '1'"; |
|
| 941 | + $where .= " AND ".$table.".is_featured = '1'"; |
|
| 942 | 942 | } |
| 943 | 943 | if (!empty($wp_query->query['show_special_only'])) {
|
| 944 | - $where .= " AND ( " . $table . ".geodir_special_offers != '' AND " . $table . ".geodir_special_offers IS NOT NULL )"; |
|
| 944 | + $where .= " AND ( ".$table.".geodir_special_offers != '' AND ".$table.".geodir_special_offers IS NOT NULL )"; |
|
| 945 | 945 | } |
| 946 | 946 | if (!empty($wp_query->query['with_pics_only'])) {
|
| 947 | - $where .= " AND " . GEODIR_ATTACHMENT_TABLE . ".ID IS NOT NULL GROUP BY " . $table . ".post_id"; |
|
| 947 | + $where .= " AND ".GEODIR_ATTACHMENT_TABLE.".ID IS NOT NULL GROUP BY ".$table.".post_id"; |
|
| 948 | 948 | } |
| 949 | 949 | if (!empty($wp_query->query['with_videos_only'])) {
|
| 950 | - $where .= " AND ( " . $table . ".geodir_video != '' AND " . $table . ".geodir_video IS NOT NULL )"; |
|
| 950 | + $where .= " AND ( ".$table.".geodir_video != '' AND ".$table.".geodir_video IS NOT NULL )"; |
|
| 951 | 951 | } |
| 952 | 952 | return $where; |
| 953 | 953 | } |
| 954 | 954 | \ No newline at end of file |
@@ -24,8 +24,8 @@ discard block |
||
| 24 | 24 | function geodir_activation() |
| 25 | 25 | {
|
| 26 | 26 | |
| 27 | - geodir_install(); |
|
| 28 | - add_action('wp_loaded', 'geodir_flush_activation');
|
|
| 27 | + geodir_install(); |
|
| 28 | + add_action('wp_loaded', 'geodir_flush_activation');
|
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | /** |
@@ -36,9 +36,9 @@ discard block |
||
| 36 | 36 | */ |
| 37 | 37 | function geodir_flush_activation() |
| 38 | 38 | {
|
| 39 | - // Remove rewrite rules and then recreate rewrite rules. |
|
| 40 | - // flush late so everything is loaded |
|
| 41 | - flush_rewrite_rules(); |
|
| 39 | + // Remove rewrite rules and then recreate rewrite rules. |
|
| 40 | + // flush late so everything is loaded |
|
| 41 | + flush_rewrite_rules(); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | /** |
@@ -50,44 +50,44 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | function geodir_install() |
| 52 | 52 | {
|
| 53 | - global $geodir_settings; |
|
| 54 | - |
|
| 55 | - /** |
|
| 56 | - * Called before the GD installation scripts have run. |
|
| 57 | - * |
|
| 58 | - * @since 1.0.0 |
|
| 59 | - * @see 'geodir_installation_end' |
|
| 60 | - */ |
|
| 61 | - do_action('geodir_installation_start');
|
|
| 62 | - |
|
| 63 | - // Do install |
|
| 64 | - if (!get_option('geodir_default_data_installed')) {
|
|
| 65 | - geodir_create_tables(); // in admin db install.php |
|
| 66 | - geodir_register_defaults(); // geodir_functions/ taxonomy_functions.php |
|
| 67 | - geodir_create_default_fields(); |
|
| 68 | - //geodir_default_taxonomies(); |
|
| 69 | - geodir_set_default_options(); |
|
| 70 | - geodir_create_pages(); |
|
| 71 | - geodir_set_default_widgets(); |
|
| 72 | - gd_install_theme_compat(); |
|
| 73 | - |
|
| 74 | - update_option('geodir_default_data_installed', 1);
|
|
| 75 | - |
|
| 76 | - } |
|
| 77 | - |
|
| 78 | - if (!get_option('geodir_default_data_installed_1.2.8')) {
|
|
| 79 | - //geodir_create_tables(); // in admin db install.php |
|
| 80 | - update_option('geodir_default_data_installed_1.2.8', 1);
|
|
| 81 | - } |
|
| 82 | - |
|
| 83 | - geodir_installation_end(); |
|
| 84 | - /** |
|
| 85 | - * Called after the GD installation scripts have run. |
|
| 86 | - * |
|
| 87 | - * @since 1.0.0 |
|
| 88 | - * @see 'geodir_installation_start' |
|
| 89 | - */ |
|
| 90 | - do_action('geodir_installation_end');
|
|
| 53 | + global $geodir_settings; |
|
| 54 | + |
|
| 55 | + /** |
|
| 56 | + * Called before the GD installation scripts have run. |
|
| 57 | + * |
|
| 58 | + * @since 1.0.0 |
|
| 59 | + * @see 'geodir_installation_end' |
|
| 60 | + */ |
|
| 61 | + do_action('geodir_installation_start');
|
|
| 62 | + |
|
| 63 | + // Do install |
|
| 64 | + if (!get_option('geodir_default_data_installed')) {
|
|
| 65 | + geodir_create_tables(); // in admin db install.php |
|
| 66 | + geodir_register_defaults(); // geodir_functions/ taxonomy_functions.php |
|
| 67 | + geodir_create_default_fields(); |
|
| 68 | + //geodir_default_taxonomies(); |
|
| 69 | + geodir_set_default_options(); |
|
| 70 | + geodir_create_pages(); |
|
| 71 | + geodir_set_default_widgets(); |
|
| 72 | + gd_install_theme_compat(); |
|
| 73 | + |
|
| 74 | + update_option('geodir_default_data_installed', 1);
|
|
| 75 | + |
|
| 76 | + } |
|
| 77 | + |
|
| 78 | + if (!get_option('geodir_default_data_installed_1.2.8')) {
|
|
| 79 | + //geodir_create_tables(); // in admin db install.php |
|
| 80 | + update_option('geodir_default_data_installed_1.2.8', 1);
|
|
| 81 | + } |
|
| 82 | + |
|
| 83 | + geodir_installation_end(); |
|
| 84 | + /** |
|
| 85 | + * Called after the GD installation scripts have run. |
|
| 86 | + * |
|
| 87 | + * @since 1.0.0 |
|
| 88 | + * @see 'geodir_installation_start' |
|
| 89 | + */ |
|
| 90 | + do_action('geodir_installation_end');
|
|
| 91 | 91 | |
| 92 | 92 | |
| 93 | 93 | } |
@@ -104,16 +104,16 @@ discard block |
||
| 104 | 104 | function geodir_create_pages() |
| 105 | 105 | {
|
| 106 | 106 | |
| 107 | - //geodir_create_page( esc_sql( _x('home-map', 'page_slug', 'geodirectory') ), 'geodir_home_map_page', __('Home Map', 'geodirectory'), '',0,'publish' );
|
|
| 108 | - geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), '');
|
|
| 109 | - geodir_create_page(esc_sql(_x('add-listing', 'page_slug', 'geodirectory')), 'geodir_add_listing_page', __('Add Listing', 'geodirectory'), '');
|
|
| 110 | - geodir_create_page(esc_sql(_x('listing-preview', 'page_slug', 'geodirectory')), 'geodir_preview_page', __('Listing Preview', 'geodirectory'), '');
|
|
| 111 | - geodir_create_page(esc_sql(_x('listing-success', 'page_slug', 'geodirectory')), 'geodir_success_page', __('Listing Success', 'geodirectory'), '');
|
|
| 112 | - geodir_create_page(esc_sql(_x('location', 'page_slug', 'geodirectory')), 'geodir_location_page', __('Location', 'geodirectory'), '');
|
|
| 107 | + //geodir_create_page( esc_sql( _x('home-map', 'page_slug', 'geodirectory') ), 'geodir_home_map_page', __('Home Map', 'geodirectory'), '',0,'publish' );
|
|
| 108 | + geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), '');
|
|
| 109 | + geodir_create_page(esc_sql(_x('add-listing', 'page_slug', 'geodirectory')), 'geodir_add_listing_page', __('Add Listing', 'geodirectory'), '');
|
|
| 110 | + geodir_create_page(esc_sql(_x('listing-preview', 'page_slug', 'geodirectory')), 'geodir_preview_page', __('Listing Preview', 'geodirectory'), '');
|
|
| 111 | + geodir_create_page(esc_sql(_x('listing-success', 'page_slug', 'geodirectory')), 'geodir_success_page', __('Listing Success', 'geodirectory'), '');
|
|
| 112 | + geodir_create_page(esc_sql(_x('location', 'page_slug', 'geodirectory')), 'geodir_location_page', __('Location', 'geodirectory'), '');
|
|
| 113 | 113 | |
| 114 | - //New since 1.5.3 |
|
| 115 | - geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), '');
|
|
| 116 | - geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), '');
|
|
| 114 | + //New since 1.5.3 |
|
| 115 | + geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), '');
|
|
| 116 | + geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), '');
|
|
| 117 | 117 | |
| 118 | 118 | |
| 119 | 119 | } |
@@ -129,11 +129,11 @@ discard block |
||
| 129 | 129 | */ |
| 130 | 130 | function geodir_installation_end() |
| 131 | 131 | {
|
| 132 | - //update_option( "geodir_db_version", GEODIRECTORY_VERSION ); |
|
| 132 | + //update_option( "geodir_db_version", GEODIRECTORY_VERSION ); |
|
| 133 | 133 | |
| 134 | - update_option("geodir_installed", 1);
|
|
| 135 | - update_option("geodir_installation_redirect", 1);
|
|
| 136 | - update_option('skip_install_geodir_pages', 0);
|
|
| 134 | + update_option("geodir_installed", 1);
|
|
| 135 | + update_option("geodir_installation_redirect", 1);
|
|
| 136 | + update_option('skip_install_geodir_pages', 0);
|
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | /** |
@@ -147,45 +147,45 @@ discard block |
||
| 147 | 147 | */ |
| 148 | 148 | function geodir_set_default_options() |
| 149 | 149 | {
|
| 150 | - global $geodir_settings; |
|
| 151 | - /** |
|
| 152 | - * Contains settings array for general tab. |
|
| 153 | - * |
|
| 154 | - * @since 1.0.0 |
|
| 155 | - * @package GeoDirectory |
|
| 156 | - */ |
|
| 157 | - include_once("option-pages/general_settings_array.php");
|
|
| 158 | - /** |
|
| 159 | - * Contains settings array for design tab. |
|
| 160 | - * |
|
| 161 | - * @since 1.0.0 |
|
| 162 | - * @package GeoDirectory |
|
| 163 | - */ |
|
| 164 | - include_once("option-pages/design_settings_array.php");
|
|
| 165 | - /** |
|
| 166 | - * Contains settings array for notifications tab. |
|
| 167 | - * |
|
| 168 | - * @since 1.0.0 |
|
| 169 | - * @package GeoDirectory |
|
| 170 | - */ |
|
| 171 | - include_once("option-pages/notifications_settings_array.php");
|
|
| 172 | - /** |
|
| 173 | - * Contains settings array for permalink tab. |
|
| 174 | - * |
|
| 175 | - * @since 1.0.0 |
|
| 176 | - * @package GeoDirectory |
|
| 177 | - */ |
|
| 178 | - include_once("option-pages/permalink_settings_array.php");
|
|
| 179 | - /** |
|
| 180 | - * Contains settings array for title / meta tab. |
|
| 181 | - * |
|
| 182 | - * @since 1.5.4 |
|
| 183 | - * @package GeoDirectory |
|
| 184 | - */ |
|
| 185 | - include_once("option-pages/title_meta_settings_array.php");
|
|
| 186 | - foreach ($geodir_settings as $value) {
|
|
| 187 | - geodir_update_options($value, true); |
|
| 188 | - } |
|
| 150 | + global $geodir_settings; |
|
| 151 | + /** |
|
| 152 | + * Contains settings array for general tab. |
|
| 153 | + * |
|
| 154 | + * @since 1.0.0 |
|
| 155 | + * @package GeoDirectory |
|
| 156 | + */ |
|
| 157 | + include_once("option-pages/general_settings_array.php");
|
|
| 158 | + /** |
|
| 159 | + * Contains settings array for design tab. |
|
| 160 | + * |
|
| 161 | + * @since 1.0.0 |
|
| 162 | + * @package GeoDirectory |
|
| 163 | + */ |
|
| 164 | + include_once("option-pages/design_settings_array.php");
|
|
| 165 | + /** |
|
| 166 | + * Contains settings array for notifications tab. |
|
| 167 | + * |
|
| 168 | + * @since 1.0.0 |
|
| 169 | + * @package GeoDirectory |
|
| 170 | + */ |
|
| 171 | + include_once("option-pages/notifications_settings_array.php");
|
|
| 172 | + /** |
|
| 173 | + * Contains settings array for permalink tab. |
|
| 174 | + * |
|
| 175 | + * @since 1.0.0 |
|
| 176 | + * @package GeoDirectory |
|
| 177 | + */ |
|
| 178 | + include_once("option-pages/permalink_settings_array.php");
|
|
| 179 | + /** |
|
| 180 | + * Contains settings array for title / meta tab. |
|
| 181 | + * |
|
| 182 | + * @since 1.5.4 |
|
| 183 | + * @package GeoDirectory |
|
| 184 | + */ |
|
| 185 | + include_once("option-pages/title_meta_settings_array.php");
|
|
| 186 | + foreach ($geodir_settings as $value) {
|
|
| 187 | + geodir_update_options($value, true); |
|
| 188 | + } |
|
| 189 | 189 | |
| 190 | 190 | } |
| 191 | 191 | |
@@ -199,103 +199,103 @@ discard block |
||
| 199 | 199 | function geodir_set_default_widgets() |
| 200 | 200 | {
|
| 201 | 201 | |
| 202 | - $widget_option_list = array(); |
|
| 203 | - $widgetinfo = array(); |
|
| 204 | - $sidebarvalue_array = array(); |
|
| 205 | - $sidebars_widgets = array(); |
|
| 202 | + $widget_option_list = array(); |
|
| 203 | + $widgetinfo = array(); |
|
| 204 | + $sidebarvalue_array = array(); |
|
| 205 | + $sidebars_widgets = array(); |
|
| 206 | 206 | |
| 207 | - /*===========================*/ |
|
| 208 | - /* Widgets ON HOME PAGE */ |
|
| 209 | - /*===========================*/ |
|
| 207 | + /*===========================*/ |
|
| 208 | + /* Widgets ON HOME PAGE */ |
|
| 209 | + /*===========================*/ |
|
| 210 | 210 | |
| 211 | - $widget_option_list['geodir_home_top'] = |
|
| 212 | - array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')),
|
|
| 213 | - 'geodir_map_v3_home_map' => array("autozoom" => 1, "width" => '100%', "heigh" => '425'),
|
|
| 214 | - 'geodir_advance_search' => array()); |
|
| 211 | + $widget_option_list['geodir_home_top'] = |
|
| 212 | + array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')),
|
|
| 213 | + 'geodir_map_v3_home_map' => array("autozoom" => 1, "width" => '100%', "heigh" => '425'),
|
|
| 214 | + 'geodir_advance_search' => array()); |
|
| 215 | 215 | |
| 216 | - $widget_option_list['geodir_home_content'] = |
|
| 217 | - array('popular_post_view' => array("title" => __('Popular Places', 'geodirectory'), "layout" => 'list', "add_location_filter" => '1'));
|
|
| 216 | + $widget_option_list['geodir_home_content'] = |
|
| 217 | + array('popular_post_view' => array("title" => __('Popular Places', 'geodirectory'), "layout" => 'list', "add_location_filter" => '1'));
|
|
| 218 | 218 | |
| 219 | - $widget_option_list['geodir_home_right'] = |
|
| 220 | - array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
|
|
| 221 | - 'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
|
|
| 219 | + $widget_option_list['geodir_home_right'] = |
|
| 220 | + array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
|
|
| 221 | + 'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
|
|
| 222 | 222 | |
| 223 | - /*===========================*/ |
|
| 224 | - /* Widgets ON LISTING PAGE */ |
|
| 225 | - /*===========================*/ |
|
| 223 | + /*===========================*/ |
|
| 224 | + /* Widgets ON LISTING PAGE */ |
|
| 225 | + /*===========================*/ |
|
| 226 | 226 | |
| 227 | - $widget_option_list['geodir_listing_top'] = |
|
| 228 | - array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')),
|
|
| 229 | - 'geodir_advance_search' => array()); |
|
| 227 | + $widget_option_list['geodir_listing_top'] = |
|
| 228 | + array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')),
|
|
| 229 | + 'geodir_advance_search' => array()); |
|
| 230 | 230 | |
| 231 | - $widget_option_list['geodir_listing_right_sidebar'] = |
|
| 232 | - array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
|
|
| 233 | - 'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1),
|
|
| 234 | - 'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
|
|
| 231 | + $widget_option_list['geodir_listing_right_sidebar'] = |
|
| 232 | + array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
|
|
| 233 | + 'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1),
|
|
| 234 | + 'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
|
|
| 235 | 235 | |
| 236 | 236 | |
| 237 | - /*===========================*/ |
|
| 238 | - /* Widgets ON SEARCH PAGE */ |
|
| 239 | - /*===========================*/ |
|
| 237 | + /*===========================*/ |
|
| 238 | + /* Widgets ON SEARCH PAGE */ |
|
| 239 | + /*===========================*/ |
|
| 240 | 240 | |
| 241 | - $widget_option_list['geodir_search_top'] = |
|
| 242 | - array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')),
|
|
| 243 | - 'geodir_advance_search' => array()); |
|
| 241 | + $widget_option_list['geodir_search_top'] = |
|
| 242 | + array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')),
|
|
| 243 | + 'geodir_advance_search' => array()); |
|
| 244 | 244 | |
| 245 | - $widget_option_list['geodir_search_right_sidebar'] = |
|
| 246 | - array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
|
|
| 247 | - 'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1),
|
|
| 248 | - 'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
|
|
| 245 | + $widget_option_list['geodir_search_right_sidebar'] = |
|
| 246 | + array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
|
|
| 247 | + 'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1),
|
|
| 248 | + 'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
|
|
| 249 | 249 | |
| 250 | - /*===========================*/ |
|
| 251 | - /* Widgets ON DETAIL/SINGLE PAGE */ |
|
| 252 | - /*===========================*/ |
|
| 250 | + /*===========================*/ |
|
| 251 | + /* Widgets ON DETAIL/SINGLE PAGE */ |
|
| 252 | + /*===========================*/ |
|
| 253 | 253 | |
| 254 | - $widget_option_list['geodir_detail_sidebar'] = |
|
| 255 | - array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
|
|
| 256 | - 'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1),
|
|
| 257 | - 'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
|
|
| 254 | + $widget_option_list['geodir_detail_sidebar'] = |
|
| 255 | + array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
|
|
| 256 | + 'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1),
|
|
| 257 | + 'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
|
|
| 258 | 258 | |
| 259 | 259 | |
| 260 | - /*===========================*/ |
|
| 261 | - /* Widgets ON AUTHOR PAGE */ |
|
| 262 | - /*===========================*/ |
|
| 260 | + /*===========================*/ |
|
| 261 | + /* Widgets ON AUTHOR PAGE */ |
|
| 262 | + /*===========================*/ |
|
| 263 | 263 | |
| 264 | 264 | |
| 265 | - $widget_option_list['geodir_author_right_sidebar'] = |
|
| 266 | - array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')));
|
|
| 265 | + $widget_option_list['geodir_author_right_sidebar'] = |
|
| 266 | + array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')));
|
|
| 267 | 267 | |
| 268 | 268 | |
| 269 | - $sidebars_widgets = get_option('sidebars_widgets');
|
|
| 269 | + $sidebars_widgets = get_option('sidebars_widgets');
|
|
| 270 | 270 | |
| 271 | - foreach ($widget_option_list as $key => $widget_options) {
|
|
| 271 | + foreach ($widget_option_list as $key => $widget_options) {
|
|
| 272 | 272 | |
| 273 | - foreach ($widget_options as $key2 => $widget_options_obj) {
|
|
| 274 | - $widgetid = 'widget_' . $key2; |
|
| 273 | + foreach ($widget_options as $key2 => $widget_options_obj) {
|
|
| 274 | + $widgetid = 'widget_' . $key2; |
|
| 275 | 275 | |
| 276 | - $widgetinfo[$widgetid][] = $widget_options_obj; |
|
| 276 | + $widgetinfo[$widgetid][] = $widget_options_obj; |
|
| 277 | 277 | |
| 278 | - $sidebarvalue_array[$key][] = $key2 . "-" . (count($widgetinfo[$widgetid])); |
|
| 278 | + $sidebarvalue_array[$key][] = $key2 . "-" . (count($widgetinfo[$widgetid])); |
|
| 279 | 279 | |
| 280 | - $widget_update[$widgetid][count($widgetinfo[$widgetid])] = $widget_options_obj; |
|
| 280 | + $widget_update[$widgetid][count($widgetinfo[$widgetid])] = $widget_options_obj; |
|
| 281 | 281 | |
| 282 | - } |
|
| 282 | + } |
|
| 283 | 283 | |
| 284 | - if (!empty($sidebarvalue_array[$key])) {
|
|
| 284 | + if (!empty($sidebarvalue_array[$key])) {
|
|
| 285 | 285 | |
| 286 | - $sidebars_widgets = get_option('sidebars_widgets');
|
|
| 287 | - $sidebars_widgets[$key] = $sidebarvalue_array[$key]; |
|
| 288 | - update_option('sidebars_widgets', $sidebars_widgets);
|
|
| 286 | + $sidebars_widgets = get_option('sidebars_widgets');
|
|
| 287 | + $sidebars_widgets[$key] = $sidebarvalue_array[$key]; |
|
| 288 | + update_option('sidebars_widgets', $sidebars_widgets);
|
|
| 289 | 289 | |
| 290 | - foreach ($widget_update as $key => $value) {
|
|
| 290 | + foreach ($widget_update as $key => $value) {
|
|
| 291 | 291 | |
| 292 | - update_option($key, $value); |
|
| 292 | + update_option($key, $value); |
|
| 293 | 293 | |
| 294 | - } |
|
| 294 | + } |
|
| 295 | 295 | |
| 296 | - } |
|
| 296 | + } |
|
| 297 | 297 | |
| 298 | - } |
|
| 298 | + } |
|
| 299 | 299 | |
| 300 | 300 | |
| 301 | 301 | } |
@@ -271,11 +271,11 @@ |
||
| 271 | 271 | foreach ($widget_option_list as $key => $widget_options) {
|
| 272 | 272 | |
| 273 | 273 | foreach ($widget_options as $key2 => $widget_options_obj) {
|
| 274 | - $widgetid = 'widget_' . $key2; |
|
| 274 | + $widgetid = 'widget_'.$key2; |
|
| 275 | 275 | |
| 276 | 276 | $widgetinfo[$widgetid][] = $widget_options_obj; |
| 277 | 277 | |
| 278 | - $sidebarvalue_array[$key][] = $key2 . "-" . (count($widgetinfo[$widgetid])); |
|
| 278 | + $sidebarvalue_array[$key][] = $key2."-".(count($widgetinfo[$widgetid])); |
|
| 279 | 279 | |
| 280 | 280 | $widget_update[$widgetid][count($widgetinfo[$widgetid])] = $widget_options_obj; |
| 281 | 281 | |
@@ -16,28 +16,28 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | function jupiter_action_calls() |
| 18 | 18 | { |
| 19 | - // REMOVE BREADCRUMB |
|
| 20 | - remove_action('geodir_detail_before_main_content', 'geodir_breadcrumb', 20); |
|
| 21 | - remove_action('geodir_listings_before_main_content', 'geodir_breadcrumb', 20); |
|
| 22 | - remove_action('geodir_author_before_main_content', 'geodir_breadcrumb', 20); |
|
| 23 | - remove_action('geodir_search_before_main_content', 'geodir_breadcrumb', 20); |
|
| 24 | - remove_action('geodir_home_before_main_content', 'geodir_breadcrumb', 20); |
|
| 25 | - remove_action('geodir_location_before_main_content', 'geodir_breadcrumb', 20); |
|
| 26 | - |
|
| 27 | - // REMOVE PAGE TITLES |
|
| 28 | - remove_action('geodir_listings_page_title', 'geodir_action_listings_title', 10); |
|
| 29 | - remove_action('geodir_add_listing_page_title', 'geodir_action_add_listing_page_title', 10); |
|
| 30 | - remove_action('geodir_details_main_content', 'geodir_action_page_title', 20); |
|
| 31 | - remove_action('geodir_search_page_title', 'geodir_action_search_page_title', 10); |
|
| 32 | - remove_action('geodir_author_page_title', 'geodir_action_author_page_title', 10); |
|
| 33 | - |
|
| 34 | - |
|
| 35 | - // CAHNGE PAGE TITLES |
|
| 36 | - remove_action('page_title', 'mk_page_title'); |
|
| 37 | - add_action('page_title', 'gd_mk_page_title'); |
|
| 38 | - // CHANGE BREADCRUMS FOR GD PAGES |
|
| 39 | - remove_action('theme_breadcrumbs', 'mk_theme_breadcrumbs'); |
|
| 40 | - add_action('theme_breadcrumbs', 'gd_mk_theme_breadcrumbs'); |
|
| 19 | + // REMOVE BREADCRUMB |
|
| 20 | + remove_action('geodir_detail_before_main_content', 'geodir_breadcrumb', 20); |
|
| 21 | + remove_action('geodir_listings_before_main_content', 'geodir_breadcrumb', 20); |
|
| 22 | + remove_action('geodir_author_before_main_content', 'geodir_breadcrumb', 20); |
|
| 23 | + remove_action('geodir_search_before_main_content', 'geodir_breadcrumb', 20); |
|
| 24 | + remove_action('geodir_home_before_main_content', 'geodir_breadcrumb', 20); |
|
| 25 | + remove_action('geodir_location_before_main_content', 'geodir_breadcrumb', 20); |
|
| 26 | + |
|
| 27 | + // REMOVE PAGE TITLES |
|
| 28 | + remove_action('geodir_listings_page_title', 'geodir_action_listings_title', 10); |
|
| 29 | + remove_action('geodir_add_listing_page_title', 'geodir_action_add_listing_page_title', 10); |
|
| 30 | + remove_action('geodir_details_main_content', 'geodir_action_page_title', 20); |
|
| 31 | + remove_action('geodir_search_page_title', 'geodir_action_search_page_title', 10); |
|
| 32 | + remove_action('geodir_author_page_title', 'geodir_action_author_page_title', 10); |
|
| 33 | + |
|
| 34 | + |
|
| 35 | + // CAHNGE PAGE TITLES |
|
| 36 | + remove_action('page_title', 'mk_page_title'); |
|
| 37 | + add_action('page_title', 'gd_mk_page_title'); |
|
| 38 | + // CHANGE BREADCRUMS FOR GD PAGES |
|
| 39 | + remove_action('theme_breadcrumbs', 'mk_theme_breadcrumbs'); |
|
| 40 | + add_action('theme_breadcrumbs', 'gd_mk_theme_breadcrumbs'); |
|
| 41 | 41 | |
| 42 | 42 | |
| 43 | 43 | } |
@@ -52,19 +52,19 @@ discard block |
||
| 52 | 52 | function gd_mk_theme_breadcrumbs() |
| 53 | 53 | { |
| 54 | 54 | |
| 55 | - if (is_page_geodir_home() || geodir_is_page('location')) { |
|
| 56 | - jupiter_geodir_breadcrumb(); |
|
| 57 | - } elseif (geodir_is_page('listing')) { |
|
| 58 | - jupiter_geodir_breadcrumb(); |
|
| 59 | - } elseif (geodir_is_page('detail')) { |
|
| 60 | - jupiter_geodir_breadcrumb(); |
|
| 61 | - } elseif (geodir_is_page('search')) { |
|
| 62 | - jupiter_geodir_breadcrumb(); |
|
| 63 | - } elseif (geodir_is_page('author')) { |
|
| 64 | - jupiter_geodir_breadcrumb(); |
|
| 65 | - } else { |
|
| 66 | - mk_theme_breadcrumbs(); |
|
| 67 | - } |
|
| 55 | + if (is_page_geodir_home() || geodir_is_page('location')) { |
|
| 56 | + jupiter_geodir_breadcrumb(); |
|
| 57 | + } elseif (geodir_is_page('listing')) { |
|
| 58 | + jupiter_geodir_breadcrumb(); |
|
| 59 | + } elseif (geodir_is_page('detail')) { |
|
| 60 | + jupiter_geodir_breadcrumb(); |
|
| 61 | + } elseif (geodir_is_page('search')) { |
|
| 62 | + jupiter_geodir_breadcrumb(); |
|
| 63 | + } elseif (geodir_is_page('author')) { |
|
| 64 | + jupiter_geodir_breadcrumb(); |
|
| 65 | + } else { |
|
| 66 | + mk_theme_breadcrumbs(); |
|
| 67 | + } |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | /** |
@@ -76,35 +76,35 @@ discard block |
||
| 76 | 76 | */ |
| 77 | 77 | function gd_mk_page_title() |
| 78 | 78 | { |
| 79 | - global $wp; |
|
| 80 | - |
|
| 81 | - |
|
| 82 | - if (is_page_geodir_home() || geodir_is_page('location')) { |
|
| 83 | - jupiter_geodir_page_title(); |
|
| 84 | - } elseif (geodir_is_page('listing')) { |
|
| 85 | - ob_start(); // Start buffering; |
|
| 86 | - geodir_action_listings_title(); |
|
| 87 | - $gd_title = ob_get_clean(); |
|
| 88 | - $title_p = explode('">', $gd_title); |
|
| 89 | - $title = str_replace('</h1></header>', "", $title_p[2]); |
|
| 90 | - jupiter_geodir_page_title($title); |
|
| 91 | - } elseif (geodir_is_page('search')) { |
|
| 92 | - ob_start(); // Start buffering; |
|
| 93 | - geodir_action_listings_title(); |
|
| 94 | - $gd_title = ob_get_clean(); |
|
| 95 | - $title_p = explode('">', $gd_title); |
|
| 96 | - $title = str_replace('</h1></header>', "", $title_p[2]); |
|
| 97 | - jupiter_geodir_page_title($title); |
|
| 98 | - } elseif (geodir_is_page('author')) { |
|
| 99 | - ob_start(); // Start buffering; |
|
| 100 | - geodir_action_author_page_title(); |
|
| 101 | - $gd_title = ob_get_clean(); |
|
| 102 | - $gd_title = str_replace('<h1>', "", $gd_title); |
|
| 103 | - $gd_title = str_replace('</h1>', "", $gd_title); |
|
| 104 | - jupiter_geodir_page_title($gd_title); |
|
| 105 | - } else { |
|
| 106 | - mk_page_title(); |
|
| 107 | - } |
|
| 79 | + global $wp; |
|
| 80 | + |
|
| 81 | + |
|
| 82 | + if (is_page_geodir_home() || geodir_is_page('location')) { |
|
| 83 | + jupiter_geodir_page_title(); |
|
| 84 | + } elseif (geodir_is_page('listing')) { |
|
| 85 | + ob_start(); // Start buffering; |
|
| 86 | + geodir_action_listings_title(); |
|
| 87 | + $gd_title = ob_get_clean(); |
|
| 88 | + $title_p = explode('">', $gd_title); |
|
| 89 | + $title = str_replace('</h1></header>', "", $title_p[2]); |
|
| 90 | + jupiter_geodir_page_title($title); |
|
| 91 | + } elseif (geodir_is_page('search')) { |
|
| 92 | + ob_start(); // Start buffering; |
|
| 93 | + geodir_action_listings_title(); |
|
| 94 | + $gd_title = ob_get_clean(); |
|
| 95 | + $title_p = explode('">', $gd_title); |
|
| 96 | + $title = str_replace('</h1></header>', "", $title_p[2]); |
|
| 97 | + jupiter_geodir_page_title($title); |
|
| 98 | + } elseif (geodir_is_page('author')) { |
|
| 99 | + ob_start(); // Start buffering; |
|
| 100 | + geodir_action_author_page_title(); |
|
| 101 | + $gd_title = ob_get_clean(); |
|
| 102 | + $gd_title = str_replace('<h1>', "", $gd_title); |
|
| 103 | + $gd_title = str_replace('</h1>', "", $gd_title); |
|
| 104 | + jupiter_geodir_page_title($gd_title); |
|
| 105 | + } else { |
|
| 106 | + mk_page_title(); |
|
| 107 | + } |
|
| 108 | 108 | |
| 109 | 109 | |
| 110 | 110 | } |
@@ -119,48 +119,48 @@ discard block |
||
| 119 | 119 | */ |
| 120 | 120 | function jupiter_geodir_breadcrumb() |
| 121 | 121 | { |
| 122 | - $item = ''; |
|
| 123 | - ob_start(); // Start buffering; |
|
| 124 | - geodir_breadcrumb(); |
|
| 125 | - $gd_crums = ob_get_clean(); |
|
| 126 | - if ($gd_crums) { |
|
| 127 | - $gd_crums = str_replace('<div class="geodir-breadcrumb clearfix"><ul id="breadcrumbs"><li>', "", $gd_crums); |
|
| 128 | - $gd_crums = str_replace('</li></ul></div>', "", $gd_crums); |
|
| 129 | - $gd_crums = str_replace(' > ', " > ", $gd_crums); |
|
| 130 | - $gd_crums = str_replace('</li><li>', "", $gd_crums); |
|
| 131 | - $gd_crums = explode(" > ", $gd_crums); |
|
| 132 | - $trail_end = array_pop($gd_crums); |
|
| 133 | - $gd_crums['trail_end'] = $trail_end; |
|
| 134 | - //print_r($gd_crums);exit; |
|
| 135 | - //print_r($trail); |
|
| 136 | - $item = $gd_crums; |
|
| 137 | - |
|
| 138 | - } |
|
| 139 | - if (!$item) { |
|
| 140 | - return; |
|
| 141 | - } |
|
| 142 | - global $mk_options, $post; |
|
| 143 | - $post_id = global_get_post_id(); |
|
| 144 | - |
|
| 145 | - if ($post_id) { |
|
| 146 | - $local_skining = get_post_meta($post_id, '_enable_local_backgrounds', true); |
|
| 147 | - $breadcrumb_skin = get_post_meta($post_id, '_breadcrumb_skin', true); |
|
| 148 | - if ($local_skining == 'true' && !empty($breadcrumb_skin)) { |
|
| 149 | - $breadcrumb_skin_class = $breadcrumb_skin; |
|
| 150 | - } else { |
|
| 151 | - $breadcrumb_skin_class = $mk_options['breadcrumb_skin']; |
|
| 152 | - } |
|
| 153 | - } else { |
|
| 154 | - $breadcrumb_skin_class = $mk_options['breadcrumb_skin']; |
|
| 155 | - } |
|
| 156 | - |
|
| 157 | - |
|
| 158 | - $delimiter = ' / '; |
|
| 159 | - |
|
| 160 | - echo '<div id="mk-breadcrumbs"><div class="mk-breadcrumbs-inner ' . $breadcrumb_skin_class . '-skin">'; |
|
| 161 | - |
|
| 162 | - echo implode($delimiter, $item); |
|
| 163 | - echo "</div></div>"; |
|
| 122 | + $item = ''; |
|
| 123 | + ob_start(); // Start buffering; |
|
| 124 | + geodir_breadcrumb(); |
|
| 125 | + $gd_crums = ob_get_clean(); |
|
| 126 | + if ($gd_crums) { |
|
| 127 | + $gd_crums = str_replace('<div class="geodir-breadcrumb clearfix"><ul id="breadcrumbs"><li>', "", $gd_crums); |
|
| 128 | + $gd_crums = str_replace('</li></ul></div>', "", $gd_crums); |
|
| 129 | + $gd_crums = str_replace(' > ', " > ", $gd_crums); |
|
| 130 | + $gd_crums = str_replace('</li><li>', "", $gd_crums); |
|
| 131 | + $gd_crums = explode(" > ", $gd_crums); |
|
| 132 | + $trail_end = array_pop($gd_crums); |
|
| 133 | + $gd_crums['trail_end'] = $trail_end; |
|
| 134 | + //print_r($gd_crums);exit; |
|
| 135 | + //print_r($trail); |
|
| 136 | + $item = $gd_crums; |
|
| 137 | + |
|
| 138 | + } |
|
| 139 | + if (!$item) { |
|
| 140 | + return; |
|
| 141 | + } |
|
| 142 | + global $mk_options, $post; |
|
| 143 | + $post_id = global_get_post_id(); |
|
| 144 | + |
|
| 145 | + if ($post_id) { |
|
| 146 | + $local_skining = get_post_meta($post_id, '_enable_local_backgrounds', true); |
|
| 147 | + $breadcrumb_skin = get_post_meta($post_id, '_breadcrumb_skin', true); |
|
| 148 | + if ($local_skining == 'true' && !empty($breadcrumb_skin)) { |
|
| 149 | + $breadcrumb_skin_class = $breadcrumb_skin; |
|
| 150 | + } else { |
|
| 151 | + $breadcrumb_skin_class = $mk_options['breadcrumb_skin']; |
|
| 152 | + } |
|
| 153 | + } else { |
|
| 154 | + $breadcrumb_skin_class = $mk_options['breadcrumb_skin']; |
|
| 155 | + } |
|
| 156 | + |
|
| 157 | + |
|
| 158 | + $delimiter = ' / '; |
|
| 159 | + |
|
| 160 | + echo '<div id="mk-breadcrumbs"><div class="mk-breadcrumbs-inner ' . $breadcrumb_skin_class . '-skin">'; |
|
| 161 | + |
|
| 162 | + echo implode($delimiter, $item); |
|
| 163 | + echo "</div></div>"; |
|
| 164 | 164 | |
| 165 | 165 | } |
| 166 | 166 | |
@@ -174,41 +174,41 @@ discard block |
||
| 174 | 174 | */ |
| 175 | 175 | function jupiter_geodir_page_title($title = '', $subtitle = '') |
| 176 | 176 | { |
| 177 | - global $mk_options; |
|
| 178 | - |
|
| 179 | - $post_id = global_get_post_id(); |
|
| 180 | - $shadow_css = ''; |
|
| 181 | - if ($mk_options['page_title_shadow'] == 'true') { |
|
| 182 | - $shadow_css = 'mk-drop-shadow'; |
|
| 183 | - } |
|
| 184 | - |
|
| 185 | - $align = !empty($align) ? $align : 'left'; |
|
| 186 | - |
|
| 187 | - //$title = 'xxxx'; |
|
| 188 | - echo '<section id="mk-page-introduce" class="intro-' . $align . '">'; |
|
| 189 | - echo '<div class="mk-grid">'; |
|
| 190 | - if (!empty($title)) { |
|
| 191 | - echo '<h1 class="page-introduce-title ' . $shadow_css . '">' . $title . '</h1>'; |
|
| 192 | - |
|
| 193 | - } |
|
| 194 | - |
|
| 195 | - if (!empty($subtitle)) { |
|
| 196 | - echo '<div class="page-introduce-subtitle">'; |
|
| 197 | - echo $subtitle; |
|
| 198 | - echo '</div>'; |
|
| 199 | - } |
|
| 200 | - if ($mk_options['disable_breadcrumb'] == 'true') { |
|
| 201 | - if (get_post_meta($post_id, '_disable_breadcrumb', true) != 'false') { |
|
| 202 | - /** |
|
| 203 | - * Calls the theme breadcrumbs for Jupiter theme. |
|
| 204 | - * |
|
| 205 | - * @since 1.4.0 |
|
| 206 | - */ |
|
| 207 | - do_action('theme_breadcrumbs', $post_id); |
|
| 208 | - } |
|
| 209 | - } |
|
| 210 | - |
|
| 211 | - echo '<div class="clearboth"></div></div></section>'; |
|
| 177 | + global $mk_options; |
|
| 178 | + |
|
| 179 | + $post_id = global_get_post_id(); |
|
| 180 | + $shadow_css = ''; |
|
| 181 | + if ($mk_options['page_title_shadow'] == 'true') { |
|
| 182 | + $shadow_css = 'mk-drop-shadow'; |
|
| 183 | + } |
|
| 184 | + |
|
| 185 | + $align = !empty($align) ? $align : 'left'; |
|
| 186 | + |
|
| 187 | + //$title = 'xxxx'; |
|
| 188 | + echo '<section id="mk-page-introduce" class="intro-' . $align . '">'; |
|
| 189 | + echo '<div class="mk-grid">'; |
|
| 190 | + if (!empty($title)) { |
|
| 191 | + echo '<h1 class="page-introduce-title ' . $shadow_css . '">' . $title . '</h1>'; |
|
| 192 | + |
|
| 193 | + } |
|
| 194 | + |
|
| 195 | + if (!empty($subtitle)) { |
|
| 196 | + echo '<div class="page-introduce-subtitle">'; |
|
| 197 | + echo $subtitle; |
|
| 198 | + echo '</div>'; |
|
| 199 | + } |
|
| 200 | + if ($mk_options['disable_breadcrumb'] == 'true') { |
|
| 201 | + if (get_post_meta($post_id, '_disable_breadcrumb', true) != 'false') { |
|
| 202 | + /** |
|
| 203 | + * Calls the theme breadcrumbs for Jupiter theme. |
|
| 204 | + * |
|
| 205 | + * @since 1.4.0 |
|
| 206 | + */ |
|
| 207 | + do_action('theme_breadcrumbs', $post_id); |
|
| 208 | + } |
|
| 209 | + } |
|
| 210 | + |
|
| 211 | + echo '<div class="clearboth"></div></div></section>'; |
|
| 212 | 212 | |
| 213 | 213 | |
| 214 | 214 | } |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | |
| 158 | 158 | $delimiter = ' / '; |
| 159 | 159 | |
| 160 | - echo '<div id="mk-breadcrumbs"><div class="mk-breadcrumbs-inner ' . $breadcrumb_skin_class . '-skin">'; |
|
| 160 | + echo '<div id="mk-breadcrumbs"><div class="mk-breadcrumbs-inner '.$breadcrumb_skin_class.'-skin">'; |
|
| 161 | 161 | |
| 162 | 162 | echo implode($delimiter, $item); |
| 163 | 163 | echo "</div></div>"; |
@@ -185,10 +185,10 @@ discard block |
||
| 185 | 185 | $align = !empty($align) ? $align : 'left'; |
| 186 | 186 | |
| 187 | 187 | //$title = 'xxxx'; |
| 188 | - echo '<section id="mk-page-introduce" class="intro-' . $align . '">'; |
|
| 188 | + echo '<section id="mk-page-introduce" class="intro-'.$align.'">'; |
|
| 189 | 189 | echo '<div class="mk-grid">'; |
| 190 | 190 | if (!empty($title)) { |
| 191 | - echo '<h1 class="page-introduce-title ' . $shadow_css . '">' . $title . '</h1>'; |
|
| 191 | + echo '<h1 class="page-introduce-title '.$shadow_css.'">'.$title.'</h1>'; |
|
| 192 | 192 | |
| 193 | 193 | } |
| 194 | 194 | |
@@ -10,46 +10,46 @@ discard block |
||
| 10 | 10 | global $wpdb; |
| 11 | 11 | |
| 12 | 12 | if (get_option('geodirectory' . '_db_version') != GEODIRECTORY_VERSION) {
|
| 13 | - /** |
|
| 14 | - * Include custom database table related functions. |
|
| 15 | - * |
|
| 16 | - * @since 1.0.0 |
|
| 17 | - * @package GeoDirectory |
|
| 18 | - */ |
|
| 19 | - include_once('geodirectory-admin/admin_db_install.php');
|
|
| 20 | - add_action('plugins_loaded', 'geodirectory_upgrade_all', 10);
|
|
| 21 | - if (GEODIRECTORY_VERSION <= '1.3.6') {
|
|
| 22 | - add_action('plugins_loaded', 'geodir_upgrade_136', 11);
|
|
| 23 | - } |
|
| 13 | + /** |
|
| 14 | + * Include custom database table related functions. |
|
| 15 | + * |
|
| 16 | + * @since 1.0.0 |
|
| 17 | + * @package GeoDirectory |
|
| 18 | + */ |
|
| 19 | + include_once('geodirectory-admin/admin_db_install.php');
|
|
| 20 | + add_action('plugins_loaded', 'geodirectory_upgrade_all', 10);
|
|
| 21 | + if (GEODIRECTORY_VERSION <= '1.3.6') {
|
|
| 22 | + add_action('plugins_loaded', 'geodir_upgrade_136', 11);
|
|
| 23 | + } |
|
| 24 | 24 | |
| 25 | - if (GEODIRECTORY_VERSION <= '1.4.6') {
|
|
| 26 | - add_action('init', 'geodir_upgrade_146', 11);
|
|
| 27 | - } |
|
| 25 | + if (GEODIRECTORY_VERSION <= '1.4.6') {
|
|
| 26 | + add_action('init', 'geodir_upgrade_146', 11);
|
|
| 27 | + } |
|
| 28 | 28 | |
| 29 | - if (GEODIRECTORY_VERSION <= '1.4.8') {
|
|
| 30 | - add_action('init', 'geodir_upgrade_148', 11);
|
|
| 31 | - } |
|
| 29 | + if (GEODIRECTORY_VERSION <= '1.4.8') {
|
|
| 30 | + add_action('init', 'geodir_upgrade_148', 11);
|
|
| 31 | + } |
|
| 32 | 32 | |
| 33 | - if (GEODIRECTORY_VERSION <= '1.5.0') {
|
|
| 34 | - add_action('init', 'geodir_upgrade_150', 11);
|
|
| 35 | - } |
|
| 33 | + if (GEODIRECTORY_VERSION <= '1.5.0') {
|
|
| 34 | + add_action('init', 'geodir_upgrade_150', 11);
|
|
| 35 | + } |
|
| 36 | 36 | |
| 37 | - if (GEODIRECTORY_VERSION <= '1.5.2') {
|
|
| 38 | - add_action('init', 'geodir_upgrade_152', 11);
|
|
| 39 | - } |
|
| 37 | + if (GEODIRECTORY_VERSION <= '1.5.2') {
|
|
| 38 | + add_action('init', 'geodir_upgrade_152', 11);
|
|
| 39 | + } |
|
| 40 | 40 | |
| 41 | - if (GEODIRECTORY_VERSION <= '1.5.3') {
|
|
| 42 | - add_action('init', 'geodir_upgrade_153', 11);
|
|
| 43 | - } |
|
| 41 | + if (GEODIRECTORY_VERSION <= '1.5.3') {
|
|
| 42 | + add_action('init', 'geodir_upgrade_153', 11);
|
|
| 43 | + } |
|
| 44 | 44 | |
| 45 | - if (GEODIRECTORY_VERSION <= '1.5.4') {
|
|
| 46 | - add_action('init', 'geodir_upgrade_154', 11);
|
|
| 47 | - } |
|
| 45 | + if (GEODIRECTORY_VERSION <= '1.5.4') {
|
|
| 46 | + add_action('init', 'geodir_upgrade_154', 11);
|
|
| 47 | + } |
|
| 48 | 48 | |
| 49 | 49 | |
| 50 | - add_action('init', 'gd_fix_cpt_rewrite_slug', 11);// this needs to be kept for a few versions
|
|
| 50 | + add_action('init', 'gd_fix_cpt_rewrite_slug', 11);// this needs to be kept for a few versions
|
|
| 51 | 51 | |
| 52 | - update_option('geodirectory' . '_db_version', GEODIRECTORY_VERSION);
|
|
| 52 | + update_option('geodirectory' . '_db_version', GEODIRECTORY_VERSION);
|
|
| 53 | 53 | |
| 54 | 54 | } |
| 55 | 55 | |
@@ -62,9 +62,9 @@ discard block |
||
| 62 | 62 | */ |
| 63 | 63 | function geodirectory_upgrade_all() |
| 64 | 64 | {
|
| 65 | - geodir_create_tables(); |
|
| 66 | - geodir_update_review_db(); |
|
| 67 | - gd_install_theme_compat(); |
|
| 65 | + geodir_create_tables(); |
|
| 66 | + geodir_update_review_db(); |
|
| 67 | + gd_install_theme_compat(); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | /** |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | function geodir_upgrade_136() |
| 77 | 77 | {
|
| 78 | - geodir_fix_review_overall_rating(); |
|
| 78 | + geodir_fix_review_overall_rating(); |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | /** |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | * @package GeoDirectory |
| 86 | 86 | */ |
| 87 | 87 | function geodir_upgrade_146(){
|
| 88 | - gd_convert_virtual_pages(); |
|
| 88 | + gd_convert_virtual_pages(); |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | /** |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | * @package GeoDirectory |
| 96 | 96 | */ |
| 97 | 97 | function geodir_upgrade_150(){
|
| 98 | - gd_fix_cpt_rewrite_slug(); |
|
| 98 | + gd_fix_cpt_rewrite_slug(); |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | |
@@ -107,11 +107,11 @@ discard block |
||
| 107 | 107 | * @package GeoDirectory |
| 108 | 108 | */ |
| 109 | 109 | function geodir_upgrade_148(){
|
| 110 | - /* |
|
| 110 | + /* |
|
| 111 | 111 | * Blank the users google password if present as we now use oAuth 2.0 |
| 112 | 112 | */ |
| 113 | - update_option('geodir_ga_pass','');
|
|
| 114 | - update_option('geodir_ga_user','');
|
|
| 113 | + update_option('geodir_ga_pass','');
|
|
| 114 | + update_option('geodir_ga_user','');
|
|
| 115 | 115 | |
| 116 | 116 | } |
| 117 | 117 | |
@@ -123,8 +123,8 @@ discard block |
||
| 123 | 123 | * @package GeoDirectory |
| 124 | 124 | */ |
| 125 | 125 | function geodir_upgrade_153(){
|
| 126 | - geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), '');
|
|
| 127 | - geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), '');
|
|
| 126 | + geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), '');
|
|
| 127 | + geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), '');
|
|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | /** |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | * @package GeoDirectory |
| 135 | 135 | */ |
| 136 | 136 | function geodir_upgrade_154(){
|
| 137 | - geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), '');
|
|
| 137 | + geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), '');
|
|
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | /** |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | * @package GeoDirectory |
| 145 | 145 | */ |
| 146 | 146 | function geodir_upgrade_152(){
|
| 147 | - gd_fix_address_detail_table_limit(); |
|
| 147 | + gd_fix_address_detail_table_limit(); |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | |
@@ -158,12 +158,12 @@ discard block |
||
| 158 | 158 | */ |
| 159 | 159 | function geodir_update_review_db() |
| 160 | 160 | {
|
| 161 | - global $wpdb, $plugin_prefix; |
|
| 161 | + global $wpdb, $plugin_prefix; |
|
| 162 | 162 | |
| 163 | - geodir_fix_review_date(); |
|
| 164 | - geodir_fix_review_post_status(); |
|
| 165 | - geodir_fix_review_content(); |
|
| 166 | - geodir_fix_review_location(); |
|
| 163 | + geodir_fix_review_date(); |
|
| 164 | + geodir_fix_review_post_status(); |
|
| 165 | + geodir_fix_review_content(); |
|
| 166 | + geodir_fix_review_location(); |
|
| 167 | 167 | |
| 168 | 168 | } |
| 169 | 169 | |
@@ -176,8 +176,8 @@ discard block |
||
| 176 | 176 | */ |
| 177 | 177 | function geodir_fix_review_date() |
| 178 | 178 | {
|
| 179 | - global $wpdb; |
|
| 180 | - $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.post_date = c.comment_date WHERE gdr.post_date='0000-00-00 00:00:00'");
|
|
| 179 | + global $wpdb; |
|
| 180 | + $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.post_date = c.comment_date WHERE gdr.post_date='0000-00-00 00:00:00'");
|
|
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | /** |
@@ -189,8 +189,8 @@ discard block |
||
| 189 | 189 | */ |
| 190 | 190 | function geodir_fix_review_post_status() |
| 191 | 191 | {
|
| 192 | - global $wpdb; |
|
| 193 | - $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->posts p ON gdr.post_id=p.ID SET gdr.post_status = 1 WHERE gdr.post_status IS NULL AND p.post_status='publish'");
|
|
| 192 | + global $wpdb; |
|
| 193 | + $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->posts p ON gdr.post_id=p.ID SET gdr.post_status = 1 WHERE gdr.post_status IS NULL AND p.post_status='publish'");
|
|
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | /** |
@@ -203,12 +203,12 @@ discard block |
||
| 203 | 203 | */ |
| 204 | 204 | function geodir_fix_review_content() |
| 205 | 205 | {
|
| 206 | - global $wpdb; |
|
| 207 | - if ($wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.comment_content = c.comment_content WHERE gdr.comment_content IS NULL")) {
|
|
| 208 | - return true; |
|
| 209 | - } else {
|
|
| 210 | - return false; |
|
| 211 | - } |
|
| 206 | + global $wpdb; |
|
| 207 | + if ($wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.comment_content = c.comment_content WHERE gdr.comment_content IS NULL")) {
|
|
| 208 | + return true; |
|
| 209 | + } else {
|
|
| 210 | + return false; |
|
| 211 | + } |
|
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | /** |
@@ -221,20 +221,20 @@ discard block |
||
| 221 | 221 | */ |
| 222 | 222 | function geodir_fix_review_location() |
| 223 | 223 | {
|
| 224 | - global $wpdb; |
|
| 224 | + global $wpdb; |
|
| 225 | 225 | |
| 226 | - $all_postypes = geodir_get_posttypes(); |
|
| 226 | + $all_postypes = geodir_get_posttypes(); |
|
| 227 | 227 | |
| 228 | - if (!empty($all_postypes)) {
|
|
| 229 | - foreach ($all_postypes as $key) {
|
|
| 230 | - // update each GD CTP |
|
| 228 | + if (!empty($all_postypes)) {
|
|
| 229 | + foreach ($all_postypes as $key) {
|
|
| 230 | + // update each GD CTP |
|
| 231 | 231 | |
| 232 | - $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN " . $wpdb->prefix . "geodir_" . $key . "_detail d ON gdr.post_id=d.post_id SET gdr.post_latitude = d.post_latitude, gdr.post_longitude = d.post_longitude, gdr.post_city = d.post_city, gdr.post_region=d.post_region, gdr.post_country=d.post_country WHERE gdr.post_latitude IS NULL OR gdr.post_city IS NULL");
|
|
| 232 | + $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN " . $wpdb->prefix . "geodir_" . $key . "_detail d ON gdr.post_id=d.post_id SET gdr.post_latitude = d.post_latitude, gdr.post_longitude = d.post_longitude, gdr.post_city = d.post_city, gdr.post_region=d.post_region, gdr.post_country=d.post_country WHERE gdr.post_latitude IS NULL OR gdr.post_city IS NULL");
|
|
| 233 | 233 | |
| 234 | - } |
|
| 235 | - return true; |
|
| 236 | - } |
|
| 237 | - return false; |
|
| 234 | + } |
|
| 235 | + return true; |
|
| 236 | + } |
|
| 237 | + return false; |
|
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | /** |
@@ -246,25 +246,25 @@ discard block |
||
| 246 | 246 | */ |
| 247 | 247 | function geodir_fix_review_overall_rating() |
| 248 | 248 | {
|
| 249 | - global $wpdb; |
|
| 249 | + global $wpdb; |
|
| 250 | 250 | |
| 251 | - $all_postypes = geodir_get_posttypes(); |
|
| 251 | + $all_postypes = geodir_get_posttypes(); |
|
| 252 | 252 | |
| 253 | - if (!empty($all_postypes)) {
|
|
| 254 | - foreach ($all_postypes as $key) {
|
|
| 255 | - // update each GD CTP |
|
| 256 | - $reviews = $wpdb->get_results("SELECT post_id FROM " . $wpdb->prefix . "geodir_" . $key . "_detail d");
|
|
| 253 | + if (!empty($all_postypes)) {
|
|
| 254 | + foreach ($all_postypes as $key) {
|
|
| 255 | + // update each GD CTP |
|
| 256 | + $reviews = $wpdb->get_results("SELECT post_id FROM " . $wpdb->prefix . "geodir_" . $key . "_detail d");
|
|
| 257 | 257 | |
| 258 | - if (!empty($reviews)) {
|
|
| 259 | - foreach ($reviews as $post_id) {
|
|
| 260 | - geodir_update_postrating($post_id->post_id, $key); |
|
| 261 | - } |
|
| 258 | + if (!empty($reviews)) {
|
|
| 259 | + foreach ($reviews as $post_id) {
|
|
| 260 | + geodir_update_postrating($post_id->post_id, $key); |
|
| 261 | + } |
|
| 262 | 262 | |
| 263 | - } |
|
| 263 | + } |
|
| 264 | 264 | |
| 265 | - } |
|
| 265 | + } |
|
| 266 | 266 | |
| 267 | - } |
|
| 267 | + } |
|
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | |
@@ -281,367 +281,367 @@ discard block |
||
| 281 | 281 | */ |
| 282 | 282 | function gd_install_theme_compat() |
| 283 | 283 | {
|
| 284 | - global $wpdb; |
|
| 284 | + global $wpdb; |
|
| 285 | 285 | |
| 286 | - $theme_compat = array(); |
|
| 287 | - $theme_compat = get_option('gd_theme_compats');
|
|
| 286 | + $theme_compat = array(); |
|
| 287 | + $theme_compat = get_option('gd_theme_compats');
|
|
| 288 | 288 | //GDF |
| 289 | - $theme_compat['GeoDirectory_Framework'] = array( |
|
| 290 | - 'geodir_wrapper_open_id' => 'geodir_wrapper', |
|
| 291 | - 'geodir_wrapper_open_class' => '', |
|
| 292 | - 'geodir_wrapper_open_replace' => '', |
|
| 293 | - 'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->', |
|
| 294 | - 'geodir_wrapper_content_open_id' => 'geodir_content', |
|
| 295 | - 'geodir_wrapper_content_open_class' => '', |
|
| 296 | - 'geodir_wrapper_content_open_replace' => '', |
|
| 297 | - 'geodir_wrapper_content_close_replace' => '', |
|
| 298 | - 'geodir_article_open_id' => '', |
|
| 299 | - 'geodir_article_open_class' => '', |
|
| 300 | - 'geodir_article_open_replace' => '', |
|
| 301 | - 'geodir_article_close_replace' => '', |
|
| 302 | - 'geodir_sidebar_right_open_id' => '', |
|
| 303 | - 'geodir_sidebar_right_open_class' => '', |
|
| 304 | - 'geodir_sidebar_right_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
| 305 | - 'geodir_sidebar_right_close_replace' => '', |
|
| 306 | - 'geodir_sidebar_left_open_id' => '', |
|
| 307 | - 'geodir_sidebar_left_open_class' => '', |
|
| 308 | - 'geodir_sidebar_left_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
| 309 | - 'geodir_sidebar_left_close_replace' => '', |
|
| 310 | - 'geodir_main_content_open_id' => '', |
|
| 311 | - 'geodir_main_content_open_class' => '', |
|
| 312 | - 'geodir_main_content_open_replace' => '<!-- removed -->', |
|
| 313 | - 'geodir_main_content_close_replace' => '<!-- removed -->', |
|
| 314 | - 'geodir_top_content_add' => '', |
|
| 315 | - 'geodir_before_main_content_add' => '<div class="clearfix geodir-common">', |
|
| 316 | - 'geodir_before_widget_filter' => '', |
|
| 317 | - 'geodir_after_widget_filter' => '', |
|
| 318 | - 'geodir_theme_compat_css' => '', |
|
| 319 | - 'geodir_theme_compat_js' => '', |
|
| 320 | - 'geodir_theme_compat_default_options' => '', |
|
| 321 | - 'geodir_theme_compat_code' => '' |
|
| 322 | - ); |
|
| 289 | + $theme_compat['GeoDirectory_Framework'] = array( |
|
| 290 | + 'geodir_wrapper_open_id' => 'geodir_wrapper', |
|
| 291 | + 'geodir_wrapper_open_class' => '', |
|
| 292 | + 'geodir_wrapper_open_replace' => '', |
|
| 293 | + 'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->', |
|
| 294 | + 'geodir_wrapper_content_open_id' => 'geodir_content', |
|
| 295 | + 'geodir_wrapper_content_open_class' => '', |
|
| 296 | + 'geodir_wrapper_content_open_replace' => '', |
|
| 297 | + 'geodir_wrapper_content_close_replace' => '', |
|
| 298 | + 'geodir_article_open_id' => '', |
|
| 299 | + 'geodir_article_open_class' => '', |
|
| 300 | + 'geodir_article_open_replace' => '', |
|
| 301 | + 'geodir_article_close_replace' => '', |
|
| 302 | + 'geodir_sidebar_right_open_id' => '', |
|
| 303 | + 'geodir_sidebar_right_open_class' => '', |
|
| 304 | + 'geodir_sidebar_right_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
| 305 | + 'geodir_sidebar_right_close_replace' => '', |
|
| 306 | + 'geodir_sidebar_left_open_id' => '', |
|
| 307 | + 'geodir_sidebar_left_open_class' => '', |
|
| 308 | + 'geodir_sidebar_left_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
| 309 | + 'geodir_sidebar_left_close_replace' => '', |
|
| 310 | + 'geodir_main_content_open_id' => '', |
|
| 311 | + 'geodir_main_content_open_class' => '', |
|
| 312 | + 'geodir_main_content_open_replace' => '<!-- removed -->', |
|
| 313 | + 'geodir_main_content_close_replace' => '<!-- removed -->', |
|
| 314 | + 'geodir_top_content_add' => '', |
|
| 315 | + 'geodir_before_main_content_add' => '<div class="clearfix geodir-common">', |
|
| 316 | + 'geodir_before_widget_filter' => '', |
|
| 317 | + 'geodir_after_widget_filter' => '', |
|
| 318 | + 'geodir_theme_compat_css' => '', |
|
| 319 | + 'geodir_theme_compat_js' => '', |
|
| 320 | + 'geodir_theme_compat_default_options' => '', |
|
| 321 | + 'geodir_theme_compat_code' => '' |
|
| 322 | + ); |
|
| 323 | 323 | |
| 324 | 324 | //Directory Theme |
| 325 | - $theme_compat['Directory_Starter'] = array( |
|
| 326 | - 'geodir_wrapper_open_id' => 'geodir_wrapper', |
|
| 327 | - 'geodir_wrapper_open_class' => '', |
|
| 328 | - 'geodir_wrapper_open_replace' => '', |
|
| 329 | - 'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->', |
|
| 330 | - 'geodir_wrapper_content_open_id' => 'geodir_content', |
|
| 331 | - 'geodir_wrapper_content_open_class' => '', |
|
| 332 | - 'geodir_wrapper_content_open_replace' => '', |
|
| 333 | - 'geodir_wrapper_content_close_replace' => '', |
|
| 334 | - 'geodir_article_open_id' => '', |
|
| 335 | - 'geodir_article_open_class' => '', |
|
| 336 | - 'geodir_article_open_replace' => '', |
|
| 337 | - 'geodir_article_close_replace' => '', |
|
| 338 | - 'geodir_sidebar_right_open_id' => '', |
|
| 339 | - 'geodir_sidebar_right_open_class' => '', |
|
| 340 | - 'geodir_sidebar_right_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
| 341 | - 'geodir_sidebar_right_close_replace' => '', |
|
| 342 | - 'geodir_sidebar_left_open_id' => '', |
|
| 343 | - 'geodir_sidebar_left_open_class' => '', |
|
| 344 | - 'geodir_sidebar_left_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
| 345 | - 'geodir_sidebar_left_close_replace' => '', |
|
| 346 | - 'geodir_main_content_open_id' => '', |
|
| 347 | - 'geodir_main_content_open_class' => '', |
|
| 348 | - 'geodir_main_content_open_replace' => '<!-- removed -->', |
|
| 349 | - 'geodir_main_content_close_replace' => '<!-- removed -->', |
|
| 350 | - 'geodir_top_content_add' => '', |
|
| 351 | - 'geodir_before_main_content_add' => '<div class="clearfix geodir-common">', |
|
| 352 | - 'geodir_before_widget_filter' => '', |
|
| 353 | - 'geodir_after_widget_filter' => '', |
|
| 354 | - 'geodir_theme_compat_css' => '', |
|
| 355 | - 'geodir_theme_compat_js' => '', |
|
| 356 | - 'geodir_theme_compat_default_options' => '', |
|
| 357 | - 'geodir_theme_compat_code' => '' |
|
| 358 | - ); |
|
| 325 | + $theme_compat['Directory_Starter'] = array( |
|
| 326 | + 'geodir_wrapper_open_id' => 'geodir_wrapper', |
|
| 327 | + 'geodir_wrapper_open_class' => '', |
|
| 328 | + 'geodir_wrapper_open_replace' => '', |
|
| 329 | + 'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->', |
|
| 330 | + 'geodir_wrapper_content_open_id' => 'geodir_content', |
|
| 331 | + 'geodir_wrapper_content_open_class' => '', |
|
| 332 | + 'geodir_wrapper_content_open_replace' => '', |
|
| 333 | + 'geodir_wrapper_content_close_replace' => '', |
|
| 334 | + 'geodir_article_open_id' => '', |
|
| 335 | + 'geodir_article_open_class' => '', |
|
| 336 | + 'geodir_article_open_replace' => '', |
|
| 337 | + 'geodir_article_close_replace' => '', |
|
| 338 | + 'geodir_sidebar_right_open_id' => '', |
|
| 339 | + 'geodir_sidebar_right_open_class' => '', |
|
| 340 | + 'geodir_sidebar_right_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
| 341 | + 'geodir_sidebar_right_close_replace' => '', |
|
| 342 | + 'geodir_sidebar_left_open_id' => '', |
|
| 343 | + 'geodir_sidebar_left_open_class' => '', |
|
| 344 | + 'geodir_sidebar_left_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
| 345 | + 'geodir_sidebar_left_close_replace' => '', |
|
| 346 | + 'geodir_main_content_open_id' => '', |
|
| 347 | + 'geodir_main_content_open_class' => '', |
|
| 348 | + 'geodir_main_content_open_replace' => '<!-- removed -->', |
|
| 349 | + 'geodir_main_content_close_replace' => '<!-- removed -->', |
|
| 350 | + 'geodir_top_content_add' => '', |
|
| 351 | + 'geodir_before_main_content_add' => '<div class="clearfix geodir-common">', |
|
| 352 | + 'geodir_before_widget_filter' => '', |
|
| 353 | + 'geodir_after_widget_filter' => '', |
|
| 354 | + 'geodir_theme_compat_css' => '', |
|
| 355 | + 'geodir_theme_compat_js' => '', |
|
| 356 | + 'geodir_theme_compat_default_options' => '', |
|
| 357 | + 'geodir_theme_compat_code' => '' |
|
| 358 | + ); |
|
| 359 | 359 | |
| 360 | 360 | //Jobby |
| 361 | - $theme_compat['Jobby'] = $theme_compat['Directory_Starter']; |
|
| 361 | + $theme_compat['Jobby'] = $theme_compat['Directory_Starter']; |
|
| 362 | 362 | |
| 363 | 363 | //GeoProperty |
| 364 | - $theme_compat['GeoProperty'] = $theme_compat['Directory_Starter']; |
|
| 364 | + $theme_compat['GeoProperty'] = $theme_compat['Directory_Starter']; |
|
| 365 | 365 | |
| 366 | 366 | //Avada |
| 367 | - $theme_compat['Avada'] = array( |
|
| 368 | - 'geodir_wrapper_open_id' => '', |
|
| 369 | - 'geodir_wrapper_open_class' => '', |
|
| 370 | - 'geodir_wrapper_open_replace' => '<!-- removed -->', |
|
| 371 | - 'geodir_wrapper_close_replace' => '<!-- removed -->', |
|
| 372 | - 'geodir_wrapper_content_open_id' => 'content', |
|
| 373 | - 'geodir_wrapper_content_open_class' => '', |
|
| 374 | - 'geodir_wrapper_content_open_replace' => '', |
|
| 375 | - 'geodir_wrapper_content_close_replace' => '', |
|
| 376 | - 'geodir_article_open_id' => '', |
|
| 377 | - 'geodir_article_open_class' => '', |
|
| 378 | - 'geodir_article_open_replace' => '', |
|
| 379 | - 'geodir_article_close_replace' => '', |
|
| 380 | - 'geodir_sidebar_right_open_id' => '', |
|
| 381 | - 'geodir_sidebar_right_open_class' => '', |
|
| 382 | - 'geodir_sidebar_right_open_replace' => '<div id="sidebar" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
| 383 | - 'geodir_sidebar_right_close_replace' => '</div><!-- end sidebar -->', |
|
| 384 | - 'geodir_sidebar_left_open_id' => '', |
|
| 385 | - 'geodir_sidebar_left_open_class' => '', |
|
| 386 | - 'geodir_sidebar_left_open_replace' => '<div id="sidebar" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
| 387 | - 'geodir_sidebar_left_close_replace' => '</div><!-- end sidebar -->', |
|
| 388 | - 'geodir_main_content_open_id' => '', |
|
| 389 | - 'geodir_main_content_open_class' => '', |
|
| 390 | - 'geodir_main_content_open_replace' => '<!-- removed -->', |
|
| 391 | - 'geodir_main_content_close_replace' => '<!-- removed -->', |
|
| 392 | - 'geodir_top_content_add' => '', |
|
| 393 | - 'geodir_before_main_content_add' => '', |
|
| 394 | - 'geodir_before_widget_filter' => '', |
|
| 395 | - 'geodir_after_widget_filter' => '', |
|
| 396 | - 'geodir_theme_compat_css' => stripslashes('.geodir-sidebar-left{float:left}select,textarea{border-style:solid;border-width:1px}.top-menu li > div{visibility:visible}.geodir-chosen-container-single .chosen-single{height:auto}ul li#menu-item-gd-location-switcher ul{width:222px}ul li#menu-item-gd-location-switcher ul li{padding-right:0!important}#mobile-nav li#mobile-menu-item-gd-location-switcher li a{padding-left:10px;padding-right:10px}#menu-item-gd-location-switcher dd,#mobile-menu-item-gd-location-switcher{margin-left:0}#menu-item-gd-location-switcher dd a{display:block}.geodir-chosen-container .chosen-results li.highlighted{background-color:#eee;background-image:none;color:#444}#mobile-nav li.mobile-nav-item li a:before{content:\'\';margin:0}#mobile-nav li.mobile-nav-item li a{padding:10px;width:auto}.geodir-listing-search{text-align:center}.geodir-search{float:none;margin:0}.geodir-search select,.geodir-search .search_by_post,.geodir-search input[type="text"],.geodir-search button[type="button"], .geodir-search input[type="button"],.geodir-search input[type="submit"]{display:inline-block;float:none}.geodir-cat-list ul li,.map_category ul li{list-style-type:none}.wpgeo-avada .page-title ul li:after{content:\'\'}.top_banner_section{margin-bottom:0}.geodir-category-list-in{margin:0;padding:15px}.geodir_full_page .geodir-cat-list .widget-title{margin-top:0}.geodir_full_page .geodir-cat-list ul li{padding-left:0}.geodir-loc-bar{border:none;margin:0;padding:0}.geodir-loc-bar-in{padding:15px 0}.geodir_full_page section.widget{margin-bottom:20px}.sidebar .geodir-loginbox-list li{margin-bottom:10px;padding-bottom:10px}.sidebar .geodir-loginbox-list li a{display:block}.sidebar .geodir-chosen-container .chosen-results li{margin:0;padding:5px 6px}.sidebar .geodir-chosen-container .chosen-results li.highlighted{background:#eee;background-image:none;color:#000}.sidebar .geodir_category_list_view li.geodir-gridview{display:inline-block;margin-bottom:15px}.wpgeo-avada.double-sidebars #main #sidebar{margin-left:3%}.wpgeo-avada.double-sidebars #main #sidebar-2{margin-left:-100%}.wpgeo-avada.double-sidebars #content{float:left;margin-left:0}.geodir_full_page section.widget{margin-bottom: 0px;} .sidebar .widget .geodir-hide {display: none;}li.fusion-mobile-nav-item .geodir_location_tab_container a:before{content: "" !important; margin-right: auto !important;}li.fusion-mobile-nav-item .geodir_location_tab_container a{padding-left:5px !important;}'),
|
|
| 397 | - 'geodir_theme_compat_js' => '', |
|
| 398 | - 'geodir_theme_compat_default_options' => '', |
|
| 399 | - 'geodir_theme_compat_code' => 'Avada' |
|
| 400 | - ); |
|
| 367 | + $theme_compat['Avada'] = array( |
|
| 368 | + 'geodir_wrapper_open_id' => '', |
|
| 369 | + 'geodir_wrapper_open_class' => '', |
|
| 370 | + 'geodir_wrapper_open_replace' => '<!-- removed -->', |
|
| 371 | + 'geodir_wrapper_close_replace' => '<!-- removed -->', |
|
| 372 | + 'geodir_wrapper_content_open_id' => 'content', |
|
| 373 | + 'geodir_wrapper_content_open_class' => '', |
|
| 374 | + 'geodir_wrapper_content_open_replace' => '', |
|
| 375 | + 'geodir_wrapper_content_close_replace' => '', |
|
| 376 | + 'geodir_article_open_id' => '', |
|
| 377 | + 'geodir_article_open_class' => '', |
|
| 378 | + 'geodir_article_open_replace' => '', |
|
| 379 | + 'geodir_article_close_replace' => '', |
|
| 380 | + 'geodir_sidebar_right_open_id' => '', |
|
| 381 | + 'geodir_sidebar_right_open_class' => '', |
|
| 382 | + 'geodir_sidebar_right_open_replace' => '<div id="sidebar" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
| 383 | + 'geodir_sidebar_right_close_replace' => '</div><!-- end sidebar -->', |
|
| 384 | + 'geodir_sidebar_left_open_id' => '', |
|
| 385 | + 'geodir_sidebar_left_open_class' => '', |
|
| 386 | + 'geodir_sidebar_left_open_replace' => '<div id="sidebar" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
| 387 | + 'geodir_sidebar_left_close_replace' => '</div><!-- end sidebar -->', |
|
| 388 | + 'geodir_main_content_open_id' => '', |
|
| 389 | + 'geodir_main_content_open_class' => '', |
|
| 390 | + 'geodir_main_content_open_replace' => '<!-- removed -->', |
|
| 391 | + 'geodir_main_content_close_replace' => '<!-- removed -->', |
|
| 392 | + 'geodir_top_content_add' => '', |
|
| 393 | + 'geodir_before_main_content_add' => '', |
|
| 394 | + 'geodir_before_widget_filter' => '', |
|
| 395 | + 'geodir_after_widget_filter' => '', |
|
| 396 | + 'geodir_theme_compat_css' => stripslashes('.geodir-sidebar-left{float:left}select,textarea{border-style:solid;border-width:1px}.top-menu li > div{visibility:visible}.geodir-chosen-container-single .chosen-single{height:auto}ul li#menu-item-gd-location-switcher ul{width:222px}ul li#menu-item-gd-location-switcher ul li{padding-right:0!important}#mobile-nav li#mobile-menu-item-gd-location-switcher li a{padding-left:10px;padding-right:10px}#menu-item-gd-location-switcher dd,#mobile-menu-item-gd-location-switcher{margin-left:0}#menu-item-gd-location-switcher dd a{display:block}.geodir-chosen-container .chosen-results li.highlighted{background-color:#eee;background-image:none;color:#444}#mobile-nav li.mobile-nav-item li a:before{content:\'\';margin:0}#mobile-nav li.mobile-nav-item li a{padding:10px;width:auto}.geodir-listing-search{text-align:center}.geodir-search{float:none;margin:0}.geodir-search select,.geodir-search .search_by_post,.geodir-search input[type="text"],.geodir-search button[type="button"], .geodir-search input[type="button"],.geodir-search input[type="submit"]{display:inline-block;float:none}.geodir-cat-list ul li,.map_category ul li{list-style-type:none}.wpgeo-avada .page-title ul li:after{content:\'\'}.top_banner_section{margin-bottom:0}.geodir-category-list-in{margin:0;padding:15px}.geodir_full_page .geodir-cat-list .widget-title{margin-top:0}.geodir_full_page .geodir-cat-list ul li{padding-left:0}.geodir-loc-bar{border:none;margin:0;padding:0}.geodir-loc-bar-in{padding:15px 0}.geodir_full_page section.widget{margin-bottom:20px}.sidebar .geodir-loginbox-list li{margin-bottom:10px;padding-bottom:10px}.sidebar .geodir-loginbox-list li a{display:block}.sidebar .geodir-chosen-container .chosen-results li{margin:0;padding:5px 6px}.sidebar .geodir-chosen-container .chosen-results li.highlighted{background:#eee;background-image:none;color:#000}.sidebar .geodir_category_list_view li.geodir-gridview{display:inline-block;margin-bottom:15px}.wpgeo-avada.double-sidebars #main #sidebar{margin-left:3%}.wpgeo-avada.double-sidebars #main #sidebar-2{margin-left:-100%}.wpgeo-avada.double-sidebars #content{float:left;margin-left:0}.geodir_full_page section.widget{margin-bottom: 0px;} .sidebar .widget .geodir-hide {display: none;}li.fusion-mobile-nav-item .geodir_location_tab_container a:before{content: "" !important; margin-right: auto !important;}li.fusion-mobile-nav-item .geodir_location_tab_container a{padding-left:5px !important;}'),
|
|
| 397 | + 'geodir_theme_compat_js' => '', |
|
| 398 | + 'geodir_theme_compat_default_options' => '', |
|
| 399 | + 'geodir_theme_compat_code' => 'Avada' |
|
| 400 | + ); |
|
| 401 | 401 | |
| 402 | 402 | //Enfold |
| 403 | - $theme_compat['Enfold'] = array( |
|
| 404 | - 'geodir_wrapper_open_id' => '', |
|
| 405 | - 'geodir_wrapper_open_class' => '', |
|
| 406 | - 'geodir_wrapper_open_replace' => '', |
|
| 407 | - 'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->', |
|
| 408 | - 'geodir_wrapper_content_open_id' => '', |
|
| 409 | - 'geodir_wrapper_content_open_class' => '', |
|
| 410 | - 'geodir_wrapper_content_open_replace' => '', |
|
| 411 | - 'geodir_wrapper_content_close_replace' => '</div></main>', |
|
| 412 | - 'geodir_article_open_id' => '', |
|
| 413 | - 'geodir_article_open_class' => '', |
|
| 414 | - 'geodir_article_open_replace' => '', |
|
| 415 | - 'geodir_article_close_replace' => '', |
|
| 416 | - 'geodir_sidebar_right_open_id' => '', |
|
| 417 | - 'geodir_sidebar_right_open_class' => '', |
|
| 418 | - 'geodir_sidebar_right_open_replace' => '', |
|
| 419 | - 'geodir_sidebar_right_close_replace' => '</div></aside><!-- sidebar ends here-->', |
|
| 420 | - 'geodir_sidebar_left_open_id' => '', |
|
| 421 | - 'geodir_sidebar_left_open_class' => '', |
|
| 422 | - 'geodir_sidebar_left_open_replace' => '', |
|
| 423 | - 'geodir_sidebar_left_close_replace' => '</div></aside><!-- sidebar ends here-->', |
|
| 424 | - 'geodir_main_content_open_id' => '', |
|
| 425 | - 'geodir_main_content_open_class' => '', |
|
| 426 | - 'geodir_main_content_open_replace' => '', |
|
| 427 | - 'geodir_main_content_close_replace' => '', |
|
| 428 | - 'geodir_top_content_add' => '', |
|
| 429 | - 'geodir_before_main_content_add' => '', |
|
| 430 | - 'geodir_before_widget_filter' => '', |
|
| 431 | - 'geodir_after_widget_filter' => '', |
|
| 432 | - 'geodir_theme_compat_css' => stripslashes('.geodir_full_page .top_banner_section{margin-bottom:0}.widget .geodir-cat-list ul li{clear:none}.wpgeo-enfold .av-main-nav ul{width:222px}.geodir-listing-search .geodir-loc-bar{border-top:none;padding:0}#main .geodir-listing-search,.geodir-listing-search .geodir-loc-bar{margin-bottom:0}#main .geodir-loc-bar-in,#main .geodir-category-list-in{background-color:#fcfcfc;margin:20px 0;padding:20px}#main .geodir_full_page .geodir-loc-bar-in,#main .geodir_full_page .geodir-loc-bar,#main .geodir_full_page .geodir-category-list-in{margin-top:0;margin-bottom:0}#main .geodir-loc-bar-in{padding:20px}#main .geodir-search{margin:0;width:100%}#main .geodir-search select{margin:0 3% 0 0;padding:8px 10px;width:13%}#main .geodir-search input[type="text"]{margin:0 3% 0 0;padding:10px;width:32.4%}#main .geodir-search input[type="button"],#main .geodir-search input[type="submit"]{font-size:inherit;line-height:2.25;margin:0;padding:7px;width:13%}.enfold-home-top section.widget{margin:0;padding:0}.enfold-home-top .top_banner_section{margin-bottom:0}.enfold-home-top .geodir-loc-bar{background:#fcfcfc;border:none;margin:0;padding:0}#main .enfold-home-top .geodir-loc-bar-in{background:none;border:none;margin:0 auto;padding:20px 0}#main .geodir-breadcrumb{border-bottom-style:solid;border-bottom-width:1px}#gd-tabs dt{clear:none}#geodir_slider ul li{list-style-type:none;margin:0;padding:0}#respond{clear:both}#comments .comments-title span{display:inline;font-size:inherit;font-weight:700}#reviewsTab .comments-area .bypostauthor cite span{display:inline}#top #comments .commentlist .comment,#top #comments .commentlist .comment > div{min-height:0}.commentlist .commenttext{padding-top:15px}#comment_imagesdropbox{margin-bottom:20px}.wpgeo-enfold .geodir_category_list_view li{margin-left:0;padding:0}.widget ul.geodir-loginbox-list{overflow:visible}.geodir_category_list_view li .geodir-post-img{display:block}.wpgeo-enfold .geodir_event_listing_calendar tr.title{background:#ccc}@media only screen and (max-width:480px){.geodir_category_list_view li .geodir-content,.geodir_category_list_view li .geodir-post-img,.geodir_category_list_view li .geodir-addinfo{float:none;width:100%;margin:10px 0}#main .geodir-search input[type="text"],#main .geodir-search input[type="button"],#main .geodir-search input[type="submit"],#main .geodir-search select{margin:10px 0;width:100%}}#main .geodir_full_page section:last-child .geodir-loc-bar{margin-bottom: -1px;border-bottom: none;}'),
|
|
| 433 | - 'geodir_theme_compat_js' => '', |
|
| 434 | - 'geodir_theme_compat_default_options' => '', |
|
| 435 | - 'geodir_theme_compat_code' => 'Enfold' |
|
| 436 | - ); |
|
| 403 | + $theme_compat['Enfold'] = array( |
|
| 404 | + 'geodir_wrapper_open_id' => '', |
|
| 405 | + 'geodir_wrapper_open_class' => '', |
|
| 406 | + 'geodir_wrapper_open_replace' => '', |
|
| 407 | + 'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->', |
|
| 408 | + 'geodir_wrapper_content_open_id' => '', |
|
| 409 | + 'geodir_wrapper_content_open_class' => '', |
|
| 410 | + 'geodir_wrapper_content_open_replace' => '', |
|
| 411 | + 'geodir_wrapper_content_close_replace' => '</div></main>', |
|
| 412 | + 'geodir_article_open_id' => '', |
|
| 413 | + 'geodir_article_open_class' => '', |
|
| 414 | + 'geodir_article_open_replace' => '', |
|
| 415 | + 'geodir_article_close_replace' => '', |
|
| 416 | + 'geodir_sidebar_right_open_id' => '', |
|
| 417 | + 'geodir_sidebar_right_open_class' => '', |
|
| 418 | + 'geodir_sidebar_right_open_replace' => '', |
|
| 419 | + 'geodir_sidebar_right_close_replace' => '</div></aside><!-- sidebar ends here-->', |
|
| 420 | + 'geodir_sidebar_left_open_id' => '', |
|
| 421 | + 'geodir_sidebar_left_open_class' => '', |
|
| 422 | + 'geodir_sidebar_left_open_replace' => '', |
|
| 423 | + 'geodir_sidebar_left_close_replace' => '</div></aside><!-- sidebar ends here-->', |
|
| 424 | + 'geodir_main_content_open_id' => '', |
|
| 425 | + 'geodir_main_content_open_class' => '', |
|
| 426 | + 'geodir_main_content_open_replace' => '', |
|
| 427 | + 'geodir_main_content_close_replace' => '', |
|
| 428 | + 'geodir_top_content_add' => '', |
|
| 429 | + 'geodir_before_main_content_add' => '', |
|
| 430 | + 'geodir_before_widget_filter' => '', |
|
| 431 | + 'geodir_after_widget_filter' => '', |
|
| 432 | + 'geodir_theme_compat_css' => stripslashes('.geodir_full_page .top_banner_section{margin-bottom:0}.widget .geodir-cat-list ul li{clear:none}.wpgeo-enfold .av-main-nav ul{width:222px}.geodir-listing-search .geodir-loc-bar{border-top:none;padding:0}#main .geodir-listing-search,.geodir-listing-search .geodir-loc-bar{margin-bottom:0}#main .geodir-loc-bar-in,#main .geodir-category-list-in{background-color:#fcfcfc;margin:20px 0;padding:20px}#main .geodir_full_page .geodir-loc-bar-in,#main .geodir_full_page .geodir-loc-bar,#main .geodir_full_page .geodir-category-list-in{margin-top:0;margin-bottom:0}#main .geodir-loc-bar-in{padding:20px}#main .geodir-search{margin:0;width:100%}#main .geodir-search select{margin:0 3% 0 0;padding:8px 10px;width:13%}#main .geodir-search input[type="text"]{margin:0 3% 0 0;padding:10px;width:32.4%}#main .geodir-search input[type="button"],#main .geodir-search input[type="submit"]{font-size:inherit;line-height:2.25;margin:0;padding:7px;width:13%}.enfold-home-top section.widget{margin:0;padding:0}.enfold-home-top .top_banner_section{margin-bottom:0}.enfold-home-top .geodir-loc-bar{background:#fcfcfc;border:none;margin:0;padding:0}#main .enfold-home-top .geodir-loc-bar-in{background:none;border:none;margin:0 auto;padding:20px 0}#main .geodir-breadcrumb{border-bottom-style:solid;border-bottom-width:1px}#gd-tabs dt{clear:none}#geodir_slider ul li{list-style-type:none;margin:0;padding:0}#respond{clear:both}#comments .comments-title span{display:inline;font-size:inherit;font-weight:700}#reviewsTab .comments-area .bypostauthor cite span{display:inline}#top #comments .commentlist .comment,#top #comments .commentlist .comment > div{min-height:0}.commentlist .commenttext{padding-top:15px}#comment_imagesdropbox{margin-bottom:20px}.wpgeo-enfold .geodir_category_list_view li{margin-left:0;padding:0}.widget ul.geodir-loginbox-list{overflow:visible}.geodir_category_list_view li .geodir-post-img{display:block}.wpgeo-enfold .geodir_event_listing_calendar tr.title{background:#ccc}@media only screen and (max-width:480px){.geodir_category_list_view li .geodir-content,.geodir_category_list_view li .geodir-post-img,.geodir_category_list_view li .geodir-addinfo{float:none;width:100%;margin:10px 0}#main .geodir-search input[type="text"],#main .geodir-search input[type="button"],#main .geodir-search input[type="submit"],#main .geodir-search select{margin:10px 0;width:100%}}#main .geodir_full_page section:last-child .geodir-loc-bar{margin-bottom: -1px;border-bottom: none;}'),
|
|
| 433 | + 'geodir_theme_compat_js' => '', |
|
| 434 | + 'geodir_theme_compat_default_options' => '', |
|
| 435 | + 'geodir_theme_compat_code' => 'Enfold' |
|
| 436 | + ); |
|
| 437 | 437 | |
| 438 | 438 | // X |
| 439 | - $theme_compat['X'] = array( |
|
| 440 | - 'geodir_wrapper_open_id' => '', |
|
| 441 | - 'geodir_wrapper_open_class' => '', |
|
| 442 | - 'geodir_wrapper_open_replace' => '', |
|
| 443 | - 'geodir_wrapper_close_replace' => '', |
|
| 444 | - 'geodir_wrapper_content_open_id' => '', |
|
| 445 | - 'geodir_wrapper_content_open_class' => '', |
|
| 446 | - 'geodir_wrapper_content_open_replace' => '', |
|
| 447 | - 'geodir_wrapper_content_close_replace' => '', |
|
| 448 | - 'geodir_article_open_id' => '', |
|
| 449 | - 'geodir_article_open_class' => '', |
|
| 450 | - 'geodir_article_open_replace' => '', |
|
| 451 | - 'geodir_article_close_replace' => '', |
|
| 452 | - 'geodir_sidebar_right_open_id' => '', |
|
| 453 | - 'geodir_sidebar_right_open_class' => '', |
|
| 454 | - 'geodir_sidebar_right_open_replace' => '', |
|
| 455 | - 'geodir_sidebar_right_close_replace' => '', |
|
| 456 | - 'geodir_sidebar_left_open_id' => '', |
|
| 457 | - 'geodir_sidebar_left_open_class' => '', |
|
| 458 | - 'geodir_sidebar_left_open_replace' => '', |
|
| 459 | - 'geodir_sidebar_left_close_replace' => '', |
|
| 460 | - 'geodir_main_content_open_id' => '', |
|
| 461 | - 'geodir_main_content_open_class' => '', |
|
| 462 | - 'geodir_main_content_open_replace' => '', |
|
| 463 | - 'geodir_main_content_close_replace' => '', |
|
| 464 | - 'geodir_top_content_add' => '', |
|
| 465 | - 'geodir_before_main_content_add' => '', |
|
| 466 | - 'geodir_before_widget_filter' => '', |
|
| 467 | - 'geodir_after_widget_filter' => '', |
|
| 468 | - 'geodir_theme_compat_css' => stripslashes('.x-colophon.bottom{clear:both}#geodir-main-content,.geodir_flex-container{margin-top:16px}.geodir-x ul{list-style:none}.widget ul.geodir_category_list_view{border:none}.geodir_category_list_view li.geodir-gridview:last-child{border-bottom:1px solid #e1e1e1}.home .x-header-landmark{display:none}.geodir-x .x-main .geodir_advance_search_widget{margin:0}.geodir-x .top_banner_section{margin-bottom:0}.geodir-loc-bar{background:rgba(0,0,0,0.05);margin:0;padding:0}.geodir-loc-bar-in{background:none;border:none;padding:10px}.geodir-search{margin:0;width:100%}.widget .geodir-search select,.geodir-search input[type="text"],.geodir-search input[type="button"],.geodir-search input[type="submit"]{border:1px solid #ccc;box-shadow:none;height:auto;line-height:21px;margin:0 1% 0 0;padding:5px 10px}.widget .geodir-search select,.geodir-search input[type="text"]{width:28%}.geodir-search input[type="submit"],.geodir-search input[type="button"]{line-height:19px;margin-right:0;width:11%}.geodir-search input:hover[type="submit"],.geodir-search input:hover[type="button"]{background:#333;color:#fff}.geodir-cat-list .widget-title{margin-top:0}.geodir-x .geodir-category-list-in{background:rgba(0,0,0,0.05);border:none}.widget .geodir-cat-list ul.geodir-popular-cat-list{border:none;border-radius:0;box-shadow:none}.geodir_full_page .geodir-cat-list ul li{border:none}.geodir_full_page .geodir-cat-list ul li a{border:none}.post-type-archive .geodir-loc-bar{border:none;margin-top:20px}#menu-item-gd-location-switcher dd{margin-left:0}.geodir-chosen-container-single .chosen-single{height:auto}.widget ul.geodir-loginbox-list{overflow:visible}.geodir_full_page section.widget{clear:both}.x-ethos .entry-title{margin-bottom:20px}.x-ethos .geodir-chosen-container-single .chosen-single{padding:0 0 0 8px}.x-ethos .widget ul li a,.x-ethos .geodir_category_list_view li{color:#333}@media only screen and (max-width:767px){.widget .geodir-search select,.geodir-search input[type="text"],.geodir-search input[type="button"],.geodir-search input[type="submit"]{margin:0 0 10px;width:100%}}.geodir_full_page .geodir-loc-bar-in,.geodir_full_page .geodir-loc-bar,.geodir_full_page .geodir-category-list-in{margin-top:0;margin-bottom:0}.geodir_full_page .geodir-loc-bar-in,.geodir_full_page .geodir-category-list-in{border-bottom:1px solid rgba(0,0,0,0.1)}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'),
|
|
| 469 | - 'geodir_theme_compat_js' => '', |
|
| 470 | - 'geodir_theme_compat_default_options' => '', |
|
| 471 | - 'geodir_theme_compat_code' => 'X' |
|
| 472 | - ); |
|
| 439 | + $theme_compat['X'] = array( |
|
| 440 | + 'geodir_wrapper_open_id' => '', |
|
| 441 | + 'geodir_wrapper_open_class' => '', |
|
| 442 | + 'geodir_wrapper_open_replace' => '', |
|
| 443 | + 'geodir_wrapper_close_replace' => '', |
|
| 444 | + 'geodir_wrapper_content_open_id' => '', |
|
| 445 | + 'geodir_wrapper_content_open_class' => '', |
|
| 446 | + 'geodir_wrapper_content_open_replace' => '', |
|
| 447 | + 'geodir_wrapper_content_close_replace' => '', |
|
| 448 | + 'geodir_article_open_id' => '', |
|
| 449 | + 'geodir_article_open_class' => '', |
|
| 450 | + 'geodir_article_open_replace' => '', |
|
| 451 | + 'geodir_article_close_replace' => '', |
|
| 452 | + 'geodir_sidebar_right_open_id' => '', |
|
| 453 | + 'geodir_sidebar_right_open_class' => '', |
|
| 454 | + 'geodir_sidebar_right_open_replace' => '', |
|
| 455 | + 'geodir_sidebar_right_close_replace' => '', |
|
| 456 | + 'geodir_sidebar_left_open_id' => '', |
|
| 457 | + 'geodir_sidebar_left_open_class' => '', |
|
| 458 | + 'geodir_sidebar_left_open_replace' => '', |
|
| 459 | + 'geodir_sidebar_left_close_replace' => '', |
|
| 460 | + 'geodir_main_content_open_id' => '', |
|
| 461 | + 'geodir_main_content_open_class' => '', |
|
| 462 | + 'geodir_main_content_open_replace' => '', |
|
| 463 | + 'geodir_main_content_close_replace' => '', |
|
| 464 | + 'geodir_top_content_add' => '', |
|
| 465 | + 'geodir_before_main_content_add' => '', |
|
| 466 | + 'geodir_before_widget_filter' => '', |
|
| 467 | + 'geodir_after_widget_filter' => '', |
|
| 468 | + 'geodir_theme_compat_css' => stripslashes('.x-colophon.bottom{clear:both}#geodir-main-content,.geodir_flex-container{margin-top:16px}.geodir-x ul{list-style:none}.widget ul.geodir_category_list_view{border:none}.geodir_category_list_view li.geodir-gridview:last-child{border-bottom:1px solid #e1e1e1}.home .x-header-landmark{display:none}.geodir-x .x-main .geodir_advance_search_widget{margin:0}.geodir-x .top_banner_section{margin-bottom:0}.geodir-loc-bar{background:rgba(0,0,0,0.05);margin:0;padding:0}.geodir-loc-bar-in{background:none;border:none;padding:10px}.geodir-search{margin:0;width:100%}.widget .geodir-search select,.geodir-search input[type="text"],.geodir-search input[type="button"],.geodir-search input[type="submit"]{border:1px solid #ccc;box-shadow:none;height:auto;line-height:21px;margin:0 1% 0 0;padding:5px 10px}.widget .geodir-search select,.geodir-search input[type="text"]{width:28%}.geodir-search input[type="submit"],.geodir-search input[type="button"]{line-height:19px;margin-right:0;width:11%}.geodir-search input:hover[type="submit"],.geodir-search input:hover[type="button"]{background:#333;color:#fff}.geodir-cat-list .widget-title{margin-top:0}.geodir-x .geodir-category-list-in{background:rgba(0,0,0,0.05);border:none}.widget .geodir-cat-list ul.geodir-popular-cat-list{border:none;border-radius:0;box-shadow:none}.geodir_full_page .geodir-cat-list ul li{border:none}.geodir_full_page .geodir-cat-list ul li a{border:none}.post-type-archive .geodir-loc-bar{border:none;margin-top:20px}#menu-item-gd-location-switcher dd{margin-left:0}.geodir-chosen-container-single .chosen-single{height:auto}.widget ul.geodir-loginbox-list{overflow:visible}.geodir_full_page section.widget{clear:both}.x-ethos .entry-title{margin-bottom:20px}.x-ethos .geodir-chosen-container-single .chosen-single{padding:0 0 0 8px}.x-ethos .widget ul li a,.x-ethos .geodir_category_list_view li{color:#333}@media only screen and (max-width:767px){.widget .geodir-search select,.geodir-search input[type="text"],.geodir-search input[type="button"],.geodir-search input[type="submit"]{margin:0 0 10px;width:100%}}.geodir_full_page .geodir-loc-bar-in,.geodir_full_page .geodir-loc-bar,.geodir_full_page .geodir-category-list-in{margin-top:0;margin-bottom:0}.geodir_full_page .geodir-loc-bar-in,.geodir_full_page .geodir-category-list-in{border-bottom:1px solid rgba(0,0,0,0.1)}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'),
|
|
| 469 | + 'geodir_theme_compat_js' => '', |
|
| 470 | + 'geodir_theme_compat_default_options' => '', |
|
| 471 | + 'geodir_theme_compat_code' => 'X' |
|
| 472 | + ); |
|
| 473 | 473 | |
| 474 | 474 | // Divi |
| 475 | - $theme_compat['Divi'] = array( |
|
| 476 | - 'geodir_wrapper_open_id' => 'main-content', |
|
| 477 | - 'geodir_wrapper_open_class' => '', |
|
| 478 | - 'geodir_wrapper_open_replace' => '', |
|
| 479 | - 'geodir_wrapper_close_replace' => '', |
|
| 480 | - 'geodir_wrapper_content_open_id' => 'left-area', |
|
| 481 | - 'geodir_wrapper_content_open_class' => '', |
|
| 482 | - 'geodir_wrapper_content_open_replace' => '<div class="container"><div id="content-area" class="clearfix"><div id="[id]" class="[class]" role="main" >', |
|
| 483 | - 'geodir_wrapper_content_close_replace' => '', |
|
| 484 | - 'geodir_article_open_id' => '', |
|
| 485 | - 'geodir_article_open_class' => '', |
|
| 486 | - 'geodir_article_open_replace' => '', |
|
| 487 | - 'geodir_article_close_replace' => '', |
|
| 488 | - 'geodir_sidebar_right_open_id' => 'sidebar', |
|
| 489 | - 'geodir_sidebar_right_open_class' => '', |
|
| 490 | - 'geodir_sidebar_right_open_replace' => '<aside id="[id]" class="" role="complementary" itemscope itemtype="[itemtype]" >', |
|
| 491 | - 'geodir_sidebar_right_close_replace' => '</aside><!-- sidebar ends here--></div></div>', |
|
| 492 | - 'geodir_sidebar_left_open_id' => 'sidebar', |
|
| 493 | - 'geodir_sidebar_left_open_class' => '', |
|
| 494 | - 'geodir_sidebar_left_open_replace' => '<aside id="[id]" class="" role="complementary" itemscope itemtype="[itemtype]" >', |
|
| 495 | - 'geodir_sidebar_left_close_replace' => '</aside><!-- sidebar ends here--></div></div>', |
|
| 496 | - 'geodir_main_content_open_id' => '', |
|
| 497 | - 'geodir_main_content_open_class' => '', |
|
| 498 | - 'geodir_main_content_open_replace' => '', |
|
| 499 | - 'geodir_main_content_close_replace' => '', |
|
| 500 | - 'geodir_top_content_add' => '', |
|
| 501 | - 'geodir_before_main_content_add' => '', |
|
| 502 | - 'geodir_before_widget_filter' => '', |
|
| 503 | - 'geodir_after_widget_filter' => '', |
|
| 504 | - 'geodir_theme_compat_css' => stripslashes('#left-area ul.geodir-direction-nav{list-style-type:none}#sidebar .geodir-company_info{margin-left:30px}#sidebar .geodir-widget{float:none;margin:0 0 30px 30px}.geodir_full_page .geodir-loc-bar{padding:0;margin:0;border:none}.geodir_full_page .geodir-category-list-in{margin-top:0}.geodir_full_page .top_banner_section{margin-bottom:0}.archive .entry-header,.geodir-breadcrumb{border-bottom:1px solid #e2e2e2}.archive .entry-header h1,ul#breadcrumbs{margin:0 auto;width:1080px}#left-area ul.geodir_category_list_view{padding:10px 0}.nav li#menu-item-gd-location-switcher ul{width:222px}#menu-item-gd-location-switcher li.gd-location-switcher-menu-item{padding-right:0}#menu-item-gd-location-switcher dd{margin-left:0}#menu-item-gd-location-switcher .geodir_location_tab_container dd a{padding:5px;width:auto}@media only screen and ( max-width: 980px ){.geodir-loc-bar-in,.geodir-cat-list,ul#breadcrumbs{width:690px}}@media only screen and ( max-width: 767px ){.geodir-loc-bar-in,.geodir-cat-list,ul#breadcrumbs{width:400px}}@media only screen and ( max-width: 479px ){.geodir-loc-bar-in,.geodir-cat-list,ul#breadcrumbs{width:280px}}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'),
|
|
| 505 | - 'geodir_theme_compat_js' => '', |
|
| 506 | - 'geodir_theme_compat_default_options' => '', |
|
| 507 | - 'geodir_theme_compat_code' => 'Divi' |
|
| 508 | - ); |
|
| 475 | + $theme_compat['Divi'] = array( |
|
| 476 | + 'geodir_wrapper_open_id' => 'main-content', |
|
| 477 | + 'geodir_wrapper_open_class' => '', |
|
| 478 | + 'geodir_wrapper_open_replace' => '', |
|
| 479 | + 'geodir_wrapper_close_replace' => '', |
|
| 480 | + 'geodir_wrapper_content_open_id' => 'left-area', |
|
| 481 | + 'geodir_wrapper_content_open_class' => '', |
|
| 482 | + 'geodir_wrapper_content_open_replace' => '<div class="container"><div id="content-area" class="clearfix"><div id="[id]" class="[class]" role="main" >', |
|
| 483 | + 'geodir_wrapper_content_close_replace' => '', |
|
| 484 | + 'geodir_article_open_id' => '', |
|
| 485 | + 'geodir_article_open_class' => '', |
|
| 486 | + 'geodir_article_open_replace' => '', |
|
| 487 | + 'geodir_article_close_replace' => '', |
|
| 488 | + 'geodir_sidebar_right_open_id' => 'sidebar', |
|
| 489 | + 'geodir_sidebar_right_open_class' => '', |
|
| 490 | + 'geodir_sidebar_right_open_replace' => '<aside id="[id]" class="" role="complementary" itemscope itemtype="[itemtype]" >', |
|
| 491 | + 'geodir_sidebar_right_close_replace' => '</aside><!-- sidebar ends here--></div></div>', |
|
| 492 | + 'geodir_sidebar_left_open_id' => 'sidebar', |
|
| 493 | + 'geodir_sidebar_left_open_class' => '', |
|
| 494 | + 'geodir_sidebar_left_open_replace' => '<aside id="[id]" class="" role="complementary" itemscope itemtype="[itemtype]" >', |
|
| 495 | + 'geodir_sidebar_left_close_replace' => '</aside><!-- sidebar ends here--></div></div>', |
|
| 496 | + 'geodir_main_content_open_id' => '', |
|
| 497 | + 'geodir_main_content_open_class' => '', |
|
| 498 | + 'geodir_main_content_open_replace' => '', |
|
| 499 | + 'geodir_main_content_close_replace' => '', |
|
| 500 | + 'geodir_top_content_add' => '', |
|
| 501 | + 'geodir_before_main_content_add' => '', |
|
| 502 | + 'geodir_before_widget_filter' => '', |
|
| 503 | + 'geodir_after_widget_filter' => '', |
|
| 504 | + 'geodir_theme_compat_css' => stripslashes('#left-area ul.geodir-direction-nav{list-style-type:none}#sidebar .geodir-company_info{margin-left:30px}#sidebar .geodir-widget{float:none;margin:0 0 30px 30px}.geodir_full_page .geodir-loc-bar{padding:0;margin:0;border:none}.geodir_full_page .geodir-category-list-in{margin-top:0}.geodir_full_page .top_banner_section{margin-bottom:0}.archive .entry-header,.geodir-breadcrumb{border-bottom:1px solid #e2e2e2}.archive .entry-header h1,ul#breadcrumbs{margin:0 auto;width:1080px}#left-area ul.geodir_category_list_view{padding:10px 0}.nav li#menu-item-gd-location-switcher ul{width:222px}#menu-item-gd-location-switcher li.gd-location-switcher-menu-item{padding-right:0}#menu-item-gd-location-switcher dd{margin-left:0}#menu-item-gd-location-switcher .geodir_location_tab_container dd a{padding:5px;width:auto}@media only screen and ( max-width: 980px ){.geodir-loc-bar-in,.geodir-cat-list,ul#breadcrumbs{width:690px}}@media only screen and ( max-width: 767px ){.geodir-loc-bar-in,.geodir-cat-list,ul#breadcrumbs{width:400px}}@media only screen and ( max-width: 479px ){.geodir-loc-bar-in,.geodir-cat-list,ul#breadcrumbs{width:280px}}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'),
|
|
| 505 | + 'geodir_theme_compat_js' => '', |
|
| 506 | + 'geodir_theme_compat_default_options' => '', |
|
| 507 | + 'geodir_theme_compat_code' => 'Divi' |
|
| 508 | + ); |
|
| 509 | 509 | |
| 510 | 510 | // Genesis |
| 511 | - $theme_compat['Genesis'] = array( |
|
| 512 | - 'geodir_wrapper_open_id' => '', |
|
| 513 | - 'geodir_wrapper_open_class' => 'content-sidebar-wrap', |
|
| 514 | - 'geodir_wrapper_open_replace' => '', |
|
| 515 | - 'geodir_wrapper_close_replace' => '', |
|
| 516 | - 'geodir_wrapper_content_open_id' => '', |
|
| 517 | - 'geodir_wrapper_content_open_class' => 'content', |
|
| 518 | - 'geodir_wrapper_content_open_replace' => '<div class="[class]" role="main" >', |
|
| 519 | - 'geodir_wrapper_content_close_replace' => '', |
|
| 520 | - 'geodir_article_open_id' => '', |
|
| 521 | - 'geodir_article_open_class' => '', |
|
| 522 | - 'geodir_article_open_replace' => '', |
|
| 523 | - 'geodir_article_close_replace' => '', |
|
| 524 | - 'geodir_sidebar_right_open_id' => '', |
|
| 525 | - 'geodir_sidebar_right_open_class' => 'sidebar sidebar-primary widget-area', |
|
| 526 | - 'geodir_sidebar_right_open_replace' => '<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]">', |
|
| 527 | - 'geodir_sidebar_right_close_replace' => '', |
|
| 528 | - 'geodir_sidebar_left_open_id' => '', |
|
| 529 | - 'geodir_sidebar_left_open_class' => 'sidebar sidebar-secondary widget-area', |
|
| 530 | - 'geodir_sidebar_left_open_replace' => '<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]">', |
|
| 531 | - 'geodir_sidebar_left_close_replace' => '', |
|
| 532 | - 'geodir_main_content_open_id' => '', |
|
| 533 | - 'geodir_main_content_open_class' => '', |
|
| 534 | - 'geodir_main_content_open_replace' => '<main id="[id]" class="entry [class]" role="main">', |
|
| 535 | - 'geodir_main_content_close_replace' => '', |
|
| 536 | - 'geodir_top_content_add' => '', |
|
| 537 | - 'geodir_before_main_content_add' => '', |
|
| 538 | - 'geodir_before_widget_filter' => '', |
|
| 539 | - 'geodir_after_widget_filter' => '', |
|
| 540 | - 'geodir_location_switcher_menu_li_class_filter' => 'menu-item menu-item-gd-location-switcher menu-item-has-children gd-location-switcher', |
|
| 541 | - 'geodir_theme_compat_css' => stripslashes('.full-width-content #geodir-wrapper-content{width:100%}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}.content{float:left}.sidebar-content .content,.sidebar-content #geodir-wrapper-content{float:right}.sidebar .geodir-company_info{background-color:#fff;border:none}.geodir_full_page .geodir-loc-bar{padding:0;margin:0;border:none}.geodir_full_page .geodir-category-list-in{margin-top:0}.geodir_full_page .top_banner_section{margin-bottom:0}.geodir-breadcrumb-bar{margin-bottom:-35px} .search-page .entry-title,.listings-page .entry-title{font-size: 20px;}.site-inner .geodir-breadcrumb-bar{margin-bottom:0px}'),
|
|
| 542 | - 'geodir_theme_compat_js' => '', |
|
| 543 | - 'geodir_theme_compat_default_options' => '', |
|
| 544 | - 'geodir_theme_compat_code' => 'Genesis' |
|
| 545 | - ); |
|
| 511 | + $theme_compat['Genesis'] = array( |
|
| 512 | + 'geodir_wrapper_open_id' => '', |
|
| 513 | + 'geodir_wrapper_open_class' => 'content-sidebar-wrap', |
|
| 514 | + 'geodir_wrapper_open_replace' => '', |
|
| 515 | + 'geodir_wrapper_close_replace' => '', |
|
| 516 | + 'geodir_wrapper_content_open_id' => '', |
|
| 517 | + 'geodir_wrapper_content_open_class' => 'content', |
|
| 518 | + 'geodir_wrapper_content_open_replace' => '<div class="[class]" role="main" >', |
|
| 519 | + 'geodir_wrapper_content_close_replace' => '', |
|
| 520 | + 'geodir_article_open_id' => '', |
|
| 521 | + 'geodir_article_open_class' => '', |
|
| 522 | + 'geodir_article_open_replace' => '', |
|
| 523 | + 'geodir_article_close_replace' => '', |
|
| 524 | + 'geodir_sidebar_right_open_id' => '', |
|
| 525 | + 'geodir_sidebar_right_open_class' => 'sidebar sidebar-primary widget-area', |
|
| 526 | + 'geodir_sidebar_right_open_replace' => '<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]">', |
|
| 527 | + 'geodir_sidebar_right_close_replace' => '', |
|
| 528 | + 'geodir_sidebar_left_open_id' => '', |
|
| 529 | + 'geodir_sidebar_left_open_class' => 'sidebar sidebar-secondary widget-area', |
|
| 530 | + 'geodir_sidebar_left_open_replace' => '<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]">', |
|
| 531 | + 'geodir_sidebar_left_close_replace' => '', |
|
| 532 | + 'geodir_main_content_open_id' => '', |
|
| 533 | + 'geodir_main_content_open_class' => '', |
|
| 534 | + 'geodir_main_content_open_replace' => '<main id="[id]" class="entry [class]" role="main">', |
|
| 535 | + 'geodir_main_content_close_replace' => '', |
|
| 536 | + 'geodir_top_content_add' => '', |
|
| 537 | + 'geodir_before_main_content_add' => '', |
|
| 538 | + 'geodir_before_widget_filter' => '', |
|
| 539 | + 'geodir_after_widget_filter' => '', |
|
| 540 | + 'geodir_location_switcher_menu_li_class_filter' => 'menu-item menu-item-gd-location-switcher menu-item-has-children gd-location-switcher', |
|
| 541 | + 'geodir_theme_compat_css' => stripslashes('.full-width-content #geodir-wrapper-content{width:100%}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}.content{float:left}.sidebar-content .content,.sidebar-content #geodir-wrapper-content{float:right}.sidebar .geodir-company_info{background-color:#fff;border:none}.geodir_full_page .geodir-loc-bar{padding:0;margin:0;border:none}.geodir_full_page .geodir-category-list-in{margin-top:0}.geodir_full_page .top_banner_section{margin-bottom:0}.geodir-breadcrumb-bar{margin-bottom:-35px} .search-page .entry-title,.listings-page .entry-title{font-size: 20px;}.site-inner .geodir-breadcrumb-bar{margin-bottom:0px}'),
|
|
| 542 | + 'geodir_theme_compat_js' => '', |
|
| 543 | + 'geodir_theme_compat_default_options' => '', |
|
| 544 | + 'geodir_theme_compat_code' => 'Genesis' |
|
| 545 | + ); |
|
| 546 | 546 | |
| 547 | 547 | // Jupiter |
| 548 | - $theme_compat['Jupiter'] = array( |
|
| 549 | - 'geodir_wrapper_open_id' => '', |
|
| 550 | - 'geodir_wrapper_open_class' => '', |
|
| 551 | - 'geodir_wrapper_open_replace' => '<div id="theme-page"><div class="mk-main-wrapper-holder"><div class="theme-page-wrapper mk-main-wrapper mk-grid vc_row-fluid">', |
|
| 552 | - 'geodir_wrapper_close_replace' => '</div></div></div>', |
|
| 553 | - 'geodir_wrapper_content_open_id' => '', |
|
| 554 | - 'geodir_wrapper_content_open_class' => '', |
|
| 555 | - 'geodir_wrapper_content_open_replace' => '', |
|
| 556 | - 'geodir_wrapper_content_close_replace' => '', |
|
| 557 | - 'geodir_article_open_id' => '', |
|
| 558 | - 'geodir_article_open_class' => '', |
|
| 559 | - 'geodir_article_open_replace' => '', |
|
| 560 | - 'geodir_article_close_replace' => '', |
|
| 561 | - 'geodir_sidebar_right_open_id' => 'mk-sidebar', |
|
| 562 | - 'geodir_sidebar_right_open_class' => 'mk-builtin geodir-sidebar-right geodir-listings-sidebar-right', |
|
| 563 | - 'geodir_sidebar_right_open_replace' => '', |
|
| 564 | - 'geodir_sidebar_right_close_replace' => '', |
|
| 565 | - 'geodir_sidebar_left_open_id' => 'mk-sidebar', |
|
| 566 | - 'geodir_sidebar_left_open_class' => 'mk-builtin geodir-sidebar-right geodir-listings-sidebar-right', |
|
| 567 | - 'geodir_sidebar_left_open_replace' => '', |
|
| 568 | - 'geodir_sidebar_left_close_replace' => '', |
|
| 569 | - 'geodir_main_content_open_id' => '', |
|
| 570 | - 'geodir_main_content_open_class' => '', |
|
| 571 | - 'geodir_main_content_open_replace' => '', |
|
| 572 | - 'geodir_main_content_close_replace' => '', |
|
| 573 | - 'geodir_top_content_add' => '', |
|
| 574 | - 'geodir_before_main_content_add' => '', |
|
| 575 | - 'geodir_before_widget_filter' => '', |
|
| 576 | - 'geodir_after_widget_filter' => '', |
|
| 577 | - 'geodir_before_title_filter' => '<h3 class="widgettitle geodir-widget-title">', |
|
| 578 | - 'geodir_after_title_filter' => '', |
|
| 579 | - 'geodir_menu_li_class_filter' => 'menu-item menu-item-has-children no-mega-menu', |
|
| 580 | - 'geodir_sub_menu_ul_class_filter' => '', |
|
| 581 | - 'geodir_sub_menu_li_class_filter' => '', |
|
| 582 | - 'geodir_menu_a_class_filter' => 'menu-item-link', |
|
| 583 | - 'geodir_sub_menu_a_class_filter' => 'menu-item-link one-page-nav-item', |
|
| 584 | - 'geodir_location_switcher_menu_li_class_filter' => 'menu-item menu-item-type-social menu-item-type-social gd-location-switcher menu-item-has-children no-mega-menu', |
|
| 585 | - 'geodir_location_switcher_menu_a_class_filter' => 'menu-item-link', |
|
| 586 | - 'geodir_location_switcher_menu_sub_ul_class_filter' => '', |
|
| 587 | - 'geodir_location_switcher_menu_sub_li_class_filter' => '', |
|
| 588 | - 'geodir_theme_compat_css' => stripslashes('.geodir-widget li,.geodir_category_list_view li{margin:0}#theme-page h3.geodir-entry-title{font-size:14px}#menu-item-gd-location-switcher dd{line-height:44px}#menu-item-gd-location-switcher .geodir_location_sugestion{line-height:20px}.geodir_loginbox{overflow:visible}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'),
|
|
| 589 | - 'geodir_theme_compat_js' => '', |
|
| 590 | - 'geodir_theme_compat_default_options' => '', |
|
| 591 | - 'geodir_theme_compat_code' => 'Jupiter' |
|
| 592 | - ); |
|
| 548 | + $theme_compat['Jupiter'] = array( |
|
| 549 | + 'geodir_wrapper_open_id' => '', |
|
| 550 | + 'geodir_wrapper_open_class' => '', |
|
| 551 | + 'geodir_wrapper_open_replace' => '<div id="theme-page"><div class="mk-main-wrapper-holder"><div class="theme-page-wrapper mk-main-wrapper mk-grid vc_row-fluid">', |
|
| 552 | + 'geodir_wrapper_close_replace' => '</div></div></div>', |
|
| 553 | + 'geodir_wrapper_content_open_id' => '', |
|
| 554 | + 'geodir_wrapper_content_open_class' => '', |
|
| 555 | + 'geodir_wrapper_content_open_replace' => '', |
|
| 556 | + 'geodir_wrapper_content_close_replace' => '', |
|
| 557 | + 'geodir_article_open_id' => '', |
|
| 558 | + 'geodir_article_open_class' => '', |
|
| 559 | + 'geodir_article_open_replace' => '', |
|
| 560 | + 'geodir_article_close_replace' => '', |
|
| 561 | + 'geodir_sidebar_right_open_id' => 'mk-sidebar', |
|
| 562 | + 'geodir_sidebar_right_open_class' => 'mk-builtin geodir-sidebar-right geodir-listings-sidebar-right', |
|
| 563 | + 'geodir_sidebar_right_open_replace' => '', |
|
| 564 | + 'geodir_sidebar_right_close_replace' => '', |
|
| 565 | + 'geodir_sidebar_left_open_id' => 'mk-sidebar', |
|
| 566 | + 'geodir_sidebar_left_open_class' => 'mk-builtin geodir-sidebar-right geodir-listings-sidebar-right', |
|
| 567 | + 'geodir_sidebar_left_open_replace' => '', |
|
| 568 | + 'geodir_sidebar_left_close_replace' => '', |
|
| 569 | + 'geodir_main_content_open_id' => '', |
|
| 570 | + 'geodir_main_content_open_class' => '', |
|
| 571 | + 'geodir_main_content_open_replace' => '', |
|
| 572 | + 'geodir_main_content_close_replace' => '', |
|
| 573 | + 'geodir_top_content_add' => '', |
|
| 574 | + 'geodir_before_main_content_add' => '', |
|
| 575 | + 'geodir_before_widget_filter' => '', |
|
| 576 | + 'geodir_after_widget_filter' => '', |
|
| 577 | + 'geodir_before_title_filter' => '<h3 class="widgettitle geodir-widget-title">', |
|
| 578 | + 'geodir_after_title_filter' => '', |
|
| 579 | + 'geodir_menu_li_class_filter' => 'menu-item menu-item-has-children no-mega-menu', |
|
| 580 | + 'geodir_sub_menu_ul_class_filter' => '', |
|
| 581 | + 'geodir_sub_menu_li_class_filter' => '', |
|
| 582 | + 'geodir_menu_a_class_filter' => 'menu-item-link', |
|
| 583 | + 'geodir_sub_menu_a_class_filter' => 'menu-item-link one-page-nav-item', |
|
| 584 | + 'geodir_location_switcher_menu_li_class_filter' => 'menu-item menu-item-type-social menu-item-type-social gd-location-switcher menu-item-has-children no-mega-menu', |
|
| 585 | + 'geodir_location_switcher_menu_a_class_filter' => 'menu-item-link', |
|
| 586 | + 'geodir_location_switcher_menu_sub_ul_class_filter' => '', |
|
| 587 | + 'geodir_location_switcher_menu_sub_li_class_filter' => '', |
|
| 588 | + 'geodir_theme_compat_css' => stripslashes('.geodir-widget li,.geodir_category_list_view li{margin:0}#theme-page h3.geodir-entry-title{font-size:14px}#menu-item-gd-location-switcher dd{line-height:44px}#menu-item-gd-location-switcher .geodir_location_sugestion{line-height:20px}.geodir_loginbox{overflow:visible}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'),
|
|
| 589 | + 'geodir_theme_compat_js' => '', |
|
| 590 | + 'geodir_theme_compat_default_options' => '', |
|
| 591 | + 'geodir_theme_compat_code' => 'Jupiter' |
|
| 592 | + ); |
|
| 593 | 593 | |
| 594 | 594 | // Multi News |
| 595 | - $theme_compat['Multi_News'] = array( |
|
| 596 | - 'geodir_wrapper_open_id' => '', |
|
| 597 | - 'geodir_wrapper_open_class' => 'main-container clearfix', |
|
| 598 | - 'geodir_wrapper_open_replace' => '', |
|
| 599 | - 'geodir_wrapper_close_replace' => '', |
|
| 600 | - 'geodir_wrapper_content_open_id' => '', |
|
| 601 | - 'geodir_wrapper_content_open_class' => '', |
|
| 602 | - 'geodir_wrapper_content_open_replace' => '<div class="main-left" ><div class="main-content "><div class="site-content page-wrap">', |
|
| 603 | - 'geodir_wrapper_content_close_replace' => '</div></div></div>', |
|
| 604 | - 'geodir_article_open_id' => '', |
|
| 605 | - 'geodir_article_open_class' => '', |
|
| 606 | - 'geodir_article_open_replace' => '', |
|
| 607 | - 'geodir_article_close_replace' => '', |
|
| 608 | - 'geodir_sidebar_right_open_id' => '', |
|
| 609 | - 'geodir_sidebar_right_open_class' => '', |
|
| 610 | - 'geodir_sidebar_right_open_replace' => '<aside class="sidebar" role="complementary" itemscope itemtype="[itemtype]" >', |
|
| 611 | - 'geodir_sidebar_right_close_replace' => '', |
|
| 612 | - 'geodir_sidebar_left_open_id' => '', |
|
| 613 | - 'geodir_sidebar_left_open_class' => '', |
|
| 614 | - 'geodir_sidebar_left_open_replace' => '<aside class="secondary-sidebar" role="complementary" itemscope itemtype="[itemtype]" >', |
|
| 615 | - 'geodir_sidebar_left_close_replace' => '', |
|
| 616 | - 'geodir_main_content_open_id' => '', |
|
| 617 | - 'geodir_main_content_open_class' => '', |
|
| 618 | - 'geodir_main_content_open_replace' => '<div class="site-content page-wrap">', |
|
| 619 | - 'geodir_main_content_close_replace' => '</div>', |
|
| 620 | - 'geodir_top_content_add' => '', |
|
| 621 | - 'geodir_before_main_content_add' => '', |
|
| 622 | - 'geodir_full_page_class_filter' => 'section full-width-section', |
|
| 623 | - 'geodir_before_widget_filter' => '', |
|
| 624 | - 'geodir_after_widget_filter' => '', |
|
| 625 | - 'geodir_before_title_filter' => '<div class="widget-title"><h2>', |
|
| 626 | - 'geodir_after_title_filter' => '</h2></div>', |
|
| 627 | - 'geodir_menu_li_class_filter' => '', |
|
| 628 | - 'geodir_sub_menu_ul_class_filter' => '', |
|
| 629 | - 'geodir_sub_menu_li_class_filter' => '', |
|
| 630 | - 'geodir_menu_a_class_filter' => '', |
|
| 631 | - 'geodir_sub_menu_a_class_filter' => '', |
|
| 632 | - 'geodir_location_switcher_menu_li_class_filter' => '', |
|
| 633 | - 'geodir_location_switcher_menu_a_class_filter' => '', |
|
| 634 | - 'geodir_location_switcher_menu_sub_ul_class_filter' => '', |
|
| 635 | - 'geodir_location_switcher_menu_sub_li_class_filter' => '', |
|
| 636 | - 'geodir_theme_compat_css' => stripslashes('.full-width-section .geodir-search{margin:0;width:100%}.geodir_full_page .geodir-search{margin:0 auto;float:none}.geodir-search input[type=button],.geodir-search input[type=submit]{width:13%}.geodir-search input[type=text]{border:1px solid #ddd;border-radius:0;padding:0 8px}.geodir-category-list-in,.geodir-loc-bar-in{background:#f2f2f2;border-color:#dbdbdb}.geodir-category-list-in{margin-top:0}.geodir-cat-list .widget-title h2{margin:-13px -13px 13px}.widget .geodir-cat-list ul li.geodir-pcat-show a:before{display:none!important}.widget .geodir-cat-list ul li.geodir-pcat-show i{margin-right:5px}.container .geodir-search select{margin:0 3% 0 0;padding:8px 10px;width:13%}#geodir_carousel,#geodir_slider{border-radius:0;-webkit-border-radius:0;-moz-border-radius:0;margin-bottom:20px!important;border:1px solid #e1e1e1;box-shadow:none}#geodir_carousel{padding:10px}.geodir-tabs-content ol.commentlist{margin:40px 0;padding:0}li#post_mapTab{min-height:400px}#reviewsTab ol.commentlist li{border-bottom:none}#reviewsTab ol.commentlist li article.comment{border-bottom:1px solid #e1e1e1;padding-bottom:10px}.comment-content .rating{display:none}.comment-respond .gd_rating{margin-bottom:20px}div.geodir-rating{width:85px!important}.comment-respond .comment-notes{margin-bottom:10px}.average-review span,.comment-form label,.dtreviewed,.geodir-details-sidebar-user-links a,.geodir-viewall,.geodir_more_info span,.reviewer,dl.geodir-tab-head dd a{font-family:"Archivo Narrow",sans-serif}section.comment-content{margin:0 0 0 12%}#reviewsTab .comments-area .comment-content{width:auto}section.comment-content .description,section.comment-content p{margin:15px 0}dl.geodir-tab-head dd a{background:#f3f3f3;margin-top:-1px;font-size:14px;padding:0 15px}dl.geodir-tab-head dd.geodir-tab-active a{padding-bottom:1px}.geodir-widget .geodir_list_heading,.geodir-widget h3.widget-title{padding:0 15px;background:#e9e9e9;border:1px solid #dbdbdb;height:38px;line-height:38px;color:#2d2d2d}.geodir-widget .geodir_list_heading h3{background:0 0;border:none}.geodir-widget .geodir_list_heading{margin:-13px -14px 13px}.geodir-map-listing-page{border-width:1px 0 0;border-style:solid;border-color:#dbdbdb}.geodir-sidebar-wrap .geodir-company_info{margin:15px}.geodir-details-sidebar-social-sharing iframe{float:left}.geodir-details-sidebar-rating{overflow:hidden}.geodir-details-sidebar-rating .gd_rating_show,.geodir-details-sidebar-rating .geodir-rating{float:left;margin-right:15px}.geodir-details-sidebar-rating span.item{float:left;margin-top:5px}.geodir-details-sidebar-rating .average-review{top:-4px;position:relative}.geodir-details-sidebar-rating span.item img{margin-top:5px}.geodir_full_page{background:#fff;border:1px solid #e1e1e1;-webkit-box-shadow:0 1px 0 #e5e5e5;box-shadow:0 1px 0 #e5e5e5;padding:15px;margin-bottom:20px;clear:both}.geodir_map_container .main_list img{margin:0 5px}.geodir_category_list_view li.geodir-gridview .geodir-post-img .geodir_thumbnail{margin-bottom:10px}.geodir-addinfo .geodir-pinpoint,.geodir-addinfo a i{margin-right:5px}.geodir_category_list_view li.geodir-gridview h3{font-size:18px;margin-bottom:10px}#related_listingTab ul.geodir_category_list_view{padding:0!important}#reviewsTab #comments .gd_rating{margin-top:5px}.widget .geodir_category_list_view li .geodir-entry-content,.widget .geodir_category_list_view li a:before{display:none!important}.geodir_category_list_view li .geodir-entry-title{margin-bottom:10px}.widget ul.geodir_category_list_view{padding:15px}.sidebar .widget .geodir_category_list_view li{width:calc(100% - 25px)}.widget .geodir-loginbox-list li{overflow:visible!important}.widget ul.chosen-results{margin:0!important}.main_list_selecter{margin-right:5px}.geodir-viewall{float:right;width:auto!important}.widget-title h2{padding:0 15px;background:#e9e9e9;border:1px solid #dbdbdb;height:38px;line-height:38px}.widget:first-child .geodir_list_heading .widget-title{margin-top:0}.geodir_list_heading .widget-title{float:left;width:80%;margin-top:0}.geodir_list_heading .widget-title h2{padding:0 px;background:0 0;border:none;height:auto;line-height:auto}.chosen-default:before{content:none;display:none;position:absolute;margin-left:-1000000px;float:left}#geodir-wrapper .entry-crumbs{margin-bottom:20px}.geodir-search .mom-select{float:left;width:150px;margin:5px;border:1px solid #ddd;height:40px}.iprelative .gm-style .gm-style-iw{width:100%!important}'),
|
|
| 637 | - 'geodir_theme_compat_js' => 'jQuery(document).ready(function(e){e(".geodir_full_page").length&&""===e.trim(e(".geodir_full_page").html())&&e(".geodir_full_page").css({display:"none"})});',
|
|
| 638 | - 'geodir_theme_compat_default_options' => '', |
|
| 639 | - 'geodir_theme_compat_code' => 'Multi_News' |
|
| 640 | - ); |
|
| 641 | - |
|
| 642 | - update_option('gd_theme_compats', $theme_compat);
|
|
| 643 | - |
|
| 644 | - gd_set_theme_compat();// set the compat pack if avail |
|
| 595 | + $theme_compat['Multi_News'] = array( |
|
| 596 | + 'geodir_wrapper_open_id' => '', |
|
| 597 | + 'geodir_wrapper_open_class' => 'main-container clearfix', |
|
| 598 | + 'geodir_wrapper_open_replace' => '', |
|
| 599 | + 'geodir_wrapper_close_replace' => '', |
|
| 600 | + 'geodir_wrapper_content_open_id' => '', |
|
| 601 | + 'geodir_wrapper_content_open_class' => '', |
|
| 602 | + 'geodir_wrapper_content_open_replace' => '<div class="main-left" ><div class="main-content "><div class="site-content page-wrap">', |
|
| 603 | + 'geodir_wrapper_content_close_replace' => '</div></div></div>', |
|
| 604 | + 'geodir_article_open_id' => '', |
|
| 605 | + 'geodir_article_open_class' => '', |
|
| 606 | + 'geodir_article_open_replace' => '', |
|
| 607 | + 'geodir_article_close_replace' => '', |
|
| 608 | + 'geodir_sidebar_right_open_id' => '', |
|
| 609 | + 'geodir_sidebar_right_open_class' => '', |
|
| 610 | + 'geodir_sidebar_right_open_replace' => '<aside class="sidebar" role="complementary" itemscope itemtype="[itemtype]" >', |
|
| 611 | + 'geodir_sidebar_right_close_replace' => '', |
|
| 612 | + 'geodir_sidebar_left_open_id' => '', |
|
| 613 | + 'geodir_sidebar_left_open_class' => '', |
|
| 614 | + 'geodir_sidebar_left_open_replace' => '<aside class="secondary-sidebar" role="complementary" itemscope itemtype="[itemtype]" >', |
|
| 615 | + 'geodir_sidebar_left_close_replace' => '', |
|
| 616 | + 'geodir_main_content_open_id' => '', |
|
| 617 | + 'geodir_main_content_open_class' => '', |
|
| 618 | + 'geodir_main_content_open_replace' => '<div class="site-content page-wrap">', |
|
| 619 | + 'geodir_main_content_close_replace' => '</div>', |
|
| 620 | + 'geodir_top_content_add' => '', |
|
| 621 | + 'geodir_before_main_content_add' => '', |
|
| 622 | + 'geodir_full_page_class_filter' => 'section full-width-section', |
|
| 623 | + 'geodir_before_widget_filter' => '', |
|
| 624 | + 'geodir_after_widget_filter' => '', |
|
| 625 | + 'geodir_before_title_filter' => '<div class="widget-title"><h2>', |
|
| 626 | + 'geodir_after_title_filter' => '</h2></div>', |
|
| 627 | + 'geodir_menu_li_class_filter' => '', |
|
| 628 | + 'geodir_sub_menu_ul_class_filter' => '', |
|
| 629 | + 'geodir_sub_menu_li_class_filter' => '', |
|
| 630 | + 'geodir_menu_a_class_filter' => '', |
|
| 631 | + 'geodir_sub_menu_a_class_filter' => '', |
|
| 632 | + 'geodir_location_switcher_menu_li_class_filter' => '', |
|
| 633 | + 'geodir_location_switcher_menu_a_class_filter' => '', |
|
| 634 | + 'geodir_location_switcher_menu_sub_ul_class_filter' => '', |
|
| 635 | + 'geodir_location_switcher_menu_sub_li_class_filter' => '', |
|
| 636 | + 'geodir_theme_compat_css' => stripslashes('.full-width-section .geodir-search{margin:0;width:100%}.geodir_full_page .geodir-search{margin:0 auto;float:none}.geodir-search input[type=button],.geodir-search input[type=submit]{width:13%}.geodir-search input[type=text]{border:1px solid #ddd;border-radius:0;padding:0 8px}.geodir-category-list-in,.geodir-loc-bar-in{background:#f2f2f2;border-color:#dbdbdb}.geodir-category-list-in{margin-top:0}.geodir-cat-list .widget-title h2{margin:-13px -13px 13px}.widget .geodir-cat-list ul li.geodir-pcat-show a:before{display:none!important}.widget .geodir-cat-list ul li.geodir-pcat-show i{margin-right:5px}.container .geodir-search select{margin:0 3% 0 0;padding:8px 10px;width:13%}#geodir_carousel,#geodir_slider{border-radius:0;-webkit-border-radius:0;-moz-border-radius:0;margin-bottom:20px!important;border:1px solid #e1e1e1;box-shadow:none}#geodir_carousel{padding:10px}.geodir-tabs-content ol.commentlist{margin:40px 0;padding:0}li#post_mapTab{min-height:400px}#reviewsTab ol.commentlist li{border-bottom:none}#reviewsTab ol.commentlist li article.comment{border-bottom:1px solid #e1e1e1;padding-bottom:10px}.comment-content .rating{display:none}.comment-respond .gd_rating{margin-bottom:20px}div.geodir-rating{width:85px!important}.comment-respond .comment-notes{margin-bottom:10px}.average-review span,.comment-form label,.dtreviewed,.geodir-details-sidebar-user-links a,.geodir-viewall,.geodir_more_info span,.reviewer,dl.geodir-tab-head dd a{font-family:"Archivo Narrow",sans-serif}section.comment-content{margin:0 0 0 12%}#reviewsTab .comments-area .comment-content{width:auto}section.comment-content .description,section.comment-content p{margin:15px 0}dl.geodir-tab-head dd a{background:#f3f3f3;margin-top:-1px;font-size:14px;padding:0 15px}dl.geodir-tab-head dd.geodir-tab-active a{padding-bottom:1px}.geodir-widget .geodir_list_heading,.geodir-widget h3.widget-title{padding:0 15px;background:#e9e9e9;border:1px solid #dbdbdb;height:38px;line-height:38px;color:#2d2d2d}.geodir-widget .geodir_list_heading h3{background:0 0;border:none}.geodir-widget .geodir_list_heading{margin:-13px -14px 13px}.geodir-map-listing-page{border-width:1px 0 0;border-style:solid;border-color:#dbdbdb}.geodir-sidebar-wrap .geodir-company_info{margin:15px}.geodir-details-sidebar-social-sharing iframe{float:left}.geodir-details-sidebar-rating{overflow:hidden}.geodir-details-sidebar-rating .gd_rating_show,.geodir-details-sidebar-rating .geodir-rating{float:left;margin-right:15px}.geodir-details-sidebar-rating span.item{float:left;margin-top:5px}.geodir-details-sidebar-rating .average-review{top:-4px;position:relative}.geodir-details-sidebar-rating span.item img{margin-top:5px}.geodir_full_page{background:#fff;border:1px solid #e1e1e1;-webkit-box-shadow:0 1px 0 #e5e5e5;box-shadow:0 1px 0 #e5e5e5;padding:15px;margin-bottom:20px;clear:both}.geodir_map_container .main_list img{margin:0 5px}.geodir_category_list_view li.geodir-gridview .geodir-post-img .geodir_thumbnail{margin-bottom:10px}.geodir-addinfo .geodir-pinpoint,.geodir-addinfo a i{margin-right:5px}.geodir_category_list_view li.geodir-gridview h3{font-size:18px;margin-bottom:10px}#related_listingTab ul.geodir_category_list_view{padding:0!important}#reviewsTab #comments .gd_rating{margin-top:5px}.widget .geodir_category_list_view li .geodir-entry-content,.widget .geodir_category_list_view li a:before{display:none!important}.geodir_category_list_view li .geodir-entry-title{margin-bottom:10px}.widget ul.geodir_category_list_view{padding:15px}.sidebar .widget .geodir_category_list_view li{width:calc(100% - 25px)}.widget .geodir-loginbox-list li{overflow:visible!important}.widget ul.chosen-results{margin:0!important}.main_list_selecter{margin-right:5px}.geodir-viewall{float:right;width:auto!important}.widget-title h2{padding:0 15px;background:#e9e9e9;border:1px solid #dbdbdb;height:38px;line-height:38px}.widget:first-child .geodir_list_heading .widget-title{margin-top:0}.geodir_list_heading .widget-title{float:left;width:80%;margin-top:0}.geodir_list_heading .widget-title h2{padding:0 px;background:0 0;border:none;height:auto;line-height:auto}.chosen-default:before{content:none;display:none;position:absolute;margin-left:-1000000px;float:left}#geodir-wrapper .entry-crumbs{margin-bottom:20px}.geodir-search .mom-select{float:left;width:150px;margin:5px;border:1px solid #ddd;height:40px}.iprelative .gm-style .gm-style-iw{width:100%!important}'),
|
|
| 637 | + 'geodir_theme_compat_js' => 'jQuery(document).ready(function(e){e(".geodir_full_page").length&&""===e.trim(e(".geodir_full_page").html())&&e(".geodir_full_page").css({display:"none"})});',
|
|
| 638 | + 'geodir_theme_compat_default_options' => '', |
|
| 639 | + 'geodir_theme_compat_code' => 'Multi_News' |
|
| 640 | + ); |
|
| 641 | + |
|
| 642 | + update_option('gd_theme_compats', $theme_compat);
|
|
| 643 | + |
|
| 644 | + gd_set_theme_compat();// set the compat pack if avail |
|
| 645 | 645 | } |
| 646 | 646 | |
| 647 | 647 | |
@@ -653,61 +653,61 @@ discard block |
||
| 653 | 653 | * @global object $wpdb WordPress Database object. |
| 654 | 654 | */ |
| 655 | 655 | function gd_convert_virtual_pages(){
|
| 656 | - global $wpdb; |
|
| 657 | - |
|
| 658 | - // Update the add listing page settings |
|
| 659 | - $add_listing_page = $wpdb->get_var( |
|
| 660 | - $wpdb->prepare( |
|
| 661 | - "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
| 662 | - array('add-listing')
|
|
| 663 | - ) |
|
| 664 | - ); |
|
| 665 | - |
|
| 666 | - if($add_listing_page){
|
|
| 667 | - wp_update_post( array('ID' => $add_listing_page, 'post_status' => 'publish') );
|
|
| 668 | - update_option( 'geodir_add_listing_page', $add_listing_page); |
|
| 669 | - } |
|
| 670 | - |
|
| 671 | - // Update the listing preview page settings |
|
| 672 | - $listing_preview_page = $wpdb->get_var( |
|
| 673 | - $wpdb->prepare( |
|
| 674 | - "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
| 675 | - array('listing-preview')
|
|
| 676 | - ) |
|
| 677 | - ); |
|
| 678 | - |
|
| 679 | - if($listing_preview_page){
|
|
| 680 | - wp_update_post( array('ID' => $listing_preview_page, 'post_status' => 'publish') );
|
|
| 681 | - update_option( 'geodir_preview_page', $listing_preview_page); |
|
| 682 | - } |
|
| 683 | - |
|
| 684 | - // Update the listing success page settings |
|
| 685 | - $listing_success_page = $wpdb->get_var( |
|
| 686 | - $wpdb->prepare( |
|
| 687 | - "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
| 688 | - array('listing-success')
|
|
| 689 | - ) |
|
| 690 | - ); |
|
| 691 | - |
|
| 692 | - if($listing_success_page){
|
|
| 693 | - wp_update_post( array('ID' => $listing_success_page, 'post_status' => 'publish') );
|
|
| 694 | - update_option( 'geodir_success_page', $listing_success_page); |
|
| 695 | - } |
|
| 696 | - |
|
| 697 | - // Update the listing success page settings |
|
| 698 | - $location_page = $wpdb->get_var( |
|
| 699 | - $wpdb->prepare( |
|
| 700 | - "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
| 701 | - array('location')
|
|
| 702 | - ) |
|
| 703 | - ); |
|
| 704 | - |
|
| 705 | - if($location_page){
|
|
| 706 | - $location_slug = get_option('geodir_location_prefix');
|
|
| 707 | - if(!$location_slug ){$location_slug = 'location';}
|
|
| 708 | - wp_update_post( array('ID' => $location_page, 'post_status' => 'publish','post_name' => $location_slug) );
|
|
| 709 | - update_option( 'geodir_location_page', $location_page); |
|
| 710 | - } |
|
| 656 | + global $wpdb; |
|
| 657 | + |
|
| 658 | + // Update the add listing page settings |
|
| 659 | + $add_listing_page = $wpdb->get_var( |
|
| 660 | + $wpdb->prepare( |
|
| 661 | + "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
| 662 | + array('add-listing')
|
|
| 663 | + ) |
|
| 664 | + ); |
|
| 665 | + |
|
| 666 | + if($add_listing_page){
|
|
| 667 | + wp_update_post( array('ID' => $add_listing_page, 'post_status' => 'publish') );
|
|
| 668 | + update_option( 'geodir_add_listing_page', $add_listing_page); |
|
| 669 | + } |
|
| 670 | + |
|
| 671 | + // Update the listing preview page settings |
|
| 672 | + $listing_preview_page = $wpdb->get_var( |
|
| 673 | + $wpdb->prepare( |
|
| 674 | + "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
| 675 | + array('listing-preview')
|
|
| 676 | + ) |
|
| 677 | + ); |
|
| 678 | + |
|
| 679 | + if($listing_preview_page){
|
|
| 680 | + wp_update_post( array('ID' => $listing_preview_page, 'post_status' => 'publish') );
|
|
| 681 | + update_option( 'geodir_preview_page', $listing_preview_page); |
|
| 682 | + } |
|
| 683 | + |
|
| 684 | + // Update the listing success page settings |
|
| 685 | + $listing_success_page = $wpdb->get_var( |
|
| 686 | + $wpdb->prepare( |
|
| 687 | + "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
| 688 | + array('listing-success')
|
|
| 689 | + ) |
|
| 690 | + ); |
|
| 691 | + |
|
| 692 | + if($listing_success_page){
|
|
| 693 | + wp_update_post( array('ID' => $listing_success_page, 'post_status' => 'publish') );
|
|
| 694 | + update_option( 'geodir_success_page', $listing_success_page); |
|
| 695 | + } |
|
| 696 | + |
|
| 697 | + // Update the listing success page settings |
|
| 698 | + $location_page = $wpdb->get_var( |
|
| 699 | + $wpdb->prepare( |
|
| 700 | + "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
| 701 | + array('location')
|
|
| 702 | + ) |
|
| 703 | + ); |
|
| 704 | + |
|
| 705 | + if($location_page){
|
|
| 706 | + $location_slug = get_option('geodir_location_prefix');
|
|
| 707 | + if(!$location_slug ){$location_slug = 'location';}
|
|
| 708 | + wp_update_post( array('ID' => $location_page, 'post_status' => 'publish','post_name' => $location_slug) );
|
|
| 709 | + update_option( 'geodir_location_page', $location_page); |
|
| 710 | + } |
|
| 711 | 711 | |
| 712 | 712 | } |
| 713 | 713 | |
@@ -721,31 +721,31 @@ discard block |
||
| 721 | 721 | function gd_fix_cpt_rewrite_slug() |
| 722 | 722 | {
|
| 723 | 723 | |
| 724 | - $alt_post_types = array(); |
|
| 725 | - $post_types = get_option('geodir_post_types');
|
|
| 724 | + $alt_post_types = array(); |
|
| 725 | + $post_types = get_option('geodir_post_types');
|
|
| 726 | 726 | |
| 727 | 727 | |
| 728 | - if (is_array($post_types)){
|
|
| 728 | + if (is_array($post_types)){
|
|
| 729 | 729 | |
| 730 | - foreach ($post_types as $post_type => $args) {
|
|
| 730 | + foreach ($post_types as $post_type => $args) {
|
|
| 731 | 731 | |
| 732 | 732 | |
| 733 | - if(isset($args['rewrite']['slug'])){
|
|
| 734 | - $args['rewrite']['slug'] = str_replace("/%gd_taxonomy%","",$args['rewrite']['slug']);
|
|
| 735 | - } |
|
| 733 | + if(isset($args['rewrite']['slug'])){
|
|
| 734 | + $args['rewrite']['slug'] = str_replace("/%gd_taxonomy%","",$args['rewrite']['slug']);
|
|
| 735 | + } |
|
| 736 | 736 | |
| 737 | - $alt_post_types[$post_type] = $args; |
|
| 737 | + $alt_post_types[$post_type] = $args; |
|
| 738 | 738 | |
| 739 | - } |
|
| 740 | - } |
|
| 739 | + } |
|
| 740 | + } |
|
| 741 | 741 | |
| 742 | - if(!empty($alt_post_types)) {
|
|
| 743 | - update_option('geodir_post_types',$alt_post_types);
|
|
| 744 | - } |
|
| 742 | + if(!empty($alt_post_types)) {
|
|
| 743 | + update_option('geodir_post_types',$alt_post_types);
|
|
| 744 | + } |
|
| 745 | 745 | |
| 746 | 746 | |
| 747 | - // flush the rewrite rules |
|
| 748 | - flush_rewrite_rules(); |
|
| 747 | + // flush the rewrite rules |
|
| 748 | + flush_rewrite_rules(); |
|
| 749 | 749 | } |
| 750 | 750 | |
| 751 | 751 | |
@@ -758,18 +758,18 @@ discard block |
||
| 758 | 758 | */ |
| 759 | 759 | function gd_fix_address_detail_table_limit() |
| 760 | 760 | {
|
| 761 | - global $wpdb; |
|
| 762 | - |
|
| 763 | - $all_postypes = geodir_get_posttypes(); |
|
| 764 | - |
|
| 765 | - if (!empty($all_postypes)) {
|
|
| 766 | - foreach ($all_postypes as $key) {
|
|
| 767 | - // update each GD CTP |
|
| 768 | - try {
|
|
| 769 | - $wpdb->query("ALTER TABLE " . $wpdb->prefix . "geodir_" . $key . "_detail MODIFY post_city VARCHAR( 50 ) NULL,MODIFY post_region VARCHAR( 50 ) NULL,MODIFY post_country VARCHAR( 50 ) NULL");
|
|
| 770 | - } catch(Exception $e) {
|
|
| 771 | - error_log( 'Error: ' . $e->getMessage() ); |
|
| 772 | - } |
|
| 773 | - } |
|
| 774 | - } |
|
| 761 | + global $wpdb; |
|
| 762 | + |
|
| 763 | + $all_postypes = geodir_get_posttypes(); |
|
| 764 | + |
|
| 765 | + if (!empty($all_postypes)) {
|
|
| 766 | + foreach ($all_postypes as $key) {
|
|
| 767 | + // update each GD CTP |
|
| 768 | + try {
|
|
| 769 | + $wpdb->query("ALTER TABLE " . $wpdb->prefix . "geodir_" . $key . "_detail MODIFY post_city VARCHAR( 50 ) NULL,MODIFY post_region VARCHAR( 50 ) NULL,MODIFY post_country VARCHAR( 50 ) NULL");
|
|
| 770 | + } catch(Exception $e) {
|
|
| 771 | + error_log( 'Error: ' . $e->getMessage() ); |
|
| 772 | + } |
|
| 773 | + } |
|
| 774 | + } |
|
| 775 | 775 | } |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | |
| 10 | 10 | global $wpdb; |
| 11 | 11 | |
| 12 | -if (get_option('geodirectory' . '_db_version') != GEODIRECTORY_VERSION) {
|
|
| 12 | +if (get_option('geodirectory'.'_db_version') != GEODIRECTORY_VERSION) {
|
|
| 13 | 13 | /** |
| 14 | 14 | * Include custom database table related functions. |
| 15 | 15 | * |
@@ -47,9 +47,9 @@ discard block |
||
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | |
| 50 | - add_action('init', 'gd_fix_cpt_rewrite_slug', 11);// this needs to be kept for a few versions
|
|
| 50 | + add_action('init', 'gd_fix_cpt_rewrite_slug', 11); // this needs to be kept for a few versions
|
|
| 51 | 51 | |
| 52 | - update_option('geodirectory' . '_db_version', GEODIRECTORY_VERSION);
|
|
| 52 | + update_option('geodirectory'.'_db_version', GEODIRECTORY_VERSION);
|
|
| 53 | 53 | |
| 54 | 54 | } |
| 55 | 55 | |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | * @since 1.0.0 |
| 85 | 85 | * @package GeoDirectory |
| 86 | 86 | */ |
| 87 | -function geodir_upgrade_146(){
|
|
| 87 | +function geodir_upgrade_146() {
|
|
| 88 | 88 | gd_convert_virtual_pages(); |
| 89 | 89 | } |
| 90 | 90 | |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | * @since 1.5.0 |
| 95 | 95 | * @package GeoDirectory |
| 96 | 96 | */ |
| 97 | -function geodir_upgrade_150(){
|
|
| 97 | +function geodir_upgrade_150() {
|
|
| 98 | 98 | gd_fix_cpt_rewrite_slug(); |
| 99 | 99 | } |
| 100 | 100 | |
@@ -106,12 +106,12 @@ discard block |
||
| 106 | 106 | * @since 1.4.8 |
| 107 | 107 | * @package GeoDirectory |
| 108 | 108 | */ |
| 109 | -function geodir_upgrade_148(){
|
|
| 109 | +function geodir_upgrade_148() {
|
|
| 110 | 110 | /* |
| 111 | 111 | * Blank the users google password if present as we now use oAuth 2.0 |
| 112 | 112 | */ |
| 113 | - update_option('geodir_ga_pass','');
|
|
| 114 | - update_option('geodir_ga_user','');
|
|
| 113 | + update_option('geodir_ga_pass', '');
|
|
| 114 | + update_option('geodir_ga_user', '');
|
|
| 115 | 115 | |
| 116 | 116 | } |
| 117 | 117 | |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | * @since 1.5.3 |
| 123 | 123 | * @package GeoDirectory |
| 124 | 124 | */ |
| 125 | -function geodir_upgrade_153(){
|
|
| 125 | +function geodir_upgrade_153() {
|
|
| 126 | 126 | geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), '');
|
| 127 | 127 | geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), '');
|
| 128 | 128 | } |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | * @since 1.5.3 |
| 134 | 134 | * @package GeoDirectory |
| 135 | 135 | */ |
| 136 | -function geodir_upgrade_154(){
|
|
| 136 | +function geodir_upgrade_154() {
|
|
| 137 | 137 | geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), '');
|
| 138 | 138 | } |
| 139 | 139 | |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | * @since 1.5.2 |
| 144 | 144 | * @package GeoDirectory |
| 145 | 145 | */ |
| 146 | -function geodir_upgrade_152(){
|
|
| 146 | +function geodir_upgrade_152() {
|
|
| 147 | 147 | gd_fix_address_detail_table_limit(); |
| 148 | 148 | } |
| 149 | 149 | |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | function geodir_fix_review_date() |
| 178 | 178 | {
|
| 179 | 179 | global $wpdb; |
| 180 | - $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.post_date = c.comment_date WHERE gdr.post_date='0000-00-00 00:00:00'");
|
|
| 180 | + $wpdb->query("UPDATE ".GEODIR_REVIEW_TABLE." gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.post_date = c.comment_date WHERE gdr.post_date='0000-00-00 00:00:00'");
|
|
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | /** |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | function geodir_fix_review_post_status() |
| 191 | 191 | {
|
| 192 | 192 | global $wpdb; |
| 193 | - $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->posts p ON gdr.post_id=p.ID SET gdr.post_status = 1 WHERE gdr.post_status IS NULL AND p.post_status='publish'");
|
|
| 193 | + $wpdb->query("UPDATE ".GEODIR_REVIEW_TABLE." gdr JOIN $wpdb->posts p ON gdr.post_id=p.ID SET gdr.post_status = 1 WHERE gdr.post_status IS NULL AND p.post_status='publish'");
|
|
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | /** |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | function geodir_fix_review_content() |
| 205 | 205 | {
|
| 206 | 206 | global $wpdb; |
| 207 | - if ($wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.comment_content = c.comment_content WHERE gdr.comment_content IS NULL")) {
|
|
| 207 | + if ($wpdb->query("UPDATE ".GEODIR_REVIEW_TABLE." gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.comment_content = c.comment_content WHERE gdr.comment_content IS NULL")) {
|
|
| 208 | 208 | return true; |
| 209 | 209 | } else {
|
| 210 | 210 | return false; |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | foreach ($all_postypes as $key) {
|
| 230 | 230 | // update each GD CTP |
| 231 | 231 | |
| 232 | - $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN " . $wpdb->prefix . "geodir_" . $key . "_detail d ON gdr.post_id=d.post_id SET gdr.post_latitude = d.post_latitude, gdr.post_longitude = d.post_longitude, gdr.post_city = d.post_city, gdr.post_region=d.post_region, gdr.post_country=d.post_country WHERE gdr.post_latitude IS NULL OR gdr.post_city IS NULL");
|
|
| 232 | + $wpdb->query("UPDATE ".GEODIR_REVIEW_TABLE." gdr JOIN ".$wpdb->prefix."geodir_".$key."_detail d ON gdr.post_id=d.post_id SET gdr.post_latitude = d.post_latitude, gdr.post_longitude = d.post_longitude, gdr.post_city = d.post_city, gdr.post_region=d.post_region, gdr.post_country=d.post_country WHERE gdr.post_latitude IS NULL OR gdr.post_city IS NULL");
|
|
| 233 | 233 | |
| 234 | 234 | } |
| 235 | 235 | return true; |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | if (!empty($all_postypes)) {
|
| 254 | 254 | foreach ($all_postypes as $key) {
|
| 255 | 255 | // update each GD CTP |
| 256 | - $reviews = $wpdb->get_results("SELECT post_id FROM " . $wpdb->prefix . "geodir_" . $key . "_detail d");
|
|
| 256 | + $reviews = $wpdb->get_results("SELECT post_id FROM ".$wpdb->prefix."geodir_".$key."_detail d");
|
|
| 257 | 257 | |
| 258 | 258 | if (!empty($reviews)) {
|
| 259 | 259 | foreach ($reviews as $post_id) {
|
@@ -641,7 +641,7 @@ discard block |
||
| 641 | 641 | |
| 642 | 642 | update_option('gd_theme_compats', $theme_compat);
|
| 643 | 643 | |
| 644 | - gd_set_theme_compat();// set the compat pack if avail |
|
| 644 | + gd_set_theme_compat(); // set the compat pack if avail |
|
| 645 | 645 | } |
| 646 | 646 | |
| 647 | 647 | |
@@ -652,61 +652,61 @@ discard block |
||
| 652 | 652 | * @package GeoDirectory |
| 653 | 653 | * @global object $wpdb WordPress Database object. |
| 654 | 654 | */ |
| 655 | -function gd_convert_virtual_pages(){
|
|
| 655 | +function gd_convert_virtual_pages() {
|
|
| 656 | 656 | global $wpdb; |
| 657 | 657 | |
| 658 | 658 | // Update the add listing page settings |
| 659 | 659 | $add_listing_page = $wpdb->get_var( |
| 660 | 660 | $wpdb->prepare( |
| 661 | - "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
| 661 | + "SELECT ID FROM ".$wpdb->posts." WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
| 662 | 662 | array('add-listing')
|
| 663 | 663 | ) |
| 664 | 664 | ); |
| 665 | 665 | |
| 666 | - if($add_listing_page){
|
|
| 667 | - wp_update_post( array('ID' => $add_listing_page, 'post_status' => 'publish') );
|
|
| 668 | - update_option( 'geodir_add_listing_page', $add_listing_page); |
|
| 666 | + if ($add_listing_page) {
|
|
| 667 | + wp_update_post(array('ID' => $add_listing_page, 'post_status' => 'publish'));
|
|
| 668 | + update_option('geodir_add_listing_page', $add_listing_page);
|
|
| 669 | 669 | } |
| 670 | 670 | |
| 671 | 671 | // Update the listing preview page settings |
| 672 | 672 | $listing_preview_page = $wpdb->get_var( |
| 673 | 673 | $wpdb->prepare( |
| 674 | - "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
| 674 | + "SELECT ID FROM ".$wpdb->posts." WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
| 675 | 675 | array('listing-preview')
|
| 676 | 676 | ) |
| 677 | 677 | ); |
| 678 | 678 | |
| 679 | - if($listing_preview_page){
|
|
| 680 | - wp_update_post( array('ID' => $listing_preview_page, 'post_status' => 'publish') );
|
|
| 681 | - update_option( 'geodir_preview_page', $listing_preview_page); |
|
| 679 | + if ($listing_preview_page) {
|
|
| 680 | + wp_update_post(array('ID' => $listing_preview_page, 'post_status' => 'publish'));
|
|
| 681 | + update_option('geodir_preview_page', $listing_preview_page);
|
|
| 682 | 682 | } |
| 683 | 683 | |
| 684 | 684 | // Update the listing success page settings |
| 685 | 685 | $listing_success_page = $wpdb->get_var( |
| 686 | 686 | $wpdb->prepare( |
| 687 | - "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
| 687 | + "SELECT ID FROM ".$wpdb->posts." WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
| 688 | 688 | array('listing-success')
|
| 689 | 689 | ) |
| 690 | 690 | ); |
| 691 | 691 | |
| 692 | - if($listing_success_page){
|
|
| 693 | - wp_update_post( array('ID' => $listing_success_page, 'post_status' => 'publish') );
|
|
| 694 | - update_option( 'geodir_success_page', $listing_success_page); |
|
| 692 | + if ($listing_success_page) {
|
|
| 693 | + wp_update_post(array('ID' => $listing_success_page, 'post_status' => 'publish'));
|
|
| 694 | + update_option('geodir_success_page', $listing_success_page);
|
|
| 695 | 695 | } |
| 696 | 696 | |
| 697 | 697 | // Update the listing success page settings |
| 698 | 698 | $location_page = $wpdb->get_var( |
| 699 | 699 | $wpdb->prepare( |
| 700 | - "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
| 700 | + "SELECT ID FROM ".$wpdb->posts." WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
| 701 | 701 | array('location')
|
| 702 | 702 | ) |
| 703 | 703 | ); |
| 704 | 704 | |
| 705 | - if($location_page){
|
|
| 705 | + if ($location_page) {
|
|
| 706 | 706 | $location_slug = get_option('geodir_location_prefix');
|
| 707 | - if(!$location_slug ){$location_slug = 'location';}
|
|
| 708 | - wp_update_post( array('ID' => $location_page, 'post_status' => 'publish','post_name' => $location_slug) );
|
|
| 709 | - update_option( 'geodir_location_page', $location_page); |
|
| 707 | + if (!$location_slug) {$location_slug = 'location'; }
|
|
| 708 | + wp_update_post(array('ID' => $location_page, 'post_status' => 'publish', 'post_name' => $location_slug));
|
|
| 709 | + update_option('geodir_location_page', $location_page);
|
|
| 710 | 710 | } |
| 711 | 711 | |
| 712 | 712 | } |
@@ -725,13 +725,13 @@ discard block |
||
| 725 | 725 | $post_types = get_option('geodir_post_types');
|
| 726 | 726 | |
| 727 | 727 | |
| 728 | - if (is_array($post_types)){
|
|
| 728 | + if (is_array($post_types)) {
|
|
| 729 | 729 | |
| 730 | 730 | foreach ($post_types as $post_type => $args) {
|
| 731 | 731 | |
| 732 | 732 | |
| 733 | - if(isset($args['rewrite']['slug'])){
|
|
| 734 | - $args['rewrite']['slug'] = str_replace("/%gd_taxonomy%","",$args['rewrite']['slug']);
|
|
| 733 | + if (isset($args['rewrite']['slug'])) {
|
|
| 734 | + $args['rewrite']['slug'] = str_replace("/%gd_taxonomy%", "", $args['rewrite']['slug']);
|
|
| 735 | 735 | } |
| 736 | 736 | |
| 737 | 737 | $alt_post_types[$post_type] = $args; |
@@ -739,8 +739,8 @@ discard block |
||
| 739 | 739 | } |
| 740 | 740 | } |
| 741 | 741 | |
| 742 | - if(!empty($alt_post_types)) {
|
|
| 743 | - update_option('geodir_post_types',$alt_post_types);
|
|
| 742 | + if (!empty($alt_post_types)) {
|
|
| 743 | + update_option('geodir_post_types', $alt_post_types);
|
|
| 744 | 744 | } |
| 745 | 745 | |
| 746 | 746 | |
@@ -766,9 +766,9 @@ discard block |
||
| 766 | 766 | foreach ($all_postypes as $key) {
|
| 767 | 767 | // update each GD CTP |
| 768 | 768 | try {
|
| 769 | - $wpdb->query("ALTER TABLE " . $wpdb->prefix . "geodir_" . $key . "_detail MODIFY post_city VARCHAR( 50 ) NULL,MODIFY post_region VARCHAR( 50 ) NULL,MODIFY post_country VARCHAR( 50 ) NULL");
|
|
| 770 | - } catch(Exception $e) {
|
|
| 771 | - error_log( 'Error: ' . $e->getMessage() ); |
|
| 769 | + $wpdb->query("ALTER TABLE ".$wpdb->prefix."geodir_".$key."_detail MODIFY post_city VARCHAR( 50 ) NULL,MODIFY post_region VARCHAR( 50 ) NULL,MODIFY post_country VARCHAR( 50 ) NULL");
|
|
| 770 | + } catch (Exception $e) {
|
|
| 771 | + error_log('Error: '.$e->getMessage());
|
|
| 772 | 772 | } |
| 773 | 773 | } |
| 774 | 774 | } |