Passed
Push — master ( ff62a1...a83c7a )
by Stiofan
10:28
created
geodirectory_hooks_actions.php 2 patches
Indentation   +1493 added lines, -1493 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
  */
20 20
 function geodir_get_ajax_url()
21 21
 {
22
-    return admin_url('admin-ajax.php?action=geodir_ajax_action');
22
+	return admin_url('admin-ajax.php?action=geodir_ajax_action');
23 23
 }
24 24
 
25 25
 /////////////////////
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 add_filter('query_vars', 'geodir_add_geodir_page_var');
88 88
 add_action('wp', 'geodir_add_page_id_in_query_var'); // problem fix in wordpress 3.8
89 89
 if (get_option('permalink_structure') != '')
90
-    add_filter('parse_request', 'geodir_set_location_var_in_session_in_core');
90
+	add_filter('parse_request', 'geodir_set_location_var_in_session_in_core');
91 91
 
92 92
 add_filter('parse_query', 'geodir_modified_query');
93 93
 
@@ -154,14 +154,14 @@  discard block
 block discarded – undo
154 154
 /* POST AND LOOP ACTIONS */
155 155
 ////////////////////////
156 156
 if (!is_admin()) {
157
-    add_action('pre_get_posts', 'geodir_exclude_page', 100); /// Will help to exclude virtural page from everywhere
158
-    add_filter('wp_list_pages_excludes', 'exclude_from_wp_list_pages', 100);
159
-    /** Exclude Virtual Pages From Pages List **/
160
-    add_action('pre_get_posts', 'set_listing_request', 0);
161
-    add_action('pre_get_posts', 'geodir_listing_loop_filter', 1);
162
-    add_filter('excerpt_more', 'geodir_excerpt_more', 1000);
163
-    add_filter('excerpt_length', 'geodir_excerpt_length', 1000);
164
-    add_action('the_post', 'create_marker_jason_of_posts'); // Add marker in json array, Map related filter
157
+	add_action('pre_get_posts', 'geodir_exclude_page', 100); /// Will help to exclude virtural page from everywhere
158
+	add_filter('wp_list_pages_excludes', 'exclude_from_wp_list_pages', 100);
159
+	/** Exclude Virtual Pages From Pages List **/
160
+	add_action('pre_get_posts', 'set_listing_request', 0);
161
+	add_action('pre_get_posts', 'geodir_listing_loop_filter', 1);
162
+	add_filter('excerpt_more', 'geodir_excerpt_more', 1000);
163
+	add_filter('excerpt_length', 'geodir_excerpt_length', 1000);
164
+	add_action('the_post', 'create_marker_jason_of_posts'); // Add marker in json array, Map related filter
165 165
 }
166 166
 
167 167
 
@@ -222,12 +222,12 @@  discard block
 block discarded – undo
222 222
  */
223 223
 function geodir_unset_prev_theme_nav_location($newname)
224 224
 {
225
-    $geodir_theme_location = get_option('geodir_theme_location_nav_' . $newname);
226
-    if ($geodir_theme_location) {
227
-        update_option('geodir_theme_location_nav', $geodir_theme_location);
228
-    } else {
229
-        update_option('geodir_theme_location_nav', '');
230
-    }
225
+	$geodir_theme_location = get_option('geodir_theme_location_nav_' . $newname);
226
+	if ($geodir_theme_location) {
227
+		update_option('geodir_theme_location_nav', $geodir_theme_location);
228
+	} else {
229
+		update_option('geodir_theme_location_nav', '');
230
+	}
231 231
 }
232 232
 
233 233
 /// add action for theme switch to blank previous theme navigation location setting
@@ -248,32 +248,32 @@  discard block
 block discarded – undo
248 248
  */
249 249
 function geodir_add_post_filters()
250 250
 {
251
-    /**
252
-     * Contains all function for filtering listing.
253
-     *
254
-     * @since 1.0.0
255
-     * @package GeoDirectory
256
-     */
257
-    include_once('geodirectory-functions/listing_filters.php');
251
+	/**
252
+	 * Contains all function for filtering listing.
253
+	 *
254
+	 * @since 1.0.0
255
+	 * @package GeoDirectory
256
+	 */
257
+	include_once('geodirectory-functions/listing_filters.php');
258 258
 }
259 259
 
260 260
 
261 261
 if (!function_exists('geodir_init_defaults')) {
262
-    /**
263
-     * Calls the function to register the GeoDirectory default CPT and taxonomies.
264
-     *
265
-     * @since 1.0.0
266
-     * @package GeoDirectory
267
-     */
268
-    function geodir_init_defaults()
269
-    {
270
-        if (function_exists('geodir_register_defaults')) {
262
+	/**
263
+	 * Calls the function to register the GeoDirectory default CPT and taxonomies.
264
+	 *
265
+	 * @since 1.0.0
266
+	 * @package GeoDirectory
267
+	 */
268
+	function geodir_init_defaults()
269
+	{
270
+		if (function_exists('geodir_register_defaults')) {
271 271
 
272
-            geodir_register_defaults();
272
+			geodir_register_defaults();
273 273
 
274
-        }
274
+		}
275 275
 
276
-    }
276
+	}
277 277
 }
278 278
 
279 279
 
@@ -295,26 +295,26 @@  discard block
 block discarded – undo
295 295
 // CALLED ON 'sidebars_widgets' FILTER
296 296
 
297 297
 if (!function_exists('geodir_restrict_widget')) {
298
-    /**
299
-     * Sets global values to be able to tell if the current page is a GeoDirectory listing page or a GeoDirectory details page.
300
-     *
301
-     * @global bool $is_listing Sets the global value to true if on a GD category page. False if not.
302
-     * @global bool $is_single_place Sets the global value to true if on a GD details (post) page. False if not.
303
-     * @since 1.0.0
304
-     * @package GeoDirectory
305
-     */
306
-    function geodir_restrict_widget()
307
-    {
308
-        global $is_listing, $is_single_place;
298
+	/**
299
+	 * Sets global values to be able to tell if the current page is a GeoDirectory listing page or a GeoDirectory details page.
300
+	 *
301
+	 * @global bool $is_listing Sets the global value to true if on a GD category page. False if not.
302
+	 * @global bool $is_single_place Sets the global value to true if on a GD details (post) page. False if not.
303
+	 * @since 1.0.0
304
+	 * @package GeoDirectory
305
+	 */
306
+	function geodir_restrict_widget()
307
+	{
308
+		global $is_listing, $is_single_place;
309 309
 
310
-        // set is listing	
311
-        (geodir_is_page('listing')) ? $is_listing = true : $is_listing = false;
310
+		// set is listing	
311
+		(geodir_is_page('listing')) ? $is_listing = true : $is_listing = false;
312 312
 
313
-        // set is single place
314
-        (geodir_is_page('place')) ? $is_single_place = true : $is_single_place = false;
313
+		// set is single place
314
+		(geodir_is_page('place')) ? $is_single_place = true : $is_single_place = false;
315 315
 
316 316
 
317
-    }
317
+	}
318 318
 }
319 319
 
320 320
 
@@ -335,32 +335,32 @@  discard block
 block discarded – undo
335 335
  */
336 336
 function geodir_detail_page_sidebar_content_sorting()
337 337
 {
338
-    $arr_detail_page_sidebar_content =
339
-        /**
340
-         * An array of functions to be called to be displayed on the details (post) page sidebar.
341
-         *
342
-         * This filter can be used to remove sections of the details page sidebar,
343
-         * add new sections or rearrange the order of the sections.
344
-         *
345
-         * @param array array('geodir_social_sharing_buttons','geodir_share_this_button','geodir_detail_page_google_analytics','geodir_edit_post_link','geodir_detail_page_review_rating','geodir_detail_page_more_info') The array of functions that will be called.
346
-         * @since 1.0.0
347
-         */
348
-        apply_filters('geodir_detail_page_sidebar_content',
349
-            array('geodir_social_sharing_buttons',
350
-                'geodir_share_this_button',
351
-                'geodir_detail_page_google_analytics',
352
-                'geodir_edit_post_link',
353
-                //'geodir_detail_page_review_rating',
354
-                'geodir_detail_page_more_info'
355
-            ) // end of array 
356
-        ); // end of apply filter
357
-    if (!empty($arr_detail_page_sidebar_content)) {
358
-        foreach ($arr_detail_page_sidebar_content as $content_function) {
359
-            if (function_exists($content_function)) {
360
-                add_action('geodir_detail_page_sidebar', $content_function);
361
-            }
362
-        }
363
-    }
338
+	$arr_detail_page_sidebar_content =
339
+		/**
340
+		 * An array of functions to be called to be displayed on the details (post) page sidebar.
341
+		 *
342
+		 * This filter can be used to remove sections of the details page sidebar,
343
+		 * add new sections or rearrange the order of the sections.
344
+		 *
345
+		 * @param array array('geodir_social_sharing_buttons','geodir_share_this_button','geodir_detail_page_google_analytics','geodir_edit_post_link','geodir_detail_page_review_rating','geodir_detail_page_more_info') The array of functions that will be called.
346
+		 * @since 1.0.0
347
+		 */
348
+		apply_filters('geodir_detail_page_sidebar_content',
349
+			array('geodir_social_sharing_buttons',
350
+				'geodir_share_this_button',
351
+				'geodir_detail_page_google_analytics',
352
+				'geodir_edit_post_link',
353
+				//'geodir_detail_page_review_rating',
354
+				'geodir_detail_page_more_info'
355
+			) // end of array 
356
+		); // end of apply filter
357
+	if (!empty($arr_detail_page_sidebar_content)) {
358
+		foreach ($arr_detail_page_sidebar_content as $content_function) {
359
+			if (function_exists($content_function)) {
360
+				add_action('geodir_detail_page_sidebar', $content_function);
361
+			}
362
+		}
363
+	}
364 364
 }
365 365
 
366 366
 add_action('geodir_after_edit_post_link', 'geodir_add_to_favourite_link', 1);
@@ -375,14 +375,14 @@  discard block
 block discarded – undo
375 375
  */
376 376
 function geodir_add_to_favourite_link()
377 377
 {
378
-    global $post, $preview;
379
-    if (!$preview && geodir_is_page('detail')) {
380
-        ?>
378
+	global $post, $preview;
379
+	if (!$preview && geodir_is_page('detail')) {
380
+		?>
381 381
         <p class="edit_link">
382 382
             <?php geodir_favourite_html($post->post_author, $post->ID); ?>
383 383
         </p>
384 384
     <?php
385
-    }
385
+	}
386 386
 }
387 387
 
388 388
 /**
@@ -396,41 +396,41 @@  discard block
 block discarded – undo
396 396
  */
397 397
 function geodir_social_sharing_buttons()
398 398
 {
399
-    global $preview;
400
-    ob_start(); // Start  buffering;
401
-    /**
402
-     * This action is called before the social buttons twitter,facebook and google plus are output in a containing div.
403
-     *
404
-     * @since 1.0.0
405
-     */
406
-    do_action('geodir_before_social_sharing_buttons');
407
-    if (!$preview) {
408
-        ?>
399
+	global $preview;
400
+	ob_start(); // Start  buffering;
401
+	/**
402
+	 * This action is called before the social buttons twitter,facebook and google plus are output in a containing div.
403
+	 *
404
+	 * @since 1.0.0
405
+	 */
406
+	do_action('geodir_before_social_sharing_buttons');
407
+	if (!$preview) {
408
+		?>
409 409
         <div class="likethis">
410 410
             <?php geodir_twitter_tweet_button(); ?>
411 411
             <?php geodir_fb_like_button(); ?>
412 412
             <?php geodir_google_plus_button(); ?>
413 413
         </div>
414 414
     <?php
415
-    }// end of if, if its a preview or not
416
-
417
-    /**
418
-     * This action is called after the social buttons twitter,facebook and google plus are output in a containing div.
419
-     *
420
-     * @since 1.0.0
421
-     */
422
-    do_action('geodir_after_social_sharing_buttons');
423
-    $content_html = ob_get_clean();
424
-    if (trim($content_html) != '')
425
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">' . $content_html . '</div>';
426
-    if ((int)get_option('geodir_disable_tfg_buttons_section') != 1) {
427
-        /**
428
-         * Filter the geodir_social_sharing_buttons() function content.
429
-         *
430
-         * @param string $content_html The output html of the geodir_social_sharing_buttons() function.
431
-         */
432
-        echo $content_html = apply_filters('geodir_social_sharing_buttons_html', $content_html);
433
-    }
415
+	}// end of if, if its a preview or not
416
+
417
+	/**
418
+	 * This action is called after the social buttons twitter,facebook and google plus are output in a containing div.
419
+	 *
420
+	 * @since 1.0.0
421
+	 */
422
+	do_action('geodir_after_social_sharing_buttons');
423
+	$content_html = ob_get_clean();
424
+	if (trim($content_html) != '')
425
+		$content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">' . $content_html . '</div>';
426
+	if ((int)get_option('geodir_disable_tfg_buttons_section') != 1) {
427
+		/**
428
+		 * Filter the geodir_social_sharing_buttons() function content.
429
+		 *
430
+		 * @param string $content_html The output html of the geodir_social_sharing_buttons() function.
431
+		 */
432
+		echo $content_html = apply_filters('geodir_social_sharing_buttons_html', $content_html);
433
+	}
434 434
 
435 435
 
436 436
 }
@@ -446,39 +446,39 @@  discard block
 block discarded – undo
446 446
  */
447 447
 function geodir_share_this_button()
448 448
 {
449
-    global $preview;
450
-    ob_start(); // Start buffering;
451
-    /**
452
-     * This is called before the share this html in the function geodir_share_this_button()
453
-     *
454
-     * @since 1.0.0
455
-     */
456
-    do_action('geodir_before_share_this_button');
457
-    if (!$preview) {
458
-        ?>
449
+	global $preview;
450
+	ob_start(); // Start buffering;
451
+	/**
452
+	 * This is called before the share this html in the function geodir_share_this_button()
453
+	 *
454
+	 * @since 1.0.0
455
+	 */
456
+	do_action('geodir_before_share_this_button');
457
+	if (!$preview) {
458
+		?>
459 459
         <div class="share clearfix">
460 460
             <?php geodir_share_this_button_code(); ?>
461 461
         </div>
462 462
     <?php
463
-    }// end of if, if its a preview or not
464
-    /**
465
-     * This is called after the share this html in the function geodir_share_this_button()
466
-     *
467
-     * @since 1.0.0
468
-     */
469
-    do_action('geodir_after_share_this_button');
470
-    $content_html = ob_get_clean();
471
-    if (trim($content_html) != '')
472
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-sharethis">' . $content_html . '</div>';
473
-    if ((int)get_option('geodir_disable_sharethis_button_section') != 1) {
474
-        /**
475
-         * Filter the geodir_share_this_button() function content.
476
-         *
477
-         * @param string $content_html The output html of the geodir_share_this_button() function.
478
-         * @since 1.0.0
479
-         */
480
-        echo $content_html = apply_filters('geodir_share_this_button_html', $content_html);
481
-    }
463
+	}// end of if, if its a preview or not
464
+	/**
465
+	 * This is called after the share this html in the function geodir_share_this_button()
466
+	 *
467
+	 * @since 1.0.0
468
+	 */
469
+	do_action('geodir_after_share_this_button');
470
+	$content_html = ob_get_clean();
471
+	if (trim($content_html) != '')
472
+		$content_html = '<div class="geodir-company_info geodir-details-sidebar-sharethis">' . $content_html . '</div>';
473
+	if ((int)get_option('geodir_disable_sharethis_button_section') != 1) {
474
+		/**
475
+		 * Filter the geodir_share_this_button() function content.
476
+		 *
477
+		 * @param string $content_html The output html of the geodir_share_this_button() function.
478
+		 * @since 1.0.0
479
+		 */
480
+		echo $content_html = apply_filters('geodir_share_this_button_html', $content_html);
481
+	}
482 482
 
483 483
 }
484 484
 
@@ -494,46 +494,46 @@  discard block
 block discarded – undo
494 494
  */
495 495
 function geodir_edit_post_link()
496 496
 {
497
-    global $post, $preview;
498
-    ob_start(); // Start buffering;
499
-    /**
500
-     * This is called before the edit post link html in the function geodir_edit_post_link()
501
-     *
502
-     * @since 1.0.0
503
-     */
504
-    do_action('geodir_before_edit_post_link');
505
-    if (!$preview) {
506
-        $is_current_user_owner = geodir_listing_belong_to_current_user();
497
+	global $post, $preview;
498
+	ob_start(); // Start buffering;
499
+	/**
500
+	 * This is called before the edit post link html in the function geodir_edit_post_link()
501
+	 *
502
+	 * @since 1.0.0
503
+	 */
504
+	do_action('geodir_before_edit_post_link');
505
+	if (!$preview) {
506
+		$is_current_user_owner = geodir_listing_belong_to_current_user();
507 507
         
508
-        if ($is_current_user_owner) {
509
-            $post_id = $post->ID;
508
+		if ($is_current_user_owner) {
509
+			$post_id = $post->ID;
510 510
             
511
-            if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
512
-                $post_id = (int)$_REQUEST['pid'];
513
-            }
511
+			if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
512
+				$post_id = (int)$_REQUEST['pid'];
513
+			}
514 514
 
515
-            $postlink = get_permalink(geodir_add_listing_page_id());
516
-            $editlink = geodir_getlink($postlink, array('pid' => $post_id), false);
517
-            echo ' <p class="edit_link"><i class="fa fa-pencil"></i> <a href="' . esc_url($editlink) . '">' . __('Edit this Post', 'geodirectory') . '</a></p>';
518
-        }
519
-    }// end of if, if its a preview or not
520
-    /**
521
-     * This is called after the edit post link html in the function geodir_edit_post_link()
522
-     *
523
-     * @since 1.0.0
524
-     */
525
-    do_action('geodir_after_edit_post_link');
526
-    $content_html = ob_get_clean();
527
-    if (trim($content_html) != '')
528
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">' . $content_html . '</div>';
529
-    if ((int)get_option('geodir_disable_user_links_section') != 1) {
530
-        /**
531
-         * Filter the geodir_edit_post_link() function content.
532
-         *
533
-         * @param string $content_html The output html of the geodir_edit_post_link() function.
534
-         */
535
-        echo $content_html = apply_filters('geodir_edit_post_link_html', $content_html);
536
-    }
515
+			$postlink = get_permalink(geodir_add_listing_page_id());
516
+			$editlink = geodir_getlink($postlink, array('pid' => $post_id), false);
517
+			echo ' <p class="edit_link"><i class="fa fa-pencil"></i> <a href="' . esc_url($editlink) . '">' . __('Edit this Post', 'geodirectory') . '</a></p>';
518
+		}
519
+	}// end of if, if its a preview or not
520
+	/**
521
+	 * This is called after the edit post link html in the function geodir_edit_post_link()
522
+	 *
523
+	 * @since 1.0.0
524
+	 */
525
+	do_action('geodir_after_edit_post_link');
526
+	$content_html = ob_get_clean();
527
+	if (trim($content_html) != '')
528
+		$content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">' . $content_html . '</div>';
529
+	if ((int)get_option('geodir_disable_user_links_section') != 1) {
530
+		/**
531
+		 * Filter the geodir_edit_post_link() function content.
532
+		 *
533
+		 * @param string $content_html The output html of the geodir_edit_post_link() function.
534
+		 */
535
+		echo $content_html = apply_filters('geodir_edit_post_link_html', $content_html);
536
+	}
537 537
 }
538 538
 
539 539
 /**
@@ -547,41 +547,41 @@  discard block
 block discarded – undo
547 547
  */
548 548
 function geodir_detail_page_google_analytics()
549 549
 {
550
-    global $post;
551
-    $package_info = array();
552
-    $package_info = geodir_post_package_info($package_info, $post);
550
+	global $post;
551
+	$package_info = array();
552
+	$package_info = geodir_post_package_info($package_info, $post);
553 553
 
554
-    $id = trim(get_option('geodir_ga_id'));
554
+	$id = trim(get_option('geodir_ga_id'));
555 555
 
556
-    if (!$id) {
557
-        return; //if no Google Analytics ID then bail.
558
-    }
556
+	if (!$id) {
557
+		return; //if no Google Analytics ID then bail.
558
+	}
559 559
 
560
-    ob_start(); // Start buffering;
561
-    /**
562
-     * This is called before the edit post link html in the function geodir_detail_page_google_analytics()
563
-     *
564
-     * @since 1.0.0
565
-     */
566
-    do_action('geodir_before_google_analytics');
560
+	ob_start(); // Start buffering;
561
+	/**
562
+	 * This is called before the edit post link html in the function geodir_detail_page_google_analytics()
563
+	 *
564
+	 * @since 1.0.0
565
+	 */
566
+	do_action('geodir_before_google_analytics');
567 567
     
568
-    $refresh_time = get_option('geodir_ga_refresh_time', 5);
569
-    /**
570
-     * Filter the time interval to check & refresh new users results.
571
-     *
572
-     * @since 1.5.9
573
-     *
574
-     * @param int $refresh_time Time interval to check & refresh new users results.
575
-     */
576
-    $refresh_time = apply_filters('geodir_google_analytics_refresh_time', $refresh_time);
577
-    $refresh_time = absint($refresh_time * 1000);
568
+	$refresh_time = get_option('geodir_ga_refresh_time', 5);
569
+	/**
570
+	 * Filter the time interval to check & refresh new users results.
571
+	 *
572
+	 * @since 1.5.9
573
+	 *
574
+	 * @param int $refresh_time Time interval to check & refresh new users results.
575
+	 */
576
+	$refresh_time = apply_filters('geodir_google_analytics_refresh_time', $refresh_time);
577
+	$refresh_time = absint($refresh_time * 1000);
578 578
     
579
-    $hide_refresh = get_option('geodir_ga_auto_refresh');
579
+	$hide_refresh = get_option('geodir_ga_auto_refresh');
580 580
     
581
-    $auto_refresh = $hide_refresh && $refresh_time && $refresh_time > 0 ? 1 : 0;
582
-    if (get_option('geodir_ga_stats') && is_user_logged_in() &&  (isset($package_info->google_analytics) && $package_info->google_analytics == '1') && (get_current_user_id()==$post->post_author || current_user_can( 'manage_options' )) ) {
583
-        $page_url = urlencode($_SERVER['REQUEST_URI']);
584
-        ?>
581
+	$auto_refresh = $hide_refresh && $refresh_time && $refresh_time > 0 ? 1 : 0;
582
+	if (get_option('geodir_ga_stats') && is_user_logged_in() &&  (isset($package_info->google_analytics) && $package_info->google_analytics == '1') && (get_current_user_id()==$post->post_author || current_user_can( 'manage_options' )) ) {
583
+		$page_url = urlencode($_SERVER['REQUEST_URI']);
584
+		?>
585 585
         <script type="text/javascript">
586 586
             var gd_gaTimeOut;
587 587
             var gd_gaTime = parseInt('<?php echo $refresh_time;?>');
@@ -833,15 +833,15 @@  discard block
 block discarded – undo
833 833
                     var labels = results[1].rows.map(function(row) { return +row[0]; });
834 834
 
835 835
                     <?php
836
-                    // Here we list the shorthand days of the week so it can be used in translation.
837
-                    __("Mon",'geodirectory');
838
-                    __("Tue",'geodirectory');
839
-                    __("Wed",'geodirectory');
840
-                    __("Thu",'geodirectory');
841
-                    __("Fri",'geodirectory');
842
-                    __("Sat",'geodirectory');
843
-                    __("Sun",'geodirectory');
844
-                    ?>
836
+					// Here we list the shorthand days of the week so it can be used in translation.
837
+					__("Mon",'geodirectory');
838
+					__("Tue",'geodirectory');
839
+					__("Wed",'geodirectory');
840
+					__("Thu",'geodirectory');
841
+					__("Fri",'geodirectory');
842
+					__("Sat",'geodirectory');
843
+					__("Sun",'geodirectory');
844
+					?>
845 845
 
846 846
                     labels = [
847 847
                         "<?php _e(date('D', strtotime("+1 day")),'geodirectory'); ?>",
@@ -1090,24 +1090,24 @@  discard block
 block discarded – undo
1090 1090
         </span>
1091 1091
 
1092 1092
     <?php
1093
-    }
1094
-    /**
1095
-     * This is called after the edit post link html in the function geodir_detail_page_google_analytics()
1096
-     *
1097
-     * @since 1.0.0
1098
-     */
1099
-    do_action('geodir_after_google_analytics');
1100
-    $content_html = ob_get_clean();
1101
-    if (trim($content_html) != '')
1102
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">' . $content_html . '</div>';
1103
-    if ((int)get_option('geodir_disable_google_analytics_section') != 1) {
1104
-        /**
1105
-         * Filter the geodir_edit_post_link() function content.
1106
-         *
1107
-         * @param string $content_html The output html of the geodir_edit_post_link() function.
1108
-         */
1109
-        echo $content_html = apply_filters('geodir_google_analytic_html', $content_html);
1110
-    }
1093
+	}
1094
+	/**
1095
+	 * This is called after the edit post link html in the function geodir_detail_page_google_analytics()
1096
+	 *
1097
+	 * @since 1.0.0
1098
+	 */
1099
+	do_action('geodir_after_google_analytics');
1100
+	$content_html = ob_get_clean();
1101
+	if (trim($content_html) != '')
1102
+		$content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">' . $content_html . '</div>';
1103
+	if ((int)get_option('geodir_disable_google_analytics_section') != 1) {
1104
+		/**
1105
+		 * Filter the geodir_edit_post_link() function content.
1106
+		 *
1107
+		 * @param string $content_html The output html of the geodir_edit_post_link() function.
1108
+		 */
1109
+		echo $content_html = apply_filters('geodir_google_analytic_html', $content_html);
1110
+	}
1111 1111
 }
1112 1112
 
1113 1113
 /**
@@ -1123,90 +1123,90 @@  discard block
 block discarded – undo
1123 1123
  */
1124 1124
 function geodir_detail_page_review_rating()
1125 1125
 {
1126
-    global $post, $preview, $post_images;
1127
-    ob_start(); // Start  buffering;
1128
-    /**
1129
-     * This is called before the rating html in the function geodir_detail_page_review_rating().
1130
-     *
1131
-     * This is called outside the check for an actual rating and the check for preview page.
1132
-     *
1133
-     * @since 1.0.0
1134
-     */
1135
-    do_action('geodir_before_detail_page_review_rating');
1136
-
1137
-    $comment_count = geodir_get_review_count_total($post->ID);
1138
-    $post_avgratings = geodir_get_post_rating($post->ID);
1139
-
1140
-    if ($post_avgratings != 0 && !$preview) {
1141
-        /**
1142
-         * This is called before the rating html in the function geodir_detail_page_review_rating().
1143
-         *
1144
-         * This is called inside the check for an actual rating and the check for preview page.
1145
-         *
1146
-         * @since 1.0.0
1147
-         * @param float $post_avgratings Average rating for the surrent post.
1148
-         * @param int $post->ID Current post ID.
1149
-         */
1150
-        do_action('geodir_before_review_rating_stars_on_detail', $post_avgratings, $post->ID);
1151
-
1152
-        $html = '<p style=" float:left;">';
1153
-        $html .= geodir_get_rating_stars($post_avgratings, $post->ID);
1154
-        $html .= '<div class="average-review" itemscope itemtype="http://data-vocabulary.org/Review-aggregate">';
1155
-        $post_avgratings = (is_float($post_avgratings) || (strpos($post_avgratings, ".", 1) == 1 && strlen($post_avgratings) > 3)) ? number_format($post_avgratings, 1, '.', '') : $post_avgratings;
1126
+	global $post, $preview, $post_images;
1127
+	ob_start(); // Start  buffering;
1128
+	/**
1129
+	 * This is called before the rating html in the function geodir_detail_page_review_rating().
1130
+	 *
1131
+	 * This is called outside the check for an actual rating and the check for preview page.
1132
+	 *
1133
+	 * @since 1.0.0
1134
+	 */
1135
+	do_action('geodir_before_detail_page_review_rating');
1136
+
1137
+	$comment_count = geodir_get_review_count_total($post->ID);
1138
+	$post_avgratings = geodir_get_post_rating($post->ID);
1139
+
1140
+	if ($post_avgratings != 0 && !$preview) {
1141
+		/**
1142
+		 * This is called before the rating html in the function geodir_detail_page_review_rating().
1143
+		 *
1144
+		 * This is called inside the check for an actual rating and the check for preview page.
1145
+		 *
1146
+		 * @since 1.0.0
1147
+		 * @param float $post_avgratings Average rating for the surrent post.
1148
+		 * @param int $post->ID Current post ID.
1149
+		 */
1150
+		do_action('geodir_before_review_rating_stars_on_detail', $post_avgratings, $post->ID);
1151
+
1152
+		$html = '<p style=" float:left;">';
1153
+		$html .= geodir_get_rating_stars($post_avgratings, $post->ID);
1154
+		$html .= '<div class="average-review" itemscope itemtype="http://data-vocabulary.org/Review-aggregate">';
1155
+		$post_avgratings = (is_float($post_avgratings) || (strpos($post_avgratings, ".", 1) == 1 && strlen($post_avgratings) > 3)) ? number_format($post_avgratings, 1, '.', '') : $post_avgratings;
1156 1156
        
1157 1157
 	   $reviews_text = $comment_count > 1 ? __("reviews", 'geodirectory') : __("review", 'geodirectory');
1158 1158
 	   
1159 1159
 	   $html .= '<span itemprop="rating" itemscope itemtype="http://data-vocabulary.org/Rating"><span class="rating" itemprop="average" content="' . $post_avgratings . '">' . $post_avgratings . '</span> / <span itemprop="best" content="5">5</span> ' . __("based on", 'geodirectory') . ' </span><span class="count" itemprop="count" content="' . $comment_count . '">' . $comment_count . ' ' . $reviews_text . '</span><br />';
1160 1160
 
1161
-        $html .= '<span class="item">';
1162
-        $html .= '<span class="fn" itemprop="itemreviewed">' . $post->post_title . '</span>';
1161
+		$html .= '<span class="item">';
1162
+		$html .= '<span class="fn" itemprop="itemreviewed">' . $post->post_title . '</span>';
1163 1163
 
1164
-        if ($post_images) {
1165
-            foreach ($post_images as $img) {
1166
-                $post_img = $img->src;
1167
-                break;
1168
-            }
1169
-        }
1170
-
1171
-        if (isset($post_img) && $post_img) {
1172
-            $html .= '<br /><img src="' . $post_img . '" class="photo" alt="' . esc_attr($post->post_title) . '" itemprop="photo" content="' . $post_img . '" class="photo" />';
1173
-        }
1174
-
1175
-        $html .= '</span>';
1176
-
1177
-        echo $html .= '</div>';
1178
-        /**
1179
-         * This is called after the rating html in the function geodir_detail_page_review_rating().
1180
-         *
1181
-         * This is called inside the check for an actual rating and the check for preview page.
1182
-         *
1183
-         * @since 1.0.0
1184
-         * @param float $post_avgratings Average rating for the surrent post.
1185
-         * @param int $post->ID Current post ID.
1186
-         */
1187
-        do_action('geodir_after_review_rating_stars_on_detail', $post_avgratings, $post->ID);
1188
-    }
1189
-    /**
1190
-     * This is called before the rating html in the function geodir_detail_page_review_rating().
1191
-     *
1192
-     * This is called outside the check for an actual rating and the check for preview page.
1193
-     *
1194
-     * @since 1.0.0
1195
-     */
1196
-    do_action('geodir_after_detail_page_review_rating');
1197
-    $content_html = ob_get_clean();
1198
-    if (trim($content_html) != '') {
1199
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">' . $content_html . '</div>';
1200
-    }
1201
-    if ((int)get_option('geodir_disable_rating_info_section') != 1) {
1202
-        /**
1203
-         * Filter the geodir_detail_page_review_rating() function content.
1204
-         *
1205
-         * @since 1.0.0
1206
-         * @param string $content_html The output html of the geodir_detail_page_review_rating() function.
1207
-         */
1208
-        echo $content_html = apply_filters('geodir_detail_page_review_rating_html', $content_html);
1209
-    }
1164
+		if ($post_images) {
1165
+			foreach ($post_images as $img) {
1166
+				$post_img = $img->src;
1167
+				break;
1168
+			}
1169
+		}
1170
+
1171
+		if (isset($post_img) && $post_img) {
1172
+			$html .= '<br /><img src="' . $post_img . '" class="photo" alt="' . esc_attr($post->post_title) . '" itemprop="photo" content="' . $post_img . '" class="photo" />';
1173
+		}
1174
+
1175
+		$html .= '</span>';
1176
+
1177
+		echo $html .= '</div>';
1178
+		/**
1179
+		 * This is called after the rating html in the function geodir_detail_page_review_rating().
1180
+		 *
1181
+		 * This is called inside the check for an actual rating and the check for preview page.
1182
+		 *
1183
+		 * @since 1.0.0
1184
+		 * @param float $post_avgratings Average rating for the surrent post.
1185
+		 * @param int $post->ID Current post ID.
1186
+		 */
1187
+		do_action('geodir_after_review_rating_stars_on_detail', $post_avgratings, $post->ID);
1188
+	}
1189
+	/**
1190
+	 * This is called before the rating html in the function geodir_detail_page_review_rating().
1191
+	 *
1192
+	 * This is called outside the check for an actual rating and the check for preview page.
1193
+	 *
1194
+	 * @since 1.0.0
1195
+	 */
1196
+	do_action('geodir_after_detail_page_review_rating');
1197
+	$content_html = ob_get_clean();
1198
+	if (trim($content_html) != '') {
1199
+		$content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">' . $content_html . '</div>';
1200
+	}
1201
+	if ((int)get_option('geodir_disable_rating_info_section') != 1) {
1202
+		/**
1203
+		 * Filter the geodir_detail_page_review_rating() function content.
1204
+		 *
1205
+		 * @since 1.0.0
1206
+		 * @param string $content_html The output html of the geodir_detail_page_review_rating() function.
1207
+		 */
1208
+		echo $content_html = apply_filters('geodir_detail_page_review_rating_html', $content_html);
1209
+	}
1210 1210
 }
1211 1211
 
1212 1212
 /**
@@ -1218,35 +1218,35 @@  discard block
 block discarded – undo
1218 1218
  */
1219 1219
 function geodir_detail_page_more_info()
1220 1220
 {
1221
-    ob_start(); // Start  buffering;
1222
-    /**
1223
-     * This is called before the info section html.
1224
-     *
1225
-     * @since 1.0.0
1226
-     */
1227
-    do_action('geodir_before_detail_page_more_info');
1228
-    if ($geodir_post_detail_fields = geodir_show_listing_info()) {
1229
-        echo $geodir_post_detail_fields;
1230
-    }
1231
-    /**
1232
-     * This is called after the info section html.
1233
-     *
1234
-     * @since 1.0.0
1235
-     */
1236
-    do_action('geodir_after_detail_page_more_info');
1237
-
1238
-    $content_html = ob_get_clean();
1239
-    if (trim($content_html) != '')
1240
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">' . $content_html . '</div>';
1241
-    if ((int)get_option('geodir_disable_listing_info_section') != 1) {
1242
-        /**
1243
-         * Filter the output html for function geodir_detail_page_more_info().
1244
-         *
1245
-         * @since 1.0.0
1246
-         * @param string $content_html The output html of the geodir_detail_page_more_info() function.
1247
-         */
1248
-        echo $content_html = apply_filters('geodir_detail_page_more_info_html', $content_html);
1249
-    }
1221
+	ob_start(); // Start  buffering;
1222
+	/**
1223
+	 * This is called before the info section html.
1224
+	 *
1225
+	 * @since 1.0.0
1226
+	 */
1227
+	do_action('geodir_before_detail_page_more_info');
1228
+	if ($geodir_post_detail_fields = geodir_show_listing_info()) {
1229
+		echo $geodir_post_detail_fields;
1230
+	}
1231
+	/**
1232
+	 * This is called after the info section html.
1233
+	 *
1234
+	 * @since 1.0.0
1235
+	 */
1236
+	do_action('geodir_after_detail_page_more_info');
1237
+
1238
+	$content_html = ob_get_clean();
1239
+	if (trim($content_html) != '')
1240
+		$content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">' . $content_html . '</div>';
1241
+	if ((int)get_option('geodir_disable_listing_info_section') != 1) {
1242
+		/**
1243
+		 * Filter the output html for function geodir_detail_page_more_info().
1244
+		 *
1245
+		 * @since 1.0.0
1246
+		 * @param string $content_html The output html of the geodir_detail_page_more_info() function.
1247
+		 */
1248
+		echo $content_html = apply_filters('geodir_detail_page_more_info_html', $content_html);
1249
+	}
1250 1250
 }
1251 1251
 
1252 1252
 
@@ -1260,15 +1260,15 @@  discard block
 block discarded – undo
1260 1260
  */
1261 1261
 function geodir_localize_all_js_msg()
1262 1262
 {// 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
1263
-    if (str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
1264
-        $ajax_url = admin_url('admin-ajax.php');
1265
-    } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
1266
-        $ajax_url = admin_url('admin-ajax.php');
1267
-    } elseif (str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
1268
-        $ajax_url = str_replace("https", "http", admin_url('admin-ajax.php'));
1269
-    } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
1270
-        $ajax_url = str_replace("http", "https", admin_url('admin-ajax.php'));
1271
-    }
1263
+	if (str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
1264
+		$ajax_url = admin_url('admin-ajax.php');
1265
+	} elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
1266
+		$ajax_url = admin_url('admin-ajax.php');
1267
+	} elseif (str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
1268
+		$ajax_url = str_replace("https", "http", admin_url('admin-ajax.php'));
1269
+	} elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
1270
+		$ajax_url = str_replace("http", "https", admin_url('admin-ajax.php'));
1271
+	}
1272 1272
 	
1273 1273
 	/**
1274 1274
 	 * Filter the allowed image type extensions for post images.
@@ -1278,59 +1278,59 @@  discard block
 block discarded – undo
1278 1278
 	 */
1279 1279
 	$allowed_img_types = apply_filters('geodir_allowed_post_image_exts', array('jpg', 'jpeg', 'jpe', 'gif', 'png'));
1280 1280
 	
1281
-    $default_marker_icon = get_option('geodir_default_marker_icon');
1282
-    $default_marker_size = geodir_get_marker_size($default_marker_icon, array('w' => 20, 'h' => 34));
1283
-    $default_marker_width = $default_marker_size['w'];
1284
-    $default_marker_height = $default_marker_size['h'];
1281
+	$default_marker_icon = get_option('geodir_default_marker_icon');
1282
+	$default_marker_size = geodir_get_marker_size($default_marker_icon, array('w' => 20, 'h' => 34));
1283
+	$default_marker_width = $default_marker_size['w'];
1284
+	$default_marker_height = $default_marker_size['h'];
1285 1285
     
1286
-    $arr_alert_msg = array(
1287
-        'geodir_plugin_url' => geodir_plugin_url(),
1288
-        'geodir_admin_ajax_url' => $ajax_url,
1289
-        'custom_field_not_blank_var' => __('HTML Variable Name must not be blank', 'geodirectory'),
1290
-        'custom_field_not_special_char' => __('Please do not use special character and spaces in HTML Variable Name.', 'geodirectory'),
1291
-        'custom_field_unique_name' => __('HTML Variable Name should be a unique name.', 'geodirectory'),
1292
-        'custom_field_delete' => __('Are you wish to delete this field?', 'geodirectory'),
1293
-        //start not show alert msg
1294
-        'tax_meta_class_succ_del_msg' => __('File has been successfully deleted.', 'geodirectory'),
1295
-        'tax_meta_class_not_permission_to_del_msg' => __('You do NOT have permission to delete this file.', 'geodirectory'),
1296
-        'tax_meta_class_order_save_msg' => __('Order saved!', 'geodirectory'),
1297
-        'tax_meta_class_not_permission_record_img_msg' => __('You do not have permission to reorder images.', 'geodirectory'),
1298
-        'address_not_found_on_map_msg' => __('Address not found for:', 'geodirectory'),
1299
-        // end not show alert msg
1300
-        'my_place_listing_del' => __('Are you wish to delete this listing?', 'geodirectory'),
1301
-        //start not show alert msg
1302
-        'rating_error_msg' => __('Error : please retry', 'geodirectory'),
1303
-        'listing_url_prefix_msg' => __('Please enter listing url prefix', 'geodirectory'),
1304
-        'invalid_listing_prefix_msg' => __('Invalid character in listing url prefix', 'geodirectory'),
1305
-        'location_url_prefix_msg' => __('Please enter location url prefix', 'geodirectory'),
1306
-        'invalid_location_prefix_msg' => __('Invalid character in location url prefix', 'geodirectory'),
1307
-        'location_and_cat_url_separator_msg' => __('Please enter location and category url separator', 'geodirectory'),
1308
-        'invalid_char_and_cat_url_separator_msg' => __('Invalid character in location and category url separator', 'geodirectory'),
1309
-        'listing_det_url_separator_msg' => __('Please enter listing detail url separator', 'geodirectory'),
1310
-        'invalid_char_listing_det_url_separator_msg' => __('Invalid character in listing detail url separator', 'geodirectory'),
1311
-        'loading_listing_error_favorite' => __('Error loading listing.', 'geodirectory'),
1312
-        'geodir_field_id_required' => __('This field is required.', 'geodirectory'),
1313
-        'geodir_valid_email_address_msg' => __('Please enter valid email address.', 'geodirectory'),
1314
-        'geodir_default_marker_icon' => $default_marker_icon,
1315
-        'geodir_default_marker_w' => $default_marker_width,
1316
-        'geodir_default_marker_h' => $default_marker_height,
1317
-        'geodir_latitude_error_msg' => GEODIR_LATITUDE_ERROR_MSG,
1318
-        'geodir_longgitude_error_msg' => GEODIR_LOGNGITUDE_ERROR_MSG,
1319
-        'geodir_default_rating_star_icon' => get_option('geodir_default_rating_star_icon'),
1320
-        'gd_cmt_btn_post_reply' => __('Post Reply', 'geodirectory'),
1321
-        'gd_cmt_btn_reply_text' => __('Reply text', 'geodirectory'),
1322
-        'gd_cmt_btn_post_review' => __('Post Review', 'geodirectory'),
1323
-        'gd_cmt_btn_review_text' => __('Review text', 'geodirectory'),
1324
-        'gd_cmt_err_no_rating' => __("Please select star rating, you can't leave a review without stars.", 'geodirectory'),
1325
-        /* on/off dragging for phone devices */
1326
-        'geodir_onoff_dragging' => get_option('geodir_map_onoff_dragging') ? true : false,
1327
-        'geodir_is_mobile' => wp_is_mobile() ? true : false,
1328
-        'geodir_on_dragging_text' => __('Enable Dragging', 'geodirectory'),
1329
-        'geodir_off_dragging_text' => __('Disable Dragging', 'geodirectory'),
1330
-        'geodir_err_max_file_size' => __('File size error : You tried to upload a file over %s', 'geodirectory'),
1331
-        'geodir_err_file_upload_limit' => __('You have reached your upload limit of %s files.', 'geodirectory'),
1332
-        'geodir_err_pkg_upload_limit' => __('You may only upload %s files with this package, please try again.', 'geodirectory'),
1333
-        'geodir_action_remove' => __('Remove', 'geodirectory'),
1286
+	$arr_alert_msg = array(
1287
+		'geodir_plugin_url' => geodir_plugin_url(),
1288
+		'geodir_admin_ajax_url' => $ajax_url,
1289
+		'custom_field_not_blank_var' => __('HTML Variable Name must not be blank', 'geodirectory'),
1290
+		'custom_field_not_special_char' => __('Please do not use special character and spaces in HTML Variable Name.', 'geodirectory'),
1291
+		'custom_field_unique_name' => __('HTML Variable Name should be a unique name.', 'geodirectory'),
1292
+		'custom_field_delete' => __('Are you wish to delete this field?', 'geodirectory'),
1293
+		//start not show alert msg
1294
+		'tax_meta_class_succ_del_msg' => __('File has been successfully deleted.', 'geodirectory'),
1295
+		'tax_meta_class_not_permission_to_del_msg' => __('You do NOT have permission to delete this file.', 'geodirectory'),
1296
+		'tax_meta_class_order_save_msg' => __('Order saved!', 'geodirectory'),
1297
+		'tax_meta_class_not_permission_record_img_msg' => __('You do not have permission to reorder images.', 'geodirectory'),
1298
+		'address_not_found_on_map_msg' => __('Address not found for:', 'geodirectory'),
1299
+		// end not show alert msg
1300
+		'my_place_listing_del' => __('Are you wish to delete this listing?', 'geodirectory'),
1301
+		//start not show alert msg
1302
+		'rating_error_msg' => __('Error : please retry', 'geodirectory'),
1303
+		'listing_url_prefix_msg' => __('Please enter listing url prefix', 'geodirectory'),
1304
+		'invalid_listing_prefix_msg' => __('Invalid character in listing url prefix', 'geodirectory'),
1305
+		'location_url_prefix_msg' => __('Please enter location url prefix', 'geodirectory'),
1306
+		'invalid_location_prefix_msg' => __('Invalid character in location url prefix', 'geodirectory'),
1307
+		'location_and_cat_url_separator_msg' => __('Please enter location and category url separator', 'geodirectory'),
1308
+		'invalid_char_and_cat_url_separator_msg' => __('Invalid character in location and category url separator', 'geodirectory'),
1309
+		'listing_det_url_separator_msg' => __('Please enter listing detail url separator', 'geodirectory'),
1310
+		'invalid_char_listing_det_url_separator_msg' => __('Invalid character in listing detail url separator', 'geodirectory'),
1311
+		'loading_listing_error_favorite' => __('Error loading listing.', 'geodirectory'),
1312
+		'geodir_field_id_required' => __('This field is required.', 'geodirectory'),
1313
+		'geodir_valid_email_address_msg' => __('Please enter valid email address.', 'geodirectory'),
1314
+		'geodir_default_marker_icon' => $default_marker_icon,
1315
+		'geodir_default_marker_w' => $default_marker_width,
1316
+		'geodir_default_marker_h' => $default_marker_height,
1317
+		'geodir_latitude_error_msg' => GEODIR_LATITUDE_ERROR_MSG,
1318
+		'geodir_longgitude_error_msg' => GEODIR_LOGNGITUDE_ERROR_MSG,
1319
+		'geodir_default_rating_star_icon' => get_option('geodir_default_rating_star_icon'),
1320
+		'gd_cmt_btn_post_reply' => __('Post Reply', 'geodirectory'),
1321
+		'gd_cmt_btn_reply_text' => __('Reply text', 'geodirectory'),
1322
+		'gd_cmt_btn_post_review' => __('Post Review', 'geodirectory'),
1323
+		'gd_cmt_btn_review_text' => __('Review text', 'geodirectory'),
1324
+		'gd_cmt_err_no_rating' => __("Please select star rating, you can't leave a review without stars.", 'geodirectory'),
1325
+		/* on/off dragging for phone devices */
1326
+		'geodir_onoff_dragging' => get_option('geodir_map_onoff_dragging') ? true : false,
1327
+		'geodir_is_mobile' => wp_is_mobile() ? true : false,
1328
+		'geodir_on_dragging_text' => __('Enable Dragging', 'geodirectory'),
1329
+		'geodir_off_dragging_text' => __('Disable Dragging', 'geodirectory'),
1330
+		'geodir_err_max_file_size' => __('File size error : You tried to upload a file over %s', 'geodirectory'),
1331
+		'geodir_err_file_upload_limit' => __('You have reached your upload limit of %s files.', 'geodirectory'),
1332
+		'geodir_err_pkg_upload_limit' => __('You may only upload %s files with this package, please try again.', 'geodirectory'),
1333
+		'geodir_action_remove' => __('Remove', 'geodirectory'),
1334 1334
 		'geodir_txt_all_files' => __('Allowed files', 'geodirectory'),
1335 1335
 		'geodir_err_file_type' => __('File type error. Allowed file types: %s', 'geodirectory'),
1336 1336
 		'gd_allowed_img_types' => !empty($allowed_img_types) ? implode(',', $allowed_img_types) : '',
@@ -1338,29 +1338,29 @@  discard block
 block discarded – undo
1338 1338
 		'geodir_txt_form_searching' => __('Searching...', 'geodirectory'),
1339 1339
 		'fa_rating' => (int)get_option('geodir_reviewrating_enable_font_awesome') == 1 ? 1 : '',
1340 1340
 		'reviewrating' => defined('GEODIRREVIEWRATING_VERSION') ? 1 : '',
1341
-        'geodir_map_name' => geodir_map_name(),
1342
-    );
1343
-
1344
-    /**
1345
-     * Filters the translated JS strings from function geodir_localize_all_js_msg().
1346
-     *
1347
-     * With this filter you can add, remove or change translated JS strings.
1348
-     * You should add your own translations to this if you are building an addon rather than adding another script block.
1349
-     *
1350
-     * @since 1.0.0
1351
-     */
1352
-    $arr_alert_msg = apply_filters('geodir_all_js_msg', $arr_alert_msg);
1353
-
1354
-    foreach ($arr_alert_msg as $key => $value) {
1355
-        if (!is_scalar($value))
1356
-            continue;
1357
-        $arr_alert_msg[$key] = html_entity_decode((string)$value, ENT_QUOTES, 'UTF-8');
1358
-    }
1341
+		'geodir_map_name' => geodir_map_name(),
1342
+	);
1343
+
1344
+	/**
1345
+	 * Filters the translated JS strings from function geodir_localize_all_js_msg().
1346
+	 *
1347
+	 * With this filter you can add, remove or change translated JS strings.
1348
+	 * You should add your own translations to this if you are building an addon rather than adding another script block.
1349
+	 *
1350
+	 * @since 1.0.0
1351
+	 */
1352
+	$arr_alert_msg = apply_filters('geodir_all_js_msg', $arr_alert_msg);
1353
+
1354
+	foreach ($arr_alert_msg as $key => $value) {
1355
+		if (!is_scalar($value))
1356
+			continue;
1357
+		$arr_alert_msg[$key] = html_entity_decode((string)$value, ENT_QUOTES, 'UTF-8');
1358
+	}
1359 1359
 
1360
-    $script = "var geodir_all_js_msg = " . json_encode($arr_alert_msg) . ';';
1361
-    echo '<script>';
1362
-    echo $script;
1363
-    echo '</script>';
1360
+	$script = "var geodir_all_js_msg = " . json_encode($arr_alert_msg) . ';';
1361
+	echo '<script>';
1362
+	echo $script;
1363
+	echo '</script>';
1364 1364
 }
1365 1365
 
1366 1366
 add_action('admin_bar_menu', 'geodir_admin_bar_site_menu', 31);
@@ -1376,9 +1376,9 @@  discard block
 block discarded – undo
1376 1376
  */
1377 1377
 function geodir_admin_bar_site_menu($wp_admin_bar)
1378 1378
 {
1379
-    if (get_option("geodir_installed")) {
1380
-        $wp_admin_bar->add_menu(array('parent' => 'appearance', 'id' => 'geodirectory', 'title' => __('GeoDirectory', 'geodirectory'), 'href' => admin_url('?page=geodirectory')));
1381
-    }
1379
+	if (get_option("geodir_installed")) {
1380
+		$wp_admin_bar->add_menu(array('parent' => 'appearance', 'id' => 'geodirectory', 'title' => __('GeoDirectory', 'geodirectory'), 'href' => admin_url('?page=geodirectory')));
1381
+	}
1382 1382
 }
1383 1383
 
1384 1384
 add_action('geodir_before_listing', 'geodir_display_sort_options'); /*function in custom_functions.php*/
@@ -1404,25 +1404,25 @@  discard block
 block discarded – undo
1404 1404
  */
1405 1405
 function geodir_store_sidebars()
1406 1406
 {
1407
-    global $geodir_sidebars;
1408
-    global $sidebars_widgets;
1409
-
1410
-    if (!is_array($sidebars_widgets))
1411
-        $sidebars_widgets = wp_get_sidebars_widgets();
1412
-    $geodir_old_sidebars = array();
1413
-
1414
-    if (is_array($geodir_sidebars)) {
1415
-        foreach ($geodir_sidebars as $val) {
1416
-            if (is_array($sidebars_widgets)) {
1417
-                if (array_key_exists($val, $sidebars_widgets))
1418
-                    $geodir_old_sidebars[$val] = $sidebars_widgets[$val];
1419
-                else
1420
-                    $geodir_old_sidebars[$val] = array();
1421
-            }
1422
-        }
1423
-    }
1424
-    update_option('geodir_sidebars', $geodir_old_sidebars);
1425
-    geodir_option_version_backup('geodir_sidebars');
1407
+	global $geodir_sidebars;
1408
+	global $sidebars_widgets;
1409
+
1410
+	if (!is_array($sidebars_widgets))
1411
+		$sidebars_widgets = wp_get_sidebars_widgets();
1412
+	$geodir_old_sidebars = array();
1413
+
1414
+	if (is_array($geodir_sidebars)) {
1415
+		foreach ($geodir_sidebars as $val) {
1416
+			if (is_array($sidebars_widgets)) {
1417
+				if (array_key_exists($val, $sidebars_widgets))
1418
+					$geodir_old_sidebars[$val] = $sidebars_widgets[$val];
1419
+				else
1420
+					$geodir_old_sidebars[$val] = array();
1421
+			}
1422
+		}
1423
+	}
1424
+	update_option('geodir_sidebars', $geodir_old_sidebars);
1425
+	geodir_option_version_backup('geodir_sidebars');
1426 1426
 
1427 1427
 }
1428 1428
 
@@ -1436,28 +1436,28 @@  discard block
 block discarded – undo
1436 1436
  */
1437 1437
 function geodir_restore_sidebars()
1438 1438
 {
1439
-    global $sidebars_widgets;
1440
-
1441
-    if (!is_array($sidebars_widgets))
1442
-        $sidebars_widgets = wp_get_sidebars_widgets();
1443
-
1444
-    if (is_array($sidebars_widgets)) {
1445
-        $geodir_old_sidebars = get_option('geodir_sidebars');
1446
-        if (is_array($geodir_old_sidebars)) {
1447
-            foreach ($geodir_old_sidebars as $key => $val) {
1448
-                if(0 === strpos($key, 'geodir_'))// if gd widget
1449
-                {
1450
-                    $sidebars_widgets[$key] = $geodir_old_sidebars[$key];
1451
-                }
1439
+	global $sidebars_widgets;
1452 1440
 
1441
+	if (!is_array($sidebars_widgets))
1442
+		$sidebars_widgets = wp_get_sidebars_widgets();
1453 1443
 
1454
-            }
1455
-        }
1444
+	if (is_array($sidebars_widgets)) {
1445
+		$geodir_old_sidebars = get_option('geodir_sidebars');
1446
+		if (is_array($geodir_old_sidebars)) {
1447
+			foreach ($geodir_old_sidebars as $key => $val) {
1448
+				if(0 === strpos($key, 'geodir_'))// if gd widget
1449
+				{
1450
+					$sidebars_widgets[$key] = $geodir_old_sidebars[$key];
1451
+				}
1456 1452
 
1457
-    }
1458 1453
 
1459
-    update_option('sidebars_widgets', $sidebars_widgets);
1460
-    update_option('geodir_sidebars', '');
1454
+			}
1455
+		}
1456
+
1457
+	}
1458
+
1459
+	update_option('sidebars_widgets', $sidebars_widgets);
1460
+	update_option('geodir_sidebars', '');
1461 1461
 }
1462 1462
 
1463 1463
 add_action('geodir_after_listing_post_gridview', 'geodir_after_listing_post_gridview');
@@ -1470,9 +1470,9 @@  discard block
 block discarded – undo
1470 1470
  */
1471 1471
 function geodir_after_listing_post_gridview()
1472 1472
 {
1473
-    global $gridview_columns;
1473
+	global $gridview_columns;
1474 1474
 
1475
-    $gridview_columns = '';
1475
+	$gridview_columns = '';
1476 1476
 
1477 1477
 }
1478 1478
 
@@ -1500,11 +1500,11 @@  discard block
 block discarded – undo
1500 1500
  */
1501 1501
 function so_handle_038($url, $original_url, $_context)
1502 1502
 {
1503
-    if (strstr($url, "maps.google.com/maps/api/js") !== false) {
1504
-        $url = str_replace("&#038;", "&amp;", $url); // or $url = $original_url
1505
-    }
1503
+	if (strstr($url, "maps.google.com/maps/api/js") !== false) {
1504
+		$url = str_replace("&#038;", "&amp;", $url); // or $url = $original_url
1505
+	}
1506 1506
 
1507
-    return $url;
1507
+	return $url;
1508 1508
 }
1509 1509
 
1510 1510
 
@@ -1520,34 +1520,34 @@  discard block
 block discarded – undo
1520 1520
 function geodir_after_main_form_fields() {
1521 1521
 	global $gd_session;
1522 1522
 	
1523
-    if (get_option('geodir_accept_term_condition')) {
1524
-        global $post;
1525
-        $term_condition = '';
1526
-        if (isset($_REQUEST['backandedit'])) {
1527
-            $post = (object)$gd_session->get('listing');
1528
-            $term_condition = isset($post->geodir_accept_term_condition) ? $post->geodir_accept_term_condition : '';
1529
-        }
1530
-
1531
-        ?>
1523
+	if (get_option('geodir_accept_term_condition')) {
1524
+		global $post;
1525
+		$term_condition = '';
1526
+		if (isset($_REQUEST['backandedit'])) {
1527
+			$post = (object)$gd_session->get('listing');
1528
+			$term_condition = isset($post->geodir_accept_term_condition) ? $post->geodir_accept_term_condition : '';
1529
+		}
1530
+
1531
+		?>
1532 1532
         <div id="geodir_accept_term_condition_row" class="required_field geodir_form_row clearfix">
1533 1533
             <label>&nbsp;</label>
1534 1534
 
1535 1535
             <div class="geodir_taxonomy_field" style="float:left; width:70%;">
1536 1536
 				<span style="display:block"> 
1537 1537
 				<input class="main_list_selecter" type="checkbox" <?php if ($term_condition == '1') {
1538
-                    echo 'checked="checked"';
1539
-                } ?> field_type="checkbox" name="geodir_accept_term_condition" id="geodir_accept_term_condition"
1538
+					echo 'checked="checked"';
1539
+				} ?> field_type="checkbox" name="geodir_accept_term_condition" id="geodir_accept_term_condition"
1540 1540
                        class="geodir_textfield" value="1"
1541 1541
                        style="display:inline-block"/><a href="<?php $terms_page = get_option('geodir_term_condition_page'); if($terms_page){ echo get_permalink($terms_page);}?>" target="_blank"><?php _e('Please accept our terms and conditions', 'geodirectory'); ?></a>
1542 1542
 				</span>
1543 1543
             </div>
1544 1544
             <span class="geodir_message_error"><?php if (isset($required_msg)) {
1545
-                    _e($required_msg, 'geodirectory');
1546
-                } ?></span>
1545
+					_e($required_msg, 'geodirectory');
1546
+				} ?></span>
1547 1547
         </div>
1548 1548
     <?php
1549 1549
 
1550
-    }
1550
+	}
1551 1551
 }
1552 1552
 
1553 1553
 
@@ -1572,42 +1572,42 @@  discard block
 block discarded – undo
1572 1572
  */
1573 1573
 function geodir_detail_page_tab_is_display($is_display, $tab)
1574 1574
 {
1575
-    global $post, $post_images, $video, $special_offers, $related_listing, $geodir_post_detail_fields;
1575
+	global $post, $post_images, $video, $special_offers, $related_listing, $geodir_post_detail_fields;
1576 1576
 
1577
-    if ($tab == 'post_profile') {
1578
-        /** This action is documented in geodirectory_template_actions.php */
1579
-        $desc_limit = apply_filters('geodir_description_field_desc_limit', '');
1577
+	if ($tab == 'post_profile') {
1578
+		/** This action is documented in geodirectory_template_actions.php */
1579
+		$desc_limit = apply_filters('geodir_description_field_desc_limit', '');
1580 1580
         
1581
-        if (!($desc_limit === '' || (int)$desc_limit > 0)) {
1582
-            $is_display = false;
1583
-        }
1584
-    }
1581
+		if (!($desc_limit === '' || (int)$desc_limit > 0)) {
1582
+			$is_display = false;
1583
+		}
1584
+	}
1585 1585
     
1586
-    if ($tab == 'post_info')
1587
-        $is_display = (!empty($geodir_post_detail_fields)) ? true : false;
1586
+	if ($tab == 'post_info')
1587
+		$is_display = (!empty($geodir_post_detail_fields)) ? true : false;
1588 1588
 
1589
-    if ($tab == 'post_images')
1590
-        $is_display = (!empty($post_images)) ? true : false;
1589
+	if ($tab == 'post_images')
1590
+		$is_display = (!empty($post_images)) ? true : false;
1591 1591
 
1592
-    if ($tab == 'post_video')
1593
-        $is_display = (!empty($video)) ? true : false;
1592
+	if ($tab == 'post_video')
1593
+		$is_display = (!empty($video)) ? true : false;
1594 1594
 
1595
-    if ($tab == 'special_offers')
1596
-        $is_display = (!empty($special_offers)) ? true : false;
1595
+	if ($tab == 'special_offers')
1596
+		$is_display = (!empty($special_offers)) ? true : false;
1597 1597
 
1598
-    if ($tab == 'reviews')
1599
-        $is_display = (geodir_is_page('detail')) ? true : false;
1598
+	if ($tab == 'reviews')
1599
+		$is_display = (geodir_is_page('detail')) ? true : false;
1600 1600
 
1601
-    if ($tab == 'related_listing') {
1602
-       $message = __('No listings found which match your selection.', 'geodirectory');
1601
+	if ($tab == 'related_listing') {
1602
+	   $message = __('No listings found which match your selection.', 'geodirectory');
1603 1603
        
1604
-       /** This action is documented in geodirectory-functions/template_functions.php */
1605
-       $message = apply_filters('geodir_message_listing_not_found', $message, 'listing-listview', false);
1604
+	   /** This action is documented in geodirectory-functions/template_functions.php */
1605
+	   $message = apply_filters('geodir_message_listing_not_found', $message, 'listing-listview', false);
1606 1606
        
1607
-       $is_display = ((strpos($related_listing, $message) !== false || $related_listing == '' || !geodir_is_page('detail'))) ? false : true;
1608
-    }
1607
+	   $is_display = ((strpos($related_listing, $message) !== false || $related_listing == '' || !geodir_is_page('detail'))) ? false : true;
1608
+	}
1609 1609
 
1610
-    return $is_display;
1610
+	return $is_display;
1611 1611
 }
1612 1612
 
1613 1613
 
@@ -1623,69 +1623,69 @@  discard block
 block discarded – undo
1623 1623
  * @global string $plugin_prefix Geodirectory plugin table prefix.
1624 1624
  */
1625 1625
 function geodir_changes_in_custom_fields_table() {
1626
-    global $wpdb, $plugin_prefix;
1626
+	global $wpdb, $plugin_prefix;
1627 1627
 	
1628 1628
 	// Remove unused virtual page
1629 1629
 	$listings_page_id = (int)get_option('geodir_listing_page');
1630 1630
 	if ($listings_page_id) {
1631 1631
 		$wpdb->query($wpdb->prepare("DELETE FROM " . $wpdb->posts . " WHERE ID=%d AND post_name = %s AND post_type=%s", array($listings_page_id, 'listings', 'page')));
1632
-        delete_option('geodir_listing_page');
1632
+		delete_option('geodir_listing_page');
1633 1633
 	}
1634 1634
 
1635
-    if (!get_option('geodir_changes_in_custom_fields_table')) {
1636
-        $wpdb->query(
1637
-            $wpdb->prepare(
1638
-                "UPDATE " . GEODIR_CUSTOM_FIELDS_TABLE . " SET is_default=%s, is_admin=%s WHERE is_default=%s",
1639
-                array('1', '1', 'admin')
1640
-            )
1641
-        );
1635
+	if (!get_option('geodir_changes_in_custom_fields_table')) {
1636
+		$wpdb->query(
1637
+			$wpdb->prepare(
1638
+				"UPDATE " . GEODIR_CUSTOM_FIELDS_TABLE . " SET is_default=%s, is_admin=%s WHERE is_default=%s",
1639
+				array('1', '1', 'admin')
1640
+			)
1641
+		);
1642 1642
 
1643 1643
 
1644
-        /* --- terms meta value set --- */
1644
+		/* --- terms meta value set --- */
1645 1645
 
1646
-        update_option('geodir_default_marker_icon', geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png');
1646
+		update_option('geodir_default_marker_icon', geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png');
1647 1647
 
1648
-        $options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "options WHERE option_name LIKE %s", array('%tax_meta_%')));
1648
+		$options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "options WHERE option_name LIKE %s", array('%tax_meta_%')));
1649 1649
 
1650
-        if (!empty($options_data)) {
1650
+		if (!empty($options_data)) {
1651 1651
 
1652
-            foreach ($options_data as $optobj) {
1652
+			foreach ($options_data as $optobj) {
1653 1653
 
1654
-                $option_val = str_replace('tax_meta_', '', $optobj->option_name);
1654
+				$option_val = str_replace('tax_meta_', '', $optobj->option_name);
1655 1655
 
1656
-                $taxonomies_data = $wpdb->get_results($wpdb->prepare("SELECT taxonomy FROM " . $wpdb->prefix . "term_taxonomy WHERE taxonomy LIKE %s AND term_id=%d", array('%category%', $option_val)));
1656
+				$taxonomies_data = $wpdb->get_results($wpdb->prepare("SELECT taxonomy FROM " . $wpdb->prefix . "term_taxonomy WHERE taxonomy LIKE %s AND term_id=%d", array('%category%', $option_val)));
1657 1657
 
1658
-                if (!empty($taxonomies_data)) {
1658
+				if (!empty($taxonomies_data)) {
1659 1659
 
1660
-                    foreach ($taxonomies_data as $taxobj) {
1660
+					foreach ($taxonomies_data as $taxobj) {
1661 1661
 
1662
-                        $taxObject = get_taxonomy($taxobj->taxonomy);
1663
-                        $post_type = $taxObject->object_type[0];
1662
+						$taxObject = get_taxonomy($taxobj->taxonomy);
1663
+						$post_type = $taxObject->object_type[0];
1664 1664
 
1665
-                        $opt_value = 'tax_meta_' . $post_type . '_' . $option_val;
1665
+						$opt_value = 'tax_meta_' . $post_type . '_' . $option_val;
1666 1666
 
1667
-                        $duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM " . $wpdb->prefix . "options WHERE option_name=%s", array('tax_meta_' . $option_val)));
1667
+						$duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM " . $wpdb->prefix . "options WHERE option_name=%s", array('tax_meta_' . $option_val)));
1668 1668
 
1669
-                        if ($duplicate_data) {
1669
+						if ($duplicate_data) {
1670 1670
 
1671
-                            $wpdb->query($wpdb->prepare("UPDATE " . $wpdb->prefix . "options SET	option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id)));
1671
+							$wpdb->query($wpdb->prepare("UPDATE " . $wpdb->prefix . "options SET	option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id)));
1672 1672
 
1673
-                        } else {
1673
+						} else {
1674 1674
 
1675
-                            $wpdb->query($wpdb->prepare("INSERT INTO " . $wpdb->prefix . "options (option_name,option_value,autoload) VALUES (%s, %s, %s)", array($opt_value, $optobj->option_value, $optobj->autoload)));
1675
+							$wpdb->query($wpdb->prepare("INSERT INTO " . $wpdb->prefix . "options (option_name,option_value,autoload) VALUES (%s, %s, %s)", array($opt_value, $optobj->option_value, $optobj->autoload)));
1676 1676
 
1677
-                        }
1677
+						}
1678 1678
 
1679
-                    }
1679
+					}
1680 1680
 
1681
-                }
1681
+				}
1682 1682
 
1683
-            }
1684
-        }
1683
+			}
1684
+		}
1685 1685
 
1686
-        update_option('geodir_changes_in_custom_fields_table', '1');
1686
+		update_option('geodir_changes_in_custom_fields_table', '1');
1687 1687
 
1688
-    }
1688
+	}
1689 1689
 
1690 1690
 }
1691 1691
 
@@ -1704,24 +1704,24 @@  discard block
 block discarded – undo
1704 1704
 function geodir_location_slug_check($slug)
1705 1705
 {
1706 1706
 
1707
-    global $wpdb, $table_prefix;
1707
+	global $wpdb, $table_prefix;
1708 1708
 
1709
-    $slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($slug)));
1709
+	$slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($slug)));
1710 1710
 
1711
-    if ($slug_exists) {
1711
+	if ($slug_exists) {
1712 1712
 
1713
-        $suffix = 1;
1714
-        do {
1715
-            $alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1716
-            $location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($alt_location_name)));
1717
-            $suffix++;
1718
-        } while ($location_slug_check && $suffix < 100);
1713
+		$suffix = 1;
1714
+		do {
1715
+			$alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1716
+			$location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($alt_location_name)));
1717
+			$suffix++;
1718
+		} while ($location_slug_check && $suffix < 100);
1719 1719
 
1720
-        $slug = $alt_location_name;
1720
+		$slug = $alt_location_name;
1721 1721
 
1722
-    }
1722
+	}
1723 1723
 
1724
-    return $slug;
1724
+	return $slug;
1725 1725
 
1726 1726
 }
1727 1727
 
@@ -1746,42 +1746,42 @@  discard block
 block discarded – undo
1746 1746
 function geodir_update_term_slug($term_id, $tt_id, $taxonomy)
1747 1747
 {
1748 1748
 
1749
-    global $wpdb, $plugin_prefix, $table_prefix;
1749
+	global $wpdb, $plugin_prefix, $table_prefix;
1750 1750
 
1751
-    $tern_data = get_term_by('id', $term_id, $taxonomy);
1751
+	$tern_data = get_term_by('id', $term_id, $taxonomy);
1752 1752
 
1753
-    $slug = $tern_data->slug;
1753
+	$slug = $tern_data->slug;
1754 1754
 
1755
-    /**
1756
-     * Filter if a term slug exists.
1757
-     *
1758
-     * @since 1.0.0
1759
-     * @package GeoDirectory
1760
-     * @param bool $bool Default: false.
1761
-     * @param string $slug The term slug.
1762
-     * @param int $term_id The term ID.
1763
-     */
1764
-    $slug_exists = apply_filters('geodir_term_slug_is_exists', false, $slug, $term_id);
1755
+	/**
1756
+	 * Filter if a term slug exists.
1757
+	 *
1758
+	 * @since 1.0.0
1759
+	 * @package GeoDirectory
1760
+	 * @param bool $bool Default: false.
1761
+	 * @param string $slug The term slug.
1762
+	 * @param int $term_id The term ID.
1763
+	 */
1764
+	$slug_exists = apply_filters('geodir_term_slug_is_exists', false, $slug, $term_id);
1765 1765
 
1766
-    if ($slug_exists) {
1766
+	if ($slug_exists) {
1767 1767
 
1768
-        $suffix = 1;
1769
-        do {
1770
-            $new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1768
+		$suffix = 1;
1769
+		do {
1770
+			$new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1771 1771
 
1772
-            /** This action is documented in geodirectory_hooks_actions.php */
1773
-            $term_slug_check = apply_filters('geodir_term_slug_is_exists', false, $new_slug, $term_id);
1772
+			/** This action is documented in geodirectory_hooks_actions.php */
1773
+			$term_slug_check = apply_filters('geodir_term_slug_is_exists', false, $new_slug, $term_id);
1774 1774
 
1775
-            $suffix++;
1776
-        } while ($term_slug_check && $suffix < 100);
1775
+			$suffix++;
1776
+		} while ($term_slug_check && $suffix < 100);
1777 1777
 
1778
-        $slug = $new_slug;
1778
+		$slug = $new_slug;
1779 1779
 
1780
-        //wp_update_term( $term_id, $taxonomy, array('slug' => $slug) );
1780
+		//wp_update_term( $term_id, $taxonomy, array('slug' => $slug) );
1781 1781
 
1782
-        $wpdb->query($wpdb->prepare("UPDATE " . $table_prefix . "terms SET slug=%s WHERE term_id=%d", array($slug, $term_id)));
1782
+		$wpdb->query($wpdb->prepare("UPDATE " . $table_prefix . "terms SET slug=%s WHERE term_id=%d", array($slug, $term_id)));
1783 1783
 
1784
-    }
1784
+	}
1785 1785
 	
1786 1786
 	// Update tag in detail table.
1787 1787
 	$taxonomy_obj = get_taxonomy($taxonomy);
@@ -1822,21 +1822,21 @@  discard block
 block discarded – undo
1822 1822
 function geodir_term_slug_is_exists($slug_exists, $slug, $term_id)
1823 1823
 {
1824 1824
 
1825
-    global $wpdb, $table_prefix;
1825
+	global $wpdb, $table_prefix;
1826 1826
 
1827
-    $default_location = geodir_get_default_location();
1827
+	$default_location = geodir_get_default_location();
1828 1828
 
1829
-    $country_slug = $default_location->country_slug;
1830
-    $region_slug = $default_location->region_slug;
1831
-    $city_slug = $default_location->city_slug;
1829
+	$country_slug = $default_location->country_slug;
1830
+	$region_slug = $default_location->region_slug;
1831
+	$city_slug = $default_location->city_slug;
1832 1832
 
1833
-    if ($country_slug == $slug || $region_slug == $slug || $city_slug == $slug)
1834
-        return $slug_exists = true;
1833
+	if ($country_slug == $slug || $region_slug == $slug || $city_slug == $slug)
1834
+		return $slug_exists = true;
1835 1835
 
1836
-    if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s AND term_id != %d", array($slug, $term_id))))
1837
-        return $slug_exists = true;
1836
+	if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s AND term_id != %d", array($slug, $term_id))))
1837
+		return $slug_exists = true;
1838 1838
 
1839
-    return $slug_exists;
1839
+	return $slug_exists;
1840 1840
 }
1841 1841
 
1842 1842
 
@@ -1855,75 +1855,75 @@  discard block
 block discarded – undo
1855 1855
  */
1856 1856
 function geodir_custom_page_title($title = '', $sep = '')
1857 1857
 {
1858
-    global $wp;
1859
-    if (class_exists('WPSEO_Frontend') || class_exists('All_in_One_SEO_Pack')) {
1860
-        return $title;
1861
-    }
1858
+	global $wp;
1859
+	if (class_exists('WPSEO_Frontend') || class_exists('All_in_One_SEO_Pack')) {
1860
+		return $title;
1861
+	}
1862 1862
 
1863
-    if ($sep == '') {
1864
-        /**
1865
-         * Filter the page title separator.
1866
-         *
1867
-         * @since 1.0.0
1868
-         * @package GeoDirectory
1869
-         * @param string $sep The separator, default: `|`.
1870
-         */
1871
-        $sep = apply_filters('geodir_page_title_separator', '|');
1872
-    }
1863
+	if ($sep == '') {
1864
+		/**
1865
+		 * Filter the page title separator.
1866
+		 *
1867
+		 * @since 1.0.0
1868
+		 * @package GeoDirectory
1869
+		 * @param string $sep The separator, default: `|`.
1870
+		 */
1871
+		$sep = apply_filters('geodir_page_title_separator', '|');
1872
+	}
1873 1873
 
1874 1874
 
1875
-    $gd_page = '';
1876
-    if(geodir_is_page('home')){
1877
-        $gd_page = 'home';
1878
-        $title = (get_option('geodir_meta_title_homepage')) ? get_option('geodir_meta_title_homepage') : $title;
1879
-    }
1880
-    elseif(geodir_is_page('detail')){
1881
-        $gd_page = 'detail';
1882
-        $title = (get_option('geodir_meta_title_detail')) ? get_option('geodir_meta_title_detail') : $title;
1883
-    }
1884
-    elseif(geodir_is_page('pt')){
1885
-        $gd_page = 'pt';
1886
-        $title = (get_option('geodir_meta_title_pt')) ? get_option('geodir_meta_title_pt') : $title;
1887
-    }
1888
-    elseif(geodir_is_page('listing')){
1889
-        $gd_page = 'listing';
1890
-        $title = (get_option('geodir_meta_title_listing')) ? get_option('geodir_meta_title_listing') : $title;
1891
-    }
1892
-    elseif(geodir_is_page('location')){
1893
-        $gd_page = 'location';
1894
-        $title = (get_option('geodir_meta_title_location')) ? get_option('geodir_meta_title_location') : $title;
1895
-    }
1896
-    elseif(geodir_is_page('search')){
1897
-        $gd_page = 'search';
1898
-        $title = (get_option('geodir_meta_title_search')) ? get_option('geodir_meta_title_search') : $title;
1899
-    }
1900
-    elseif(geodir_is_page('add-listing')){
1901
-        $gd_page = 'add-listing';
1902
-        $title = (get_option('geodir_meta_title_add-listing')) ? get_option('geodir_meta_title_add-listing') : $title;
1903
-    }
1904
-    elseif(geodir_is_page('author')){
1905
-        $gd_page = 'author';
1906
-        $title = (get_option('geodir_meta_title_author')) ? get_option('geodir_meta_title_author') : $title;
1907
-    }
1908
-    elseif(geodir_is_page('login')){
1909
-        $gd_page = 'login';
1910
-        $title = (get_option('geodir_meta_title_login')) ? get_option('geodir_meta_title_login') : $title;
1911
-    }
1912
-    elseif(geodir_is_page('listing-success')){
1913
-        $gd_page = 'listing-success';
1914
-        $title = (get_option('geodir_meta_title_listing-success')) ? get_option('geodir_meta_title_listing-success') : $title;
1915
-    }
1875
+	$gd_page = '';
1876
+	if(geodir_is_page('home')){
1877
+		$gd_page = 'home';
1878
+		$title = (get_option('geodir_meta_title_homepage')) ? get_option('geodir_meta_title_homepage') : $title;
1879
+	}
1880
+	elseif(geodir_is_page('detail')){
1881
+		$gd_page = 'detail';
1882
+		$title = (get_option('geodir_meta_title_detail')) ? get_option('geodir_meta_title_detail') : $title;
1883
+	}
1884
+	elseif(geodir_is_page('pt')){
1885
+		$gd_page = 'pt';
1886
+		$title = (get_option('geodir_meta_title_pt')) ? get_option('geodir_meta_title_pt') : $title;
1887
+	}
1888
+	elseif(geodir_is_page('listing')){
1889
+		$gd_page = 'listing';
1890
+		$title = (get_option('geodir_meta_title_listing')) ? get_option('geodir_meta_title_listing') : $title;
1891
+	}
1892
+	elseif(geodir_is_page('location')){
1893
+		$gd_page = 'location';
1894
+		$title = (get_option('geodir_meta_title_location')) ? get_option('geodir_meta_title_location') : $title;
1895
+	}
1896
+	elseif(geodir_is_page('search')){
1897
+		$gd_page = 'search';
1898
+		$title = (get_option('geodir_meta_title_search')) ? get_option('geodir_meta_title_search') : $title;
1899
+	}
1900
+	elseif(geodir_is_page('add-listing')){
1901
+		$gd_page = 'add-listing';
1902
+		$title = (get_option('geodir_meta_title_add-listing')) ? get_option('geodir_meta_title_add-listing') : $title;
1903
+	}
1904
+	elseif(geodir_is_page('author')){
1905
+		$gd_page = 'author';
1906
+		$title = (get_option('geodir_meta_title_author')) ? get_option('geodir_meta_title_author') : $title;
1907
+	}
1908
+	elseif(geodir_is_page('login')){
1909
+		$gd_page = 'login';
1910
+		$title = (get_option('geodir_meta_title_login')) ? get_option('geodir_meta_title_login') : $title;
1911
+	}
1912
+	elseif(geodir_is_page('listing-success')){
1913
+		$gd_page = 'listing-success';
1914
+		$title = (get_option('geodir_meta_title_listing-success')) ? get_option('geodir_meta_title_listing-success') : $title;
1915
+	}
1916 1916
 
1917 1917
 
1918
-    /**
1919
-     * Filter page meta title to replace variables.
1920
-     *
1921
-     * @since 1.5.4
1922
-     * @param string $title The page title including variables.
1923
-     * @param string $gd_page The GeoDirectory page type if any.
1924
-     * @param string $sep The title separator symbol.
1925
-     */
1926
-    return apply_filters('geodir_seo_meta_title', __($title, 'geodirectory'), $gd_page, $sep);
1918
+	/**
1919
+	 * Filter page meta title to replace variables.
1920
+	 *
1921
+	 * @since 1.5.4
1922
+	 * @param string $title The page title including variables.
1923
+	 * @param string $gd_page The GeoDirectory page type if any.
1924
+	 * @param string $sep The title separator symbol.
1925
+	 */
1926
+	return apply_filters('geodir_seo_meta_title', __($title, 'geodirectory'), $gd_page, $sep);
1927 1927
 
1928 1928
 }
1929 1929
 
@@ -1939,36 +1939,36 @@  discard block
 block discarded – undo
1939 1939
 function geodir_set_post_attachment()
1940 1940
 {
1941 1941
 
1942
-    if (!get_option('geodir_set_post_attachments')) {
1942
+	if (!get_option('geodir_set_post_attachments')) {
1943 1943
 
1944
-        require_once(ABSPATH . 'wp-admin/includes/image.php');
1945
-        require_once(ABSPATH . 'wp-admin/includes/file.php');
1944
+		require_once(ABSPATH . 'wp-admin/includes/image.php');
1945
+		require_once(ABSPATH . 'wp-admin/includes/file.php');
1946 1946
 
1947
-        $all_postypes = geodir_get_posttypes();
1947
+		$all_postypes = geodir_get_posttypes();
1948 1948
 
1949
-        foreach($all_postypes as $post_type){
1950
-            $args = array(
1951
-                'posts_per_page' => -1,
1952
-                'post_type' => $post_type,
1953
-                'post_status' => 'publish');
1949
+		foreach($all_postypes as $post_type){
1950
+			$args = array(
1951
+				'posts_per_page' => -1,
1952
+				'post_type' => $post_type,
1953
+				'post_status' => 'publish');
1954 1954
 
1955
-            $posts_array = get_posts($args);
1955
+			$posts_array = get_posts($args);
1956 1956
 
1957
-            if (!empty($posts_array)) {
1957
+			if (!empty($posts_array)) {
1958 1958
 
1959
-                foreach ($posts_array as $post) {
1959
+				foreach ($posts_array as $post) {
1960 1960
 
1961
-                    geodir_set_wp_featured_image($post->ID);
1961
+					geodir_set_wp_featured_image($post->ID);
1962 1962
 
1963
-                }
1963
+				}
1964 1964
 
1965
-            }
1966
-        }
1965
+			}
1966
+		}
1967 1967
 
1968 1968
 
1969
-        update_option('geodir_set_post_attachments', '1');
1969
+		update_option('geodir_set_post_attachments', '1');
1970 1970
 
1971
-    }
1971
+	}
1972 1972
 
1973 1973
 }
1974 1974
 
@@ -1985,19 +1985,19 @@  discard block
 block discarded – undo
1985 1985
 function geodir_remove_url_seperator()
1986 1986
 {
1987 1987
 
1988
-    if (!get_option('geodir_remove_url_seperator')) {
1988
+	if (!get_option('geodir_remove_url_seperator')) {
1989 1989
 
1990
-        if (get_option('geodir_listingurl_separator'))
1991
-            delete_option('geodir_listingurl_separator');
1990
+		if (get_option('geodir_listingurl_separator'))
1991
+			delete_option('geodir_listingurl_separator');
1992 1992
 
1993
-        if (get_option('geodir_detailurl_separator'))
1994
-            delete_option('geodir_detailurl_separator');
1993
+		if (get_option('geodir_detailurl_separator'))
1994
+			delete_option('geodir_detailurl_separator');
1995 1995
 
1996
-        flush_rewrite_rules(false);
1996
+		flush_rewrite_rules(false);
1997 1997
 
1998
-        update_option('geodir_remove_url_seperator', '1');
1998
+		update_option('geodir_remove_url_seperator', '1');
1999 1999
 
2000
-    }
2000
+	}
2001 2001
 
2002 2002
 }
2003 2003
 
@@ -2013,19 +2013,19 @@  discard block
 block discarded – undo
2013 2013
  */
2014 2014
 function geodir_remove_url_seperator_form_permalink_settings($permalink_arr)
2015 2015
 {
2016
-    foreach ($permalink_arr as $key => $value) {
2016
+	foreach ($permalink_arr as $key => $value) {
2017 2017
 
2018
-        if ($value['id'] == 'geodir_listingurl_separator' || $value['id'] == 'geodir_detailurl_separator')
2019
-            unset($permalink_arr[$key]);
2018
+		if ($value['id'] == 'geodir_listingurl_separator' || $value['id'] == 'geodir_detailurl_separator')
2019
+			unset($permalink_arr[$key]);
2020 2020
 
2021
-    }
2021
+	}
2022 2022
 
2023
-    return $permalink_arr;
2023
+	return $permalink_arr;
2024 2024
 
2025 2025
 }
2026 2026
 
2027 2027
 if (!is_admin()) {
2028
-    add_filter('posts_results', 'geodir_set_status_draft_to_publish_for_own_post');
2028
+	add_filter('posts_results', 'geodir_set_status_draft_to_publish_for_own_post');
2029 2029
 }
2030 2030
 /**
2031 2031
  * Set status from draft to publish.
@@ -2038,16 +2038,16 @@  discard block
 block discarded – undo
2038 2038
  */
2039 2039
 function geodir_set_status_draft_to_publish_for_own_post($post)
2040 2040
 {
2041
-    $user_id = get_current_user_id();
2041
+	$user_id = get_current_user_id();
2042 2042
 
2043
-    if(!$user_id){return $post;}
2043
+	if(!$user_id){return $post;}
2044 2044
 
2045
-    $gd_post_types = geodir_get_posttypes();
2045
+	$gd_post_types = geodir_get_posttypes();
2046 2046
 
2047
-    if (!empty($post) && $post[0]->post_author == $user_id && in_array($post[0]->post_type, $gd_post_types) && !isset($_REQUEST['fl_builder'])) {
2048
-        $post[0]->post_status = 'publish';
2049
-    }
2050
-    return $post;
2047
+	if (!empty($post) && $post[0]->post_author == $user_id && in_array($post[0]->post_type, $gd_post_types) && !isset($_REQUEST['fl_builder'])) {
2048
+		$post[0]->post_status = 'publish';
2049
+	}
2050
+	return $post;
2051 2051
 }
2052 2052
 
2053 2053
 
@@ -2139,33 +2139,33 @@  discard block
 block discarded – undo
2139 2139
  */
2140 2140
 function geodir_detail_page_tab_headings_change($tabs_arr)
2141 2141
 {
2142
-    global $wpdb;
2142
+	global $wpdb;
2143 2143
 
2144
-    $post_type = geodir_get_current_posttype();
2144
+	$post_type = geodir_get_current_posttype();
2145 2145
 
2146
-    $all_postypes = geodir_get_posttypes();
2146
+	$all_postypes = geodir_get_posttypes();
2147 2147
 
2148
-    if (!empty($tabs_arr) && $post_type != '' && in_array($post_type, $all_postypes)) {
2148
+	if (!empty($tabs_arr) && $post_type != '' && in_array($post_type, $all_postypes)) {
2149 2149
 
2150
-        if (array_key_exists('post_video', $tabs_arr)) {
2150
+		if (array_key_exists('post_video', $tabs_arr)) {
2151 2151
 
2152
-            $field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_video', $post_type)));
2152
+			$field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_video', $post_type)));
2153 2153
 
2154
-            if (isset($tabs_arr['post_video']['heading_text']) && $field_title != '')
2155
-                $tabs_arr['post_video']['heading_text'] = $field_title;
2156
-        }
2154
+			if (isset($tabs_arr['post_video']['heading_text']) && $field_title != '')
2155
+				$tabs_arr['post_video']['heading_text'] = $field_title;
2156
+		}
2157 2157
 
2158
-        if (array_key_exists('special_offers', $tabs_arr)) {
2158
+		if (array_key_exists('special_offers', $tabs_arr)) {
2159 2159
 
2160
-            $field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_special_offers', $post_type)));
2160
+			$field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_special_offers', $post_type)));
2161 2161
 
2162
-            if (isset($tabs_arr['special_offers']['heading_text']) && $field_title != '')
2163
-                $tabs_arr['special_offers']['heading_text'] = $field_title;
2164
-        }
2162
+			if (isset($tabs_arr['special_offers']['heading_text']) && $field_title != '')
2163
+				$tabs_arr['special_offers']['heading_text'] = $field_title;
2164
+		}
2165 2165
 
2166
-    }
2166
+	}
2167 2167
 
2168
-    return $tabs_arr;
2168
+	return $tabs_arr;
2169 2169
 
2170 2170
 }
2171 2171
 
@@ -2178,10 +2178,10 @@  discard block
 block discarded – undo
2178 2178
  */
2179 2179
 function geodir_remove_template_redirect_actions()
2180 2180
 {
2181
-    if (geodir_is_page('login')){
2182
-        remove_all_actions('template_redirect');
2183
-        remove_action('init', 'avia_modify_front', 10);
2184
-    }
2181
+	if (geodir_is_page('login')){
2182
+		remove_all_actions('template_redirect');
2183
+		remove_action('init', 'avia_modify_front', 10);
2184
+	}
2185 2185
 }
2186 2186
 
2187 2187
 
@@ -2203,51 +2203,51 @@  discard block
 block discarded – undo
2203 2203
 function geodirectory_before_featured_image_delete($attachment_id)
2204 2204
 {
2205 2205
 
2206
-    global $wpdb, $plugin_prefix;
2206
+	global $wpdb, $plugin_prefix;
2207 2207
 
2208
-    $post_id = get_post_field('post_parent', $attachment_id);
2208
+	$post_id = get_post_field('post_parent', $attachment_id);
2209 2209
 
2210
-    $attachment_url = wp_get_attachment_url($attachment_id);
2210
+	$attachment_url = wp_get_attachment_url($attachment_id);
2211 2211
 
2212
-    if ($post_id > 0 && (isset($_REQUEST['action']) && $_REQUEST['action'] == 'delete')) {
2212
+	if ($post_id > 0 && (isset($_REQUEST['action']) && $_REQUEST['action'] == 'delete')) {
2213 2213
 
2214
-        $post_type = get_post_type($post_id);
2214
+		$post_type = get_post_type($post_id);
2215 2215
 
2216
-        $all_postypes = geodir_get_posttypes();
2216
+		$all_postypes = geodir_get_posttypes();
2217 2217
 
2218
-        if (!in_array($post_type, $all_postypes) || !is_admin())
2219
-            return false;
2218
+		if (!in_array($post_type, $all_postypes) || !is_admin())
2219
+			return false;
2220 2220
 
2221
-        $uploads = wp_upload_dir();
2221
+		$uploads = wp_upload_dir();
2222 2222
 
2223
-        $split_img_path = explode($uploads['baseurl'], $attachment_url);
2223
+		$split_img_path = explode($uploads['baseurl'], $attachment_url);
2224 2224
 
2225
-        $split_img_file_path = isset($split_img_path[1]) ? $split_img_path[1] : '';
2225
+		$split_img_file_path = isset($split_img_path[1]) ? $split_img_path[1] : '';
2226 2226
 
2227
-        $wpdb->query(
2228
-            $wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = %d AND file=%s ",
2229
-                array($post_id, $split_img_file_path)
2230
-            )
2231
-        );
2227
+		$wpdb->query(
2228
+			$wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = %d AND file=%s ",
2229
+				array($post_id, $split_img_file_path)
2230
+			)
2231
+		);
2232 2232
 
2233
-        $attachment_data = $wpdb->get_row(
2234
-            $wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=%d",
2235
-                array($post_id)
2236
-            )
2237
-        );
2233
+		$attachment_data = $wpdb->get_row(
2234
+			$wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=%d",
2235
+				array($post_id)
2236
+			)
2237
+		);
2238 2238
 
2239
-        if (!empty($attachment_data)) {
2240
-            $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2241
-        }
2239
+		if (!empty($attachment_data)) {
2240
+			$wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2241
+		}
2242 2242
 
2243 2243
 
2244
-        $table_name = $plugin_prefix . $post_type . '_detail';
2244
+		$table_name = $plugin_prefix . $post_type . '_detail';
2245 2245
 
2246
-        $wpdb->query("UPDATE " . $table_name . " SET featured_image='' WHERE post_id =" . $post_id);
2246
+		$wpdb->query("UPDATE " . $table_name . " SET featured_image='' WHERE post_id =" . $post_id);
2247 2247
 
2248
-        geodir_set_wp_featured_image($post_id);
2248
+		geodir_set_wp_featured_image($post_id);
2249 2249
 
2250
-    }
2250
+	}
2251 2251
 
2252 2252
 }
2253 2253
 
@@ -2265,79 +2265,79 @@  discard block
 block discarded – undo
2265 2265
 function geodir_temp_set_post_attachment()
2266 2266
 {
2267 2267
 
2268
-    global $wpdb, $plugin_prefix;
2268
+	global $wpdb, $plugin_prefix;
2269 2269
 
2270
-    $all_postypes = geodir_get_posttypes();
2270
+	$all_postypes = geodir_get_posttypes();
2271 2271
 
2272
-    foreach ($all_postypes as $posttype) {
2272
+	foreach ($all_postypes as $posttype) {
2273 2273
 
2274
-        $tablename = $plugin_prefix . $posttype . '_detail';
2274
+		$tablename = $plugin_prefix . $posttype . '_detail';
2275 2275
 
2276
-        $get_post_data = $wpdb->get_results("SELECT post_id FROM " . $tablename);
2276
+		$get_post_data = $wpdb->get_results("SELECT post_id FROM " . $tablename);
2277 2277
 
2278
-        if (!empty($get_post_data)) {
2278
+		if (!empty($get_post_data)) {
2279 2279
 
2280
-            foreach ($get_post_data as $data) {
2280
+			foreach ($get_post_data as $data) {
2281 2281
 
2282
-                $post_id = $data->post_id;
2282
+				$post_id = $data->post_id;
2283 2283
 
2284
-                $attachment_data = $wpdb->get_results("SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id =" . $post_id . " AND file!=''");
2284
+				$attachment_data = $wpdb->get_results("SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id =" . $post_id . " AND file!=''");
2285 2285
 
2286
-                if (!empty($attachment_data)) {
2286
+				if (!empty($attachment_data)) {
2287 2287
 
2288
-                    foreach ($attachment_data as $attach) {
2288
+					foreach ($attachment_data as $attach) {
2289 2289
 
2290
-                        $file_info = pathinfo($attach->file);
2290
+						$file_info = pathinfo($attach->file);
2291 2291
 
2292
-                        $sub_dir = '';
2293
-                        if ($file_info['dirname'] != '.' && $file_info['dirname'] != '..')
2294
-                            $sub_dir = stripslashes_deep($file_info['dirname']);
2292
+						$sub_dir = '';
2293
+						if ($file_info['dirname'] != '.' && $file_info['dirname'] != '..')
2294
+							$sub_dir = stripslashes_deep($file_info['dirname']);
2295 2295
 
2296
-                        $uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs
2297
-                        $uploads_path = $uploads['basedir'];
2296
+						$uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs
2297
+						$uploads_path = $uploads['basedir'];
2298 2298
 
2299
-                        $file_name = $file_info['basename'];
2299
+						$file_name = $file_info['basename'];
2300 2300
 
2301
-                        $img_arr['path'] = $uploads_path . $sub_dir . '/' . $file_name;
2301
+						$img_arr['path'] = $uploads_path . $sub_dir . '/' . $file_name;
2302 2302
 
2303
-                        if (!file_exists($img_arr['path'])) {
2303
+						if (!file_exists($img_arr['path'])) {
2304 2304
 
2305
-                            $wpdb->query("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE ID=" . $attach->ID);
2305
+							$wpdb->query("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE ID=" . $attach->ID);
2306 2306
 
2307
-                        }
2307
+						}
2308 2308
 
2309
-                    }
2309
+					}
2310 2310
 
2311
-                    $attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=" . $post_id . " GROUP BY post_id");
2311
+					$attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=" . $post_id . " GROUP BY post_id");
2312 2312
 
2313
-                    if (!empty($attachment_data)) {
2313
+					if (!empty($attachment_data)) {
2314 2314
 
2315
-                        if ($attachment_data->ID)
2316
-                            $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2315
+						if ($attachment_data->ID)
2316
+							$wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2317 2317
 
2318
-                    } else {
2318
+					} else {
2319 2319
 
2320
-                        if (has_post_thumbnail($post_id)) {
2320
+						if (has_post_thumbnail($post_id)) {
2321 2321
 
2322
-                            $post_thumbnail_id = get_post_thumbnail_id($post_id);
2322
+							$post_thumbnail_id = get_post_thumbnail_id($post_id);
2323 2323
 
2324
-                            wp_delete_attachment($post_thumbnail_id);
2324
+							wp_delete_attachment($post_thumbnail_id);
2325 2325
 
2326
-                        }
2326
+						}
2327 2327
 
2328
-                    }
2328
+					}
2329 2329
 
2330
-                    $wpdb->query("UPDATE " . $tablename . " SET featured_image='' WHERE post_id =" . $post_id);
2330
+					$wpdb->query("UPDATE " . $tablename . " SET featured_image='' WHERE post_id =" . $post_id);
2331 2331
 
2332
-                    geodir_set_wp_featured_image($post_id);
2332
+					geodir_set_wp_featured_image($post_id);
2333 2333
 
2334
-                }
2334
+				}
2335 2335
 
2336
-            }
2336
+			}
2337 2337
 
2338
-        }
2338
+		}
2339 2339
 
2340
-    }
2340
+	}
2341 2341
 
2342 2342
 }
2343 2343
 
@@ -2355,9 +2355,9 @@  discard block
 block discarded – undo
2355 2355
 function geodir_default_rating_star_icon()
2356 2356
 {
2357 2357
 
2358
-    if (!get_option('geodir_default_rating_star_icon')) {
2359
-        update_option('geodir_default_rating_star_icon', geodir_plugin_url() . '/geodirectory-assets/images/stars.png');
2360
-    }
2358
+	if (!get_option('geodir_default_rating_star_icon')) {
2359
+		update_option('geodir_default_rating_star_icon', geodir_plugin_url() . '/geodirectory-assets/images/stars.png');
2360
+	}
2361 2361
 
2362 2362
 }
2363 2363
 
@@ -2375,27 +2375,27 @@  discard block
 block discarded – undo
2375 2375
  */
2376 2376
 function geodir_user_post_listing_count($user_id=null)
2377 2377
 {
2378
-    global $wpdb, $plugin_prefix, $current_user;
2379
-    if(!$user_id){
2380
-        $user_id = $current_user->ID;
2381
-    }
2378
+	global $wpdb, $plugin_prefix, $current_user;
2379
+	if(!$user_id){
2380
+		$user_id = $current_user->ID;
2381
+	}
2382 2382
 
2383
-    $user_id = $current_user->ID;
2384
-    $all_postypes = geodir_get_posttypes();
2385
-    $all_posts = get_option('geodir_listing_link_user_dashboard');
2383
+	$user_id = $current_user->ID;
2384
+	$all_postypes = geodir_get_posttypes();
2385
+	$all_posts = get_option('geodir_listing_link_user_dashboard');
2386 2386
 
2387
-    $user_listing = array();
2388
-    if (is_array($all_posts) && !empty($all_posts)) {
2389
-        foreach ($all_posts as $ptype) {
2390
-            $total_posts = $wpdb->get_var("SELECT count( ID ) FROM " . $wpdb->prefix . "posts WHERE post_author=" . $user_id . " AND post_type='" . $ptype . "' AND ( post_status = 'publish' OR post_status = 'draft' OR post_status = 'private' )");
2387
+	$user_listing = array();
2388
+	if (is_array($all_posts) && !empty($all_posts)) {
2389
+		foreach ($all_posts as $ptype) {
2390
+			$total_posts = $wpdb->get_var("SELECT count( ID ) FROM " . $wpdb->prefix . "posts WHERE post_author=" . $user_id . " AND post_type='" . $ptype . "' AND ( post_status = 'publish' OR post_status = 'draft' OR post_status = 'private' )");
2391 2391
 
2392
-            if ($total_posts > 0) {
2393
-                $user_listing[$ptype] = $total_posts;
2394
-            }
2395
-        }
2396
-    }
2392
+			if ($total_posts > 0) {
2393
+				$user_listing[$ptype] = $total_posts;
2394
+			}
2395
+		}
2396
+	}
2397 2397
 
2398
-    return $user_listing;
2398
+	return $user_listing;
2399 2399
 }
2400 2400
 
2401 2401
 
@@ -2415,584 +2415,584 @@  discard block
 block discarded – undo
2415 2415
  */
2416 2416
 function geodir_detail_page_custom_field_tab($tabs_arr)
2417 2417
 {
2418
-    global $post;
2419
-
2420
-    $post_type = geodir_get_current_posttype();
2421
-    $all_postypes = geodir_get_posttypes();
2422
-
2423
-    if (!empty($tabs_arr) && $post_type != '' && in_array($post_type, $all_postypes) && (geodir_is_page('detail') || geodir_is_page('preview'))) {
2424
-        $package_info = array();
2425
-        $package_info = geodir_post_package_info($package_info, $post);
2426
-        $post_package_id = $package_info->pid;
2427
-        $fields_location = 'detail';
2428
-
2429
-        $custom_fields = geodir_post_custom_fields($post_package_id, 'default', $post_type, $fields_location);
2430
-        if (!empty($custom_fields)) {
2431
-            $parse_custom_fields = array();
2432
-            foreach ($custom_fields as $field) {
2433
-                $field = stripslashes_deep($field); // strip slashes
2418
+	global $post;
2419
+
2420
+	$post_type = geodir_get_current_posttype();
2421
+	$all_postypes = geodir_get_posttypes();
2422
+
2423
+	if (!empty($tabs_arr) && $post_type != '' && in_array($post_type, $all_postypes) && (geodir_is_page('detail') || geodir_is_page('preview'))) {
2424
+		$package_info = array();
2425
+		$package_info = geodir_post_package_info($package_info, $post);
2426
+		$post_package_id = $package_info->pid;
2427
+		$fields_location = 'detail';
2428
+
2429
+		$custom_fields = geodir_post_custom_fields($post_package_id, 'default', $post_type, $fields_location);
2430
+		if (!empty($custom_fields)) {
2431
+			$parse_custom_fields = array();
2432
+			foreach ($custom_fields as $field) {
2433
+				$field = stripslashes_deep($field); // strip slashes
2434 2434
                 
2435
-                $type = $field;
2436
-                $field_name = $field['htmlvar_name'];
2437
-                if (empty($geodir_post_info) && geodir_is_page('preview') && $field_name != '' && !isset($post->{$field_name}) && isset($_REQUEST[$field_name])) {
2438
-                    $post->{$field_name} = $_REQUEST[$field_name];
2439
-                }
2440
-
2441
-                if (isset($field['show_as_tab']) && $field['show_as_tab'] == 1 && ((isset($post->{$field_name}) && $post->{$field_name} != '') || $field['type'] == 'fieldset') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file'))) {
2442
-                    if ($type['type'] == 'datepicker' && ($post->{$type['htmlvar_name']} == '' || $post->{$type['htmlvar_name']} == '0000-00-00')) {
2443
-                        continue;
2444
-                    }
2445
-
2446
-                    $parse_custom_fields[] = $field;
2447
-                }
2448
-            }
2449
-            $custom_fields = $parse_custom_fields;
2450
-        }
2451
-
2452
-        if (!empty($custom_fields)) {
2453
-            $field_set_start = 0;
2454
-            $fieldset_count = 0;
2455
-            $fieldset = '';
2456
-            $total_fields = count($custom_fields);
2457
-            $count_field = 0;
2458
-            $fieldset_arr = array();
2459
-            $i = 0;
2460
-            $geodir_post_info = isset($post->ID) && !empty($post->ID) ? geodir_get_post_info($post->ID) : NULL;
2461
-
2462
-            foreach ($custom_fields as $field) {
2463
-                $count_field++;
2464
-                $field_name = $field['htmlvar_name'];
2465
-                if (empty($geodir_post_info) && geodir_is_page('preview') && $field_name != '' && !isset($post->{$field_name}) && isset($_REQUEST[$field_name])) {
2466
-                    $post->{$field_name} = $_REQUEST[$field_name];
2467
-                }
2468
-
2469
-                if (isset($field['show_as_tab']) && $field['show_as_tab'] == 1 && ((isset($post->{$field_name}) && $post->{$field_name} != '') || $field['type'] == 'fieldset') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file'))) {
2470
-                    $label = $field['site_title'] != '' ? $field['site_title'] : $field['admin_title'];
2471
-                    $site_title = trim($field['site_title']);
2472
-                    $type = $field;
2473
-                    $html = '';
2474
-                    $html_var = $field_name;
2475
-                    $field_icon = '';
2476
-                    $variables_array = array();
2477
-
2478
-                    if ($type['type'] == 'datepicker' && ($post->{$type['htmlvar_name']} == '' || $post->{$type['htmlvar_name']} == '0000-00-00')) {
2479
-                        continue;
2480
-                    }
2481
-
2482
-                    if ($type['type'] != 'fieldset') {
2483
-                        $i++;
2484
-                        $variables_array['post_id'] = $post->ID;
2485
-                        $variables_array['label'] = __($type['site_title'], 'geodirectory');
2486
-                        $variables_array['value'] = '';
2487
-                        $variables_array['value'] = $post->{$type['htmlvar_name']};
2488
-                    }
2489
-
2490
-                    if (strpos($type['field_icon'], 'http') !== false) {
2491
-                        $field_icon = ' background: url(' . $type['field_icon'] . ') no-repeat left center;background-size:18px 18px;padding-left: 21px;';
2492
-                    } elseif (strpos($type['field_icon'], 'fa fa-') !== false) {
2493
-                        $field_icon = '<i class="' . $type['field_icon'] . '"></i>';
2494
-                    }
2435
+				$type = $field;
2436
+				$field_name = $field['htmlvar_name'];
2437
+				if (empty($geodir_post_info) && geodir_is_page('preview') && $field_name != '' && !isset($post->{$field_name}) && isset($_REQUEST[$field_name])) {
2438
+					$post->{$field_name} = $_REQUEST[$field_name];
2439
+				}
2440
+
2441
+				if (isset($field['show_as_tab']) && $field['show_as_tab'] == 1 && ((isset($post->{$field_name}) && $post->{$field_name} != '') || $field['type'] == 'fieldset') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file'))) {
2442
+					if ($type['type'] == 'datepicker' && ($post->{$type['htmlvar_name']} == '' || $post->{$type['htmlvar_name']} == '0000-00-00')) {
2443
+						continue;
2444
+					}
2445
+
2446
+					$parse_custom_fields[] = $field;
2447
+				}
2448
+			}
2449
+			$custom_fields = $parse_custom_fields;
2450
+		}
2495 2451
 
2496
-                    switch ($type['type']) {
2497
-                        case 'fieldset': {
2498
-                            $i = 0;
2499
-                            $fieldset_count++;
2500
-                            $field_set_start = 1;
2501
-                            $fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_' . $fieldset_count;
2502
-                            $fieldset_arr[$fieldset_count]['label'] = $label;
2503
-                        }
2504
-                            break;
2505
-                        case 'url': {
2506
-                            if (strpos($field_icon, 'http') !== false) {
2507
-                                $field_icon_af = '';
2508
-                            } elseif ($field_icon == '') {
2509
-
2510
-                                if ($type['name'] == 'geodir_facebook') {
2511
-                                    $field_icon_af = '<i class="fa fa-facebook-square"></i>';
2512
-                                } elseif ($type['name'] == 'geodir_twitter') {
2513
-                                    $field_icon_af = '<i class="fa fa-twitter-square"></i>';
2514
-                                } else {
2515
-                                    $field_icon_af = '<i class="fa fa-link"></i>';
2516
-                                }
2517
-
2518
-                            } else {
2519
-                                $field_icon_af = $field_icon;
2520
-                                $field_icon = '';
2521
-                            }
2452
+		if (!empty($custom_fields)) {
2453
+			$field_set_start = 0;
2454
+			$fieldset_count = 0;
2455
+			$fieldset = '';
2456
+			$total_fields = count($custom_fields);
2457
+			$count_field = 0;
2458
+			$fieldset_arr = array();
2459
+			$i = 0;
2460
+			$geodir_post_info = isset($post->ID) && !empty($post->ID) ? geodir_get_post_info($post->ID) : NULL;
2461
+
2462
+			foreach ($custom_fields as $field) {
2463
+				$count_field++;
2464
+				$field_name = $field['htmlvar_name'];
2465
+				if (empty($geodir_post_info) && geodir_is_page('preview') && $field_name != '' && !isset($post->{$field_name}) && isset($_REQUEST[$field_name])) {
2466
+					$post->{$field_name} = $_REQUEST[$field_name];
2467
+				}
2468
+
2469
+				if (isset($field['show_as_tab']) && $field['show_as_tab'] == 1 && ((isset($post->{$field_name}) && $post->{$field_name} != '') || $field['type'] == 'fieldset') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file'))) {
2470
+					$label = $field['site_title'] != '' ? $field['site_title'] : $field['admin_title'];
2471
+					$site_title = trim($field['site_title']);
2472
+					$type = $field;
2473
+					$html = '';
2474
+					$html_var = $field_name;
2475
+					$field_icon = '';
2476
+					$variables_array = array();
2477
+
2478
+					if ($type['type'] == 'datepicker' && ($post->{$type['htmlvar_name']} == '' || $post->{$type['htmlvar_name']} == '0000-00-00')) {
2479
+						continue;
2480
+					}
2481
+
2482
+					if ($type['type'] != 'fieldset') {
2483
+						$i++;
2484
+						$variables_array['post_id'] = $post->ID;
2485
+						$variables_array['label'] = __($type['site_title'], 'geodirectory');
2486
+						$variables_array['value'] = '';
2487
+						$variables_array['value'] = $post->{$type['htmlvar_name']};
2488
+					}
2489
+
2490
+					if (strpos($type['field_icon'], 'http') !== false) {
2491
+						$field_icon = ' background: url(' . $type['field_icon'] . ') no-repeat left center;background-size:18px 18px;padding-left: 21px;';
2492
+					} elseif (strpos($type['field_icon'], 'fa fa-') !== false) {
2493
+						$field_icon = '<i class="' . $type['field_icon'] . '"></i>';
2494
+					}
2495
+
2496
+					switch ($type['type']) {
2497
+						case 'fieldset': {
2498
+							$i = 0;
2499
+							$fieldset_count++;
2500
+							$field_set_start = 1;
2501
+							$fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_' . $fieldset_count;
2502
+							$fieldset_arr[$fieldset_count]['label'] = $label;
2503
+						}
2504
+							break;
2505
+						case 'url': {
2506
+							if (strpos($field_icon, 'http') !== false) {
2507
+								$field_icon_af = '';
2508
+							} elseif ($field_icon == '') {
2509
+
2510
+								if ($type['name'] == 'geodir_facebook') {
2511
+									$field_icon_af = '<i class="fa fa-facebook-square"></i>';
2512
+								} elseif ($type['name'] == 'geodir_twitter') {
2513
+									$field_icon_af = '<i class="fa fa-twitter-square"></i>';
2514
+								} else {
2515
+									$field_icon_af = '<i class="fa fa-link"></i>';
2516
+								}
2517
+
2518
+							} else {
2519
+								$field_icon_af = $field_icon;
2520
+								$field_icon = '';
2521
+							}
2522 2522
                             
2523
-                            $a_url = geodir_parse_custom_field_url($post->{$type['htmlvar_name']});
2524
-
2525
-                            $website = !empty($a_url['url']) ? $a_url['url'] : '';
2526
-                            $title = !empty($a_url['label']) ? $a_url['label'] : $type['site_title'];
2527
-                            $title = $title != '' ? __(stripslashes($title), 'geodirectory') : '';
2528
-
2529
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2530
-
2531
-                            // all search engines that use the nofollow value exclude links that use it from their ranking calculation
2532
-                            $rel = strpos($website, get_site_url()) !== false ? '' : 'rel="nofollow"';
2533
-
2534
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '"><span class="geodir-i-website" style="' . $field_icon . '">' . $field_icon_af . ' <a href="' . $website . '" target="_blank" ' . $rel . ' ><strong>' .
2535
-                                /**
2536
-                                 * Filer the custom field website name.
2537
-                                 *
2538
-                                 * @since 1.0.0
2539
-                                 * @param string $title The field name default: "Website".
2540
-                                 * @param string $website The website address.
2541
-                                 * @param int $post->ID The post ID.
2542
-                                 */
2543
-                                apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID) . '</strong></a></span></div>';
2544
-                        }
2545
-                            break;
2546
-                        case 'phone': {
2547
-                            if (strpos($field_icon, 'http') !== false) {
2548
-                                $field_icon_af = '';
2549
-                            } elseif ($field_icon == '') {
2550
-                                $field_icon_af = '<i class="fa fa-phone"></i>';
2551
-                            } else {
2552
-                                $field_icon_af = $field_icon;
2553
-                                $field_icon = '';
2554
-                            }
2555
-
2556
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2557
-
2558
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-contact" style="' . $field_icon . '">' . $field_icon_af;
2559
-                            if ($field_set_start == 1 && $site_title != '') {
2560
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2561
-                            }
2562
-                            $html .= ' </span>' . stripslashes($post->{$type['htmlvar_name']}) . '</div>';
2563
-                        }
2564
-                            break;
2565
-                        case 'time': {
2566
-                            $value = '';
2567
-                            if ($post->{$type['htmlvar_name']} != '')
2568
-                                $value = date_i18n(get_option('time_format'), strtotime($post->{$type['htmlvar_name']}));
2569
-
2570
-                            if (strpos($field_icon, 'http') !== false) {
2571
-                                $field_icon_af = '';
2572
-                            } elseif ($field_icon == '') {
2573
-                                $field_icon_af = '<i class="fa fa-clock-o"></i>';
2574
-                            } else {
2575
-                                $field_icon_af = $field_icon;
2576
-                                $field_icon = '';
2577
-                            }
2578
-
2579
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2580
-
2581
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-time" style="' . $field_icon . '">' . $field_icon_af;
2582
-                            if ($field_set_start == 1 && $site_title != '') {
2583
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2584
-                            }
2585
-                            $html .= ' </span>' . stripslashes($value) . '</div>';
2586
-                        }
2587
-                            break;
2588
-                        case 'datepicker': {
2589
-                            $date_format = geodir_default_date_format();
2590
-                            if ($type['extra_fields'] != '') {
2591
-                                $date_format = unserialize($type['extra_fields']);
2592
-                                $date_format = $date_format['date_format'];
2593
-                            }
2594
-
2595
-                            $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
2596
-                            $replace = array('d','j','l','m','n','F','Y');//PHP date format
2597
-
2598
-                            $date_format = str_replace($search, $replace, $date_format);
2599
-
2600
-                            $post_htmlvar_value = $date_format == 'd/m/Y' ? str_replace('/', '-', $post->{$type['htmlvar_name']}) : $post->{$type['htmlvar_name']}; // PHP doesn't work well with dd/mm/yyyy format
2601
-
2602
-                            $value = '';
2603
-                            if ($post->{$type['htmlvar_name']} != '')
2604
-                                $value = date($date_format, strtotime($post_htmlvar_value));
2605
-
2606
-                            if (strpos($field_icon, 'http') !== false) {
2607
-                                $field_icon_af = '';
2608
-                            } elseif ($field_icon == '') {
2609
-                                $field_icon_af = '<i class="fa fa-calendar"></i>';
2610
-                            } else {
2611
-                                $field_icon_af = $field_icon;
2612
-                                $field_icon = '';
2613
-                            }
2614
-
2615
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2616
-
2617
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-datepicker" style="' . $field_icon . '">' . $field_icon_af;
2618
-                            if ($field_set_start == 1 && $site_title != '') {
2619
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2620
-                            }
2621
-                            $html .= ' </span>' . $value . '</div>';
2622
-                        }
2623
-                            break;
2624
-                        case 'text': {
2625
-                            if (strpos($field_icon, 'http') !== false) {
2626
-                                $field_icon_af = '';
2627
-                            } elseif ($field_icon == '') {
2628
-                                $field_icon_af = '';
2629
-                            } else {
2630
-                                $field_icon_af = $field_icon;
2631
-                                $field_icon = '';
2632
-                            }
2633
-
2634
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2635
-
2636
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
2637
-                            if ($field_set_start == 1 && $site_title != '') {
2638
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2639
-                            }
2640
-                            $html .= ' </span>' . stripslashes($post->{$type['htmlvar_name']}) . '</div>';
2641
-                        }
2642
-                            break;
2643
-                        case 'radio': {
2644
-
2645
-                            if ($post->{$type['htmlvar_name']} != '') {
2646
-                                if ($post->{$type['htmlvar_name']} == 'f' || $post->{$type['htmlvar_name']} == '0') {
2647
-                                    $html_val = __('No', 'geodirectory');
2648
-                                } else if ($post->{$type['htmlvar_name']} == 't' || $post->{$type['htmlvar_name']} == '1') {
2649
-                                    $html_val = __('Yes', 'geodirectory');
2650
-                                } else {
2651
-                                    $html_val = __($post->{$type['htmlvar_name']}, 'geodirectory');
2523
+							$a_url = geodir_parse_custom_field_url($post->{$type['htmlvar_name']});
2524
+
2525
+							$website = !empty($a_url['url']) ? $a_url['url'] : '';
2526
+							$title = !empty($a_url['label']) ? $a_url['label'] : $type['site_title'];
2527
+							$title = $title != '' ? __(stripslashes($title), 'geodirectory') : '';
2528
+
2529
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2530
+
2531
+							// all search engines that use the nofollow value exclude links that use it from their ranking calculation
2532
+							$rel = strpos($website, get_site_url()) !== false ? '' : 'rel="nofollow"';
2533
+
2534
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '"><span class="geodir-i-website" style="' . $field_icon . '">' . $field_icon_af . ' <a href="' . $website . '" target="_blank" ' . $rel . ' ><strong>' .
2535
+								/**
2536
+								 * Filer the custom field website name.
2537
+								 *
2538
+								 * @since 1.0.0
2539
+								 * @param string $title The field name default: "Website".
2540
+								 * @param string $website The website address.
2541
+								 * @param int $post->ID The post ID.
2542
+								 */
2543
+								apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID) . '</strong></a></span></div>';
2544
+						}
2545
+							break;
2546
+						case 'phone': {
2547
+							if (strpos($field_icon, 'http') !== false) {
2548
+								$field_icon_af = '';
2549
+							} elseif ($field_icon == '') {
2550
+								$field_icon_af = '<i class="fa fa-phone"></i>';
2551
+							} else {
2552
+								$field_icon_af = $field_icon;
2553
+								$field_icon = '';
2554
+							}
2555
+
2556
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2557
+
2558
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-contact" style="' . $field_icon . '">' . $field_icon_af;
2559
+							if ($field_set_start == 1 && $site_title != '') {
2560
+								$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2561
+							}
2562
+							$html .= ' </span>' . stripslashes($post->{$type['htmlvar_name']}) . '</div>';
2563
+						}
2564
+							break;
2565
+						case 'time': {
2566
+							$value = '';
2567
+							if ($post->{$type['htmlvar_name']} != '')
2568
+								$value = date_i18n(get_option('time_format'), strtotime($post->{$type['htmlvar_name']}));
2569
+
2570
+							if (strpos($field_icon, 'http') !== false) {
2571
+								$field_icon_af = '';
2572
+							} elseif ($field_icon == '') {
2573
+								$field_icon_af = '<i class="fa fa-clock-o"></i>';
2574
+							} else {
2575
+								$field_icon_af = $field_icon;
2576
+								$field_icon = '';
2577
+							}
2578
+
2579
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2580
+
2581
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-time" style="' . $field_icon . '">' . $field_icon_af;
2582
+							if ($field_set_start == 1 && $site_title != '') {
2583
+								$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2584
+							}
2585
+							$html .= ' </span>' . stripslashes($value) . '</div>';
2586
+						}
2587
+							break;
2588
+						case 'datepicker': {
2589
+							$date_format = geodir_default_date_format();
2590
+							if ($type['extra_fields'] != '') {
2591
+								$date_format = unserialize($type['extra_fields']);
2592
+								$date_format = $date_format['date_format'];
2593
+							}
2594
+
2595
+							$search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
2596
+							$replace = array('d','j','l','m','n','F','Y');//PHP date format
2597
+
2598
+							$date_format = str_replace($search, $replace, $date_format);
2599
+
2600
+							$post_htmlvar_value = $date_format == 'd/m/Y' ? str_replace('/', '-', $post->{$type['htmlvar_name']}) : $post->{$type['htmlvar_name']}; // PHP doesn't work well with dd/mm/yyyy format
2601
+
2602
+							$value = '';
2603
+							if ($post->{$type['htmlvar_name']} != '')
2604
+								$value = date($date_format, strtotime($post_htmlvar_value));
2605
+
2606
+							if (strpos($field_icon, 'http') !== false) {
2607
+								$field_icon_af = '';
2608
+							} elseif ($field_icon == '') {
2609
+								$field_icon_af = '<i class="fa fa-calendar"></i>';
2610
+							} else {
2611
+								$field_icon_af = $field_icon;
2612
+								$field_icon = '';
2613
+							}
2614
+
2615
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2616
+
2617
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-datepicker" style="' . $field_icon . '">' . $field_icon_af;
2618
+							if ($field_set_start == 1 && $site_title != '') {
2619
+								$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2620
+							}
2621
+							$html .= ' </span>' . $value . '</div>';
2622
+						}
2623
+							break;
2624
+						case 'text': {
2625
+							if (strpos($field_icon, 'http') !== false) {
2626
+								$field_icon_af = '';
2627
+							} elseif ($field_icon == '') {
2628
+								$field_icon_af = '';
2629
+							} else {
2630
+								$field_icon_af = $field_icon;
2631
+								$field_icon = '';
2632
+							}
2633
+
2634
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2635
+
2636
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
2637
+							if ($field_set_start == 1 && $site_title != '') {
2638
+								$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2639
+							}
2640
+							$html .= ' </span>' . stripslashes($post->{$type['htmlvar_name']}) . '</div>';
2641
+						}
2642
+							break;
2643
+						case 'radio': {
2644
+
2645
+							if ($post->{$type['htmlvar_name']} != '') {
2646
+								if ($post->{$type['htmlvar_name']} == 'f' || $post->{$type['htmlvar_name']} == '0') {
2647
+									$html_val = __('No', 'geodirectory');
2648
+								} else if ($post->{$type['htmlvar_name']} == 't' || $post->{$type['htmlvar_name']} == '1') {
2649
+									$html_val = __('Yes', 'geodirectory');
2650
+								} else {
2651
+									$html_val = __($post->{$type['htmlvar_name']}, 'geodirectory');
2652 2652
                                     
2653
-                                    if (!empty($type['option_values'])) {
2654
-                                        $cf_option_values = geodir_string_values_to_options(stripslashes_deep($type['option_values']), true);
2653
+									if (!empty($type['option_values'])) {
2654
+										$cf_option_values = geodir_string_values_to_options(stripslashes_deep($type['option_values']), true);
2655 2655
                                         
2656
-                                        if (!empty($cf_option_values)) {
2657
-                                            foreach ($cf_option_values as $cf_option_value) {
2658
-                                                if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->{$type['htmlvar_name']}) {
2659
-                                                    $html_val = $cf_option_value['label'];
2660
-                                                }
2661
-                                            }
2662
-                                        }
2663
-                                    }
2664
-                                }
2665
-
2666
-                                if (strpos($field_icon, 'http') !== false) {
2667
-                                    $field_icon_af = '';
2668
-                                } else if ($field_icon == '') {
2669
-                                    $field_icon_af = '';
2670
-                                } else {
2671
-                                    $field_icon_af = $field_icon;
2672
-                                    $field_icon = '';
2673
-                                }
2674
-
2675
-                                $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2676
-
2677
-                                $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-radio" style="' . $field_icon . '">' . $field_icon_af;
2678
-
2679
-                                if ($field_set_start == 1 && $site_title != '') {
2680
-                                    $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2681
-                                }
2682
-
2683
-                                $html .= ' </span>' . $html_val . '</div>';
2684
-                            }
2685
-                        }
2686
-                            break;
2687
-                        case 'checkbox': {
2688
-                            $html_var = $type['htmlvar_name'];
2689
-                            $html_val = $type['htmlvar_name'];
2690
-
2691
-                            if ((int)$post->{$html_var} == 1) {
2692
-
2693
-                                if ($post->{$type['htmlvar_name']} == '1') {
2694
-                                    $html_val = __('Yes', 'geodirectory');
2695
-                                } else {
2696
-                                    $html_val = __('No', 'geodirectory');
2697
-                                }
2698
-
2699
-                                if (strpos($field_icon, 'http') !== false) {
2700
-                                    $field_icon_af = '';
2701
-                                } else if ($field_icon == '') {
2702
-                                    $field_icon_af = '';
2703
-                                } else {
2704
-                                    $field_icon_af = $field_icon;
2705
-                                    $field_icon = '';
2706
-                                }
2707
-
2708
-                                $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2709
-
2710
-                                $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-checkbox" style="' . $field_icon . '">' . $field_icon_af;
2711
-
2712
-                                if ($field_set_start == 1 && $site_title != '') {
2713
-                                    $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2714
-                                }
2715
-
2716
-                                $html .= ' </span>' . $html_val . '</div>';
2717
-                            }
2718
-                        }
2719
-                            break;
2720
-                        case 'select': {
2721
-                            if (strpos($field_icon, 'http') !== false) {
2722
-                                $field_icon_af = '';
2723
-                            } elseif ($field_icon == '') {
2724
-                                $field_icon_af = '';
2725
-                            } else {
2726
-                                $field_icon_af = $field_icon;
2727
-                                $field_icon = '';
2728
-                            }
2656
+										if (!empty($cf_option_values)) {
2657
+											foreach ($cf_option_values as $cf_option_value) {
2658
+												if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->{$type['htmlvar_name']}) {
2659
+													$html_val = $cf_option_value['label'];
2660
+												}
2661
+											}
2662
+										}
2663
+									}
2664
+								}
2665
+
2666
+								if (strpos($field_icon, 'http') !== false) {
2667
+									$field_icon_af = '';
2668
+								} else if ($field_icon == '') {
2669
+									$field_icon_af = '';
2670
+								} else {
2671
+									$field_icon_af = $field_icon;
2672
+									$field_icon = '';
2673
+								}
2674
+
2675
+								$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2676
+
2677
+								$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-radio" style="' . $field_icon . '">' . $field_icon_af;
2678
+
2679
+								if ($field_set_start == 1 && $site_title != '') {
2680
+									$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2681
+								}
2682
+
2683
+								$html .= ' </span>' . $html_val . '</div>';
2684
+							}
2685
+						}
2686
+							break;
2687
+						case 'checkbox': {
2688
+							$html_var = $type['htmlvar_name'];
2689
+							$html_val = $type['htmlvar_name'];
2690
+
2691
+							if ((int)$post->{$html_var} == 1) {
2692
+
2693
+								if ($post->{$type['htmlvar_name']} == '1') {
2694
+									$html_val = __('Yes', 'geodirectory');
2695
+								} else {
2696
+									$html_val = __('No', 'geodirectory');
2697
+								}
2698
+
2699
+								if (strpos($field_icon, 'http') !== false) {
2700
+									$field_icon_af = '';
2701
+								} else if ($field_icon == '') {
2702
+									$field_icon_af = '';
2703
+								} else {
2704
+									$field_icon_af = $field_icon;
2705
+									$field_icon = '';
2706
+								}
2707
+
2708
+								$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2709
+
2710
+								$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-checkbox" style="' . $field_icon . '">' . $field_icon_af;
2711
+
2712
+								if ($field_set_start == 1 && $site_title != '') {
2713
+									$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2714
+								}
2715
+
2716
+								$html .= ' </span>' . $html_val . '</div>';
2717
+							}
2718
+						}
2719
+							break;
2720
+						case 'select': {
2721
+							if (strpos($field_icon, 'http') !== false) {
2722
+								$field_icon_af = '';
2723
+							} elseif ($field_icon == '') {
2724
+								$field_icon_af = '';
2725
+							} else {
2726
+								$field_icon_af = $field_icon;
2727
+								$field_icon = '';
2728
+							}
2729 2729
                             
2730
-                            $field_value = __($post->{$type['htmlvar_name']}, 'geodirectory');
2730
+							$field_value = __($post->{$type['htmlvar_name']}, 'geodirectory');
2731 2731
                             
2732
-                            if (!empty($type['option_values'])) {
2733
-                                $cf_option_values = geodir_string_values_to_options(stripslashes_deep($type['option_values']), true);
2732
+							if (!empty($type['option_values'])) {
2733
+								$cf_option_values = geodir_string_values_to_options(stripslashes_deep($type['option_values']), true);
2734 2734
                                 
2735
-                                if (!empty($cf_option_values)) {
2736
-                                    foreach ($cf_option_values as $cf_option_value) {
2737
-                                        if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->{$type['htmlvar_name']}) {
2738
-                                            $field_value = $cf_option_value['label'];
2739
-                                        }
2740
-                                    }
2741
-                                }
2742
-                            }
2743
-
2744
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2745
-
2746
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
2747
-                            if ($field_set_start == 1 && $site_title != '') {
2748
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2749
-                            }
2750
-                            $html .= ' </span>' . $field_value . '</div>';
2751
-                        }
2752
-                            break;
2753
-                        case 'multiselect': {
2754
-                            if (is_array($post->{$type['htmlvar_name']})) {
2755
-                                $post->{$type['htmlvar_name']} = implode(', ', $post->{$type['htmlvar_name']});
2756
-                            }
2757
-
2758
-                            if (strpos($field_icon, 'http') !== false) {
2759
-                                $field_icon_af = '';
2760
-                            } elseif ($field_icon == '') {
2761
-                                $field_icon_af = '';
2762
-                            } else {
2763
-                                $field_icon_af = $field_icon;
2764
-                                $field_icon = '';
2765
-                            }
2766
-
2767
-                            $field_values = explode(',', trim($post->{$type['htmlvar_name']}, ","));
2768
-
2769
-                            $option_values = array();
2770
-                            if (!empty($type['option_values'])) {
2771
-                                $cf_option_values = geodir_string_values_to_options(stripslashes_deep($type['option_values']), true);
2735
+								if (!empty($cf_option_values)) {
2736
+									foreach ($cf_option_values as $cf_option_value) {
2737
+										if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->{$type['htmlvar_name']}) {
2738
+											$field_value = $cf_option_value['label'];
2739
+										}
2740
+									}
2741
+								}
2742
+							}
2743
+
2744
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2745
+
2746
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
2747
+							if ($field_set_start == 1 && $site_title != '') {
2748
+								$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2749
+							}
2750
+							$html .= ' </span>' . $field_value . '</div>';
2751
+						}
2752
+							break;
2753
+						case 'multiselect': {
2754
+							if (is_array($post->{$type['htmlvar_name']})) {
2755
+								$post->{$type['htmlvar_name']} = implode(', ', $post->{$type['htmlvar_name']});
2756
+							}
2757
+
2758
+							if (strpos($field_icon, 'http') !== false) {
2759
+								$field_icon_af = '';
2760
+							} elseif ($field_icon == '') {
2761
+								$field_icon_af = '';
2762
+							} else {
2763
+								$field_icon_af = $field_icon;
2764
+								$field_icon = '';
2765
+							}
2766
+
2767
+							$field_values = explode(',', trim($post->{$type['htmlvar_name']}, ","));
2768
+
2769
+							$option_values = array();
2770
+							if (!empty($type['option_values'])) {
2771
+								$cf_option_values = geodir_string_values_to_options(stripslashes_deep($type['option_values']), true);
2772 2772
                                 
2773
-                                if (!empty($cf_option_values)) {
2774
-                                    foreach ($cf_option_values as $cf_option_value) {
2775
-                                        if (isset($cf_option_value['value']) && in_array($cf_option_value['value'], $field_values)) {
2776
-                                            $option_values[] = $cf_option_value['label'];
2777
-                                        }
2778
-                                    }
2779
-                                }
2780
-                            }
2781
-
2782
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2783
-
2784
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
2785
-                            if ($field_set_start == 1 && $site_title != '') {
2786
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2787
-                            }
2788
-                            $html .= ' </span>';
2789
-
2790
-                            $html .= ' <span class="gd-multiselect-value-output gd-val-'.$type['htmlvar_name'].'" >';
2791
-
2792
-                            if (count($option_values) > 1) {
2793
-                                $html .= "<span>".implode('</span>, <span>',$option_values)."</span>";
2794
-                            } else {
2795
-                                $vals = explode(",",$post->{$type['htmlvar_name']});
2796
-                                $html .= "<span>".implode('</span>, <span>', $vals)."</span>";
2797
-                            }
2798
-
2799
-                            $html .= ' </span>';
2800
-
2801
-
2802
-
2803
-
2804
-                            $html .= '</div>';
2805
-                        }
2806
-                            break;
2807
-                        case 'email': {
2808
-                            if (strpos($field_icon, 'http') !== false) {
2809
-                                $field_icon_af = '';
2810
-                            } elseif ($field_icon == '') {
2811
-                                $field_icon_af = '<i class="fa fa-envelope"></i>';
2812
-                            } else {
2813
-                                $field_icon_af = $field_icon;
2814
-                                $field_icon = '';
2815
-                            }
2816
-
2817
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2818
-
2819
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af;
2820
-                            if ($field_set_start == 1 && $site_title != '') {
2821
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2822
-                            }
2823
-                            $html .= ' </span>' . stripslashes($post->{$type['htmlvar_name']}) . '</div>';
2824
-                        }
2825
-                            break;
2826
-                        case 'textarea': {
2827
-                            if (strpos($field_icon, 'http') !== false) {
2828
-                                $field_icon_af = '';
2829
-                            } elseif ($field_icon == '') {
2830
-                                $field_icon_af = '';
2831
-                            } else {
2832
-                                $field_icon_af = $field_icon;
2833
-                                $field_icon = '';
2834
-                            }
2835
-
2836
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2837
-
2838
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
2839
-                            if ($field_set_start == 1 && $site_title != '') {
2840
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2841
-                            }
2842
-                            $html .= '</span>' . wpautop(stripslashes($post->{$type['htmlvar_name']})) . '</div>';
2843
-                        }
2844
-                            break;
2845
-                        case 'html': {
2846
-                            if (strpos($field_icon, 'http') !== false) {
2847
-                                $field_icon_af = '';
2848
-                            } elseif ($field_icon == '') {
2849
-                                $field_icon_af = '';
2850
-                            } else {
2851
-                                $field_icon_af = $field_icon;
2852
-                                $field_icon = '';
2853
-                            }
2854
-
2855
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2856
-
2857
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
2858
-                            if ($field_set_start == 1 && $site_title != '') {
2859
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2860
-                            }
2861
-                            $html .= ' </span>' . wpautop(stripslashes($post->{$type['htmlvar_name']})) . '</div>';
2862
-                        }
2863
-                        break;
2864
-                        case 'file': {
2865
-                            $html_var = $type['htmlvar_name'];
2866
-
2867
-                            if (!empty($post->{$type['htmlvar_name']})) {
2868
-                                $files = explode(",", $post->{$type['htmlvar_name']});
2869
-
2870
-                                if (!empty($files)) {
2871
-                                    $extra_fields = !empty($type['extra_fields']) ? maybe_unserialize($type['extra_fields']) : NULL;
2872
-                                    $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types'] ) ? $extra_fields['gd_file_types'] : '';
2773
+								if (!empty($cf_option_values)) {
2774
+									foreach ($cf_option_values as $cf_option_value) {
2775
+										if (isset($cf_option_value['value']) && in_array($cf_option_value['value'], $field_values)) {
2776
+											$option_values[] = $cf_option_value['label'];
2777
+										}
2778
+									}
2779
+								}
2780
+							}
2781
+
2782
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2783
+
2784
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
2785
+							if ($field_set_start == 1 && $site_title != '') {
2786
+								$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2787
+							}
2788
+							$html .= ' </span>';
2789
+
2790
+							$html .= ' <span class="gd-multiselect-value-output gd-val-'.$type['htmlvar_name'].'" >';
2791
+
2792
+							if (count($option_values) > 1) {
2793
+								$html .= "<span>".implode('</span>, <span>',$option_values)."</span>";
2794
+							} else {
2795
+								$vals = explode(",",$post->{$type['htmlvar_name']});
2796
+								$html .= "<span>".implode('</span>, <span>', $vals)."</span>";
2797
+							}
2798
+
2799
+							$html .= ' </span>';
2800
+
2801
+
2802
+
2803
+
2804
+							$html .= '</div>';
2805
+						}
2806
+							break;
2807
+						case 'email': {
2808
+							if (strpos($field_icon, 'http') !== false) {
2809
+								$field_icon_af = '';
2810
+							} elseif ($field_icon == '') {
2811
+								$field_icon_af = '<i class="fa fa-envelope"></i>';
2812
+							} else {
2813
+								$field_icon_af = $field_icon;
2814
+								$field_icon = '';
2815
+							}
2816
+
2817
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2818
+
2819
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af;
2820
+							if ($field_set_start == 1 && $site_title != '') {
2821
+								$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2822
+							}
2823
+							$html .= ' </span>' . stripslashes($post->{$type['htmlvar_name']}) . '</div>';
2824
+						}
2825
+							break;
2826
+						case 'textarea': {
2827
+							if (strpos($field_icon, 'http') !== false) {
2828
+								$field_icon_af = '';
2829
+							} elseif ($field_icon == '') {
2830
+								$field_icon_af = '';
2831
+							} else {
2832
+								$field_icon_af = $field_icon;
2833
+								$field_icon = '';
2834
+							}
2835
+
2836
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2837
+
2838
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
2839
+							if ($field_set_start == 1 && $site_title != '') {
2840
+								$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2841
+							}
2842
+							$html .= '</span>' . wpautop(stripslashes($post->{$type['htmlvar_name']})) . '</div>';
2843
+						}
2844
+							break;
2845
+						case 'html': {
2846
+							if (strpos($field_icon, 'http') !== false) {
2847
+								$field_icon_af = '';
2848
+							} elseif ($field_icon == '') {
2849
+								$field_icon_af = '';
2850
+							} else {
2851
+								$field_icon_af = $field_icon;
2852
+								$field_icon = '';
2853
+							}
2854
+
2855
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2856
+
2857
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
2858
+							if ($field_set_start == 1 && $site_title != '') {
2859
+								$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2860
+							}
2861
+							$html .= ' </span>' . wpautop(stripslashes($post->{$type['htmlvar_name']})) . '</div>';
2862
+						}
2863
+						break;
2864
+						case 'file': {
2865
+							$html_var = $type['htmlvar_name'];
2866
+
2867
+							if (!empty($post->{$type['htmlvar_name']})) {
2868
+								$files = explode(",", $post->{$type['htmlvar_name']});
2869
+
2870
+								if (!empty($files)) {
2871
+									$extra_fields = !empty($type['extra_fields']) ? maybe_unserialize($type['extra_fields']) : NULL;
2872
+									$allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types'] ) ? $extra_fields['gd_file_types'] : '';
2873 2873
                                
2874
-                                    $file_paths = '';
2875
-                                    foreach ($files as $file) {
2876
-                                        if (!empty($file)) {
2877
-                                            $image_name_arr = explode('/', $file);
2878
-                                            $filename = end($image_name_arr);
2879
-
2880
-                                            $arr_file_type = wp_check_filetype($filename);
2881
-                                            if (empty($arr_file_type['ext']) || empty($arr_file_type['type'])) {
2882
-                                                continue;
2883
-                                            }
2884
-                                            $uploaded_file_type = $arr_file_type['type'];
2885
-                                            $uploaded_file_ext = $arr_file_type['ext'];
2874
+									$file_paths = '';
2875
+									foreach ($files as $file) {
2876
+										if (!empty($file)) {
2877
+											$image_name_arr = explode('/', $file);
2878
+											$filename = end($image_name_arr);
2879
+
2880
+											$arr_file_type = wp_check_filetype($filename);
2881
+											if (empty($arr_file_type['ext']) || empty($arr_file_type['type'])) {
2882
+												continue;
2883
+											}
2884
+											$uploaded_file_type = $arr_file_type['type'];
2885
+											$uploaded_file_ext = $arr_file_type['ext'];
2886 2886
                                             
2887
-                                            if (!empty($allowed_file_types) && !in_array($uploaded_file_ext, $allowed_file_types)) {
2888
-                                                continue; // Invalid file type.
2889
-                                            }
2890
-
2891
-                                            $image_file_types = array('image/jpg', 'image/jpeg', 'image/gif', 'image/png', 'image/bmp', 'image/x-icon');
2892
-
2893
-                                            // If the uploaded file is image
2894
-                                            if (in_array($uploaded_file_type, $image_file_types)) {
2895
-                                                $file_paths .= '<div class="geodir-custom-post-gallery" class="clearfix">';
2896
-                                                $file_paths .= '<a href="'.$file.'">';
2897
-                                                $file_paths .= geodir_show_image(array('src' => $file), 'thumbnail', false, false);
2898
-                                                $file_paths .= '</a>';
2899
-                                                $file_paths .= '</div>';
2900
-                                            } else {
2901
-                                                $ext_path = '_' . $html_var . '_';
2902
-                                                $filename = explode($ext_path, $filename);
2903
-                                                $file_paths .= '<a href="' . $file . '" target="_blank">' . $filename[count($filename) - 1] . '</a>';
2904
-                                            }
2905
-                                        }
2906
-                                    }
2907
-
2908
-                                    if (strpos($field_icon, 'http') !== false) {
2909
-                                        $field_icon_af = '';
2910
-                                    } else if ($field_icon == '') {
2911
-                                        $field_icon_af = '';
2912
-                                    } else {
2913
-                                        $field_icon_af = $field_icon;
2914
-                                        $field_icon = '';
2915
-                                    }
2916
-
2917
-                                    $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2918
-
2919
-
2920
-                                    $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . ' geodir-custom-file-box" style="clear:both;"><span class="geodir-i-file" style="display:inline-block;vertical-align:top;padding-right:14px;' . $field_icon . '">' . $field_icon_af;
2921
-
2922
-                                    if ($field_set_start == 1 && $site_title != '') {
2923
-                                        $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2924
-                                    }
2925
-
2926
-                                    $html .= ' </span>' . $file_paths . '</div>';
2927
-                                }
2928
-                            }
2929
-                        }
2930
-                            break;
2931
-                    }
2932
-
2933
-
2934
-                    /**
2935
-                     * Filter custom field output in tab.
2936
-                     *
2937
-                     * @since 1.5.6
2938
-                     *
2939
-                     * @param string $html_var The HTML variable name for the field.
2940
-                     * @param string $html Custom field unfiltered HTML.
2941
-                     * @param array $variables_array Custom field variables array.
2942
-                     */
2943
-                    $html = apply_filters("geodir_tab_show_{$html_var}", $html, $variables_array);
2944
-
2945
-                    $fieldset_html = '';
2946
-                    if ($field_set_start == 1) {
2947
-                        $add_html = false;
2948
-                        if ($type['type'] == 'fieldset' && $fieldset_count > 1) {
2949
-                            if ($fieldset != '') {
2950
-                                $add_html = true;
2951
-                                $label = $fieldset_arr[$fieldset_count - 1]['label'];
2952
-                                $htmlvar_name = $fieldset_arr[$fieldset_count - 1]['htmlvar_name'];
2953
-                            }
2954
-                            $fieldset_html = $fieldset;
2955
-                            $fieldset = '';
2956
-                        } else {
2957
-                            $fieldset .= $html;
2958
-                            if ($total_fields == $count_field && $fieldset != '') {
2959
-                                $add_html = true;
2960
-                                $label = $fieldset_arr[$fieldset_count]['label'];
2961
-                                $htmlvar_name = $fieldset_arr[$fieldset_count]['htmlvar_name'];
2962
-                                $fieldset_html = $fieldset;
2963
-                            }
2964
-                        }
2965
-
2966
-                        if ($add_html) {
2967
-                            $tabs_arr[$htmlvar_name] = array(
2968
-                                'heading_text' => __($label, 'geodirectory'),
2969
-                                'is_active_tab' => false,
2970
-                                /**
2971
-                                 * Filter if a custom field should be displayed on the details page tab.
2972
-                                 *
2973
-                                 * @since 1.0.0
2974
-                                 * @param string $htmlvar_name The field HTML var name.
2975
-                                 */
2976
-                                'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $htmlvar_name),
2977
-                                'tab_content' => '<div class="geodir-company_info field-group">' . $fieldset_html . '</html>'
2978
-                            );
2979
-                        }
2980
-                    } else {
2981
-                        if ($html != '') {
2982
-                            $tabs_arr[$field['htmlvar_name']] = array(
2983
-                                'heading_text' => __($label, 'geodirectory'),
2984
-                                'is_active_tab' => false,
2985
-                                /** This action is documented in geodirectory_hooks_actions.php */
2986
-                                'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $field['htmlvar_name']),
2987
-                                'tab_content' => $html
2988
-                            );
2989
-                        }
2990
-                    }
2991
-                }
2992
-            }
2993
-        }
2994
-    }
2995
-    return $tabs_arr;
2887
+											if (!empty($allowed_file_types) && !in_array($uploaded_file_ext, $allowed_file_types)) {
2888
+												continue; // Invalid file type.
2889
+											}
2890
+
2891
+											$image_file_types = array('image/jpg', 'image/jpeg', 'image/gif', 'image/png', 'image/bmp', 'image/x-icon');
2892
+
2893
+											// If the uploaded file is image
2894
+											if (in_array($uploaded_file_type, $image_file_types)) {
2895
+												$file_paths .= '<div class="geodir-custom-post-gallery" class="clearfix">';
2896
+												$file_paths .= '<a href="'.$file.'">';
2897
+												$file_paths .= geodir_show_image(array('src' => $file), 'thumbnail', false, false);
2898
+												$file_paths .= '</a>';
2899
+												$file_paths .= '</div>';
2900
+											} else {
2901
+												$ext_path = '_' . $html_var . '_';
2902
+												$filename = explode($ext_path, $filename);
2903
+												$file_paths .= '<a href="' . $file . '" target="_blank">' . $filename[count($filename) - 1] . '</a>';
2904
+											}
2905
+										}
2906
+									}
2907
+
2908
+									if (strpos($field_icon, 'http') !== false) {
2909
+										$field_icon_af = '';
2910
+									} else if ($field_icon == '') {
2911
+										$field_icon_af = '';
2912
+									} else {
2913
+										$field_icon_af = $field_icon;
2914
+										$field_icon = '';
2915
+									}
2916
+
2917
+									$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2918
+
2919
+
2920
+									$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . ' geodir-custom-file-box" style="clear:both;"><span class="geodir-i-file" style="display:inline-block;vertical-align:top;padding-right:14px;' . $field_icon . '">' . $field_icon_af;
2921
+
2922
+									if ($field_set_start == 1 && $site_title != '') {
2923
+										$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2924
+									}
2925
+
2926
+									$html .= ' </span>' . $file_paths . '</div>';
2927
+								}
2928
+							}
2929
+						}
2930
+							break;
2931
+					}
2932
+
2933
+
2934
+					/**
2935
+					 * Filter custom field output in tab.
2936
+					 *
2937
+					 * @since 1.5.6
2938
+					 *
2939
+					 * @param string $html_var The HTML variable name for the field.
2940
+					 * @param string $html Custom field unfiltered HTML.
2941
+					 * @param array $variables_array Custom field variables array.
2942
+					 */
2943
+					$html = apply_filters("geodir_tab_show_{$html_var}", $html, $variables_array);
2944
+
2945
+					$fieldset_html = '';
2946
+					if ($field_set_start == 1) {
2947
+						$add_html = false;
2948
+						if ($type['type'] == 'fieldset' && $fieldset_count > 1) {
2949
+							if ($fieldset != '') {
2950
+								$add_html = true;
2951
+								$label = $fieldset_arr[$fieldset_count - 1]['label'];
2952
+								$htmlvar_name = $fieldset_arr[$fieldset_count - 1]['htmlvar_name'];
2953
+							}
2954
+							$fieldset_html = $fieldset;
2955
+							$fieldset = '';
2956
+						} else {
2957
+							$fieldset .= $html;
2958
+							if ($total_fields == $count_field && $fieldset != '') {
2959
+								$add_html = true;
2960
+								$label = $fieldset_arr[$fieldset_count]['label'];
2961
+								$htmlvar_name = $fieldset_arr[$fieldset_count]['htmlvar_name'];
2962
+								$fieldset_html = $fieldset;
2963
+							}
2964
+						}
2965
+
2966
+						if ($add_html) {
2967
+							$tabs_arr[$htmlvar_name] = array(
2968
+								'heading_text' => __($label, 'geodirectory'),
2969
+								'is_active_tab' => false,
2970
+								/**
2971
+								 * Filter if a custom field should be displayed on the details page tab.
2972
+								 *
2973
+								 * @since 1.0.0
2974
+								 * @param string $htmlvar_name The field HTML var name.
2975
+								 */
2976
+								'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $htmlvar_name),
2977
+								'tab_content' => '<div class="geodir-company_info field-group">' . $fieldset_html . '</html>'
2978
+							);
2979
+						}
2980
+					} else {
2981
+						if ($html != '') {
2982
+							$tabs_arr[$field['htmlvar_name']] = array(
2983
+								'heading_text' => __($label, 'geodirectory'),
2984
+								'is_active_tab' => false,
2985
+								/** This action is documented in geodirectory_hooks_actions.php */
2986
+								'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $field['htmlvar_name']),
2987
+								'tab_content' => $html
2988
+							);
2989
+						}
2990
+					}
2991
+				}
2992
+			}
2993
+		}
2994
+	}
2995
+	return $tabs_arr;
2996 2996
 }
2997 2997
 
2998 2998
 /* display add listing page for wpml */
@@ -3016,37 +3016,37 @@  discard block
 block discarded – undo
3016 3016
  */
3017 3017
 function geodir_add_post_status_author_page()
3018 3018
 {
3019
-    global $wpdb, $post;
3020
-
3021
-    $html = '';
3022
-    if (get_current_user_id()) {
3023
-        if (geodir_is_page('author') && !empty($post) && isset($post->post_author) && $post->post_author == get_current_user_id()) {
3024
-
3025
-            // we need to query real status direct as we dynamically change the status for author on author page so even non author status can view them.
3026
-            $real_status = $wpdb->get_var("SELECT post_status from $wpdb->posts WHERE ID=$post->ID");
3027
-            $status = "<strong>(";
3028
-            $status_icon = '<i class="fa fa-play"></i>';
3029
-            if ($real_status == 'publish') {
3030
-                $status .= __('Published', 'geodirectory');
3031
-            } else {
3032
-                $status .= __('Not published', 'geodirectory');
3033
-                $status_icon = '<i class="fa fa-pause"></i>';
3034
-            }
3035
-            $status .= ")</strong>";
3019
+	global $wpdb, $post;
3020
+
3021
+	$html = '';
3022
+	if (get_current_user_id()) {
3023
+		if (geodir_is_page('author') && !empty($post) && isset($post->post_author) && $post->post_author == get_current_user_id()) {
3024
+
3025
+			// we need to query real status direct as we dynamically change the status for author on author page so even non author status can view them.
3026
+			$real_status = $wpdb->get_var("SELECT post_status from $wpdb->posts WHERE ID=$post->ID");
3027
+			$status = "<strong>(";
3028
+			$status_icon = '<i class="fa fa-play"></i>';
3029
+			if ($real_status == 'publish') {
3030
+				$status .= __('Published', 'geodirectory');
3031
+			} else {
3032
+				$status .= __('Not published', 'geodirectory');
3033
+				$status_icon = '<i class="fa fa-pause"></i>';
3034
+			}
3035
+			$status .= ")</strong>";
3036 3036
 
3037
-            $html = '<span class="geodir-post-status">' . $status_icon . ' <font class="geodir-status-label">' . __('Status: ', 'geodirectory') . '</font>' . $status . '</span>';
3038
-        }
3039
-    }
3037
+			$html = '<span class="geodir-post-status">' . $status_icon . ' <font class="geodir-status-label">' . __('Status: ', 'geodirectory') . '</font>' . $status . '</span>';
3038
+		}
3039
+	}
3040 3040
 
3041
-    if ($html != '') {
3042
-        /**
3043
-         * Filter the post status text on the author page.
3044
-         *
3045
-         * @since 1.0.0
3046
-         * @param string $html The HTML of the status.
3047
-         */
3048
-        echo apply_filters('geodir_filter_status_text_on_author_page', $html);
3049
-    }
3041
+	if ($html != '') {
3042
+		/**
3043
+		 * Filter the post status text on the author page.
3044
+		 *
3045
+		 * @since 1.0.0
3046
+		 * @param string $html The HTML of the status.
3047
+		 */
3048
+		echo apply_filters('geodir_filter_status_text_on_author_page', $html);
3049
+	}
3050 3050
 
3051 3051
 
3052 3052
 }
@@ -3060,21 +3060,21 @@  discard block
 block discarded – undo
3060 3060
  */
3061 3061
 function geodir_init_no_rating()
3062 3062
 {
3063
-    if (get_option('geodir_disable_rating')) {
3064
-        remove_action('comment_form_logged_in_after', 'geodir_comment_rating_fields');
3065
-        remove_action('comment_form_before_fields', 'geodir_comment_rating_fields');
3066
-        remove_action('comment_form_logged_in_after', 'geodir_reviewrating_comment_rating_fields');
3067
-        remove_action('comment_form_before_fields', 'geodir_reviewrating_comment_rating_fields');
3068
-        remove_action('add_meta_boxes_comment', 'geodir_comment_add_meta_box');
3069
-        remove_action('add_meta_boxes', 'geodir_reviewrating_comment_metabox', 13);
3070
-        remove_filter('comment_text', 'geodir_wrap_comment_text', 40);
3071
-
3072
-        add_action('comment_form_logged_in_after', 'geodir_no_rating_rating_fields');
3073
-        add_action('comment_form_before_fields', 'geodir_no_rating_rating_fields');
3074
-        add_filter('comment_text', 'geodir_no_rating_comment_text', 100, 2);
3075
-        add_filter('geodir_detail_page_review_rating_html', 'geodir_no_rating_review_rating_html', 100);
3076
-        add_filter('geodir_get_sort_options', 'geodir_no_rating_get_sort_options', 100, 2);
3077
-    }
3063
+	if (get_option('geodir_disable_rating')) {
3064
+		remove_action('comment_form_logged_in_after', 'geodir_comment_rating_fields');
3065
+		remove_action('comment_form_before_fields', 'geodir_comment_rating_fields');
3066
+		remove_action('comment_form_logged_in_after', 'geodir_reviewrating_comment_rating_fields');
3067
+		remove_action('comment_form_before_fields', 'geodir_reviewrating_comment_rating_fields');
3068
+		remove_action('add_meta_boxes_comment', 'geodir_comment_add_meta_box');
3069
+		remove_action('add_meta_boxes', 'geodir_reviewrating_comment_metabox', 13);
3070
+		remove_filter('comment_text', 'geodir_wrap_comment_text', 40);
3071
+
3072
+		add_action('comment_form_logged_in_after', 'geodir_no_rating_rating_fields');
3073
+		add_action('comment_form_before_fields', 'geodir_no_rating_rating_fields');
3074
+		add_filter('comment_text', 'geodir_no_rating_comment_text', 100, 2);
3075
+		add_filter('geodir_detail_page_review_rating_html', 'geodir_no_rating_review_rating_html', 100);
3076
+		add_filter('geodir_get_sort_options', 'geodir_no_rating_get_sort_options', 100, 2);
3077
+	}
3078 3078
 }
3079 3079
 
3080 3080
 /**
@@ -3086,20 +3086,20 @@  discard block
 block discarded – undo
3086 3086
  */
3087 3087
 function geodir_no_rating_rating_fields()
3088 3088
 {
3089
-    global $post;
3089
+	global $post;
3090 3090
 
3091
-    $post_types = geodir_get_posttypes();
3091
+	$post_types = geodir_get_posttypes();
3092 3092
 
3093
-    if (!empty($post) && isset($post->post_type) && in_array($post->post_type, $post_types)) {
3094
-        if (is_plugin_active('geodir_review_rating_manager/geodir_review_rating_manager.php')) {
3095
-            echo '<input type="hidden" value="1" name="geodir_rating[overall]" />';
3096
-            if (get_option('geodir_reviewrating_enable_images')) {
3097
-                geodir_reviewrating_rating_img_html();
3098
-            }
3099
-        } else {
3100
-            echo '<input type="hidden" id="geodir_overallrating" name="geodir_overallrating" value="1" />';
3101
-        }
3102
-    }
3093
+	if (!empty($post) && isset($post->post_type) && in_array($post->post_type, $post_types)) {
3094
+		if (is_plugin_active('geodir_review_rating_manager/geodir_review_rating_manager.php')) {
3095
+			echo '<input type="hidden" value="1" name="geodir_rating[overall]" />';
3096
+			if (get_option('geodir_reviewrating_enable_images')) {
3097
+				geodir_reviewrating_rating_img_html();
3098
+			}
3099
+		} else {
3100
+			echo '<input type="hidden" id="geodir_overallrating" name="geodir_overallrating" value="1" />';
3101
+		}
3102
+	}
3103 3103
 }
3104 3104
 
3105 3105
 /**
@@ -3113,11 +3113,11 @@  discard block
 block discarded – undo
3113 3113
  */
3114 3114
 function geodir_no_rating_comment_text($content, $comment = '')
3115 3115
 {
3116
-    if (!is_admin()) {
3117
-        return '<div class="description">' . $content . '</div>';
3118
-    } else {
3119
-        return $content;
3120
-    }
3116
+	if (!is_admin()) {
3117
+		return '<div class="description">' . $content . '</div>';
3118
+	} else {
3119
+		return $content;
3120
+	}
3121 3121
 }
3122 3122
 
3123 3123
 /**
@@ -3130,7 +3130,7 @@  discard block
 block discarded – undo
3130 3130
  */
3131 3131
 function geodir_no_rating_review_rating_html($content = '')
3132 3132
 {
3133
-    return NULL;
3133
+	return NULL;
3134 3134
 }
3135 3135
 
3136 3136
 /**
@@ -3144,19 +3144,19 @@  discard block
 block discarded – undo
3144 3144
  */
3145 3145
 function geodir_no_rating_get_sort_options($options, $post_type = '')
3146 3146
 {
3147
-    $new_options = array();
3148
-    if (!empty($options)) {
3149
-        foreach ($options as $option) {
3150
-            if (is_object($option) && isset($option->htmlvar_name) && $option->htmlvar_name == 'overall_rating') {
3151
-                continue;
3152
-            }
3153
-            $new_options[] = $option;
3154
-        }
3147
+	$new_options = array();
3148
+	if (!empty($options)) {
3149
+		foreach ($options as $option) {
3150
+			if (is_object($option) && isset($option->htmlvar_name) && $option->htmlvar_name == 'overall_rating') {
3151
+				continue;
3152
+			}
3153
+			$new_options[] = $option;
3154
+		}
3155 3155
 
3156
-        $options = $new_options;
3157
-    }
3156
+		$options = $new_options;
3157
+	}
3158 3158
 
3159
-    return $options;
3159
+	return $options;
3160 3160
 }
3161 3161
 
3162 3162
 add_filter('geodir_all_js_msg', 'geodir_all_js_msg_no_rating', 100);
@@ -3170,11 +3170,11 @@  discard block
 block discarded – undo
3170 3170
  */
3171 3171
 function geodir_all_js_msg_no_rating($msg = array())
3172 3172
 {
3173
-    if (get_option('geodir_disable_rating')) {
3174
-        $msg['gd_cmt_no_rating'] = true;
3175
-    }
3173
+	if (get_option('geodir_disable_rating')) {
3174
+		$msg['gd_cmt_no_rating'] = true;
3175
+	}
3176 3176
 
3177
-    return $msg;
3177
+	return $msg;
3178 3178
 }
3179 3179
 
3180 3180
 add_filter('body_class', 'geodir_body_class_no_rating', 100);
@@ -3188,13 +3188,13 @@  discard block
 block discarded – undo
3188 3188
  */
3189 3189
 function geodir_body_class_no_rating($classes = array())
3190 3190
 {
3191
-    if (get_option('geodir_disable_rating')) {
3192
-        $classes[] = 'gd-no-rating';
3193
-    }
3191
+	if (get_option('geodir_disable_rating')) {
3192
+		$classes[] = 'gd-no-rating';
3193
+	}
3194 3194
     
3195
-    $classes[] = 'gd-map-' . geodir_map_name();
3195
+	$classes[] = 'gd-map-' . geodir_map_name();
3196 3196
 
3197
-    return $classes;
3197
+	return $classes;
3198 3198
 }
3199 3199
 
3200 3200
 add_filter('admin_body_class', 'geodir_admin_body_class_no_rating', 100);
@@ -3208,13 +3208,13 @@  discard block
 block discarded – undo
3208 3208
  */
3209 3209
 function geodir_admin_body_class_no_rating($class = '')
3210 3210
 {
3211
-    if (get_option('geodir_disable_rating')) {
3212
-        $class .= ' gd-no-rating';
3213
-    }
3211
+	if (get_option('geodir_disable_rating')) {
3212
+		$class .= ' gd-no-rating';
3213
+	}
3214 3214
     
3215
-    $class .= ' gd-map-' . geodir_map_name();
3215
+	$class .= ' gd-map-' . geodir_map_name();
3216 3216
 
3217
-    return $class;
3217
+	return $class;
3218 3218
 }
3219 3219
 
3220 3220
 add_action('wp_head', 'geodir_wp_head_no_rating');
@@ -3227,10 +3227,10 @@  discard block
 block discarded – undo
3227 3227
  */
3228 3228
 function geodir_wp_head_no_rating()
3229 3229
 {
3230
-    if (get_option('geodir_disable_rating')) {
3231
-        echo '<style>body .geodir-rating, body .geodir-bubble-rating, body .gd_ratings_module_box{display:none!important;}</style>';
3232
-        echo '<script type="text/javascript">jQuery(function(){jQuery(".gd_rating_show").parent(".geodir-rating").remove();});</script>';
3233
-    }
3230
+	if (get_option('geodir_disable_rating')) {
3231
+		echo '<style>body .geodir-rating, body .geodir-bubble-rating, body .gd_ratings_module_box{display:none!important;}</style>';
3232
+		echo '<script type="text/javascript">jQuery(function(){jQuery(".gd_rating_show").parent(".geodir-rating").remove();});</script>';
3233
+	}
3234 3234
 }
3235 3235
 
3236 3236
 add_filter('geodir_load_db_language', 'geodir_load_custom_field_translation');
@@ -3247,36 +3247,36 @@  discard block
 block discarded – undo
3247 3247
  * @return array Translation texts.
3248 3248
  */
3249 3249
 function geodir_load_gd_options_text_translation($translation_texts = array()) {
3250
-    $translation_texts = !empty( $translation_texts ) && is_array( $translation_texts ) ? $translation_texts : array();
3251
-
3252
-    $gd_options = array('geodir_post_submited_success_email_subject_admin', 'geodir_post_submited_success_email_content_admin', 'geodir_post_submited_success_email_subject', 'geodir_post_submited_success_email_content', 'geodir_forgot_password_subject', 'geodir_forgot_password_content', 'geodir_registration_success_email_subject', 'geodir_registration_success_email_content', 'geodir_post_published_email_subject', 'geodir_post_published_email_content', 'geodir_email_friend_subject', 'geodir_email_friend_content', 'geodir_email_enquiry_subject', 'geodir_email_enquiry_content', 'geodir_post_added_success_msg_content', 'geodir_post_edited_email_subject_admin', 'geodir_post_edited_email_content_admin');
3253
-
3254
-    /**
3255
-     * Filters the geodirectory option names that requires to add for translation.
3256
-     *
3257
-     * @since 1.5.7
3258
-     * @package GeoDirectory
3259
-     *
3260
-     * @param  array $gd_options Array of option names.
3261
-     */
3262
-    $gd_options = apply_filters('geodir_gd_options_for_translation', $gd_options);
3263
-    $gd_options = array_unique($gd_options);
3264
-
3265
-    if (!empty($gd_options)) {
3266
-        foreach ($gd_options as $gd_option) {
3267
-            if ($gd_option != '' && $option_value = get_option($gd_option)) {
3268
-                $option_value = is_string($option_value) ? stripslashes_deep($option_value) : '';
3250
+	$translation_texts = !empty( $translation_texts ) && is_array( $translation_texts ) ? $translation_texts : array();
3251
+
3252
+	$gd_options = array('geodir_post_submited_success_email_subject_admin', 'geodir_post_submited_success_email_content_admin', 'geodir_post_submited_success_email_subject', 'geodir_post_submited_success_email_content', 'geodir_forgot_password_subject', 'geodir_forgot_password_content', 'geodir_registration_success_email_subject', 'geodir_registration_success_email_content', 'geodir_post_published_email_subject', 'geodir_post_published_email_content', 'geodir_email_friend_subject', 'geodir_email_friend_content', 'geodir_email_enquiry_subject', 'geodir_email_enquiry_content', 'geodir_post_added_success_msg_content', 'geodir_post_edited_email_subject_admin', 'geodir_post_edited_email_content_admin');
3253
+
3254
+	/**
3255
+	 * Filters the geodirectory option names that requires to add for translation.
3256
+	 *
3257
+	 * @since 1.5.7
3258
+	 * @package GeoDirectory
3259
+	 *
3260
+	 * @param  array $gd_options Array of option names.
3261
+	 */
3262
+	$gd_options = apply_filters('geodir_gd_options_for_translation', $gd_options);
3263
+	$gd_options = array_unique($gd_options);
3264
+
3265
+	if (!empty($gd_options)) {
3266
+		foreach ($gd_options as $gd_option) {
3267
+			if ($gd_option != '' && $option_value = get_option($gd_option)) {
3268
+				$option_value = is_string($option_value) ? stripslashes_deep($option_value) : '';
3269 3269
                 
3270
-                if ($option_value != '' && !in_array($option_value, $translation_texts)) {
3271
-                    $translation_texts[] = stripslashes_deep($option_value);
3272
-                }
3273
-            }
3274
-        }
3275
-    }
3270
+				if ($option_value != '' && !in_array($option_value, $translation_texts)) {
3271
+					$translation_texts[] = stripslashes_deep($option_value);
3272
+				}
3273
+			}
3274
+		}
3275
+	}
3276 3276
 
3277
-    $translation_texts = !empty($translation_texts) ? array_unique($translation_texts) : $translation_texts;
3277
+	$translation_texts = !empty($translation_texts) ? array_unique($translation_texts) : $translation_texts;
3278 3278
 
3279
-    return $translation_texts;
3279
+	return $translation_texts;
3280 3280
 }
3281 3281
 
3282 3282
 add_filter('geodir_load_db_language', 'geodir_load_gd_options_text_translation');
@@ -3290,15 +3290,15 @@  discard block
 block discarded – undo
3290 3290
 
3291 3291
 add_filter('get_comments_link', 'gd_get_comments_link', 10, 2);
3292 3292
 function gd_get_comments_link($comments_link, $post_id) {
3293
-    $post_type = get_post_type($post_id);
3293
+	$post_type = get_post_type($post_id);
3294 3294
 
3295
-    $all_postypes = geodir_get_posttypes();
3296
-    if (in_array($post_type, $all_postypes)) {
3297
-        $comments_link = str_replace('#comments', '#reviews', $comments_link);
3298
-        $comments_link = str_replace('#respond', '#reviews', $comments_link);
3299
-    }
3295
+	$all_postypes = geodir_get_posttypes();
3296
+	if (in_array($post_type, $all_postypes)) {
3297
+		$comments_link = str_replace('#comments', '#reviews', $comments_link);
3298
+		$comments_link = str_replace('#respond', '#reviews', $comments_link);
3299
+	}
3300 3300
 
3301
-    return $comments_link;
3301
+	return $comments_link;
3302 3302
 }
3303 3303
 
3304 3304
 
@@ -3316,11 +3316,11 @@  discard block
 block discarded – undo
3316 3316
 function geodir_add_nav_menu_class( $args )
3317 3317
 {
3318 3318
 
3319
-        if(isset($args['menu_class'])){
3320
-            $args['menu_class'] = $args['menu_class']." gd-menu-z";
3321
-        }
3319
+		if(isset($args['menu_class'])){
3320
+			$args['menu_class'] = $args['menu_class']." gd-menu-z";
3321
+		}
3322 3322
     
3323
-    return $args;
3323
+	return $args;
3324 3324
 }
3325 3325
 
3326 3326
 add_filter( 'wp_nav_menu_args', 'geodir_add_nav_menu_class' );
3327 3327
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +183 added lines, -183 removed lines patch added patch discarded remove patch
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 /* ON TEMPLATE INCLUDE */
137 137
 /////////////////////////
138 138
 
139
-add_filter('template_include', 'geodir_template_loader',9);
139
+add_filter('template_include', 'geodir_template_loader', 9);
140 140
 
141 141
 /////////////////////////
142 142
 /* CATEGORY / TAXONOMY / CUSTOM POST ACTIONS */
@@ -176,9 +176,9 @@  discard block
 block discarded – undo
176 176
 /* WP REVIEW COUNT ACTIONS */
177 177
 ////////////////////////
178 178
 
179
-add_action('geodir_update_postrating', 'geodir_term_review_count_force_update_single_post', 100,1);
179
+add_action('geodir_update_postrating', 'geodir_term_review_count_force_update_single_post', 100, 1);
180 180
 //add_action('geodir_update_postrating', 'geodir_term_review_count_force_update', 100);
181
-add_action('transition_post_status', 'geodir_term_review_count_force_update', 100,3);
181
+add_action('transition_post_status', 'geodir_term_review_count_force_update', 100, 3);
182 182
 //add_action('created_term', 'geodir_term_review_count_force_update', 100);
183 183
 add_action('edited_term', 'geodir_term_review_count_force_update', 100);
184 184
 add_action('delete_term', 'geodir_term_review_count_force_update', 100);
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
  */
223 223
 function geodir_unset_prev_theme_nav_location($newname)
224 224
 {
225
-    $geodir_theme_location = get_option('geodir_theme_location_nav_' . $newname);
225
+    $geodir_theme_location = get_option('geodir_theme_location_nav_'.$newname);
226 226
     if ($geodir_theme_location) {
227 227
         update_option('geodir_theme_location_nav', $geodir_theme_location);
228 228
     } else {
@@ -320,8 +320,8 @@  discard block
 block discarded – undo
320 320
 
321 321
 /////// GEO DIRECOTORY CUSTOM HOOKS ///
322 322
 
323
-add_action('geodir_before_tab_content', 'geodir_before_tab_content');// this function is in custom_functions.php and it is used to wrap detail page tab content 
324
-add_action('geodir_after_tab_content', 'geodir_after_tab_content');// this function is in custom_functions.php and it is used to wrap detail page tab content
323
+add_action('geodir_before_tab_content', 'geodir_before_tab_content'); // this function is in custom_functions.php and it is used to wrap detail page tab content 
324
+add_action('geodir_after_tab_content', 'geodir_after_tab_content'); // this function is in custom_functions.php and it is used to wrap detail page tab content
325 325
 
326 326
 // Detail page sidebar content 
327 327
 add_action('geodir_detail_page_sidebar', 'geodir_detail_page_sidebar_content_sorting', 1);
@@ -422,8 +422,8 @@  discard block
 block discarded – undo
422 422
     do_action('geodir_after_social_sharing_buttons');
423 423
     $content_html = ob_get_clean();
424 424
     if (trim($content_html) != '')
425
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">' . $content_html . '</div>';
426
-    if ((int)get_option('geodir_disable_tfg_buttons_section') != 1) {
425
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">'.$content_html.'</div>';
426
+    if ((int) get_option('geodir_disable_tfg_buttons_section') != 1) {
427 427
         /**
428 428
          * Filter the geodir_social_sharing_buttons() function content.
429 429
          *
@@ -469,8 +469,8 @@  discard block
 block discarded – undo
469 469
     do_action('geodir_after_share_this_button');
470 470
     $content_html = ob_get_clean();
471 471
     if (trim($content_html) != '')
472
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-sharethis">' . $content_html . '</div>';
473
-    if ((int)get_option('geodir_disable_sharethis_button_section') != 1) {
472
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-sharethis">'.$content_html.'</div>';
473
+    if ((int) get_option('geodir_disable_sharethis_button_section') != 1) {
474 474
         /**
475 475
          * Filter the geodir_share_this_button() function content.
476 476
          *
@@ -509,12 +509,12 @@  discard block
 block discarded – undo
509 509
             $post_id = $post->ID;
510 510
             
511 511
             if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
512
-                $post_id = (int)$_REQUEST['pid'];
512
+                $post_id = (int) $_REQUEST['pid'];
513 513
             }
514 514
 
515 515
             $postlink = get_permalink(geodir_add_listing_page_id());
516 516
             $editlink = geodir_getlink($postlink, array('pid' => $post_id), false);
517
-            echo ' <p class="edit_link"><i class="fa fa-pencil"></i> <a href="' . esc_url($editlink) . '">' . __('Edit this Post', 'geodirectory') . '</a></p>';
517
+            echo ' <p class="edit_link"><i class="fa fa-pencil"></i> <a href="'.esc_url($editlink).'">'.__('Edit this Post', 'geodirectory').'</a></p>';
518 518
         }
519 519
     }// end of if, if its a preview or not
520 520
     /**
@@ -525,8 +525,8 @@  discard block
 block discarded – undo
525 525
     do_action('geodir_after_edit_post_link');
526 526
     $content_html = ob_get_clean();
527 527
     if (trim($content_html) != '')
528
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">' . $content_html . '</div>';
529
-    if ((int)get_option('geodir_disable_user_links_section') != 1) {
528
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">'.$content_html.'</div>';
529
+    if ((int) get_option('geodir_disable_user_links_section') != 1) {
530 530
         /**
531 531
          * Filter the geodir_edit_post_link() function content.
532 532
          *
@@ -579,14 +579,14 @@  discard block
 block discarded – undo
579 579
     $hide_refresh = get_option('geodir_ga_auto_refresh');
580 580
     
581 581
     $auto_refresh = $hide_refresh && $refresh_time && $refresh_time > 0 ? 1 : 0;
582
-    if (get_option('geodir_ga_stats') && is_user_logged_in() &&  (isset($package_info->google_analytics) && $package_info->google_analytics == '1') && (get_current_user_id()==$post->post_author || current_user_can( 'manage_options' )) ) {
582
+    if (get_option('geodir_ga_stats') && is_user_logged_in() && (isset($package_info->google_analytics) && $package_info->google_analytics == '1') && (get_current_user_id() == $post->post_author || current_user_can('manage_options'))) {
583 583
         $page_url = urlencode($_SERVER['REQUEST_URI']);
584 584
         ?>
585 585
         <script type="text/javascript">
586 586
             var gd_gaTimeOut;
587
-            var gd_gaTime = parseInt('<?php echo $refresh_time;?>');
588
-            var gd_gaHideRefresh = <?php echo (int)$hide_refresh;?>;
589
-            var gd_gaAutoRefresh = <?php echo $auto_refresh;?>;
587
+            var gd_gaTime = parseInt('<?php echo $refresh_time; ?>');
588
+            var gd_gaHideRefresh = <?php echo (int) $hide_refresh; ?>;
589
+            var gd_gaAutoRefresh = <?php echo $auto_refresh; ?>;
590 590
             ga_data1 = false;
591 591
             ga_data2 = false;
592 592
             ga_data3 = false;
@@ -727,7 +727,7 @@  discard block
 block discarded – undo
727 727
             }
728 728
 
729 729
             function gdga_noResults() {
730
-                jQuery('#gdga-chart-container').html('<?php _e('No results available','geodirectory');?>');
730
+                jQuery('#gdga-chart-container').html('<?php _e('No results available', 'geodirectory'); ?>');
731 731
                 jQuery('#gdga-legend-container').html('');
732 732
             }
733 733
 
@@ -759,18 +759,18 @@  discard block
 block discarded – undo
759 759
                     var data2 = results[1].rows.map(function(row) { return +row[2]; });
760 760
                     //var labelsN = results[0].rows.map(function(row) { return +row[1]; });
761 761
 
762
-                    var labels = ['<?php _e('Jan', 'geodirectory');?>',
763
-                        '<?php _e('Feb', 'geodirectory');?>',
764
-                        '<?php _e('Mar', 'geodirectory');?>',
765
-                        '<?php _e('Apr', 'geodirectory');?>',
766
-                        '<?php _e('May', 'geodirectory');?>',
767
-                        '<?php _e('Jun', 'geodirectory');?>',
768
-                        '<?php _e('Jul', 'geodirectory');?>',
769
-                        '<?php _e('Aug', 'geodirectory');?>',
770
-                        '<?php _e('Sep', 'geodirectory');?>',
771
-                        '<?php _e('Oct', 'geodirectory');?>',
772
-                        '<?php _e('Nov', 'geodirectory');?>',
773
-                        '<?php _e('Dec', 'geodirectory');?>'];
762
+                    var labels = ['<?php _e('Jan', 'geodirectory'); ?>',
763
+                        '<?php _e('Feb', 'geodirectory'); ?>',
764
+                        '<?php _e('Mar', 'geodirectory'); ?>',
765
+                        '<?php _e('Apr', 'geodirectory'); ?>',
766
+                        '<?php _e('May', 'geodirectory'); ?>',
767
+                        '<?php _e('Jun', 'geodirectory'); ?>',
768
+                        '<?php _e('Jul', 'geodirectory'); ?>',
769
+                        '<?php _e('Aug', 'geodirectory'); ?>',
770
+                        '<?php _e('Sep', 'geodirectory'); ?>',
771
+                        '<?php _e('Oct', 'geodirectory'); ?>',
772
+                        '<?php _e('Nov', 'geodirectory'); ?>',
773
+                        '<?php _e('Dec', 'geodirectory'); ?>'];
774 774
 
775 775
                     // Ensure the data arrays are at least as long as the labels array.
776 776
                     // Chart.js bar charts don't (yet) accept sparse datasets.
@@ -783,13 +783,13 @@  discard block
 block discarded – undo
783 783
                         labels : labels,
784 784
                         datasets : [
785 785
                             {
786
-                                label: '<?php _e('Last Year', 'geodirectory');?>',
786
+                                label: '<?php _e('Last Year', 'geodirectory'); ?>',
787 787
                                 fillColor : "rgba(220,220,220,0.5)",
788 788
                                 strokeColor : "rgba(220,220,220,1)",
789 789
                                 data : data2
790 790
                             },
791 791
                             {
792
-                                label: '<?php _e('This Year', 'geodirectory');?>',
792
+                                label: '<?php _e('This Year', 'geodirectory'); ?>',
793 793
                                 fillColor : "rgba(151,187,205,0.5)",
794 794
                                 strokeColor : "rgba(151,187,205,1)",
795 795
                                 data : data1
@@ -834,30 +834,30 @@  discard block
 block discarded – undo
834 834
 
835 835
                     <?php
836 836
                     // Here we list the shorthand days of the week so it can be used in translation.
837
-                    __("Mon",'geodirectory');
838
-                    __("Tue",'geodirectory');
839
-                    __("Wed",'geodirectory');
840
-                    __("Thu",'geodirectory');
841
-                    __("Fri",'geodirectory');
842
-                    __("Sat",'geodirectory');
843
-                    __("Sun",'geodirectory');
837
+                    __("Mon", 'geodirectory');
838
+                    __("Tue", 'geodirectory');
839
+                    __("Wed", 'geodirectory');
840
+                    __("Thu", 'geodirectory');
841
+                    __("Fri", 'geodirectory');
842
+                    __("Sat", 'geodirectory');
843
+                    __("Sun", 'geodirectory');
844 844
                     ?>
845 845
 
846 846
                     labels = [
847
-                        "<?php _e(date('D', strtotime("+1 day")),'geodirectory'); ?>",
848
-                        "<?php _e(date('D', strtotime("+2 day")),'geodirectory'); ?>",
849
-                        "<?php _e(date('D', strtotime("+3 day")),'geodirectory'); ?>",
850
-                        "<?php _e(date('D', strtotime("+4 day")),'geodirectory'); ?>",
851
-                        "<?php _e(date('D', strtotime("+5 day")),'geodirectory'); ?>",
852
-                        "<?php _e(date('D', strtotime("+6 day")),'geodirectory'); ?>",
853
-                        "<?php _e(date('D', strtotime("+7 day")),'geodirectory'); ?>"
847
+                        "<?php _e(date('D', strtotime("+1 day")), 'geodirectory'); ?>",
848
+                        "<?php _e(date('D', strtotime("+2 day")), 'geodirectory'); ?>",
849
+                        "<?php _e(date('D', strtotime("+3 day")), 'geodirectory'); ?>",
850
+                        "<?php _e(date('D', strtotime("+4 day")), 'geodirectory'); ?>",
851
+                        "<?php _e(date('D', strtotime("+5 day")), 'geodirectory'); ?>",
852
+                        "<?php _e(date('D', strtotime("+6 day")), 'geodirectory'); ?>",
853
+                        "<?php _e(date('D', strtotime("+7 day")), 'geodirectory'); ?>"
854 854
                     ];
855 855
 
856 856
                     var data = {
857 857
                         labels : labels,
858 858
                         datasets : [
859 859
                             {
860
-                                label: '<?php _e('Last Week', 'geodirectory');?>',
860
+                                label: '<?php _e('Last Week', 'geodirectory'); ?>',
861 861
                                 fillColor : "rgba(220,220,220,0.5)",
862 862
                                 strokeColor : "rgba(220,220,220,1)",
863 863
                                 pointColor : "rgba(220,220,220,1)",
@@ -865,7 +865,7 @@  discard block
 block discarded – undo
865 865
                                 data : data2
866 866
                             },
867 867
                             {
868
-                                label: '<?php _e('This Week', 'geodirectory');?>',
868
+                                label: '<?php _e('This Week', 'geodirectory'); ?>',
869 869
                                 fillColor : "rgba(151,187,205,0.5)",
870 870
                                 strokeColor : "rgba(151,187,205,1)",
871 871
                                 pointColor : "rgba(151,187,205,1)",
@@ -1072,18 +1072,18 @@  discard block
 block discarded – undo
1072 1072
         </style>
1073 1073
         <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.min.js"></script>
1074 1074
         <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.2/moment.min.js"></script>
1075
-        <button type="button" class="gdga-show-analytics"><?php _e('Show Google Analytics', 'geodirectory');?></button>
1075
+        <button type="button" class="gdga-show-analytics"><?php _e('Show Google Analytics', 'geodirectory'); ?></button>
1076 1076
         <span id="ga_stats" class="gdga-analytics-box" style="display:none">
1077
-            <div id="ga-analytics-title"><?php _e("Analytics", 'geodirectory');?></div>
1077
+            <div id="ga-analytics-title"><?php _e("Analytics", 'geodirectory'); ?></div>
1078 1078
             <div id="gd-active-users-container">
1079
-                <div class="gd-ActiveUsers"><i id="gdga-loader-icon" class="fa fa-refresh fa-spin" title="<?php esc_attr_e("Refresh", 'geodirectory');?>"></i><?php _e("Active Users:", 'geodirectory');?>
1079
+                <div class="gd-ActiveUsers"><i id="gdga-loader-icon" class="fa fa-refresh fa-spin" title="<?php esc_attr_e("Refresh", 'geodirectory'); ?>"></i><?php _e("Active Users:", 'geodirectory'); ?>
1080 1080
                     <b class="gd-ActiveUsers-value">0</b>
1081 1081
                 </div>
1082 1082
             </div>
1083 1083
             <select id="gdga-select-analytic" onchange="gdga_select_option();" style="display: none;">
1084
-                <option value="weeks"><?php _e("Last Week vs This Week", 'geodirectory');?></option>
1085
-                <option value="years"><?php _e("This Year vs Last Year", 'geodirectory');?></option>
1086
-                <option value="country"><?php _e("Top Countries", 'geodirectory');?></option>
1084
+                <option value="weeks"><?php _e("Last Week vs This Week", 'geodirectory'); ?></option>
1085
+                <option value="years"><?php _e("This Year vs Last Year", 'geodirectory'); ?></option>
1086
+                <option value="country"><?php _e("Top Countries", 'geodirectory'); ?></option>
1087 1087
             </select>
1088 1088
             <div class="Chartjs-figure" id="gdga-chart-container"></div>
1089 1089
             <ol class="Chartjs-legend" id="gdga-legend-container"></ol>
@@ -1099,8 +1099,8 @@  discard block
 block discarded – undo
1099 1099
     do_action('geodir_after_google_analytics');
1100 1100
     $content_html = ob_get_clean();
1101 1101
     if (trim($content_html) != '')
1102
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">' . $content_html . '</div>';
1103
-    if ((int)get_option('geodir_disable_google_analytics_section') != 1) {
1102
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">'.$content_html.'</div>';
1103
+    if ((int) get_option('geodir_disable_google_analytics_section') != 1) {
1104 1104
         /**
1105 1105
          * Filter the geodir_edit_post_link() function content.
1106 1106
          *
@@ -1156,10 +1156,10 @@  discard block
 block discarded – undo
1156 1156
        
1157 1157
 	   $reviews_text = $comment_count > 1 ? __("reviews", 'geodirectory') : __("review", 'geodirectory');
1158 1158
 	   
1159
-	   $html .= '<span itemprop="rating" itemscope itemtype="http://data-vocabulary.org/Rating"><span class="rating" itemprop="average" content="' . $post_avgratings . '">' . $post_avgratings . '</span> / <span itemprop="best" content="5">5</span> ' . __("based on", 'geodirectory') . ' </span><span class="count" itemprop="count" content="' . $comment_count . '">' . $comment_count . ' ' . $reviews_text . '</span><br />';
1159
+	   $html .= '<span itemprop="rating" itemscope itemtype="http://data-vocabulary.org/Rating"><span class="rating" itemprop="average" content="'.$post_avgratings.'">'.$post_avgratings.'</span> / <span itemprop="best" content="5">5</span> '.__("based on", 'geodirectory').' </span><span class="count" itemprop="count" content="'.$comment_count.'">'.$comment_count.' '.$reviews_text.'</span><br />';
1160 1160
 
1161 1161
         $html .= '<span class="item">';
1162
-        $html .= '<span class="fn" itemprop="itemreviewed">' . $post->post_title . '</span>';
1162
+        $html .= '<span class="fn" itemprop="itemreviewed">'.$post->post_title.'</span>';
1163 1163
 
1164 1164
         if ($post_images) {
1165 1165
             foreach ($post_images as $img) {
@@ -1169,7 +1169,7 @@  discard block
 block discarded – undo
1169 1169
         }
1170 1170
 
1171 1171
         if (isset($post_img) && $post_img) {
1172
-            $html .= '<br /><img src="' . $post_img . '" class="photo" alt="' . esc_attr($post->post_title) . '" itemprop="photo" content="' . $post_img . '" class="photo" />';
1172
+            $html .= '<br /><img src="'.$post_img.'" class="photo" alt="'.esc_attr($post->post_title).'" itemprop="photo" content="'.$post_img.'" class="photo" />';
1173 1173
         }
1174 1174
 
1175 1175
         $html .= '</span>';
@@ -1196,9 +1196,9 @@  discard block
 block discarded – undo
1196 1196
     do_action('geodir_after_detail_page_review_rating');
1197 1197
     $content_html = ob_get_clean();
1198 1198
     if (trim($content_html) != '') {
1199
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">' . $content_html . '</div>';
1199
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">'.$content_html.'</div>';
1200 1200
     }
1201
-    if ((int)get_option('geodir_disable_rating_info_section') != 1) {
1201
+    if ((int) get_option('geodir_disable_rating_info_section') != 1) {
1202 1202
         /**
1203 1203
          * Filter the geodir_detail_page_review_rating() function content.
1204 1204
          *
@@ -1237,8 +1237,8 @@  discard block
 block discarded – undo
1237 1237
 
1238 1238
     $content_html = ob_get_clean();
1239 1239
     if (trim($content_html) != '')
1240
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">' . $content_html . '</div>';
1241
-    if ((int)get_option('geodir_disable_listing_info_section') != 1) {
1240
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">'.$content_html.'</div>';
1241
+    if ((int) get_option('geodir_disable_listing_info_section') != 1) {
1242 1242
         /**
1243 1243
          * Filter the output html for function geodir_detail_page_more_info().
1244 1244
          *
@@ -1336,7 +1336,7 @@  discard block
 block discarded – undo
1336 1336
 		'gd_allowed_img_types' => !empty($allowed_img_types) ? implode(',', $allowed_img_types) : '',
1337 1337
 		'geodir_txt_form_wait' => __('Wait...', 'geodirectory'),
1338 1338
 		'geodir_txt_form_searching' => __('Searching...', 'geodirectory'),
1339
-		'fa_rating' => (int)get_option('geodir_reviewrating_enable_font_awesome') == 1 ? 1 : '',
1339
+		'fa_rating' => (int) get_option('geodir_reviewrating_enable_font_awesome') == 1 ? 1 : '',
1340 1340
 		'reviewrating' => defined('GEODIRREVIEWRATING_VERSION') ? 1 : '',
1341 1341
         'geodir_map_name' => geodir_map_name(),
1342 1342
     );
@@ -1354,10 +1354,10 @@  discard block
 block discarded – undo
1354 1354
     foreach ($arr_alert_msg as $key => $value) {
1355 1355
         if (!is_scalar($value))
1356 1356
             continue;
1357
-        $arr_alert_msg[$key] = html_entity_decode((string)$value, ENT_QUOTES, 'UTF-8');
1357
+        $arr_alert_msg[$key] = html_entity_decode((string) $value, ENT_QUOTES, 'UTF-8');
1358 1358
     }
1359 1359
 
1360
-    $script = "var geodir_all_js_msg = " . json_encode($arr_alert_msg) . ';';
1360
+    $script = "var geodir_all_js_msg = ".json_encode($arr_alert_msg).';';
1361 1361
     echo '<script>';
1362 1362
     echo $script;
1363 1363
     echo '</script>';
@@ -1445,7 +1445,7 @@  discard block
 block discarded – undo
1445 1445
         $geodir_old_sidebars = get_option('geodir_sidebars');
1446 1446
         if (is_array($geodir_old_sidebars)) {
1447 1447
             foreach ($geodir_old_sidebars as $key => $val) {
1448
-                if(0 === strpos($key, 'geodir_'))// if gd widget
1448
+                if (0 === strpos($key, 'geodir_'))// if gd widget
1449 1449
                 {
1450 1450
                     $sidebars_widgets[$key] = $geodir_old_sidebars[$key];
1451 1451
                 }
@@ -1524,7 +1524,7 @@  discard block
 block discarded – undo
1524 1524
         global $post;
1525 1525
         $term_condition = '';
1526 1526
         if (isset($_REQUEST['backandedit'])) {
1527
-            $post = (object)$gd_session->get('listing');
1527
+            $post = (object) $gd_session->get('listing');
1528 1528
             $term_condition = isset($post->geodir_accept_term_condition) ? $post->geodir_accept_term_condition : '';
1529 1529
         }
1530 1530
 
@@ -1538,7 +1538,7 @@  discard block
 block discarded – undo
1538 1538
                     echo 'checked="checked"';
1539 1539
                 } ?> field_type="checkbox" name="geodir_accept_term_condition" id="geodir_accept_term_condition"
1540 1540
                        class="geodir_textfield" value="1"
1541
-                       style="display:inline-block"/><a href="<?php $terms_page = get_option('geodir_term_condition_page'); if($terms_page){ echo get_permalink($terms_page);}?>" target="_blank"><?php _e('Please accept our terms and conditions', 'geodirectory'); ?></a>
1541
+                       style="display:inline-block"/><a href="<?php $terms_page = get_option('geodir_term_condition_page'); if ($terms_page) { echo get_permalink($terms_page); }?>" target="_blank"><?php _e('Please accept our terms and conditions', 'geodirectory'); ?></a>
1542 1542
 				</span>
1543 1543
             </div>
1544 1544
             <span class="geodir_message_error"><?php if (isset($required_msg)) {
@@ -1578,7 +1578,7 @@  discard block
 block discarded – undo
1578 1578
         /** This action is documented in geodirectory_template_actions.php */
1579 1579
         $desc_limit = apply_filters('geodir_description_field_desc_limit', '');
1580 1580
         
1581
-        if (!($desc_limit === '' || (int)$desc_limit > 0)) {
1581
+        if (!($desc_limit === '' || (int) $desc_limit > 0)) {
1582 1582
             $is_display = false;
1583 1583
         }
1584 1584
     }
@@ -1626,16 +1626,16 @@  discard block
 block discarded – undo
1626 1626
     global $wpdb, $plugin_prefix;
1627 1627
 	
1628 1628
 	// Remove unused virtual page
1629
-	$listings_page_id = (int)get_option('geodir_listing_page');
1629
+	$listings_page_id = (int) get_option('geodir_listing_page');
1630 1630
 	if ($listings_page_id) {
1631
-		$wpdb->query($wpdb->prepare("DELETE FROM " . $wpdb->posts . " WHERE ID=%d AND post_name = %s AND post_type=%s", array($listings_page_id, 'listings', 'page')));
1631
+		$wpdb->query($wpdb->prepare("DELETE FROM ".$wpdb->posts." WHERE ID=%d AND post_name = %s AND post_type=%s", array($listings_page_id, 'listings', 'page')));
1632 1632
         delete_option('geodir_listing_page');
1633 1633
 	}
1634 1634
 
1635 1635
     if (!get_option('geodir_changes_in_custom_fields_table')) {
1636 1636
         $wpdb->query(
1637 1637
             $wpdb->prepare(
1638
-                "UPDATE " . GEODIR_CUSTOM_FIELDS_TABLE . " SET is_default=%s, is_admin=%s WHERE is_default=%s",
1638
+                "UPDATE ".GEODIR_CUSTOM_FIELDS_TABLE." SET is_default=%s, is_admin=%s WHERE is_default=%s",
1639 1639
                 array('1', '1', 'admin')
1640 1640
             )
1641 1641
         );
@@ -1643,9 +1643,9 @@  discard block
 block discarded – undo
1643 1643
 
1644 1644
         /* --- terms meta value set --- */
1645 1645
 
1646
-        update_option('geodir_default_marker_icon', geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png');
1646
+        update_option('geodir_default_marker_icon', geodir_plugin_url().'/geodirectory-functions/map-functions/icons/pin.png');
1647 1647
 
1648
-        $options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "options WHERE option_name LIKE %s", array('%tax_meta_%')));
1648
+        $options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM ".$wpdb->prefix."options WHERE option_name LIKE %s", array('%tax_meta_%')));
1649 1649
 
1650 1650
         if (!empty($options_data)) {
1651 1651
 
@@ -1653,7 +1653,7 @@  discard block
 block discarded – undo
1653 1653
 
1654 1654
                 $option_val = str_replace('tax_meta_', '', $optobj->option_name);
1655 1655
 
1656
-                $taxonomies_data = $wpdb->get_results($wpdb->prepare("SELECT taxonomy FROM " . $wpdb->prefix . "term_taxonomy WHERE taxonomy LIKE %s AND term_id=%d", array('%category%', $option_val)));
1656
+                $taxonomies_data = $wpdb->get_results($wpdb->prepare("SELECT taxonomy FROM ".$wpdb->prefix."term_taxonomy WHERE taxonomy LIKE %s AND term_id=%d", array('%category%', $option_val)));
1657 1657
 
1658 1658
                 if (!empty($taxonomies_data)) {
1659 1659
 
@@ -1662,17 +1662,17 @@  discard block
 block discarded – undo
1662 1662
                         $taxObject = get_taxonomy($taxobj->taxonomy);
1663 1663
                         $post_type = $taxObject->object_type[0];
1664 1664
 
1665
-                        $opt_value = 'tax_meta_' . $post_type . '_' . $option_val;
1665
+                        $opt_value = 'tax_meta_'.$post_type.'_'.$option_val;
1666 1666
 
1667
-                        $duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM " . $wpdb->prefix . "options WHERE option_name=%s", array('tax_meta_' . $option_val)));
1667
+                        $duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM ".$wpdb->prefix."options WHERE option_name=%s", array('tax_meta_'.$option_val)));
1668 1668
 
1669 1669
                         if ($duplicate_data) {
1670 1670
 
1671
-                            $wpdb->query($wpdb->prepare("UPDATE " . $wpdb->prefix . "options SET	option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id)));
1671
+                            $wpdb->query($wpdb->prepare("UPDATE ".$wpdb->prefix."options SET	option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id)));
1672 1672
 
1673 1673
                         } else {
1674 1674
 
1675
-                            $wpdb->query($wpdb->prepare("INSERT INTO " . $wpdb->prefix . "options (option_name,option_value,autoload) VALUES (%s, %s, %s)", array($opt_value, $optobj->option_value, $optobj->autoload)));
1675
+                            $wpdb->query($wpdb->prepare("INSERT INTO ".$wpdb->prefix."options (option_name,option_value,autoload) VALUES (%s, %s, %s)", array($opt_value, $optobj->option_value, $optobj->autoload)));
1676 1676
 
1677 1677
                         }
1678 1678
 
@@ -1706,14 +1706,14 @@  discard block
 block discarded – undo
1706 1706
 
1707 1707
     global $wpdb, $table_prefix;
1708 1708
 
1709
-    $slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($slug)));
1709
+    $slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM ".$table_prefix."terms WHERE slug=%s", array($slug)));
1710 1710
 
1711 1711
     if ($slug_exists) {
1712 1712
 
1713 1713
         $suffix = 1;
1714 1714
         do {
1715
-            $alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1716
-            $location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($alt_location_name)));
1715
+            $alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1))."-$suffix";
1716
+            $location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM ".$table_prefix."terms WHERE slug=%s", array($alt_location_name)));
1717 1717
             $suffix++;
1718 1718
         } while ($location_slug_check && $suffix < 100);
1719 1719
 
@@ -1767,7 +1767,7 @@  discard block
 block discarded – undo
1767 1767
 
1768 1768
         $suffix = 1;
1769 1769
         do {
1770
-            $new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1770
+            $new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1))."-$suffix";
1771 1771
 
1772 1772
             /** This action is documented in geodirectory_hooks_actions.php */
1773 1773
             $term_slug_check = apply_filters('geodir_term_slug_is_exists', false, $new_slug, $term_id);
@@ -1779,7 +1779,7 @@  discard block
 block discarded – undo
1779 1779
 
1780 1780
         //wp_update_term( $term_id, $taxonomy, array('slug' => $slug) );
1781 1781
 
1782
-        $wpdb->query($wpdb->prepare("UPDATE " . $table_prefix . "terms SET slug=%s WHERE term_id=%d", array($slug, $term_id)));
1782
+        $wpdb->query($wpdb->prepare("UPDATE ".$table_prefix."terms SET slug=%s WHERE term_id=%d", array($slug, $term_id)));
1783 1783
 
1784 1784
     }
1785 1785
 	
@@ -1788,18 +1788,18 @@  discard block
 block discarded – undo
1788 1788
 	$post_type = !empty($taxonomy_obj) ? $taxonomy_obj->object_type[0] : NULL;
1789 1789
 	
1790 1790
 	$post_types = geodir_get_posttypes();
1791
-	if ($post_type && in_array($post_type, $post_types) && $post_type . '_tags' == $taxonomy) {		
1792
-		$posts_obj = $wpdb->get_results($wpdb->prepare("SELECT object_id FROM " . $wpdb->term_relationships . " WHERE term_taxonomy_id = %d", array($tt_id)));
1791
+	if ($post_type && in_array($post_type, $post_types) && $post_type.'_tags' == $taxonomy) {		
1792
+		$posts_obj = $wpdb->get_results($wpdb->prepare("SELECT object_id FROM ".$wpdb->term_relationships." WHERE term_taxonomy_id = %d", array($tt_id)));
1793 1793
 		
1794 1794
 		if (!empty($posts_obj)) {
1795 1795
 			foreach ($posts_obj as $post_obj) {
1796 1796
 				$post_id = $post_obj->object_id;
1797 1797
 				
1798
-				$raw_tags = wp_get_object_terms($post_id, $post_type . '_tags', array('fields' => 'names'));
1798
+				$raw_tags = wp_get_object_terms($post_id, $post_type.'_tags', array('fields' => 'names'));
1799 1799
 				$post_tags = !empty($raw_tags) ? implode(',', $raw_tags) : '';
1800 1800
 				
1801
-				$listing_table = $plugin_prefix . $post_type . '_detail';
1802
-				$wpdb->query($wpdb->prepare("UPDATE " . $listing_table . " SET post_tags=%s WHERE post_id =%d", array($post_tags, $post_id)));
1801
+				$listing_table = $plugin_prefix.$post_type.'_detail';
1802
+				$wpdb->query($wpdb->prepare("UPDATE ".$listing_table." SET post_tags=%s WHERE post_id =%d", array($post_tags, $post_id)));
1803 1803
 			}
1804 1804
 		}
1805 1805
 	}
@@ -1833,7 +1833,7 @@  discard block
 block discarded – undo
1833 1833
     if ($country_slug == $slug || $region_slug == $slug || $city_slug == $slug)
1834 1834
         return $slug_exists = true;
1835 1835
 
1836
-    if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s AND term_id != %d", array($slug, $term_id))))
1836
+    if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM ".$table_prefix."terms WHERE slug=%s AND term_id != %d", array($slug, $term_id))))
1837 1837
         return $slug_exists = true;
1838 1838
 
1839 1839
     return $slug_exists;
@@ -1873,43 +1873,43 @@  discard block
 block discarded – undo
1873 1873
 
1874 1874
 
1875 1875
     $gd_page = '';
1876
-    if(geodir_is_page('home')){
1876
+    if (geodir_is_page('home')) {
1877 1877
         $gd_page = 'home';
1878 1878
         $title = (get_option('geodir_meta_title_homepage')) ? get_option('geodir_meta_title_homepage') : $title;
1879 1879
     }
1880
-    elseif(geodir_is_page('detail')){
1880
+    elseif (geodir_is_page('detail')) {
1881 1881
         $gd_page = 'detail';
1882 1882
         $title = (get_option('geodir_meta_title_detail')) ? get_option('geodir_meta_title_detail') : $title;
1883 1883
     }
1884
-    elseif(geodir_is_page('pt')){
1884
+    elseif (geodir_is_page('pt')) {
1885 1885
         $gd_page = 'pt';
1886 1886
         $title = (get_option('geodir_meta_title_pt')) ? get_option('geodir_meta_title_pt') : $title;
1887 1887
     }
1888
-    elseif(geodir_is_page('listing')){
1888
+    elseif (geodir_is_page('listing')) {
1889 1889
         $gd_page = 'listing';
1890 1890
         $title = (get_option('geodir_meta_title_listing')) ? get_option('geodir_meta_title_listing') : $title;
1891 1891
     }
1892
-    elseif(geodir_is_page('location')){
1892
+    elseif (geodir_is_page('location')) {
1893 1893
         $gd_page = 'location';
1894 1894
         $title = (get_option('geodir_meta_title_location')) ? get_option('geodir_meta_title_location') : $title;
1895 1895
     }
1896
-    elseif(geodir_is_page('search')){
1896
+    elseif (geodir_is_page('search')) {
1897 1897
         $gd_page = 'search';
1898 1898
         $title = (get_option('geodir_meta_title_search')) ? get_option('geodir_meta_title_search') : $title;
1899 1899
     }
1900
-    elseif(geodir_is_page('add-listing')){
1900
+    elseif (geodir_is_page('add-listing')) {
1901 1901
         $gd_page = 'add-listing';
1902 1902
         $title = (get_option('geodir_meta_title_add-listing')) ? get_option('geodir_meta_title_add-listing') : $title;
1903 1903
     }
1904
-    elseif(geodir_is_page('author')){
1904
+    elseif (geodir_is_page('author')) {
1905 1905
         $gd_page = 'author';
1906 1906
         $title = (get_option('geodir_meta_title_author')) ? get_option('geodir_meta_title_author') : $title;
1907 1907
     }
1908
-    elseif(geodir_is_page('login')){
1908
+    elseif (geodir_is_page('login')) {
1909 1909
         $gd_page = 'login';
1910 1910
         $title = (get_option('geodir_meta_title_login')) ? get_option('geodir_meta_title_login') : $title;
1911 1911
     }
1912
-    elseif(geodir_is_page('listing-success')){
1912
+    elseif (geodir_is_page('listing-success')) {
1913 1913
         $gd_page = 'listing-success';
1914 1914
         $title = (get_option('geodir_meta_title_listing-success')) ? get_option('geodir_meta_title_listing-success') : $title;
1915 1915
     }
@@ -1941,12 +1941,12 @@  discard block
 block discarded – undo
1941 1941
 
1942 1942
     if (!get_option('geodir_set_post_attachments')) {
1943 1943
 
1944
-        require_once(ABSPATH . 'wp-admin/includes/image.php');
1945
-        require_once(ABSPATH . 'wp-admin/includes/file.php');
1944
+        require_once(ABSPATH.'wp-admin/includes/image.php');
1945
+        require_once(ABSPATH.'wp-admin/includes/file.php');
1946 1946
 
1947 1947
         $all_postypes = geodir_get_posttypes();
1948 1948
 
1949
-        foreach($all_postypes as $post_type){
1949
+        foreach ($all_postypes as $post_type) {
1950 1950
             $args = array(
1951 1951
                 'posts_per_page' => -1,
1952 1952
                 'post_type' => $post_type,
@@ -2040,7 +2040,7 @@  discard block
 block discarded – undo
2040 2040
 {
2041 2041
     $user_id = get_current_user_id();
2042 2042
 
2043
-    if(!$user_id){return $post;}
2043
+    if (!$user_id) {return $post; }
2044 2044
 
2045 2045
     $gd_post_types = geodir_get_posttypes();
2046 2046
 
@@ -2149,7 +2149,7 @@  discard block
 block discarded – undo
2149 2149
 
2150 2150
         if (array_key_exists('post_video', $tabs_arr)) {
2151 2151
 
2152
-            $field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_video', $post_type)));
2152
+            $field_title = $wpdb->get_var($wpdb->prepare("select site_title from ".GEODIR_CUSTOM_FIELDS_TABLE." where htmlvar_name = %s and post_type = %s ", array('geodir_video', $post_type)));
2153 2153
 
2154 2154
             if (isset($tabs_arr['post_video']['heading_text']) && $field_title != '')
2155 2155
                 $tabs_arr['post_video']['heading_text'] = $field_title;
@@ -2157,7 +2157,7 @@  discard block
 block discarded – undo
2157 2157
 
2158 2158
         if (array_key_exists('special_offers', $tabs_arr)) {
2159 2159
 
2160
-            $field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_special_offers', $post_type)));
2160
+            $field_title = $wpdb->get_var($wpdb->prepare("select site_title from ".GEODIR_CUSTOM_FIELDS_TABLE." where htmlvar_name = %s and post_type = %s ", array('geodir_special_offers', $post_type)));
2161 2161
 
2162 2162
             if (isset($tabs_arr['special_offers']['heading_text']) && $field_title != '')
2163 2163
                 $tabs_arr['special_offers']['heading_text'] = $field_title;
@@ -2178,7 +2178,7 @@  discard block
 block discarded – undo
2178 2178
  */
2179 2179
 function geodir_remove_template_redirect_actions()
2180 2180
 {
2181
-    if (geodir_is_page('login')){
2181
+    if (geodir_is_page('login')) {
2182 2182
         remove_all_actions('template_redirect');
2183 2183
         remove_action('init', 'avia_modify_front', 10);
2184 2184
     }
@@ -2225,25 +2225,25 @@  discard block
 block discarded – undo
2225 2225
         $split_img_file_path = isset($split_img_path[1]) ? $split_img_path[1] : '';
2226 2226
 
2227 2227
         $wpdb->query(
2228
-            $wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = %d AND file=%s ",
2228
+            $wpdb->prepare("DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id = %d AND file=%s ",
2229 2229
                 array($post_id, $split_img_file_path)
2230 2230
             )
2231 2231
         );
2232 2232
 
2233 2233
         $attachment_data = $wpdb->get_row(
2234
-            $wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=%d",
2234
+            $wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id=%d",
2235 2235
                 array($post_id)
2236 2236
             )
2237 2237
         );
2238 2238
 
2239 2239
         if (!empty($attachment_data)) {
2240
-            $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2240
+            $wpdb->query("UPDATE ".GEODIR_ATTACHMENT_TABLE." SET menu_order=1 WHERE ID=".$attachment_data->ID);
2241 2241
         }
2242 2242
 
2243 2243
 
2244
-        $table_name = $plugin_prefix . $post_type . '_detail';
2244
+        $table_name = $plugin_prefix.$post_type.'_detail';
2245 2245
 
2246
-        $wpdb->query("UPDATE " . $table_name . " SET featured_image='' WHERE post_id =" . $post_id);
2246
+        $wpdb->query("UPDATE ".$table_name." SET featured_image='' WHERE post_id =".$post_id);
2247 2247
 
2248 2248
         geodir_set_wp_featured_image($post_id);
2249 2249
 
@@ -2271,9 +2271,9 @@  discard block
 block discarded – undo
2271 2271
 
2272 2272
     foreach ($all_postypes as $posttype) {
2273 2273
 
2274
-        $tablename = $plugin_prefix . $posttype . '_detail';
2274
+        $tablename = $plugin_prefix.$posttype.'_detail';
2275 2275
 
2276
-        $get_post_data = $wpdb->get_results("SELECT post_id FROM " . $tablename);
2276
+        $get_post_data = $wpdb->get_results("SELECT post_id FROM ".$tablename);
2277 2277
 
2278 2278
         if (!empty($get_post_data)) {
2279 2279
 
@@ -2281,7 +2281,7 @@  discard block
 block discarded – undo
2281 2281
 
2282 2282
                 $post_id = $data->post_id;
2283 2283
 
2284
-                $attachment_data = $wpdb->get_results("SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id =" . $post_id . " AND file!=''");
2284
+                $attachment_data = $wpdb->get_results("SELECT * FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id =".$post_id." AND file!=''");
2285 2285
 
2286 2286
                 if (!empty($attachment_data)) {
2287 2287
 
@@ -2298,22 +2298,22 @@  discard block
 block discarded – undo
2298 2298
 
2299 2299
                         $file_name = $file_info['basename'];
2300 2300
 
2301
-                        $img_arr['path'] = $uploads_path . $sub_dir . '/' . $file_name;
2301
+                        $img_arr['path'] = $uploads_path.$sub_dir.'/'.$file_name;
2302 2302
 
2303 2303
                         if (!file_exists($img_arr['path'])) {
2304 2304
 
2305
-                            $wpdb->query("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE ID=" . $attach->ID);
2305
+                            $wpdb->query("DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE ID=".$attach->ID);
2306 2306
 
2307 2307
                         }
2308 2308
 
2309 2309
                     }
2310 2310
 
2311
-                    $attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=" . $post_id . " GROUP BY post_id");
2311
+                    $attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id=".$post_id." GROUP BY post_id");
2312 2312
 
2313 2313
                     if (!empty($attachment_data)) {
2314 2314
 
2315 2315
                         if ($attachment_data->ID)
2316
-                            $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2316
+                            $wpdb->query("UPDATE ".GEODIR_ATTACHMENT_TABLE." SET menu_order=1 WHERE ID=".$attachment_data->ID);
2317 2317
 
2318 2318
                     } else {
2319 2319
 
@@ -2327,7 +2327,7 @@  discard block
 block discarded – undo
2327 2327
 
2328 2328
                     }
2329 2329
 
2330
-                    $wpdb->query("UPDATE " . $tablename . " SET featured_image='' WHERE post_id =" . $post_id);
2330
+                    $wpdb->query("UPDATE ".$tablename." SET featured_image='' WHERE post_id =".$post_id);
2331 2331
 
2332 2332
                     geodir_set_wp_featured_image($post_id);
2333 2333
 
@@ -2356,7 +2356,7 @@  discard block
 block discarded – undo
2356 2356
 {
2357 2357
 
2358 2358
     if (!get_option('geodir_default_rating_star_icon')) {
2359
-        update_option('geodir_default_rating_star_icon', geodir_plugin_url() . '/geodirectory-assets/images/stars.png');
2359
+        update_option('geodir_default_rating_star_icon', geodir_plugin_url().'/geodirectory-assets/images/stars.png');
2360 2360
     }
2361 2361
 
2362 2362
 }
@@ -2373,10 +2373,10 @@  discard block
 block discarded – undo
2373 2373
  * @global string $plugin_prefix Geodirectory plugin table prefix.
2374 2374
  * @return array User listing count for each post type.
2375 2375
  */
2376
-function geodir_user_post_listing_count($user_id=null)
2376
+function geodir_user_post_listing_count($user_id = null)
2377 2377
 {
2378 2378
     global $wpdb, $plugin_prefix, $current_user;
2379
-    if(!$user_id){
2379
+    if (!$user_id) {
2380 2380
         $user_id = $current_user->ID;
2381 2381
     }
2382 2382
 
@@ -2387,7 +2387,7 @@  discard block
 block discarded – undo
2387 2387
     $user_listing = array();
2388 2388
     if (is_array($all_posts) && !empty($all_posts)) {
2389 2389
         foreach ($all_posts as $ptype) {
2390
-            $total_posts = $wpdb->get_var("SELECT count( ID ) FROM " . $wpdb->prefix . "posts WHERE post_author=" . $user_id . " AND post_type='" . $ptype . "' AND ( post_status = 'publish' OR post_status = 'draft' OR post_status = 'private' )");
2390
+            $total_posts = $wpdb->get_var("SELECT count( ID ) FROM ".$wpdb->prefix."posts WHERE post_author=".$user_id." AND post_type='".$ptype."' AND ( post_status = 'publish' OR post_status = 'draft' OR post_status = 'private' )");
2391 2391
 
2392 2392
             if ($total_posts > 0) {
2393 2393
                 $user_listing[$ptype] = $total_posts;
@@ -2488,9 +2488,9 @@  discard block
 block discarded – undo
2488 2488
                     }
2489 2489
 
2490 2490
                     if (strpos($type['field_icon'], 'http') !== false) {
2491
-                        $field_icon = ' background: url(' . $type['field_icon'] . ') no-repeat left center;background-size:18px 18px;padding-left: 21px;';
2491
+                        $field_icon = ' background: url('.$type['field_icon'].') no-repeat left center;background-size:18px 18px;padding-left: 21px;';
2492 2492
                     } elseif (strpos($type['field_icon'], 'fa fa-') !== false) {
2493
-                        $field_icon = '<i class="' . $type['field_icon'] . '"></i>';
2493
+                        $field_icon = '<i class="'.$type['field_icon'].'"></i>';
2494 2494
                     }
2495 2495
 
2496 2496
                     switch ($type['type']) {
@@ -2498,7 +2498,7 @@  discard block
 block discarded – undo
2498 2498
                             $i = 0;
2499 2499
                             $fieldset_count++;
2500 2500
                             $field_set_start = 1;
2501
-                            $fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_' . $fieldset_count;
2501
+                            $fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_'.$fieldset_count;
2502 2502
                             $fieldset_arr[$fieldset_count]['label'] = $label;
2503 2503
                         }
2504 2504
                             break;
@@ -2531,7 +2531,7 @@  discard block
 block discarded – undo
2531 2531
                             // all search engines that use the nofollow value exclude links that use it from their ranking calculation
2532 2532
                             $rel = strpos($website, get_site_url()) !== false ? '' : 'rel="nofollow"';
2533 2533
 
2534
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '"><span class="geodir-i-website" style="' . $field_icon . '">' . $field_icon_af . ' <a href="' . $website . '" target="_blank" ' . $rel . ' ><strong>' .
2534
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'"><span class="geodir-i-website" style="'.$field_icon.'">'.$field_icon_af.' <a href="'.$website.'" target="_blank" '.$rel.' ><strong>'.
2535 2535
                                 /**
2536 2536
                                  * Filer the custom field website name.
2537 2537
                                  *
@@ -2540,7 +2540,7 @@  discard block
 block discarded – undo
2540 2540
                                  * @param string $website The website address.
2541 2541
                                  * @param int $post->ID The post ID.
2542 2542
                                  */
2543
-                                apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID) . '</strong></a></span></div>';
2543
+                                apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID).'</strong></a></span></div>';
2544 2544
                         }
2545 2545
                             break;
2546 2546
                         case 'phone': {
@@ -2555,11 +2555,11 @@  discard block
 block discarded – undo
2555 2555
 
2556 2556
                             $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2557 2557
 
2558
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-contact" style="' . $field_icon . '">' . $field_icon_af;
2558
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-contact" style="'.$field_icon.'">'.$field_icon_af;
2559 2559
                             if ($field_set_start == 1 && $site_title != '') {
2560
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2560
+                                $html .= ' '.__($site_title, 'geodirectory').': ';
2561 2561
                             }
2562
-                            $html .= ' </span>' . stripslashes($post->{$type['htmlvar_name']}) . '</div>';
2562
+                            $html .= ' </span>'.stripslashes($post->{$type['htmlvar_name']}).'</div>';
2563 2563
                         }
2564 2564
                             break;
2565 2565
                         case 'time': {
@@ -2578,11 +2578,11 @@  discard block
 block discarded – undo
2578 2578
 
2579 2579
                             $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2580 2580
 
2581
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-time" style="' . $field_icon . '">' . $field_icon_af;
2581
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-time" style="'.$field_icon.'">'.$field_icon_af;
2582 2582
                             if ($field_set_start == 1 && $site_title != '') {
2583
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2583
+                                $html .= ' '.__($site_title, 'geodirectory').': ';
2584 2584
                             }
2585
-                            $html .= ' </span>' . stripslashes($value) . '</div>';
2585
+                            $html .= ' </span>'.stripslashes($value).'</div>';
2586 2586
                         }
2587 2587
                             break;
2588 2588
                         case 'datepicker': {
@@ -2592,8 +2592,8 @@  discard block
 block discarded – undo
2592 2592
                                 $date_format = $date_format['date_format'];
2593 2593
                             }
2594 2594
 
2595
-                            $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
2596
-                            $replace = array('d','j','l','m','n','F','Y');//PHP date format
2595
+                            $search = array('dd', 'd', 'DD', 'mm', 'm', 'MM', 'yy'); //jQuery UI datepicker format
2596
+                            $replace = array('d', 'j', 'l', 'm', 'n', 'F', 'Y'); //PHP date format
2597 2597
 
2598 2598
                             $date_format = str_replace($search, $replace, $date_format);
2599 2599
 
@@ -2614,11 +2614,11 @@  discard block
 block discarded – undo
2614 2614
 
2615 2615
                             $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2616 2616
 
2617
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-datepicker" style="' . $field_icon . '">' . $field_icon_af;
2617
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-datepicker" style="'.$field_icon.'">'.$field_icon_af;
2618 2618
                             if ($field_set_start == 1 && $site_title != '') {
2619
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2619
+                                $html .= ' '.__($site_title, 'geodirectory').': ';
2620 2620
                             }
2621
-                            $html .= ' </span>' . $value . '</div>';
2621
+                            $html .= ' </span>'.$value.'</div>';
2622 2622
                         }
2623 2623
                             break;
2624 2624
                         case 'text': {
@@ -2633,11 +2633,11 @@  discard block
 block discarded – undo
2633 2633
 
2634 2634
                             $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2635 2635
 
2636
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
2636
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-text" style="'.$field_icon.'">'.$field_icon_af;
2637 2637
                             if ($field_set_start == 1 && $site_title != '') {
2638
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2638
+                                $html .= ' '.__($site_title, 'geodirectory').': ';
2639 2639
                             }
2640
-                            $html .= ' </span>' . stripslashes($post->{$type['htmlvar_name']}) . '</div>';
2640
+                            $html .= ' </span>'.stripslashes($post->{$type['htmlvar_name']}).'</div>';
2641 2641
                         }
2642 2642
                             break;
2643 2643
                         case 'radio': {
@@ -2674,13 +2674,13 @@  discard block
 block discarded – undo
2674 2674
 
2675 2675
                                 $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2676 2676
 
2677
-                                $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-radio" style="' . $field_icon . '">' . $field_icon_af;
2677
+                                $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-radio" style="'.$field_icon.'">'.$field_icon_af;
2678 2678
 
2679 2679
                                 if ($field_set_start == 1 && $site_title != '') {
2680
-                                    $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2680
+                                    $html .= ' '.__($site_title, 'geodirectory').': ';
2681 2681
                                 }
2682 2682
 
2683
-                                $html .= ' </span>' . $html_val . '</div>';
2683
+                                $html .= ' </span>'.$html_val.'</div>';
2684 2684
                             }
2685 2685
                         }
2686 2686
                             break;
@@ -2688,7 +2688,7 @@  discard block
 block discarded – undo
2688 2688
                             $html_var = $type['htmlvar_name'];
2689 2689
                             $html_val = $type['htmlvar_name'];
2690 2690
 
2691
-                            if ((int)$post->{$html_var} == 1) {
2691
+                            if ((int) $post->{$html_var} == 1) {
2692 2692
 
2693 2693
                                 if ($post->{$type['htmlvar_name']} == '1') {
2694 2694
                                     $html_val = __('Yes', 'geodirectory');
@@ -2707,13 +2707,13 @@  discard block
 block discarded – undo
2707 2707
 
2708 2708
                                 $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2709 2709
 
2710
-                                $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-checkbox" style="' . $field_icon . '">' . $field_icon_af;
2710
+                                $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-checkbox" style="'.$field_icon.'">'.$field_icon_af;
2711 2711
 
2712 2712
                                 if ($field_set_start == 1 && $site_title != '') {
2713
-                                    $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2713
+                                    $html .= ' '.__($site_title, 'geodirectory').': ';
2714 2714
                                 }
2715 2715
 
2716
-                                $html .= ' </span>' . $html_val . '</div>';
2716
+                                $html .= ' </span>'.$html_val.'</div>';
2717 2717
                             }
2718 2718
                         }
2719 2719
                             break;
@@ -2743,11 +2743,11 @@  discard block
 block discarded – undo
2743 2743
 
2744 2744
                             $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2745 2745
 
2746
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
2746
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-select" style="'.$field_icon.'">'.$field_icon_af;
2747 2747
                             if ($field_set_start == 1 && $site_title != '') {
2748
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2748
+                                $html .= ' '.__($site_title, 'geodirectory').': ';
2749 2749
                             }
2750
-                            $html .= ' </span>' . $field_value . '</div>';
2750
+                            $html .= ' </span>'.$field_value.'</div>';
2751 2751
                         }
2752 2752
                             break;
2753 2753
                         case 'multiselect': {
@@ -2781,18 +2781,18 @@  discard block
 block discarded – undo
2781 2781
 
2782 2782
                             $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2783 2783
 
2784
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
2784
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-select" style="'.$field_icon.'">'.$field_icon_af;
2785 2785
                             if ($field_set_start == 1 && $site_title != '') {
2786
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2786
+                                $html .= ' '.__($site_title, 'geodirectory').': ';
2787 2787
                             }
2788 2788
                             $html .= ' </span>';
2789 2789
 
2790 2790
                             $html .= ' <span class="gd-multiselect-value-output gd-val-'.$type['htmlvar_name'].'" >';
2791 2791
 
2792 2792
                             if (count($option_values) > 1) {
2793
-                                $html .= "<span>".implode('</span>, <span>',$option_values)."</span>";
2793
+                                $html .= "<span>".implode('</span>, <span>', $option_values)."</span>";
2794 2794
                             } else {
2795
-                                $vals = explode(",",$post->{$type['htmlvar_name']});
2795
+                                $vals = explode(",", $post->{$type['htmlvar_name']});
2796 2796
                                 $html .= "<span>".implode('</span>, <span>', $vals)."</span>";
2797 2797
                             }
2798 2798
 
@@ -2816,11 +2816,11 @@  discard block
 block discarded – undo
2816 2816
 
2817 2817
                             $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2818 2818
 
2819
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af;
2819
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-email" style="'.$field_icon.'">'.$field_icon_af;
2820 2820
                             if ($field_set_start == 1 && $site_title != '') {
2821
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2821
+                                $html .= ' '.__($site_title, 'geodirectory').': ';
2822 2822
                             }
2823
-                            $html .= ' </span>' . stripslashes($post->{$type['htmlvar_name']}) . '</div>';
2823
+                            $html .= ' </span>'.stripslashes($post->{$type['htmlvar_name']}).'</div>';
2824 2824
                         }
2825 2825
                             break;
2826 2826
                         case 'textarea': {
@@ -2835,11 +2835,11 @@  discard block
 block discarded – undo
2835 2835
 
2836 2836
                             $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2837 2837
 
2838
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
2838
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-text" style="'.$field_icon.'">'.$field_icon_af;
2839 2839
                             if ($field_set_start == 1 && $site_title != '') {
2840
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2840
+                                $html .= ' '.__($site_title, 'geodirectory').': ';
2841 2841
                             }
2842
-                            $html .= '</span>' . wpautop(stripslashes($post->{$type['htmlvar_name']})) . '</div>';
2842
+                            $html .= '</span>'.wpautop(stripslashes($post->{$type['htmlvar_name']})).'</div>';
2843 2843
                         }
2844 2844
                             break;
2845 2845
                         case 'html': {
@@ -2854,11 +2854,11 @@  discard block
 block discarded – undo
2854 2854
 
2855 2855
                             $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2856 2856
 
2857
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
2857
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-text" style="'.$field_icon.'">'.$field_icon_af;
2858 2858
                             if ($field_set_start == 1 && $site_title != '') {
2859
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2859
+                                $html .= ' '.__($site_title, 'geodirectory').': ';
2860 2860
                             }
2861
-                            $html .= ' </span>' . wpautop(stripslashes($post->{$type['htmlvar_name']})) . '</div>';
2861
+                            $html .= ' </span>'.wpautop(stripslashes($post->{$type['htmlvar_name']})).'</div>';
2862 2862
                         }
2863 2863
                         break;
2864 2864
                         case 'file': {
@@ -2869,7 +2869,7 @@  discard block
 block discarded – undo
2869 2869
 
2870 2870
                                 if (!empty($files)) {
2871 2871
                                     $extra_fields = !empty($type['extra_fields']) ? maybe_unserialize($type['extra_fields']) : NULL;
2872
-                                    $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types'] ) ? $extra_fields['gd_file_types'] : '';
2872
+                                    $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types']) ? $extra_fields['gd_file_types'] : '';
2873 2873
                                
2874 2874
                                     $file_paths = '';
2875 2875
                                     foreach ($files as $file) {
@@ -2898,9 +2898,9 @@  discard block
 block discarded – undo
2898 2898
                                                 $file_paths .= '</a>';
2899 2899
                                                 $file_paths .= '</div>';
2900 2900
                                             } else {
2901
-                                                $ext_path = '_' . $html_var . '_';
2901
+                                                $ext_path = '_'.$html_var.'_';
2902 2902
                                                 $filename = explode($ext_path, $filename);
2903
-                                                $file_paths .= '<a href="' . $file . '" target="_blank">' . $filename[count($filename) - 1] . '</a>';
2903
+                                                $file_paths .= '<a href="'.$file.'" target="_blank">'.$filename[count($filename) - 1].'</a>';
2904 2904
                                             }
2905 2905
                                         }
2906 2906
                                     }
@@ -2917,13 +2917,13 @@  discard block
 block discarded – undo
2917 2917
                                     $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2918 2918
 
2919 2919
 
2920
-                                    $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . ' geodir-custom-file-box" style="clear:both;"><span class="geodir-i-file" style="display:inline-block;vertical-align:top;padding-right:14px;' . $field_icon . '">' . $field_icon_af;
2920
+                                    $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].' geodir-custom-file-box" style="clear:both;"><span class="geodir-i-file" style="display:inline-block;vertical-align:top;padding-right:14px;'.$field_icon.'">'.$field_icon_af;
2921 2921
 
2922 2922
                                     if ($field_set_start == 1 && $site_title != '') {
2923
-                                        $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2923
+                                        $html .= ' '.__($site_title, 'geodirectory').': ';
2924 2924
                                     }
2925 2925
 
2926
-                                    $html .= ' </span>' . $file_paths . '</div>';
2926
+                                    $html .= ' </span>'.$file_paths.'</div>';
2927 2927
                                 }
2928 2928
                             }
2929 2929
                         }
@@ -2974,7 +2974,7 @@  discard block
 block discarded – undo
2974 2974
                                  * @param string $htmlvar_name The field HTML var name.
2975 2975
                                  */
2976 2976
                                 'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $htmlvar_name),
2977
-                                'tab_content' => '<div class="geodir-company_info field-group">' . $fieldset_html . '</html>'
2977
+                                'tab_content' => '<div class="geodir-company_info field-group">'.$fieldset_html.'</html>'
2978 2978
                             );
2979 2979
                         }
2980 2980
                     } else {
@@ -3034,7 +3034,7 @@  discard block
 block discarded – undo
3034 3034
             }
3035 3035
             $status .= ")</strong>";
3036 3036
 
3037
-            $html = '<span class="geodir-post-status">' . $status_icon . ' <font class="geodir-status-label">' . __('Status: ', 'geodirectory') . '</font>' . $status . '</span>';
3037
+            $html = '<span class="geodir-post-status">'.$status_icon.' <font class="geodir-status-label">'.__('Status: ', 'geodirectory').'</font>'.$status.'</span>';
3038 3038
         }
3039 3039
     }
3040 3040
 
@@ -3114,7 +3114,7 @@  discard block
 block discarded – undo
3114 3114
 function geodir_no_rating_comment_text($content, $comment = '')
3115 3115
 {
3116 3116
     if (!is_admin()) {
3117
-        return '<div class="description">' . $content . '</div>';
3117
+        return '<div class="description">'.$content.'</div>';
3118 3118
     } else {
3119 3119
         return $content;
3120 3120
     }
@@ -3192,7 +3192,7 @@  discard block
 block discarded – undo
3192 3192
         $classes[] = 'gd-no-rating';
3193 3193
     }
3194 3194
     
3195
-    $classes[] = 'gd-map-' . geodir_map_name();
3195
+    $classes[] = 'gd-map-'.geodir_map_name();
3196 3196
 
3197 3197
     return $classes;
3198 3198
 }
@@ -3212,7 +3212,7 @@  discard block
 block discarded – undo
3212 3212
         $class .= ' gd-no-rating';
3213 3213
     }
3214 3214
     
3215
-    $class .= ' gd-map-' . geodir_map_name();
3215
+    $class .= ' gd-map-'.geodir_map_name();
3216 3216
 
3217 3217
     return $class;
3218 3218
 }
@@ -3247,7 +3247,7 @@  discard block
 block discarded – undo
3247 3247
  * @return array Translation texts.
3248 3248
  */
3249 3249
 function geodir_load_gd_options_text_translation($translation_texts = array()) {
3250
-    $translation_texts = !empty( $translation_texts ) && is_array( $translation_texts ) ? $translation_texts : array();
3250
+    $translation_texts = !empty($translation_texts) && is_array($translation_texts) ? $translation_texts : array();
3251 3251
 
3252 3252
     $gd_options = array('geodir_post_submited_success_email_subject_admin', 'geodir_post_submited_success_email_content_admin', 'geodir_post_submited_success_email_subject', 'geodir_post_submited_success_email_content', 'geodir_forgot_password_subject', 'geodir_forgot_password_content', 'geodir_registration_success_email_subject', 'geodir_registration_success_email_content', 'geodir_post_published_email_subject', 'geodir_post_published_email_content', 'geodir_email_friend_subject', 'geodir_email_friend_content', 'geodir_email_enquiry_subject', 'geodir_email_enquiry_content', 'geodir_post_added_success_msg_content', 'geodir_post_edited_email_subject_admin', 'geodir_post_edited_email_content_admin');
3253 3253
 
@@ -3313,14 +3313,14 @@  discard block
 block discarded – undo
3313 3313
  * @param array $args The array of menu arguments.
3314 3314
  * @return array The modified arguments.
3315 3315
  */
3316
-function geodir_add_nav_menu_class( $args )
3316
+function geodir_add_nav_menu_class($args)
3317 3317
 {
3318 3318
 
3319
-        if(isset($args['menu_class'])){
3319
+        if (isset($args['menu_class'])) {
3320 3320
             $args['menu_class'] = $args['menu_class']." gd-menu-z";
3321 3321
         }
3322 3322
     
3323 3323
     return $args;
3324 3324
 }
3325 3325
 
3326
-add_filter( 'wp_nav_menu_args', 'geodir_add_nav_menu_class' );
3327 3326
\ No newline at end of file
3327
+add_filter('wp_nav_menu_args', 'geodir_add_nav_menu_class');
3328 3328
\ No newline at end of file
Please login to merge, or discard this patch.