Test Failed
Pull Request — master (#450)
by Kiran
19:15
created
geodirectory-functions/cat-meta-functions/Tax-meta-class.php 4 patches
Braces   +106 added lines, -69 removed lines patch added patch discarded remove patch
@@ -102,8 +102,9 @@  discard block
 block discarded – undo
102 102
         {
103 103
 
104 104
             // If we are not in admin area exit.
105
-            if (!is_admin())
106
-                return;
105
+            if (!is_admin()) {
106
+                            return;
107
+            }
107 108
 
108 109
             // Assign meta box values to local variables and add it's missed values.
109 110
             $this->_meta_box = $meta_box;
@@ -111,15 +112,15 @@  discard block
 block discarded – undo
111 112
             $this->_fields = &$this->_meta_box['fields'];
112 113
             $this->_Local_images = (isset($meta_box['local_images'])) ? true : false;
113 114
             $this->add_missed_values();
114
-            if (isset($meta_box['use_with_theme']))
115
-                if ($meta_box['use_with_theme'] === true) {
115
+            if (isset($meta_box['use_with_theme'])) {
116
+                            if ($meta_box['use_with_theme'] === true) {
116 117
                     $this->SelfPath = get_stylesheet_directory_uri() . '/library/cat-meta';
118
+            }
117 119
                 } elseif ($meta_box['use_with_theme'] === false) {
118 120
                     $this->SelfPath = plugins_url('cat-meta-functions', plugin_basename(dirname(__FILE__)));
119 121
                 } else {
120 122
                     $this->SelfPath = $meta_box['use_with_theme'];
121
-                }
122
-            else {
123
+                } else {
123 124
                 $this->SelfPath = plugins_url('cat-meta-functions', plugin_basename(dirname(__FILE__)));
124 125
             }
125 126
 
@@ -190,8 +191,9 @@  discard block
 block discarded – undo
190 191
         {
191 192
 
192 193
             // Check if the field is an image or file. If not, return.
193
-            if (!$this->has_field('image') && !$this->has_field('file'))
194
-                return;
194
+            if (!$this->has_field('image') && !$this->has_field('file')) {
195
+                            return;
196
+            }
195 197
 
196 198
 
197 199
             add_action('wp_enqueue_scripts', array(&$this, 'enqueue_tax_meta_scripts'), 100);
@@ -235,8 +237,9 @@  discard block
 block discarded – undo
235 237
         {
236 238
 
237 239
             // If post variables are empty, return.
238
-            if (!isset($_POST['at-insert']) || empty($_POST['attachments']))
239
-                return;
240
+            if (!isset($_POST['at-insert']) || empty($_POST['attachments'])) {
241
+                            return;
242
+            }
240 243
 
241 244
             // Security Check
242 245
             check_admin_referer('media-form');
@@ -256,8 +259,9 @@  discard block
 block discarded – undo
256 259
                 $attachment = stripslashes_deep($attachment);
257 260
 
258 261
                 // If not selected or url is empty, continue in loop.
259
-                if (empty($attachment['selected']) || empty($attachment['url']))
260
-                    continue;
262
+                if (empty($attachment['selected']) || empty($attachment['url'])) {
263
+                                    continue;
264
+                }
261 265
 
262 266
                 $li = "<li id='item_{$attachment_id}'>";
263 267
                 $li .= "<img src='{$attachment['url']}' alt='image_{$attachment_id}' />";
@@ -308,13 +312,15 @@  discard block
 block discarded – undo
308 312
 
309 313
 
310 314
             // If data is not set, die.
311
-            if (!isset($_POST['data']))
312
-                die();
315
+            if (!isset($_POST['data'])) {
316
+                            die();
317
+            }
313 318
 
314 319
             list($nonce, $term_id, $key, $attach_id) = explode('|', $_POST['data']);
315 320
 
316
-            if (!wp_verify_nonce($nonce, 'at_ajax_delete'))
317
-                die('1');
321
+            if (!wp_verify_nonce($nonce, 'at_ajax_delete')) {
322
+                            die('1');
323
+            }
318 324
 
319 325
             $this->delete_tax_meta($term_id, $key, $attach_id);
320 326
 
@@ -336,8 +342,9 @@  discard block
 block discarded – undo
336 342
             $ok = false;
337 343
             if (strpos($field_id, '[') === false) {
338 344
                 check_admin_referer("at-delete-mupload_" . urldecode($field_id));
339
-                if ($term_id > 0)
340
-                    $this->delete_tax_meta($term_id, $field_id);
345
+                if ($term_id > 0) {
346
+                                    $this->delete_tax_meta($term_id, $field_id);
347
+                }
341 348
                 //$ok = wp_delete_attachment( $attachment_id );
342 349
                 $ok = 1;
343 350
             } else {
@@ -349,8 +356,9 @@  discard block
 block discarded – undo
349 356
                 $saved = $this->get_tax_meta($term_id, $f[0], true);
350 357
                 if (isset($saved[$f[1]][$f[2]])) {
351 358
                     unset($saved[$f[1]][$f[2]]);
352
-                    if ($term_id > 0)
353
-                        update_post_meta($term_id, $f[0], $saved);
359
+                    if ($term_id > 0) {
360
+                                            update_post_meta($term_id, $f[0], $saved);
361
+                    }
354 362
                     //$ok = wp_delete_attachment( $attachment_id );
355 363
                     $ok = 1;
356 364
                 }
@@ -375,13 +383,15 @@  discard block
 block discarded – undo
375 383
         public function reorder_images()
376 384
         {
377 385
 
378
-            if (!isset($_POST['data']))
379
-                die();
386
+            if (!isset($_POST['data'])) {
387
+                            die();
388
+            }
380 389
 
381 390
             list($order, $term_id, $key, $nonce) = explode('|', $_POST['data']);
382 391
 
383
-            if (!wp_verify_nonce($nonce, 'at_ajax_reorder'))
384
-                die('1');
392
+            if (!wp_verify_nonce($nonce, 'at_ajax_reorder')) {
393
+                            die('1');
394
+            }
385 395
 
386 396
             parse_str($order, $items);
387 397
             $items = $items['item'];
@@ -513,8 +523,9 @@  discard block
 block discarded – undo
513 523
             foreach ($this->_fields as $field) {
514 524
                 $meta = $this->get_tax_meta($term_id, $field['id'], !$field['multiple']);
515 525
                 $meta = ($meta !== '') ? $meta : $field['std'];
516
-                if ('image' != $field['type'] && $field['type'] != 'repeater')
517
-                    $meta = is_array($meta) ? array_map('esc_attr', $meta) : esc_attr($meta);
526
+                if ('image' != $field['type'] && $field['type'] != 'repeater') {
527
+                                    $meta = is_array($meta) ? array_map('esc_attr', $meta) : esc_attr($meta);
528
+                }
518 529
 
519 530
                 if ($field['validate_func']) {
520 531
                     echo '<tr class="form-field form-required ' . $field['style'] . '">';
@@ -560,8 +571,9 @@  discard block
 block discarded – undo
560 571
                         $id = $field['id'] . '[' . $c . '][' . $f['id'] . ']';
561 572
                         $m = $me[$f['id']];
562 573
                         $m = ($m !== '') ? $m : $f['std'];
563
-                        if ('image' != $f['type'] && $f['type'] != 'repeater')
564
-                            $m = is_array($m) ? array_map('esc_attr', $m) : esc_attr($m);
574
+                        if ('image' != $f['type'] && $f['type'] != 'repeater') {
575
+                                                    $m = is_array($m) ? array_map('esc_attr', $m) : esc_attr($m);
576
+                        }
565 577
                         //set new id for field in array format
566 578
                         $f['id'] = $id;
567 579
                         if (!$field['inline']) {
@@ -802,8 +814,9 @@  discard block
 block discarded – undo
802 814
         public function show_field_select($field, $meta)
803 815
         {
804 816
 
805
-            if (!is_array($meta))
806
-                $meta = (array)$meta;
817
+            if (!is_array($meta)) {
818
+                            $meta = (array)$meta;
819
+            }
807 820
 
808 821
             $this->show_field_begin($field, $meta);
809 822
             echo "<select class='at-select' name='{$field['id']}" . ($field['multiple'] ? "[]' id='{$field['id']}' multiple='multiple'" : "'") . ">";
@@ -826,8 +839,9 @@  discard block
 block discarded – undo
826 839
         public function show_field_radio($field, $meta)
827 840
         {
828 841
 
829
-            if (!is_array($meta))
830
-                $meta = (array)$meta;
842
+            if (!is_array($meta)) {
843
+                            $meta = (array)$meta;
844
+            }
831 845
 
832 846
             $this->show_field_begin($field, $meta);
833 847
             foreach ($field['options'] as $key => $value) {
@@ -889,8 +903,9 @@  discard block
 block discarded – undo
889 903
 
890 904
             global $post;
891 905
 
892
-            if (!is_array($meta))
893
-                $meta = (array)$meta;
906
+            if (!is_array($meta)) {
907
+                            $meta = (array)$meta;
908
+            }
894 909
 
895 910
             $this->show_field_begin($field, $meta);
896 911
             echo "{$field['desc']}<br />";
@@ -934,16 +949,18 @@  discard block
 block discarded – undo
934 949
             $this->show_field_begin($field, $meta);
935 950
             $html = wp_nonce_field("at-delete-mupload_{$field['id']}", "nonce-delete-mupload_" . $field['id'], false, false);
936 951
             if (is_array($meta)) {
937
-                if (isset($meta[0]) && is_array($meta[0]))
938
-                    $meta = $meta[0];
952
+                if (isset($meta[0]) && is_array($meta[0])) {
953
+                                    $meta = $meta[0];
954
+                }
939 955
             }
940 956
 
941 957
             $uploads = wp_upload_dir();
942 958
             if (is_array($meta) && isset($meta['src']) && $meta['src'] != '') {
943 959
                 $file_info = pathinfo($meta['src']);
944 960
 
945
-                if ($file_info['dirname'] != '.' && $file_info['dirname'] != '..')
946
-                    $sub_dir = $file_info['dirname'];
961
+                if ($file_info['dirname'] != '.' && $file_info['dirname'] != '..') {
962
+                                    $sub_dir = $file_info['dirname'];
963
+                }
947 964
 
948 965
                 $uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs
949 966
                 $uploads_baseurl = $uploads['baseurl'];
@@ -987,8 +1004,9 @@  discard block
 block discarded – undo
987 1004
         public function show_field_color($field, $meta)
988 1005
         {
989 1006
 
990
-            if (empty($meta))
991
-                $meta = '#';
1007
+            if (empty($meta)) {
1008
+                            $meta = '#';
1009
+            }
992 1010
 
993 1011
             $this->show_field_begin($field, $meta);
994 1012
 
@@ -1011,8 +1029,9 @@  discard block
 block discarded – undo
1011 1029
         public function show_field_checkbox_list($field, $meta)
1012 1030
         {
1013 1031
 
1014
-            if (!is_array($meta))
1015
-                $meta = (array)$meta;
1032
+            if (!is_array($meta)) {
1033
+                            $meta = (array)$meta;
1034
+            }
1016 1035
 
1017 1036
             $this->show_field_begin($field, $meta);
1018 1037
 
@@ -1072,7 +1091,9 @@  discard block
 block discarded – undo
1072 1091
         {
1073 1092
             global $post;
1074 1093
 
1075
-            if (!is_array($meta)) $meta = (array)$meta;
1094
+            if (!is_array($meta)) {
1095
+            	$meta = (array)$meta;
1096
+            }
1076 1097
             $this->show_field_begin($field, $meta);
1077 1098
             $options = $field['options'];
1078 1099
             $posts = get_posts($options['args']);
@@ -1110,7 +1131,9 @@  discard block
 block discarded – undo
1110 1131
         {
1111 1132
             global $post;
1112 1133
 
1113
-            if (!is_array($meta)) $meta = (array)$meta;
1134
+            if (!is_array($meta)) {
1135
+            	$meta = (array)$meta;
1136
+            }
1114 1137
             $this->show_field_begin($field, $meta);
1115 1138
             $options = $field['options'];
1116 1139
             $terms = get_terms($options['taxonomy'], $options['args']);
@@ -1144,17 +1167,20 @@  discard block
 block discarded – undo
1144 1167
         {
1145 1168
 
1146 1169
             $taxnow = '';
1147
-            if (isset($_POST['taxonomy']))
1148
-                $taxnow = $_POST['taxonomy'];
1170
+            if (isset($_POST['taxonomy'])) {
1171
+                            $taxnow = $_POST['taxonomy'];
1172
+            }
1149 1173
 
1150 1174
             if (!isset($term_id)                                                        // Check Revision
1151 1175
                 || (!in_array($taxnow, $this->_meta_box['pages']))                            // Check if current taxonomy type is supported.
1152 1176
                 || (!check_admin_referer(basename(__FILE__), 'tax_meta_class_nonce'))        // Check nonce - Security
1153 1177
                 || (!current_user_can('manage_categories'))
1154
-            )                                // Check permission
1178
+            ) {
1179
+            	// Check permission
1155 1180
             {
1156 1181
                 return $term_id;
1157 1182
             }
1183
+            }
1158 1184
 
1159 1185
 
1160 1186
             foreach ($this->_fields as $field) {
@@ -1248,8 +1274,9 @@  discard block
 block discarded – undo
1248 1274
         {
1249 1275
             $name = $field['id'];
1250 1276
             $this->delete_tax_meta($term_id, $name);
1251
-            if ($new === '' || $new === array())
1252
-                return;
1277
+            if ($new === '' || $new === array()) {
1278
+                            return;
1279
+            }
1253 1280
 
1254 1281
             $this->update_tax_meta($term_id, $name, $new);
1255 1282
         }
@@ -1269,8 +1296,9 @@  discard block
 block discarded – undo
1269 1296
             $name = $field['id'];
1270 1297
 
1271 1298
             $this->delete_tax_meta($term_id, $name);
1272
-            if ($new === '' || $new === array() || $new['id'] == '' || $new['src'] == '')
1273
-                return;
1299
+            if ($new === '' || $new === array() || $new['id'] == '' || $new['src'] == '') {
1300
+                            return;
1301
+            }
1274 1302
 
1275 1303
             $this->update_tax_meta($term_id, $name, $new);
1276 1304
         }
@@ -1317,8 +1345,9 @@  discard block
 block discarded – undo
1317 1345
                                 break;
1318 1346
                         }
1319 1347
                     }
1320
-                    if (!$this->is_array_empty($n))
1321
-                        $temp[] = $n;
1348
+                    if (!$this->is_array_empty($n)) {
1349
+                                            $temp[] = $n;
1350
+                    }
1322 1351
                 }
1323 1352
                 if (isset($temp) && count($temp) > 0 && !$this->is_array_empty($temp)) {
1324 1353
                     $this->update_tax_meta($term_id, $field['id'], $temp);
@@ -1346,14 +1375,16 @@  discard block
 block discarded – undo
1346 1375
         {
1347 1376
 
1348 1377
             $name = $field['id'];
1349
-            if (empty($_FILES[$name]))
1350
-                return;
1378
+            if (empty($_FILES[$name])) {
1379
+                            return;
1380
+            }
1351 1381
             $this->fix_file_array($_FILES[$name]);
1352 1382
             foreach ($_FILES[$name] as $position => $fileitem) {
1353 1383
 
1354 1384
                 $file = wp_handle_upload($fileitem, array('test_form' => false));
1355
-                if (empty($file['file']))
1356
-                    continue;
1385
+                if (empty($file['file'])) {
1386
+                                    continue;
1387
+                }
1357 1388
                 $filename = $file['file'];
1358 1389
 
1359 1390
                 $attachment = array(
@@ -1391,14 +1422,16 @@  discard block
 block discarded – undo
1391 1422
         {
1392 1423
 
1393 1424
             $name = $field['id'];
1394
-            if (empty($_FILES[$name]))
1395
-                return;
1425
+            if (empty($_FILES[$name])) {
1426
+                            return;
1427
+            }
1396 1428
             $this->fix_file_array($_FILES[$name]);
1397 1429
             foreach ($_FILES[$name] as $position => $fileitem) {
1398 1430
 
1399 1431
                 $file = wp_handle_upload($fileitem, array('test_form' => false));
1400
-                if (empty($file['file']))
1401
-                    continue;
1432
+                if (empty($file['file'])) {
1433
+                                    continue;
1434
+                }
1402 1435
                 $filename = $file['file'];
1403 1436
 
1404 1437
                 $attachment = array(
@@ -1453,8 +1486,9 @@  discard block
 block discarded – undo
1453 1486
         {
1454 1487
             if(is_array($this->_fields)) {
1455 1488
                 foreach ($this->_fields as $field) {
1456
-                    if ($type == $field['type'])
1457
-                        return true;
1489
+                    if ($type == $field['type']) {
1490
+                                            return true;
1491
+                    }
1458 1492
                 }
1459 1493
             }
1460 1494
             return false;
@@ -1992,18 +2026,21 @@  discard block
 block discarded – undo
1992 2026
          */
1993 2027
         public function is_array_empty($array)
1994 2028
         {
1995
-            if (!is_array($array))
1996
-                return true;
2029
+            if (!is_array($array)) {
2030
+                            return true;
2031
+            }
1997 2032
 
1998 2033
             foreach ($array as $a) {
1999 2034
                 if (is_array($a)) {
2000 2035
                     foreach ($a as $sub_a) {
2001
-                        if (!empty($sub_a) && $sub_a != '')
2002
-                            return false;
2036
+                        if (!empty($sub_a) && $sub_a != '') {
2037
+                                                    return false;
2038
+                        }
2003 2039
                     }
2004 2040
                 } else {
2005
-                    if (!empty($a) && $a != '')
2006
-                        return false;
2041
+                    if (!empty($a) && $a != '') {
2042
+                                            return false;
2043
+                    }
2007 2044
                 }
2008 2045
             }
2009 2046
             return true;
Please login to merge, or discard this patch.
Indentation   +2046 added lines, -2046 removed lines patch added patch discarded remove patch
@@ -28,260 +28,260 @@  discard block
 block discarded – undo
28 28
 
29 29
 if (!class_exists('Geodir_Tax_Meta_Class')) :
30 30
 
31
-    /**
32
-     * All Types Meta Box class.
33
-     *
34
-     * @package All Types Meta Box
35
-     * @since 1.0
36
-     *
37
-     * @todo Nothing.
38
-     */
39
-
40
-
41
-    class Geodir_Tax_Meta_Class
42
-    {
43
-
44
-        /**
45
-         * Holds meta box object
46
-         *
47
-         * @var object
48
-         * @access protected
49
-         */
50
-        protected $_meta_box;
51
-
52
-        /**
53
-         * Holds meta box fields.
54
-         *
55
-         * @var array
56
-         * @access protected
57
-         */
58
-        protected $_prefix;
59
-
60
-        /**
61
-         * Holds Prefix for meta box fields.
62
-         *
63
-         * @var array
64
-         * @access protected
65
-         */
66
-        protected $_fields;
67
-
68
-        /**
69
-         * Use local images.
70
-         *
71
-         * @var bool
72
-         * @access protected
73
-         */
74
-        protected $_Local_images;
75
-
76
-        /**
77
-         * What form is this? edit or new term.
78
-         *
79
-         * @var string
80
-         * @access protected
81
-         * $since 1.0
82
-         */
83
-        protected $_form_type;
84
-        /**
85
-         * SelfPath to allow themes as well as plugins.
86
-         *
87
-         * @var string
88
-         * @access protected
89
-         * $since 1.0
90
-         */
91
-        protected $SelfPath;
92
-
93
-        /**
94
-         * Constructor
95
-         *
96
-         * @since 1.0
97
-         * @access public
98
-         *
99
-         * @param array $meta_box
100
-         */
101
-        public function __construct($meta_box)
102
-        {
103
-
104
-            // If we are not in admin area exit.
105
-            if (!is_admin())
106
-                return;
107
-
108
-            // Assign meta box values to local variables and add it's missed values.
109
-            $this->_meta_box = $meta_box;
110
-            $this->_prefix = (isset($meta_box['prefix'])) ? $meta_box['prefix'] : '';
111
-            $this->_fields = &$this->_meta_box['fields'];
112
-            $this->_Local_images = (isset($meta_box['local_images'])) ? true : false;
113
-            $this->add_missed_values();
114
-            if (isset($meta_box['use_with_theme']))
115
-                if ($meta_box['use_with_theme'] === true) {
116
-                    $this->SelfPath = get_stylesheet_directory_uri() . '/library/cat-meta';
117
-                } elseif ($meta_box['use_with_theme'] === false) {
118
-                    $this->SelfPath = plugins_url('cat-meta-functions', plugin_basename(dirname(__FILE__)));
119
-                } else {
120
-                    $this->SelfPath = $meta_box['use_with_theme'];
121
-                }
122
-            else {
123
-                $this->SelfPath = plugins_url('cat-meta-functions', plugin_basename(dirname(__FILE__)));
124
-            }
125
-
126
-
127
-            // Add Actions
128
-            add_action('admin_init', array(&$this, 'add'));
129
-
130
-            // Check for special fields and add needed actions for them.
131
-            $this->check_field_upload();
132
-            $this->check_field_color();
133
-            $this->check_field_date();
134
-            $this->check_field_time();
135
-
136
-            // Load common js, css files
137
-            // Must enqueue for all pages as we need js for the media upload, too.
138
-            add_action('admin_print_styles', array(&$this, 'load_scripts_styles'));
139
-
140
-        }
141
-
142
-        /**
143
-         * Load all Javascript and CSS
144
-         *
145
-         * @since 1.0
146
-         * @access public
147
-         */
148
-        public function load_scripts_styles()
149
-        {
150
-
151
-            // Get Plugin Path
152
-            $plugin_path = $this->SelfPath;
153
-            //only load styles and js when needed
154
-            /* 
31
+	/**
32
+	 * All Types Meta Box class.
33
+	 *
34
+	 * @package All Types Meta Box
35
+	 * @since 1.0
36
+	 *
37
+	 * @todo Nothing.
38
+	 */
39
+
40
+
41
+	class Geodir_Tax_Meta_Class
42
+	{
43
+
44
+		/**
45
+		 * Holds meta box object
46
+		 *
47
+		 * @var object
48
+		 * @access protected
49
+		 */
50
+		protected $_meta_box;
51
+
52
+		/**
53
+		 * Holds meta box fields.
54
+		 *
55
+		 * @var array
56
+		 * @access protected
57
+		 */
58
+		protected $_prefix;
59
+
60
+		/**
61
+		 * Holds Prefix for meta box fields.
62
+		 *
63
+		 * @var array
64
+		 * @access protected
65
+		 */
66
+		protected $_fields;
67
+
68
+		/**
69
+		 * Use local images.
70
+		 *
71
+		 * @var bool
72
+		 * @access protected
73
+		 */
74
+		protected $_Local_images;
75
+
76
+		/**
77
+		 * What form is this? edit or new term.
78
+		 *
79
+		 * @var string
80
+		 * @access protected
81
+		 * $since 1.0
82
+		 */
83
+		protected $_form_type;
84
+		/**
85
+		 * SelfPath to allow themes as well as plugins.
86
+		 *
87
+		 * @var string
88
+		 * @access protected
89
+		 * $since 1.0
90
+		 */
91
+		protected $SelfPath;
92
+
93
+		/**
94
+		 * Constructor
95
+		 *
96
+		 * @since 1.0
97
+		 * @access public
98
+		 *
99
+		 * @param array $meta_box
100
+		 */
101
+		public function __construct($meta_box)
102
+		{
103
+
104
+			// If we are not in admin area exit.
105
+			if (!is_admin())
106
+				return;
107
+
108
+			// Assign meta box values to local variables and add it's missed values.
109
+			$this->_meta_box = $meta_box;
110
+			$this->_prefix = (isset($meta_box['prefix'])) ? $meta_box['prefix'] : '';
111
+			$this->_fields = &$this->_meta_box['fields'];
112
+			$this->_Local_images = (isset($meta_box['local_images'])) ? true : false;
113
+			$this->add_missed_values();
114
+			if (isset($meta_box['use_with_theme']))
115
+				if ($meta_box['use_with_theme'] === true) {
116
+					$this->SelfPath = get_stylesheet_directory_uri() . '/library/cat-meta';
117
+				} elseif ($meta_box['use_with_theme'] === false) {
118
+					$this->SelfPath = plugins_url('cat-meta-functions', plugin_basename(dirname(__FILE__)));
119
+				} else {
120
+					$this->SelfPath = $meta_box['use_with_theme'];
121
+				}
122
+			else {
123
+				$this->SelfPath = plugins_url('cat-meta-functions', plugin_basename(dirname(__FILE__)));
124
+			}
125
+
126
+
127
+			// Add Actions
128
+			add_action('admin_init', array(&$this, 'add'));
129
+
130
+			// Check for special fields and add needed actions for them.
131
+			$this->check_field_upload();
132
+			$this->check_field_color();
133
+			$this->check_field_date();
134
+			$this->check_field_time();
135
+
136
+			// Load common js, css files
137
+			// Must enqueue for all pages as we need js for the media upload, too.
138
+			add_action('admin_print_styles', array(&$this, 'load_scripts_styles'));
139
+
140
+		}
141
+
142
+		/**
143
+		 * Load all Javascript and CSS
144
+		 *
145
+		 * @since 1.0
146
+		 * @access public
147
+		 */
148
+		public function load_scripts_styles()
149
+		{
150
+
151
+			// Get Plugin Path
152
+			$plugin_path = $this->SelfPath;
153
+			//only load styles and js when needed
154
+			/* 
155 155
 		 * since 1.0
156 156
 		 */
157
-            $taxnow = isset($_REQUEST['taxonomy']) ? $_REQUEST['taxonomy'] : '';
158
-
159
-            if (!empty($this->_meta_box['pages'])) {
160
-                if (in_array($taxnow, $this->_meta_box['pages'])) {
161
-                    // Enqueue Meta Box Style
162
-                    //wp_enqueue_style( 'tax-meta-clss', $plugin_path . '/css/Tax-meta-class.css' );
163
-                    // Enqueue Meta Box Scripts
164
-                    //wp_enqueue_script( 'tax-meta-clss', $plugin_path . '/js/tax-meta-clss.js', array( 'jquery' ), null, true );
165
-
166
-                }
167
-            }
168
-
169
-        }
170
-
171
-        /**
172
-         * Check the Field Upload, Add needed Actions
173
-         *
174
-         * @since 1.0
175
-         * @access public
176
-         */
177
-        public function enqueue_tax_meta_scripts()
178
-        {
179
-            // Make upload feature work event when custom post type doesn't support 'editor'
180
-            wp_enqueue_script('media-upload');
181
-            wp_enqueue_script('thickbox');
182
-            add_thickbox();
183
-            wp_enqueue_script('jquery-ui-core');
184
-            wp_enqueue_script('jquery-ui-sortable');
185
-
186
-
187
-        }
188
-
189
-        public function check_field_upload()
190
-        {
191
-
192
-            // Check if the field is an image or file. If not, return.
193
-            if (!$this->has_field('image') && !$this->has_field('file'))
194
-                return;
195
-
196
-
197
-            add_action('wp_enqueue_scripts', array(&$this, 'enqueue_tax_meta_scripts'), 100);
198
-
199
-            // Add data encoding type for file uploading.	
200
-            add_action('post_edit_form_tag', array(&$this, 'add_enctype'));
201
-
202
-
203
-            // Add filters for media upload.
204
-            add_filter('media_upload_gallery', array(&$this, 'insert_images'));
205
-            add_filter('media_upload_library', array(&$this, 'insert_images'));
206
-            add_filter('media_upload_image', array(&$this, 'insert_images'));
207
-
208
-            // Delete all attachments when delete custom post type.
209
-            add_action('wp_ajax_at_delete_file', array(&$this, 'delete_file'));
210
-            add_action('wp_ajax_at_reorder_images', array(&$this, 'reorder_images'));
211
-            // Delete file via Ajax
212
-            add_action('wp_ajax_at_delete_mupload', array($this, 'wp_ajax_delete_image'));
213
-        }
214
-
215
-        /**
216
-         * Add data encoding type for file uploading
217
-         *
218
-         * @since 1.0
219
-         * @access public
220
-         */
221
-        public function add_enctype()
222
-        {
223
-            echo ' enctype="multipart/form-data"';
224
-        }
225
-
226
-        /**
227
-         * Process images added to meta field.
228
-         *
229
-         * Modified from Faster Image Insert plugin.
230
-         *
231
-         * @return void
232
-         * @author Cory Crowley
233
-         */
234
-        public function insert_images()
235
-        {
236
-
237
-            // If post variables are empty, return.
238
-            if (!isset($_POST['at-insert']) || empty($_POST['attachments']))
239
-                return;
240
-
241
-            // Security Check
242
-            check_admin_referer('media-form');
243
-
244
-            // Create Security Nonce
245
-            $nonce = wp_create_nonce('at_ajax_delete');
246
-
247
-            // Get Post Id and Field Id
248
-            $term_id = $_POST['post_id'];
249
-            $id = $_POST['field_id'];
250
-
251
-            // Modify the insertion string
252
-            $html = '';
253
-            foreach ($_POST['attachments'] as $attachment_id => $attachment) {
254
-
255
-                // Strip Slashes
256
-                $attachment = stripslashes_deep($attachment);
257
-
258
-                // If not selected or url is empty, continue in loop.
259
-                if (empty($attachment['selected']) || empty($attachment['url']))
260
-                    continue;
261
-
262
-                $li = "<li id='item_{$attachment_id}'>";
263
-                $li .= "<img src='{$attachment['url']}' alt='image_{$attachment_id}' />";
264
-                //$li 	.= "<a title='" . __( 'Delete this image' ) . "' class='at-delete-file' href='#' rel='{$nonce}|{$term_id}|{$id}|{$attachment_id}'>" . __( 'Delete' ) . "</a>";
265
-                $li .= "<a title='" . __('Remove this image', 'geodirectory') . "' class='at-delete-file' href='#' rel='{$nonce}|{$term_id}|{$id}|{$attachment_id}'><img src='" . $this->SelfPath . "/images/delete-16.png' alt='" . __('Remove', 'geodirectory') . "' /></a>";
266
-                $li .= "<input type='hidden' name='{$id}[]' value='{$attachment_id}' />";
267
-                $li .= "</li>";
268
-                $html .= $li;
269
-
270
-            } // End For Each
271
-
272
-            return media_send_to_editor($html);
273
-
274
-        }
275
-
276
-        /**
277
-         * Delete attachments associated with the post.
278
-         *
279
-         * @since 1.0
280
-         * @access public
281
-         *
282
-         * @param int|string $term_id The term ID.
283
-         */
284
-        /*public function delete_attachments( $term_id ) {
157
+			$taxnow = isset($_REQUEST['taxonomy']) ? $_REQUEST['taxonomy'] : '';
158
+
159
+			if (!empty($this->_meta_box['pages'])) {
160
+				if (in_array($taxnow, $this->_meta_box['pages'])) {
161
+					// Enqueue Meta Box Style
162
+					//wp_enqueue_style( 'tax-meta-clss', $plugin_path . '/css/Tax-meta-class.css' );
163
+					// Enqueue Meta Box Scripts
164
+					//wp_enqueue_script( 'tax-meta-clss', $plugin_path . '/js/tax-meta-clss.js', array( 'jquery' ), null, true );
165
+
166
+				}
167
+			}
168
+
169
+		}
170
+
171
+		/**
172
+		 * Check the Field Upload, Add needed Actions
173
+		 *
174
+		 * @since 1.0
175
+		 * @access public
176
+		 */
177
+		public function enqueue_tax_meta_scripts()
178
+		{
179
+			// Make upload feature work event when custom post type doesn't support 'editor'
180
+			wp_enqueue_script('media-upload');
181
+			wp_enqueue_script('thickbox');
182
+			add_thickbox();
183
+			wp_enqueue_script('jquery-ui-core');
184
+			wp_enqueue_script('jquery-ui-sortable');
185
+
186
+
187
+		}
188
+
189
+		public function check_field_upload()
190
+		{
191
+
192
+			// Check if the field is an image or file. If not, return.
193
+			if (!$this->has_field('image') && !$this->has_field('file'))
194
+				return;
195
+
196
+
197
+			add_action('wp_enqueue_scripts', array(&$this, 'enqueue_tax_meta_scripts'), 100);
198
+
199
+			// Add data encoding type for file uploading.	
200
+			add_action('post_edit_form_tag', array(&$this, 'add_enctype'));
201
+
202
+
203
+			// Add filters for media upload.
204
+			add_filter('media_upload_gallery', array(&$this, 'insert_images'));
205
+			add_filter('media_upload_library', array(&$this, 'insert_images'));
206
+			add_filter('media_upload_image', array(&$this, 'insert_images'));
207
+
208
+			// Delete all attachments when delete custom post type.
209
+			add_action('wp_ajax_at_delete_file', array(&$this, 'delete_file'));
210
+			add_action('wp_ajax_at_reorder_images', array(&$this, 'reorder_images'));
211
+			// Delete file via Ajax
212
+			add_action('wp_ajax_at_delete_mupload', array($this, 'wp_ajax_delete_image'));
213
+		}
214
+
215
+		/**
216
+		 * Add data encoding type for file uploading
217
+		 *
218
+		 * @since 1.0
219
+		 * @access public
220
+		 */
221
+		public function add_enctype()
222
+		{
223
+			echo ' enctype="multipart/form-data"';
224
+		}
225
+
226
+		/**
227
+		 * Process images added to meta field.
228
+		 *
229
+		 * Modified from Faster Image Insert plugin.
230
+		 *
231
+		 * @return void
232
+		 * @author Cory Crowley
233
+		 */
234
+		public function insert_images()
235
+		{
236
+
237
+			// If post variables are empty, return.
238
+			if (!isset($_POST['at-insert']) || empty($_POST['attachments']))
239
+				return;
240
+
241
+			// Security Check
242
+			check_admin_referer('media-form');
243
+
244
+			// Create Security Nonce
245
+			$nonce = wp_create_nonce('at_ajax_delete');
246
+
247
+			// Get Post Id and Field Id
248
+			$term_id = $_POST['post_id'];
249
+			$id = $_POST['field_id'];
250
+
251
+			// Modify the insertion string
252
+			$html = '';
253
+			foreach ($_POST['attachments'] as $attachment_id => $attachment) {
254
+
255
+				// Strip Slashes
256
+				$attachment = stripslashes_deep($attachment);
257
+
258
+				// If not selected or url is empty, continue in loop.
259
+				if (empty($attachment['selected']) || empty($attachment['url']))
260
+					continue;
261
+
262
+				$li = "<li id='item_{$attachment_id}'>";
263
+				$li .= "<img src='{$attachment['url']}' alt='image_{$attachment_id}' />";
264
+				//$li 	.= "<a title='" . __( 'Delete this image' ) . "' class='at-delete-file' href='#' rel='{$nonce}|{$term_id}|{$id}|{$attachment_id}'>" . __( 'Delete' ) . "</a>";
265
+				$li .= "<a title='" . __('Remove this image', 'geodirectory') . "' class='at-delete-file' href='#' rel='{$nonce}|{$term_id}|{$id}|{$attachment_id}'><img src='" . $this->SelfPath . "/images/delete-16.png' alt='" . __('Remove', 'geodirectory') . "' /></a>";
266
+				$li .= "<input type='hidden' name='{$id}[]' value='{$attachment_id}' />";
267
+				$li .= "</li>";
268
+				$html .= $li;
269
+
270
+			} // End For Each
271
+
272
+			return media_send_to_editor($html);
273
+
274
+		}
275
+
276
+		/**
277
+		 * Delete attachments associated with the post.
278
+		 *
279
+		 * @since 1.0
280
+		 * @access public
281
+		 *
282
+		 * @param int|string $term_id The term ID.
283
+		 */
284
+		/*public function delete_attachments( $term_id ) {
285 285
 		
286 286
 		// Get Attachments
287 287
 		$attachments = get_posts( array( 'numberposts' => -1, 'post_type' => 'attachment', 'post_parent' => $term_id ) );
@@ -295,349 +295,349 @@  discard block
 block discarded – undo
295 295
 		
296 296
 	}*/
297 297
 
298
-        /**
299
-         * Ajax callback for deleting files.
300
-         *
301
-         * Modified from a function used by "Verve Meta Boxes" plugin ( http://goo.gl/aw64H )
302
-         *
303
-         * @since 1.0
304
-         * @access public
305
-         */
306
-        public function delete_file()
307
-        {
308
-
309
-
310
-            // If data is not set, die.
311
-            if (!isset($_POST['data']))
312
-                die();
313
-
314
-            list($nonce, $term_id, $key, $attach_id) = explode('|', $_POST['data']);
315
-
316
-            if (!wp_verify_nonce($nonce, 'at_ajax_delete'))
317
-                die('1');
318
-
319
-            $this->delete_tax_meta($term_id, $key, $attach_id);
320
-
321
-            die('0');
322
-
323
-        }
324
-
325
-        /**
326
-         * Ajax callback for deleting files.
327
-         * Modified from a function used by "Verve Meta Boxes" plugin (http://goo.gl/LzYSq)
328
-         * @since 1.0
329
-         * @access public
330
-         */
331
-        public function wp_ajax_delete_image()
332
-        {
333
-            $term_id = isset($_GET['post_id']) ? intval($_GET['post_id']) : 0;
334
-            $field_id = isset($_GET['field_id']) ? $_GET['field_id'] : 0;
335
-            $attachment_id = isset($_GET['attachment_id']) ? intval($_GET['attachment_id']) : 0;
336
-            $ok = false;
337
-            if (strpos($field_id, '[') === false) {
338
-                check_admin_referer("at-delete-mupload_" . urldecode($field_id));
339
-                if ($term_id > 0)
340
-                    $this->delete_tax_meta($term_id, $field_id);
341
-                //$ok = wp_delete_attachment( $attachment_id );
342
-                $ok = 1;
343
-            } else {
344
-                $f = explode('[', urldecode($field_id));
345
-                $f_fiexed = array();
346
-                foreach ($f as $k => $v) {
347
-                    $f[$k] = str_replace(']', '', $v);
348
-                }
349
-                $saved = $this->get_tax_meta($term_id, $f[0], true);
350
-                if (isset($saved[$f[1]][$f[2]])) {
351
-                    unset($saved[$f[1]][$f[2]]);
352
-                    if ($term_id > 0)
353
-                        update_post_meta($term_id, $f[0], $saved);
354
-                    //$ok = wp_delete_attachment( $attachment_id );
355
-                    $ok = 1;
356
-                }
357
-            }
358
-
359
-
360
-            if ($ok) {
361
-                echo json_encode(array('status' => 'success'));
362
-                die();
363
-            } else {
364
-                echo json_encode(array('message' => __('Cannot delete file. Something\'s wrong.', 'geodirectory')));
365
-                die();
366
-            }
367
-        }
368
-
369
-        /**
370
-         * Ajax callback for reordering Images.
371
-         *
372
-         * @since 1.0
373
-         * @access public
374
-         */
375
-        public function reorder_images()
376
-        {
377
-
378
-            if (!isset($_POST['data']))
379
-                die();
380
-
381
-            list($order, $term_id, $key, $nonce) = explode('|', $_POST['data']);
382
-
383
-            if (!wp_verify_nonce($nonce, 'at_ajax_reorder'))
384
-                die('1');
385
-
386
-            parse_str($order, $items);
387
-            $items = $items['item'];
388
-            $order = 1;
389
-            foreach ($items as $item) {
390
-                wp_update_post(array('ID' => $item, 'post_parent' => $term_id, 'menu_order' => $order));
391
-                $order++;
392
-            }
393
-
394
-            die('0');
395
-
396
-        }
397
-
398
-        /**
399
-         * Check Field Color
400
-         *
401
-         * @since 1.0
402
-         * @access public
403
-         */
404
-        public function check_field_color()
405
-        {
406
-
407
-            if ($this->has_field('color') && $this->is_edit_page()) {
408
-                // Enqueu built-in script and style for color picker.
409
-                wp_enqueue_style('farbtastic');
410
-                wp_enqueue_script('farbtastic');
411
-            }
412
-
413
-        }
414
-
415
-        /**
416
-         * Check Field Date
417
-         *
418
-         * @since 1.0
419
-         * @access public
420
-         */
421
-        public function check_field_date()
422
-        {
423
-
424
-            if ($this->has_field('date') && $this->is_edit_page()) {
425
-                // Enqueu JQuery UI, use proper version.
426
-                wp_enqueue_style('tmc-jquery-ui-css', 'https://ajax.googleapis.com/ajax/libs/jqueryui/' . $this->get_jqueryui_ver() . '/themes/base/jquery-ui.css');
427
-                wp_enqueue_script('tmc-jquery-ui', 'https://ajax.googleapis.com/ajax/libs/jqueryui/' . $this->get_jqueryui_ver() . '/jquery-ui.min.js', array('jquery'));
428
-            }
429
-
430
-        }
431
-
432
-        /**
433
-         * Check Field Time
434
-         *
435
-         * @since 1.0
436
-         * @access public
437
-         */
438
-        public function check_field_time()
439
-        {
440
-
441
-            if ($this->has_field('time') && $this->is_edit_page()) {
442
-
443
-                // Enqueu JQuery UI, use proper version.
444
-                wp_enqueue_style('tmc-jquery-ui-css', 'https://ajax.googleapis.com/ajax/libs/jqueryui/' . $this->get_jqueryui_ver() . '/themes/base/jquery-ui.css', array(), false, true);
445
-                wp_enqueue_script('tmc-jquery-ui', 'https://ajax.googleapis.com/ajax/libs/jqueryui/' . $this->get_jqueryui_ver() . '/jquery-ui.min.js', array('jquery'), false, true);
446
-                wp_enqueue_script('at-timepicker', 'https://github.com/trentrichardson/jQuery-Timepicker-Addon/raw/master/jquery-ui-timepicker-addon.js', array('tmc-jquery-ui'), false, true);
447
-
448
-            }
449
-
450
-        }
451
-
452
-        /**
453
-         * Add Meta Box for multiple post types.
454
-         *
455
-         * @since 1.0
456
-         * @access public
457
-         */
458
-        public function add()
459
-        {
460
-
461
-            // Loop through array
462
-            if (!empty($this->_meta_box['pages'])) {
463
-                foreach ($this->_meta_box['pages'] as $page) {
464
-                    //add fields to edit form
465
-                    add_action($page . '_edit_form_fields', array(&$this, 'show_edit_form'));
466
-                    //add fields to add new form
467
-                    add_action($page . '_add_form_fields', array(&$this, 'show_new_form'));
468
-                    // this saves the edit fields
469
-                    add_action('edited_' . $page, array(&$this, 'save'), 10, 2);
470
-                    // this saves the add fields
471
-                    add_action('created_' . $page, array(&$this, 'save'), 10, 2);
472
-                }
473
-            }
474
-
475
-        }
476
-
477
-        /**
478
-         * Callback function to show fields on add new taxonomy term form.
479
-         *
480
-         * @since 1.0
481
-         * @access public
482
-         */
483
-        public function show_new_form($term_id)
484
-        {
485
-            $this->_form_type = 'new';
486
-            $this->show($term_id);
487
-        }
488
-
489
-        /**
490
-         * Callback function to show fields on term edit form.
491
-         *
492
-         * @since 1.0
493
-         * @access public
494
-         */
495
-        public function show_edit_form($term_id)
496
-        {
497
-            $this->_form_type = 'edit';
498
-            $this->show($term_id);
499
-        }
500
-
501
-
502
-        /**
503
-         * Callback function to show fields in meta box.
504
-         *
505
-         * @since 1.0
506
-         * @access public
507
-         */
508
-        public function show($term_id)
509
-        {
510
-
511
-            wp_nonce_field(basename(__FILE__), 'tax_meta_class_nonce');
512
-
513
-            foreach ($this->_fields as $field) {
514
-                $meta = $this->get_tax_meta($term_id, $field['id'], !$field['multiple']);
515
-                $meta = ($meta !== '') ? $meta : $field['std'];
516
-                if ('image' != $field['type'] && $field['type'] != 'repeater')
517
-                    $meta = is_array($meta) ? array_map('esc_attr', $meta) : esc_attr($meta);
518
-
519
-                if ($field['validate_func']) {
520
-                    echo '<tr class="form-field form-required ' . $field['style'] . '">';
521
-                } else {
522
-                    echo '<tr class="form-field ' . $field['style'] . '">';
523
-                }
524
-
525
-                // Call Separated methods for displaying each type of field.
526
-                call_user_func(array(&$this, 'show_field_' . $field['type']), $field, $meta);
527
-                echo '</tr>';
528
-            }
529
-            echo '</table>';
530
-        }
531
-
532
-        /**
533
-         * Show Repeater Fields.
534
-         *
535
-         * @param string $field
536
-         * @param string $meta
537
-         * @since 1.0
538
-         * @access public
539
-         */
540
-        public function show_field_repeater($field, $meta)
541
-        {
542
-            // Get Plugin Path
543
-            $plugin_path = $this->SelfPath;
544
-            $this->show_field_begin($field, $meta);
545
-            echo "<div class='at-repeat' id='{$field['id']}'>";
546
-
547
-            $c = 0;
548
-
549
-            if (count($meta) > 0 && is_array($meta)) {
550
-                foreach ($meta as $me) {
551
-                    //for labling toggles
552
-                    $mmm = $me[$field['fields'][0]['id']];
553
-                    echo '<div class="at-repater-block">' . $mmm . '<br/><table class="repeater-table" style="display: none;">';
554
-                    if ($field['inline']) {
555
-                        echo '<tr class="at-inline" VALIGN="top">';
556
-                    }
557
-                    foreach ($field['fields'] as $f) {
558
-                        //reset var $id for repeater
559
-                        $id = '';
560
-                        $id = $field['id'] . '[' . $c . '][' . $f['id'] . ']';
561
-                        $m = $me[$f['id']];
562
-                        $m = ($m !== '') ? $m : $f['std'];
563
-                        if ('image' != $f['type'] && $f['type'] != 'repeater')
564
-                            $m = is_array($m) ? array_map('esc_attr', $m) : esc_attr($m);
565
-                        //set new id for field in array format
566
-                        $f['id'] = $id;
567
-                        if (!$field['inline']) {
568
-                            echo '<tr>';
569
-                        }
570
-                        call_user_func(array(&$this, 'show_field_' . $f['type']), $f, $m);
571
-                        if (!$field['inline']) {
572
-                            echo '</tr>';
573
-                        }
574
-                    }
575
-                    if ($field['inline']) {
576
-                        echo '</tr>';
577
-                    }
578
-                    echo '</table>
298
+		/**
299
+		 * Ajax callback for deleting files.
300
+		 *
301
+		 * Modified from a function used by "Verve Meta Boxes" plugin ( http://goo.gl/aw64H )
302
+		 *
303
+		 * @since 1.0
304
+		 * @access public
305
+		 */
306
+		public function delete_file()
307
+		{
308
+
309
+
310
+			// If data is not set, die.
311
+			if (!isset($_POST['data']))
312
+				die();
313
+
314
+			list($nonce, $term_id, $key, $attach_id) = explode('|', $_POST['data']);
315
+
316
+			if (!wp_verify_nonce($nonce, 'at_ajax_delete'))
317
+				die('1');
318
+
319
+			$this->delete_tax_meta($term_id, $key, $attach_id);
320
+
321
+			die('0');
322
+
323
+		}
324
+
325
+		/**
326
+		 * Ajax callback for deleting files.
327
+		 * Modified from a function used by "Verve Meta Boxes" plugin (http://goo.gl/LzYSq)
328
+		 * @since 1.0
329
+		 * @access public
330
+		 */
331
+		public function wp_ajax_delete_image()
332
+		{
333
+			$term_id = isset($_GET['post_id']) ? intval($_GET['post_id']) : 0;
334
+			$field_id = isset($_GET['field_id']) ? $_GET['field_id'] : 0;
335
+			$attachment_id = isset($_GET['attachment_id']) ? intval($_GET['attachment_id']) : 0;
336
+			$ok = false;
337
+			if (strpos($field_id, '[') === false) {
338
+				check_admin_referer("at-delete-mupload_" . urldecode($field_id));
339
+				if ($term_id > 0)
340
+					$this->delete_tax_meta($term_id, $field_id);
341
+				//$ok = wp_delete_attachment( $attachment_id );
342
+				$ok = 1;
343
+			} else {
344
+				$f = explode('[', urldecode($field_id));
345
+				$f_fiexed = array();
346
+				foreach ($f as $k => $v) {
347
+					$f[$k] = str_replace(']', '', $v);
348
+				}
349
+				$saved = $this->get_tax_meta($term_id, $f[0], true);
350
+				if (isset($saved[$f[1]][$f[2]])) {
351
+					unset($saved[$f[1]][$f[2]]);
352
+					if ($term_id > 0)
353
+						update_post_meta($term_id, $f[0], $saved);
354
+					//$ok = wp_delete_attachment( $attachment_id );
355
+					$ok = 1;
356
+				}
357
+			}
358
+
359
+
360
+			if ($ok) {
361
+				echo json_encode(array('status' => 'success'));
362
+				die();
363
+			} else {
364
+				echo json_encode(array('message' => __('Cannot delete file. Something\'s wrong.', 'geodirectory')));
365
+				die();
366
+			}
367
+		}
368
+
369
+		/**
370
+		 * Ajax callback for reordering Images.
371
+		 *
372
+		 * @since 1.0
373
+		 * @access public
374
+		 */
375
+		public function reorder_images()
376
+		{
377
+
378
+			if (!isset($_POST['data']))
379
+				die();
380
+
381
+			list($order, $term_id, $key, $nonce) = explode('|', $_POST['data']);
382
+
383
+			if (!wp_verify_nonce($nonce, 'at_ajax_reorder'))
384
+				die('1');
385
+
386
+			parse_str($order, $items);
387
+			$items = $items['item'];
388
+			$order = 1;
389
+			foreach ($items as $item) {
390
+				wp_update_post(array('ID' => $item, 'post_parent' => $term_id, 'menu_order' => $order));
391
+				$order++;
392
+			}
393
+
394
+			die('0');
395
+
396
+		}
397
+
398
+		/**
399
+		 * Check Field Color
400
+		 *
401
+		 * @since 1.0
402
+		 * @access public
403
+		 */
404
+		public function check_field_color()
405
+		{
406
+
407
+			if ($this->has_field('color') && $this->is_edit_page()) {
408
+				// Enqueu built-in script and style for color picker.
409
+				wp_enqueue_style('farbtastic');
410
+				wp_enqueue_script('farbtastic');
411
+			}
412
+
413
+		}
414
+
415
+		/**
416
+		 * Check Field Date
417
+		 *
418
+		 * @since 1.0
419
+		 * @access public
420
+		 */
421
+		public function check_field_date()
422
+		{
423
+
424
+			if ($this->has_field('date') && $this->is_edit_page()) {
425
+				// Enqueu JQuery UI, use proper version.
426
+				wp_enqueue_style('tmc-jquery-ui-css', 'https://ajax.googleapis.com/ajax/libs/jqueryui/' . $this->get_jqueryui_ver() . '/themes/base/jquery-ui.css');
427
+				wp_enqueue_script('tmc-jquery-ui', 'https://ajax.googleapis.com/ajax/libs/jqueryui/' . $this->get_jqueryui_ver() . '/jquery-ui.min.js', array('jquery'));
428
+			}
429
+
430
+		}
431
+
432
+		/**
433
+		 * Check Field Time
434
+		 *
435
+		 * @since 1.0
436
+		 * @access public
437
+		 */
438
+		public function check_field_time()
439
+		{
440
+
441
+			if ($this->has_field('time') && $this->is_edit_page()) {
442
+
443
+				// Enqueu JQuery UI, use proper version.
444
+				wp_enqueue_style('tmc-jquery-ui-css', 'https://ajax.googleapis.com/ajax/libs/jqueryui/' . $this->get_jqueryui_ver() . '/themes/base/jquery-ui.css', array(), false, true);
445
+				wp_enqueue_script('tmc-jquery-ui', 'https://ajax.googleapis.com/ajax/libs/jqueryui/' . $this->get_jqueryui_ver() . '/jquery-ui.min.js', array('jquery'), false, true);
446
+				wp_enqueue_script('at-timepicker', 'https://github.com/trentrichardson/jQuery-Timepicker-Addon/raw/master/jquery-ui-timepicker-addon.js', array('tmc-jquery-ui'), false, true);
447
+
448
+			}
449
+
450
+		}
451
+
452
+		/**
453
+		 * Add Meta Box for multiple post types.
454
+		 *
455
+		 * @since 1.0
456
+		 * @access public
457
+		 */
458
+		public function add()
459
+		{
460
+
461
+			// Loop through array
462
+			if (!empty($this->_meta_box['pages'])) {
463
+				foreach ($this->_meta_box['pages'] as $page) {
464
+					//add fields to edit form
465
+					add_action($page . '_edit_form_fields', array(&$this, 'show_edit_form'));
466
+					//add fields to add new form
467
+					add_action($page . '_add_form_fields', array(&$this, 'show_new_form'));
468
+					// this saves the edit fields
469
+					add_action('edited_' . $page, array(&$this, 'save'), 10, 2);
470
+					// this saves the add fields
471
+					add_action('created_' . $page, array(&$this, 'save'), 10, 2);
472
+				}
473
+			}
474
+
475
+		}
476
+
477
+		/**
478
+		 * Callback function to show fields on add new taxonomy term form.
479
+		 *
480
+		 * @since 1.0
481
+		 * @access public
482
+		 */
483
+		public function show_new_form($term_id)
484
+		{
485
+			$this->_form_type = 'new';
486
+			$this->show($term_id);
487
+		}
488
+
489
+		/**
490
+		 * Callback function to show fields on term edit form.
491
+		 *
492
+		 * @since 1.0
493
+		 * @access public
494
+		 */
495
+		public function show_edit_form($term_id)
496
+		{
497
+			$this->_form_type = 'edit';
498
+			$this->show($term_id);
499
+		}
500
+
501
+
502
+		/**
503
+		 * Callback function to show fields in meta box.
504
+		 *
505
+		 * @since 1.0
506
+		 * @access public
507
+		 */
508
+		public function show($term_id)
509
+		{
510
+
511
+			wp_nonce_field(basename(__FILE__), 'tax_meta_class_nonce');
512
+
513
+			foreach ($this->_fields as $field) {
514
+				$meta = $this->get_tax_meta($term_id, $field['id'], !$field['multiple']);
515
+				$meta = ($meta !== '') ? $meta : $field['std'];
516
+				if ('image' != $field['type'] && $field['type'] != 'repeater')
517
+					$meta = is_array($meta) ? array_map('esc_attr', $meta) : esc_attr($meta);
518
+
519
+				if ($field['validate_func']) {
520
+					echo '<tr class="form-field form-required ' . $field['style'] . '">';
521
+				} else {
522
+					echo '<tr class="form-field ' . $field['style'] . '">';
523
+				}
524
+
525
+				// Call Separated methods for displaying each type of field.
526
+				call_user_func(array(&$this, 'show_field_' . $field['type']), $field, $meta);
527
+				echo '</tr>';
528
+			}
529
+			echo '</table>';
530
+		}
531
+
532
+		/**
533
+		 * Show Repeater Fields.
534
+		 *
535
+		 * @param string $field
536
+		 * @param string $meta
537
+		 * @since 1.0
538
+		 * @access public
539
+		 */
540
+		public function show_field_repeater($field, $meta)
541
+		{
542
+			// Get Plugin Path
543
+			$plugin_path = $this->SelfPath;
544
+			$this->show_field_begin($field, $meta);
545
+			echo "<div class='at-repeat' id='{$field['id']}'>";
546
+
547
+			$c = 0;
548
+
549
+			if (count($meta) > 0 && is_array($meta)) {
550
+				foreach ($meta as $me) {
551
+					//for labling toggles
552
+					$mmm = $me[$field['fields'][0]['id']];
553
+					echo '<div class="at-repater-block">' . $mmm . '<br/><table class="repeater-table" style="display: none;">';
554
+					if ($field['inline']) {
555
+						echo '<tr class="at-inline" VALIGN="top">';
556
+					}
557
+					foreach ($field['fields'] as $f) {
558
+						//reset var $id for repeater
559
+						$id = '';
560
+						$id = $field['id'] . '[' . $c . '][' . $f['id'] . ']';
561
+						$m = $me[$f['id']];
562
+						$m = ($m !== '') ? $m : $f['std'];
563
+						if ('image' != $f['type'] && $f['type'] != 'repeater')
564
+							$m = is_array($m) ? array_map('esc_attr', $m) : esc_attr($m);
565
+						//set new id for field in array format
566
+						$f['id'] = $id;
567
+						if (!$field['inline']) {
568
+							echo '<tr>';
569
+						}
570
+						call_user_func(array(&$this, 'show_field_' . $f['type']), $f, $m);
571
+						if (!$field['inline']) {
572
+							echo '</tr>';
573
+						}
574
+					}
575
+					if ($field['inline']) {
576
+						echo '</tr>';
577
+					}
578
+					echo '</table>
579 579
 				<span class="at-re-toggle"><img src="';
580
-                    if ($this->_Local_images) {
581
-                        echo $plugin_path . '/images/edit.png';
582
-                    } else {
583
-                        echo 'http://i.imgur.com/ka0E2.png';
584
-                    }
585
-                    echo '" alt="Edit" title="Edit"/></span> 
580
+					if ($this->_Local_images) {
581
+						echo $plugin_path . '/images/edit.png';
582
+					} else {
583
+						echo 'http://i.imgur.com/ka0E2.png';
584
+					}
585
+					echo '" alt="Edit" title="Edit"/></span> 
586 586
 				<img src="';
587
-                    if ($this->_Local_images) {
588
-                        echo $plugin_path . '/images/remove.png';
589
-                    } else {
590
-                        echo 'http://i.imgur.com/g8Duj.png';
591
-                    }
592
-                    echo '" alt="' . __('Remove', 'geodirectory') . '" title="' . __('Remove', 'geodirectory') . '" id="remove-' . $field['id'] . '"></div>';
593
-                    $c = $c + 1;
594
-
595
-                }
596
-                $this->show_field_end($field, $meta);
597
-            }
598
-
599
-            echo '<img src="';
600
-            if ($this->_Local_images) {
601
-                echo $plugin_path . '/images/add.png';
602
-            } else {
603
-                echo 'http://i.imgur.com/w5Tuc.png';
604
-            }
605
-            echo '" alt="' . __('Add', 'geodirectory') . '" title="' . __('Add', 'geodirectory') . '" id="add-' . $field['id'] . '"><br/></div>';
606
-
607
-            //create all fields once more for js function and catch with object buffer
608
-            ob_start();
609
-            echo '<div class="at-repater-block"><table class="repeater-table">';
610
-            if ($field['inline']) {
611
-                echo '<tr class="at-inline" VALIGN="top">';
612
-            }
613
-            foreach ($field['fields'] as $f) {
614
-                //reset var $id for repeater
615
-                $id = '';
616
-                $id = $field['id'] . '[CurrentCounter][' . $f['id'] . ']';
617
-                $f['id'] = $id;
618
-                if (!$field['inline']) {
619
-                    echo '<tr>';
620
-                }
621
-                call_user_func(array(&$this, 'show_field_' . $f['type']), $f, '');
622
-                if (!$field['inline']) {
623
-                    echo '</tr>';
624
-                }
625
-            }
626
-            if ($field['inline']) {
627
-                echo '</tr>';
628
-            }
629
-            echo '</table><img src="';
630
-            if ($this->_Local_images) {
631
-                echo $plugin_path . '/images/remove.png';
632
-            } else {
633
-                echo 'http://i.imgur.com/g8Duj.png';
634
-            }
635
-            echo '" alt="' . __('Remove', 'geodirectory') . '" title="' . __('Remove', 'geodirectory') . '" id="remove-' . $field['id'] . '"></div>';
636
-            $counter = 'countadd_' . $field['id'];
637
-            $js_code = ob_get_clean();
638
-            $js_code = str_replace("'", "\"", $js_code);
639
-            $js_code = str_replace("CurrentCounter", "' + " . $counter . " + '", $js_code);
640
-            echo '<script>
587
+					if ($this->_Local_images) {
588
+						echo $plugin_path . '/images/remove.png';
589
+					} else {
590
+						echo 'http://i.imgur.com/g8Duj.png';
591
+					}
592
+					echo '" alt="' . __('Remove', 'geodirectory') . '" title="' . __('Remove', 'geodirectory') . '" id="remove-' . $field['id'] . '"></div>';
593
+					$c = $c + 1;
594
+
595
+				}
596
+				$this->show_field_end($field, $meta);
597
+			}
598
+
599
+			echo '<img src="';
600
+			if ($this->_Local_images) {
601
+				echo $plugin_path . '/images/add.png';
602
+			} else {
603
+				echo 'http://i.imgur.com/w5Tuc.png';
604
+			}
605
+			echo '" alt="' . __('Add', 'geodirectory') . '" title="' . __('Add', 'geodirectory') . '" id="add-' . $field['id'] . '"><br/></div>';
606
+
607
+			//create all fields once more for js function and catch with object buffer
608
+			ob_start();
609
+			echo '<div class="at-repater-block"><table class="repeater-table">';
610
+			if ($field['inline']) {
611
+				echo '<tr class="at-inline" VALIGN="top">';
612
+			}
613
+			foreach ($field['fields'] as $f) {
614
+				//reset var $id for repeater
615
+				$id = '';
616
+				$id = $field['id'] . '[CurrentCounter][' . $f['id'] . ']';
617
+				$f['id'] = $id;
618
+				if (!$field['inline']) {
619
+					echo '<tr>';
620
+				}
621
+				call_user_func(array(&$this, 'show_field_' . $f['type']), $f, '');
622
+				if (!$field['inline']) {
623
+					echo '</tr>';
624
+				}
625
+			}
626
+			if ($field['inline']) {
627
+				echo '</tr>';
628
+			}
629
+			echo '</table><img src="';
630
+			if ($this->_Local_images) {
631
+				echo $plugin_path . '/images/remove.png';
632
+			} else {
633
+				echo 'http://i.imgur.com/g8Duj.png';
634
+			}
635
+			echo '" alt="' . __('Remove', 'geodirectory') . '" title="' . __('Remove', 'geodirectory') . '" id="remove-' . $field['id'] . '"></div>';
636
+			$counter = 'countadd_' . $field['id'];
637
+			$js_code = ob_get_clean();
638
+			$js_code = str_replace("'", "\"", $js_code);
639
+			$js_code = str_replace("CurrentCounter", "' + " . $counter . " + '", $js_code);
640
+			echo '<script>
641 641
 				jQuery(document).ready(function() {
642 642
 					var ' . $counter . ' = ' . $c . ';
643 643
 					jQuery("#add-' . $field['id'] . '").live(\'click\', function() {
@@ -650,7 +650,7 @@  discard block
 block discarded – undo
650 650
         			});
651 651
     			});
652 652
     		</script>';
653
-            echo '<br/><style>
653
+			echo '<br/><style>
654 654
 .at-inline{line-height: 1 !important;}
655 655
 .at-inline .at-field{border: 0px !important;}
656 656
 .at-inline .at-label{margin: 0 0 1px !important;}
@@ -658,531 +658,531 @@  discard block
 block discarded – undo
658 658
 .at-inline .at-textarea{width: 100px; height: 75px;}
659 659
 .at-repater-block{background-color: #FFFFFF;border: 1px solid;margin: 2px;}
660 660
 </style>';
661
-            $this->show_field_end($field, $meta);
662
-        }
663
-
664
-        /**
665
-         * Begin Field.
666
-         *
667
-         * @param string $field
668
-         * @param string $meta
669
-         * @since 1.0
670
-         * @access public
671
-         */
672
-        public function show_field_begin($field, $meta)
673
-        {
674
-            if (isset($field['group'])) {
675
-                if ($field['group'] == "start") {
676
-                    echo "<td class='at-field'>";
677
-                }
678
-            } else {
679
-                if ($this->_form_type == 'edit') {
680
-                    echo '<th valign="top" scope="row">';
681
-                } else {
682
-                    if ($field['validate_func']) {
683
-                        echo '<td><div class="form-field form-required">';
684
-                    } else {
685
-                        echo '<td><div class="form-field">';
686
-                    }
687
-                }
688
-            }
689
-            if ($field['name'] != '' || $field['name'] != FALSE) {
690
-                //echo "<div class='at-label'>";
691
-                echo "<label for='{$field['id']}'>{$field['name']}</label>";
692
-                //echo "</div>";
693
-            }
694
-            if ($this->_form_type == 'edit') {
695
-                echo '</th><td>';
696
-            }
697
-        }
698
-
699
-        /**
700
-         * End Field.
701
-         *
702
-         * @param string $field
703
-         * @param string $meta
704
-         * @since 1.0
705
-         * @access public
706
-         */
707
-        public function show_field_end($field, $meta = NULL, $group = false)
708
-        {
709
-            if (isset($field['group'])) {
710
-                if ($group == 'end') {
711
-                    if ($field['desc'] != '') {
712
-                        echo "<p class='desc-field'>{$field['desc']}</p></td>";
713
-                    } else {
714
-                        echo "</td>";
715
-                    }
716
-                } else {
717
-                    if ($field['desc'] != '') {
718
-                        echo "<p class='desc-field'>{$field['desc']}</p><br/>";
719
-                    } else {
720
-                        echo '<br/>';
721
-                    }
722
-                }
723
-            } else {
724
-                if ($field['desc'] != '') {
725
-                    echo "<p class='desc-field'>{$field['desc']}</p>";
726
-                }
727
-                if ($this->_form_type == 'edit') {
728
-                    echo '</td>';
729
-                } else {
730
-                    echo '</td></div>';
731
-                }
732
-            }
733
-        }
734
-
735
-        /**
736
-         * Show Field Text.
737
-         *
738
-         * @param string $field
739
-         * @param string $meta
740
-         * @since 1.0
741
-         * @access public
742
-         */
743
-        public function show_field_text($field, $meta)
744
-        {
745
-            $this->show_field_begin($field, $meta);
746
-            echo "<input type='text' class='at-text' name='{$field['id']}' id='{$field['id']}' value='{$meta}' size='30' />";
747
-            $this->show_field_end($field, $meta);
748
-        }
749
-
750
-        /**
751
-         * Show Field hidden.
752
-         *
753
-         * @param string $field
754
-         * @param string|mixed $meta
755
-         * @since 0.1.3
756
-         * @access public
757
-         */
758
-        public function show_field_hidden($field, $meta)
759
-        {
760
-            //$this->show_field_begin( $field, $meta );
761
-            echo "<input type='hidden' class='at-text' name='{$field['id']}' id='{$field['id']}' value='{$meta}'/>";
762
-            //$this->show_field_end( $field, $meta );
763
-        }
764
-
765
-        /**
766
-         * Show Field Paragraph.
767
-         *
768
-         * @param string $field
769
-         * @since 0.1.3
770
-         * @access public
771
-         */
772
-        public function show_field_paragraph($field)
773
-        {
774
-            //$this->show_field_begin( $field, $meta );
775
-            echo '<p>' . $field['value'] . '</p>';
776
-            //$this->show_field_end( $field, $meta );
777
-        }
778
-
779
-        /**
780
-         * Show Field Textarea.
781
-         *
782
-         * @param string $field
783
-         * @param string $meta
784
-         * @since 1.0
785
-         * @access public
786
-         */
787
-        public function show_field_textarea($field, $meta)
788
-        {
789
-            $this->show_field_begin($field, $meta);
790
-            echo "<textarea class='at-textarea large-text' name='{$field['id']}' id='{$field['id']}' cols='60' rows='10'>{$meta}</textarea>";
791
-            $this->show_field_end($field, $meta);
792
-        }
793
-
794
-        /**
795
-         * Show Field Select.
796
-         *
797
-         * @param string $field
798
-         * @param string $meta
799
-         * @since 1.0
800
-         * @access public
801
-         */
802
-        public function show_field_select($field, $meta)
803
-        {
804
-
805
-            if (!is_array($meta))
806
-                $meta = (array)$meta;
807
-
808
-            $this->show_field_begin($field, $meta);
809
-            echo "<select class='at-select' name='{$field['id']}" . ($field['multiple'] ? "[]' id='{$field['id']}' multiple='multiple'" : "'") . ">";
810
-            foreach ($field['options'] as $key => $value) {
811
-                echo "<option value='{$key}'" . selected(in_array($key, $meta), true, false) . ">{$value}</option>";
812
-            }
813
-            echo "</select>";
814
-            $this->show_field_end($field, $meta);
815
-
816
-        }
817
-
818
-        /**
819
-         * Show Radio Field.
820
-         *
821
-         * @param string $field
822
-         * @param string $meta
823
-         * @since 1.0
824
-         * @access public
825
-         */
826
-        public function show_field_radio($field, $meta)
827
-        {
828
-
829
-            if (!is_array($meta))
830
-                $meta = (array)$meta;
831
-
832
-            $this->show_field_begin($field, $meta);
833
-            foreach ($field['options'] as $key => $value) {
834
-                echo "<input type='radio' class='at-radio' name='{$field['id']}' value='{$key}'" . checked(in_array($key, $meta), true, false) . " /> <span class='at-radio-label'>{$value}</span>";
835
-            }
836
-            $this->show_field_end($field, $meta);
837
-        }
838
-
839
-        /**
840
-         * Show Checkbox Field.
841
-         *
842
-         * @param string $field
843
-         * @param string $meta
844
-         * @since 1.0
845
-         * @access public
846
-         */
847
-        public function show_field_checkbox($field, $meta)
848
-        {
849
-
850
-            $this->show_field_begin($field, $meta);
851
-            echo "<input type='checkbox' class='rw-checkbox' name='{$field['id']}' id='{$field['id']}'" . checked(!empty($meta), true, false) . " /> {$field['desc']}";
852
-            $this->show_field_end($field, $meta);
853
-        }
854
-
855
-        /**
856
-         * Show Wysiwig Field.
857
-         *
858
-         * @param string $field
859
-         * @param string $meta
860
-         * @since 1.0
861
-         * @access public
862
-         */
863
-        public function show_field_wysiwyg($field, $meta)
864
-        {
865
-            $this->show_field_begin($field, $meta);
866
-            // Add TinyMCE script for WP version < 3.3
867
-            global $wp_version;
868
-
869
-            if (version_compare($wp_version, '3.2.1') < 1) {
870
-                echo "<textarea class='at-wysiwyg theEditor large-text' name='{$field['id']}' id='{$field['id']}' cols='60' rows='10'>{$meta}</textarea>";
871
-            } else {
872
-                // Use new wp_editor() since WP 3.3
873
-                wp_editor(stripslashes(html_entity_decode($meta)), $field['id'], array('editor_class' => 'at-wysiwyg'));
874
-            }
875
-            $this->show_field_end($field, $meta);
876
-        }
877
-
878
-        /**
879
-         * Show File Field.
880
-         *
881
-         * @global object $post The current post object.
882
-         * @param string $field
883
-         * @param string $meta
884
-         * @since 1.0
885
-         * @access public
886
-         */
887
-        public function show_field_file($field, $meta)
888
-        {
889
-
890
-            global $post;
891
-
892
-            if (!is_array($meta))
893
-                $meta = (array)$meta;
894
-
895
-            $this->show_field_begin($field, $meta);
896
-            echo "{$field['desc']}<br />";
897
-
898
-            if (!empty($meta)) {
899
-                $nonce = wp_create_nonce('at_ajax_delete');
900
-                echo '<div style="margin-bottom: 10px"><strong>' . __('Uploaded files', 'geodirectory') . '</strong></div>';
901
-                echo '<ol class="at-upload">';
902
-                foreach ($meta as $att) {
903
-                    // if (wp_attachment_is_image($att)) continue; // what's image uploader for?
904
-                    echo "<li>" . wp_get_attachment_link($att, '', false, false, ' ') . " (<a class='at-delete-file' href='#' rel='{$nonce}|{$post->ID}|{$field['id']}|{$att}'>" . __('Remove', 'geodirectory') . "</a>)</li>";
905
-                }
906
-                echo '</ol>';
907
-            }
908
-
909
-            // show form upload
910
-
911
-            echo "<div class='at-file-upload-label'>";
912
-            echo "<strong>" . __('Upload new files', 'geodirectory') . "</strong>";
913
-            echo "</div>";
914
-            echo "<div class='new-files'>";
915
-            echo "<div class='file-input'>";
916
-            echo "<input type='file' name='{$field['id']}[]' />";
917
-            echo "</div><!-- End .file-input -->";
918
-            echo "<a class='at-add-file button' href='#'>" . __('Add more files', 'geodirectory') . "</a>";
919
-            echo "</div><!-- End .new-files -->";
920
-            echo "</td>";
921
-            $this->show_field_end($field, $meta);
922
-        }
923
-
924
-        /**
925
-         * Show Image Field.
926
-         *
927
-         * @param array $field
928
-         * @param array $meta
929
-         * @since 1.0
930
-         * @access public
931
-         */
932
-        public function show_field_image($field, $meta)
933
-        {
934
-            $this->show_field_begin($field, $meta);
935
-            $html = wp_nonce_field("at-delete-mupload_{$field['id']}", "nonce-delete-mupload_" . $field['id'], false, false);
936
-            if (is_array($meta)) {
937
-                if (isset($meta[0]) && is_array($meta[0]))
938
-                    $meta = $meta[0];
939
-            }
940
-
941
-            $uploads = wp_upload_dir();
942
-            if (is_array($meta) && isset($meta['src']) && $meta['src'] != '') {
943
-                $file_info = pathinfo($meta['src']);
944
-
945
-                if ($file_info['dirname'] != '.' && $file_info['dirname'] != '..')
946
-                    $sub_dir = $file_info['dirname'];
947
-
948
-                $uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs
949
-                $uploads_baseurl = $uploads['baseurl'];
950
-                $uploads_path = $uploads['path'];
951
-
952
-                $file_name = $file_info['basename'];
953
-
954
-                if (strpos($sub_dir, 'https://') !== false) {
955
-                    $uploads['baseurl'] = str_replace('http://', 'https://', $uploads['baseurl']);
956
-                } else {
957
-                    $uploads['baseurl'] = str_replace('https://', 'http://', $uploads['baseurl']);
958
-                }
959
-                $sub_dir = str_replace($uploads['baseurl'], '', $sub_dir);
960
-
961
-                $uploads_url = $uploads_baseurl . $sub_dir;
962
-
963
-                $meta['src'] = $uploads_url . '/' . $file_name;
964
-
965
-                $html .= "<span class='mupload_img_holder'><img src='" . $meta['src'] . "' style='max-height: 150px;max-width: 150px;' /></span>";
966
-                $html .= "<input type='hidden' name='" . $field['id'] . "[id]' id='" . $field['id'] . "[id]' value='" . $meta['id'] . "' />";
967
-                $html .= "<input type='hidden' class='" . $field['id'] . "[src]' name='" . $field['id'] . "[src]' id='" . $field['id'] . "[src]' value='" . $meta['src'] . "' />";
968
-                $html .= "<input class='at-delete_image_button' type='button' rel='" . $field['id'] . "' value='" . __('Remove Image', 'geodirectory') . "' />";
969
-            } else {
970
-                $html .= "<span class='mupload_img_holder'></span>";
971
-                $html .= "<input type='hidden' name='" . $field['id'] . "[id]' id='" . $field['id'] . "[id]' value='' />";
972
-                $html .= "<input class='" . $field['id'] . "[src]' style='position:absolute;left:-500px;width:50px;' type='text' name='" . $field['id'] . "[src]' id='" . $field['id'] . "[src]' value='' />";
973
-                $html .= "<input class='at-upload_image_button' type='button' rel='" . $field['id'] . "' value='" . __('Upload Image', 'geodirectory') . "' />";
974
-            }
975
-            echo $html;
976
-            $this->show_field_end($field, $meta);
977
-        }
978
-
979
-        /**
980
-         * Show Color Field.
981
-         *
982
-         * @param string $field
983
-         * @param string $meta
984
-         * @since 1.0
985
-         * @access public
986
-         */
987
-        public function show_field_color($field, $meta)
988
-        {
989
-
990
-            if (empty($meta))
991
-                $meta = '#';
992
-
993
-            $this->show_field_begin($field, $meta);
994
-
995
-            echo "<input class='at-color' type='text' name='{$field['id']}' id='{$field['id']}' value='{$meta}' size='8' />";
996
-            //	echo "<a href='#' class='at-color-select button' rel='{$field['id']}'>" . __( 'Select a color' ) . "</a>";
997
-            echo "<input type='button' class='at-color-select button' rel='{$field['id']}' value='" . __('Select a color', 'geodirectory') . "'/>";
998
-            echo "<div style='display:none' class='at-color-picker' rel='{$field['id']}'></div>";
999
-            $this->show_field_end($field, $meta);
1000
-
1001
-        }
1002
-
1003
-        /**
1004
-         * Show Checkbox List Field
1005
-         *
1006
-         * @param string $field
1007
-         * @param string $meta
1008
-         * @since 1.0
1009
-         * @access public
1010
-         */
1011
-        public function show_field_checkbox_list($field, $meta)
1012
-        {
1013
-
1014
-            if (!is_array($meta))
1015
-                $meta = (array)$meta;
1016
-
1017
-            $this->show_field_begin($field, $meta);
1018
-
1019
-            $html = array();
1020
-
1021
-            foreach ($field['options'] as $key => $value) {
1022
-                $html[] = "<input type='checkbox' class='at-checkbox_list' name='{$field['id']}[]' value='{$key}'" . checked(in_array($key, $meta), true, false) . " /> {$value}";
1023
-            }
1024
-
1025
-            echo implode('<br />', $html);
1026
-
1027
-            $this->show_field_end($field, $meta);
1028
-
1029
-        }
1030
-
1031
-        /**
1032
-         * Show Date Field.
1033
-         *
1034
-         * @param string $field
1035
-         * @param string $meta
1036
-         * @since 1.0
1037
-         * @access public
1038
-         */
1039
-        public function show_field_date($field, $meta)
1040
-        {
1041
-            $this->show_field_begin($field, $meta);
1042
-            echo "<input type='text' class='at-date' name='{$field['id']}' id='{$field['id']}' rel='{$field['format']}' value='{$meta}' size='30' />";
1043
-            $this->show_field_end($field, $meta);
1044
-        }
1045
-
1046
-        /**
1047
-         * Show time field.
1048
-         *
1049
-         * @param string $field
1050
-         * @param string $meta
1051
-         * @since 1.0
1052
-         * @access public
1053
-         */
1054
-        public function show_field_time($field, $meta)
1055
-        {
1056
-            $this->show_field_begin($field, $meta);
1057
-            echo "<input type='text' class='at-time' name='{$field['id']}' id='{$field['id']}' rel='{$field['format']}' value='{$meta}' size='30' />";
1058
-            $this->show_field_end($field, $meta);
1059
-        }
1060
-
1061
-        /**
1062
-         * Show Posts field.
1063
-         * used creating a posts/pages/custom types checkboxlist or a select dropdown
1064
-         *
1065
-         * @global object $post The current post object.
1066
-         * @param string $field
1067
-         * @param string $meta
1068
-         * @since 1.0
1069
-         * @access public
1070
-         */
1071
-        public function show_field_posts($field, $meta)
1072
-        {
1073
-            global $post;
1074
-
1075
-            if (!is_array($meta)) $meta = (array)$meta;
1076
-            $this->show_field_begin($field, $meta);
1077
-            $options = $field['options'];
1078
-            $posts = get_posts($options['args']);
1079
-
1080
-            // checkbox_list
1081
-            if ('checkbox_list' == $options['type']) {
1082
-                foreach ($posts as $p) {
1083
-                    echo "<input type='checkbox' name='{$field['id']}[]' value='$p->ID'" . checked(in_array($p->ID, $meta), true, false) . " /> $p->post_title<br/>";
1084
-                }
1085
-            } // select
1086
-            else {
1087
-                echo "<select name='{$field['id']}" . ($field['multiple'] ? "[]' multiple='multiple' style='height:auto'" : "'") . ">";
1088
-                foreach ($posts as $p) {
1089
-                    echo "<option value='$p->ID'" . selected(in_array($p->ID, $meta), true, false) . ">$p->post_title</option>";
1090
-                }
1091
-                echo "</select>";
1092
-            }
1093
-
1094
-            $this->show_field_end($field, $meta);
1095
-        }
1096
-
1097
-        /**
1098
-         * Show Taxonomy field.
1099
-         * used creating a category/tags/custom taxonomy checkboxlist or a select dropdown
1100
-         *
1101
-         * @global object $post The current post object.
1102
-         * @param string $field
1103
-         * @param string $meta
1104
-         * @since 1.0
1105
-         * @access public
1106
-         *
1107
-         * @uses get_terms()
1108
-         */
1109
-        public function show_field_taxonomy($field, $meta)
1110
-        {
1111
-            global $post;
1112
-
1113
-            if (!is_array($meta)) $meta = (array)$meta;
1114
-            $this->show_field_begin($field, $meta);
1115
-            $options = $field['options'];
1116
-            $terms = get_terms($options['taxonomy'], $options['args']);
1117
-
1118
-            // checkbox_list
1119
-            if ('checkbox_list' == $options['type']) {
1120
-                foreach ($terms as $term) {
1121
-                    echo "<input type='checkbox' name='{$field['id']}[]' value='$term->slug'" . checked(in_array($term->slug, $meta), true, false) . " /> $term->name<br/>";
1122
-                }
1123
-            } // select
1124
-            else {
1125
-                echo "<select name='{$field['id']}" . ($field['multiple'] ? "[]' multiple='multiple' style='height:auto'" : "'") . ">";
1126
-                foreach ($terms as $term) {
1127
-                    echo "<option value='$term->slug'" . selected(in_array($term->slug, $meta), true, false) . ">$term->name</option>";
1128
-                }
1129
-                echo "</select>";
1130
-            }
1131
-
1132
-            $this->show_field_end($field, $meta);
1133
-        }
1134
-
1135
-        /**
1136
-         * Save Data from Metabox
1137
-         *
1138
-         * @param string $term_id The term ID.
1139
-         * @since 1.0
1140
-         * @access public
1141
-         * @return string
1142
-         */
1143
-        public function save($term_id)
1144
-        {
1145
-
1146
-            $taxnow = '';
1147
-            if (isset($_POST['taxonomy']))
1148
-                $taxnow = $_POST['taxonomy'];
1149
-
1150
-            if (!isset($term_id)                                                        // Check Revision
1151
-                || (!in_array($taxnow, $this->_meta_box['pages']))                            // Check if current taxonomy type is supported.
1152
-                || (!check_admin_referer(basename(__FILE__), 'tax_meta_class_nonce'))        // Check nonce - Security
1153
-                || (!current_user_can('manage_categories'))
1154
-            )                                // Check permission
1155
-            {
1156
-                return $term_id;
1157
-            }
1158
-
1159
-
1160
-            foreach ($this->_fields as $field) {
1161
-
1162
-                $name = $field['id'];
1163
-                $type = $field['type'];
1164
-                $old = $this->get_tax_meta($term_id, $name, !$field['multiple']);
1165
-                $new = (isset($_POST[$name])) ? $_POST[$name] : (($field['multiple']) ? array() : '');
1166
-
1167
-                // Validate meta value
1168
-                if (class_exists('Tax_Meta_Validate') && method_exists('Tax_Meta_Validate', $field['validate_func'])) {
1169
-                    $new = call_user_func(array('Tax_Meta_Validate', $field['validate_func']), $new);
1170
-                }
1171
-
1172
-
1173
-                if ($name == 'ct_cat_icon') {
1174
-
1175
-                    $upload_dir = wp_upload_dir();
1176
-
1177
-                    $image_name_arr = explode('/', $new['src']);
1178
-                    //$old_filename = end($image_name_arr);
1179
-                    //$img_name_arr = explode('.',$old_filename);
1180
-
1181
-                    //$old_filename = $upload_dir['path'].'/'.$old_filename;
1182
-
1183
-                    $new_filename = $upload_dir['path'] . '/' . 'cat_icon_' . $term_id . '.png';
1184
-
1185
-                    /*rename($old_filename, $new_filename);
661
+			$this->show_field_end($field, $meta);
662
+		}
663
+
664
+		/**
665
+		 * Begin Field.
666
+		 *
667
+		 * @param string $field
668
+		 * @param string $meta
669
+		 * @since 1.0
670
+		 * @access public
671
+		 */
672
+		public function show_field_begin($field, $meta)
673
+		{
674
+			if (isset($field['group'])) {
675
+				if ($field['group'] == "start") {
676
+					echo "<td class='at-field'>";
677
+				}
678
+			} else {
679
+				if ($this->_form_type == 'edit') {
680
+					echo '<th valign="top" scope="row">';
681
+				} else {
682
+					if ($field['validate_func']) {
683
+						echo '<td><div class="form-field form-required">';
684
+					} else {
685
+						echo '<td><div class="form-field">';
686
+					}
687
+				}
688
+			}
689
+			if ($field['name'] != '' || $field['name'] != FALSE) {
690
+				//echo "<div class='at-label'>";
691
+				echo "<label for='{$field['id']}'>{$field['name']}</label>";
692
+				//echo "</div>";
693
+			}
694
+			if ($this->_form_type == 'edit') {
695
+				echo '</th><td>';
696
+			}
697
+		}
698
+
699
+		/**
700
+		 * End Field.
701
+		 *
702
+		 * @param string $field
703
+		 * @param string $meta
704
+		 * @since 1.0
705
+		 * @access public
706
+		 */
707
+		public function show_field_end($field, $meta = NULL, $group = false)
708
+		{
709
+			if (isset($field['group'])) {
710
+				if ($group == 'end') {
711
+					if ($field['desc'] != '') {
712
+						echo "<p class='desc-field'>{$field['desc']}</p></td>";
713
+					} else {
714
+						echo "</td>";
715
+					}
716
+				} else {
717
+					if ($field['desc'] != '') {
718
+						echo "<p class='desc-field'>{$field['desc']}</p><br/>";
719
+					} else {
720
+						echo '<br/>';
721
+					}
722
+				}
723
+			} else {
724
+				if ($field['desc'] != '') {
725
+					echo "<p class='desc-field'>{$field['desc']}</p>";
726
+				}
727
+				if ($this->_form_type == 'edit') {
728
+					echo '</td>';
729
+				} else {
730
+					echo '</td></div>';
731
+				}
732
+			}
733
+		}
734
+
735
+		/**
736
+		 * Show Field Text.
737
+		 *
738
+		 * @param string $field
739
+		 * @param string $meta
740
+		 * @since 1.0
741
+		 * @access public
742
+		 */
743
+		public function show_field_text($field, $meta)
744
+		{
745
+			$this->show_field_begin($field, $meta);
746
+			echo "<input type='text' class='at-text' name='{$field['id']}' id='{$field['id']}' value='{$meta}' size='30' />";
747
+			$this->show_field_end($field, $meta);
748
+		}
749
+
750
+		/**
751
+		 * Show Field hidden.
752
+		 *
753
+		 * @param string $field
754
+		 * @param string|mixed $meta
755
+		 * @since 0.1.3
756
+		 * @access public
757
+		 */
758
+		public function show_field_hidden($field, $meta)
759
+		{
760
+			//$this->show_field_begin( $field, $meta );
761
+			echo "<input type='hidden' class='at-text' name='{$field['id']}' id='{$field['id']}' value='{$meta}'/>";
762
+			//$this->show_field_end( $field, $meta );
763
+		}
764
+
765
+		/**
766
+		 * Show Field Paragraph.
767
+		 *
768
+		 * @param string $field
769
+		 * @since 0.1.3
770
+		 * @access public
771
+		 */
772
+		public function show_field_paragraph($field)
773
+		{
774
+			//$this->show_field_begin( $field, $meta );
775
+			echo '<p>' . $field['value'] . '</p>';
776
+			//$this->show_field_end( $field, $meta );
777
+		}
778
+
779
+		/**
780
+		 * Show Field Textarea.
781
+		 *
782
+		 * @param string $field
783
+		 * @param string $meta
784
+		 * @since 1.0
785
+		 * @access public
786
+		 */
787
+		public function show_field_textarea($field, $meta)
788
+		{
789
+			$this->show_field_begin($field, $meta);
790
+			echo "<textarea class='at-textarea large-text' name='{$field['id']}' id='{$field['id']}' cols='60' rows='10'>{$meta}</textarea>";
791
+			$this->show_field_end($field, $meta);
792
+		}
793
+
794
+		/**
795
+		 * Show Field Select.
796
+		 *
797
+		 * @param string $field
798
+		 * @param string $meta
799
+		 * @since 1.0
800
+		 * @access public
801
+		 */
802
+		public function show_field_select($field, $meta)
803
+		{
804
+
805
+			if (!is_array($meta))
806
+				$meta = (array)$meta;
807
+
808
+			$this->show_field_begin($field, $meta);
809
+			echo "<select class='at-select' name='{$field['id']}" . ($field['multiple'] ? "[]' id='{$field['id']}' multiple='multiple'" : "'") . ">";
810
+			foreach ($field['options'] as $key => $value) {
811
+				echo "<option value='{$key}'" . selected(in_array($key, $meta), true, false) . ">{$value}</option>";
812
+			}
813
+			echo "</select>";
814
+			$this->show_field_end($field, $meta);
815
+
816
+		}
817
+
818
+		/**
819
+		 * Show Radio Field.
820
+		 *
821
+		 * @param string $field
822
+		 * @param string $meta
823
+		 * @since 1.0
824
+		 * @access public
825
+		 */
826
+		public function show_field_radio($field, $meta)
827
+		{
828
+
829
+			if (!is_array($meta))
830
+				$meta = (array)$meta;
831
+
832
+			$this->show_field_begin($field, $meta);
833
+			foreach ($field['options'] as $key => $value) {
834
+				echo "<input type='radio' class='at-radio' name='{$field['id']}' value='{$key}'" . checked(in_array($key, $meta), true, false) . " /> <span class='at-radio-label'>{$value}</span>";
835
+			}
836
+			$this->show_field_end($field, $meta);
837
+		}
838
+
839
+		/**
840
+		 * Show Checkbox Field.
841
+		 *
842
+		 * @param string $field
843
+		 * @param string $meta
844
+		 * @since 1.0
845
+		 * @access public
846
+		 */
847
+		public function show_field_checkbox($field, $meta)
848
+		{
849
+
850
+			$this->show_field_begin($field, $meta);
851
+			echo "<input type='checkbox' class='rw-checkbox' name='{$field['id']}' id='{$field['id']}'" . checked(!empty($meta), true, false) . " /> {$field['desc']}";
852
+			$this->show_field_end($field, $meta);
853
+		}
854
+
855
+		/**
856
+		 * Show Wysiwig Field.
857
+		 *
858
+		 * @param string $field
859
+		 * @param string $meta
860
+		 * @since 1.0
861
+		 * @access public
862
+		 */
863
+		public function show_field_wysiwyg($field, $meta)
864
+		{
865
+			$this->show_field_begin($field, $meta);
866
+			// Add TinyMCE script for WP version < 3.3
867
+			global $wp_version;
868
+
869
+			if (version_compare($wp_version, '3.2.1') < 1) {
870
+				echo "<textarea class='at-wysiwyg theEditor large-text' name='{$field['id']}' id='{$field['id']}' cols='60' rows='10'>{$meta}</textarea>";
871
+			} else {
872
+				// Use new wp_editor() since WP 3.3
873
+				wp_editor(stripslashes(html_entity_decode($meta)), $field['id'], array('editor_class' => 'at-wysiwyg'));
874
+			}
875
+			$this->show_field_end($field, $meta);
876
+		}
877
+
878
+		/**
879
+		 * Show File Field.
880
+		 *
881
+		 * @global object $post The current post object.
882
+		 * @param string $field
883
+		 * @param string $meta
884
+		 * @since 1.0
885
+		 * @access public
886
+		 */
887
+		public function show_field_file($field, $meta)
888
+		{
889
+
890
+			global $post;
891
+
892
+			if (!is_array($meta))
893
+				$meta = (array)$meta;
894
+
895
+			$this->show_field_begin($field, $meta);
896
+			echo "{$field['desc']}<br />";
897
+
898
+			if (!empty($meta)) {
899
+				$nonce = wp_create_nonce('at_ajax_delete');
900
+				echo '<div style="margin-bottom: 10px"><strong>' . __('Uploaded files', 'geodirectory') . '</strong></div>';
901
+				echo '<ol class="at-upload">';
902
+				foreach ($meta as $att) {
903
+					// if (wp_attachment_is_image($att)) continue; // what's image uploader for?
904
+					echo "<li>" . wp_get_attachment_link($att, '', false, false, ' ') . " (<a class='at-delete-file' href='#' rel='{$nonce}|{$post->ID}|{$field['id']}|{$att}'>" . __('Remove', 'geodirectory') . "</a>)</li>";
905
+				}
906
+				echo '</ol>';
907
+			}
908
+
909
+			// show form upload
910
+
911
+			echo "<div class='at-file-upload-label'>";
912
+			echo "<strong>" . __('Upload new files', 'geodirectory') . "</strong>";
913
+			echo "</div>";
914
+			echo "<div class='new-files'>";
915
+			echo "<div class='file-input'>";
916
+			echo "<input type='file' name='{$field['id']}[]' />";
917
+			echo "</div><!-- End .file-input -->";
918
+			echo "<a class='at-add-file button' href='#'>" . __('Add more files', 'geodirectory') . "</a>";
919
+			echo "</div><!-- End .new-files -->";
920
+			echo "</td>";
921
+			$this->show_field_end($field, $meta);
922
+		}
923
+
924
+		/**
925
+		 * Show Image Field.
926
+		 *
927
+		 * @param array $field
928
+		 * @param array $meta
929
+		 * @since 1.0
930
+		 * @access public
931
+		 */
932
+		public function show_field_image($field, $meta)
933
+		{
934
+			$this->show_field_begin($field, $meta);
935
+			$html = wp_nonce_field("at-delete-mupload_{$field['id']}", "nonce-delete-mupload_" . $field['id'], false, false);
936
+			if (is_array($meta)) {
937
+				if (isset($meta[0]) && is_array($meta[0]))
938
+					$meta = $meta[0];
939
+			}
940
+
941
+			$uploads = wp_upload_dir();
942
+			if (is_array($meta) && isset($meta['src']) && $meta['src'] != '') {
943
+				$file_info = pathinfo($meta['src']);
944
+
945
+				if ($file_info['dirname'] != '.' && $file_info['dirname'] != '..')
946
+					$sub_dir = $file_info['dirname'];
947
+
948
+				$uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs
949
+				$uploads_baseurl = $uploads['baseurl'];
950
+				$uploads_path = $uploads['path'];
951
+
952
+				$file_name = $file_info['basename'];
953
+
954
+				if (strpos($sub_dir, 'https://') !== false) {
955
+					$uploads['baseurl'] = str_replace('http://', 'https://', $uploads['baseurl']);
956
+				} else {
957
+					$uploads['baseurl'] = str_replace('https://', 'http://', $uploads['baseurl']);
958
+				}
959
+				$sub_dir = str_replace($uploads['baseurl'], '', $sub_dir);
960
+
961
+				$uploads_url = $uploads_baseurl . $sub_dir;
962
+
963
+				$meta['src'] = $uploads_url . '/' . $file_name;
964
+
965
+				$html .= "<span class='mupload_img_holder'><img src='" . $meta['src'] . "' style='max-height: 150px;max-width: 150px;' /></span>";
966
+				$html .= "<input type='hidden' name='" . $field['id'] . "[id]' id='" . $field['id'] . "[id]' value='" . $meta['id'] . "' />";
967
+				$html .= "<input type='hidden' class='" . $field['id'] . "[src]' name='" . $field['id'] . "[src]' id='" . $field['id'] . "[src]' value='" . $meta['src'] . "' />";
968
+				$html .= "<input class='at-delete_image_button' type='button' rel='" . $field['id'] . "' value='" . __('Remove Image', 'geodirectory') . "' />";
969
+			} else {
970
+				$html .= "<span class='mupload_img_holder'></span>";
971
+				$html .= "<input type='hidden' name='" . $field['id'] . "[id]' id='" . $field['id'] . "[id]' value='' />";
972
+				$html .= "<input class='" . $field['id'] . "[src]' style='position:absolute;left:-500px;width:50px;' type='text' name='" . $field['id'] . "[src]' id='" . $field['id'] . "[src]' value='' />";
973
+				$html .= "<input class='at-upload_image_button' type='button' rel='" . $field['id'] . "' value='" . __('Upload Image', 'geodirectory') . "' />";
974
+			}
975
+			echo $html;
976
+			$this->show_field_end($field, $meta);
977
+		}
978
+
979
+		/**
980
+		 * Show Color Field.
981
+		 *
982
+		 * @param string $field
983
+		 * @param string $meta
984
+		 * @since 1.0
985
+		 * @access public
986
+		 */
987
+		public function show_field_color($field, $meta)
988
+		{
989
+
990
+			if (empty($meta))
991
+				$meta = '#';
992
+
993
+			$this->show_field_begin($field, $meta);
994
+
995
+			echo "<input class='at-color' type='text' name='{$field['id']}' id='{$field['id']}' value='{$meta}' size='8' />";
996
+			//	echo "<a href='#' class='at-color-select button' rel='{$field['id']}'>" . __( 'Select a color' ) . "</a>";
997
+			echo "<input type='button' class='at-color-select button' rel='{$field['id']}' value='" . __('Select a color', 'geodirectory') . "'/>";
998
+			echo "<div style='display:none' class='at-color-picker' rel='{$field['id']}'></div>";
999
+			$this->show_field_end($field, $meta);
1000
+
1001
+		}
1002
+
1003
+		/**
1004
+		 * Show Checkbox List Field
1005
+		 *
1006
+		 * @param string $field
1007
+		 * @param string $meta
1008
+		 * @since 1.0
1009
+		 * @access public
1010
+		 */
1011
+		public function show_field_checkbox_list($field, $meta)
1012
+		{
1013
+
1014
+			if (!is_array($meta))
1015
+				$meta = (array)$meta;
1016
+
1017
+			$this->show_field_begin($field, $meta);
1018
+
1019
+			$html = array();
1020
+
1021
+			foreach ($field['options'] as $key => $value) {
1022
+				$html[] = "<input type='checkbox' class='at-checkbox_list' name='{$field['id']}[]' value='{$key}'" . checked(in_array($key, $meta), true, false) . " /> {$value}";
1023
+			}
1024
+
1025
+			echo implode('<br />', $html);
1026
+
1027
+			$this->show_field_end($field, $meta);
1028
+
1029
+		}
1030
+
1031
+		/**
1032
+		 * Show Date Field.
1033
+		 *
1034
+		 * @param string $field
1035
+		 * @param string $meta
1036
+		 * @since 1.0
1037
+		 * @access public
1038
+		 */
1039
+		public function show_field_date($field, $meta)
1040
+		{
1041
+			$this->show_field_begin($field, $meta);
1042
+			echo "<input type='text' class='at-date' name='{$field['id']}' id='{$field['id']}' rel='{$field['format']}' value='{$meta}' size='30' />";
1043
+			$this->show_field_end($field, $meta);
1044
+		}
1045
+
1046
+		/**
1047
+		 * Show time field.
1048
+		 *
1049
+		 * @param string $field
1050
+		 * @param string $meta
1051
+		 * @since 1.0
1052
+		 * @access public
1053
+		 */
1054
+		public function show_field_time($field, $meta)
1055
+		{
1056
+			$this->show_field_begin($field, $meta);
1057
+			echo "<input type='text' class='at-time' name='{$field['id']}' id='{$field['id']}' rel='{$field['format']}' value='{$meta}' size='30' />";
1058
+			$this->show_field_end($field, $meta);
1059
+		}
1060
+
1061
+		/**
1062
+		 * Show Posts field.
1063
+		 * used creating a posts/pages/custom types checkboxlist or a select dropdown
1064
+		 *
1065
+		 * @global object $post The current post object.
1066
+		 * @param string $field
1067
+		 * @param string $meta
1068
+		 * @since 1.0
1069
+		 * @access public
1070
+		 */
1071
+		public function show_field_posts($field, $meta)
1072
+		{
1073
+			global $post;
1074
+
1075
+			if (!is_array($meta)) $meta = (array)$meta;
1076
+			$this->show_field_begin($field, $meta);
1077
+			$options = $field['options'];
1078
+			$posts = get_posts($options['args']);
1079
+
1080
+			// checkbox_list
1081
+			if ('checkbox_list' == $options['type']) {
1082
+				foreach ($posts as $p) {
1083
+					echo "<input type='checkbox' name='{$field['id']}[]' value='$p->ID'" . checked(in_array($p->ID, $meta), true, false) . " /> $p->post_title<br/>";
1084
+				}
1085
+			} // select
1086
+			else {
1087
+				echo "<select name='{$field['id']}" . ($field['multiple'] ? "[]' multiple='multiple' style='height:auto'" : "'") . ">";
1088
+				foreach ($posts as $p) {
1089
+					echo "<option value='$p->ID'" . selected(in_array($p->ID, $meta), true, false) . ">$p->post_title</option>";
1090
+				}
1091
+				echo "</select>";
1092
+			}
1093
+
1094
+			$this->show_field_end($field, $meta);
1095
+		}
1096
+
1097
+		/**
1098
+		 * Show Taxonomy field.
1099
+		 * used creating a category/tags/custom taxonomy checkboxlist or a select dropdown
1100
+		 *
1101
+		 * @global object $post The current post object.
1102
+		 * @param string $field
1103
+		 * @param string $meta
1104
+		 * @since 1.0
1105
+		 * @access public
1106
+		 *
1107
+		 * @uses get_terms()
1108
+		 */
1109
+		public function show_field_taxonomy($field, $meta)
1110
+		{
1111
+			global $post;
1112
+
1113
+			if (!is_array($meta)) $meta = (array)$meta;
1114
+			$this->show_field_begin($field, $meta);
1115
+			$options = $field['options'];
1116
+			$terms = get_terms($options['taxonomy'], $options['args']);
1117
+
1118
+			// checkbox_list
1119
+			if ('checkbox_list' == $options['type']) {
1120
+				foreach ($terms as $term) {
1121
+					echo "<input type='checkbox' name='{$field['id']}[]' value='$term->slug'" . checked(in_array($term->slug, $meta), true, false) . " /> $term->name<br/>";
1122
+				}
1123
+			} // select
1124
+			else {
1125
+				echo "<select name='{$field['id']}" . ($field['multiple'] ? "[]' multiple='multiple' style='height:auto'" : "'") . ">";
1126
+				foreach ($terms as $term) {
1127
+					echo "<option value='$term->slug'" . selected(in_array($term->slug, $meta), true, false) . ">$term->name</option>";
1128
+				}
1129
+				echo "</select>";
1130
+			}
1131
+
1132
+			$this->show_field_end($field, $meta);
1133
+		}
1134
+
1135
+		/**
1136
+		 * Save Data from Metabox
1137
+		 *
1138
+		 * @param string $term_id The term ID.
1139
+		 * @since 1.0
1140
+		 * @access public
1141
+		 * @return string
1142
+		 */
1143
+		public function save($term_id)
1144
+		{
1145
+
1146
+			$taxnow = '';
1147
+			if (isset($_POST['taxonomy']))
1148
+				$taxnow = $_POST['taxonomy'];
1149
+
1150
+			if (!isset($term_id)                                                        // Check Revision
1151
+				|| (!in_array($taxnow, $this->_meta_box['pages']))                            // Check if current taxonomy type is supported.
1152
+				|| (!check_admin_referer(basename(__FILE__), 'tax_meta_class_nonce'))        // Check nonce - Security
1153
+				|| (!current_user_can('manage_categories'))
1154
+			)                                // Check permission
1155
+			{
1156
+				return $term_id;
1157
+			}
1158
+
1159
+
1160
+			foreach ($this->_fields as $field) {
1161
+
1162
+				$name = $field['id'];
1163
+				$type = $field['type'];
1164
+				$old = $this->get_tax_meta($term_id, $name, !$field['multiple']);
1165
+				$new = (isset($_POST[$name])) ? $_POST[$name] : (($field['multiple']) ? array() : '');
1166
+
1167
+				// Validate meta value
1168
+				if (class_exists('Tax_Meta_Validate') && method_exists('Tax_Meta_Validate', $field['validate_func'])) {
1169
+					$new = call_user_func(array('Tax_Meta_Validate', $field['validate_func']), $new);
1170
+				}
1171
+
1172
+
1173
+				if ($name == 'ct_cat_icon') {
1174
+
1175
+					$upload_dir = wp_upload_dir();
1176
+
1177
+					$image_name_arr = explode('/', $new['src']);
1178
+					//$old_filename = end($image_name_arr);
1179
+					//$img_name_arr = explode('.',$old_filename);
1180
+
1181
+					//$old_filename = $upload_dir['path'].'/'.$old_filename;
1182
+
1183
+					$new_filename = $upload_dir['path'] . '/' . 'cat_icon_' . $term_id . '.png';
1184
+
1185
+					/*rename($old_filename, $new_filename);
1186 1186
 				
1187 1187
 				//subdir
1188 1188
 				$new['src'] = $upload_dir['url'].'/'.'cat_icon_'.$term_id.'.png';
@@ -1190,7 +1190,7 @@  discard block
 block discarded – undo
1190 1190
 				update_attached_file( $new['id'], $new['src'] );*/
1191 1191
 
1192 1192
 
1193
-                    /*	
1193
+					/*	
1194 1194
 		
1195 1195
 		$new['src'] = $upload_dir['url'].'/'.'cat_icon_'.$term_id.'.png';
1196 1196
 		
@@ -1215,67 +1215,67 @@  discard block
 block discarded – undo
1215 1215
 		$attach_id = wp_insert_attachment( $attachment, $filename);*/
1216 1216
 
1217 1217
 
1218
-                }
1219
-
1220
-
1221
-                //skip on Paragraph field
1222
-                if ($type != "paragraph") {
1223
-
1224
-                    // Call defined method to save meta value, if there's no methods, call common one.
1225
-                    $save_func = 'save_field_' . $type;
1226
-                    if (method_exists($this, $save_func)) {
1227
-                        call_user_func(array(&$this, 'save_field_' . $type), $term_id, $field, $old, $new);
1228
-                    } else {
1229
-                        $this->save_field($term_id, $field, $old, $new);
1230
-                    }
1231
-                }
1232
-
1233
-            } // End foreach
1234
-
1235
-        }
1236
-
1237
-        /**
1238
-         * Common function for saving fields.
1239
-         *
1240
-         * @param string $term_id The term ID.
1241
-         * @param string $field
1242
-         * @param string $old
1243
-         * @param string|mixed $new
1244
-         * @since 1.0
1245
-         * @access public
1246
-         */
1247
-        public function save_field($term_id, $field, $old, $new)
1248
-        {
1249
-            $name = $field['id'];
1250
-            $this->delete_tax_meta($term_id, $name);
1251
-            if ($new === '' || $new === array())
1252
-                return;
1253
-
1254
-            $this->update_tax_meta($term_id, $name, $new);
1255
-        }
1256
-
1257
-        /**
1258
-         * function for saving image field.
1259
-         *
1260
-         * @param string $term_id The term ID.
1261
-         * @param string $field
1262
-         * @param string $old
1263
-         * @param string|mixed $new
1264
-         * @since 1.0
1265
-         * @access public
1266
-         */
1267
-        public function save_field_image($term_id, $field, $old, $new)
1268
-        {
1269
-            $name = $field['id'];
1270
-
1271
-            $this->delete_tax_meta($term_id, $name);
1272
-            if ($new === '' || $new === array() || $new['id'] == '' || $new['src'] == '')
1273
-                return;
1274
-
1275
-            $this->update_tax_meta($term_id, $name, $new);
1276
-        }
1277
-
1278
-        /*
1218
+				}
1219
+
1220
+
1221
+				//skip on Paragraph field
1222
+				if ($type != "paragraph") {
1223
+
1224
+					// Call defined method to save meta value, if there's no methods, call common one.
1225
+					$save_func = 'save_field_' . $type;
1226
+					if (method_exists($this, $save_func)) {
1227
+						call_user_func(array(&$this, 'save_field_' . $type), $term_id, $field, $old, $new);
1228
+					} else {
1229
+						$this->save_field($term_id, $field, $old, $new);
1230
+					}
1231
+				}
1232
+
1233
+			} // End foreach
1234
+
1235
+		}
1236
+
1237
+		/**
1238
+		 * Common function for saving fields.
1239
+		 *
1240
+		 * @param string $term_id The term ID.
1241
+		 * @param string $field
1242
+		 * @param string $old
1243
+		 * @param string|mixed $new
1244
+		 * @since 1.0
1245
+		 * @access public
1246
+		 */
1247
+		public function save_field($term_id, $field, $old, $new)
1248
+		{
1249
+			$name = $field['id'];
1250
+			$this->delete_tax_meta($term_id, $name);
1251
+			if ($new === '' || $new === array())
1252
+				return;
1253
+
1254
+			$this->update_tax_meta($term_id, $name, $new);
1255
+		}
1256
+
1257
+		/**
1258
+		 * function for saving image field.
1259
+		 *
1260
+		 * @param string $term_id The term ID.
1261
+		 * @param string $field
1262
+		 * @param string $old
1263
+		 * @param string|mixed $new
1264
+		 * @since 1.0
1265
+		 * @access public
1266
+		 */
1267
+		public function save_field_image($term_id, $field, $old, $new)
1268
+		{
1269
+			$name = $field['id'];
1270
+
1271
+			$this->delete_tax_meta($term_id, $name);
1272
+			if ($new === '' || $new === array() || $new['id'] == '' || $new['src'] == '')
1273
+				return;
1274
+
1275
+			$this->update_tax_meta($term_id, $name, $new);
1276
+		}
1277
+
1278
+		/*
1279 1279
 	 * Save Wysiwyg Field.
1280 1280
 	 *
1281 1281
 	 * @param string $term_id The term ID. 
@@ -1285,806 +1285,806 @@  discard block
 block discarded – undo
1285 1285
 	 * @since 1.0
1286 1286
 	 * @access public 
1287 1287
 	 */
1288
-        public function save_field_wysiwyg($term_id, $field, $old, $new)
1289
-        {
1290
-            $this->save_field($term_id, $field, $old, $new);
1291
-        }
1292
-
1293
-        /**
1294
-         * Save repeater Fields.
1295
-         *
1296
-         * @param string $term_id The term ID.
1297
-         * @param string $field
1298
-         * @param string|mixed $old
1299
-         * @param string|mixed $new
1300
-         * @since 1.0
1301
-         * @access public
1302
-         */
1303
-        public function save_field_repeater($term_id, $field, $old, $new)
1304
-        {
1305
-            if (is_array($new) && count($new) > 0) {
1306
-                foreach ($new as $n) {
1307
-                    foreach ($field['fields'] as $f) {
1308
-                        $type = $f['type'];
1309
-                        switch ($type) {
1310
-                            case 'wysiwyg':
1311
-                                $n[$f['id']] = wpautop($n[$f['id']]);
1312
-                                break;
1313
-                            case 'file':
1314
-                                $n[$f['id']] = $this->save_field_file_repeater($term_id, $f, '', $n[$f['id']]);
1315
-                                break;
1316
-                            default:
1317
-                                break;
1318
-                        }
1319
-                    }
1320
-                    if (!$this->is_array_empty($n))
1321
-                        $temp[] = $n;
1322
-                }
1323
-                if (isset($temp) && count($temp) > 0 && !$this->is_array_empty($temp)) {
1324
-                    $this->update_tax_meta($term_id, $field['id'], $temp);
1325
-                } else {
1326
-                    //	remove old meta if exists
1327
-                    delete_post_meta($term_id, $field['id']);
1328
-                }
1329
-            } else {
1330
-                //	remove old meta if exists
1331
-                delete_post_meta($term_id, $field['id']);
1332
-            }
1333
-        }
1334
-
1335
-        /**
1336
-         * Save File Field.
1337
-         *
1338
-         * @param string $term_id The term ID.
1339
-         * @param string $field
1340
-         * @param string $old
1341
-         * @param string $new
1342
-         * @since 1.0
1343
-         * @access public
1344
-         */
1345
-        public function save_field_file($term_id, $field, $old, $new)
1346
-        {
1347
-
1348
-            $name = $field['id'];
1349
-            if (empty($_FILES[$name]))
1350
-                return;
1351
-            $this->fix_file_array($_FILES[$name]);
1352
-            foreach ($_FILES[$name] as $position => $fileitem) {
1353
-
1354
-                $file = wp_handle_upload($fileitem, array('test_form' => false));
1355
-                if (empty($file['file']))
1356
-                    continue;
1357
-                $filename = $file['file'];
1358
-
1359
-                $attachment = array(
1360
-                    'post_mime_type' => $file['type'],
1361
-                    'guid' => $file['url'],
1362
-                    'post_parent' => $term_id,
1363
-                    'post_title' => preg_replace('/\.[^.]+$/', '', basename($filename)),
1364
-                    'post_content' => ''
1365
-                );
1366
-
1367
-                $id = wp_insert_attachment($attachment, $filename, $term_id);
1368
-
1369
-                if (!is_wp_error($id)) {
1370
-
1371
-                    wp_update_attachment_metadata($id, wp_generate_attachment_metadata($id, $filename));
1372
-                    add_post_meta($term_id, $name, $id, false);    // save file's url in meta fields
1373
-
1374
-                } // End if
1375
-
1376
-            } // End foreach
1377
-
1378
-        }
1379
-
1380
-        /**
1381
-         * Save repeater File Field.
1382
-         * @param string $term_id The term ID.
1383
-         * @param string $field
1384
-         * @param string $old
1385
-         * @param string $new
1386
-         * @since 1.0
1387
-         * @access public
1388
-         * @return int|void
1389
-         */
1390
-        public function save_field_file_repeater($term_id, $field, $old, $new)
1391
-        {
1392
-
1393
-            $name = $field['id'];
1394
-            if (empty($_FILES[$name]))
1395
-                return;
1396
-            $this->fix_file_array($_FILES[$name]);
1397
-            foreach ($_FILES[$name] as $position => $fileitem) {
1398
-
1399
-                $file = wp_handle_upload($fileitem, array('test_form' => false));
1400
-                if (empty($file['file']))
1401
-                    continue;
1402
-                $filename = $file['file'];
1403
-
1404
-                $attachment = array(
1405
-                    'post_mime_type' => $file['type'],
1406
-                    'guid' => $file['url'],
1407
-                    'post_parent' => $term_id,
1408
-                    'post_title' => preg_replace('/\.[^.]+$/', '', basename($filename)),
1409
-                    'post_content' => ''
1410
-                );
1411
-
1412
-                $id = wp_insert_attachment($attachment, $filename);
1413
-
1414
-                if (!is_wp_error($id)) {
1415
-
1416
-                    wp_update_attachment_metadata($id, wp_generate_attachment_metadata($id, $filename));
1417
-                    return $id;    // return file's url in meta fields
1418
-                } // End if
1419
-            } // End foreach
1420
-        }
1421
-
1422
-        /**
1423
-         * Add missed values for meta box.
1424
-         *
1425
-         * @since 1.0
1426
-         * @access public
1427
-         */
1428
-        public function add_missed_values()
1429
-        {
1430
-
1431
-            // Default values for meta box
1432
-            $this->_meta_box = array_merge(array('context' => 'normal', 'priority' => 'high', 'pages' => array('post')), (array)$this->_meta_box);
1433
-
1434
-            if(is_array($this->_fields)) {
1435
-                // Default values for fields
1436
-                foreach ($this->_fields as &$field) {
1437
-                    $multiple = in_array($field['type'], array('checkbox_list', 'file', 'image'));
1438
-                    $std = $multiple ? array() : '';
1439
-                    $format = 'date' == $field['type'] ? 'yy-mm-dd' : ('time' == $field['type'] ? 'hh:mm' : '');
1440
-                    $field = array_merge(array('multiple' => $multiple, 'std' => $std, 'desc' => '', 'format' => $format, 'validate_func' => ''), $field);
1441
-                } // End foreach
1442
-            }
1443
-        }
1444
-
1445
-        /**
1446
-         * Check if field with $type exists.
1447
-         *
1448
-         * @param string $type
1449
-         * @since 1.0
1450
-         * @access public
1451
-         */
1452
-        public function has_field($type)
1453
-        {
1454
-            if(is_array($this->_fields)) {
1455
-                foreach ($this->_fields as $field) {
1456
-                    if ($type == $field['type'])
1457
-                        return true;
1458
-                }
1459
-            }
1460
-            return false;
1461
-        }
1462
-
1463
-        /**
1464
-         * Check if current page is edit page.
1465
-         *
1466
-         * @since 1.0
1467
-         * @access public
1468
-         */
1469
-        public function is_edit_page()
1470
-        {
1471
-            global $pagenow;
1472
-            return ($pagenow == 'edit-tags.php' || $pagenow == 'term.php');
1473
-        }
1474
-
1475
-        /**
1476
-         * Fixes the odd indexing of multiple file uploads.
1477
-         *
1478
-         * Goes from the format:
1479
-         * $_FILES['field']['key']['index']
1480
-         * to
1481
-         * The More standard and appropriate:
1482
-         * $_FILES['field']['index']['key']
1483
-         *
1484
-         * @param string $files
1485
-         * @since 1.0
1486
-         * @access public
1487
-         */
1488
-        public function fix_file_array(&$files)
1489
-        {
1490
-
1491
-            $output = array();
1492
-
1493
-            foreach ($files as $key => $list) {
1494
-                foreach ($list as $index => $value) {
1495
-                    $output[$index][$key] = $value;
1496
-                }
1497
-            }
1498
-
1499
-            return $files = $output;
1500
-
1501
-        }
1502
-
1503
-        /**
1504
-         * Get proper JQuery UI version.
1505
-         *
1506
-         * Used in order to not conflict with WP Admin Scripts.
1507
-         *
1508
-         * @since 1.0
1509
-         * @access public
1510
-         */
1511
-        public function get_jqueryui_ver()
1512
-        {
1513
-
1514
-            global $wp_version;
1515
-
1516
-            if (version_compare($wp_version, '3.1', '>=')) {
1517
-                return '1.8.10';
1518
-            }
1519
-
1520
-            return '1.7.3';
1521
-
1522
-        }
1523
-
1524
-        /**
1525
-         *  Add Field to meta box (generic function)
1526
-         * @author Ohad Raz
1527
-         * @since 1.0
1528
-         * @access public
1529
-         * @param $id string  field id, i.e. the meta key
1530
-         * @param $args mixed|array
1531
-         */
1532
-        public function addField($id, $args)
1533
-        {
1534
-            $new_field = array('id' => $id, 'std' => '', 'desc' => '', 'style' => '');
1535
-            $new_field = array_merge($new_field, $args);
1536
-            $this->_fields[] = $new_field;
1537
-        }
1538
-
1539
-
1540
-        /**
1541
-         *  Add Text Field to meta box
1542
-         * @author Ohad Raz
1543
-         * @since 1.0
1544
-         * @access public
1545
-         * @param $id string  field id, i.e. the meta key
1546
-         * @param $args mixed|array
1547
-         *    'name' => // field name/label string optional
1548
-         *    'desc' => // field description, string optional
1549
-         *    'std' => // default value, string optional
1550
-         *    'style' =>    // custom style for field, string optional
1551
-         *    'validate_func' => // validate function, string optional
1552
-         * @param $repeater bool  is this a field inside a repeatr? true|false(default)
1553
-         */
1554
-        public function addText($id, $args, $repeater = false)
1555
-        {
1556
-            $new_field = array('type' => 'text', 'id' => $id, 'std' => '', 'desc' => '', 'style' => '', 'name' => __('Text Field', 'geodirectory'));
1557
-            $new_field = array_merge($new_field, $args);
1558
-            if (false === $repeater) {
1559
-                $this->_fields[] = $new_field;
1560
-            } else {
1561
-                return $new_field;
1562
-            }
1563
-        }
1564
-
1565
-        /**
1566
-         *  Add Hidden Field to meta box
1567
-         * @author Ohad Raz
1568
-         * @since 0.1.3
1569
-         * @access public
1570
-         * @param $id string  field id, i.e. the meta key
1571
-         * @param $args mixed|array
1572
-         *    'name' => // field name/label string optional
1573
-         *    'desc' => // field description, string optional
1574
-         *    'std' => // default value, string optional
1575
-         *    'style' =>    // custom style for field, string optional
1576
-         *    'validate_func' => // validate function, string optional
1577
-         * @param $repeater bool  is this a field inside a repeatr? true|false(default)
1578
-         */
1579
-        public function addHidden($id, $args, $repeater = false)
1580
-        {
1581
-            $new_field = array('type' => 'hidden', 'id' => $id, 'std' => '', 'desc' => '', 'style' => '', 'name' => __('Text Field', 'geodirectory'));
1582
-            $new_field = array_merge($new_field, $args);
1583
-            if (false === $repeater) {
1584
-                $this->_fields[] = $new_field;
1585
-            } else {
1586
-                return $new_field;
1587
-            }
1588
-        }
1589
-
1590
-        /**
1591
-         *  Add Paragraph to meta box
1592
-         * @author Ohad Raz
1593
-         * @since 0.1.3
1594
-         * @access public
1595
-         * @param $id string  field id, i.e. the meta key
1596
-         * @param $value  paragraph html
1597
-         * @param $repeater bool  is this a field inside a repeatr? true|false(default)
1598
-         */
1599
-        public function addParagraph($id, $args, $repeater = false)
1600
-        {
1601
-            $new_field = array('type' => 'paragraph', 'id' => $id, 'value' => '', 'style' => '');
1602
-            $new_field = array_merge($new_field, $args);
1603
-            if (false === $repeater) {
1604
-                $this->_fields[] = $new_field;
1605
-            } else {
1606
-                return $new_field;
1607
-            }
1608
-        }
1609
-
1610
-        /**
1611
-         *  Add Checkbox Field to meta box
1612
-         * @author Ohad Raz
1613
-         * @since 1.0
1614
-         * @access public
1615
-         * @param $id string  field id, i.e. the meta key
1616
-         * @param $args mixed|array
1617
-         *    'name' => // field name/label string optional
1618
-         *    'desc' => // field description, string optional
1619
-         *    'std' => // default value, string optional
1620
-         *    'validate_func' => // validate function, string optional
1621
-         * @param $repeater bool  is this a field inside a repeatr? true|false(default)
1622
-         */
1623
-        public function addCheckbox($id, $args, $repeater = false)
1624
-        {
1625
-            $new_field = array('type' => 'checkbox', 'id' => $id, 'std' => '', 'desc' => '', 'style' => '', 'name' => __('Checkbox Field', 'geodirectory'));
1626
-            $new_field = array_merge($new_field, $args);
1627
-            if (false === $repeater) {
1628
-                $this->_fields[] = $new_field;
1629
-            } else {
1630
-                return $new_field;
1631
-            }
1632
-        }
1633
-
1634
-        /**
1635
-         *  Add CheckboxList Field to meta box
1636
-         * @author Ohad Raz
1637
-         * @since 1.0
1638
-         * @access public
1639
-         * @param $id string  field id, i.e. the meta key
1640
-         * @param $options (array)  array of key => value pairs for select options
1641
-         * @param $args mixed|array
1642
-         *    'name' => // field name/label string optional
1643
-         *    'desc' => // field description, string optional
1644
-         *    'std' => // default value, string optional
1645
-         *    'validate_func' => // validate function, string optional
1646
-         * @param $repeater bool  is this a field inside a repeatr? true|false(default)
1647
-         *
1648
-         * @return : remember to call: $checkbox_list = $this->get_tax_meta(get_the_ID(), 'meta_name', false);
1649
-         *   which means the last param as false to get the values in an array
1650
-         */
1651
-        public function addCheckboxList($id, $options, $args, $repeater = false)
1652
-        {
1653
-            $new_field = array('type' => 'checkbox_list', 'id' => $id, 'std' => '', 'desc' => '', 'style' => '', 'name' => __('Checkbox List Field', 'geodirectory'));
1654
-            $new_field = array_merge($new_field, $args);
1655
-            if (false === $repeater) {
1656
-                $this->_fields[] = $new_field;
1657
-            } else {
1658
-                return $new_field;
1659
-            }
1660
-        }
1661
-
1662
-        /**
1663
-         *  Add Textarea Field to meta box
1664
-         * @author Ohad Raz
1665
-         * @since 1.0
1666
-         * @access public
1667
-         * @param $id string  field id, i.e. the meta key
1668
-         * @param $args mixed|array
1669
-         *    'name' => // field name/label string optional
1670
-         *    'desc' => // field description, string optional
1671
-         *    'std' => // default value, string optional
1672
-         *    'style' =>    // custom style for field, string optional
1673
-         *    'validate_func' => // validate function, string optional
1674
-         * @param $repeater bool  is this a field inside a repeatr? true|false(default)
1675
-         */
1676
-        public function addTextarea($id, $args, $repeater = false)
1677
-        {
1678
-            $new_field = array('type' => 'textarea', 'id' => $id, 'std' => '', 'desc' => '', 'style' => '', 'name' => __('Textarea Field', 'geodirectory'));
1679
-            $new_field = array_merge($new_field, $args);
1680
-            if (false === $repeater) {
1681
-                $this->_fields[] = $new_field;
1682
-            } else {
1683
-                return $new_field;
1684
-            }
1685
-        }
1686
-
1687
-        /**
1688
-         *  Add Select Field to meta box
1689
-         * @author Ohad Raz
1690
-         * @since 1.0
1691
-         * @access public
1692
-         * @param $id string field id, i.e. the meta key
1693
-         * @param $options (array)  array of key => value pairs for select options
1694
-         * @param $args mixed|array
1695
-         *    'name' => // field name/label string optional
1696
-         *    'desc' => // field description, string optional
1697
-         *    'std' => // default value, (array) optional
1698
-         *    'multiple' => // select multiple values, optional. Default is false.
1699
-         *    'validate_func' => // validate function, string optional
1700
-         * @param $repeater bool  is this a field inside a repeatr? true|false(default)
1701
-         */
1702
-        public function addSelect($id, $options, $args, $repeater = false)
1703
-        {
1704
-            $new_field = array('type' => 'select', 'id' => $id, 'std' => array(), 'desc' => '', 'style' => '', 'name' => __('Select Field', 'geodirectory'), 'multiple' => false, 'options' => $options);
1705
-            $new_field = array_merge($new_field, $args);
1706
-            if (false === $repeater) {
1707
-                $this->_fields[] = $new_field;
1708
-            } else {
1709
-                return $new_field;
1710
-            }
1711
-        }
1712
-
1713
-
1714
-        /**
1715
-         *  Add Radio Field to meta box
1716
-         * @author Ohad Raz
1717
-         * @since 1.0
1718
-         * @access public
1719
-         * @param $id string field id, i.e. the meta key
1720
-         * @param $options (array)  array of key => value pairs for radio options
1721
-         * @param $args mixed|array
1722
-         *    'name' => // field name/label string optional
1723
-         *    'desc' => // field description, string optional
1724
-         *    'std' => // default value, string optional
1725
-         *    'validate_func' => // validate function, string optional
1726
-         * @param $repeater bool  is this a field inside a repeatr? true|false(default)
1727
-         */
1728
-        public function addRadio($id, $options, $args, $repeater = false)
1729
-        {
1730
-            $new_field = array('type' => 'radio', 'id' => $id, 'std' => array(), 'desc' => '', 'style' => '', 'name' => __('Radio Field', 'geodirectory'), 'options' => $options);
1731
-            $new_field = array_merge($new_field, $args);
1732
-            if (false === $repeater) {
1733
-                $this->_fields[] = $new_field;
1734
-            } else {
1735
-                return $new_field;
1736
-            }
1737
-        }
1738
-
1739
-        /**
1740
-         *  Add Date Field to meta box
1741
-         * @author Ohad Raz
1742
-         * @since 1.0
1743
-         * @access public
1744
-         * @param $id string  field id, i.e. the meta key
1745
-         * @param $args mixed|array
1746
-         *    'name' => // field name/label string optional
1747
-         *    'desc' => // field description, string optional
1748
-         *    'std' => // default value, string optional
1749
-         *    'validate_func' => // validate function, string optional
1750
-         *    'format' => // date format, default yy-mm-dd. Optional. Default "'d MM, yy'"  See more formats here: http://goo.gl/Wcwxn
1751
-         * @param $repeater bool  is this a field inside a repeatr? true|false(default)
1752
-         */
1753
-        public function addDate($id, $args, $repeater = false)
1754
-        {
1755
-            $new_field = array('type' => 'date', 'id' => $id, 'std' => '', 'desc' => '', 'format' => 'yy-mm-dd', 'name' => __('Date Field', 'geodirectory'));
1756
-            $new_field = array_merge($new_field, $args);
1757
-            if (false === $repeater) {
1758
-                $this->_fields[] = $new_field;
1759
-            } else {
1760
-                return $new_field;
1761
-            }
1762
-        }
1763
-
1764
-        /**
1765
-         *  Add Time Field to meta box
1766
-         * @author Ohad Raz
1767
-         * @since 1.0
1768
-         * @access public
1769
-         * @param $id string- field id, i.e. the meta key
1770
-         * @param $args mixed|array
1771
-         *    'name' => // field name/label string optional
1772
-         *    'desc' => // field description, string optional
1773
-         *    'std' => // default value, string optional
1774
-         *    'validate_func' => // validate function, string optional
1775
-         *    'format' => // time format, default hh:mm. Optional. See more formats here: http://goo.gl/83woX
1776
-         * @param $repeater bool  is this a field inside a repeatr? true|false(default)
1777
-         */
1778
-        public function addTime($id, $args, $repeater = false)
1779
-        {
1780
-            $new_field = array('type' => 'time', 'id' => $id, 'std' => '', 'desc' => '', 'format' => 'hh:mm', 'name' => __('Time Field', 'geodirectory'));
1781
-            $new_field = array_merge($new_field, $args);
1782
-            if (false === $repeater) {
1783
-                $this->_fields[] = $new_field;
1784
-            } else {
1785
-                return $new_field;
1786
-            }
1787
-        }
1788
-
1789
-        /**
1790
-         *  Add Color Field to meta box
1791
-         * @author Ohad Raz
1792
-         * @since 1.0
1793
-         * @access public
1794
-         * @param $id string  field id, i.e. the meta key
1795
-         * @param $args mixed|array
1796
-         *    'name' => // field name/label string optional
1797
-         *    'desc' => // field description, string optional
1798
-         *    'std' => // default value, string optional
1799
-         *    'validate_func' => // validate function, string optional
1800
-         * @param $repeater bool  is this a field inside a repeatr? true|false(default)
1801
-         */
1802
-        public function addColor($id, $args, $repeater = false)
1803
-        {
1804
-            $new_field = array('type' => 'color', 'id' => $id, 'std' => '', 'desc' => '', 'name' => __('ColorPicker Field', 'geodirectory'));
1805
-            $new_field = array_merge($new_field, $args);
1806
-            if (false === $repeater) {
1807
-                $this->_fields[] = $new_field;
1808
-            } else {
1809
-                return $new_field;
1810
-            }
1811
-        }
1812
-
1813
-        /**
1814
-         *  Add Image Field to meta box
1815
-         * @author Ohad Raz
1816
-         * @since 1.0
1817
-         * @access public
1818
-         * @param $id string  field id, i.e. the meta key
1819
-         * @param $args mixed|array
1820
-         *    'name' => // field name/label string optional
1821
-         *    'desc' => // field description, string optional
1822
-         *    'validate_func' => // validate function, string optional
1823
-         * @param $repeater bool  is this a field inside a repeatr? true|false(default)
1824
-         */
1825
-        public function addImage($id, $args, $repeater = false)
1826
-        {
1827
-            $new_field = array('type' => 'image', 'id' => $id, 'desc' => '', 'style' => '', 'name' => __('Image Field', 'geodirectory'));
1828
-            $new_field = array_merge($new_field, $args);
1829
-
1830
-            if (false === $repeater) {
1831
-                $this->_fields[] = $new_field;
1832
-            } else {
1833
-                return $new_field;
1834
-            }
1835
-        }
1836
-
1837
-        /**
1838
-         *  Add File Field to meta box
1839
-         * @author Ohad Raz
1840
-         * @since 1.0
1841
-         * @access public
1842
-         * @param $id string  field id, i.e. the meta key
1843
-         * @param $args mixed|array
1844
-         *    'name' => // field name/label string optional
1845
-         *    'desc' => // field description, string optional
1846
-         *    'validate_func' => // validate function, string optional
1847
-         * @param $repeater bool  is this a field inside a repeatr? true|false(default)
1848
-         */
1849
-        public function addFile($id, $args, $repeater = false)
1850
-        {
1851
-            $new_field = array('type' => 'file', 'id' => $id, 'desc' => '', 'style' => '', 'name' => __('File Field', 'geodirectory'));
1852
-            $new_field = array_merge($new_field, $args);
1853
-            if (false === $repeater) {
1854
-                $this->_fields[] = $new_field;
1855
-            } else {
1856
-                return $new_field;
1857
-            }
1858
-        }
1859
-
1860
-        /**
1861
-         *  Add WYSIWYG Field to meta box
1862
-         * @author Ohad Raz
1863
-         * @since 1.0
1864
-         * @access public
1865
-         * @param $id string  field id, i.e. the meta key
1866
-         * @param $args mixed|array
1867
-         *    'name' => // field name/label string optional
1868
-         *    'desc' => // field description, string optional
1869
-         *    'std' => // default value, string optional
1870
-         *    'style' =>    // custom style for field, string optional Default 'width: 300px; height: 400px'
1871
-         *    'validate_func' => // validate function, string optional
1872
-         * @param $repeater bool  is this a field inside a repeatr? true|false(default)
1873
-         */
1874
-        public function addWysiwyg($id, $args, $repeater = false)
1875
-        {
1876
-            $new_field = array('type' => 'wysiwyg', 'id' => $id, 'std' => '', 'desc' => '', 'style' => 'width: 300px; height: 400px', 'name' => __('WYSIWYG Editor Field', 'geodirectory'));
1877
-            $new_field = array_merge($new_field, $args);
1878
-            if (false === $repeater) {
1879
-                $this->_fields[] = $new_field;
1880
-            } else {
1881
-                return $new_field;
1882
-            }
1883
-        }
1884
-
1885
-        /**
1886
-         *  Add Taxonomy Field to meta box
1887
-         * @author Ohad Raz
1888
-         * @since 1.0
1889
-         * @access public
1890
-         * @param $id string  field id, i.e. the meta key
1891
-         * @param $options mixed|array options of taxonomy field
1892
-         *    'taxonomy' =>    // taxonomy name can be category,post_tag or any custom taxonomy default is category
1893
-         * 'type' =>  // how to show taxonomy? 'select' (default) or 'checkbox_list'
1894
-         * 'args' =>  // arguments to query taxonomy, see http://goo.gl/uAANN default ('hide_empty' => false)
1895
-         * @param $args mixed|array
1896
-         *    'name' => // field name/label string optional
1897
-         *    'desc' => // field description, string optional
1898
-         *    'std' => // default value, string optional
1899
-         *    'validate_func' => // validate function, string optional
1900
-         * @param $repeater bool  is this a field inside a repeatr? true|false(default)
1901
-         */
1902
-        public function addTaxonomy($id, $options, $args, $repeater = false)
1903
-        {
1904
-            $q = array('hide_empty' => 0);
1905
-            $tax = 'category';
1906
-            $type = 'select';
1907
-            $temp = array($tax, $type, $q);
1908
-            $options = array_merge($temp, $options);
1909
-            $new_field = array('type' => 'taxonomy', 'id' => $id, 'desc' => '', 'name' => __('Taxonomy Field', 'geodirectory'), 'options' => $options);
1910
-            $new_field = array_merge($new_field, $args);
1911
-            if (false === $repeater) {
1912
-                $this->_fields[] = $new_field;
1913
-            } else {
1914
-                return $new_field;
1915
-            }
1916
-        }
1917
-
1918
-        /**
1919
-         *  Add posts Field to meta box
1920
-         * @author Ohad Raz
1921
-         * @since 1.0
1922
-         * @access public
1923
-         * @param $id string  field id, i.e. the meta key
1924
-         * @param $options mixed|array options of taxonomy field
1925
-         *    'post_type' =>    // post type name, 'post' (default) 'page' or any custom post type
1926
-         * 'type' =>  // how to show posts? 'select' (default) or 'checkbox_list'
1927
-         * 'args' =>  // arguments to query posts, see http://goo.gl/is0yK default ('posts_per_page' => -1)
1928
-         * @param $args mixed|array
1929
-         *    'name' => // field name/label string optional
1930
-         *    'desc' => // field description, string optional
1931
-         *    'std' => // default value, string optional
1932
-         *    'validate_func' => // validate function, string optional
1933
-         * @param $repeater bool  is this a field inside a repeatr? true|false(default)
1934
-         */
1935
-        public function addPosts($id, $options, $args, $repeater = false)
1936
-        {
1937
-            $q = array('posts_per_page' => -1);
1938
-            $temp = array('post_type' => 'post', 'type' => 'select', 'args' => $q);
1939
-            $options = array_merge($temp, $options);
1940
-            $new_field = array('type' => 'posts', 'id' => $id, 'desc' => '', 'name' => __('Posts Field', 'geodirectory'), 'options' => $options);
1941
-            $new_field = array_merge($new_field, $args);
1942
-            if (false === $repeater) {
1943
-                $this->_fields[] = $new_field;
1944
-            } else {
1945
-                return $new_field;
1946
-            }
1947
-        }
1948
-
1949
-        /**
1950
-         *  Add repeater Field Block to meta box
1951
-         * @author Ohad Raz
1952
-         * @since 1.0
1953
-         * @access public
1954
-         * @param $id string  field id, i.e. the meta key
1955
-         * @param $args mixed|array
1956
-         *    'name' => // field name/label string optional
1957
-         *    'desc' => // field description, string optional
1958
-         *    'std' => // default value, string optional
1959
-         *    'style' =>    // custom style for field, string optional
1960
-         *    'validate_func' => // validate function, string optional
1961
-         *    'fields' => //fields to repeater
1962
-         */
1963
-        public function addRepeaterBlock($id, $args)
1964
-        {
1965
-            $new_field = array('type' => 'repeater', 'id' => $id, 'name' => __('Reapeater Field', 'geodirectory'), 'fields' => array(), 'inline' => false);
1966
-            $new_field = array_merge($new_field, $args);
1967
-            $this->_fields[] = $new_field;
1968
-        }
1969
-
1970
-
1971
-        /**
1972
-         * Finish Declaration of Meta Box
1973
-         * @author Ohad Raz
1974
-         * @since 1.0
1975
-         * @access public
1976
-         */
1977
-        public function Finish()
1978
-        {
1979
-            $this->add_missed_values();
1980
-            $this->check_field_upload();
1981
-            $this->check_field_color();
1982
-            $this->check_field_date();
1983
-            $this->check_field_time();
1984
-        }
1985
-
1986
-        /**
1987
-         * Helper function to check for empty arrays
1988
-         * @author Ohad Raz
1989
-         * @since 1.0
1990
-         * @access public
1991
-         * @param $args mixed|array
1992
-         */
1993
-        public function is_array_empty($array)
1994
-        {
1995
-            if (!is_array($array))
1996
-                return true;
1997
-
1998
-            foreach ($array as $a) {
1999
-                if (is_array($a)) {
2000
-                    foreach ($a as $sub_a) {
2001
-                        if (!empty($sub_a) && $sub_a != '')
2002
-                            return false;
2003
-                    }
2004
-                } else {
2005
-                    if (!empty($a) && $a != '')
2006
-                        return false;
2007
-                }
2008
-            }
2009
-            return true;
2010
-        }
2011
-
2012
-
2013
-        //get term meta field
2014
-        public function get_tax_meta($term_id, $key, $multi = false, $post_type = '')
2015
-        {
2016
-
2017
-            if (empty($post_type) && isset($_REQUEST['taxonomy'])) {
2018
-                $taxObject = get_taxonomy($_REQUEST['taxonomy']);
2019
-                $post_type = $taxObject->object_type[0];
2020
-            }
2021
-
2022
-            if($post_type=='post'){$post_type='';}
2023
-            if($post_type){$post_type = $post_type.'_';}
2024
-
2025
-            $t_id = (is_object($term_id)) ? $term_id->term_id : $term_id;
2026
-
2027
-            $m = get_option('tax_meta_' . $post_type  . $t_id);
2028
-            if (isset($m[$key])) {
2029
-                return $m[$key];
2030
-            } else {
2031
-                return '';
2032
-            }
2033
-        }
2034
-
2035
-        //delete meta
2036
-        public function delete_tax_meta($term_id, $key, $post_type = '')
2037
-        {
2038
-
2039
-            if (empty($post_type) && isset($_REQUEST['taxonomy'])) {
2040
-                $taxObject = get_taxonomy($_REQUEST['taxonomy']);
2041
-                $post_type = $taxObject->object_type[0];
2042
-            }
2043
-
2044
-            if($post_type=='post'){$post_type='';}
2045
-            if($post_type){$post_type = $post_type.'_';}
2046
-
2047
-            $m = get_option('tax_meta_' . $post_type  . $term_id);
2048
-
2049
-            if (isset($m[$key])) {
2050
-                unset($m[$key]);
2051
-            }
2052
-            update_option('tax_meta_' . $post_type  . $term_id, $m);
2053
-        }
2054
-
2055
-        //update meta
2056
-        public function update_tax_meta($term_id, $key, $value, $post_type = '')
2057
-        {
2058
-
2059
-            if (empty($post_type) && isset($_REQUEST['taxonomy'])) {
2060
-                $taxObject = get_taxonomy($_REQUEST['taxonomy']);
2061
-                $post_type = $taxObject->object_type[0];
2062
-            }
2063
-
2064
-            if($post_type=='post'){$post_type='';}
2065
-            if($post_type){$post_type = $post_type.'_';}
2066
-
2067
-            $m = get_option('tax_meta_' . $post_type  . $term_id);
2068
-
2069
-            $m[$key] = $value;
2070
-            update_option('tax_meta_' . $post_type  . $term_id, $m);
2071
-
2072
-            /**
2073
-             * Called after the tax meta is updated.
2074
-             *
2075
-             * Used to update things after a GD category is saved.
2076
-             *
2077
-             * @since 1.0.0
2078
-             * @param bool $false False.
2079
-             * @param bool $true True.
2080
-             * @param int $term_id The term id being updated.
2081
-             * @param string $post_type The post type of the cat being updated.
2082
-             */
2083
-            do_action('gd_tax_meta_updated', false, true, $term_id, $post_type);
2084
-        }
2085
-
2086
-
2087
-    } // End Class
1288
+		public function save_field_wysiwyg($term_id, $field, $old, $new)
1289
+		{
1290
+			$this->save_field($term_id, $field, $old, $new);
1291
+		}
1292
+
1293
+		/**
1294
+		 * Save repeater Fields.
1295
+		 *
1296
+		 * @param string $term_id The term ID.
1297
+		 * @param string $field
1298
+		 * @param string|mixed $old
1299
+		 * @param string|mixed $new
1300
+		 * @since 1.0
1301
+		 * @access public
1302
+		 */
1303
+		public function save_field_repeater($term_id, $field, $old, $new)
1304
+		{
1305
+			if (is_array($new) && count($new) > 0) {
1306
+				foreach ($new as $n) {
1307
+					foreach ($field['fields'] as $f) {
1308
+						$type = $f['type'];
1309
+						switch ($type) {
1310
+							case 'wysiwyg':
1311
+								$n[$f['id']] = wpautop($n[$f['id']]);
1312
+								break;
1313
+							case 'file':
1314
+								$n[$f['id']] = $this->save_field_file_repeater($term_id, $f, '', $n[$f['id']]);
1315
+								break;
1316
+							default:
1317
+								break;
1318
+						}
1319
+					}
1320
+					if (!$this->is_array_empty($n))
1321
+						$temp[] = $n;
1322
+				}
1323
+				if (isset($temp) && count($temp) > 0 && !$this->is_array_empty($temp)) {
1324
+					$this->update_tax_meta($term_id, $field['id'], $temp);
1325
+				} else {
1326
+					//	remove old meta if exists
1327
+					delete_post_meta($term_id, $field['id']);
1328
+				}
1329
+			} else {
1330
+				//	remove old meta if exists
1331
+				delete_post_meta($term_id, $field['id']);
1332
+			}
1333
+		}
1334
+
1335
+		/**
1336
+		 * Save File Field.
1337
+		 *
1338
+		 * @param string $term_id The term ID.
1339
+		 * @param string $field
1340
+		 * @param string $old
1341
+		 * @param string $new
1342
+		 * @since 1.0
1343
+		 * @access public
1344
+		 */
1345
+		public function save_field_file($term_id, $field, $old, $new)
1346
+		{
1347
+
1348
+			$name = $field['id'];
1349
+			if (empty($_FILES[$name]))
1350
+				return;
1351
+			$this->fix_file_array($_FILES[$name]);
1352
+			foreach ($_FILES[$name] as $position => $fileitem) {
1353
+
1354
+				$file = wp_handle_upload($fileitem, array('test_form' => false));
1355
+				if (empty($file['file']))
1356
+					continue;
1357
+				$filename = $file['file'];
1358
+
1359
+				$attachment = array(
1360
+					'post_mime_type' => $file['type'],
1361
+					'guid' => $file['url'],
1362
+					'post_parent' => $term_id,
1363
+					'post_title' => preg_replace('/\.[^.]+$/', '', basename($filename)),
1364
+					'post_content' => ''
1365
+				);
1366
+
1367
+				$id = wp_insert_attachment($attachment, $filename, $term_id);
1368
+
1369
+				if (!is_wp_error($id)) {
1370
+
1371
+					wp_update_attachment_metadata($id, wp_generate_attachment_metadata($id, $filename));
1372
+					add_post_meta($term_id, $name, $id, false);    // save file's url in meta fields
1373
+
1374
+				} // End if
1375
+
1376
+			} // End foreach
1377
+
1378
+		}
1379
+
1380
+		/**
1381
+		 * Save repeater File Field.
1382
+		 * @param string $term_id The term ID.
1383
+		 * @param string $field
1384
+		 * @param string $old
1385
+		 * @param string $new
1386
+		 * @since 1.0
1387
+		 * @access public
1388
+		 * @return int|void
1389
+		 */
1390
+		public function save_field_file_repeater($term_id, $field, $old, $new)
1391
+		{
1392
+
1393
+			$name = $field['id'];
1394
+			if (empty($_FILES[$name]))
1395
+				return;
1396
+			$this->fix_file_array($_FILES[$name]);
1397
+			foreach ($_FILES[$name] as $position => $fileitem) {
1398
+
1399
+				$file = wp_handle_upload($fileitem, array('test_form' => false));
1400
+				if (empty($file['file']))
1401
+					continue;
1402
+				$filename = $file['file'];
1403
+
1404
+				$attachment = array(
1405
+					'post_mime_type' => $file['type'],
1406
+					'guid' => $file['url'],
1407
+					'post_parent' => $term_id,
1408
+					'post_title' => preg_replace('/\.[^.]+$/', '', basename($filename)),
1409
+					'post_content' => ''
1410
+				);
1411
+
1412
+				$id = wp_insert_attachment($attachment, $filename);
1413
+
1414
+				if (!is_wp_error($id)) {
1415
+
1416
+					wp_update_attachment_metadata($id, wp_generate_attachment_metadata($id, $filename));
1417
+					return $id;    // return file's url in meta fields
1418
+				} // End if
1419
+			} // End foreach
1420
+		}
1421
+
1422
+		/**
1423
+		 * Add missed values for meta box.
1424
+		 *
1425
+		 * @since 1.0
1426
+		 * @access public
1427
+		 */
1428
+		public function add_missed_values()
1429
+		{
1430
+
1431
+			// Default values for meta box
1432
+			$this->_meta_box = array_merge(array('context' => 'normal', 'priority' => 'high', 'pages' => array('post')), (array)$this->_meta_box);
1433
+
1434
+			if(is_array($this->_fields)) {
1435
+				// Default values for fields
1436
+				foreach ($this->_fields as &$field) {
1437
+					$multiple = in_array($field['type'], array('checkbox_list', 'file', 'image'));
1438
+					$std = $multiple ? array() : '';
1439
+					$format = 'date' == $field['type'] ? 'yy-mm-dd' : ('time' == $field['type'] ? 'hh:mm' : '');
1440
+					$field = array_merge(array('multiple' => $multiple, 'std' => $std, 'desc' => '', 'format' => $format, 'validate_func' => ''), $field);
1441
+				} // End foreach
1442
+			}
1443
+		}
1444
+
1445
+		/**
1446
+		 * Check if field with $type exists.
1447
+		 *
1448
+		 * @param string $type
1449
+		 * @since 1.0
1450
+		 * @access public
1451
+		 */
1452
+		public function has_field($type)
1453
+		{
1454
+			if(is_array($this->_fields)) {
1455
+				foreach ($this->_fields as $field) {
1456
+					if ($type == $field['type'])
1457
+						return true;
1458
+				}
1459
+			}
1460
+			return false;
1461
+		}
1462
+
1463
+		/**
1464
+		 * Check if current page is edit page.
1465
+		 *
1466
+		 * @since 1.0
1467
+		 * @access public
1468
+		 */
1469
+		public function is_edit_page()
1470
+		{
1471
+			global $pagenow;
1472
+			return ($pagenow == 'edit-tags.php' || $pagenow == 'term.php');
1473
+		}
1474
+
1475
+		/**
1476
+		 * Fixes the odd indexing of multiple file uploads.
1477
+		 *
1478
+		 * Goes from the format:
1479
+		 * $_FILES['field']['key']['index']
1480
+		 * to
1481
+		 * The More standard and appropriate:
1482
+		 * $_FILES['field']['index']['key']
1483
+		 *
1484
+		 * @param string $files
1485
+		 * @since 1.0
1486
+		 * @access public
1487
+		 */
1488
+		public function fix_file_array(&$files)
1489
+		{
1490
+
1491
+			$output = array();
1492
+
1493
+			foreach ($files as $key => $list) {
1494
+				foreach ($list as $index => $value) {
1495
+					$output[$index][$key] = $value;
1496
+				}
1497
+			}
1498
+
1499
+			return $files = $output;
1500
+
1501
+		}
1502
+
1503
+		/**
1504
+		 * Get proper JQuery UI version.
1505
+		 *
1506
+		 * Used in order to not conflict with WP Admin Scripts.
1507
+		 *
1508
+		 * @since 1.0
1509
+		 * @access public
1510
+		 */
1511
+		public function get_jqueryui_ver()
1512
+		{
1513
+
1514
+			global $wp_version;
1515
+
1516
+			if (version_compare($wp_version, '3.1', '>=')) {
1517
+				return '1.8.10';
1518
+			}
1519
+
1520
+			return '1.7.3';
1521
+
1522
+		}
1523
+
1524
+		/**
1525
+		 *  Add Field to meta box (generic function)
1526
+		 * @author Ohad Raz
1527
+		 * @since 1.0
1528
+		 * @access public
1529
+		 * @param $id string  field id, i.e. the meta key
1530
+		 * @param $args mixed|array
1531
+		 */
1532
+		public function addField($id, $args)
1533
+		{
1534
+			$new_field = array('id' => $id, 'std' => '', 'desc' => '', 'style' => '');
1535
+			$new_field = array_merge($new_field, $args);
1536
+			$this->_fields[] = $new_field;
1537
+		}
1538
+
1539
+
1540
+		/**
1541
+		 *  Add Text Field to meta box
1542
+		 * @author Ohad Raz
1543
+		 * @since 1.0
1544
+		 * @access public
1545
+		 * @param $id string  field id, i.e. the meta key
1546
+		 * @param $args mixed|array
1547
+		 *    'name' => // field name/label string optional
1548
+		 *    'desc' => // field description, string optional
1549
+		 *    'std' => // default value, string optional
1550
+		 *    'style' =>    // custom style for field, string optional
1551
+		 *    'validate_func' => // validate function, string optional
1552
+		 * @param $repeater bool  is this a field inside a repeatr? true|false(default)
1553
+		 */
1554
+		public function addText($id, $args, $repeater = false)
1555
+		{
1556
+			$new_field = array('type' => 'text', 'id' => $id, 'std' => '', 'desc' => '', 'style' => '', 'name' => __('Text Field', 'geodirectory'));
1557
+			$new_field = array_merge($new_field, $args);
1558
+			if (false === $repeater) {
1559
+				$this->_fields[] = $new_field;
1560
+			} else {
1561
+				return $new_field;
1562
+			}
1563
+		}
1564
+
1565
+		/**
1566
+		 *  Add Hidden Field to meta box
1567
+		 * @author Ohad Raz
1568
+		 * @since 0.1.3
1569
+		 * @access public
1570
+		 * @param $id string  field id, i.e. the meta key
1571
+		 * @param $args mixed|array
1572
+		 *    'name' => // field name/label string optional
1573
+		 *    'desc' => // field description, string optional
1574
+		 *    'std' => // default value, string optional
1575
+		 *    'style' =>    // custom style for field, string optional
1576
+		 *    'validate_func' => // validate function, string optional
1577
+		 * @param $repeater bool  is this a field inside a repeatr? true|false(default)
1578
+		 */
1579
+		public function addHidden($id, $args, $repeater = false)
1580
+		{
1581
+			$new_field = array('type' => 'hidden', 'id' => $id, 'std' => '', 'desc' => '', 'style' => '', 'name' => __('Text Field', 'geodirectory'));
1582
+			$new_field = array_merge($new_field, $args);
1583
+			if (false === $repeater) {
1584
+				$this->_fields[] = $new_field;
1585
+			} else {
1586
+				return $new_field;
1587
+			}
1588
+		}
1589
+
1590
+		/**
1591
+		 *  Add Paragraph to meta box
1592
+		 * @author Ohad Raz
1593
+		 * @since 0.1.3
1594
+		 * @access public
1595
+		 * @param $id string  field id, i.e. the meta key
1596
+		 * @param $value  paragraph html
1597
+		 * @param $repeater bool  is this a field inside a repeatr? true|false(default)
1598
+		 */
1599
+		public function addParagraph($id, $args, $repeater = false)
1600
+		{
1601
+			$new_field = array('type' => 'paragraph', 'id' => $id, 'value' => '', 'style' => '');
1602
+			$new_field = array_merge($new_field, $args);
1603
+			if (false === $repeater) {
1604
+				$this->_fields[] = $new_field;
1605
+			} else {
1606
+				return $new_field;
1607
+			}
1608
+		}
1609
+
1610
+		/**
1611
+		 *  Add Checkbox Field to meta box
1612
+		 * @author Ohad Raz
1613
+		 * @since 1.0
1614
+		 * @access public
1615
+		 * @param $id string  field id, i.e. the meta key
1616
+		 * @param $args mixed|array
1617
+		 *    'name' => // field name/label string optional
1618
+		 *    'desc' => // field description, string optional
1619
+		 *    'std' => // default value, string optional
1620
+		 *    'validate_func' => // validate function, string optional
1621
+		 * @param $repeater bool  is this a field inside a repeatr? true|false(default)
1622
+		 */
1623
+		public function addCheckbox($id, $args, $repeater = false)
1624
+		{
1625
+			$new_field = array('type' => 'checkbox', 'id' => $id, 'std' => '', 'desc' => '', 'style' => '', 'name' => __('Checkbox Field', 'geodirectory'));
1626
+			$new_field = array_merge($new_field, $args);
1627
+			if (false === $repeater) {
1628
+				$this->_fields[] = $new_field;
1629
+			} else {
1630
+				return $new_field;
1631
+			}
1632
+		}
1633
+
1634
+		/**
1635
+		 *  Add CheckboxList Field to meta box
1636
+		 * @author Ohad Raz
1637
+		 * @since 1.0
1638
+		 * @access public
1639
+		 * @param $id string  field id, i.e. the meta key
1640
+		 * @param $options (array)  array of key => value pairs for select options
1641
+		 * @param $args mixed|array
1642
+		 *    'name' => // field name/label string optional
1643
+		 *    'desc' => // field description, string optional
1644
+		 *    'std' => // default value, string optional
1645
+		 *    'validate_func' => // validate function, string optional
1646
+		 * @param $repeater bool  is this a field inside a repeatr? true|false(default)
1647
+		 *
1648
+		 * @return : remember to call: $checkbox_list = $this->get_tax_meta(get_the_ID(), 'meta_name', false);
1649
+		 *   which means the last param as false to get the values in an array
1650
+		 */
1651
+		public function addCheckboxList($id, $options, $args, $repeater = false)
1652
+		{
1653
+			$new_field = array('type' => 'checkbox_list', 'id' => $id, 'std' => '', 'desc' => '', 'style' => '', 'name' => __('Checkbox List Field', 'geodirectory'));
1654
+			$new_field = array_merge($new_field, $args);
1655
+			if (false === $repeater) {
1656
+				$this->_fields[] = $new_field;
1657
+			} else {
1658
+				return $new_field;
1659
+			}
1660
+		}
1661
+
1662
+		/**
1663
+		 *  Add Textarea Field to meta box
1664
+		 * @author Ohad Raz
1665
+		 * @since 1.0
1666
+		 * @access public
1667
+		 * @param $id string  field id, i.e. the meta key
1668
+		 * @param $args mixed|array
1669
+		 *    'name' => // field name/label string optional
1670
+		 *    'desc' => // field description, string optional
1671
+		 *    'std' => // default value, string optional
1672
+		 *    'style' =>    // custom style for field, string optional
1673
+		 *    'validate_func' => // validate function, string optional
1674
+		 * @param $repeater bool  is this a field inside a repeatr? true|false(default)
1675
+		 */
1676
+		public function addTextarea($id, $args, $repeater = false)
1677
+		{
1678
+			$new_field = array('type' => 'textarea', 'id' => $id, 'std' => '', 'desc' => '', 'style' => '', 'name' => __('Textarea Field', 'geodirectory'));
1679
+			$new_field = array_merge($new_field, $args);
1680
+			if (false === $repeater) {
1681
+				$this->_fields[] = $new_field;
1682
+			} else {
1683
+				return $new_field;
1684
+			}
1685
+		}
1686
+
1687
+		/**
1688
+		 *  Add Select Field to meta box
1689
+		 * @author Ohad Raz
1690
+		 * @since 1.0
1691
+		 * @access public
1692
+		 * @param $id string field id, i.e. the meta key
1693
+		 * @param $options (array)  array of key => value pairs for select options
1694
+		 * @param $args mixed|array
1695
+		 *    'name' => // field name/label string optional
1696
+		 *    'desc' => // field description, string optional
1697
+		 *    'std' => // default value, (array) optional
1698
+		 *    'multiple' => // select multiple values, optional. Default is false.
1699
+		 *    'validate_func' => // validate function, string optional
1700
+		 * @param $repeater bool  is this a field inside a repeatr? true|false(default)
1701
+		 */
1702
+		public function addSelect($id, $options, $args, $repeater = false)
1703
+		{
1704
+			$new_field = array('type' => 'select', 'id' => $id, 'std' => array(), 'desc' => '', 'style' => '', 'name' => __('Select Field', 'geodirectory'), 'multiple' => false, 'options' => $options);
1705
+			$new_field = array_merge($new_field, $args);
1706
+			if (false === $repeater) {
1707
+				$this->_fields[] = $new_field;
1708
+			} else {
1709
+				return $new_field;
1710
+			}
1711
+		}
1712
+
1713
+
1714
+		/**
1715
+		 *  Add Radio Field to meta box
1716
+		 * @author Ohad Raz
1717
+		 * @since 1.0
1718
+		 * @access public
1719
+		 * @param $id string field id, i.e. the meta key
1720
+		 * @param $options (array)  array of key => value pairs for radio options
1721
+		 * @param $args mixed|array
1722
+		 *    'name' => // field name/label string optional
1723
+		 *    'desc' => // field description, string optional
1724
+		 *    'std' => // default value, string optional
1725
+		 *    'validate_func' => // validate function, string optional
1726
+		 * @param $repeater bool  is this a field inside a repeatr? true|false(default)
1727
+		 */
1728
+		public function addRadio($id, $options, $args, $repeater = false)
1729
+		{
1730
+			$new_field = array('type' => 'radio', 'id' => $id, 'std' => array(), 'desc' => '', 'style' => '', 'name' => __('Radio Field', 'geodirectory'), 'options' => $options);
1731
+			$new_field = array_merge($new_field, $args);
1732
+			if (false === $repeater) {
1733
+				$this->_fields[] = $new_field;
1734
+			} else {
1735
+				return $new_field;
1736
+			}
1737
+		}
1738
+
1739
+		/**
1740
+		 *  Add Date Field to meta box
1741
+		 * @author Ohad Raz
1742
+		 * @since 1.0
1743
+		 * @access public
1744
+		 * @param $id string  field id, i.e. the meta key
1745
+		 * @param $args mixed|array
1746
+		 *    'name' => // field name/label string optional
1747
+		 *    'desc' => // field description, string optional
1748
+		 *    'std' => // default value, string optional
1749
+		 *    'validate_func' => // validate function, string optional
1750
+		 *    'format' => // date format, default yy-mm-dd. Optional. Default "'d MM, yy'"  See more formats here: http://goo.gl/Wcwxn
1751
+		 * @param $repeater bool  is this a field inside a repeatr? true|false(default)
1752
+		 */
1753
+		public function addDate($id, $args, $repeater = false)
1754
+		{
1755
+			$new_field = array('type' => 'date', 'id' => $id, 'std' => '', 'desc' => '', 'format' => 'yy-mm-dd', 'name' => __('Date Field', 'geodirectory'));
1756
+			$new_field = array_merge($new_field, $args);
1757
+			if (false === $repeater) {
1758
+				$this->_fields[] = $new_field;
1759
+			} else {
1760
+				return $new_field;
1761
+			}
1762
+		}
1763
+
1764
+		/**
1765
+		 *  Add Time Field to meta box
1766
+		 * @author Ohad Raz
1767
+		 * @since 1.0
1768
+		 * @access public
1769
+		 * @param $id string- field id, i.e. the meta key
1770
+		 * @param $args mixed|array
1771
+		 *    'name' => // field name/label string optional
1772
+		 *    'desc' => // field description, string optional
1773
+		 *    'std' => // default value, string optional
1774
+		 *    'validate_func' => // validate function, string optional
1775
+		 *    'format' => // time format, default hh:mm. Optional. See more formats here: http://goo.gl/83woX
1776
+		 * @param $repeater bool  is this a field inside a repeatr? true|false(default)
1777
+		 */
1778
+		public function addTime($id, $args, $repeater = false)
1779
+		{
1780
+			$new_field = array('type' => 'time', 'id' => $id, 'std' => '', 'desc' => '', 'format' => 'hh:mm', 'name' => __('Time Field', 'geodirectory'));
1781
+			$new_field = array_merge($new_field, $args);
1782
+			if (false === $repeater) {
1783
+				$this->_fields[] = $new_field;
1784
+			} else {
1785
+				return $new_field;
1786
+			}
1787
+		}
1788
+
1789
+		/**
1790
+		 *  Add Color Field to meta box
1791
+		 * @author Ohad Raz
1792
+		 * @since 1.0
1793
+		 * @access public
1794
+		 * @param $id string  field id, i.e. the meta key
1795
+		 * @param $args mixed|array
1796
+		 *    'name' => // field name/label string optional
1797
+		 *    'desc' => // field description, string optional
1798
+		 *    'std' => // default value, string optional
1799
+		 *    'validate_func' => // validate function, string optional
1800
+		 * @param $repeater bool  is this a field inside a repeatr? true|false(default)
1801
+		 */
1802
+		public function addColor($id, $args, $repeater = false)
1803
+		{
1804
+			$new_field = array('type' => 'color', 'id' => $id, 'std' => '', 'desc' => '', 'name' => __('ColorPicker Field', 'geodirectory'));
1805
+			$new_field = array_merge($new_field, $args);
1806
+			if (false === $repeater) {
1807
+				$this->_fields[] = $new_field;
1808
+			} else {
1809
+				return $new_field;
1810
+			}
1811
+		}
1812
+
1813
+		/**
1814
+		 *  Add Image Field to meta box
1815
+		 * @author Ohad Raz
1816
+		 * @since 1.0
1817
+		 * @access public
1818
+		 * @param $id string  field id, i.e. the meta key
1819
+		 * @param $args mixed|array
1820
+		 *    'name' => // field name/label string optional
1821
+		 *    'desc' => // field description, string optional
1822
+		 *    'validate_func' => // validate function, string optional
1823
+		 * @param $repeater bool  is this a field inside a repeatr? true|false(default)
1824
+		 */
1825
+		public function addImage($id, $args, $repeater = false)
1826
+		{
1827
+			$new_field = array('type' => 'image', 'id' => $id, 'desc' => '', 'style' => '', 'name' => __('Image Field', 'geodirectory'));
1828
+			$new_field = array_merge($new_field, $args);
1829
+
1830
+			if (false === $repeater) {
1831
+				$this->_fields[] = $new_field;
1832
+			} else {
1833
+				return $new_field;
1834
+			}
1835
+		}
1836
+
1837
+		/**
1838
+		 *  Add File Field to meta box
1839
+		 * @author Ohad Raz
1840
+		 * @since 1.0
1841
+		 * @access public
1842
+		 * @param $id string  field id, i.e. the meta key
1843
+		 * @param $args mixed|array
1844
+		 *    'name' => // field name/label string optional
1845
+		 *    'desc' => // field description, string optional
1846
+		 *    'validate_func' => // validate function, string optional
1847
+		 * @param $repeater bool  is this a field inside a repeatr? true|false(default)
1848
+		 */
1849
+		public function addFile($id, $args, $repeater = false)
1850
+		{
1851
+			$new_field = array('type' => 'file', 'id' => $id, 'desc' => '', 'style' => '', 'name' => __('File Field', 'geodirectory'));
1852
+			$new_field = array_merge($new_field, $args);
1853
+			if (false === $repeater) {
1854
+				$this->_fields[] = $new_field;
1855
+			} else {
1856
+				return $new_field;
1857
+			}
1858
+		}
1859
+
1860
+		/**
1861
+		 *  Add WYSIWYG Field to meta box
1862
+		 * @author Ohad Raz
1863
+		 * @since 1.0
1864
+		 * @access public
1865
+		 * @param $id string  field id, i.e. the meta key
1866
+		 * @param $args mixed|array
1867
+		 *    'name' => // field name/label string optional
1868
+		 *    'desc' => // field description, string optional
1869
+		 *    'std' => // default value, string optional
1870
+		 *    'style' =>    // custom style for field, string optional Default 'width: 300px; height: 400px'
1871
+		 *    'validate_func' => // validate function, string optional
1872
+		 * @param $repeater bool  is this a field inside a repeatr? true|false(default)
1873
+		 */
1874
+		public function addWysiwyg($id, $args, $repeater = false)
1875
+		{
1876
+			$new_field = array('type' => 'wysiwyg', 'id' => $id, 'std' => '', 'desc' => '', 'style' => 'width: 300px; height: 400px', 'name' => __('WYSIWYG Editor Field', 'geodirectory'));
1877
+			$new_field = array_merge($new_field, $args);
1878
+			if (false === $repeater) {
1879
+				$this->_fields[] = $new_field;
1880
+			} else {
1881
+				return $new_field;
1882
+			}
1883
+		}
1884
+
1885
+		/**
1886
+		 *  Add Taxonomy Field to meta box
1887
+		 * @author Ohad Raz
1888
+		 * @since 1.0
1889
+		 * @access public
1890
+		 * @param $id string  field id, i.e. the meta key
1891
+		 * @param $options mixed|array options of taxonomy field
1892
+		 *    'taxonomy' =>    // taxonomy name can be category,post_tag or any custom taxonomy default is category
1893
+		 * 'type' =>  // how to show taxonomy? 'select' (default) or 'checkbox_list'
1894
+		 * 'args' =>  // arguments to query taxonomy, see http://goo.gl/uAANN default ('hide_empty' => false)
1895
+		 * @param $args mixed|array
1896
+		 *    'name' => // field name/label string optional
1897
+		 *    'desc' => // field description, string optional
1898
+		 *    'std' => // default value, string optional
1899
+		 *    'validate_func' => // validate function, string optional
1900
+		 * @param $repeater bool  is this a field inside a repeatr? true|false(default)
1901
+		 */
1902
+		public function addTaxonomy($id, $options, $args, $repeater = false)
1903
+		{
1904
+			$q = array('hide_empty' => 0);
1905
+			$tax = 'category';
1906
+			$type = 'select';
1907
+			$temp = array($tax, $type, $q);
1908
+			$options = array_merge($temp, $options);
1909
+			$new_field = array('type' => 'taxonomy', 'id' => $id, 'desc' => '', 'name' => __('Taxonomy Field', 'geodirectory'), 'options' => $options);
1910
+			$new_field = array_merge($new_field, $args);
1911
+			if (false === $repeater) {
1912
+				$this->_fields[] = $new_field;
1913
+			} else {
1914
+				return $new_field;
1915
+			}
1916
+		}
1917
+
1918
+		/**
1919
+		 *  Add posts Field to meta box
1920
+		 * @author Ohad Raz
1921
+		 * @since 1.0
1922
+		 * @access public
1923
+		 * @param $id string  field id, i.e. the meta key
1924
+		 * @param $options mixed|array options of taxonomy field
1925
+		 *    'post_type' =>    // post type name, 'post' (default) 'page' or any custom post type
1926
+		 * 'type' =>  // how to show posts? 'select' (default) or 'checkbox_list'
1927
+		 * 'args' =>  // arguments to query posts, see http://goo.gl/is0yK default ('posts_per_page' => -1)
1928
+		 * @param $args mixed|array
1929
+		 *    'name' => // field name/label string optional
1930
+		 *    'desc' => // field description, string optional
1931
+		 *    'std' => // default value, string optional
1932
+		 *    'validate_func' => // validate function, string optional
1933
+		 * @param $repeater bool  is this a field inside a repeatr? true|false(default)
1934
+		 */
1935
+		public function addPosts($id, $options, $args, $repeater = false)
1936
+		{
1937
+			$q = array('posts_per_page' => -1);
1938
+			$temp = array('post_type' => 'post', 'type' => 'select', 'args' => $q);
1939
+			$options = array_merge($temp, $options);
1940
+			$new_field = array('type' => 'posts', 'id' => $id, 'desc' => '', 'name' => __('Posts Field', 'geodirectory'), 'options' => $options);
1941
+			$new_field = array_merge($new_field, $args);
1942
+			if (false === $repeater) {
1943
+				$this->_fields[] = $new_field;
1944
+			} else {
1945
+				return $new_field;
1946
+			}
1947
+		}
1948
+
1949
+		/**
1950
+		 *  Add repeater Field Block to meta box
1951
+		 * @author Ohad Raz
1952
+		 * @since 1.0
1953
+		 * @access public
1954
+		 * @param $id string  field id, i.e. the meta key
1955
+		 * @param $args mixed|array
1956
+		 *    'name' => // field name/label string optional
1957
+		 *    'desc' => // field description, string optional
1958
+		 *    'std' => // default value, string optional
1959
+		 *    'style' =>    // custom style for field, string optional
1960
+		 *    'validate_func' => // validate function, string optional
1961
+		 *    'fields' => //fields to repeater
1962
+		 */
1963
+		public function addRepeaterBlock($id, $args)
1964
+		{
1965
+			$new_field = array('type' => 'repeater', 'id' => $id, 'name' => __('Reapeater Field', 'geodirectory'), 'fields' => array(), 'inline' => false);
1966
+			$new_field = array_merge($new_field, $args);
1967
+			$this->_fields[] = $new_field;
1968
+		}
1969
+
1970
+
1971
+		/**
1972
+		 * Finish Declaration of Meta Box
1973
+		 * @author Ohad Raz
1974
+		 * @since 1.0
1975
+		 * @access public
1976
+		 */
1977
+		public function Finish()
1978
+		{
1979
+			$this->add_missed_values();
1980
+			$this->check_field_upload();
1981
+			$this->check_field_color();
1982
+			$this->check_field_date();
1983
+			$this->check_field_time();
1984
+		}
1985
+
1986
+		/**
1987
+		 * Helper function to check for empty arrays
1988
+		 * @author Ohad Raz
1989
+		 * @since 1.0
1990
+		 * @access public
1991
+		 * @param $args mixed|array
1992
+		 */
1993
+		public function is_array_empty($array)
1994
+		{
1995
+			if (!is_array($array))
1996
+				return true;
1997
+
1998
+			foreach ($array as $a) {
1999
+				if (is_array($a)) {
2000
+					foreach ($a as $sub_a) {
2001
+						if (!empty($sub_a) && $sub_a != '')
2002
+							return false;
2003
+					}
2004
+				} else {
2005
+					if (!empty($a) && $a != '')
2006
+						return false;
2007
+				}
2008
+			}
2009
+			return true;
2010
+		}
2011
+
2012
+
2013
+		//get term meta field
2014
+		public function get_tax_meta($term_id, $key, $multi = false, $post_type = '')
2015
+		{
2016
+
2017
+			if (empty($post_type) && isset($_REQUEST['taxonomy'])) {
2018
+				$taxObject = get_taxonomy($_REQUEST['taxonomy']);
2019
+				$post_type = $taxObject->object_type[0];
2020
+			}
2021
+
2022
+			if($post_type=='post'){$post_type='';}
2023
+			if($post_type){$post_type = $post_type.'_';}
2024
+
2025
+			$t_id = (is_object($term_id)) ? $term_id->term_id : $term_id;
2026
+
2027
+			$m = get_option('tax_meta_' . $post_type  . $t_id);
2028
+			if (isset($m[$key])) {
2029
+				return $m[$key];
2030
+			} else {
2031
+				return '';
2032
+			}
2033
+		}
2034
+
2035
+		//delete meta
2036
+		public function delete_tax_meta($term_id, $key, $post_type = '')
2037
+		{
2038
+
2039
+			if (empty($post_type) && isset($_REQUEST['taxonomy'])) {
2040
+				$taxObject = get_taxonomy($_REQUEST['taxonomy']);
2041
+				$post_type = $taxObject->object_type[0];
2042
+			}
2043
+
2044
+			if($post_type=='post'){$post_type='';}
2045
+			if($post_type){$post_type = $post_type.'_';}
2046
+
2047
+			$m = get_option('tax_meta_' . $post_type  . $term_id);
2048
+
2049
+			if (isset($m[$key])) {
2050
+				unset($m[$key]);
2051
+			}
2052
+			update_option('tax_meta_' . $post_type  . $term_id, $m);
2053
+		}
2054
+
2055
+		//update meta
2056
+		public function update_tax_meta($term_id, $key, $value, $post_type = '')
2057
+		{
2058
+
2059
+			if (empty($post_type) && isset($_REQUEST['taxonomy'])) {
2060
+				$taxObject = get_taxonomy($_REQUEST['taxonomy']);
2061
+				$post_type = $taxObject->object_type[0];
2062
+			}
2063
+
2064
+			if($post_type=='post'){$post_type='';}
2065
+			if($post_type){$post_type = $post_type.'_';}
2066
+
2067
+			$m = get_option('tax_meta_' . $post_type  . $term_id);
2068
+
2069
+			$m[$key] = $value;
2070
+			update_option('tax_meta_' . $post_type  . $term_id, $m);
2071
+
2072
+			/**
2073
+			 * Called after the tax meta is updated.
2074
+			 *
2075
+			 * Used to update things after a GD category is saved.
2076
+			 *
2077
+			 * @since 1.0.0
2078
+			 * @param bool $false False.
2079
+			 * @param bool $true True.
2080
+			 * @param int $term_id The term id being updated.
2081
+			 * @param string $post_type The post type of the cat being updated.
2082
+			 */
2083
+			do_action('gd_tax_meta_updated', false, true, $term_id, $post_type);
2084
+		}
2085
+
2086
+
2087
+	} // End Class
2088 2088
 
2089 2089
 endif; // End Check Class Exists
2090 2090
 
@@ -2094,79 +2094,79 @@  discard block
 block discarded – undo
2094 2094
 
2095 2095
 //get term meta field
2096 2096
 if (!function_exists('geodir_get_tax_meta')) {
2097
-    function geodir_get_tax_meta($term_id, $key, $multi = false, $post_type = '') {
2098
-        if (empty($post_type) && isset($_REQUEST['taxonomy'])) {
2099
-            $taxObject = get_taxonomy($_REQUEST['taxonomy']);
2097
+	function geodir_get_tax_meta($term_id, $key, $multi = false, $post_type = '') {
2098
+		if (empty($post_type) && isset($_REQUEST['taxonomy'])) {
2099
+			$taxObject = get_taxonomy($_REQUEST['taxonomy']);
2100 2100
             
2101
-            if (!empty($taxObject->object_type)) {
2102
-                $post_type = $taxObject->object_type[0];
2103
-            }
2104
-        }
2105
-
2106
-        if ($post_type == 'post') {
2107
-            $post_type = '';
2108
-        }
2109
-        if ($post_type) {
2110
-            $post_type = $post_type . '_';
2111
-        }
2112
-
2113
-        $t_id = (is_object($term_id)) ? $term_id->term_id : $term_id;
2114
-
2115
-        $m = get_option('tax_meta_' . $post_type  . $t_id);
2116
-        if (isset($m[$key])) {
2117
-            return $m[$key];
2118
-        } else {
2119
-            return '';
2120
-        }
2121
-    }
2101
+			if (!empty($taxObject->object_type)) {
2102
+				$post_type = $taxObject->object_type[0];
2103
+			}
2104
+		}
2105
+
2106
+		if ($post_type == 'post') {
2107
+			$post_type = '';
2108
+		}
2109
+		if ($post_type) {
2110
+			$post_type = $post_type . '_';
2111
+		}
2112
+
2113
+		$t_id = (is_object($term_id)) ? $term_id->term_id : $term_id;
2114
+
2115
+		$m = get_option('tax_meta_' . $post_type  . $t_id);
2116
+		if (isset($m[$key])) {
2117
+			return $m[$key];
2118
+		} else {
2119
+			return '';
2120
+		}
2121
+	}
2122 2122
 }
2123 2123
 
2124 2124
 //delete meta
2125 2125
 if (!function_exists('geodir_delete_tax_meta')) {
2126
-    function geodir_delete_tax_meta($term_id, $key) {
2127
-        $taxObject = get_taxonomy($_REQUEST['taxonomy']);
2128
-        $post_type = !empty($taxObject->object_type) ? $taxObject->object_type[0] : '';
2129
-
2130
-        if ($post_type == 'post') {
2131
-            $post_type = '';
2132
-        }
2133
-        if ($post_type) {
2134
-            $post_type = $post_type . '_';
2135
-        }
2136
-
2137
-        $m = get_option('tax_meta_' . $post_type . $term_id);
2138
-
2139
-        if (isset($m[$key])) {
2140
-            unset($m[$key]);
2141
-        }
2142
-        update_option('tax_meta_' . $post_type  . $term_id, $m);
2143
-    }
2126
+	function geodir_delete_tax_meta($term_id, $key) {
2127
+		$taxObject = get_taxonomy($_REQUEST['taxonomy']);
2128
+		$post_type = !empty($taxObject->object_type) ? $taxObject->object_type[0] : '';
2129
+
2130
+		if ($post_type == 'post') {
2131
+			$post_type = '';
2132
+		}
2133
+		if ($post_type) {
2134
+			$post_type = $post_type . '_';
2135
+		}
2136
+
2137
+		$m = get_option('tax_meta_' . $post_type . $term_id);
2138
+
2139
+		if (isset($m[$key])) {
2140
+			unset($m[$key]);
2141
+		}
2142
+		update_option('tax_meta_' . $post_type  . $term_id, $m);
2143
+	}
2144 2144
 }
2145 2145
 
2146 2146
 //update meta
2147 2147
 if (!function_exists('geodir_update_tax_meta')) {
2148
-    function geodir_update_tax_meta($term_id, $key, $value, $post_type = '') {
2149
-        if (empty($post_type) && isset($_REQUEST['taxonomy'])) {
2150
-            $taxObject = get_taxonomy($_REQUEST['taxonomy']);
2148
+	function geodir_update_tax_meta($term_id, $key, $value, $post_type = '') {
2149
+		if (empty($post_type) && isset($_REQUEST['taxonomy'])) {
2150
+			$taxObject = get_taxonomy($_REQUEST['taxonomy']);
2151 2151
             
2152
-            if (!empty($taxObject->object_type)) {
2153
-                $post_type = $taxObject->object_type[0];
2154
-            }
2155
-        }
2156
-
2157
-        if ($post_type == 'post') {
2158
-            $post_type = '';
2159
-        }
2160
-        if ($post_type) {
2161
-            $post_type = $post_type . '_';
2162
-        }
2163
-
2164
-        $m = get_option('tax_meta_' . $post_type  . $term_id);
2165
-
2166
-        $m[$key] = $value;
2167
-        update_option('tax_meta_' . $post_type . $term_id, $m);
2168
-
2169
-        /** This action is documented in geodirectory-functions/cat-meta-functions/Tax-meta-class.php */
2170
-        do_action('gd_tax_meta_updated', false, true, $term_id, $post_type);
2171
-    }
2152
+			if (!empty($taxObject->object_type)) {
2153
+				$post_type = $taxObject->object_type[0];
2154
+			}
2155
+		}
2156
+
2157
+		if ($post_type == 'post') {
2158
+			$post_type = '';
2159
+		}
2160
+		if ($post_type) {
2161
+			$post_type = $post_type . '_';
2162
+		}
2163
+
2164
+		$m = get_option('tax_meta_' . $post_type  . $term_id);
2165
+
2166
+		$m[$key] = $value;
2167
+		update_option('tax_meta_' . $post_type . $term_id, $m);
2168
+
2169
+		/** This action is documented in geodirectory-functions/cat-meta-functions/Tax-meta-class.php */
2170
+		do_action('gd_tax_meta_updated', false, true, $term_id, $post_type);
2171
+	}
2172 2172
 }
2173 2173
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +93 added lines, -93 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
             $this->add_missed_values();
114 114
             if (isset($meta_box['use_with_theme']))
115 115
                 if ($meta_box['use_with_theme'] === true) {
116
-                    $this->SelfPath = get_stylesheet_directory_uri() . '/library/cat-meta';
116
+                    $this->SelfPath = get_stylesheet_directory_uri().'/library/cat-meta';
117 117
                 } elseif ($meta_box['use_with_theme'] === false) {
118 118
                     $this->SelfPath = plugins_url('cat-meta-functions', plugin_basename(dirname(__FILE__)));
119 119
                 } else {
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
                 $li = "<li id='item_{$attachment_id}'>";
263 263
                 $li .= "<img src='{$attachment['url']}' alt='image_{$attachment_id}' />";
264 264
                 //$li 	.= "<a title='" . __( 'Delete this image' ) . "' class='at-delete-file' href='#' rel='{$nonce}|{$term_id}|{$id}|{$attachment_id}'>" . __( 'Delete' ) . "</a>";
265
-                $li .= "<a title='" . __('Remove this image', 'geodirectory') . "' class='at-delete-file' href='#' rel='{$nonce}|{$term_id}|{$id}|{$attachment_id}'><img src='" . $this->SelfPath . "/images/delete-16.png' alt='" . __('Remove', 'geodirectory') . "' /></a>";
265
+                $li .= "<a title='".__('Remove this image', 'geodirectory')."' class='at-delete-file' href='#' rel='{$nonce}|{$term_id}|{$id}|{$attachment_id}'><img src='".$this->SelfPath."/images/delete-16.png' alt='".__('Remove', 'geodirectory')."' /></a>";
266 266
                 $li .= "<input type='hidden' name='{$id}[]' value='{$attachment_id}' />";
267 267
                 $li .= "</li>";
268 268
                 $html .= $li;
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
             $attachment_id = isset($_GET['attachment_id']) ? intval($_GET['attachment_id']) : 0;
336 336
             $ok = false;
337 337
             if (strpos($field_id, '[') === false) {
338
-                check_admin_referer("at-delete-mupload_" . urldecode($field_id));
338
+                check_admin_referer("at-delete-mupload_".urldecode($field_id));
339 339
                 if ($term_id > 0)
340 340
                     $this->delete_tax_meta($term_id, $field_id);
341 341
                 //$ok = wp_delete_attachment( $attachment_id );
@@ -423,8 +423,8 @@  discard block
 block discarded – undo
423 423
 
424 424
             if ($this->has_field('date') && $this->is_edit_page()) {
425 425
                 // Enqueu JQuery UI, use proper version.
426
-                wp_enqueue_style('tmc-jquery-ui-css', 'https://ajax.googleapis.com/ajax/libs/jqueryui/' . $this->get_jqueryui_ver() . '/themes/base/jquery-ui.css');
427
-                wp_enqueue_script('tmc-jquery-ui', 'https://ajax.googleapis.com/ajax/libs/jqueryui/' . $this->get_jqueryui_ver() . '/jquery-ui.min.js', array('jquery'));
426
+                wp_enqueue_style('tmc-jquery-ui-css', 'https://ajax.googleapis.com/ajax/libs/jqueryui/'.$this->get_jqueryui_ver().'/themes/base/jquery-ui.css');
427
+                wp_enqueue_script('tmc-jquery-ui', 'https://ajax.googleapis.com/ajax/libs/jqueryui/'.$this->get_jqueryui_ver().'/jquery-ui.min.js', array('jquery'));
428 428
             }
429 429
 
430 430
         }
@@ -441,8 +441,8 @@  discard block
 block discarded – undo
441 441
             if ($this->has_field('time') && $this->is_edit_page()) {
442 442
 
443 443
                 // Enqueu JQuery UI, use proper version.
444
-                wp_enqueue_style('tmc-jquery-ui-css', 'https://ajax.googleapis.com/ajax/libs/jqueryui/' . $this->get_jqueryui_ver() . '/themes/base/jquery-ui.css', array(), false, true);
445
-                wp_enqueue_script('tmc-jquery-ui', 'https://ajax.googleapis.com/ajax/libs/jqueryui/' . $this->get_jqueryui_ver() . '/jquery-ui.min.js', array('jquery'), false, true);
444
+                wp_enqueue_style('tmc-jquery-ui-css', 'https://ajax.googleapis.com/ajax/libs/jqueryui/'.$this->get_jqueryui_ver().'/themes/base/jquery-ui.css', array(), false, true);
445
+                wp_enqueue_script('tmc-jquery-ui', 'https://ajax.googleapis.com/ajax/libs/jqueryui/'.$this->get_jqueryui_ver().'/jquery-ui.min.js', array('jquery'), false, true);
446 446
                 wp_enqueue_script('at-timepicker', 'https://github.com/trentrichardson/jQuery-Timepicker-Addon/raw/master/jquery-ui-timepicker-addon.js', array('tmc-jquery-ui'), false, true);
447 447
 
448 448
             }
@@ -462,13 +462,13 @@  discard block
 block discarded – undo
462 462
             if (!empty($this->_meta_box['pages'])) {
463 463
                 foreach ($this->_meta_box['pages'] as $page) {
464 464
                     //add fields to edit form
465
-                    add_action($page . '_edit_form_fields', array(&$this, 'show_edit_form'));
465
+                    add_action($page.'_edit_form_fields', array(&$this, 'show_edit_form'));
466 466
                     //add fields to add new form
467
-                    add_action($page . '_add_form_fields', array(&$this, 'show_new_form'));
467
+                    add_action($page.'_add_form_fields', array(&$this, 'show_new_form'));
468 468
                     // this saves the edit fields
469
-                    add_action('edited_' . $page, array(&$this, 'save'), 10, 2);
469
+                    add_action('edited_'.$page, array(&$this, 'save'), 10, 2);
470 470
                     // this saves the add fields
471
-                    add_action('created_' . $page, array(&$this, 'save'), 10, 2);
471
+                    add_action('created_'.$page, array(&$this, 'save'), 10, 2);
472 472
                 }
473 473
             }
474 474
 
@@ -517,13 +517,13 @@  discard block
 block discarded – undo
517 517
                     $meta = is_array($meta) ? array_map('esc_attr', $meta) : esc_attr($meta);
518 518
 
519 519
                 if ($field['validate_func']) {
520
-                    echo '<tr class="form-field form-required ' . $field['style'] . '">';
520
+                    echo '<tr class="form-field form-required '.$field['style'].'">';
521 521
                 } else {
522
-                    echo '<tr class="form-field ' . $field['style'] . '">';
522
+                    echo '<tr class="form-field '.$field['style'].'">';
523 523
                 }
524 524
 
525 525
                 // Call Separated methods for displaying each type of field.
526
-                call_user_func(array(&$this, 'show_field_' . $field['type']), $field, $meta);
526
+                call_user_func(array(&$this, 'show_field_'.$field['type']), $field, $meta);
527 527
                 echo '</tr>';
528 528
             }
529 529
             echo '</table>';
@@ -550,14 +550,14 @@  discard block
 block discarded – undo
550 550
                 foreach ($meta as $me) {
551 551
                     //for labling toggles
552 552
                     $mmm = $me[$field['fields'][0]['id']];
553
-                    echo '<div class="at-repater-block">' . $mmm . '<br/><table class="repeater-table" style="display: none;">';
553
+                    echo '<div class="at-repater-block">'.$mmm.'<br/><table class="repeater-table" style="display: none;">';
554 554
                     if ($field['inline']) {
555 555
                         echo '<tr class="at-inline" VALIGN="top">';
556 556
                     }
557 557
                     foreach ($field['fields'] as $f) {
558 558
                         //reset var $id for repeater
559 559
                         $id = '';
560
-                        $id = $field['id'] . '[' . $c . '][' . $f['id'] . ']';
560
+                        $id = $field['id'].'['.$c.']['.$f['id'].']';
561 561
                         $m = $me[$f['id']];
562 562
                         $m = ($m !== '') ? $m : $f['std'];
563 563
                         if ('image' != $f['type'] && $f['type'] != 'repeater')
@@ -567,7 +567,7 @@  discard block
 block discarded – undo
567 567
                         if (!$field['inline']) {
568 568
                             echo '<tr>';
569 569
                         }
570
-                        call_user_func(array(&$this, 'show_field_' . $f['type']), $f, $m);
570
+                        call_user_func(array(&$this, 'show_field_'.$f['type']), $f, $m);
571 571
                         if (!$field['inline']) {
572 572
                             echo '</tr>';
573 573
                         }
@@ -578,18 +578,18 @@  discard block
 block discarded – undo
578 578
                     echo '</table>
579 579
 				<span class="at-re-toggle"><img src="';
580 580
                     if ($this->_Local_images) {
581
-                        echo $plugin_path . '/images/edit.png';
581
+                        echo $plugin_path.'/images/edit.png';
582 582
                     } else {
583 583
                         echo 'http://i.imgur.com/ka0E2.png';
584 584
                     }
585 585
                     echo '" alt="Edit" title="Edit"/></span> 
586 586
 				<img src="';
587 587
                     if ($this->_Local_images) {
588
-                        echo $plugin_path . '/images/remove.png';
588
+                        echo $plugin_path.'/images/remove.png';
589 589
                     } else {
590 590
                         echo 'http://i.imgur.com/g8Duj.png';
591 591
                     }
592
-                    echo '" alt="' . __('Remove', 'geodirectory') . '" title="' . __('Remove', 'geodirectory') . '" id="remove-' . $field['id'] . '"></div>';
592
+                    echo '" alt="'.__('Remove', 'geodirectory').'" title="'.__('Remove', 'geodirectory').'" id="remove-'.$field['id'].'"></div>';
593 593
                     $c = $c + 1;
594 594
 
595 595
                 }
@@ -598,11 +598,11 @@  discard block
 block discarded – undo
598 598
 
599 599
             echo '<img src="';
600 600
             if ($this->_Local_images) {
601
-                echo $plugin_path . '/images/add.png';
601
+                echo $plugin_path.'/images/add.png';
602 602
             } else {
603 603
                 echo 'http://i.imgur.com/w5Tuc.png';
604 604
             }
605
-            echo '" alt="' . __('Add', 'geodirectory') . '" title="' . __('Add', 'geodirectory') . '" id="add-' . $field['id'] . '"><br/></div>';
605
+            echo '" alt="'.__('Add', 'geodirectory').'" title="'.__('Add', 'geodirectory').'" id="add-'.$field['id'].'"><br/></div>';
606 606
 
607 607
             //create all fields once more for js function and catch with object buffer
608 608
             ob_start();
@@ -613,12 +613,12 @@  discard block
 block discarded – undo
613 613
             foreach ($field['fields'] as $f) {
614 614
                 //reset var $id for repeater
615 615
                 $id = '';
616
-                $id = $field['id'] . '[CurrentCounter][' . $f['id'] . ']';
616
+                $id = $field['id'].'[CurrentCounter]['.$f['id'].']';
617 617
                 $f['id'] = $id;
618 618
                 if (!$field['inline']) {
619 619
                     echo '<tr>';
620 620
                 }
621
-                call_user_func(array(&$this, 'show_field_' . $f['type']), $f, '');
621
+                call_user_func(array(&$this, 'show_field_'.$f['type']), $f, '');
622 622
                 if (!$field['inline']) {
623 623
                     echo '</tr>';
624 624
                 }
@@ -628,24 +628,24 @@  discard block
 block discarded – undo
628 628
             }
629 629
             echo '</table><img src="';
630 630
             if ($this->_Local_images) {
631
-                echo $plugin_path . '/images/remove.png';
631
+                echo $plugin_path.'/images/remove.png';
632 632
             } else {
633 633
                 echo 'http://i.imgur.com/g8Duj.png';
634 634
             }
635
-            echo '" alt="' . __('Remove', 'geodirectory') . '" title="' . __('Remove', 'geodirectory') . '" id="remove-' . $field['id'] . '"></div>';
636
-            $counter = 'countadd_' . $field['id'];
635
+            echo '" alt="'.__('Remove', 'geodirectory').'" title="'.__('Remove', 'geodirectory').'" id="remove-'.$field['id'].'"></div>';
636
+            $counter = 'countadd_'.$field['id'];
637 637
             $js_code = ob_get_clean();
638 638
             $js_code = str_replace("'", "\"", $js_code);
639
-            $js_code = str_replace("CurrentCounter", "' + " . $counter . " + '", $js_code);
639
+            $js_code = str_replace("CurrentCounter", "' + ".$counter." + '", $js_code);
640 640
             echo '<script>
641 641
 				jQuery(document).ready(function() {
642
-					var ' . $counter . ' = ' . $c . ';
643
-					jQuery("#add-' . $field['id'] . '").live(\'click\', function() {
644
-						' . $counter . ' = ' . $counter . ' + 1;
645
-						jQuery(this).before(\'' . $js_code . '\');						
642
+					var ' . $counter.' = '.$c.';
643
+					jQuery("#add-' . $field['id'].'").live(\'click\', function() {
644
+						' . $counter.' = '.$counter.' + 1;
645
+						jQuery(this).before(\'' . $js_code.'\');						
646 646
 						update_repeater_fields();
647 647
 					});
648
-        			jQuery("#remove-' . $field['id'] . '").live(\'click\', function() {
648
+        			jQuery("#remove-' . $field['id'].'").live(\'click\', function() {
649 649
             			jQuery(this).parent().remove();
650 650
         			});
651 651
     			});
@@ -772,7 +772,7 @@  discard block
 block discarded – undo
772 772
         public function show_field_paragraph($field)
773 773
         {
774 774
             //$this->show_field_begin( $field, $meta );
775
-            echo '<p>' . $field['value'] . '</p>';
775
+            echo '<p>'.$field['value'].'</p>';
776 776
             //$this->show_field_end( $field, $meta );
777 777
         }
778 778
 
@@ -803,12 +803,12 @@  discard block
 block discarded – undo
803 803
         {
804 804
 
805 805
             if (!is_array($meta))
806
-                $meta = (array)$meta;
806
+                $meta = (array) $meta;
807 807
 
808 808
             $this->show_field_begin($field, $meta);
809
-            echo "<select class='at-select' name='{$field['id']}" . ($field['multiple'] ? "[]' id='{$field['id']}' multiple='multiple'" : "'") . ">";
809
+            echo "<select class='at-select' name='{$field['id']}".($field['multiple'] ? "[]' id='{$field['id']}' multiple='multiple'" : "'").">";
810 810
             foreach ($field['options'] as $key => $value) {
811
-                echo "<option value='{$key}'" . selected(in_array($key, $meta), true, false) . ">{$value}</option>";
811
+                echo "<option value='{$key}'".selected(in_array($key, $meta), true, false).">{$value}</option>";
812 812
             }
813 813
             echo "</select>";
814 814
             $this->show_field_end($field, $meta);
@@ -827,11 +827,11 @@  discard block
 block discarded – undo
827 827
         {
828 828
 
829 829
             if (!is_array($meta))
830
-                $meta = (array)$meta;
830
+                $meta = (array) $meta;
831 831
 
832 832
             $this->show_field_begin($field, $meta);
833 833
             foreach ($field['options'] as $key => $value) {
834
-                echo "<input type='radio' class='at-radio' name='{$field['id']}' value='{$key}'" . checked(in_array($key, $meta), true, false) . " /> <span class='at-radio-label'>{$value}</span>";
834
+                echo "<input type='radio' class='at-radio' name='{$field['id']}' value='{$key}'".checked(in_array($key, $meta), true, false)." /> <span class='at-radio-label'>{$value}</span>";
835 835
             }
836 836
             $this->show_field_end($field, $meta);
837 837
         }
@@ -848,7 +848,7 @@  discard block
 block discarded – undo
848 848
         {
849 849
 
850 850
             $this->show_field_begin($field, $meta);
851
-            echo "<input type='checkbox' class='rw-checkbox' name='{$field['id']}' id='{$field['id']}'" . checked(!empty($meta), true, false) . " /> {$field['desc']}";
851
+            echo "<input type='checkbox' class='rw-checkbox' name='{$field['id']}' id='{$field['id']}'".checked(!empty($meta), true, false)." /> {$field['desc']}";
852 852
             $this->show_field_end($field, $meta);
853 853
         }
854 854
 
@@ -890,18 +890,18 @@  discard block
 block discarded – undo
890 890
             global $post;
891 891
 
892 892
             if (!is_array($meta))
893
-                $meta = (array)$meta;
893
+                $meta = (array) $meta;
894 894
 
895 895
             $this->show_field_begin($field, $meta);
896 896
             echo "{$field['desc']}<br />";
897 897
 
898 898
             if (!empty($meta)) {
899 899
                 $nonce = wp_create_nonce('at_ajax_delete');
900
-                echo '<div style="margin-bottom: 10px"><strong>' . __('Uploaded files', 'geodirectory') . '</strong></div>';
900
+                echo '<div style="margin-bottom: 10px"><strong>'.__('Uploaded files', 'geodirectory').'</strong></div>';
901 901
                 echo '<ol class="at-upload">';
902 902
                 foreach ($meta as $att) {
903 903
                     // if (wp_attachment_is_image($att)) continue; // what's image uploader for?
904
-                    echo "<li>" . wp_get_attachment_link($att, '', false, false, ' ') . " (<a class='at-delete-file' href='#' rel='{$nonce}|{$post->ID}|{$field['id']}|{$att}'>" . __('Remove', 'geodirectory') . "</a>)</li>";
904
+                    echo "<li>".wp_get_attachment_link($att, '', false, false, ' ')." (<a class='at-delete-file' href='#' rel='{$nonce}|{$post->ID}|{$field['id']}|{$att}'>".__('Remove', 'geodirectory')."</a>)</li>";
905 905
                 }
906 906
                 echo '</ol>';
907 907
             }
@@ -909,13 +909,13 @@  discard block
 block discarded – undo
909 909
             // show form upload
910 910
 
911 911
             echo "<div class='at-file-upload-label'>";
912
-            echo "<strong>" . __('Upload new files', 'geodirectory') . "</strong>";
912
+            echo "<strong>".__('Upload new files', 'geodirectory')."</strong>";
913 913
             echo "</div>";
914 914
             echo "<div class='new-files'>";
915 915
             echo "<div class='file-input'>";
916 916
             echo "<input type='file' name='{$field['id']}[]' />";
917 917
             echo "</div><!-- End .file-input -->";
918
-            echo "<a class='at-add-file button' href='#'>" . __('Add more files', 'geodirectory') . "</a>";
918
+            echo "<a class='at-add-file button' href='#'>".__('Add more files', 'geodirectory')."</a>";
919 919
             echo "</div><!-- End .new-files -->";
920 920
             echo "</td>";
921 921
             $this->show_field_end($field, $meta);
@@ -932,7 +932,7 @@  discard block
 block discarded – undo
932 932
         public function show_field_image($field, $meta)
933 933
         {
934 934
             $this->show_field_begin($field, $meta);
935
-            $html = wp_nonce_field("at-delete-mupload_{$field['id']}", "nonce-delete-mupload_" . $field['id'], false, false);
935
+            $html = wp_nonce_field("at-delete-mupload_{$field['id']}", "nonce-delete-mupload_".$field['id'], false, false);
936 936
             if (is_array($meta)) {
937 937
                 if (isset($meta[0]) && is_array($meta[0]))
938 938
                     $meta = $meta[0];
@@ -958,19 +958,19 @@  discard block
 block discarded – undo
958 958
                 }
959 959
                 $sub_dir = str_replace($uploads['baseurl'], '', $sub_dir);
960 960
 
961
-                $uploads_url = $uploads_baseurl . $sub_dir;
961
+                $uploads_url = $uploads_baseurl.$sub_dir;
962 962
 
963
-                $meta['src'] = $uploads_url . '/' . $file_name;
963
+                $meta['src'] = $uploads_url.'/'.$file_name;
964 964
 
965
-                $html .= "<span class='mupload_img_holder'><img src='" . $meta['src'] . "' style='max-height: 150px;max-width: 150px;' /></span>";
966
-                $html .= "<input type='hidden' name='" . $field['id'] . "[id]' id='" . $field['id'] . "[id]' value='" . $meta['id'] . "' />";
967
-                $html .= "<input type='hidden' class='" . $field['id'] . "[src]' name='" . $field['id'] . "[src]' id='" . $field['id'] . "[src]' value='" . $meta['src'] . "' />";
968
-                $html .= "<input class='at-delete_image_button' type='button' rel='" . $field['id'] . "' value='" . __('Remove Image', 'geodirectory') . "' />";
965
+                $html .= "<span class='mupload_img_holder'><img src='".$meta['src']."' style='max-height: 150px;max-width: 150px;' /></span>";
966
+                $html .= "<input type='hidden' name='".$field['id']."[id]' id='".$field['id']."[id]' value='".$meta['id']."' />";
967
+                $html .= "<input type='hidden' class='".$field['id']."[src]' name='".$field['id']."[src]' id='".$field['id']."[src]' value='".$meta['src']."' />";
968
+                $html .= "<input class='at-delete_image_button' type='button' rel='".$field['id']."' value='".__('Remove Image', 'geodirectory')."' />";
969 969
             } else {
970 970
                 $html .= "<span class='mupload_img_holder'></span>";
971
-                $html .= "<input type='hidden' name='" . $field['id'] . "[id]' id='" . $field['id'] . "[id]' value='' />";
972
-                $html .= "<input class='" . $field['id'] . "[src]' style='position:absolute;left:-500px;width:50px;' type='text' name='" . $field['id'] . "[src]' id='" . $field['id'] . "[src]' value='' />";
973
-                $html .= "<input class='at-upload_image_button' type='button' rel='" . $field['id'] . "' value='" . __('Upload Image', 'geodirectory') . "' />";
971
+                $html .= "<input type='hidden' name='".$field['id']."[id]' id='".$field['id']."[id]' value='' />";
972
+                $html .= "<input class='".$field['id']."[src]' style='position:absolute;left:-500px;width:50px;' type='text' name='".$field['id']."[src]' id='".$field['id']."[src]' value='' />";
973
+                $html .= "<input class='at-upload_image_button' type='button' rel='".$field['id']."' value='".__('Upload Image', 'geodirectory')."' />";
974 974
             }
975 975
             echo $html;
976 976
             $this->show_field_end($field, $meta);
@@ -994,7 +994,7 @@  discard block
 block discarded – undo
994 994
 
995 995
             echo "<input class='at-color' type='text' name='{$field['id']}' id='{$field['id']}' value='{$meta}' size='8' />";
996 996
             //	echo "<a href='#' class='at-color-select button' rel='{$field['id']}'>" . __( 'Select a color' ) . "</a>";
997
-            echo "<input type='button' class='at-color-select button' rel='{$field['id']}' value='" . __('Select a color', 'geodirectory') . "'/>";
997
+            echo "<input type='button' class='at-color-select button' rel='{$field['id']}' value='".__('Select a color', 'geodirectory')."'/>";
998 998
             echo "<div style='display:none' class='at-color-picker' rel='{$field['id']}'></div>";
999 999
             $this->show_field_end($field, $meta);
1000 1000
 
@@ -1012,14 +1012,14 @@  discard block
 block discarded – undo
1012 1012
         {
1013 1013
 
1014 1014
             if (!is_array($meta))
1015
-                $meta = (array)$meta;
1015
+                $meta = (array) $meta;
1016 1016
 
1017 1017
             $this->show_field_begin($field, $meta);
1018 1018
 
1019 1019
             $html = array();
1020 1020
 
1021 1021
             foreach ($field['options'] as $key => $value) {
1022
-                $html[] = "<input type='checkbox' class='at-checkbox_list' name='{$field['id']}[]' value='{$key}'" . checked(in_array($key, $meta), true, false) . " /> {$value}";
1022
+                $html[] = "<input type='checkbox' class='at-checkbox_list' name='{$field['id']}[]' value='{$key}'".checked(in_array($key, $meta), true, false)." /> {$value}";
1023 1023
             }
1024 1024
 
1025 1025
             echo implode('<br />', $html);
@@ -1072,7 +1072,7 @@  discard block
 block discarded – undo
1072 1072
         {
1073 1073
             global $post;
1074 1074
 
1075
-            if (!is_array($meta)) $meta = (array)$meta;
1075
+            if (!is_array($meta)) $meta = (array) $meta;
1076 1076
             $this->show_field_begin($field, $meta);
1077 1077
             $options = $field['options'];
1078 1078
             $posts = get_posts($options['args']);
@@ -1080,13 +1080,13 @@  discard block
 block discarded – undo
1080 1080
             // checkbox_list
1081 1081
             if ('checkbox_list' == $options['type']) {
1082 1082
                 foreach ($posts as $p) {
1083
-                    echo "<input type='checkbox' name='{$field['id']}[]' value='$p->ID'" . checked(in_array($p->ID, $meta), true, false) . " /> $p->post_title<br/>";
1083
+                    echo "<input type='checkbox' name='{$field['id']}[]' value='$p->ID'".checked(in_array($p->ID, $meta), true, false)." /> $p->post_title<br/>";
1084 1084
                 }
1085 1085
             } // select
1086 1086
             else {
1087
-                echo "<select name='{$field['id']}" . ($field['multiple'] ? "[]' multiple='multiple' style='height:auto'" : "'") . ">";
1087
+                echo "<select name='{$field['id']}".($field['multiple'] ? "[]' multiple='multiple' style='height:auto'" : "'").">";
1088 1088
                 foreach ($posts as $p) {
1089
-                    echo "<option value='$p->ID'" . selected(in_array($p->ID, $meta), true, false) . ">$p->post_title</option>";
1089
+                    echo "<option value='$p->ID'".selected(in_array($p->ID, $meta), true, false).">$p->post_title</option>";
1090 1090
                 }
1091 1091
                 echo "</select>";
1092 1092
             }
@@ -1110,7 +1110,7 @@  discard block
 block discarded – undo
1110 1110
         {
1111 1111
             global $post;
1112 1112
 
1113
-            if (!is_array($meta)) $meta = (array)$meta;
1113
+            if (!is_array($meta)) $meta = (array) $meta;
1114 1114
             $this->show_field_begin($field, $meta);
1115 1115
             $options = $field['options'];
1116 1116
             $terms = get_terms($options['taxonomy'], $options['args']);
@@ -1118,13 +1118,13 @@  discard block
 block discarded – undo
1118 1118
             // checkbox_list
1119 1119
             if ('checkbox_list' == $options['type']) {
1120 1120
                 foreach ($terms as $term) {
1121
-                    echo "<input type='checkbox' name='{$field['id']}[]' value='$term->slug'" . checked(in_array($term->slug, $meta), true, false) . " /> $term->name<br/>";
1121
+                    echo "<input type='checkbox' name='{$field['id']}[]' value='$term->slug'".checked(in_array($term->slug, $meta), true, false)." /> $term->name<br/>";
1122 1122
                 }
1123 1123
             } // select
1124 1124
             else {
1125
-                echo "<select name='{$field['id']}" . ($field['multiple'] ? "[]' multiple='multiple' style='height:auto'" : "'") . ">";
1125
+                echo "<select name='{$field['id']}".($field['multiple'] ? "[]' multiple='multiple' style='height:auto'" : "'").">";
1126 1126
                 foreach ($terms as $term) {
1127
-                    echo "<option value='$term->slug'" . selected(in_array($term->slug, $meta), true, false) . ">$term->name</option>";
1127
+                    echo "<option value='$term->slug'".selected(in_array($term->slug, $meta), true, false).">$term->name</option>";
1128 1128
                 }
1129 1129
                 echo "</select>";
1130 1130
             }
@@ -1180,7 +1180,7 @@  discard block
 block discarded – undo
1180 1180
 
1181 1181
                     //$old_filename = $upload_dir['path'].'/'.$old_filename;
1182 1182
 
1183
-                    $new_filename = $upload_dir['path'] . '/' . 'cat_icon_' . $term_id . '.png';
1183
+                    $new_filename = $upload_dir['path'].'/'.'cat_icon_'.$term_id.'.png';
1184 1184
 
1185 1185
                     /*rename($old_filename, $new_filename);
1186 1186
 				
@@ -1222,9 +1222,9 @@  discard block
 block discarded – undo
1222 1222
                 if ($type != "paragraph") {
1223 1223
 
1224 1224
                     // Call defined method to save meta value, if there's no methods, call common one.
1225
-                    $save_func = 'save_field_' . $type;
1225
+                    $save_func = 'save_field_'.$type;
1226 1226
                     if (method_exists($this, $save_func)) {
1227
-                        call_user_func(array(&$this, 'save_field_' . $type), $term_id, $field, $old, $new);
1227
+                        call_user_func(array(&$this, 'save_field_'.$type), $term_id, $field, $old, $new);
1228 1228
                     } else {
1229 1229
                         $this->save_field($term_id, $field, $old, $new);
1230 1230
                     }
@@ -1369,7 +1369,7 @@  discard block
 block discarded – undo
1369 1369
                 if (!is_wp_error($id)) {
1370 1370
 
1371 1371
                     wp_update_attachment_metadata($id, wp_generate_attachment_metadata($id, $filename));
1372
-                    add_post_meta($term_id, $name, $id, false);    // save file's url in meta fields
1372
+                    add_post_meta($term_id, $name, $id, false); // save file's url in meta fields
1373 1373
 
1374 1374
                 } // End if
1375 1375
 
@@ -1414,7 +1414,7 @@  discard block
 block discarded – undo
1414 1414
                 if (!is_wp_error($id)) {
1415 1415
 
1416 1416
                     wp_update_attachment_metadata($id, wp_generate_attachment_metadata($id, $filename));
1417
-                    return $id;    // return file's url in meta fields
1417
+                    return $id; // return file's url in meta fields
1418 1418
                 } // End if
1419 1419
             } // End foreach
1420 1420
         }
@@ -1429,9 +1429,9 @@  discard block
 block discarded – undo
1429 1429
         {
1430 1430
 
1431 1431
             // Default values for meta box
1432
-            $this->_meta_box = array_merge(array('context' => 'normal', 'priority' => 'high', 'pages' => array('post')), (array)$this->_meta_box);
1432
+            $this->_meta_box = array_merge(array('context' => 'normal', 'priority' => 'high', 'pages' => array('post')), (array) $this->_meta_box);
1433 1433
 
1434
-            if(is_array($this->_fields)) {
1434
+            if (is_array($this->_fields)) {
1435 1435
                 // Default values for fields
1436 1436
                 foreach ($this->_fields as &$field) {
1437 1437
                     $multiple = in_array($field['type'], array('checkbox_list', 'file', 'image'));
@@ -1451,7 +1451,7 @@  discard block
 block discarded – undo
1451 1451
          */
1452 1452
         public function has_field($type)
1453 1453
         {
1454
-            if(is_array($this->_fields)) {
1454
+            if (is_array($this->_fields)) {
1455 1455
                 foreach ($this->_fields as $field) {
1456 1456
                     if ($type == $field['type'])
1457 1457
                         return true;
@@ -2019,12 +2019,12 @@  discard block
 block discarded – undo
2019 2019
                 $post_type = $taxObject->object_type[0];
2020 2020
             }
2021 2021
 
2022
-            if($post_type=='post'){$post_type='';}
2023
-            if($post_type){$post_type = $post_type.'_';}
2022
+            if ($post_type == 'post') {$post_type = ''; }
2023
+            if ($post_type) {$post_type = $post_type.'_'; }
2024 2024
 
2025 2025
             $t_id = (is_object($term_id)) ? $term_id->term_id : $term_id;
2026 2026
 
2027
-            $m = get_option('tax_meta_' . $post_type  . $t_id);
2027
+            $m = get_option('tax_meta_'.$post_type.$t_id);
2028 2028
             if (isset($m[$key])) {
2029 2029
                 return $m[$key];
2030 2030
             } else {
@@ -2041,15 +2041,15 @@  discard block
 block discarded – undo
2041 2041
                 $post_type = $taxObject->object_type[0];
2042 2042
             }
2043 2043
 
2044
-            if($post_type=='post'){$post_type='';}
2045
-            if($post_type){$post_type = $post_type.'_';}
2044
+            if ($post_type == 'post') {$post_type = ''; }
2045
+            if ($post_type) {$post_type = $post_type.'_'; }
2046 2046
 
2047
-            $m = get_option('tax_meta_' . $post_type  . $term_id);
2047
+            $m = get_option('tax_meta_'.$post_type.$term_id);
2048 2048
 
2049 2049
             if (isset($m[$key])) {
2050 2050
                 unset($m[$key]);
2051 2051
             }
2052
-            update_option('tax_meta_' . $post_type  . $term_id, $m);
2052
+            update_option('tax_meta_'.$post_type.$term_id, $m);
2053 2053
         }
2054 2054
 
2055 2055
         //update meta
@@ -2061,13 +2061,13 @@  discard block
 block discarded – undo
2061 2061
                 $post_type = $taxObject->object_type[0];
2062 2062
             }
2063 2063
 
2064
-            if($post_type=='post'){$post_type='';}
2065
-            if($post_type){$post_type = $post_type.'_';}
2064
+            if ($post_type == 'post') {$post_type = ''; }
2065
+            if ($post_type) {$post_type = $post_type.'_'; }
2066 2066
 
2067
-            $m = get_option('tax_meta_' . $post_type  . $term_id);
2067
+            $m = get_option('tax_meta_'.$post_type.$term_id);
2068 2068
 
2069 2069
             $m[$key] = $value;
2070
-            update_option('tax_meta_' . $post_type  . $term_id, $m);
2070
+            update_option('tax_meta_'.$post_type.$term_id, $m);
2071 2071
 
2072 2072
             /**
2073 2073
              * Called after the tax meta is updated.
@@ -2107,12 +2107,12 @@  discard block
 block discarded – undo
2107 2107
             $post_type = '';
2108 2108
         }
2109 2109
         if ($post_type) {
2110
-            $post_type = $post_type . '_';
2110
+            $post_type = $post_type.'_';
2111 2111
         }
2112 2112
 
2113 2113
         $t_id = (is_object($term_id)) ? $term_id->term_id : $term_id;
2114 2114
 
2115
-        $m = get_option('tax_meta_' . $post_type  . $t_id);
2115
+        $m = get_option('tax_meta_'.$post_type.$t_id);
2116 2116
         if (isset($m[$key])) {
2117 2117
             return $m[$key];
2118 2118
         } else {
@@ -2131,15 +2131,15 @@  discard block
 block discarded – undo
2131 2131
             $post_type = '';
2132 2132
         }
2133 2133
         if ($post_type) {
2134
-            $post_type = $post_type . '_';
2134
+            $post_type = $post_type.'_';
2135 2135
         }
2136 2136
 
2137
-        $m = get_option('tax_meta_' . $post_type . $term_id);
2137
+        $m = get_option('tax_meta_'.$post_type.$term_id);
2138 2138
 
2139 2139
         if (isset($m[$key])) {
2140 2140
             unset($m[$key]);
2141 2141
         }
2142
-        update_option('tax_meta_' . $post_type  . $term_id, $m);
2142
+        update_option('tax_meta_'.$post_type.$term_id, $m);
2143 2143
     }
2144 2144
 }
2145 2145
 
@@ -2158,13 +2158,13 @@  discard block
 block discarded – undo
2158 2158
             $post_type = '';
2159 2159
         }
2160 2160
         if ($post_type) {
2161
-            $post_type = $post_type . '_';
2161
+            $post_type = $post_type.'_';
2162 2162
         }
2163 2163
 
2164
-        $m = get_option('tax_meta_' . $post_type  . $term_id);
2164
+        $m = get_option('tax_meta_'.$post_type.$term_id);
2165 2165
 
2166 2166
         $m[$key] = $value;
2167
-        update_option('tax_meta_' . $post_type . $term_id, $m);
2167
+        update_option('tax_meta_'.$post_type.$term_id, $m);
2168 2168
 
2169 2169
         /** This action is documented in geodirectory-functions/cat-meta-functions/Tax-meta-class.php */
2170 2170
         do_action('gd_tax_meta_updated', false, true, $term_id, $post_type);
Please login to merge, or discard this patch.
Doc Comments   +18 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1689,7 +1689,7 @@  discard block
 block discarded – undo
1689 1689
          * @author Ohad Raz
1690 1690
          * @since 1.0
1691 1691
          * @access public
1692
-         * @param $id string field id, i.e. the meta key
1692
+         * @param string $id string field id, i.e. the meta key
1693 1693
          * @param $options (array)  array of key => value pairs for select options
1694 1694
          * @param $args mixed|array
1695 1695
          *    'name' => // field name/label string optional
@@ -1815,7 +1815,7 @@  discard block
 block discarded – undo
1815 1815
          * @author Ohad Raz
1816 1816
          * @since 1.0
1817 1817
          * @access public
1818
-         * @param $id string  field id, i.e. the meta key
1818
+         * @param string $id string  field id, i.e. the meta key
1819 1819
          * @param $args mixed|array
1820 1820
          *    'name' => // field name/label string optional
1821 1821
          *    'desc' => // field description, string optional
@@ -1862,7 +1862,7 @@  discard block
 block discarded – undo
1862 1862
          * @author Ohad Raz
1863 1863
          * @since 1.0
1864 1864
          * @access public
1865
-         * @param $id string  field id, i.e. the meta key
1865
+         * @param string $id string  field id, i.e. the meta key
1866 1866
          * @param $args mixed|array
1867 1867
          *    'name' => // field name/label string optional
1868 1868
          *    'desc' => // field description, string optional
@@ -2053,6 +2053,11 @@  discard block
 block discarded – undo
2053 2053
         }
2054 2054
 
2055 2055
         //update meta
2056
+
2057
+        /**
2058
+         * @param string $term_id
2059
+         * @param string $key
2060
+         */
2056 2061
         public function update_tax_meta($term_id, $key, $value, $post_type = '')
2057 2062
         {
2058 2063
 
@@ -2094,6 +2099,12 @@  discard block
 block discarded – undo
2094 2099
 
2095 2100
 //get term meta field
2096 2101
 if (!function_exists('geodir_get_tax_meta')) {
2102
+
2103
+    /**
2104
+     * @param string $key
2105
+     *
2106
+     * @return string
2107
+     */
2097 2108
     function geodir_get_tax_meta($term_id, $key, $multi = false, $post_type = '') {
2098 2109
         if (empty($post_type) && isset($_REQUEST['taxonomy'])) {
2099 2110
             $taxObject = get_taxonomy($_REQUEST['taxonomy']);
@@ -2145,6 +2156,10 @@  discard block
 block discarded – undo
2145 2156
 
2146 2157
 //update meta
2147 2158
 if (!function_exists('geodir_update_tax_meta')) {
2159
+
2160
+    /**
2161
+     * @param string $key
2162
+     */
2148 2163
     function geodir_update_tax_meta($term_id, $key, $value, $post_type = '') {
2149 2164
         if (empty($post_type) && isset($_REQUEST['taxonomy'])) {
2150 2165
             $taxObject = get_taxonomy($_REQUEST['taxonomy']);
Please login to merge, or discard this patch.
geodirectory_template_actions.php 3 patches
Braces   +31 added lines, -24 removed lines patch added patch discarded remove patch
@@ -715,8 +715,9 @@  discard block
 block discarded – undo
715 715
 
716 716
                         if (isset($post->post_default_category) && $post->post_default_category == $cat_id) {
717 717
                             if ($term_icon_url = geodir_get_tax_meta($cat_id, 'ct_cat_icon', false, $post_type)) {
718
-                                if (isset($term_icon_url['src']) && $term_icon_url['src'] != '')
719
-                                    $term_icon = $term_icon_url['src'];
718
+                                if (isset($term_icon_url['src']) && $term_icon_url['src'] != '') {
719
+                                                                    $term_icon = $term_icon_url['src'];
720
+                                }
720 721
                                 break;
721 722
                             }
722 723
                         }
@@ -1265,8 +1266,9 @@  discard block
 block discarded – undo
1265 1266
         echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>';
1266 1267
     }
1267 1268
 
1268
-    if (isset($taxonomies[$post_type . '_tags']))
1269
-        echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>';
1269
+    if (isset($taxonomies[$post_type . '_tags'])) {
1270
+            echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>';
1271
+    }
1270 1272
 
1271 1273
     ?>
1272 1274
     </p><?php
@@ -1634,23 +1636,21 @@  discard block
 block discarded – undo
1634 1636
     if(geodir_is_page('pt')){
1635 1637
         $gd_page = 'pt';
1636 1638
         $title  = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1637
-    }
1638
-    elseif(geodir_is_page('listing')){
1639
+    } elseif(geodir_is_page('listing')){
1639 1640
         $gd_page = 'listing';
1640 1641
         global $wp_query;
1641 1642
         $current_term = $wp_query->get_queried_object();
1642 1643
         if (strpos($current_term->taxonomy,'_tags') !== false) {
1643 1644
             $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
1644
-        }else{
1645
+        } else{
1645 1646
             $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
1646 1647
         }
1647 1648
 
1648
-    }
1649
-    elseif(geodir_is_page('author')){
1649
+    } elseif(geodir_is_page('author')){
1650 1650
         $gd_page = 'author';
1651 1651
         if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
1652 1652
             $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
1653
-        }else{
1653
+        } else{
1654 1654
             $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
1655 1655
         }
1656 1656
 
@@ -2074,8 +2074,9 @@  discard block
 block discarded – undo
2074 2074
  */
2075 2075
 function geodir_action_add_listing_page_title()
2076 2076
 {
2077
-    if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '')
2078
-        $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2077
+    if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '') {
2078
+            $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2079
+    }
2079 2080
     /** This action is documented in geodirectory_template_actions.php */
2080 2081
     $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2081 2082
     /** This action is documented in geodirectory_template_actions.php */
@@ -2087,7 +2088,7 @@  discard block
 block discarded – undo
2087 2088
         $gd_page = 'add-listing';
2088 2089
         if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
2089 2090
             $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
2090
-        }elseif(isset($listing_type)){
2091
+        } elseif(isset($listing_type)){
2091 2092
             $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
2092 2093
         }
2093 2094
 
@@ -2406,8 +2407,9 @@  discard block
 block discarded – undo
2406 2407
         $totImg = 0;
2407 2408
         if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2408 2409
             $post = (object)$gd_session->get('listing');
2409
-            if (isset($post->post_images))
2410
-                $curImages = trim($post->post_images, ",");
2410
+            if (isset($post->post_images)) {
2411
+                            $curImages = trim($post->post_images, ",");
2412
+            }
2411 2413
 
2412 2414
 
2413 2415
             if ($curImages != '') {
@@ -2435,10 +2437,13 @@  discard block
 block discarded – undo
2435 2437
             $totImg = count((array)$thumb_img_arr);
2436 2438
         }
2437 2439
 
2438
-        if ($curImages != '')
2439
-            $svalue = $curImages; // this will be initial value of the above form field. Image urls.
2440
-        else
2441
-            $svalue = '';
2440
+        if ($curImages != '') {
2441
+                    $svalue = $curImages;
2442
+        }
2443
+        // this will be initial value of the above form field. Image urls.
2444
+        else {
2445
+                    $svalue = '';
2446
+        }
2442 2447
 
2443 2448
         $image_limit = isset($package_info->image_limit) ? $package_info->image_limit : '0';
2444 2449
         $show_image_input_box = ($image_limit != '0');
@@ -2650,8 +2655,9 @@  discard block
 block discarded – undo
2650 2655
     </script><?php
2651 2656
 
2652 2657
     global $errors;
2653
-    if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim')
2654
-        $errors->add('claim_login', LOGIN_CLAIM);
2658
+    if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim') {
2659
+            $errors->add('claim_login', LOGIN_CLAIM);
2660
+    }
2655 2661
 
2656 2662
     if (!empty($errors)) {
2657 2663
         foreach ($errors as $errorsObj) {
@@ -2758,8 +2764,9 @@  discard block
 block discarded – undo
2758 2764
 
2759 2765
     if (!empty($term)) {
2760 2766
         $current_term = get_term_by('slug', $term, $taxonomy[0]);
2761
-        if (!empty($current_term))
2762
-            $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2767
+        if (!empty($current_term)) {
2768
+                    $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2769
+        }
2763 2770
     }
2764 2771
 
2765 2772
 
@@ -2777,7 +2784,7 @@  discard block
 block discarded – undo
2777 2784
         $gd_page = 'author';
2778 2785
         if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2779 2786
             $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2780
-        }else{
2787
+        } else{
2781 2788
             $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2782 2789
         }
2783 2790
 
Please login to merge, or discard this patch.
Indentation   +1852 added lines, -1852 removed lines patch added patch discarded remove patch
@@ -17,10 +17,10 @@  discard block
 block discarded – undo
17 17
  */
18 18
 function gd_compat_styles()
19 19
 {
20
-    $tc = get_option('theme_compatibility_setting');
21
-    echo "<style id='gd-compat-styles' type='text/css'>";
22
-    echo $tc['geodir_theme_compat_css'];
23
-    echo "</style>";
20
+	$tc = get_option('theme_compatibility_setting');
21
+	echo "<style id='gd-compat-styles' type='text/css'>";
22
+	echo $tc['geodir_theme_compat_css'];
23
+	echo "</style>";
24 24
 }
25 25
 
26 26
 /**
@@ -31,10 +31,10 @@  discard block
 block discarded – undo
31 31
  */
32 32
 function gd_compat_script()
33 33
 {
34
-    $tc = get_option('theme_compatibility_setting');
35
-    echo "<script>";
36
-    echo $tc['geodir_theme_compat_js'];
37
-    echo " </script>";
34
+	$tc = get_option('theme_compatibility_setting');
35
+	echo "<script>";
36
+	echo $tc['geodir_theme_compat_js'];
37
+	echo " </script>";
38 38
 }
39 39
 
40 40
 /**
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
  */
48 48
 function geodir_top_content_add_dynamic()
49 49
 {
50
-    $tc = get_option('theme_compatibility_setting');
51
-    echo $tc['geodir_top_content_add'];
50
+	$tc = get_option('theme_compatibility_setting');
51
+	echo $tc['geodir_top_content_add'];
52 52
 }
53 53
 
54 54
 /**
@@ -61,8 +61,8 @@  discard block
 block discarded – undo
61 61
  */
62 62
 function geodir_before_main_content_add_dynamic()
63 63
 {
64
-    $tc = get_option('theme_compatibility_setting');
65
-    echo $tc['geodir_before_main_content_add'];
64
+	$tc = get_option('theme_compatibility_setting');
65
+	echo $tc['geodir_before_main_content_add'];
66 66
 }
67 67
 
68 68
 /**
@@ -75,8 +75,8 @@  discard block
 block discarded – undo
75 75
  */
76 76
 function geodir_full_page_class_dynamic()
77 77
 {
78
-    $tc = get_option('theme_compatibility_setting');
79
-    return $tc['geodir_full_page_class_filter'];
78
+	$tc = get_option('theme_compatibility_setting');
79
+	return $tc['geodir_full_page_class_filter'];
80 80
 }
81 81
 
82 82
 /**
@@ -89,8 +89,8 @@  discard block
 block discarded – undo
89 89
  */
90 90
 function geodir_before_widget_dynamic()
91 91
 {
92
-    $tc = get_option('theme_compatibility_setting');
93
-    return $tc['geodir_before_widget_filter'];
92
+	$tc = get_option('theme_compatibility_setting');
93
+	return $tc['geodir_before_widget_filter'];
94 94
 }
95 95
 
96 96
 /**
@@ -103,8 +103,8 @@  discard block
 block discarded – undo
103 103
  */
104 104
 function geodir_after_widget_dynamic()
105 105
 {
106
-    $tc = get_option('theme_compatibility_setting');
107
-    return $tc['geodir_after_widget_filter'];
106
+	$tc = get_option('theme_compatibility_setting');
107
+	return $tc['geodir_after_widget_filter'];
108 108
 }
109 109
 
110 110
 /**
@@ -117,8 +117,8 @@  discard block
 block discarded – undo
117 117
  */
118 118
 function geodir_before_title_dynamic()
119 119
 {
120
-    $tc = get_option('theme_compatibility_setting');
121
-    return $tc['geodir_before_title_filter'];
120
+	$tc = get_option('theme_compatibility_setting');
121
+	return $tc['geodir_before_title_filter'];
122 122
 }
123 123
 
124 124
 /**
@@ -131,8 +131,8 @@  discard block
 block discarded – undo
131 131
  */
132 132
 function geodir_after_title_dynamic()
133 133
 {
134
-    $tc = get_option('theme_compatibility_setting');
135
-    return $tc['geodir_after_title_filter'];
134
+	$tc = get_option('theme_compatibility_setting');
135
+	return $tc['geodir_after_title_filter'];
136 136
 }
137 137
 
138 138
 /**
@@ -145,8 +145,8 @@  discard block
 block discarded – undo
145 145
  */
146 146
 function geodir_menu_li_class_dynamic()
147 147
 {
148
-    $tc = get_option('theme_compatibility_setting');
149
-    return $tc['geodir_menu_li_class_filter'];
148
+	$tc = get_option('theme_compatibility_setting');
149
+	return $tc['geodir_menu_li_class_filter'];
150 150
 }
151 151
 
152 152
 /**
@@ -159,8 +159,8 @@  discard block
 block discarded – undo
159 159
  */
160 160
 function geodir_sub_menu_ul_class_dynamic()
161 161
 {
162
-    $tc = get_option('theme_compatibility_setting');
163
-    return $tc['geodir_sub_menu_ul_class_filter'];
162
+	$tc = get_option('theme_compatibility_setting');
163
+	return $tc['geodir_sub_menu_ul_class_filter'];
164 164
 }
165 165
 
166 166
 /**
@@ -173,8 +173,8 @@  discard block
 block discarded – undo
173 173
  */
174 174
 function geodir_sub_menu_li_class_dynamic()
175 175
 {
176
-    $tc = get_option('theme_compatibility_setting');
177
-    return $tc['geodir_sub_menu_li_class_filter'];
176
+	$tc = get_option('theme_compatibility_setting');
177
+	return $tc['geodir_sub_menu_li_class_filter'];
178 178
 }
179 179
 
180 180
 /**
@@ -187,8 +187,8 @@  discard block
 block discarded – undo
187 187
  */
188 188
 function geodir_menu_a_class_dynamic()
189 189
 {
190
-    $tc = get_option('theme_compatibility_setting');
191
-    return $tc['geodir_menu_a_class_filter'];
190
+	$tc = get_option('theme_compatibility_setting');
191
+	return $tc['geodir_menu_a_class_filter'];
192 192
 }
193 193
 
194 194
 /**
@@ -201,8 +201,8 @@  discard block
 block discarded – undo
201 201
  */
202 202
 function geodir_sub_menu_a_class_dynamic()
203 203
 {
204
-    $tc = get_option('theme_compatibility_setting');
205
-    return $tc['geodir_sub_menu_a_class_filter'];
204
+	$tc = get_option('theme_compatibility_setting');
205
+	return $tc['geodir_sub_menu_a_class_filter'];
206 206
 }
207 207
 
208 208
 /**
@@ -215,8 +215,8 @@  discard block
 block discarded – undo
215 215
  */
216 216
 function geodir_location_switcher_menu_li_class_dynamic()
217 217
 {
218
-    $tc = get_option('theme_compatibility_setting');
219
-    return $tc['geodir_location_switcher_menu_li_class_filter'];
218
+	$tc = get_option('theme_compatibility_setting');
219
+	return $tc['geodir_location_switcher_menu_li_class_filter'];
220 220
 }
221 221
 
222 222
 /**
@@ -229,8 +229,8 @@  discard block
 block discarded – undo
229 229
  */
230 230
 function geodir_location_switcher_menu_a_class_dynamic()
231 231
 {
232
-    $tc = get_option('theme_compatibility_setting');
233
-    return $tc['geodir_location_switcher_menu_a_class_filter'];
232
+	$tc = get_option('theme_compatibility_setting');
233
+	return $tc['geodir_location_switcher_menu_a_class_filter'];
234 234
 }
235 235
 
236 236
 /**
@@ -243,8 +243,8 @@  discard block
 block discarded – undo
243 243
  */
244 244
 function geodir_location_switcher_menu_sub_ul_class_dynamic()
245 245
 {
246
-    $tc = get_option('theme_compatibility_setting');
247
-    return $tc['geodir_location_switcher_menu_sub_ul_class_filter'];
246
+	$tc = get_option('theme_compatibility_setting');
247
+	return $tc['geodir_location_switcher_menu_sub_ul_class_filter'];
248 248
 }
249 249
 
250 250
 /**
@@ -257,8 +257,8 @@  discard block
 block discarded – undo
257 257
  */
258 258
 function geodir_location_switcher_menu_sub_li_class_dynamic()
259 259
 {
260
-    $tc = get_option('theme_compatibility_setting');
261
-    return $tc['geodir_location_switcher_menu_sub_li_class_filter'];
260
+	$tc = get_option('theme_compatibility_setting');
261
+	return $tc['geodir_location_switcher_menu_sub_li_class_filter'];
262 262
 }
263 263
 
264 264
 
@@ -275,107 +275,107 @@  discard block
 block discarded – undo
275 275
 function geodir_content_actions_dynamic()
276 276
 {
277 277
 
278
-    $tc = get_option('theme_compatibility_setting');
278
+	$tc = get_option('theme_compatibility_setting');
279 279
 //print_r($tc);
280
-    if (empty($tc)) {
281
-        return;
282
-    }
283
-
284
-    //php
285
-    if (!empty($tc['geodir_theme_compat_code'])) {
286
-        include_once('geodirectory-functions/compatibility/' . $tc['geodir_theme_compat_code'] . '.php');
287
-    }
288
-
289
-    //geodir_full_page_class
290
-    if (!empty($tc['geodir_full_page_class_filter'])) {
291
-        add_filter('geodir_full_page_class', 'geodir_full_page_class_dynamic', 10);
292
-    }
293
-
294
-    //widget before filter
295
-    if (!empty($tc['geodir_before_widget_filter'])) {
296
-        add_filter('geodir_before_widget', 'geodir_before_widget_dynamic', 10);
297
-    }
298
-
299
-    //widget after filter
300
-    if (!empty($tc['geodir_after_widget_filter'])) {
301
-        add_filter('geodir_after_widget', 'geodir_after_widget_dynamic', 10);
302
-    }
303
-
304
-    //widget before title filter
305
-    if (!empty($tc['geodir_before_title_filter'])) {
306
-        add_filter('geodir_before_title', 'geodir_before_title_dynamic', 10);
307
-    }
308
-
309
-    //widget before title filter
310
-    if (!empty($tc['geodir_after_title_filter'])) {
311
-        add_filter('geodir_after_title', 'geodir_after_title_dynamic', 10);
312
-    }
313
-
314
-    //menu li class
315
-    if (!empty($tc['geodir_menu_li_class_filter'])) {
316
-        add_filter('geodir_menu_li_class', 'geodir_menu_li_class_dynamic', 10);
317
-    }
318
-
319
-    //menu ul class
320
-    if (!empty($tc['geodir_sub_menu_ul_class_filter'])) {
321
-        add_filter('geodir_sub_menu_ul_class', 'geodir_sub_menu_ul_class_dynamic', 10);
322
-    }
323
-
324
-    //menu sub li class
325
-    if (!empty($tc['geodir_sub_menu_li_class_filter'])) {
326
-        add_filter('geodir_sub_menu_li_class', 'geodir_sub_menu_li_class_dynamic', 10);
327
-    }
328
-
329
-    //menu a class
330
-    if (!empty($tc['geodir_menu_a_class_filter'])) {
331
-        add_filter('geodir_menu_a_class', 'geodir_menu_a_class_dynamic', 10);
332
-    }
333
-
334
-    //menu sub a class
335
-    if (!empty($tc['geodir_sub_menu_a_class_filter'])) {
336
-        add_filter('geodir_sub_menu_a_class', 'geodir_sub_menu_a_class_dynamic', 10);
337
-    }
338
-
339
-    //location menu li class
340
-    if (!empty($tc['geodir_location_switcher_menu_li_class_filter'])) {
341
-        add_filter('geodir_location_switcher_menu_li_class', 'geodir_location_switcher_menu_li_class_dynamic', 10);
342
-    }
343
-
344
-    //location menu sub ul class
345
-    if (!empty($tc['geodir_location_switcher_menu_sub_ul_class_filter'])) {
346
-        add_filter('geodir_location_switcher_menu_sub_ul_class', 'geodir_location_switcher_menu_sub_ul_class_dynamic', 10);
347
-    }
348
-
349
-    //location menu sub li class
350
-    if (!empty($tc['geodir_location_switcher_menu_sub_li_class_filter'])) {
351
-        add_filter('geodir_location_switcher_menu_sub_li_class', 'geodir_location_switcher_menu_sub_li_class_dynamic', 10);
352
-    }
353
-
354
-    //location menu a class
355
-    if (!empty($tc['geodir_location_switcher_menu_a_class_filter'])) {
356
-        add_filter('geodir_location_switcher_menu_a_class', 'geodir_location_switcher_menu_a_class_dynamic', 10);
357
-    }
358
-
359
-    // compat styles
360
-    if (!empty($tc['geodir_theme_compat_css'])) {
361
-        add_action('wp_head', 'gd_compat_styles');
362
-    }
363
-
364
-    // compat js
365
-    if (!empty($tc['geodir_theme_compat_js'])) {
366
-        add_action('wp_footer', 'gd_compat_script');
367
-    }
368
-
369
-
370
-    // geodir_top_content_add
371
-    if (!empty($tc['geodir_top_content_add'])) {
372
-        add_action('geodir_top_content', 'geodir_top_content_add_dynamic', 10, 1);
373
-    }
374
-
375
-    // geodir_before_main_content_add
376
-    if (!empty($tc['geodir_before_main_content_add'])) {
377
-        add_action('geodir_before_main_content', 'geodir_before_main_content_add_dynamic', 10, 1);
378
-    }
280
+	if (empty($tc)) {
281
+		return;
282
+	}
283
+
284
+	//php
285
+	if (!empty($tc['geodir_theme_compat_code'])) {
286
+		include_once('geodirectory-functions/compatibility/' . $tc['geodir_theme_compat_code'] . '.php');
287
+	}
288
+
289
+	//geodir_full_page_class
290
+	if (!empty($tc['geodir_full_page_class_filter'])) {
291
+		add_filter('geodir_full_page_class', 'geodir_full_page_class_dynamic', 10);
292
+	}
293
+
294
+	//widget before filter
295
+	if (!empty($tc['geodir_before_widget_filter'])) {
296
+		add_filter('geodir_before_widget', 'geodir_before_widget_dynamic', 10);
297
+	}
298
+
299
+	//widget after filter
300
+	if (!empty($tc['geodir_after_widget_filter'])) {
301
+		add_filter('geodir_after_widget', 'geodir_after_widget_dynamic', 10);
302
+	}
303
+
304
+	//widget before title filter
305
+	if (!empty($tc['geodir_before_title_filter'])) {
306
+		add_filter('geodir_before_title', 'geodir_before_title_dynamic', 10);
307
+	}
308
+
309
+	//widget before title filter
310
+	if (!empty($tc['geodir_after_title_filter'])) {
311
+		add_filter('geodir_after_title', 'geodir_after_title_dynamic', 10);
312
+	}
313
+
314
+	//menu li class
315
+	if (!empty($tc['geodir_menu_li_class_filter'])) {
316
+		add_filter('geodir_menu_li_class', 'geodir_menu_li_class_dynamic', 10);
317
+	}
318
+
319
+	//menu ul class
320
+	if (!empty($tc['geodir_sub_menu_ul_class_filter'])) {
321
+		add_filter('geodir_sub_menu_ul_class', 'geodir_sub_menu_ul_class_dynamic', 10);
322
+	}
323
+
324
+	//menu sub li class
325
+	if (!empty($tc['geodir_sub_menu_li_class_filter'])) {
326
+		add_filter('geodir_sub_menu_li_class', 'geodir_sub_menu_li_class_dynamic', 10);
327
+	}
328
+
329
+	//menu a class
330
+	if (!empty($tc['geodir_menu_a_class_filter'])) {
331
+		add_filter('geodir_menu_a_class', 'geodir_menu_a_class_dynamic', 10);
332
+	}
333
+
334
+	//menu sub a class
335
+	if (!empty($tc['geodir_sub_menu_a_class_filter'])) {
336
+		add_filter('geodir_sub_menu_a_class', 'geodir_sub_menu_a_class_dynamic', 10);
337
+	}
338
+
339
+	//location menu li class
340
+	if (!empty($tc['geodir_location_switcher_menu_li_class_filter'])) {
341
+		add_filter('geodir_location_switcher_menu_li_class', 'geodir_location_switcher_menu_li_class_dynamic', 10);
342
+	}
343
+
344
+	//location menu sub ul class
345
+	if (!empty($tc['geodir_location_switcher_menu_sub_ul_class_filter'])) {
346
+		add_filter('geodir_location_switcher_menu_sub_ul_class', 'geodir_location_switcher_menu_sub_ul_class_dynamic', 10);
347
+	}
348
+
349
+	//location menu sub li class
350
+	if (!empty($tc['geodir_location_switcher_menu_sub_li_class_filter'])) {
351
+		add_filter('geodir_location_switcher_menu_sub_li_class', 'geodir_location_switcher_menu_sub_li_class_dynamic', 10);
352
+	}
353
+
354
+	//location menu a class
355
+	if (!empty($tc['geodir_location_switcher_menu_a_class_filter'])) {
356
+		add_filter('geodir_location_switcher_menu_a_class', 'geodir_location_switcher_menu_a_class_dynamic', 10);
357
+	}
358
+
359
+	// compat styles
360
+	if (!empty($tc['geodir_theme_compat_css'])) {
361
+		add_action('wp_head', 'gd_compat_styles');
362
+	}
363
+
364
+	// compat js
365
+	if (!empty($tc['geodir_theme_compat_js'])) {
366
+		add_action('wp_footer', 'gd_compat_script');
367
+	}
368
+
369
+
370
+	// geodir_top_content_add
371
+	if (!empty($tc['geodir_top_content_add'])) {
372
+		add_action('geodir_top_content', 'geodir_top_content_add_dynamic', 10, 1);
373
+	}
374
+
375
+	// geodir_before_main_content_add
376
+	if (!empty($tc['geodir_before_main_content_add'])) {
377
+		add_action('geodir_before_main_content', 'geodir_before_main_content_add_dynamic', 10, 1);
378
+	}
379 379
 
380 380
 
381 381
 }
@@ -398,23 +398,23 @@  discard block
 block discarded – undo
398 398
  */
399 399
 function geodir_action_wrapper_open($type = '', $id = '', $class = '')
400 400
 {
401
-    $tc = get_option('theme_compatibility_setting');
402
-    if (!empty($tc['geodir_wrapper_open_replace'])) {
403
-        $text = $tc['geodir_wrapper_open_replace'];
404
-    } else {
405
-        $text = '<div id="[id]" class="[class]">';
406
-    }
401
+	$tc = get_option('theme_compatibility_setting');
402
+	if (!empty($tc['geodir_wrapper_open_replace'])) {
403
+		$text = $tc['geodir_wrapper_open_replace'];
404
+	} else {
405
+		$text = '<div id="[id]" class="[class]">';
406
+	}
407 407
 
408
-    if (!empty($tc['geodir_wrapper_open_id'])) {
409
-        $id = $tc['geodir_wrapper_open_id'];
410
-    }
411
-    if (!empty($tc['geodir_wrapper_open_class'])) {
412
-        $class = $tc['geodir_wrapper_open_class'];
413
-    }
408
+	if (!empty($tc['geodir_wrapper_open_id'])) {
409
+		$id = $tc['geodir_wrapper_open_id'];
410
+	}
411
+	if (!empty($tc['geodir_wrapper_open_class'])) {
412
+		$class = $tc['geodir_wrapper_open_class'];
413
+	}
414 414
 
415
-    $text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
415
+	$text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
416 416
 
417
-    echo $text;
417
+	echo $text;
418 418
 }
419 419
 
420 420
 // action for adding the wrapperdiv closing tag
@@ -429,14 +429,14 @@  discard block
 block discarded – undo
429 429
  */
430 430
 function geodir_action_wrapper_close($type = '')
431 431
 {
432
-    $tc = get_option('theme_compatibility_setting');
433
-    if (!empty($tc['geodir_wrapper_close_replace'])) {
434
-        $text = $tc['geodir_wrapper_close_replace'];
435
-    } else {
436
-        $text = '</div><!-- wrapper ends here-->';
437
-    }
432
+	$tc = get_option('theme_compatibility_setting');
433
+	if (!empty($tc['geodir_wrapper_close_replace'])) {
434
+		$text = $tc['geodir_wrapper_close_replace'];
435
+	} else {
436
+		$text = '</div><!-- wrapper ends here-->';
437
+	}
438 438
 
439
-    echo $text;
439
+	echo $text;
440 440
 }
441 441
 
442 442
 // action for adding the content div opening tag
@@ -452,35 +452,35 @@  discard block
 block discarded – undo
452 452
  */
453 453
 function geodir_action_wrapper_content_open($type = '', $id = '', $class = '')
454 454
 {
455
-    if ($type == 'home-page' && $width = get_option('geodir_width_home_contant_section')) {
456
-        $width_css = 'style="width:' . $width . '%;"';
457
-    } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_contant_section')) {
458
-        $width_css = 'style="width:' . $width . '%;"';
459
-    } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_contant_section')) {
460
-        $width_css = 'style="width:' . $width . '%;"';
461
-    } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_contant_section')) {
462
-        $width_css = 'style="width:' . $width . '%;"';
463
-    } else {
464
-        $width_css = '';
465
-    }
466
-
467
-    $tc = get_option('theme_compatibility_setting');
468
-    if (!empty($tc['geodir_wrapper_content_open_replace'])) {
469
-        $text = $tc['geodir_wrapper_content_open_replace'];
470
-    } else {
471
-        $text = '<div id="[id]" class="[class]" role="main" [width_css]>';
472
-    }
473
-
474
-    if (!empty($tc['geodir_wrapper_content_open_id'])) {
475
-        $id = $tc['geodir_wrapper_content_open_id'];
476
-    }
477
-    if (!empty($tc['geodir_wrapper_content_open_class'])) {
478
-        $class = $tc['geodir_wrapper_content_open_class'];
479
-    }
480
-
481
-    $text = str_replace(array("[id]", "[class]", "[width_css]"), array($id, $class, $width_css), $text);
482
-
483
-    echo $text;
455
+	if ($type == 'home-page' && $width = get_option('geodir_width_home_contant_section')) {
456
+		$width_css = 'style="width:' . $width . '%;"';
457
+	} elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_contant_section')) {
458
+		$width_css = 'style="width:' . $width . '%;"';
459
+	} elseif ($type == 'search-page' && $width = get_option('geodir_width_search_contant_section')) {
460
+		$width_css = 'style="width:' . $width . '%;"';
461
+	} elseif ($type == 'author-page' && $width = get_option('geodir_width_author_contant_section')) {
462
+		$width_css = 'style="width:' . $width . '%;"';
463
+	} else {
464
+		$width_css = '';
465
+	}
466
+
467
+	$tc = get_option('theme_compatibility_setting');
468
+	if (!empty($tc['geodir_wrapper_content_open_replace'])) {
469
+		$text = $tc['geodir_wrapper_content_open_replace'];
470
+	} else {
471
+		$text = '<div id="[id]" class="[class]" role="main" [width_css]>';
472
+	}
473
+
474
+	if (!empty($tc['geodir_wrapper_content_open_id'])) {
475
+		$id = $tc['geodir_wrapper_content_open_id'];
476
+	}
477
+	if (!empty($tc['geodir_wrapper_content_open_class'])) {
478
+		$class = $tc['geodir_wrapper_content_open_class'];
479
+	}
480
+
481
+	$text = str_replace(array("[id]", "[class]", "[width_css]"), array($id, $class, $width_css), $text);
482
+
483
+	echo $text;
484 484
 }
485 485
 
486 486
 // action for adding the primary div closing tag
@@ -494,13 +494,13 @@  discard block
 block discarded – undo
494 494
  */
495 495
 function geodir_action_wrapper_content_close($type = '')
496 496
 {
497
-    $tc = get_option('theme_compatibility_setting');
498
-    if (!empty($tc['geodir_wrapper_content_close_replace'])) {
499
-        $text = $tc['geodir_wrapper_content_close_replace'];
500
-    } else {
501
-        $text = '</div><!-- content ends here-->';
502
-    }
503
-    echo $text;
497
+	$tc = get_option('theme_compatibility_setting');
498
+	if (!empty($tc['geodir_wrapper_content_close_replace'])) {
499
+		$text = $tc['geodir_wrapper_content_close_replace'];
500
+	} else {
501
+		$text = '</div><!-- content ends here-->';
502
+	}
503
+	echo $text;
504 504
 }
505 505
 
506 506
 // action for adding the <article> opening tag
@@ -518,24 +518,24 @@  discard block
 block discarded – undo
518 518
  */
519 519
 function geodir_action_article_open($type = '', $id = '', $class = '', $itemtype = '')
520 520
 {
521
-    $class = implode(" ", $class);
522
-    $tc = get_option('theme_compatibility_setting');
523
-    if (!empty($tc['geodir_article_open_replace'])) {
524
-        $text = $tc['geodir_article_open_replace'];
525
-    } else {
526
-        $text = '<article  id="[id]" class="[class]" >';
527
-    }
521
+	$class = implode(" ", $class);
522
+	$tc = get_option('theme_compatibility_setting');
523
+	if (!empty($tc['geodir_article_open_replace'])) {
524
+		$text = $tc['geodir_article_open_replace'];
525
+	} else {
526
+		$text = '<article  id="[id]" class="[class]" >';
527
+	}
528 528
 
529
-    if (!empty($tc['geodir_article_open_id'])) {
530
-        $id = $tc['geodir_article_open_id'];
531
-    }
532
-    if (!empty($tc['geodir_article_open_class'])) {
533
-        $class = $tc['geodir_article_open_class'];
534
-    }
529
+	if (!empty($tc['geodir_article_open_id'])) {
530
+		$id = $tc['geodir_article_open_id'];
531
+	}
532
+	if (!empty($tc['geodir_article_open_class'])) {
533
+		$class = $tc['geodir_article_open_class'];
534
+	}
535 535
 
536
-    $text = str_replace(array("[id]", "[class]", "[itemtype]"), array($id, $class, $itemtype), $text);
536
+	$text = str_replace(array("[id]", "[class]", "[itemtype]"), array($id, $class, $itemtype), $text);
537 537
 
538
-    echo $text;
538
+	echo $text;
539 539
 }
540 540
 
541 541
 // action for adding the primary div closing tag
@@ -549,13 +549,13 @@  discard block
 block discarded – undo
549 549
  */
550 550
 function geodir_action_article_close($type = '')
551 551
 {
552
-    $tc = get_option('theme_compatibility_setting');
553
-    if (!empty($tc['geodir_article_close_replace'])) {
554
-        $text = $tc['geodir_article_close_replace'];
555
-    } else {
556
-        $text = '</article><!-- article ends here-->';
557
-    }
558
-    echo $text;
552
+	$tc = get_option('theme_compatibility_setting');
553
+	if (!empty($tc['geodir_article_close_replace'])) {
554
+		$text = $tc['geodir_article_close_replace'];
555
+	} else {
556
+		$text = '</article><!-- article ends here-->';
557
+	}
558
+	echo $text;
559 559
 }
560 560
 
561 561
 // action for adding the sidebar opening tag
@@ -572,35 +572,35 @@  discard block
 block discarded – undo
572 572
  */
573 573
 function geodir_action_sidebar_right_open($type = '', $id = '', $class = '', $itemtype = '')
574 574
 {
575
-    if ($type == 'home-page' && $width = get_option('geodir_width_home_right_section')) {
576
-        $width_css = 'style="width:' . $width . '%;"';
577
-    } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_right_section')) {
578
-        $width_css = 'style="width:' . $width . '%;"';
579
-    } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_right_section')) {
580
-        $width_css = 'style="width:' . $width . '%;"';
581
-    } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_right_section')) {
582
-        $width_css = 'style="width:' . $width . '%;"';
583
-    } else {
584
-        $width_css = '';
585
-    }
586
-
587
-    $tc = get_option('theme_compatibility_setting');
588
-    if (!empty($tc['geodir_sidebar_right_open_replace'])) {
589
-        $text = $tc['geodir_sidebar_right_open_replace'];
590
-    } else {
591
-        $text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
592
-    }
593
-
594
-    if (!empty($tc['geodir_sidebar_right_open_id'])) {
595
-        $id = $tc['geodir_sidebar_right_open_id'];
596
-    }
597
-    if (!empty($tc['geodir_sidebar_right_open_class'])) {
598
-        $class = $tc['geodir_sidebar_right_open_class'];
599
-    }
600
-
601
-    $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
602
-
603
-    echo $text;
575
+	if ($type == 'home-page' && $width = get_option('geodir_width_home_right_section')) {
576
+		$width_css = 'style="width:' . $width . '%;"';
577
+	} elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_right_section')) {
578
+		$width_css = 'style="width:' . $width . '%;"';
579
+	} elseif ($type == 'search-page' && $width = get_option('geodir_width_search_right_section')) {
580
+		$width_css = 'style="width:' . $width . '%;"';
581
+	} elseif ($type == 'author-page' && $width = get_option('geodir_width_author_right_section')) {
582
+		$width_css = 'style="width:' . $width . '%;"';
583
+	} else {
584
+		$width_css = '';
585
+	}
586
+
587
+	$tc = get_option('theme_compatibility_setting');
588
+	if (!empty($tc['geodir_sidebar_right_open_replace'])) {
589
+		$text = $tc['geodir_sidebar_right_open_replace'];
590
+	} else {
591
+		$text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
592
+	}
593
+
594
+	if (!empty($tc['geodir_sidebar_right_open_id'])) {
595
+		$id = $tc['geodir_sidebar_right_open_id'];
596
+	}
597
+	if (!empty($tc['geodir_sidebar_right_open_class'])) {
598
+		$class = $tc['geodir_sidebar_right_open_class'];
599
+	}
600
+
601
+	$text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
602
+
603
+	echo $text;
604 604
 }
605 605
 
606 606
 // action for adding the primary div closing tag
@@ -614,13 +614,13 @@  discard block
 block discarded – undo
614 614
  */
615 615
 function geodir_action_sidebar_right_close($type = '')
616 616
 {
617
-    $tc = get_option('theme_compatibility_setting');
618
-    if (!empty($tc['geodir_sidebar_right_close_replace'])) {
619
-        $text = $tc['geodir_sidebar_right_close_replace'];
620
-    } else {
621
-        $text = '</aside><!-- sidebar ends here-->';
622
-    }
623
-    echo $text;
617
+	$tc = get_option('theme_compatibility_setting');
618
+	if (!empty($tc['geodir_sidebar_right_close_replace'])) {
619
+		$text = $tc['geodir_sidebar_right_close_replace'];
620
+	} else {
621
+		$text = '</aside><!-- sidebar ends here-->';
622
+	}
623
+	echo $text;
624 624
 }
625 625
 
626 626
 
@@ -641,121 +641,121 @@  discard block
 block discarded – undo
641 641
  */
642 642
 function geodir_action_geodir_set_preview_post()
643 643
 {
644
-    global $post, $preview, $gd_session;
645
-    $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
646
-    if (!$preview || $is_backend_preview) {
647
-        return;
648
-    }// bail if not previewing
649
-
650
-    $listing_type = isset($_REQUEST['listing_type']) ? sanitize_text_field($_REQUEST['listing_type']) : '';
651
-
652
-    $fields_info = geodir_get_custom_fields_type($listing_type);
653
-
654
-    foreach ($_REQUEST as $pkey => $pval) {
655
-        if ($pkey == 'geodir_video') {
656
-            $tags = '<iframe>';
657
-        } else if ($pkey == 'post_desc') {
658
-            $tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
659
-        } else if (is_array($fields_info) && isset($fields_info[$pkey]) && ($fields_info[$pkey] == 'textarea' || $fields_info[$pkey] == 'html')) {
660
-            $tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
661
-        } else if (is_array($_REQUEST[$pkey])) {
662
-            $tags = 'skip_field';
663
-        } else {
664
-            $tags = '';
665
-        }
666
-        /**
667
-         * Allows the filtering of the allowed HTML tags per field when submitting from frontend add listing page.
668
-         *
669
-         * @since 1.0.0
670
-         * @param string $tags The allowed HTML tags for the field. Can be many things, for example the description allows these tags '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'.
671
-         * @param string|array $pkey The field id/name. If array then value is set as "skip_field".
672
-         */
673
-        $tags = apply_filters('geodir_save_post_key', $tags, $pkey);
674
-
675
-        if ($tags != 'skip_field') {
676
-            $_REQUEST[$pkey] = strip_tags($_REQUEST[$pkey], $tags);
677
-        }
678
-    }
679
-
680
-    $post = (object)$_REQUEST;
681
-
682
-
683
-    if (isset($post->video)) {
684
-        $post->video = stripslashes($post->video);
685
-    }
686
-
687
-    if (isset($post->Video2)) {
688
-        $post->Video2 = stripslashes($post->Video2);
689
-    }
690
-
691
-    $post_type = $post->listing_type;
692
-    $post_type_info = get_post_type_object($post_type);
693
-
694
-    $listing_label = $post_type_info->labels->singular_name;
695
-
696
-    $term_icon = '';
697
-
698
-    if (!empty($post->post_category)) {
699
-        foreach ($post->post_category as $post_taxonomy => $post_term) {
700
-
701
-            if ($post_term != '' && !is_array($post_term)) {
702
-                $post_term = explode(',', trim($post_term, ','));
703
-            }
644
+	global $post, $preview, $gd_session;
645
+	$is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
646
+	if (!$preview || $is_backend_preview) {
647
+		return;
648
+	}// bail if not previewing
649
+
650
+	$listing_type = isset($_REQUEST['listing_type']) ? sanitize_text_field($_REQUEST['listing_type']) : '';
651
+
652
+	$fields_info = geodir_get_custom_fields_type($listing_type);
653
+
654
+	foreach ($_REQUEST as $pkey => $pval) {
655
+		if ($pkey == 'geodir_video') {
656
+			$tags = '<iframe>';
657
+		} else if ($pkey == 'post_desc') {
658
+			$tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
659
+		} else if (is_array($fields_info) && isset($fields_info[$pkey]) && ($fields_info[$pkey] == 'textarea' || $fields_info[$pkey] == 'html')) {
660
+			$tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
661
+		} else if (is_array($_REQUEST[$pkey])) {
662
+			$tags = 'skip_field';
663
+		} else {
664
+			$tags = '';
665
+		}
666
+		/**
667
+		 * Allows the filtering of the allowed HTML tags per field when submitting from frontend add listing page.
668
+		 *
669
+		 * @since 1.0.0
670
+		 * @param string $tags The allowed HTML tags for the field. Can be many things, for example the description allows these tags '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'.
671
+		 * @param string|array $pkey The field id/name. If array then value is set as "skip_field".
672
+		 */
673
+		$tags = apply_filters('geodir_save_post_key', $tags, $pkey);
674
+
675
+		if ($tags != 'skip_field') {
676
+			$_REQUEST[$pkey] = strip_tags($_REQUEST[$pkey], $tags);
677
+		}
678
+	}
679
+
680
+	$post = (object)$_REQUEST;
681
+
682
+
683
+	if (isset($post->video)) {
684
+		$post->video = stripslashes($post->video);
685
+	}
686
+
687
+	if (isset($post->Video2)) {
688
+		$post->Video2 = stripslashes($post->Video2);
689
+	}
690
+
691
+	$post_type = $post->listing_type;
692
+	$post_type_info = get_post_type_object($post_type);
693
+
694
+	$listing_label = $post_type_info->labels->singular_name;
695
+
696
+	$term_icon = '';
697
+
698
+	if (!empty($post->post_category)) {
699
+		foreach ($post->post_category as $post_taxonomy => $post_term) {
700
+
701
+			if ($post_term != '' && !is_array($post_term)) {
702
+				$post_term = explode(',', trim($post_term, ','));
703
+			}
704 704
 
705
-            if (is_array($post_term)) {
706
-                $post_term = array_unique($post_term);
707
-            }
705
+			if (is_array($post_term)) {
706
+				$post_term = array_unique($post_term);
707
+			}
708 708
 
709
-            if (!empty($post_term)) {
710
-                foreach ($post_term as $cat_id) {
711
-                    $cat_id = trim($cat_id);
712
-
713
-                    if ($cat_id != '') {
714
-                        $term_icon = get_option('geodir_default_marker_icon');
715
-
716
-                        if (isset($post->post_default_category) && $post->post_default_category == $cat_id) {
717
-                            if ($term_icon_url = geodir_get_tax_meta($cat_id, 'ct_cat_icon', false, $post_type)) {
718
-                                if (isset($term_icon_url['src']) && $term_icon_url['src'] != '')
719
-                                    $term_icon = $term_icon_url['src'];
720
-                                break;
721
-                            }
722
-                        }
723
-                    }
724
-                }
725
-            }
726
-        }
727
-    }
709
+			if (!empty($post_term)) {
710
+				foreach ($post_term as $cat_id) {
711
+					$cat_id = trim($cat_id);
712
+
713
+					if ($cat_id != '') {
714
+						$term_icon = get_option('geodir_default_marker_icon');
715
+
716
+						if (isset($post->post_default_category) && $post->post_default_category == $cat_id) {
717
+							if ($term_icon_url = geodir_get_tax_meta($cat_id, 'ct_cat_icon', false, $post_type)) {
718
+								if (isset($term_icon_url['src']) && $term_icon_url['src'] != '')
719
+									$term_icon = $term_icon_url['src'];
720
+								break;
721
+							}
722
+						}
723
+					}
724
+				}
725
+			}
726
+		}
727
+	}
728 728
 
729
-    $post_latitude = isset($post->post_latitude) ? $post->post_latitude : '';
730
-    $post_longitude = isset($post->post_longitude) ? $post->post_longitude : '';
729
+	$post_latitude = isset($post->post_latitude) ? $post->post_latitude : '';
730
+	$post_longitude = isset($post->post_longitude) ? $post->post_longitude : '';
731 731
 
732
-    $srcharr = array("'", "/", "-", '"', '\\');
733
-    $replarr = array("&prime;", "&frasl;", "&ndash;", "&ldquo;", '');
732
+	$srcharr = array("'", "/", "-", '"', '\\');
733
+	$replarr = array("&prime;", "&frasl;", "&ndash;", "&ldquo;", '');
734 734
 
735
-    $json_title = str_replace($srcharr, $replarr, $post->post_title);
735
+	$json_title = str_replace($srcharr, $replarr, $post->post_title);
736 736
 
737
-    $json = '{';
738
-    $json .= '"post_preview": "1",';
739
-    $json .= '"t": "' . $json_title . '",';
740
-    $json .= '"lt": "' . $post_latitude . '",';
741
-    $json .= '"ln": "' . $post_longitude . '",';
742
-    $json .= '"i":"' . $term_icon . '"';
743
-    $json .= '}';
737
+	$json = '{';
738
+	$json .= '"post_preview": "1",';
739
+	$json .= '"t": "' . $json_title . '",';
740
+	$json .= '"lt": "' . $post_latitude . '",';
741
+	$json .= '"ln": "' . $post_longitude . '",';
742
+	$json .= '"i":"' . $term_icon . '"';
743
+	$json .= '}';
744 744
 
745
-    $post->marker_json = $json;
745
+	$post->marker_json = $json;
746 746
 
747
-    $gd_session->set('listing', $_REQUEST);
747
+	$gd_session->set('listing', $_REQUEST);
748 748
 
749
-    // we need to define a few things to trick the setup_postdata
750
-    if (!isset($post->ID)) {
751
-        $post->ID = '';
752
-        $post->post_author = '';
753
-        $post->post_date = '';
754
-        $post->post_content = '';
755
-        $post->default_category = '';
756
-        $post->post_type = '';
757
-    }
758
-    setup_postdata($post);
749
+	// we need to define a few things to trick the setup_postdata
750
+	if (!isset($post->ID)) {
751
+		$post->ID = '';
752
+		$post->post_author = '';
753
+		$post->post_date = '';
754
+		$post->post_content = '';
755
+		$post->default_category = '';
756
+		$post->post_type = '';
757
+	}
758
+	setup_postdata($post);
759 759
 }
760 760
 
761 761
 /**
@@ -767,15 +767,15 @@  discard block
 block discarded – undo
767 767
  */
768 768
 function geodir_action_geodir_preview_code()
769 769
 {
770
-    global $preview;
770
+	global $preview;
771 771
 
772
-    $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
772
+	$is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
773 773
 
774
-    if (!$preview || $is_backend_preview) {
775
-        return;
776
-    }// bail if not previewing
774
+	if (!$preview || $is_backend_preview) {
775
+		return;
776
+	}// bail if not previewing
777 777
 
778
-    geodir_get_template_part('preview', 'buttons');
778
+	geodir_get_template_part('preview', 'buttons');
779 779
 }
780 780
 
781 781
 // action for adding the details page top widget area
@@ -791,20 +791,20 @@  discard block
 block discarded – undo
791 791
  */
792 792
 function geodir_action_geodir_sidebar_detail_top($class = '')
793 793
 {
794
-    if (get_option('geodir_show_detail_top_section')) { ?>
794
+	if (get_option('geodir_show_detail_top_section')) { ?>
795 795
         <div
796 796
             class="<?php
797
-            /**
798
-             * Filter the div class for the wrapper of the full width widget areas.
799
-             *
800
-             * Allows you to filter the class of the div for the HTML Container wrapper for the full width widget areas referred to as "Top Section" or "Bottom Section" in the widget areas.
801
-             *
802
-             * @since 1.0.0
803
-             * @param string $class The class of the div.
804
-             * @param string $type The page type the widget area is being used on. Values can be 'geodir_detail_top', 'geodir_detail_bottom', 'geodir_listing_top', 'geodir_listing_bottom', 'Reg/Login Top Section',
805
-             *               'geodir_author_top','geodir_author_bottom', 'geodir_search_top', 'geodir_search_bottom', 'geodir_home_top' or 'geodir_home_bottom'.
806
-             */
807
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_top'); ?> <?php echo $class; ?>">
797
+			/**
798
+			 * Filter the div class for the wrapper of the full width widget areas.
799
+			 *
800
+			 * Allows you to filter the class of the div for the HTML Container wrapper for the full width widget areas referred to as "Top Section" or "Bottom Section" in the widget areas.
801
+			 *
802
+			 * @since 1.0.0
803
+			 * @param string $class The class of the div.
804
+			 * @param string $type The page type the widget area is being used on. Values can be 'geodir_detail_top', 'geodir_detail_bottom', 'geodir_listing_top', 'geodir_listing_bottom', 'Reg/Login Top Section',
805
+			 *               'geodir_author_top','geodir_author_bottom', 'geodir_search_top', 'geodir_search_bottom', 'geodir_home_top' or 'geodir_home_bottom'.
806
+			 */
807
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_top'); ?> <?php echo $class; ?>">
808 808
             <?php dynamic_sidebar('geodir_detail_top'); ?>
809 809
         </div>
810 810
     <?php }
@@ -828,11 +828,11 @@  discard block
 block discarded – undo
828 828
  */
829 829
 function geodir_action_geodir_sidebar_detail_bottom_section($class = '')
830 830
 {
831
-    if (get_option('geodir_show_detail_bottom_section')) { ?>
831
+	if (get_option('geodir_show_detail_bottom_section')) { ?>
832 832
         <div
833 833
             class="<?php
834
-            /** This action is documented in geodirectory_template_actions.php */
835
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_bottom'); ?> <?php echo $class; ?>">
834
+			/** This action is documented in geodirectory_template_actions.php */
835
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_bottom'); ?> <?php echo $class; ?>">
836 836
             <?php dynamic_sidebar('geodir_detail_bottom'); ?>
837 837
         </div><!-- clearfix ends here-->
838 838
     <?php }
@@ -846,7 +846,7 @@  discard block
 block discarded – undo
846 846
  */
847 847
 function geodir_details_sidebar_widget_area()
848 848
 {
849
-    dynamic_sidebar('geodir_detail_sidebar');
849
+	dynamic_sidebar('geodir_detail_sidebar');
850 850
 }
851 851
 
852 852
 /**
@@ -857,12 +857,12 @@  discard block
 block discarded – undo
857 857
  */
858 858
 function geodir_details_sidebar_place_details()
859 859
 {
860
-    /**
861
-     * Used to add items to the details page sidebar.
862
-     *
863
-     * @since 1.0.0
864
-     */
865
-    do_action('geodir_detail_page_sidebar');
860
+	/**
861
+	 * Used to add items to the details page sidebar.
862
+	 *
863
+	 * @since 1.0.0
864
+	 */
865
+	do_action('geodir_detail_page_sidebar');
866 866
 }
867 867
 
868 868
 add_action('geodir_detail_sidebar_inside', 'geodir_details_sidebar_place_details', 10);
@@ -877,68 +877,68 @@  discard block
 block discarded – undo
877 877
  */
878 878
 function geodir_action_details_sidebar()
879 879
 {
880
-    // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
881
-    if (get_option('geodir_detail_sidebar_left_section')) {
882
-        /**
883
-         * Called before the details page left sidebar is opened.
884
-         *
885
-         * This is used to add opening wrapper HTML to the details page left sidebar.
886
-         *
887
-         * @since 1.0.0
888
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
889
-         * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-left'.
890
-         * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-left geodir-details-sidebar-left'.
891
-         * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
892
-         */
893
-        do_action('geodir_sidebar_left_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-left geodir-details-sidebar-left', 'https://schema.org/WPSideBar');
894
-        ?>
880
+	// this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
881
+	if (get_option('geodir_detail_sidebar_left_section')) {
882
+		/**
883
+		 * Called before the details page left sidebar is opened.
884
+		 *
885
+		 * This is used to add opening wrapper HTML to the details page left sidebar.
886
+		 *
887
+		 * @since 1.0.0
888
+		 * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
889
+		 * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-left'.
890
+		 * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-left geodir-details-sidebar-left'.
891
+		 * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
892
+		 */
893
+		do_action('geodir_sidebar_left_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-left geodir-details-sidebar-left', 'https://schema.org/WPSideBar');
894
+		?>
895 895
         <div class="geodir-content-left geodir-sidebar-wrap"><?php
896
-        /**
897
-         * Called inside the HTML wrapper of the details sidebar for either the left and right sidebar.
898
-         *
899
-         * This is used to add all info to the details page sidebars.
900
-         *
901
-         * @since 1.0.0
902
-         */
903
-        do_action('geodir_detail_sidebar_inside');
904
-        ?></div><!-- end geodir-content-left --><?php
905
-        /**
906
-         * Called after the details page left sidebar.
907
-         *
908
-         * This is used to add closing wrapper HTML to the details page left sidebar.
909
-         *
910
-         * @since 1.0.0
911
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
912
-         */
913
-        do_action('geodir_sidebar_left_close', 'details-page');
914
-    } else {
915
-        /**
916
-         * Called before the details page right sidebar is opened.
917
-         *
918
-         * This is used to add opening wrapper HTML to the details page right sidebar.
919
-         *
920
-         * @since 1.0.0
921
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'add-listing-page', 'author-page', 'search-page' or 'home-page'.
922
-         * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-right'.
923
-         * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-right geodir-details-sidebar-right'.
924
-         * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
925
-         */
926
-        do_action('geodir_sidebar_right_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-right geodir-details-sidebar-right', 'http://schema.org/WPSideBar');
927
-        ?>
896
+		/**
897
+		 * Called inside the HTML wrapper of the details sidebar for either the left and right sidebar.
898
+		 *
899
+		 * This is used to add all info to the details page sidebars.
900
+		 *
901
+		 * @since 1.0.0
902
+		 */
903
+		do_action('geodir_detail_sidebar_inside');
904
+		?></div><!-- end geodir-content-left --><?php
905
+		/**
906
+		 * Called after the details page left sidebar.
907
+		 *
908
+		 * This is used to add closing wrapper HTML to the details page left sidebar.
909
+		 *
910
+		 * @since 1.0.0
911
+		 * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
912
+		 */
913
+		do_action('geodir_sidebar_left_close', 'details-page');
914
+	} else {
915
+		/**
916
+		 * Called before the details page right sidebar is opened.
917
+		 *
918
+		 * This is used to add opening wrapper HTML to the details page right sidebar.
919
+		 *
920
+		 * @since 1.0.0
921
+		 * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'add-listing-page', 'author-page', 'search-page' or 'home-page'.
922
+		 * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-right'.
923
+		 * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-right geodir-details-sidebar-right'.
924
+		 * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
925
+		 */
926
+		do_action('geodir_sidebar_right_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-right geodir-details-sidebar-right', 'http://schema.org/WPSideBar');
927
+		?>
928 928
         <div class="geodir-content-right geodir-sidebar-wrap"><?php
929
-        /** This action is documented in geodirectory_template_actions.php */
930
-        do_action('geodir_detail_sidebar_inside');
931
-        ?></div><!-- end geodir-content-right --><?php
932
-        /**
933
-         * Called after the details page right sidebar.
934
-         *
935
-         * This is used to add closing wrapper HTML to the details page right sidebar.
936
-         *
937
-         * @since 1.0.0
938
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
939
-         */
940
-        do_action('geodir_sidebar_right_close', 'details-page');
941
-    }
929
+		/** This action is documented in geodirectory_template_actions.php */
930
+		do_action('geodir_detail_sidebar_inside');
931
+		?></div><!-- end geodir-content-right --><?php
932
+		/**
933
+		 * Called after the details page right sidebar.
934
+		 *
935
+		 * This is used to add closing wrapper HTML to the details page right sidebar.
936
+		 *
937
+		 * @since 1.0.0
938
+		 * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
939
+		 */
940
+		do_action('geodir_sidebar_right_close', 'details-page');
941
+	}
942 942
 }
943 943
 
944 944
 add_action('geodir_page_title', 'geodir_action_page_title', 10);
@@ -952,21 +952,21 @@  discard block
 block discarded – undo
952 952
  */
953 953
 function geodir_action_page_title()
954 954
 {
955
-    /**
956
-     * Filter the page title HTML h1 class.
957
-     *
958
-     * @since 1.0.0
959
-     * @param string $class The class to use. Default is 'entry-title fn'.
960
-     */
961
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
962
-    /**
963
-     * Filter the page title HTML header wrapper class.
964
-     *
965
-     * @since 1.0.0
966
-     * @param string $class The class to use. Default is 'entry-header'.
967
-     */
968
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
969
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . stripslashes(get_the_title()) . '</h1></header>';
955
+	/**
956
+	 * Filter the page title HTML h1 class.
957
+	 *
958
+	 * @since 1.0.0
959
+	 * @param string $class The class to use. Default is 'entry-title fn'.
960
+	 */
961
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
962
+	/**
963
+	 * Filter the page title HTML header wrapper class.
964
+	 *
965
+	 * @since 1.0.0
966
+	 * @param string $class The class to use. Default is 'entry-header'.
967
+	 */
968
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
969
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . stripslashes(get_the_title()) . '</h1></header>';
970 970
 }
971 971
 
972 972
 
@@ -983,106 +983,106 @@  discard block
 block discarded – undo
983 983
  */
984 984
 function geodir_action_details_slider()
985 985
 {
986
-    global $preview, $post;
986
+	global $preview, $post;
987 987
 
988
-    $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // preview from backend
988
+	$is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // preview from backend
989 989
 
990
-    if ($is_backend_preview && !empty($post) && !empty($post->ID) && !isset($post->post_images)) {
991
-        $preview_get_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
990
+	if ($is_backend_preview && !empty($post) && !empty($post->ID) && !isset($post->post_images)) {
991
+		$preview_get_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
992 992
 
993
-        $preview_post_images = array();
994
-        if ($preview_get_images) {
995
-            foreach ($preview_get_images as $row) {
996
-                $preview_post_images[] = $row->src;
997
-            }
998
-        }
999
-        if (!empty($preview_post_images)) {
1000
-            $post->post_images = implode(',', $preview_post_images);
1001
-        }
1002
-    }
993
+		$preview_post_images = array();
994
+		if ($preview_get_images) {
995
+			foreach ($preview_get_images as $row) {
996
+				$preview_post_images[] = $row->src;
997
+			}
998
+		}
999
+		if (!empty($preview_post_images)) {
1000
+			$post->post_images = implode(',', $preview_post_images);
1001
+		}
1002
+	}
1003 1003
     
1004
-    $package_info = geodir_post_package_info(array(), $post, (!empty($post->post_type) ? $post->post_type : ''));
1005
-    $image_limit = '';
1006
-    if (defined('GEODIRPAYMENT_VERSION') && !empty($package_info) && isset($package_info->image_limit) && $package_info->image_limit !== '') {
1007
-        $image_limit = (int)$package_info->image_limit;
1008
-    }
1009
-
1010
-    if ($preview) {
1011
-        $post_images = array();
1012
-        if (isset($post->post_images) && !empty($post->post_images)) {
1013
-            $post->post_images = trim($post->post_images, ",");
1014
-            $post_images = explode(",", $post->post_images);
1015
-        }
1016
-
1017
-        $main_slides = '';
1018
-        $nav_slides = '';
1019
-        $slides = 0;
1020
-
1021
-        if (!empty($post_images)) {
1022
-            foreach ($post_images as $image) {
1023
-                if ($image_limit !== '' && ($slides+1) > $image_limit) {
1024
-                     break;
1025
-                }
1026
-                if (!empty($image)) {
1027
-                    $sizes = getimagesize(trim($image));
1028
-                    $width = !empty($sizes) && isset($sizes[0]) ? $sizes[0] : 0;
1029
-                    $height = !empty($sizes) && isset($sizes[1]) ? $sizes[1] : 0;
1030
-
1031
-                    if ($image && $width && $height) {
1032
-                        $image = (object)array('src' => $image, 'width' => $width, 'height' => $height);
1033
-                    }
1034
-
1035
-                    if (isset($image->src)) {
1036
-                        if ($image->height >= 400) {
1037
-                            $spacer_height = 0;
1038
-                        } else {
1039
-                            $spacer_height = ((400 - $image->height) / 2);
1040
-                        }
1041
-
1042
-                        $image_title = isset($image->title) ? $image->title : '';
1043
-
1044
-                        $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1045
-                        $main_slides .= '<img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:400px;margin:0 auto;" /></li>';
1046
-                        $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:48px;margin:0 auto;" /></li>';
1047
-                        $slides++;
1048
-                    }
1049
-                }
1050
-            }// endfore
1051
-        } //end if
1052
-    } else {
1053
-        $main_slides = '';
1054
-        $nav_slides = '';
1055
-        /**
1056
-         * Filter if default images should show on the details page.
1057
-         *
1058
-         * @param bool $use_default_image Default false.
1059
-         * @since 1.6.16
1060
-         */
1061
-        $use_default_image = apply_filters('geodir_details_default_image_show', false);
1062
-        $post_images = geodir_get_images($post->ID, 'thumbnail', $use_default_image); // Hide default image on listing preview/detail page.
1063
-        $slides = 0;
1064
-
1065
-        if (!empty($post_images)) {
1066
-            foreach ($post_images as $image) {
1067
-                if ($image_limit !== '' && ($slides+1) > $image_limit) {
1068
-                     break;
1069
-                }
1070
-                if ($image->height >= 400) {
1071
-                    $spacer_height = 0;
1072
-                } else {
1073
-                    $spacer_height = ((400 - $image->height) / 2);
1074
-                }
1075
-
1076
-                $caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : '';
1077
-                $main_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>';
1078
-                $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>';
1079
-                $slides++;
1080
-            }
1081
-        }// endfore
1082
-    }
1004
+	$package_info = geodir_post_package_info(array(), $post, (!empty($post->post_type) ? $post->post_type : ''));
1005
+	$image_limit = '';
1006
+	if (defined('GEODIRPAYMENT_VERSION') && !empty($package_info) && isset($package_info->image_limit) && $package_info->image_limit !== '') {
1007
+		$image_limit = (int)$package_info->image_limit;
1008
+	}
1009
+
1010
+	if ($preview) {
1011
+		$post_images = array();
1012
+		if (isset($post->post_images) && !empty($post->post_images)) {
1013
+			$post->post_images = trim($post->post_images, ",");
1014
+			$post_images = explode(",", $post->post_images);
1015
+		}
1016
+
1017
+		$main_slides = '';
1018
+		$nav_slides = '';
1019
+		$slides = 0;
1020
+
1021
+		if (!empty($post_images)) {
1022
+			foreach ($post_images as $image) {
1023
+				if ($image_limit !== '' && ($slides+1) > $image_limit) {
1024
+					 break;
1025
+				}
1026
+				if (!empty($image)) {
1027
+					$sizes = getimagesize(trim($image));
1028
+					$width = !empty($sizes) && isset($sizes[0]) ? $sizes[0] : 0;
1029
+					$height = !empty($sizes) && isset($sizes[1]) ? $sizes[1] : 0;
1030
+
1031
+					if ($image && $width && $height) {
1032
+						$image = (object)array('src' => $image, 'width' => $width, 'height' => $height);
1033
+					}
1034
+
1035
+					if (isset($image->src)) {
1036
+						if ($image->height >= 400) {
1037
+							$spacer_height = 0;
1038
+						} else {
1039
+							$spacer_height = ((400 - $image->height) / 2);
1040
+						}
1041
+
1042
+						$image_title = isset($image->title) ? $image->title : '';
1043
+
1044
+						$main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1045
+						$main_slides .= '<img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:400px;margin:0 auto;" /></li>';
1046
+						$nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:48px;margin:0 auto;" /></li>';
1047
+						$slides++;
1048
+					}
1049
+				}
1050
+			}// endfore
1051
+		} //end if
1052
+	} else {
1053
+		$main_slides = '';
1054
+		$nav_slides = '';
1055
+		/**
1056
+		 * Filter if default images should show on the details page.
1057
+		 *
1058
+		 * @param bool $use_default_image Default false.
1059
+		 * @since 1.6.16
1060
+		 */
1061
+		$use_default_image = apply_filters('geodir_details_default_image_show', false);
1062
+		$post_images = geodir_get_images($post->ID, 'thumbnail', $use_default_image); // Hide default image on listing preview/detail page.
1063
+		$slides = 0;
1064
+
1065
+		if (!empty($post_images)) {
1066
+			foreach ($post_images as $image) {
1067
+				if ($image_limit !== '' && ($slides+1) > $image_limit) {
1068
+					 break;
1069
+				}
1070
+				if ($image->height >= 400) {
1071
+					$spacer_height = 0;
1072
+				} else {
1073
+					$spacer_height = ((400 - $image->height) / 2);
1074
+				}
1075
+
1076
+				$caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : '';
1077
+				$main_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>';
1078
+				$nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>';
1079
+				$slides++;
1080
+			}
1081
+		}// endfore
1082
+	}
1083 1083
 
1084
-    if (!empty($post_images)) {
1085
-        ?>
1084
+	if (!empty($post_images)) {
1085
+		?>
1086 1086
         <div class="geodir_flex-container">
1087 1087
             <div class="geodir_flex-loader"><i class="fa fa-refresh fa-spin"></i></div>
1088 1088
             <div id="geodir_slider" class="geodir_flexslider ">
@@ -1095,7 +1095,7 @@  discard block
 block discarded – undo
1095 1095
             <?php } ?>
1096 1096
         </div>
1097 1097
     <?php
1098
-    }
1098
+	}
1099 1099
 }
1100 1100
 
1101 1101
 add_action('geodir_details_taxonomies', 'geodir_action_details_taxonomies', 10);
@@ -1110,177 +1110,177 @@  discard block
 block discarded – undo
1110 1110
  */
1111 1111
 function geodir_action_details_taxonomies()
1112 1112
 {
1113
-    global $preview, $post;?>
1113
+	global $preview, $post;?>
1114 1114
     <p class="geodir_post_taxomomies clearfix">
1115 1115
     <?php
1116
-    $taxonomies = array();
1117
-
1118
-    $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
1119
-
1120
-    if ($preview && !$is_backend_preview) {
1121
-        $post_type = $post->listing_type;
1122
-        $post_taxonomy = $post_type . 'category';
1123
-        $post->{$post_taxonomy} = $post->post_category[$post_taxonomy];
1124
-    } else {
1125
-        $post_type = $post->post_type;
1126
-        $post_taxonomy = $post_type . 'category';
1127
-    }
1116
+	$taxonomies = array();
1117
+
1118
+	$is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
1119
+
1120
+	if ($preview && !$is_backend_preview) {
1121
+		$post_type = $post->listing_type;
1122
+		$post_taxonomy = $post_type . 'category';
1123
+		$post->{$post_taxonomy} = $post->post_category[$post_taxonomy];
1124
+	} else {
1125
+		$post_type = $post->post_type;
1126
+		$post_taxonomy = $post_type . 'category';
1127
+	}
1128 1128
 //{	
1129
-    $post_type_info = get_post_type_object($post_type);
1130
-    $listing_label = __($post_type_info->labels->singular_name, 'geodirectory');
1131
-
1132
-    if (!empty($post->post_tags)) {
1133
-
1134
-        if (taxonomy_exists($post_type . '_tags')):
1135
-            $links = array();
1136
-            $terms = array();
1137
-            // to limit post tags
1138
-            $post_tags = trim($post->post_tags, ",");
1139
-            $post_id = isset($post->ID) ? $post->ID : '';
1140
-            /**
1141
-             * Filter the post tags.
1142
-             *
1143
-             * Allows you to filter the post tags output on the details page of a post.
1144
-             *
1145
-             * @since 1.0.0
1146
-             * @param string $post_tags A comma seperated list of tags.
1147
-             * @param int $post_id The current post id.
1148
-             */
1149
-            $post_tags = apply_filters('geodir_action_details_post_tags', $post_tags, $post_id);
1150
-
1151
-            $post->post_tags = $post_tags;
1152
-            $post_tags = explode(",", trim($post->post_tags, ","));
1153
-
1154
-
1155
-            foreach ($post_tags as $post_term) {
1156
-
1157
-                // fix slug creation order for tags & location
1158
-                $post_term = trim($post_term);
1159
-
1160
-                $priority_location = false;
1161
-                if ($insert_term = term_exists($post_term, $post_type . '_tags')) {
1162
-                    $term = get_term_by('id', $insert_term['term_id'], $post_type . '_tags');
1163
-                } else {
1164
-                    $post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL;
1165
-                    $post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL;
1166
-                    $post_city = isset($_REQUEST['post_city']) && $_REQUEST['post_city'] != '' ? sanitize_text_field($_REQUEST['post_city']) : NULL;
1167
-                    $match_country = $post_country && sanitize_title($post_term) == sanitize_title($post_country) ? true : false;
1168
-                    $match_region = $post_region && sanitize_title($post_term) == sanitize_title($post_region) ? true : false;
1169
-                    $match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false;
1170
-                    if ($match_country || $match_region || $match_city) {
1171
-                        $priority_location = true;
1172
-                        $term = get_term_by('name', $post_term, $post_type . '_tags');
1173
-                    } else {
1174
-                        $insert_term = wp_insert_term($post_term, $post_type . '_tags');
1175
-                        $term = get_term_by('name', $post_term, $post_type . '_tags');
1176
-                    }
1177
-                }
1178
-
1179
-                if (!is_wp_error($term) && is_object($term)) {
1180
-
1181
-                    // fix tag link on detail page
1182
-                    if ($priority_location) {
1183
-
1184
-                        $tag_link = "<a href=''>$post_term</a>";
1185
-                        /**
1186
-                         * Filter the tag name on the details page.
1187
-                         *
1188
-                         * @since 1.5.6
1189
-                         * @param string $tag_link The tag link html.
1190
-                         * @param object $term The tag term object.
1191
-                         */
1192
-                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1193
-                        $links[] = $tag_link;
1194
-                    } else {
1195
-                        $tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>";
1196
-                        /** This action is documented in geodirectory-template_actions.php */
1197
-                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1198
-                        $links[] = $tag_link;
1199
-                    }
1200
-                    $terms[] = $term;
1201
-                }
1202
-                //
1203
-            }
1204
-            if (!isset($listing_label)) {
1205
-                $listing_label = '';
1206
-            }
1207
-            $taxonomies[$post_type . '_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1208
-        endif;
1209
-
1210
-    }
1211
-
1212
-    if (!empty($post->{$post_taxonomy})) {
1213
-        $links = array();
1214
-        $terms = array();
1215
-        $termsOrdered = array();
1216
-        if (!is_array($post->{$post_taxonomy})) {
1217
-            $post_term = explode(",", trim($post->{$post_taxonomy}, ","));
1218
-        } else {
1219
-            $post_term = $post->{$post_taxonomy};
1129
+	$post_type_info = get_post_type_object($post_type);
1130
+	$listing_label = __($post_type_info->labels->singular_name, 'geodirectory');
1131
+
1132
+	if (!empty($post->post_tags)) {
1133
+
1134
+		if (taxonomy_exists($post_type . '_tags')):
1135
+			$links = array();
1136
+			$terms = array();
1137
+			// to limit post tags
1138
+			$post_tags = trim($post->post_tags, ",");
1139
+			$post_id = isset($post->ID) ? $post->ID : '';
1140
+			/**
1141
+			 * Filter the post tags.
1142
+			 *
1143
+			 * Allows you to filter the post tags output on the details page of a post.
1144
+			 *
1145
+			 * @since 1.0.0
1146
+			 * @param string $post_tags A comma seperated list of tags.
1147
+			 * @param int $post_id The current post id.
1148
+			 */
1149
+			$post_tags = apply_filters('geodir_action_details_post_tags', $post_tags, $post_id);
1150
+
1151
+			$post->post_tags = $post_tags;
1152
+			$post_tags = explode(",", trim($post->post_tags, ","));
1153
+
1154
+
1155
+			foreach ($post_tags as $post_term) {
1156
+
1157
+				// fix slug creation order for tags & location
1158
+				$post_term = trim($post_term);
1159
+
1160
+				$priority_location = false;
1161
+				if ($insert_term = term_exists($post_term, $post_type . '_tags')) {
1162
+					$term = get_term_by('id', $insert_term['term_id'], $post_type . '_tags');
1163
+				} else {
1164
+					$post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL;
1165
+					$post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL;
1166
+					$post_city = isset($_REQUEST['post_city']) && $_REQUEST['post_city'] != '' ? sanitize_text_field($_REQUEST['post_city']) : NULL;
1167
+					$match_country = $post_country && sanitize_title($post_term) == sanitize_title($post_country) ? true : false;
1168
+					$match_region = $post_region && sanitize_title($post_term) == sanitize_title($post_region) ? true : false;
1169
+					$match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false;
1170
+					if ($match_country || $match_region || $match_city) {
1171
+						$priority_location = true;
1172
+						$term = get_term_by('name', $post_term, $post_type . '_tags');
1173
+					} else {
1174
+						$insert_term = wp_insert_term($post_term, $post_type . '_tags');
1175
+						$term = get_term_by('name', $post_term, $post_type . '_tags');
1176
+					}
1177
+				}
1178
+
1179
+				if (!is_wp_error($term) && is_object($term)) {
1180
+
1181
+					// fix tag link on detail page
1182
+					if ($priority_location) {
1183
+
1184
+						$tag_link = "<a href=''>$post_term</a>";
1185
+						/**
1186
+						 * Filter the tag name on the details page.
1187
+						 *
1188
+						 * @since 1.5.6
1189
+						 * @param string $tag_link The tag link html.
1190
+						 * @param object $term The tag term object.
1191
+						 */
1192
+						$tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1193
+						$links[] = $tag_link;
1194
+					} else {
1195
+						$tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>";
1196
+						/** This action is documented in geodirectory-template_actions.php */
1197
+						$tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1198
+						$links[] = $tag_link;
1199
+					}
1200
+					$terms[] = $term;
1201
+				}
1202
+				//
1203
+			}
1204
+			if (!isset($listing_label)) {
1205
+				$listing_label = '';
1206
+			}
1207
+			$taxonomies[$post_type . '_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1208
+		endif;
1209
+
1210
+	}
1211
+
1212
+	if (!empty($post->{$post_taxonomy})) {
1213
+		$links = array();
1214
+		$terms = array();
1215
+		$termsOrdered = array();
1216
+		if (!is_array($post->{$post_taxonomy})) {
1217
+			$post_term = explode(",", trim($post->{$post_taxonomy}, ","));
1218
+		} else {
1219
+			$post_term = $post->{$post_taxonomy};
1220 1220
 			
1221 1221
 			if ($preview && !$is_backend_preview) {
1222 1222
 				$post_term = geodir_add_parent_terms($post_term, $post_taxonomy);
1223 1223
 			}
1224
-        }
1225
-
1226
-        $post_term = array_unique($post_term);
1227
-        if (!empty($post_term)) {
1228
-            foreach ($post_term as $post_term) {
1229
-                $post_term = trim($post_term);
1230
-
1231
-                if ($post_term != ''):
1232
-                    $term = get_term_by('id', $post_term, $post_taxonomy);
1233
-
1234
-                    if (is_object($term)) {
1235
-                        $term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>";
1236
-                        /**
1237
-                         * Filter the category name on the details page.
1238
-                         *
1239
-                         * @since 1.5.6
1240
-                         * @param string $term_link The link html to the category.
1241
-                         * @param object $term The category term object.
1242
-                         */
1243
-                        $term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term);
1244
-                        $links[] = $term_link;
1245
-                        $terms[] = $term;
1246
-                    }
1247
-                endif;
1248
-            }
1249
-            // order alphabetically
1250
-            asort($links);
1251
-            foreach (array_keys($links) as $key) {
1252
-                $termsOrdered[$key] = $terms[$key];
1253
-            }
1254
-            $terms = $termsOrdered;
1224
+		}
1225
+
1226
+		$post_term = array_unique($post_term);
1227
+		if (!empty($post_term)) {
1228
+			foreach ($post_term as $post_term) {
1229
+				$post_term = trim($post_term);
1230
+
1231
+				if ($post_term != ''):
1232
+					$term = get_term_by('id', $post_term, $post_taxonomy);
1233
+
1234
+					if (is_object($term)) {
1235
+						$term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>";
1236
+						/**
1237
+						 * Filter the category name on the details page.
1238
+						 *
1239
+						 * @since 1.5.6
1240
+						 * @param string $term_link The link html to the category.
1241
+						 * @param object $term The category term object.
1242
+						 */
1243
+						$term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term);
1244
+						$links[] = $term_link;
1245
+						$terms[] = $term;
1246
+					}
1247
+				endif;
1248
+			}
1249
+			// order alphabetically
1250
+			asort($links);
1251
+			foreach (array_keys($links) as $key) {
1252
+				$termsOrdered[$key] = $terms[$key];
1253
+			}
1254
+			$terms = $termsOrdered;
1255 1255
 
1256
-        }
1256
+		}
1257 1257
 
1258
-        if (!isset($listing_label)) {
1259
-            $listing_label = '';
1260
-        }
1261
-        $taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1258
+		if (!isset($listing_label)) {
1259
+			$listing_label = '';
1260
+		}
1261
+		$taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1262 1262
 
1263
-    }
1263
+	}
1264 1264
 
1265
-    /**
1266
-     * Filter the taxonomies array before output.
1267
-     *
1268
-     * @since 1.5.9
1269
-     * @param array $taxonomies The array of cats and tags.
1270
-     * @param string $post_type The post type being output.
1271
-     * @param string $listing_label The post type label.
1272
-     * @param string $listing_label The post type label with ucwords function.
1273
-     */
1274
-    $taxonomies = apply_filters('geodir_details_taxonomies_output',$taxonomies,$post_type,$listing_label,geodir_ucwords($listing_label));
1265
+	/**
1266
+	 * Filter the taxonomies array before output.
1267
+	 *
1268
+	 * @since 1.5.9
1269
+	 * @param array $taxonomies The array of cats and tags.
1270
+	 * @param string $post_type The post type being output.
1271
+	 * @param string $listing_label The post type label.
1272
+	 * @param string $listing_label The post type label with ucwords function.
1273
+	 */
1274
+	$taxonomies = apply_filters('geodir_details_taxonomies_output',$taxonomies,$post_type,$listing_label,geodir_ucwords($listing_label));
1275 1275
 
1276
-    if (isset($taxonomies[$post_taxonomy])) {
1277
-        echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>';
1278
-    }
1276
+	if (isset($taxonomies[$post_taxonomy])) {
1277
+		echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>';
1278
+	}
1279 1279
 
1280
-    if (isset($taxonomies[$post_type . '_tags']))
1281
-        echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>';
1280
+	if (isset($taxonomies[$post_type . '_tags']))
1281
+		echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>';
1282 1282
 
1283
-    ?>
1283
+	?>
1284 1284
     </p><?php
1285 1285
 }
1286 1286
 
@@ -1302,144 +1302,144 @@  discard block
 block discarded – undo
1302 1302
 function geodir_action_details_micordata($post='')
1303 1303
 {
1304 1304
 
1305
-    global $preview;
1306
-    if(empty($post)){global $post;}
1307
-    if ($preview || !geodir_is_page('detail')) {
1308
-        return;
1309
-    }
1310
-
1311
-    // url
1312
-    $c_url = geodir_curPageURL();
1313
-
1314
-    // post reviews
1315
-    $post_reviews = get_comments(array('post_id' => $post->ID, 'status' => 'approve'));
1316
-    if (empty($post_reviews)) {
1317
-        $reviews = '';
1318
-    } else {
1319
-        foreach ($post_reviews as $review) {
1320
-
1321
-            if($rating_value = geodir_get_commentoverall($review->comment_ID)){
1322
-                $reviews[] = array(
1323
-                    "@type" => "Review",
1324
-                    "author" => $review->comment_author,
1325
-                    "datePublished" => $review->comment_date,
1326
-                    "description" => $review->comment_content,
1327
-                    "reviewRating" => array(
1328
-                        "@type" => "Rating",
1329
-                        "bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score.
1330
-                        "ratingValue" => $rating_value,
1331
-                        "worstRating" => "1"
1332
-                    )
1333
-                );
1334
-            }
1335
-
1336
-        }
1337
-
1338
-    }
1339
-
1340
-    // post images
1341
-    $post_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
1342
-    if (empty($post_images)) {
1343
-        $images = '';
1344
-    } else {
1345
-        $i_arr = array();
1346
-        foreach ($post_images as $img) {
1347
-            $i_arr[] = $img->src;
1348
-        }
1349
-
1350
-        if (count($i_arr) == 1) {
1351
-            $images = $i_arr[0];
1352
-        } else {
1353
-            $images = $i_arr;
1354
-        }
1305
+	global $preview;
1306
+	if(empty($post)){global $post;}
1307
+	if ($preview || !geodir_is_page('detail')) {
1308
+		return;
1309
+	}
1310
+
1311
+	// url
1312
+	$c_url = geodir_curPageURL();
1313
+
1314
+	// post reviews
1315
+	$post_reviews = get_comments(array('post_id' => $post->ID, 'status' => 'approve'));
1316
+	if (empty($post_reviews)) {
1317
+		$reviews = '';
1318
+	} else {
1319
+		foreach ($post_reviews as $review) {
1320
+
1321
+			if($rating_value = geodir_get_commentoverall($review->comment_ID)){
1322
+				$reviews[] = array(
1323
+					"@type" => "Review",
1324
+					"author" => $review->comment_author,
1325
+					"datePublished" => $review->comment_date,
1326
+					"description" => $review->comment_content,
1327
+					"reviewRating" => array(
1328
+						"@type" => "Rating",
1329
+						"bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score.
1330
+						"ratingValue" => $rating_value,
1331
+						"worstRating" => "1"
1332
+					)
1333
+				);
1334
+			}
1355 1335
 
1356
-    }
1357
-    //print_r($post);
1358
-    // external links
1359
-    $external_links =  array();
1360
-    $external_links[] = $post->geodir_website;
1361
-    $external_links[] = $post->geodir_twitter;
1362
-    $external_links[] = $post->geodir_facebook;
1363
-    $external_links = array_filter($external_links);
1364
-
1365
-    if(!empty($external_links)){
1366
-        $external_links = array_values($external_links);
1367
-    }
1368
-
1369
-    // reviews
1370
-    $comment_count = geodir_get_review_count_total($post->ID);
1371
-    $post_avgratings = geodir_get_post_rating($post->ID);
1372
-
1373
-    // schema type
1374
-    $schema_type = 'LocalBusiness';
1375
-    if(isset($post->default_category) && $post->default_category){
1376
-        $cat_schema = geodir_get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type);
1377
-        if($cat_schema){$schema_type = $cat_schema;}
1378
-        if(!$cat_schema && $schema_type=='LocalBusiness' && $post->post_type=='gd_event'){$schema_type = 'Event';}
1379
-    }
1380
-
1381
-    $schema = array();
1382
-    $schema['@context'] = "https://schema.org";
1383
-    $schema['@type'] = $schema_type;
1384
-    $schema['name'] = $post->post_title;
1385
-    $schema['description'] = wp_strip_all_tags( $post->post_content, true );
1386
-    $schema['telephone'] = $post->geodir_contact;
1387
-    $schema['url'] = $c_url;
1388
-    $schema['sameAs'] = $external_links;
1389
-    $schema['image'] = $images;
1390
-    $schema['address'] = array(
1391
-        "@type" => "PostalAddress",
1392
-        "streetAddress" => $post->post_address,
1393
-        "addressLocality" => $post->post_city,
1394
-        "addressRegion" => $post->post_region,
1395
-        "addressCountry" => $post->post_country,
1396
-        "postalCode" => $post->post_zip
1397
-    );
1398
-
1399
-    if($post->post_latitude && $post->post_longitude) {
1400
-        $schema['geo'] = array(
1401
-            "@type" => "GeoCoordinates",
1402
-            "latitude" => $post->post_latitude,
1403
-            "longitude" => $post->post_longitude
1404
-        );
1405
-    }
1406
-
1407
-    if($post_avgratings) {
1408
-        $schema['aggregateRating'] = array(
1409
-            "@type" => "AggregateRating",
1410
-            "ratingValue" => $post_avgratings,
1411
-            "bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score.
1412
-            "worstRating" => "1",
1413
-            "ratingCount" => $comment_count
1414
-        );
1415
-    }
1416
-    $schema['review'] = $reviews;
1417
-
1418
-    /**
1419
-     * Allow the schema JSON-LD info to be filtered.
1420
-     *
1421
-     * @since 1.5.4
1422
-     * @since 1.5.7 Added $post variable.
1423
-     * @param array $schema The array of schema data to be filtered.
1424
-     * @param object $post The post object.
1425
-     */
1426
-    $schema = apply_filters('geodir_details_schema', $schema,$post);
1427
-
1428
-
1429
-    echo '<script type="application/ld+json">' . json_encode($schema) . '</script>';
1430
-
1431
-
1432
-    $uploads = wp_upload_dir();
1433
-    $facebook_og = (isset($post->featured_image) && $post->featured_image) ? '<meta property="og:image" content="'.$uploads['baseurl'].$post->featured_image.'"/>' : '';
1434
-
1435
-    /**
1436
-     * Show facebook open graph meta info
1437
-     *
1438
-     * @since 1.6.6
1439
-     * @param string $facebook_og The open graph html to be filtered.
1440
-     * @param object $post The post object.
1441
-     */
1442
-    echo apply_filters('geodir_details_facebook_og', $facebook_og,$post);
1336
+		}
1337
+
1338
+	}
1339
+
1340
+	// post images
1341
+	$post_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
1342
+	if (empty($post_images)) {
1343
+		$images = '';
1344
+	} else {
1345
+		$i_arr = array();
1346
+		foreach ($post_images as $img) {
1347
+			$i_arr[] = $img->src;
1348
+		}
1349
+
1350
+		if (count($i_arr) == 1) {
1351
+			$images = $i_arr[0];
1352
+		} else {
1353
+			$images = $i_arr;
1354
+		}
1355
+
1356
+	}
1357
+	//print_r($post);
1358
+	// external links
1359
+	$external_links =  array();
1360
+	$external_links[] = $post->geodir_website;
1361
+	$external_links[] = $post->geodir_twitter;
1362
+	$external_links[] = $post->geodir_facebook;
1363
+	$external_links = array_filter($external_links);
1364
+
1365
+	if(!empty($external_links)){
1366
+		$external_links = array_values($external_links);
1367
+	}
1368
+
1369
+	// reviews
1370
+	$comment_count = geodir_get_review_count_total($post->ID);
1371
+	$post_avgratings = geodir_get_post_rating($post->ID);
1372
+
1373
+	// schema type
1374
+	$schema_type = 'LocalBusiness';
1375
+	if(isset($post->default_category) && $post->default_category){
1376
+		$cat_schema = geodir_get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type);
1377
+		if($cat_schema){$schema_type = $cat_schema;}
1378
+		if(!$cat_schema && $schema_type=='LocalBusiness' && $post->post_type=='gd_event'){$schema_type = 'Event';}
1379
+	}
1380
+
1381
+	$schema = array();
1382
+	$schema['@context'] = "https://schema.org";
1383
+	$schema['@type'] = $schema_type;
1384
+	$schema['name'] = $post->post_title;
1385
+	$schema['description'] = wp_strip_all_tags( $post->post_content, true );
1386
+	$schema['telephone'] = $post->geodir_contact;
1387
+	$schema['url'] = $c_url;
1388
+	$schema['sameAs'] = $external_links;
1389
+	$schema['image'] = $images;
1390
+	$schema['address'] = array(
1391
+		"@type" => "PostalAddress",
1392
+		"streetAddress" => $post->post_address,
1393
+		"addressLocality" => $post->post_city,
1394
+		"addressRegion" => $post->post_region,
1395
+		"addressCountry" => $post->post_country,
1396
+		"postalCode" => $post->post_zip
1397
+	);
1398
+
1399
+	if($post->post_latitude && $post->post_longitude) {
1400
+		$schema['geo'] = array(
1401
+			"@type" => "GeoCoordinates",
1402
+			"latitude" => $post->post_latitude,
1403
+			"longitude" => $post->post_longitude
1404
+		);
1405
+	}
1406
+
1407
+	if($post_avgratings) {
1408
+		$schema['aggregateRating'] = array(
1409
+			"@type" => "AggregateRating",
1410
+			"ratingValue" => $post_avgratings,
1411
+			"bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score.
1412
+			"worstRating" => "1",
1413
+			"ratingCount" => $comment_count
1414
+		);
1415
+	}
1416
+	$schema['review'] = $reviews;
1417
+
1418
+	/**
1419
+	 * Allow the schema JSON-LD info to be filtered.
1420
+	 *
1421
+	 * @since 1.5.4
1422
+	 * @since 1.5.7 Added $post variable.
1423
+	 * @param array $schema The array of schema data to be filtered.
1424
+	 * @param object $post The post object.
1425
+	 */
1426
+	$schema = apply_filters('geodir_details_schema', $schema,$post);
1427
+
1428
+
1429
+	echo '<script type="application/ld+json">' . json_encode($schema) . '</script>';
1430
+
1431
+
1432
+	$uploads = wp_upload_dir();
1433
+	$facebook_og = (isset($post->featured_image) && $post->featured_image) ? '<meta property="og:image" content="'.$uploads['baseurl'].$post->featured_image.'"/>' : '';
1434
+
1435
+	/**
1436
+	 * Show facebook open graph meta info
1437
+	 *
1438
+	 * @since 1.6.6
1439
+	 * @param string $facebook_og The open graph html to be filtered.
1440
+	 * @param object $post The post object.
1441
+	 */
1442
+	echo apply_filters('geodir_details_facebook_og', $facebook_og,$post);
1443 1443
 
1444 1444
 
1445 1445
 
@@ -1459,7 +1459,7 @@  discard block
 block discarded – undo
1459 1459
  */
1460 1460
 function geodir_action_details_next_prev()
1461 1461
 {
1462
-    ?>
1462
+	?>
1463 1463
     <div class="geodir-pos_navigation clearfix">
1464 1464
     <div
1465 1465
         class="geodir-post_left"><?php previous_post_link('%link', '' . __('Previous', 'geodirectory'), false) ?></div>
@@ -1477,15 +1477,15 @@  discard block
 block discarded – undo
1477 1477
  */
1478 1478
 function geodir_action_before_single_post()
1479 1479
 {
1480
-    global $post;
1481
-    /**
1482
-     * Called at the very start of the details page output, before the title section.
1483
-     *
1484
-     * @since 1.0.0
1485
-     * @param object $post The current post object.
1486
-     * @global WP_Post|null $post The current post, if available.
1487
-     */
1488
-    do_action('geodir_before_single_post', $post); // extra action	
1480
+	global $post;
1481
+	/**
1482
+	 * Called at the very start of the details page output, before the title section.
1483
+	 *
1484
+	 * @since 1.0.0
1485
+	 * @param object $post The current post object.
1486
+	 * @global WP_Post|null $post The current post, if available.
1487
+	 */
1488
+	do_action('geodir_before_single_post', $post); // extra action	
1489 1489
 }
1490 1490
 
1491 1491
 /**
@@ -1496,13 +1496,13 @@  discard block
 block discarded – undo
1496 1496
  */
1497 1497
 function geodir_action_after_single_post($post)
1498 1498
 {
1499
-    /**
1500
-     * Called on the details page after the details page tabs section and before the next/prev buttons.
1501
-     *
1502
-     * @since 1.0.0
1503
-     * @param object $post The current post object.
1504
-     */
1505
-    do_action('geodir_after_single_post', $post); // extra action	
1499
+	/**
1500
+	 * Called on the details page after the details page tabs section and before the next/prev buttons.
1501
+	 *
1502
+	 * @since 1.0.0
1503
+	 * @param object $post The current post object.
1504
+	 */
1505
+	do_action('geodir_after_single_post', $post); // extra action	
1506 1506
 }
1507 1507
 
1508 1508
 add_action('geodir_details_main_content', 'geodir_action_before_single_post', 10);
@@ -1528,168 +1528,168 @@  discard block
 block discarded – undo
1528 1528
  */
1529 1529
 function geodir_action_listings_title()
1530 1530
 {
1531
-    global $wp, $term;
1532
-
1533
-    $gd_post_type = geodir_get_current_posttype();
1534
-    $post_type_info = get_post_type_object($gd_post_type);
1531
+	global $wp, $term;
1535 1532
 
1536
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
1537
-    if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
1538
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
1539
-    }
1533
+	$gd_post_type = geodir_get_current_posttype();
1534
+	$post_type_info = get_post_type_object($gd_post_type);
1540 1535
 
1541
-    $list_title = $add_string_in_title . __($post_type_info->labels->name, 'geodirectory');
1542
-    $single_name = $post_type_info->labels->singular_name;
1536
+	$add_string_in_title = __('All', 'geodirectory') . ' ';
1537
+	if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
1538
+		$add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
1539
+	}
1543 1540
 
1544
-    $taxonomy = geodir_get_taxonomies($gd_post_type, true);
1541
+	$list_title = $add_string_in_title . __($post_type_info->labels->name, 'geodirectory');
1542
+	$single_name = $post_type_info->labels->singular_name;
1545 1543
 
1546
-    $gd_country = get_query_var('gd_country');
1547
-    $gd_region = get_query_var('gd_region');
1548
-    $gd_city = get_query_var('gd_city');
1544
+	$taxonomy = geodir_get_taxonomies($gd_post_type, true);
1549 1545
 
1550
-    if (!empty($term)) {
1551
-        $location_name = '';
1552
-        if ($gd_country != '' || $gd_region != '' || $gd_city != '') {
1553
-            if ($gd_country != '') {
1554
-                $location_name = geodir_sanitize_location_name('gd_country', $gd_country);
1555
-            }
1546
+	$gd_country = get_query_var('gd_country');
1547
+	$gd_region = get_query_var('gd_region');
1548
+	$gd_city = get_query_var('gd_city');
1556 1549
 
1557
-            if ($gd_region != '') {
1558
-                $location_name = geodir_sanitize_location_name('gd_region', $gd_region);
1559
-            }
1560
-
1561
-            if ($gd_city != '') {
1562
-                $location_name = geodir_sanitize_location_name('gd_city', $gd_city);
1563
-            }
1564
-        }
1565
-
1566
-        $current_term = get_term_by('slug', $term, $taxonomy[0]);
1567
-        if (!empty($current_term)) {
1568
-            $current_term_name = __(geodir_utf8_ucfirst($current_term->name), 'geodirectory');
1569
-            if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1570
-                $location_last_char = substr($location_name, -1);
1571
-                $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1572
-                $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1573
-            } else {
1574
-                $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1575
-            }
1576
-        } else {
1577
-            if (count($taxonomy) > 1) {
1578
-                $current_term = get_term_by('slug', $term, $taxonomy[1]);
1579
-
1580
-                if (!empty($current_term)) {
1581
-                    $current_term_name = __(geodir_utf8_ucfirst($current_term->name), 'geodirectory');
1582
-                    if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1583
-                        $location_last_char = substr($location_name, -1);
1584
-                        $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1585
-                        $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1586
-                    } else {
1587
-                        $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1588
-                    }
1589
-                }
1590
-            }
1591
-        }
1592
-
1593
-    } else {
1594
-        $gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : '';
1595
-        $gd_region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : '';
1596
-        $gd_city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : '';
1597
-
1598
-        $gd_country_actual = $gd_region_actual = $gd_city_actual = '';
1599
-
1600
-        if (function_exists('get_actual_location_name')) {
1601
-            $gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
1602
-            $gd_region_actual = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
1603
-            $gd_city_actual = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
1604
-        }
1605
-
1606
-        if ($gd_city != '') {
1607
-            if ($gd_city_actual != '') {
1608
-                $gd_city = $gd_city_actual;
1609
-            } else {
1610
-                $gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
1611
-                $gd_city = preg_replace('/[_-]/', ' ', $gd_city);
1612
-                $gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
1613
-            }
1614
-
1615
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'";
1616
-        } else if ($gd_region != '') {
1617
-            if ($gd_region_actual != '') {
1618
-                $gd_region = $gd_region_actual;
1619
-            } else {
1620
-                $gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
1621
-                $gd_region = preg_replace('/[_-]/', ' ', $gd_region);
1622
-                $gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
1623
-            }
1624
-
1625
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'";
1626
-        } else if ($gd_country != '') {
1627
-            if ($gd_country_actual != '') {
1628
-                $gd_country = $gd_country_actual;
1629
-            } else {
1630
-                $gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
1631
-                $gd_country = preg_replace('/[_-]/', ' ', $gd_country);
1632
-                $gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
1633
-            }
1634
-
1635
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'";
1636
-        }
1637
-    }
1638
-
1639
-    if (is_search()) {
1640
-        $list_title = __('Search', 'geodirectory') . ' ' . __(geodir_utf8_ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
1641
-    }
1642
-    /** This action is documented in geodirectory_template_actions.php */
1643
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
1644
-    /** This action is documented in geodirectory_template_actions.php */
1645
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
1646
-
1647
-
1648
-    $title = $list_title;
1649
-    $gd_page = '';
1650
-    if(geodir_is_page('pt')){
1651
-        $gd_page = 'pt';
1652
-        $title  = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1653
-    }
1654
-    elseif(geodir_is_page('listing')){
1655
-        $gd_page = 'listing';
1656
-        global $wp_query;
1657
-        $current_term = $wp_query->get_queried_object();
1658
-        if (strpos($current_term->taxonomy,'_tags') !== false) {
1659
-            $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
1660
-        }else{
1661
-            $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
1662
-        }
1550
+	if (!empty($term)) {
1551
+		$location_name = '';
1552
+		if ($gd_country != '' || $gd_region != '' || $gd_city != '') {
1553
+			if ($gd_country != '') {
1554
+				$location_name = geodir_sanitize_location_name('gd_country', $gd_country);
1555
+			}
1663 1556
 
1664
-    }
1665
-    elseif(geodir_is_page('author')){
1666
-        $gd_page = 'author';
1667
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
1668
-            $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
1669
-        }else{
1670
-            $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
1671
-        }
1557
+			if ($gd_region != '') {
1558
+				$location_name = geodir_sanitize_location_name('gd_region', $gd_region);
1559
+			}
1672 1560
 
1673
-    }
1561
+			if ($gd_city != '') {
1562
+				$location_name = geodir_sanitize_location_name('gd_city', $gd_city);
1563
+			}
1564
+		}
1565
+
1566
+		$current_term = get_term_by('slug', $term, $taxonomy[0]);
1567
+		if (!empty($current_term)) {
1568
+			$current_term_name = __(geodir_utf8_ucfirst($current_term->name), 'geodirectory');
1569
+			if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1570
+				$location_last_char = substr($location_name, -1);
1571
+				$location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1572
+				$list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1573
+			} else {
1574
+				$list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1575
+			}
1576
+		} else {
1577
+			if (count($taxonomy) > 1) {
1578
+				$current_term = get_term_by('slug', $term, $taxonomy[1]);
1579
+
1580
+				if (!empty($current_term)) {
1581
+					$current_term_name = __(geodir_utf8_ucfirst($current_term->name), 'geodirectory');
1582
+					if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1583
+						$location_last_char = substr($location_name, -1);
1584
+						$location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1585
+						$list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1586
+					} else {
1587
+						$list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1588
+					}
1589
+				}
1590
+			}
1591
+		}
1592
+
1593
+	} else {
1594
+		$gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : '';
1595
+		$gd_region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : '';
1596
+		$gd_city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : '';
1597
+
1598
+		$gd_country_actual = $gd_region_actual = $gd_city_actual = '';
1599
+
1600
+		if (function_exists('get_actual_location_name')) {
1601
+			$gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
1602
+			$gd_region_actual = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
1603
+			$gd_city_actual = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
1604
+		}
1605
+
1606
+		if ($gd_city != '') {
1607
+			if ($gd_city_actual != '') {
1608
+				$gd_city = $gd_city_actual;
1609
+			} else {
1610
+				$gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
1611
+				$gd_city = preg_replace('/[_-]/', ' ', $gd_city);
1612
+				$gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
1613
+			}
1674 1614
 
1615
+			$list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'";
1616
+		} else if ($gd_region != '') {
1617
+			if ($gd_region_actual != '') {
1618
+				$gd_region = $gd_region_actual;
1619
+			} else {
1620
+				$gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
1621
+				$gd_region = preg_replace('/[_-]/', ' ', $gd_region);
1622
+				$gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
1623
+			}
1675 1624
 
1676
-    /**
1677
-     * Filter page title to replace variables.
1678
-     *
1679
-     * @since 1.5.4
1680
-     * @param string $title The page title including variables.
1681
-     * @param string $gd_page The GeoDirectory page type if any.
1682
-     */
1683
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
1625
+			$list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'";
1626
+		} else if ($gd_country != '') {
1627
+			if ($gd_country_actual != '') {
1628
+				$gd_country = $gd_country_actual;
1629
+			} else {
1630
+				$gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
1631
+				$gd_country = preg_replace('/[_-]/', ' ', $gd_country);
1632
+				$gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
1633
+			}
1684 1634
 
1685
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
1686
-        /**
1687
-         * Filter the listing page title.
1688
-         *
1689
-         * @since 1.0.0
1690
-         * @param string $list_title The title for the category page.
1691
-         */
1692
-        apply_filters('geodir_listing_page_title', $title) . '</h1></header>';
1635
+			$list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'";
1636
+		}
1637
+	}
1638
+
1639
+	if (is_search()) {
1640
+		$list_title = __('Search', 'geodirectory') . ' ' . __(geodir_utf8_ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
1641
+	}
1642
+	/** This action is documented in geodirectory_template_actions.php */
1643
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
1644
+	/** This action is documented in geodirectory_template_actions.php */
1645
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
1646
+
1647
+
1648
+	$title = $list_title;
1649
+	$gd_page = '';
1650
+	if(geodir_is_page('pt')){
1651
+		$gd_page = 'pt';
1652
+		$title  = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1653
+	}
1654
+	elseif(geodir_is_page('listing')){
1655
+		$gd_page = 'listing';
1656
+		global $wp_query;
1657
+		$current_term = $wp_query->get_queried_object();
1658
+		if (strpos($current_term->taxonomy,'_tags') !== false) {
1659
+			$title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
1660
+		}else{
1661
+			$title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
1662
+		}
1663
+
1664
+	}
1665
+	elseif(geodir_is_page('author')){
1666
+		$gd_page = 'author';
1667
+		if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
1668
+			$title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
1669
+		}else{
1670
+			$title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
1671
+		}
1672
+
1673
+	}
1674
+
1675
+
1676
+	/**
1677
+	 * Filter page title to replace variables.
1678
+	 *
1679
+	 * @since 1.5.4
1680
+	 * @param string $title The page title including variables.
1681
+	 * @param string $gd_page The GeoDirectory page type if any.
1682
+	 */
1683
+	$title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
1684
+
1685
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
1686
+		/**
1687
+		 * Filter the listing page title.
1688
+		 *
1689
+		 * @since 1.0.0
1690
+		 * @param string $list_title The title for the category page.
1691
+		 */
1692
+		apply_filters('geodir_listing_page_title', $title) . '</h1></header>';
1693 1693
 }
1694 1694
 
1695 1695
 add_action('geodir_listings_page_description', 'geodir_action_listings_description', 10);
@@ -1702,46 +1702,46 @@  discard block
 block discarded – undo
1702 1702
  */
1703 1703
 function geodir_action_listings_description()
1704 1704
 {
1705
-    global $wp_query;
1706
-    $current_term = $wp_query->get_queried_object();
1705
+	global $wp_query;
1706
+	$current_term = $wp_query->get_queried_object();
1707 1707
 
1708
-    $gd_post_type = geodir_get_current_posttype();
1709
-    if (isset($current_term->term_id) && $current_term->term_id != '') {
1708
+	$gd_post_type = geodir_get_current_posttype();
1709
+	if (isset($current_term->term_id) && $current_term->term_id != '') {
1710 1710
 
1711
-        $term_desc = term_description($current_term->term_id, $gd_post_type . '_tags');
1712
-        $saved_data = stripslashes(geodir_get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type));
1713
-        if ($term_desc && !$saved_data) {
1714
-            $saved_data = $term_desc;
1715
-        }
1711
+		$term_desc = term_description($current_term->term_id, $gd_post_type . '_tags');
1712
+		$saved_data = stripslashes(geodir_get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type));
1713
+		if ($term_desc && !$saved_data) {
1714
+			$saved_data = $term_desc;
1715
+		}
1716 1716
 
1717
-        // stop payment manager filtering content length
1718
-        $filter_priority = has_filter( 'the_content', 'geodir_payments_the_content' );
1719
-        if ( false !== $filter_priority ) {
1720
-            remove_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1721
-        }
1717
+		// stop payment manager filtering content length
1718
+		$filter_priority = has_filter( 'the_content', 'geodir_payments_the_content' );
1719
+		if ( false !== $filter_priority ) {
1720
+			remove_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1721
+		}
1722 1722
 
1723
-        /**
1724
-         * Apply the core filter `the_content` filter to the variable string.
1725
-         *
1726
-         * This is a WordPress core filter that does many things.
1727
-         *
1728
-         * @since 1.0.0
1729
-         * @param string $var The string to apply the filter to.
1730
-         */
1731
-        $cat_description = apply_filters('the_content', $saved_data);
1723
+		/**
1724
+		 * Apply the core filter `the_content` filter to the variable string.
1725
+		 *
1726
+		 * This is a WordPress core filter that does many things.
1727
+		 *
1728
+		 * @since 1.0.0
1729
+		 * @param string $var The string to apply the filter to.
1730
+		 */
1731
+		$cat_description = apply_filters('the_content', $saved_data);
1732 1732
 
1733 1733
 
1734
-        if ( false !== $filter_priority ) {
1735
-            add_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1736
-        }
1734
+		if ( false !== $filter_priority ) {
1735
+			add_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1736
+		}
1737 1737
 
1738
-        if ($cat_description) {
1739
-            ?>
1738
+		if ($cat_description) {
1739
+			?>
1740 1740
 
1741 1741
             <div class="term_description"><?php echo $cat_description;?></div> <?php
1742
-        }
1742
+		}
1743 1743
 
1744
-    }
1744
+	}
1745 1745
 }
1746 1746
 
1747 1747
 // action for adding the listings page top widget area
@@ -1760,11 +1760,11 @@  discard block
 block discarded – undo
1760 1760
  */
1761 1761
 function geodir_action_geodir_sidebar_listings_top()
1762 1762
 {
1763
-    if (get_option('geodir_show_listing_top_section')) { ?>
1763
+	if (get_option('geodir_show_listing_top_section')) { ?>
1764 1764
         <div
1765 1765
             class="<?php
1766
-            /** This action is documented in geodirectory_template_actions.php */
1767
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_top'); ?>">
1766
+			/** This action is documented in geodirectory_template_actions.php */
1767
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_top'); ?>">
1768 1768
             <?php dynamic_sidebar('geodir_listing_top'); ?>
1769 1769
         </div><!-- clearfix ends here-->
1770 1770
     <?php }
@@ -1787,35 +1787,35 @@  discard block
 block discarded – undo
1787 1787
  */
1788 1788
 function geodir_action_sidebar_left_open($type = '', $id = '', $class = '', $itemtype = '')
1789 1789
 {
1790
-    if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
1791
-        $width_css = 'style="width:' . $width . '%;"';
1792
-    } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
1793
-        $width_css = 'style="width:' . $width . '%;"';
1794
-    } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
1795
-        $width_css = 'style="width:' . $width . '%;"';
1796
-    } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
1797
-        $width_css = 'style="width:' . $width . '%;"';
1798
-    } else {
1799
-        $width_css = '';
1800
-    }
1801
-
1802
-    $tc = get_option('theme_compatibility_setting');
1803
-    if (!empty($tc['geodir_sidebar_left_open_replace'])) {
1804
-        $text = $tc['geodir_sidebar_left_open_replace'];
1805
-    } else {
1806
-        $text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
1807
-    }
1808
-
1809
-    if (!empty($tc['geodir_sidebar_left_open_id'])) {
1810
-        $id = $tc['geodir_sidebar_left_open_id'];
1811
-    }
1812
-    if (!empty($tc['geodir_sidebar_left_open_class'])) {
1813
-        $class = $tc['geodir_sidebar_left_open_class'];
1814
-    }
1815
-
1816
-    $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
1817
-
1818
-    echo $text;
1790
+	if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
1791
+		$width_css = 'style="width:' . $width . '%;"';
1792
+	} elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
1793
+		$width_css = 'style="width:' . $width . '%;"';
1794
+	} elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
1795
+		$width_css = 'style="width:' . $width . '%;"';
1796
+	} elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
1797
+		$width_css = 'style="width:' . $width . '%;"';
1798
+	} else {
1799
+		$width_css = '';
1800
+	}
1801
+
1802
+	$tc = get_option('theme_compatibility_setting');
1803
+	if (!empty($tc['geodir_sidebar_left_open_replace'])) {
1804
+		$text = $tc['geodir_sidebar_left_open_replace'];
1805
+	} else {
1806
+		$text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
1807
+	}
1808
+
1809
+	if (!empty($tc['geodir_sidebar_left_open_id'])) {
1810
+		$id = $tc['geodir_sidebar_left_open_id'];
1811
+	}
1812
+	if (!empty($tc['geodir_sidebar_left_open_class'])) {
1813
+		$class = $tc['geodir_sidebar_left_open_class'];
1814
+	}
1815
+
1816
+	$text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
1817
+
1818
+	echo $text;
1819 1819
 }
1820 1820
 
1821 1821
 // action for adding the primary div closing tag
@@ -1831,13 +1831,13 @@  discard block
 block discarded – undo
1831 1831
  */
1832 1832
 function geodir_action_sidebar_left_close($type = '')
1833 1833
 {
1834
-    $tc = get_option('theme_compatibility_setting');
1835
-    if (!empty($tc['geodir_sidebar_left_close_replace'])) {
1836
-        $text = $tc['geodir_sidebar_left_close_replace'];
1837
-    } else {
1838
-        $text = '</aside><!-- sidebar ends here-->';
1839
-    }
1840
-    echo $text;
1834
+	$tc = get_option('theme_compatibility_setting');
1835
+	if (!empty($tc['geodir_sidebar_left_close_replace'])) {
1836
+		$text = $tc['geodir_sidebar_left_close_replace'];
1837
+	} else {
1838
+		$text = '</aside><!-- sidebar ends here-->';
1839
+	}
1840
+	echo $text;
1841 1841
 }
1842 1842
 
1843 1843
 /**
@@ -1850,7 +1850,7 @@  discard block
 block discarded – undo
1850 1850
  */
1851 1851
 function geodir_listing_left_section()
1852 1852
 {
1853
-    if (get_option('geodir_show_listing_left_section')) { ?>
1853
+	if (get_option('geodir_show_listing_left_section')) { ?>
1854 1854
         <div class="geodir-content-left geodir-sidebar-wrap">
1855 1855
             <?php dynamic_sidebar('geodir_listing_left_sidebar'); ?>
1856 1856
         </div><!-- end geodir-content-left -->
@@ -1868,20 +1868,20 @@  discard block
 block discarded – undo
1868 1868
  */
1869 1869
 function geodir_action_listings_sidebar_left()
1870 1870
 {
1871
-    if (get_option('geodir_show_listing_left_section')) {
1872
-        /** This action is documented in geodirectory_template_actions.php */
1873
-        do_action('geodir_sidebar_left_open', 'listings-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'https://schema.org/WPSideBar');
1874
-        /**
1875
-         * Calls the listings page (category) left sidebar content.
1876
-         *
1877
-         * All the content for the listings page left sidebar is added via this hook.
1878
-         *
1879
-         * @since 1.0.0
1880
-         */
1881
-        do_action('geodir_listings_sidebar_left_inside');
1882
-        /** This action is documented in geodirectory_template_actions.php */
1883
-        do_action('geodir_sidebar_left_close', 'listings-page');
1884
-    }
1871
+	if (get_option('geodir_show_listing_left_section')) {
1872
+		/** This action is documented in geodirectory_template_actions.php */
1873
+		do_action('geodir_sidebar_left_open', 'listings-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'https://schema.org/WPSideBar');
1874
+		/**
1875
+		 * Calls the listings page (category) left sidebar content.
1876
+		 *
1877
+		 * All the content for the listings page left sidebar is added via this hook.
1878
+		 *
1879
+		 * @since 1.0.0
1880
+		 */
1881
+		do_action('geodir_listings_sidebar_left_inside');
1882
+		/** This action is documented in geodirectory_template_actions.php */
1883
+		do_action('geodir_sidebar_left_close', 'listings-page');
1884
+	}
1885 1885
 }
1886 1886
 
1887 1887
 /**
@@ -1894,7 +1894,7 @@  discard block
 block discarded – undo
1894 1894
  */
1895 1895
 function geodir_listing_right_section()
1896 1896
 {
1897
-    if (get_option('geodir_show_listing_right_section')) { ?>
1897
+	if (get_option('geodir_show_listing_right_section')) { ?>
1898 1898
         <div class="geodir-content-right geodir-sidebar-wrap">
1899 1899
             <?php dynamic_sidebar('geodir_listing_right_sidebar'); ?>
1900 1900
         </div><!-- end geodir-content-right -->
@@ -1912,20 +1912,20 @@  discard block
 block discarded – undo
1912 1912
  */
1913 1913
 function geodir_action_listings_sidebar_right()
1914 1914
 {
1915
-    if (get_option('geodir_show_listing_right_section')) {
1916
-        /** This action is documented in geodirectory_template_actions.php */
1917
-        do_action('geodir_sidebar_right_open', 'listings-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
1918
-        /**
1919
-         * Calls the listings page (category) right sidebar content.
1920
-         *
1921
-         * All the content for the listings page right sidebar is added via this hook.
1922
-         *
1923
-         * @since 1.0.0
1924
-         */
1925
-        do_action('geodir_listings_sidebar_right_inside');
1926
-        /** This action is documented in geodirectory_template_actions.php */
1927
-        do_action('geodir_sidebar_right_close', 'listings-page');
1928
-    }
1915
+	if (get_option('geodir_show_listing_right_section')) {
1916
+		/** This action is documented in geodirectory_template_actions.php */
1917
+		do_action('geodir_sidebar_right_open', 'listings-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
1918
+		/**
1919
+		 * Calls the listings page (category) right sidebar content.
1920
+		 *
1921
+		 * All the content for the listings page right sidebar is added via this hook.
1922
+		 *
1923
+		 * @since 1.0.0
1924
+		 */
1925
+		do_action('geodir_listings_sidebar_right_inside');
1926
+		/** This action is documented in geodirectory_template_actions.php */
1927
+		do_action('geodir_sidebar_right_close', 'listings-page');
1928
+	}
1929 1929
 }
1930 1930
 
1931 1931
 
@@ -1942,23 +1942,23 @@  discard block
 block discarded – undo
1942 1942
  */
1943 1943
 function geodir_action_main_content_open($type = '', $id = '', $class = '')
1944 1944
 {
1945
-    $tc = get_option('theme_compatibility_setting');
1946
-    if (!empty($tc['geodir_main_content_open_replace'])) {
1947
-        $text = $tc['geodir_main_content_open_replace'];
1948
-    } else {
1949
-        $text = '<main id="[id]" class="[class]" role="main">';
1950
-    }
1945
+	$tc = get_option('theme_compatibility_setting');
1946
+	if (!empty($tc['geodir_main_content_open_replace'])) {
1947
+		$text = $tc['geodir_main_content_open_replace'];
1948
+	} else {
1949
+		$text = '<main id="[id]" class="[class]" role="main">';
1950
+	}
1951 1951
 
1952
-    if (!empty($tc['geodir_main_content_open_id'])) {
1953
-        $id = $tc['geodir_main_content_open_id'];
1954
-    }
1955
-    if (!empty($tc['geodir_main_content_open_class'])) {
1956
-        $class = $tc['geodir_main_content_open_class'];
1957
-    }
1952
+	if (!empty($tc['geodir_main_content_open_id'])) {
1953
+		$id = $tc['geodir_main_content_open_id'];
1954
+	}
1955
+	if (!empty($tc['geodir_main_content_open_class'])) {
1956
+		$class = $tc['geodir_main_content_open_class'];
1957
+	}
1958 1958
 
1959
-    $text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
1959
+	$text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
1960 1960
 
1961
-    echo $text;
1961
+	echo $text;
1962 1962
 }
1963 1963
 
1964 1964
 // action for adding the primary div closing tag
@@ -1971,13 +1971,13 @@  discard block
 block discarded – undo
1971 1971
  */
1972 1972
 function geodir_action_main_content_close()
1973 1973
 {
1974
-    $tc = get_option('theme_compatibility_setting');
1975
-    if (!empty($tc['geodir_main_content_close_replace'])) {
1976
-        $text = $tc['geodir_main_content_close_replace'];
1977
-    } else {
1978
-        $text = '</main><!-- main ends here-->';
1979
-    }
1980
-    echo $text;
1974
+	$tc = get_option('theme_compatibility_setting');
1975
+	if (!empty($tc['geodir_main_content_close_replace'])) {
1976
+		$text = $tc['geodir_main_content_close_replace'];
1977
+	} else {
1978
+		$text = '</main><!-- main ends here-->';
1979
+	}
1980
+	echo $text;
1981 1981
 }
1982 1982
 
1983 1983
 /**
@@ -1989,14 +1989,14 @@  discard block
 block discarded – undo
1989 1989
  */
1990 1990
 function geodir_action_listings_content_inside()
1991 1991
 {
1992
-    global $gridview_columns;
1993
-    $listing_view = get_option('geodir_listing_view');
1994
-    if (strstr($listing_view, 'gridview')) {
1995
-        $gridview_columns = $listing_view;
1996
-        $listing_view_exp = explode('_', $listing_view);
1997
-        $listing_view = $listing_view_exp[0];
1998
-    }
1999
-    geodir_get_template_part('listing', 'listview');
1992
+	global $gridview_columns;
1993
+	$listing_view = get_option('geodir_listing_view');
1994
+	if (strstr($listing_view, 'gridview')) {
1995
+		$gridview_columns = $listing_view;
1996
+		$listing_view_exp = explode('_', $listing_view);
1997
+		$listing_view = $listing_view_exp[0];
1998
+	}
1999
+	geodir_get_template_part('listing', 'listview');
2000 2000
 }
2001 2001
 
2002 2002
 add_action('geodir_listings_content_inside', 'geodir_action_listings_content_inside', 10);
@@ -2012,47 +2012,47 @@  discard block
 block discarded – undo
2012 2012
  */
2013 2013
 function geodir_action_listings_content()
2014 2014
 {
2015
-    /**
2016
-     * This is used to add HTML opening wrappers to the main content of most pages including listings, author, search, home etc.
2017
-     *
2018
-     * @since 1.0.0
2019
-     * @param string $type The page type. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
2020
-     * @param string $id The id for the div. Usually 'geodir-main-content'.
2021
-     * @param string $class The class for the div. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
2022
-     * @see 'geodir_main_content_close' Where the oposing closing tag is added.
2023
-     */
2024
-    do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page');
2025
-    $extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page');
2026
-    echo '<div class="clearfix '.$extra_class.'">';
2027
-    /**
2028
-     * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages.
2029
-     *
2030
-     * @since 1.0.0
2031
-     */
2032
-    do_action('geodir_before_listing');
2033
-    echo '</div>';
2034
-
2035
-    /**
2036
-     * This actions calls the listings list content. Used on listings pages and search and author pages.
2037
-     *
2038
-     * @since 1.0.0
2039
-     */
2040
-    do_action('geodir_listings_content_inside');
2041
-
2042
-    /**
2043
-     * Called after the listings content, inside the outer wrapper HTML. Used on listings pages and search and author pages.
2044
-     *
2045
-     * @since 1.0.0
2046
-     */
2047
-    do_action('geodir_after_listing');
2048
-
2049
-    /**
2050
-     * This is used to add HTML closing wrappers to the main content of most pages including listings, author, search, home etc.
2051
-     *
2052
-     * @since 1.0.0
2053
-     * @see 'geodir_main_content_open' Where the oposing opening tag is added.
2054
-     */
2055
-    do_action('geodir_main_content_close', 'listings-page');
2015
+	/**
2016
+	 * This is used to add HTML opening wrappers to the main content of most pages including listings, author, search, home etc.
2017
+	 *
2018
+	 * @since 1.0.0
2019
+	 * @param string $type The page type. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
2020
+	 * @param string $id The id for the div. Usually 'geodir-main-content'.
2021
+	 * @param string $class The class for the div. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
2022
+	 * @see 'geodir_main_content_close' Where the oposing closing tag is added.
2023
+	 */
2024
+	do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page');
2025
+	$extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page');
2026
+	echo '<div class="clearfix '.$extra_class.'">';
2027
+	/**
2028
+	 * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages.
2029
+	 *
2030
+	 * @since 1.0.0
2031
+	 */
2032
+	do_action('geodir_before_listing');
2033
+	echo '</div>';
2034
+
2035
+	/**
2036
+	 * This actions calls the listings list content. Used on listings pages and search and author pages.
2037
+	 *
2038
+	 * @since 1.0.0
2039
+	 */
2040
+	do_action('geodir_listings_content_inside');
2041
+
2042
+	/**
2043
+	 * Called after the listings content, inside the outer wrapper HTML. Used on listings pages and search and author pages.
2044
+	 *
2045
+	 * @since 1.0.0
2046
+	 */
2047
+	do_action('geodir_after_listing');
2048
+
2049
+	/**
2050
+	 * This is used to add HTML closing wrappers to the main content of most pages including listings, author, search, home etc.
2051
+	 *
2052
+	 * @since 1.0.0
2053
+	 * @see 'geodir_main_content_open' Where the oposing opening tag is added.
2054
+	 */
2055
+	do_action('geodir_main_content_close', 'listings-page');
2056 2056
 }
2057 2057
 
2058 2058
 
@@ -2067,10 +2067,10 @@  discard block
 block discarded – undo
2067 2067
  */
2068 2068
 function geodir_action_sidebar_listings_bottom_section()
2069 2069
 {
2070
-    if (get_option('geodir_show_listing_bottom_section')) { ?>
2070
+	if (get_option('geodir_show_listing_bottom_section')) { ?>
2071 2071
         <div class="<?php
2072
-            /** This action is documented in geodirectory_template_actions.php */
2073
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_bottom'); ?>">
2072
+			/** This action is documented in geodirectory_template_actions.php */
2073
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_bottom'); ?>">
2074 2074
             <?php dynamic_sidebar('geodir_listing_bottom'); ?>
2075 2075
         </div><!-- clearfix ends here-->
2076 2076
     <?php }
@@ -2090,38 +2090,38 @@  discard block
 block discarded – undo
2090 2090
  */
2091 2091
 function geodir_action_add_listing_page_title()
2092 2092
 {
2093
-    if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '')
2094
-        $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2095
-    /** This action is documented in geodirectory_template_actions.php */
2096
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2097
-    /** This action is documented in geodirectory_template_actions.php */
2098
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2099
-
2100
-    $title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
2101
-
2102
-    if(geodir_is_page('add-listing')){
2103
-        $gd_page = 'add-listing';
2104
-        if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
2105
-            $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
2106
-        }elseif(isset($listing_type)){
2107
-            $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
2108
-        }
2093
+	if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '')
2094
+		$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2095
+	/** This action is documented in geodirectory_template_actions.php */
2096
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
2097
+	/** This action is documented in geodirectory_template_actions.php */
2098
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2099
+
2100
+	$title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
2101
+
2102
+	if(geodir_is_page('add-listing')){
2103
+		$gd_page = 'add-listing';
2104
+		if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
2105
+			$title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
2106
+		}elseif(isset($listing_type)){
2107
+			$title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
2108
+		}
2109 2109
 
2110
-    }
2110
+	}
2111 2111
 
2112 2112
 
2113
-    /**
2114
-     * Filter page title to replace variables.
2115
-     *
2116
-     * @since 1.5.4
2117
-     * @param string $title The page title including variables.
2118
-     * @param string $gd_page The GeoDirectory page type if any.
2119
-     */
2120
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2113
+	/**
2114
+	 * Filter page title to replace variables.
2115
+	 *
2116
+	 * @since 1.5.4
2117
+	 * @param string $title The page title including variables.
2118
+	 * @param string $gd_page The GeoDirectory page type if any.
2119
+	 */
2120
+	$title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2121 2121
 
2122
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">';
2123
-    echo $title;
2124
-    echo '</h1></header>';
2122
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">';
2123
+	echo $title;
2124
+	echo '</h1></header>';
2125 2125
 }
2126 2126
 
2127 2127
 add_action('geodir_add_listing_page_mandatory', 'geodir_action_add_listing_page_mandatory', 10);
@@ -2152,61 +2152,61 @@  discard block
 block discarded – undo
2152 2152
  */
2153 2153
 function geodir_action_add_listing_form()
2154 2154
 {
2155
-    global $cat_display, $post_cat, $current_user, $gd_session;
2156
-    $page_id = get_the_ID();
2157
-    $post = '';
2158
-    $title = '';
2159
-    $desc = '';
2160
-    $kw_tags = '';
2161
-    $required_msg = '';
2162
-    $submit_button = '';
2163
-
2164
-    $ajax_action = isset($_REQUEST['ajax_action']) ? $_REQUEST['ajax_action'] : 'add';
2165
-
2166
-    $thumb_img_arr = array();
2167
-    $curImages = '';
2168
-
2169
-    if (isset($_REQUEST['backandedit'])) {
2170
-        global $post;
2171
-        $post = (object)$gd_session->get('listing');
2172
-        $listing_type = $post->listing_type;
2173
-        $title = $post->post_title;
2174
-        $desc = $post->post_desc;
2175
-        $post_cat = isset($post->post_category) ? $post->post_category : '';
2176
-
2177
-        $kw_tags = $post->post_tags;
2178
-        $curImages = isset($post->post_images) ? $post->post_images : '';
2179
-    } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2180
-        global $post, $post_images;
2181
-
2182
-        $post = geodir_get_post_info($_REQUEST['pid']);
2183
-        $thumb_img_arr = geodir_get_images($post->ID);
2184
-        if ($thumb_img_arr) {
2185
-            foreach ($thumb_img_arr as $post_img) {
2186
-                $curImages .= $post_img->src . ',';
2187
-            }
2188
-        }
2155
+	global $cat_display, $post_cat, $current_user, $gd_session;
2156
+	$page_id = get_the_ID();
2157
+	$post = '';
2158
+	$title = '';
2159
+	$desc = '';
2160
+	$kw_tags = '';
2161
+	$required_msg = '';
2162
+	$submit_button = '';
2163
+
2164
+	$ajax_action = isset($_REQUEST['ajax_action']) ? $_REQUEST['ajax_action'] : 'add';
2165
+
2166
+	$thumb_img_arr = array();
2167
+	$curImages = '';
2168
+
2169
+	if (isset($_REQUEST['backandedit'])) {
2170
+		global $post;
2171
+		$post = (object)$gd_session->get('listing');
2172
+		$listing_type = $post->listing_type;
2173
+		$title = $post->post_title;
2174
+		$desc = $post->post_desc;
2175
+		$post_cat = isset($post->post_category) ? $post->post_category : '';
2176
+
2177
+		$kw_tags = $post->post_tags;
2178
+		$curImages = isset($post->post_images) ? $post->post_images : '';
2179
+	} elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2180
+		global $post, $post_images;
2181
+
2182
+		$post = geodir_get_post_info($_REQUEST['pid']);
2183
+		$thumb_img_arr = geodir_get_images($post->ID);
2184
+		if ($thumb_img_arr) {
2185
+			foreach ($thumb_img_arr as $post_img) {
2186
+				$curImages .= $post_img->src . ',';
2187
+			}
2188
+		}
2189 2189
 
2190
-        $listing_type = $post->post_type;
2191
-        $title = $post->post_title;
2192
-        $desc = $post->post_content;
2193
-        $kw_tags = $post->post_tags;
2194
-        $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
2195
-    } else {
2196
-        $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2197
-    }
2190
+		$listing_type = $post->post_type;
2191
+		$title = $post->post_title;
2192
+		$desc = $post->post_content;
2193
+		$kw_tags = $post->post_tags;
2194
+		$kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
2195
+	} else {
2196
+		$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2197
+	}
2198 2198
 
2199
-    if ($current_user->ID != '0') {
2200
-        $user_login = true;
2201
-    }
2199
+	if ($current_user->ID != '0') {
2200
+		$user_login = true;
2201
+	}
2202 2202
 
2203
-    $post_type_info = geodir_get_posttype_info($listing_type);
2203
+	$post_type_info = geodir_get_posttype_info($listing_type);
2204 2204
 
2205
-    $cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? __($post_type_info['labels']['singular_name'], 'geodirectory') : __('Listing','geodirectory');
2205
+	$cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? __($post_type_info['labels']['singular_name'], 'geodirectory') : __('Listing','geodirectory');
2206 2206
     
2207
-    $package_info = array();
2208
-    $package_info = geodir_post_package_info($package_info, $post);
2209
-    ?>
2207
+	$package_info = array();
2208
+	$package_info = geodir_post_package_info($package_info, $post);
2209
+	?>
2210 2210
     <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id());?>" method="post" enctype="multipart/form-data">
2211 2211
         <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type);?>"/>
2212 2212
         <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type);?>"/>
@@ -2217,114 +2217,114 @@  discard block
 block discarded – undo
2217 2217
         <?php } if (isset($_REQUEST['backandedit'])) { ?>
2218 2218
             <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']);?>"/>
2219 2219
         <?php
2220
-        } 
2221
-        /**
2222
-         * Called at the very top of the add listing page form for frontend.
2223
-         *
2224
-         * This is called just before the "Enter Listing Details" text.
2225
-         *
2226
-         * @since 1.0.0
2227
-         */
2228
-        do_action('geodir_before_detail_fields');
2229
-        ?>
2220
+		} 
2221
+		/**
2222
+		 * Called at the very top of the add listing page form for frontend.
2223
+		 *
2224
+		 * This is called just before the "Enter Listing Details" text.
2225
+		 *
2226
+		 * @since 1.0.0
2227
+		 */
2228
+		do_action('geodir_before_detail_fields');
2229
+		?>
2230 2230
         <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT;?></h5>
2231 2231
         <?php
2232
-        /**
2233
-         * Called at the top of the add listing page form for frontend.
2234
-         *
2235
-         * This is called after the "Enter Listing Details" text.
2236
-         *
2237
-         * @since 1.0.0
2238
-         */
2239
-        do_action('geodir_before_main_form_fields');
2240
-        ?>
2232
+		/**
2233
+		 * Called at the top of the add listing page form for frontend.
2234
+		 *
2235
+		 * This is called after the "Enter Listing Details" text.
2236
+		 *
2237
+		 * @since 1.0.0
2238
+		 */
2239
+		do_action('geodir_before_main_form_fields');
2240
+		?>
2241 2241
         <div id="geodir_post_title_row" class="required_field geodir_form_row clearfix gd-fieldset-details">
2242 2242
             <label><?php
2243
-                /**
2244
-                 * Filter the add listing page title input label.
2245
-                 *
2246
-                 * @since 1.6.11
2247
-                 * @param string $title The title to be output.
2248
-                 * @param string $cpt_singular_name The singular title of the curent CPT.
2249
-                 * @param string $listing_type The CPT being requested. ie: gd_place.
2250
-                 */
2251
-                echo apply_filters('geodir_add_listing_title_label', sprintf( __('%s Title', 'geodirectory'), $cpt_singular_name ),$cpt_singular_name,$listing_type); ?><span>*</span> </label>
2243
+				/**
2244
+				 * Filter the add listing page title input label.
2245
+				 *
2246
+				 * @since 1.6.11
2247
+				 * @param string $title The title to be output.
2248
+				 * @param string $cpt_singular_name The singular title of the curent CPT.
2249
+				 * @param string $listing_type The CPT being requested. ie: gd_place.
2250
+				 */
2251
+				echo apply_filters('geodir_add_listing_title_label', sprintf( __('%s Title', 'geodirectory'), $cpt_singular_name ),$cpt_singular_name,$listing_type); ?><span>*</span> </label>
2252 2252
             <input type="text" field_type="text" name="post_title" id="post_title" class="geodir_textfield"
2253 2253
                    value="<?php echo esc_attr(stripslashes($title)); ?>"/>
2254 2254
             <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory');?></span>
2255 2255
         </div>
2256 2256
         <?php
2257
-        $show_editor = get_option('geodir_tiny_editor_on_add_listing');
2258
-        $show_editor = !empty($show_editor) && in_array($listing_type, $show_editor) ? true : false;
2259
-        /**
2260
-         * Filter whether to show or don't show the editor.
2261
-         *
2262
-         * @since 1.6.16
2263
-         * @param bool $show_editor If true the editor will be available for description field.
2264
-         * @param object $package_info The listing package.
2265
-         * @param string $listing_type The current post type.
2266
-         * @param object $post The current post object.
2267
-         */
2268
-        $show_editor = apply_filters('geodir_description_field_show_editor', $show_editor, $package_info, $listing_type, $post);
2269
-
2270
-        $desc = $show_editor ? stripslashes($desc) : esc_attr(stripslashes($desc));
2271
-        $desc_limit = '';
2272
-        /**
2273
-         * Filter the add listing description field character limit number.
2274
-         *
2275
-         * @since 1.0.0
2276
-         * @param int $desc_limit The amount of characters to limit the description to.
2277
-         */
2278
-        $desc_limit = apply_filters('geodir_description_field_desc_limit', $desc_limit);
2279
-        /**
2280
-         * Filter the add listing description field text.
2281
-         *
2282
-         * @since 1.0.0
2283
-         * @param string $desc The text for the description field.
2284
-         * @param int $desc_limit The character limit number if any.
2285
-         */
2286
-        $desc = apply_filters('geodir_description_field_desc', $desc, $desc_limit);
2287
-        $desc_limit_msg = '';
2288
-        /**
2289
-         * Filter the add listing description limit message.
2290
-         *
2291
-         * This is the message shown if there is a limit applied to the amount of characters the description can use.
2292
-         *
2293
-         * @since 1.0.0
2294
-         * @param string $desc_limit_msg The limit message string if any.
2295
-         * @param int $desc_limit The character limit numer if any.
2296
-         */
2297
-        $desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
2257
+		$show_editor = get_option('geodir_tiny_editor_on_add_listing');
2258
+		$show_editor = !empty($show_editor) && in_array($listing_type, $show_editor) ? true : false;
2259
+		/**
2260
+		 * Filter whether to show or don't show the editor.
2261
+		 *
2262
+		 * @since 1.6.16
2263
+		 * @param bool $show_editor If true the editor will be available for description field.
2264
+		 * @param object $package_info The listing package.
2265
+		 * @param string $listing_type The current post type.
2266
+		 * @param object $post The current post object.
2267
+		 */
2268
+		$show_editor = apply_filters('geodir_description_field_show_editor', $show_editor, $package_info, $listing_type, $post);
2269
+
2270
+		$desc = $show_editor ? stripslashes($desc) : esc_attr(stripslashes($desc));
2271
+		$desc_limit = '';
2272
+		/**
2273
+		 * Filter the add listing description field character limit number.
2274
+		 *
2275
+		 * @since 1.0.0
2276
+		 * @param int $desc_limit The amount of characters to limit the description to.
2277
+		 */
2278
+		$desc_limit = apply_filters('geodir_description_field_desc_limit', $desc_limit);
2279
+		/**
2280
+		 * Filter the add listing description field text.
2281
+		 *
2282
+		 * @since 1.0.0
2283
+		 * @param string $desc The text for the description field.
2284
+		 * @param int $desc_limit The character limit number if any.
2285
+		 */
2286
+		$desc = apply_filters('geodir_description_field_desc', $desc, $desc_limit);
2287
+		$desc_limit_msg = '';
2288
+		/**
2289
+		 * Filter the add listing description limit message.
2290
+		 *
2291
+		 * This is the message shown if there is a limit applied to the amount of characters the description can use.
2292
+		 *
2293
+		 * @since 1.0.0
2294
+		 * @param string $desc_limit_msg The limit message string if any.
2295
+		 * @param int $desc_limit The character limit numer if any.
2296
+		 */
2297
+		$desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
2298 2298
         
2299
-        $desc_class = '';
2300
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2301
-            /**
2302
-             * Called on the add listing page form for frontend just before the description field.
2303
-             *
2304
-             * @since 1.0.0
2305
-             */
2306
-            do_action('geodir_before_description_field');
2299
+		$desc_class = '';
2300
+		if ($desc_limit === '' || (int)$desc_limit > 0) {
2301
+			/**
2302
+			 * Called on the add listing page form for frontend just before the description field.
2303
+			 *
2304
+			 * @since 1.0.0
2305
+			 */
2306
+			do_action('geodir_before_description_field');
2307 2307
             
2308
-            $desc_class = ' required_field';
2309
-        } else {
2310
-            $desc_class = ' hidden';
2311
-        }
2312
-        ?>
2308
+			$desc_class = ' required_field';
2309
+		} else {
2310
+			$desc_class = ' hidden';
2311
+		}
2312
+		?>
2313 2313
         <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class;?>">
2314 2314
             <label><?php
2315
-                /**
2316
-                 * Filter the add listing page description input label.
2317
-                 *
2318
-                 * @since 1.6.11
2319
-                 * @param string $title The title to be output.
2320
-                 * @param string $cpt_singular_name The singular title of the curent CPT.
2321
-                 * @param string $listing_type The CPT being requested. ie: gd_place.
2322
-                 */
2323
-                echo apply_filters('geodir_add_listing_description_label',sprintf( __('%s Description', 'geodirectory'), $cpt_singular_name ),$cpt_singular_name,$listing_type); ?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
2315
+				/**
2316
+				 * Filter the add listing page description input label.
2317
+				 *
2318
+				 * @since 1.6.11
2319
+				 * @param string $title The title to be output.
2320
+				 * @param string $cpt_singular_name The singular title of the curent CPT.
2321
+				 * @param string $listing_type The CPT being requested. ie: gd_place.
2322
+				 */
2323
+				echo apply_filters('geodir_add_listing_description_label',sprintf( __('%s Description', 'geodirectory'), $cpt_singular_name ),$cpt_singular_name,$listing_type); ?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
2324 2324
             <?php
2325
-            if ($show_editor) {
2326
-                $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
2327
-            ?>
2325
+			if ($show_editor) {
2326
+				$editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
2327
+			?>
2328 2328
                 <div class="editor" field_id="post_desc" field_type="editor">
2329 2329
                     <?php wp_editor($desc, "post_desc", $editor_settings); ?>
2330 2330
                 </div>
@@ -2338,56 +2338,56 @@  discard block
 block discarded – undo
2338 2338
             <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory');?></span>
2339 2339
         </div>
2340 2340
         <?php
2341
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2342
-            /**
2343
-             * Called on the add listing page form for frontend just after the description field.
2344
-             *
2345
-             * @since 1.0.0
2346
-             */
2347
-            do_action('geodir_after_description_field');
2348
-        }
2341
+		if ($desc_limit === '' || (int)$desc_limit > 0) {
2342
+			/**
2343
+			 * Called on the add listing page form for frontend just after the description field.
2344
+			 *
2345
+			 * @since 1.0.0
2346
+			 */
2347
+			do_action('geodir_after_description_field');
2348
+		}
2349 2349
         
2350
-        $kw_tags = esc_attr(stripslashes($kw_tags));
2351
-        $kw_tags_count = TAGKW_TEXT_COUNT;
2352
-        $kw_tags_msg = TAGKW_MSG;
2353
-        /**
2354
-         * Filter the add listing tags character limit.
2355
-         *
2356
-         * @since 1.0.0
2357
-         * @param int $kw_tags_count The character count limit if any.
2358
-         */
2359
-        $kw_tags_count = apply_filters('geodir_listing_tags_field_tags_count', $kw_tags_count);
2360
-        /**
2361
-         * Filter the add listing tags field value.
2362
-         *
2363
-         * You can use the $_REQUEST values to check if this is a go back and edit value etc.
2364
-         *
2365
-         * @since 1.0.0
2366
-         * @param string $kw_tags The tag field value, usually a comma separated list of tags.
2367
-         * @param int $kw_tags_count The character count limit if any.
2368
-         */
2369
-        $kw_tags = apply_filters('geodir_listing_tags_field_tags', $kw_tags, $kw_tags_count);
2370
-        /**
2371
-         * Filter the add listing tags field message text.
2372
-         *
2373
-         * @since 1.0.0
2374
-         * @param string $kw_tags_msg The message shown under the field.
2375
-         * @param int $kw_tags_count The character count limit if any.
2376
-         */
2377
-        $kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
2350
+		$kw_tags = esc_attr(stripslashes($kw_tags));
2351
+		$kw_tags_count = TAGKW_TEXT_COUNT;
2352
+		$kw_tags_msg = TAGKW_MSG;
2353
+		/**
2354
+		 * Filter the add listing tags character limit.
2355
+		 *
2356
+		 * @since 1.0.0
2357
+		 * @param int $kw_tags_count The character count limit if any.
2358
+		 */
2359
+		$kw_tags_count = apply_filters('geodir_listing_tags_field_tags_count', $kw_tags_count);
2360
+		/**
2361
+		 * Filter the add listing tags field value.
2362
+		 *
2363
+		 * You can use the $_REQUEST values to check if this is a go back and edit value etc.
2364
+		 *
2365
+		 * @since 1.0.0
2366
+		 * @param string $kw_tags The tag field value, usually a comma separated list of tags.
2367
+		 * @param int $kw_tags_count The character count limit if any.
2368
+		 */
2369
+		$kw_tags = apply_filters('geodir_listing_tags_field_tags', $kw_tags, $kw_tags_count);
2370
+		/**
2371
+		 * Filter the add listing tags field message text.
2372
+		 *
2373
+		 * @since 1.0.0
2374
+		 * @param string $kw_tags_msg The message shown under the field.
2375
+		 * @param int $kw_tags_count The character count limit if any.
2376
+		 */
2377
+		$kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
2378 2378
         
2379
-        $tags_class = '';
2380
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2381
-            /**
2382
-             * Called on the add listing page form for frontend just before the tags field.
2383
-             *
2384
-             * @since 1.0.0
2385
-             */
2386
-            do_action('geodir_before_listing_tags_field');
2387
-        } else {
2388
-            $tags_class = ' hidden';
2389
-        }
2390
-        ?>
2379
+		$tags_class = '';
2380
+		if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2381
+			/**
2382
+			 * Called on the add listing page form for frontend just before the tags field.
2383
+			 *
2384
+			 * @since 1.0.0
2385
+			 */
2386
+			do_action('geodir_before_listing_tags_field');
2387
+		} else {
2388
+			$tags_class = ' hidden';
2389
+		}
2390
+		?>
2391 2391
         <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class;?>">
2392 2392
             <label><?php echo TAGKW_TEXT; ?></label>
2393 2393
             <input name="post_tags" id="post_tags" value="<?php echo $kw_tags; ?>" type="text" class="geodir_textfield"
@@ -2395,90 +2395,90 @@  discard block
 block discarded – undo
2395 2395
             <span class="geodir_message_note"><?php echo $kw_tags_msg;?></span>
2396 2396
         </div>
2397 2397
         <?php
2398
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2399
-            /**
2400
-             * Called on the add listing page form for frontend just after the tags field.
2401
-             *
2402
-             * @since 1.0.0
2403
-             */
2404
-            do_action('geodir_after_listing_tags_field');
2405
-        }
2398
+		if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2399
+			/**
2400
+			 * Called on the add listing page form for frontend just after the tags field.
2401
+			 *
2402
+			 * @since 1.0.0
2403
+			 */
2404
+			do_action('geodir_after_listing_tags_field');
2405
+		}
2406 2406
         
2407
-        $package_info = array();
2408
-        $package_info = geodir_post_package_info($package_info, $post);
2407
+		$package_info = array();
2408
+		$package_info = geodir_post_package_info($package_info, $post);
2409 2409
         
2410
-        geodir_get_custom_fields_html($package_info->pid, 'all', $listing_type);
2410
+		geodir_get_custom_fields_html($package_info->pid, 'all', $listing_type);
2411 2411
         
2412
-        // adjust values here
2413
-        $id = "post_images"; // this will be the name of form field. Image url(s) will be submitted in $_POST using this key. So if $id == �img1� then $_POST[�img1�] will have all the image urls
2412
+		// adjust values here
2413
+		$id = "post_images"; // this will be the name of form field. Image url(s) will be submitted in $_POST using this key. So if $id == �img1� then $_POST[�img1�] will have all the image urls
2414 2414
 
2415
-        $multiple = true; // allow multiple files upload
2415
+		$multiple = true; // allow multiple files upload
2416 2416
 
2417
-        $width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels)
2417
+		$width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels)
2418 2418
 
2419
-        $height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels)
2419
+		$height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels)
2420 2420
 
2421
-        $thumb_img_arr = array();
2422
-        $totImg = 0;
2423
-        if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2424
-            $post = (object)$gd_session->get('listing');
2425
-            if (isset($post->post_images))
2426
-                $curImages = trim($post->post_images, ",");
2421
+		$thumb_img_arr = array();
2422
+		$totImg = 0;
2423
+		if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2424
+			$post = (object)$gd_session->get('listing');
2425
+			if (isset($post->post_images))
2426
+				$curImages = trim($post->post_images, ",");
2427 2427
 
2428 2428
 
2429
-            if ($curImages != '') {
2430
-                $curImages_array = explode(',', $curImages);
2431
-                $totImg = count($curImages_array);
2432
-            }
2429
+			if ($curImages != '') {
2430
+				$curImages_array = explode(',', $curImages);
2431
+				$totImg = count($curImages_array);
2432
+			}
2433 2433
 
2434
-            $listing_type = $post->listing_type;
2434
+			$listing_type = $post->listing_type;
2435 2435
 
2436
-        } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2437
-            $post = geodir_get_post_info((int)$_REQUEST['pid']);
2438
-            $listing_type = $post->post_type;
2439
-            $thumb_img_arr = geodir_get_images($_REQUEST['pid']);
2436
+		} elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2437
+			$post = geodir_get_post_info((int)$_REQUEST['pid']);
2438
+			$listing_type = $post->post_type;
2439
+			$thumb_img_arr = geodir_get_images($_REQUEST['pid']);
2440 2440
 
2441
-        } else {
2442
-            $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2443
-        }
2441
+		} else {
2442
+			$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2443
+		}
2444 2444
 
2445 2445
 
2446
-        if (!empty($thumb_img_arr)) {
2447
-            foreach ($thumb_img_arr as $img) {
2448
-                //$curImages = $img->src.",";
2449
-            }
2450
-
2451
-            $totImg = count((array)$thumb_img_arr);
2452
-        }
2446
+		if (!empty($thumb_img_arr)) {
2447
+			foreach ($thumb_img_arr as $img) {
2448
+				//$curImages = $img->src.",";
2449
+			}
2453 2450
 
2454
-        if ($curImages != '')
2455
-            $svalue = $curImages; // this will be initial value of the above form field. Image urls.
2456
-        else
2457
-            $svalue = '';
2458
-
2459
-        $image_limit = isset($package_info->image_limit) ? $package_info->image_limit : '0';
2460
-        $show_image_input_box = ($image_limit != '0');
2461
-        /**
2462
-         * Filter to be able to show/hide the image upload section of the add listing form.
2463
-         *
2464
-         * @since 1.0.0
2465
-         * @param bool $show_image_input_box Set true to show. Set false to not show.
2466
-         * @param string $listing_type The custom post type slug.
2467
-         */
2468
-        $show_image_input_box = apply_filters('geodir_image_uploader_on_add_listing', $show_image_input_box, $listing_type);
2469
-        if ($show_image_input_box) {
2470
-            ?>
2451
+			$totImg = count((array)$thumb_img_arr);
2452
+		}
2453
+
2454
+		if ($curImages != '')
2455
+			$svalue = $curImages; // this will be initial value of the above form field. Image urls.
2456
+		else
2457
+			$svalue = '';
2458
+
2459
+		$image_limit = isset($package_info->image_limit) ? $package_info->image_limit : '0';
2460
+		$show_image_input_box = ($image_limit != '0');
2461
+		/**
2462
+		 * Filter to be able to show/hide the image upload section of the add listing form.
2463
+		 *
2464
+		 * @since 1.0.0
2465
+		 * @param bool $show_image_input_box Set true to show. Set false to not show.
2466
+		 * @param string $listing_type The custom post type slug.
2467
+		 */
2468
+		$show_image_input_box = apply_filters('geodir_image_uploader_on_add_listing', $show_image_input_box, $listing_type);
2469
+		if ($show_image_input_box) {
2470
+			?>
2471 2471
 
2472 2472
             <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT;?>
2473 2473
                 <?php if ($image_limit == 1) {
2474
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
2475
-                } ?>
2474
+					echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
2475
+				} ?>
2476 2476
                 <?php if ($image_limit > 1) {
2477
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
2478
-                } ?>
2477
+					echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
2478
+				} ?>
2479 2479
                 <?php if ($image_limit == '') {
2480
-                    echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
2481
-                } ?>
2480
+					echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
2481
+				} ?>
2482 2482
             </h5>
2483 2483
 
2484 2484
             <div class="geodir_form_row clearfix" id="<?php echo $id; ?>dropbox"
@@ -2516,12 +2516,12 @@  discard block
 block discarded – undo
2516 2516
         <?php } ?>
2517 2517
 
2518 2518
         <?php
2519
-        /**
2520
-         * Called on the add listing page form for frontend just after the image upload field.
2521
-         *
2522
-         * @since 1.0.0
2523
-         */
2524
-        do_action('geodir_after_main_form_fields');?>
2519
+		/**
2520
+		 * Called on the add listing page form for frontend just after the image upload field.
2521
+		 *
2522
+		 * @since 1.0.0
2523
+		 */
2524
+		do_action('geodir_after_main_form_fields');?>
2525 2525
 
2526 2526
 
2527 2527
         <!-- add captcha code -->
@@ -2550,7 +2550,7 @@  discard block
 block discarded – undo
2550 2550
 
2551 2551
     </form>
2552 2552
     <?php
2553
-    wp_reset_query();
2553
+	wp_reset_query();
2554 2554
 }
2555 2555
 
2556 2556
 /**
@@ -2561,7 +2561,7 @@  discard block
 block discarded – undo
2561 2561
  */
2562 2562
 function geodir_add_listing_sidebar_widget_area()
2563 2563
 {
2564
-    dynamic_sidebar('geodir_add_listing_sidebar');
2564
+	dynamic_sidebar('geodir_add_listing_sidebar');
2565 2565
 }
2566 2566
 
2567 2567
 add_action('geodir_add_listing_sidebar_inside', 'geodir_add_listing_sidebar_widget_area', 10);
@@ -2576,16 +2576,16 @@  discard block
 block discarded – undo
2576 2576
  */
2577 2577
 function geodir_action_add_listing_sidebar()
2578 2578
 {
2579
-    /** This action is documented in geodirectory_template_actions.php */
2580
-    do_action('geodir_sidebar_right_open', 'add-listing-page', 'geodir-sidebar', 'geodir-sidebar-right', 'http://schema.org/WPSideBar');
2581
-    /**
2582
-     * This is used to add the content to the add listing page sidebar.
2583
-     *
2584
-     * @since 1.0.0
2585
-     */
2586
-    do_action('geodir_add_listing_sidebar_inside');
2587
-    /** This action is documented in geodirectory_template_actions.php */
2588
-    do_action('geodir_sidebar_right_close', 'details-page');
2579
+	/** This action is documented in geodirectory_template_actions.php */
2580
+	do_action('geodir_sidebar_right_open', 'add-listing-page', 'geodir-sidebar', 'geodir-sidebar-right', 'http://schema.org/WPSideBar');
2581
+	/**
2582
+	 * This is used to add the content to the add listing page sidebar.
2583
+	 *
2584
+	 * @since 1.0.0
2585
+	 */
2586
+	do_action('geodir_add_listing_sidebar_inside');
2587
+	/** This action is documented in geodirectory_template_actions.php */
2588
+	do_action('geodir_sidebar_right_close', 'details-page');
2589 2589
 }
2590 2590
 
2591 2591
 ###############################################
@@ -2602,11 +2602,11 @@  discard block
 block discarded – undo
2602 2602
  */
2603 2603
 function geodir_action_geodir_sidebar_signup_top()
2604 2604
 {
2605
-    ?>
2605
+	?>
2606 2606
     <div
2607 2607
         class="<?php
2608
-        /** This action is documented in geodirectory_template_actions.php */
2609
-        echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
2608
+		/** This action is documented in geodirectory_template_actions.php */
2609
+		echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
2610 2610
         <?php dynamic_sidebar('Reg/Login Top Section');?>
2611 2611
     </div><!-- clearfix ends here-->
2612 2612
 <?php
@@ -2625,11 +2625,11 @@  discard block
 block discarded – undo
2625 2625
 function geodir_action_signup_forms()
2626 2626
 {
2627 2627
 
2628
-    global $user_login;
2628
+	global $user_login;
2629 2629
     
2630
-    $is_enable_signup = get_option( 'users_can_register' );
2630
+	$is_enable_signup = get_option( 'users_can_register' );
2631 2631
     
2632
-    ?>
2632
+	?>
2633 2633
     <script type="text/javascript">
2634 2634
         <?php if ( $user_login ) { ?>
2635 2635
         setTimeout(function () {
@@ -2665,67 +2665,67 @@  discard block
 block discarded – undo
2665 2665
         <?php } ?>
2666 2666
     </script><?php
2667 2667
 
2668
-    global $errors;
2669
-    if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim')
2670
-        $errors->add('claim_login', LOGIN_CLAIM);
2671
-
2672
-    if (!empty($errors)) {
2673
-        foreach ($errors as $errorsObj) {
2674
-            foreach ($errorsObj as $key => $val) {
2675
-                for ($i = 0; $i < count($val); $i++) {
2676
-                    echo "<div class=error_msg_fix>" . $val[$i] . '</div>';
2677
-                    $registration_error_msg = 1;
2678
-                }
2679
-            }
2680
-        }
2681
-    }
2668
+	global $errors;
2669
+	if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim')
2670
+		$errors->add('claim_login', LOGIN_CLAIM);
2671
+
2672
+	if (!empty($errors)) {
2673
+		foreach ($errors as $errorsObj) {
2674
+			foreach ($errorsObj as $key => $val) {
2675
+				for ($i = 0; $i < count($val); $i++) {
2676
+					echo "<div class=error_msg_fix>" . $val[$i] . '</div>';
2677
+					$registration_error_msg = 1;
2678
+				}
2679
+			}
2680
+		}
2681
+	}
2682 2682
 
2683
-    if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_in') {
2684
-        ?>
2683
+	if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_in') {
2684
+		?>
2685 2685
 
2686 2686
         <div class="login_form">
2687 2687
             <?php
2688
-            /**
2689
-             * Contains login form template.
2690
-             *
2691
-             * @since 1.0.0
2692
-             */
2693
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2688
+			/**
2689
+			 * Contains login form template.
2690
+			 *
2691
+			 * @since 1.0.0
2692
+			 */
2693
+			include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2694 2694
         </div>
2695 2695
 
2696 2696
     <?php } elseif (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_up' && $is_enable_signup ) { ?>
2697 2697
 
2698 2698
         <div class="registration_form">
2699 2699
             <?php
2700
-            /**
2701
-             * Contains registration form template.
2702
-             *
2703
-             * @since 1.0.0
2704
-             */
2705
-            include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2700
+			/**
2701
+			 * Contains registration form template.
2702
+			 *
2703
+			 * @since 1.0.0
2704
+			 */
2705
+			include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2706 2706
         </div>
2707 2707
 
2708 2708
     <?php } else { ?>
2709 2709
 
2710 2710
         <div class="login_form_l">
2711 2711
             <?php
2712
-            /**
2713
-             * Contains login form template.
2714
-             *
2715
-             * @since 1.0.0
2716
-             */
2717
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2712
+			/**
2713
+			 * Contains login form template.
2714
+			 *
2715
+			 * @since 1.0.0
2716
+			 */
2717
+			include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2718 2718
         </div>
2719 2719
         
2720 2720
         <?php if ( $is_enable_signup ) { ?>
2721 2721
             <div class="registration_form_r">
2722 2722
                 <?php
2723
-                /**
2724
-                 * Contains registration form template.
2725
-                 *
2726
-                 * @since 1.0.0
2727
-                 */
2728
-                include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2723
+				/**
2724
+				 * Contains registration form template.
2725
+				 *
2726
+				 * @since 1.0.0
2727
+				 */
2728
+				include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2729 2729
             </div>
2730 2730
         <?php } ?>
2731 2731
 
@@ -2757,66 +2757,66 @@  discard block
 block discarded – undo
2757 2757
  */
2758 2758
 function geodir_action_author_page_title()
2759 2759
 {
2760
-    global $term;
2760
+	global $term;
2761 2761
 
2762
-    $gd_post_type = geodir_get_current_posttype();
2763
-    $post_type_info = get_post_type_object($gd_post_type);
2762
+	$gd_post_type = geodir_get_current_posttype();
2763
+	$post_type_info = get_post_type_object($gd_post_type);
2764 2764
 
2765
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
2766
-    if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2767
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
2768
-    }
2765
+	$add_string_in_title = __('All', 'geodirectory') . ' ';
2766
+	if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2767
+		$add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
2768
+	}
2769 2769
 
2770
-    $list_title = $add_string_in_title . $post_type_info->labels->name;
2771
-    $single_name = $post_type_info->labels->singular_name;
2770
+	$list_title = $add_string_in_title . $post_type_info->labels->name;
2771
+	$single_name = $post_type_info->labels->singular_name;
2772 2772
 
2773
-    $taxonomy = geodir_get_taxonomies($gd_post_type);
2773
+	$taxonomy = geodir_get_taxonomies($gd_post_type);
2774 2774
 
2775
-    if (!empty($term)) {
2776
-        $current_term = get_term_by('slug', $term, $taxonomy[0]);
2777
-        if (!empty($current_term))
2778
-            $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2779
-    }
2775
+	if (!empty($term)) {
2776
+		$current_term = get_term_by('slug', $term, $taxonomy[0]);
2777
+		if (!empty($current_term))
2778
+			$list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2779
+	}
2780 2780
 
2781 2781
 
2782
-    if (is_search()) {
2783
-        $list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2782
+	if (is_search()) {
2783
+		$list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2784 2784
 
2785
-    }
2786
-    /** This action is documented in geodirectory_template_actions.php */
2787
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2788
-    /** This action is documented in geodirectory_template_actions.php */
2789
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2785
+	}
2786
+	/** This action is documented in geodirectory_template_actions.php */
2787
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
2788
+	/** This action is documented in geodirectory_template_actions.php */
2789
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2790 2790
 
2791
-    $title = $list_title;
2792
-    if(geodir_is_page('author')){
2793
-        $gd_page = 'author';
2794
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2795
-            $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2796
-        }else{
2797
-            $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2798
-        }
2791
+	$title = $list_title;
2792
+	if(geodir_is_page('author')){
2793
+		$gd_page = 'author';
2794
+		if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2795
+			$title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2796
+		}else{
2797
+			$title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2798
+		}
2799 2799
 
2800
-    }
2800
+	}
2801 2801
 
2802 2802
 
2803
-    /**
2804
-     * Filter page title to replace variables.
2805
-     *
2806
-     * @since 1.5.4
2807
-     * @param string $title The page title including variables.
2808
-     * @param string $gd_page The GeoDirectory page type if any.
2809
-     */
2810
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2803
+	/**
2804
+	 * Filter page title to replace variables.
2805
+	 *
2806
+	 * @since 1.5.4
2807
+	 * @param string $title The page title including variables.
2808
+	 * @param string $gd_page The GeoDirectory page type if any.
2809
+	 */
2810
+	$title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2811 2811
 
2812
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2813
-        /**
2814
-         * Filter the author page title text.
2815
-         *
2816
-         * @since 1.0.0
2817
-         * @param string $list_title The title for the page.
2818
-         */
2819
-        apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
2812
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2813
+		/**
2814
+		 * Filter the author page title text.
2815
+		 *
2816
+		 * @since 1.0.0
2817
+		 * @param string $list_title The title for the page.
2818
+		 */
2819
+		apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
2820 2820
 }
2821 2821
 
2822 2822
 
@@ -2834,11 +2834,11 @@  discard block
 block discarded – undo
2834 2834
  */
2835 2835
 function geodir_action_geodir_sidebar_author_top()
2836 2836
 {
2837
-    if (get_option('geodir_show_author_top_section')) { ?>
2837
+	if (get_option('geodir_show_author_top_section')) { ?>
2838 2838
         <div
2839 2839
             class="<?php
2840
-            /** This action is documented in geodirectory_template_actions.php */
2841
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_top'); ?>">
2840
+			/** This action is documented in geodirectory_template_actions.php */
2841
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_top'); ?>">
2842 2842
             <?php dynamic_sidebar('geodir_author_top'); ?>
2843 2843
         </div><!-- clearfix ends here-->
2844 2844
     <?php }
@@ -2854,7 +2854,7 @@  discard block
 block discarded – undo
2854 2854
  */
2855 2855
 function geodir_author_left_section()
2856 2856
 {
2857
-    if (get_option('geodir_show_author_left_section')) { ?>
2857
+	if (get_option('geodir_show_author_left_section')) { ?>
2858 2858
         <div class="geodir-content-left geodir-sidebar-wrap">
2859 2859
             <?php dynamic_sidebar('geodir_author_left_sidebar'); ?>
2860 2860
         </div><!-- end geodir-content-left -->
@@ -2875,19 +2875,19 @@  discard block
 block discarded – undo
2875 2875
  */
2876 2876
 function geodir_action_author_sidebar_left()
2877 2877
 {
2878
-    if (get_option('geodir_show_author_left_section')) {
2878
+	if (get_option('geodir_show_author_left_section')) {
2879 2879
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
2880
-        /** This action is documented in geodirectory_template_actions.php */
2881
-        do_action('geodir_sidebar_left_open', 'author-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
2882
-        /**
2883
-         * This is used to add the content to the author page left sidebar (if active).
2884
-         *
2885
-         * @since 1.0.0
2886
-         */
2887
-        do_action('geodir_author_sidebar_left_inside');
2888
-        /** This action is documented in geodirectory_template_actions.php */
2889
-        do_action('geodir_sidebar_left_close', 'author-page');
2890
-    }
2880
+		/** This action is documented in geodirectory_template_actions.php */
2881
+		do_action('geodir_sidebar_left_open', 'author-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
2882
+		/**
2883
+		 * This is used to add the content to the author page left sidebar (if active).
2884
+		 *
2885
+		 * @since 1.0.0
2886
+		 */
2887
+		do_action('geodir_author_sidebar_left_inside');
2888
+		/** This action is documented in geodirectory_template_actions.php */
2889
+		do_action('geodir_sidebar_left_close', 'author-page');
2890
+	}
2891 2891
 }
2892 2892
 
2893 2893
 /**
@@ -2900,7 +2900,7 @@  discard block
 block discarded – undo
2900 2900
  */
2901 2901
 function geodir_author_right_section()
2902 2902
 {
2903
-    if (get_option('geodir_show_author_right_section')) { ?>
2903
+	if (get_option('geodir_show_author_right_section')) { ?>
2904 2904
         <div class="geodir-content-right geodir-sidebar-wrap">
2905 2905
             <?php dynamic_sidebar('geodir_author_right_sidebar'); ?>
2906 2906
         </div><!-- end geodir-content-right -->
@@ -2920,18 +2920,18 @@  discard block
 block discarded – undo
2920 2920
  */
2921 2921
 function geodir_action_author_sidebar_right()
2922 2922
 {
2923
-    if (get_option('geodir_show_author_right_section')) {
2924
-        /** This action is documented in geodirectory_template_actions.php */
2925
-        do_action('geodir_sidebar_right_open', 'author-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
2926
-        /**
2927
-         * This is used to add the content to the author page right sidebar (if active).
2928
-         *
2929
-         * @since 1.0.0
2930
-         */
2931
-        do_action('geodir_author_sidebar_right_inside');
2932
-        /** This action is documented in geodirectory_template_actions.php */
2933
-        do_action('geodir_sidebar_right_close', 'author-page');
2934
-    }
2923
+	if (get_option('geodir_show_author_right_section')) {
2924
+		/** This action is documented in geodirectory_template_actions.php */
2925
+		do_action('geodir_sidebar_right_open', 'author-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
2926
+		/**
2927
+		 * This is used to add the content to the author page right sidebar (if active).
2928
+		 *
2929
+		 * @since 1.0.0
2930
+		 */
2931
+		do_action('geodir_author_sidebar_right_inside');
2932
+		/** This action is documented in geodirectory_template_actions.php */
2933
+		do_action('geodir_sidebar_right_close', 'author-page');
2934
+	}
2935 2935
 }
2936 2936
 
2937 2937
 /**
@@ -2943,14 +2943,14 @@  discard block
 block discarded – undo
2943 2943
  */
2944 2944
 function geodir_action_author_content_inside()
2945 2945
 {
2946
-    global $gridview_columns;
2947
-    $listing_view = get_option('geodir_author_view');
2948
-    if (strstr($listing_view, 'gridview')) {
2949
-        $gridview_columns = $listing_view;
2950
-        $listing_view_exp = explode('_', $listing_view);
2951
-        $listing_view = $listing_view_exp[0];
2952
-    }
2953
-    geodir_get_template_part('listing', 'listview');
2946
+	global $gridview_columns;
2947
+	$listing_view = get_option('geodir_author_view');
2948
+	if (strstr($listing_view, 'gridview')) {
2949
+		$gridview_columns = $listing_view;
2950
+		$listing_view_exp = explode('_', $listing_view);
2951
+		$listing_view = $listing_view_exp[0];
2952
+	}
2953
+	geodir_get_template_part('listing', 'listview');
2954 2954
 }
2955 2955
 
2956 2956
 add_action('geodir_author_content_inside', 'geodir_action_author_content_inside', 10);
@@ -2965,22 +2965,22 @@  discard block
 block discarded – undo
2965 2965
  */
2966 2966
 function geodir_action_author_content()
2967 2967
 {
2968
-    /** This action is documented in geodirectory_template_actions.php */
2969
-    do_action('geodir_main_content_open', 'author-page', 'geodir-main-content', 'author-page');
2970
-    echo '<div class="clearfix">';
2971
-    /** This action is documented in geodirectory_template_actions.php */
2972
-    do_action('geodir_before_listing');
2973
-    echo '</div>';
2974
-    /**
2975
-     * This is used to add the content to the author page main content.
2976
-     *
2977
-     * @since 1.0.0
2978
-     */
2979
-    do_action('geodir_author_content_inside');
2980
-    /** This action is documented in geodirectory_template_actions.php */
2981
-    do_action('geodir_after_listing');
2982
-    /** This action is documented in geodirectory_template_actions.php */
2983
-    do_action('geodir_main_content_close', 'author-page');
2968
+	/** This action is documented in geodirectory_template_actions.php */
2969
+	do_action('geodir_main_content_open', 'author-page', 'geodir-main-content', 'author-page');
2970
+	echo '<div class="clearfix">';
2971
+	/** This action is documented in geodirectory_template_actions.php */
2972
+	do_action('geodir_before_listing');
2973
+	echo '</div>';
2974
+	/**
2975
+	 * This is used to add the content to the author page main content.
2976
+	 *
2977
+	 * @since 1.0.0
2978
+	 */
2979
+	do_action('geodir_author_content_inside');
2980
+	/** This action is documented in geodirectory_template_actions.php */
2981
+	do_action('geodir_after_listing');
2982
+	/** This action is documented in geodirectory_template_actions.php */
2983
+	do_action('geodir_main_content_close', 'author-page');
2984 2984
 }
2985 2985
 
2986 2986
 add_action('geodir_sidebar_author_bottom_section', 'geodir_action_sidebar_author_bottom_section', 10);
@@ -2994,11 +2994,11 @@  discard block
 block discarded – undo
2994 2994
  */
2995 2995
 function geodir_action_sidebar_author_bottom_section()
2996 2996
 {
2997
-    if (get_option('geodir_show_author_bottom_section')) { ?>
2997
+	if (get_option('geodir_show_author_bottom_section')) { ?>
2998 2998
         <div
2999 2999
             class="<?php
3000
-            /** This action is documented in geodirectory_template_actions.php */
3001
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_bottom'); ?>">
3000
+			/** This action is documented in geodirectory_template_actions.php */
3001
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_bottom'); ?>">
3002 3002
             <?php dynamic_sidebar('geodir_author_bottom'); ?>
3003 3003
         </div><!-- clearfix ends here-->
3004 3004
     <?php }
@@ -3017,23 +3017,23 @@  discard block
 block discarded – undo
3017 3017
  */
3018 3018
 function geodir_action_search_page_title()
3019 3019
 {
3020
-    $gd_post_type = geodir_get_current_posttype();
3021
-    $post_type_info = get_post_type_object($gd_post_type);
3020
+	$gd_post_type = geodir_get_current_posttype();
3021
+	$post_type_info = get_post_type_object($gd_post_type);
3022 3022
 
3023
-    $pt_name = '';
3024
-    if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
3023
+	$pt_name = '';
3024
+	if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
3025 3025
 
3026
-    if (is_search()) {
3027
-        $list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
3026
+	if (is_search()) {
3027
+		$list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
3028 3028
 
3029
-    }
3030
-    /** This action is documented in geodirectory_template_actions.php */
3031
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
3032
-    /** This action is documented in geodirectory_template_actions.php */
3033
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
3034
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
3035
-        /** This action is documented in geodirectory_template_actions.php */
3036
-        apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
3029
+	}
3030
+	/** This action is documented in geodirectory_template_actions.php */
3031
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
3032
+	/** This action is documented in geodirectory_template_actions.php */
3033
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
3034
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
3035
+		/** This action is documented in geodirectory_template_actions.php */
3036
+		apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
3037 3037
 }
3038 3038
 
3039 3039
 // action for adding the listings page top widget area
@@ -3049,11 +3049,11 @@  discard block
 block discarded – undo
3049 3049
  */
3050 3050
 function geodir_action_geodir_sidebar_search_top()
3051 3051
 {
3052
-    if (get_option('geodir_show_search_top_section')) { ?>
3052
+	if (get_option('geodir_show_search_top_section')) { ?>
3053 3053
         <div
3054 3054
             class="<?php
3055
-            /** This action is documented in geodirectory_template_actions.php */
3056
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_top'); ?>">
3055
+			/** This action is documented in geodirectory_template_actions.php */
3056
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_top'); ?>">
3057 3057
             <?php dynamic_sidebar('geodir_search_top'); ?>
3058 3058
         </div><!-- clearfix ends here-->
3059 3059
     <?php }
@@ -3069,7 +3069,7 @@  discard block
 block discarded – undo
3069 3069
  */
3070 3070
 function geodir_search_left_section()
3071 3071
 {
3072
-    if (get_option('geodir_show_search_left_section')) { ?>
3072
+	if (get_option('geodir_show_search_left_section')) { ?>
3073 3073
         <div class="geodir-content-left geodir-sidebar-wrap">
3074 3074
             <?php dynamic_sidebar('geodir_search_left_sidebar'); ?>
3075 3075
         </div><!-- end geodir-content-left -->
@@ -3089,19 +3089,19 @@  discard block
 block discarded – undo
3089 3089
  */
3090 3090
 function geodir_action_search_sidebar_left()
3091 3091
 {
3092
-    if (get_option('geodir_show_search_left_section')) {
3092
+	if (get_option('geodir_show_search_left_section')) {
3093 3093
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
3094
-        /** This action is documented in geodirectory_template_actions.php */
3095
-        do_action('geodir_sidebar_left_open', 'search-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3096
-        /**
3097
-         * This is used to add the content to the search page left sidebar (if active).
3098
-         *
3099
-         * @since 1.0.0
3100
-         */
3101
-        do_action('geodir_search_sidebar_left_inside');
3102
-        /** This action is documented in geodirectory_template_actions.php */
3103
-        do_action('geodir_sidebar_left_close', 'search-page');
3104
-    }
3094
+		/** This action is documented in geodirectory_template_actions.php */
3095
+		do_action('geodir_sidebar_left_open', 'search-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3096
+		/**
3097
+		 * This is used to add the content to the search page left sidebar (if active).
3098
+		 *
3099
+		 * @since 1.0.0
3100
+		 */
3101
+		do_action('geodir_search_sidebar_left_inside');
3102
+		/** This action is documented in geodirectory_template_actions.php */
3103
+		do_action('geodir_sidebar_left_close', 'search-page');
3104
+	}
3105 3105
 }
3106 3106
 
3107 3107
 /**
@@ -3114,7 +3114,7 @@  discard block
 block discarded – undo
3114 3114
  */
3115 3115
 function geodir_search_right_section()
3116 3116
 {
3117
-    if (get_option('geodir_show_search_right_section')) { ?>
3117
+	if (get_option('geodir_show_search_right_section')) { ?>
3118 3118
         <div class="geodir-content-right geodir-sidebar-wrap">
3119 3119
             <?php dynamic_sidebar('geodir_search_right_sidebar'); ?>
3120 3120
         </div><!-- end geodir-content-right -->
@@ -3134,18 +3134,18 @@  discard block
 block discarded – undo
3134 3134
  */
3135 3135
 function geodir_action_search_sidebar_right()
3136 3136
 {
3137
-    if (get_option('geodir_show_search_right_section')) {
3138
-        /** This action is documented in geodirectory_template_actions.php */
3139
-        do_action('geodir_sidebar_right_open', 'search-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3140
-        /**
3141
-         * This is used to add the content to the search page right sidebar (if active).
3142
-         *
3143
-         * @since 1.0.0
3144
-         */
3145
-        do_action('geodir_search_sidebar_right_inside');
3146
-        /** This action is documented in geodirectory_template_actions.php */
3147
-        do_action('geodir_sidebar_right_close', 'search-page');
3148
-    }
3137
+	if (get_option('geodir_show_search_right_section')) {
3138
+		/** This action is documented in geodirectory_template_actions.php */
3139
+		do_action('geodir_sidebar_right_open', 'search-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3140
+		/**
3141
+		 * This is used to add the content to the search page right sidebar (if active).
3142
+		 *
3143
+		 * @since 1.0.0
3144
+		 */
3145
+		do_action('geodir_search_sidebar_right_inside');
3146
+		/** This action is documented in geodirectory_template_actions.php */
3147
+		do_action('geodir_sidebar_right_close', 'search-page');
3148
+	}
3149 3149
 }
3150 3150
 
3151 3151
 
@@ -3160,11 +3160,11 @@  discard block
 block discarded – undo
3160 3160
  */
3161 3161
 function geodir_action_sidebar_search_bottom_section()
3162 3162
 {
3163
-    if (get_option('geodir_show_search_bottom_section')) { ?>
3163
+	if (get_option('geodir_show_search_bottom_section')) { ?>
3164 3164
         <div
3165 3165
             class="<?php
3166
-            /** This action is documented in geodirectory_template_actions.php */
3167
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_bottom'); ?>">
3166
+			/** This action is documented in geodirectory_template_actions.php */
3167
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_bottom'); ?>">
3168 3168
             <?php dynamic_sidebar('geodir_search_bottom'); ?>
3169 3169
         </div><!-- clearfix ends here-->
3170 3170
     <?php }
@@ -3179,14 +3179,14 @@  discard block
 block discarded – undo
3179 3179
  */
3180 3180
 function geodir_action_search_content_inside()
3181 3181
 {
3182
-    global $gridview_columns;
3183
-    $listing_view = get_option('geodir_search_view');
3184
-    if (strstr($listing_view, 'gridview')) {
3185
-        $gridview_columns = $listing_view;
3186
-        $listing_view_exp = explode('_', $listing_view);
3187
-        $listing_view = $listing_view_exp[0];
3188
-    }
3189
-    geodir_get_template_part('listing', 'listview');
3182
+	global $gridview_columns;
3183
+	$listing_view = get_option('geodir_search_view');
3184
+	if (strstr($listing_view, 'gridview')) {
3185
+		$gridview_columns = $listing_view;
3186
+		$listing_view_exp = explode('_', $listing_view);
3187
+		$listing_view = $listing_view_exp[0];
3188
+	}
3189
+	geodir_get_template_part('listing', 'listview');
3190 3190
 }
3191 3191
 
3192 3192
 add_action('geodir_search_content_inside', 'geodir_action_search_content_inside', 10);
@@ -3202,22 +3202,22 @@  discard block
 block discarded – undo
3202 3202
  */
3203 3203
 function geodir_action_search_content()
3204 3204
 {
3205
-    /** This action is documented in geodirectory_template_actions.php */
3206
-    do_action('geodir_main_content_open', 'search-page', 'geodir-main-content', 'search-page');
3207
-    echo '<div class="clearfix">';
3208
-    /** This action is documented in geodirectory_template_actions.php */
3209
-    do_action('geodir_before_listing');
3210
-    echo '</div>';
3211
-    /**
3212
-     * This is used to add the content to the search page main content.
3213
-     *
3214
-     * @since 1.0.0
3215
-     */
3216
-    do_action('geodir_search_content_inside');
3217
-    /** This action is documented in geodirectory_template_actions.php */
3218
-    do_action('geodir_after_listing');
3219
-    /** This action is documented in geodirectory_template_actions.php */
3220
-    do_action('geodir_main_content_close', 'search-page');
3205
+	/** This action is documented in geodirectory_template_actions.php */
3206
+	do_action('geodir_main_content_open', 'search-page', 'geodir-main-content', 'search-page');
3207
+	echo '<div class="clearfix">';
3208
+	/** This action is documented in geodirectory_template_actions.php */
3209
+	do_action('geodir_before_listing');
3210
+	echo '</div>';
3211
+	/**
3212
+	 * This is used to add the content to the search page main content.
3213
+	 *
3214
+	 * @since 1.0.0
3215
+	 */
3216
+	do_action('geodir_search_content_inside');
3217
+	/** This action is documented in geodirectory_template_actions.php */
3218
+	do_action('geodir_after_listing');
3219
+	/** This action is documented in geodirectory_template_actions.php */
3220
+	do_action('geodir_main_content_close', 'search-page');
3221 3221
 }
3222 3222
 
3223 3223
 ###############################################
@@ -3240,11 +3240,11 @@  discard block
 block discarded – undo
3240 3240
  */
3241 3241
 function geodir_action_geodir_sidebar_home_top()
3242 3242
 {
3243
-    if (get_option('geodir_show_home_top_section')) { ?>
3243
+	if (get_option('geodir_show_home_top_section')) { ?>
3244 3244
         <div
3245 3245
             class="<?php
3246
-            /** This action is documented in geodirectory_template_actions.php */
3247
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_top'); ?>">
3246
+			/** This action is documented in geodirectory_template_actions.php */
3247
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_top'); ?>">
3248 3248
             <?php dynamic_sidebar('geodir_home_top'); ?>
3249 3249
         </div><!-- clearfix ends here-->
3250 3250
     <?php }
@@ -3260,7 +3260,7 @@  discard block
 block discarded – undo
3260 3260
  */
3261 3261
 function geodir_home_left_section()
3262 3262
 {
3263
-    if (get_option('geodir_show_home_left_section')) { ?>
3263
+	if (get_option('geodir_show_home_left_section')) { ?>
3264 3264
         <div class="geodir-content-left geodir-sidebar-wrap">
3265 3265
             <?php dynamic_sidebar('geodir_home_left'); ?>
3266 3266
         </div><!-- end geodir-content-left -->
@@ -3282,19 +3282,19 @@  discard block
 block discarded – undo
3282 3282
  */
3283 3283
 function geodir_action_home_sidebar_left()
3284 3284
 {
3285
-    if (get_option('geodir_show_home_left_section')) {
3285
+	if (get_option('geodir_show_home_left_section')) {
3286 3286
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
3287
-        /** This action is documented in geodirectory_template_actions.php */
3288
-        do_action('geodir_sidebar_left_open', 'home-page', 'geodir-sidebar-left', 'geodir-sidebar geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3289
-        /**
3290
-         * This is used to add the content to the home page left sidebar (if active).
3291
-         *
3292
-         * @since 1.0.0
3293
-         */
3294
-        do_action('geodir_home_sidebar_left_inside');
3295
-        /** This action is documented in geodirectory_template_actions.php */
3296
-        do_action('geodir_sidebar_left_close', 'home-page');
3297
-    }
3287
+		/** This action is documented in geodirectory_template_actions.php */
3288
+		do_action('geodir_sidebar_left_open', 'home-page', 'geodir-sidebar-left', 'geodir-sidebar geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3289
+		/**
3290
+		 * This is used to add the content to the home page left sidebar (if active).
3291
+		 *
3292
+		 * @since 1.0.0
3293
+		 */
3294
+		do_action('geodir_home_sidebar_left_inside');
3295
+		/** This action is documented in geodirectory_template_actions.php */
3296
+		do_action('geodir_sidebar_left_close', 'home-page');
3297
+	}
3298 3298
 }
3299 3299
 
3300 3300
 /**
@@ -3307,7 +3307,7 @@  discard block
 block discarded – undo
3307 3307
  */
3308 3308
 function geodir_home_right_section()
3309 3309
 {
3310
-    if (get_option('geodir_show_home_right_section')) { ?>
3310
+	if (get_option('geodir_show_home_right_section')) { ?>
3311 3311
         <div class="geodir-content-right geodir-sidebar-wrap">
3312 3312
             <?php dynamic_sidebar('geodir_home_right'); ?>
3313 3313
         </div><!-- end geodir-content-right -->
@@ -3328,18 +3328,18 @@  discard block
 block discarded – undo
3328 3328
  */
3329 3329
 function geodir_action_home_sidebar_right()
3330 3330
 {
3331
-    if (get_option('geodir_show_home_right_section')) {
3332
-        /** This action is documented in geodirectory_template_actions.php */
3333
-        do_action('geodir_sidebar_right_open', 'home-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3334
-        /**
3335
-         * This is used to add the content to the home page right sidebar (if active).
3336
-         *
3337
-         * @since 1.0.0
3338
-         */
3339
-        do_action('geodir_home_sidebar_right_inside');
3340
-        /** This action is documented in geodirectory_template_actions.php */
3341
-        do_action('geodir_sidebar_right_close', 'home-page');
3342
-    }
3331
+	if (get_option('geodir_show_home_right_section')) {
3332
+		/** This action is documented in geodirectory_template_actions.php */
3333
+		do_action('geodir_sidebar_right_open', 'home-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3334
+		/**
3335
+		 * This is used to add the content to the home page right sidebar (if active).
3336
+		 *
3337
+		 * @since 1.0.0
3338
+		 */
3339
+		do_action('geodir_home_sidebar_right_inside');
3340
+		/** This action is documented in geodirectory_template_actions.php */
3341
+		do_action('geodir_sidebar_right_close', 'home-page');
3342
+	}
3343 3343
 }
3344 3344
 
3345 3345
 /**
@@ -3350,7 +3350,7 @@  discard block
 block discarded – undo
3350 3350
  */
3351 3351
 function geodir_action_home_content_inside()
3352 3352
 {
3353
-    dynamic_sidebar('geodir_home_content');
3353
+	dynamic_sidebar('geodir_home_content');
3354 3354
 }
3355 3355
 
3356 3356
 add_action('geodir_home_content_inside', 'geodir_action_home_content_inside', 10);
@@ -3365,28 +3365,28 @@  discard block
 block discarded – undo
3365 3365
  */
3366 3366
 function geodir_action_home_content()
3367 3367
 {
3368
-    /** This action is documented in geodirectory_template_actions.php */
3369
-    do_action('geodir_main_content_open', 'home-page', 'geodir-main-content', 'home-page');
3370
-    /**
3371
-     * This called before the home page main content.
3372
-     *
3373
-     * @since 1.0.0
3374
-     */
3375
-    do_action('geodir_before_home_content');
3376
-    /**
3377
-     * This is used to add the content to the home page main content.
3378
-     *
3379
-     * @since 1.0.0
3380
-     */
3381
-    do_action('geodir_home_content_inside');
3382
-    /**
3383
-     * This is called after the homepage main content.
3384
-     *
3385
-     * @since 1.0.0
3386
-     */
3387
-    do_action('geodir_after_home_content');
3388
-    /** This action is documented in geodirectory_template_actions.php */
3389
-    do_action('geodir_main_content_close', 'home-page');
3368
+	/** This action is documented in geodirectory_template_actions.php */
3369
+	do_action('geodir_main_content_open', 'home-page', 'geodir-main-content', 'home-page');
3370
+	/**
3371
+	 * This called before the home page main content.
3372
+	 *
3373
+	 * @since 1.0.0
3374
+	 */
3375
+	do_action('geodir_before_home_content');
3376
+	/**
3377
+	 * This is used to add the content to the home page main content.
3378
+	 *
3379
+	 * @since 1.0.0
3380
+	 */
3381
+	do_action('geodir_home_content_inside');
3382
+	/**
3383
+	 * This is called after the homepage main content.
3384
+	 *
3385
+	 * @since 1.0.0
3386
+	 */
3387
+	do_action('geodir_after_home_content');
3388
+	/** This action is documented in geodirectory_template_actions.php */
3389
+	do_action('geodir_main_content_close', 'home-page');
3390 3390
 }
3391 3391
 
3392 3392
 add_action('geodir_sidebar_location_bottom_section', 'geodir_action_sidebar_home_bottom_section', 10);
@@ -3401,11 +3401,11 @@  discard block
 block discarded – undo
3401 3401
  */
3402 3402
 function geodir_action_sidebar_home_bottom_section()
3403 3403
 {
3404
-    if (get_option('geodir_show_home_bottom_section')) { ?>
3404
+	if (get_option('geodir_show_home_bottom_section')) { ?>
3405 3405
         <div
3406 3406
             class="<?php
3407
-            /** This action is documented in geodirectory_template_actions.php */
3408
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_bottom'); ?>">
3407
+			/** This action is documented in geodirectory_template_actions.php */
3408
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_bottom'); ?>">
3409 3409
             <?php dynamic_sidebar('geodir_home_bottom'); ?>
3410 3410
         </div><!-- clearfix ends here-->
3411 3411
     <?php }
@@ -3433,13 +3433,13 @@  discard block
 block discarded – undo
3433 3433
  */
3434 3434
 function geodir_filter_listing_page_title($list_title)
3435 3435
 {
3436
-    if (is_search() && trim(get_search_query()) == '') {
3437
-        $gd_post_type = geodir_get_current_posttype();
3438
-        $post_type_info = get_post_type_object($gd_post_type);
3436
+	if (is_search() && trim(get_search_query()) == '') {
3437
+		$gd_post_type = geodir_get_current_posttype();
3438
+		$post_type_info = get_post_type_object($gd_post_type);
3439 3439
 
3440
-        $list_title = __('Search', 'geodirectory') . ' ' . __(geodir_utf8_ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
3441
-    }
3442
-    return $list_title;
3440
+		$list_title = __('Search', 'geodirectory') . ' ' . __(geodir_utf8_ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
3441
+	}
3442
+	return $list_title;
3443 3443
 }
3444 3444
 
3445 3445
 add_action('geodir_message_not_found_on_listing', 'geodir_display_message_not_found_on_listing');
@@ -3454,62 +3454,62 @@  discard block
 block discarded – undo
3454 3454
  * @param string $gd_page The geodirectory page type. Default null.
3455 3455
  */
3456 3456
 function geodir_add_page_content( $position = 'before', $gd_page = '' ) {
3457
-    global $post;
3458
-
3459
-    $gd_page_id = NULL;
3460
-    if ($gd_page == 'home-page' && geodir_is_page('home')) {
3461
-        $gd_page_id = geodir_home_page_id();
3462
-    } else if ($gd_page == 'details-page' && geodir_is_page('preview')) {
3463
-        $gd_page_id = geodir_preview_page_id();
3464
-    } else if ($gd_page == 'add-listing-page' && geodir_is_page('add-listing')) {
3465
-        $gd_page_id = geodir_add_listing_page_id();
3466
-    } else if ($gd_page == 'success-page' && geodir_is_page('listing-success')) {
3467
-        $gd_page_id = geodir_success_page_id();
3468
-    } else if ($gd_page == 'location-page' && geodir_is_page('location')) {
3469
-        $gd_page_id = geodir_location_page_id();
3470
-    } else if ($gd_page == 'info-page' && geodir_is_page('info')) {
3471
-        $gd_page_id = geodir_info_page_id();
3472
-    } else if ($gd_page == 'signup-page' && geodir_is_page('login')) {
3473
-        $gd_page_id = geodir_login_page_id();
3474
-    } else if ($gd_page == 'checkout-page' && geodir_is_page('checkout')) {
3475
-        $gd_page_id = geodir_payment_checkout_page_id();
3476
-    } else if ($gd_page == 'invoices-page' && geodir_is_page('invoices')) {
3477
-        $gd_page_id = geodir_payment_invoices_page_id();
3478
-    }
3479
-
3480
-    if (!$gd_page_id > 0) {
3481
-        return;
3482
-    }
3457
+	global $post;
3458
+
3459
+	$gd_page_id = NULL;
3460
+	if ($gd_page == 'home-page' && geodir_is_page('home')) {
3461
+		$gd_page_id = geodir_home_page_id();
3462
+	} else if ($gd_page == 'details-page' && geodir_is_page('preview')) {
3463
+		$gd_page_id = geodir_preview_page_id();
3464
+	} else if ($gd_page == 'add-listing-page' && geodir_is_page('add-listing')) {
3465
+		$gd_page_id = geodir_add_listing_page_id();
3466
+	} else if ($gd_page == 'success-page' && geodir_is_page('listing-success')) {
3467
+		$gd_page_id = geodir_success_page_id();
3468
+	} else if ($gd_page == 'location-page' && geodir_is_page('location')) {
3469
+		$gd_page_id = geodir_location_page_id();
3470
+	} else if ($gd_page == 'info-page' && geodir_is_page('info')) {
3471
+		$gd_page_id = geodir_info_page_id();
3472
+	} else if ($gd_page == 'signup-page' && geodir_is_page('login')) {
3473
+		$gd_page_id = geodir_login_page_id();
3474
+	} else if ($gd_page == 'checkout-page' && geodir_is_page('checkout')) {
3475
+		$gd_page_id = geodir_payment_checkout_page_id();
3476
+	} else if ($gd_page == 'invoices-page' && geodir_is_page('invoices')) {
3477
+		$gd_page_id = geodir_payment_invoices_page_id();
3478
+	}
3479
+
3480
+	if (!$gd_page_id > 0) {
3481
+		return;
3482
+	}
3483 3483
     
3484
-    $display = 'before';
3485
-    /**
3486
-     * Filter the position to display the page content.
3487
-     *
3488
-     * @since 1.6.3
3489
-     *
3490
-     * @param string $display Position to add the post content.
3491
-     * @param string $gd_page The geodirectory page type.
3492
-     */
3493
-    $display = apply_filters('geodir_add_page_content_position', $display, $gd_page);
3494
-
3495
-    if ($position !== $display) {
3496
-        return;
3497
-    }
3498
-
3499
-    $gd_post = $post;
3484
+	$display = 'before';
3485
+	/**
3486
+	 * Filter the position to display the page content.
3487
+	 *
3488
+	 * @since 1.6.3
3489
+	 *
3490
+	 * @param string $display Position to add the post content.
3491
+	 * @param string $gd_page The geodirectory page type.
3492
+	 */
3493
+	$display = apply_filters('geodir_add_page_content_position', $display, $gd_page);
3494
+
3495
+	if ($position !== $display) {
3496
+		return;
3497
+	}
3498
+
3499
+	$gd_post = $post;
3500 3500
     
3501
-    setup_postdata(get_post($gd_page_id));
3501
+	setup_postdata(get_post($gd_page_id));
3502 3502
 
3503
-    if (get_the_content()) {
3504
-        ?>
3503
+	if (get_the_content()) {
3504
+		?>
3505 3505
         <section class="entry-content clearfix" itemprop="articleBody"><?php the_content(); ?></section>
3506 3506
         <?php
3507
-    }
3507
+	}
3508 3508
 
3509
-    $post = $gd_post;
3510
-    if (!empty($gd_post) && is_object($gd_post)) {
3511
-        setup_postdata($gd_post);
3512
-    }
3509
+	$post = $gd_post;
3510
+	if (!empty($gd_post) && is_object($gd_post)) {
3511
+		setup_postdata($gd_post);
3512
+	}
3513 3513
 
3514 3514
 }
3515 3515
 add_action('geodir_add_page_content', 'geodir_add_page_content', 10, 2);
@@ -3530,13 +3530,13 @@  discard block
 block discarded – undo
3530 3530
  * @return string Filtered SQL JOIN clause.
3531 3531
  */
3532 3532
 function geodir_previous_next_post_join( $join, $in_same_term, $excluded_terms, $taxonomy, $post ) {
3533
-    global $plugin_prefix;
3533
+	global $plugin_prefix;
3534 3534
 
3535
-    if ( !empty($post->post_type) && in_array( $post->post_type, geodir_get_posttypes() ) ) {
3536
-        $join .= " INNER JOIN " . $plugin_prefix . $post->post_type . "_detail AS gd ON gd.post_id = p.ID";
3537
-    }
3535
+	if ( !empty($post->post_type) && in_array( $post->post_type, geodir_get_posttypes() ) ) {
3536
+		$join .= " INNER JOIN " . $plugin_prefix . $post->post_type . "_detail AS gd ON gd.post_id = p.ID";
3537
+	}
3538 3538
     
3539
-    return $join;
3539
+	return $join;
3540 3540
 }
3541 3541
 add_filter( 'get_previous_post_join', 'geodir_previous_next_post_join', 10, 5 );
3542 3542
 add_filter( 'get_next_post_join', 'geodir_previous_next_post_join', 10, 5 );
@@ -3558,31 +3558,31 @@  discard block
 block discarded – undo
3558 3558
  * @return string Filtered SQL WHERE clause.
3559 3559
  */
3560 3560
 function geodir_previous_next_post_where( $where, $in_same_term, $excluded_terms, $taxonomy, $post ) {
3561
-    global $wpdb, $plugin_prefix;
3561
+	global $wpdb, $plugin_prefix;
3562 3562
 
3563
-    if ( !empty($post->post_type) && ( !empty( $post->country_slug ) || !empty( $post->region_slug ) || !empty( $post->city_slug ) ) && in_array( $post->post_type, geodir_get_posttypes() ) ) {
3564
-        $post_locations = '';
3565
-        $post_locations_var = array();
3563
+	if ( !empty($post->post_type) && ( !empty( $post->country_slug ) || !empty( $post->region_slug ) || !empty( $post->city_slug ) ) && in_array( $post->post_type, geodir_get_posttypes() ) ) {
3564
+		$post_locations = '';
3565
+		$post_locations_var = array();
3566 3566
         
3567
-        if ( !empty( $post->country_slug ) ) {
3568
-            $post_locations .= " AND post_locations LIKE %s";
3569
-            $post_locations_var[] = "%,[" . $post->country_slug . "]";
3570
-        }
3571
-
3572
-        if ( !empty( $post->region_slug ) ) {
3573
-            $post_locations .= " AND post_locations LIKE %s";
3574
-            $post_locations_var[] = "%,[" . $post->region_slug . "],%";
3575
-        }
3576
-
3577
-        if ( !empty( $post->city_slug ) ) {
3578
-            $post_locations .= " AND post_locations LIKE %s";
3579
-            $post_locations_var[] = "[" . $post->city_slug . "],%";
3580
-        }
3567
+		if ( !empty( $post->country_slug ) ) {
3568
+			$post_locations .= " AND post_locations LIKE %s";
3569
+			$post_locations_var[] = "%,[" . $post->country_slug . "]";
3570
+		}
3571
+
3572
+		if ( !empty( $post->region_slug ) ) {
3573
+			$post_locations .= " AND post_locations LIKE %s";
3574
+			$post_locations_var[] = "%,[" . $post->region_slug . "],%";
3575
+		}
3576
+
3577
+		if ( !empty( $post->city_slug ) ) {
3578
+			$post_locations .= " AND post_locations LIKE %s";
3579
+			$post_locations_var[] = "[" . $post->city_slug . "],%";
3580
+		}
3581 3581
         
3582
-        $where .= $wpdb->prepare( $post_locations, $post_locations_var );
3583
-    }
3582
+		$where .= $wpdb->prepare( $post_locations, $post_locations_var );
3583
+	}
3584 3584
     
3585
-    return $where;
3585
+	return $where;
3586 3586
 }
3587 3587
 add_filter( 'get_previous_post_where', 'geodir_previous_next_post_where', 10, 5 );
3588 3588
 add_filter( 'get_next_post_where', 'geodir_previous_next_post_where', 10, 5 );
3589 3589
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +186 added lines, -186 removed lines patch added patch discarded remove patch
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
 
284 284
     //php
285 285
     if (!empty($tc['geodir_theme_compat_code'])) {
286
-        include_once('geodirectory-functions/compatibility/' . $tc['geodir_theme_compat_code'] . '.php');
286
+        include_once('geodirectory-functions/compatibility/'.$tc['geodir_theme_compat_code'].'.php');
287 287
     }
288 288
 
289 289
     //geodir_full_page_class
@@ -453,13 +453,13 @@  discard block
 block discarded – undo
453 453
 function geodir_action_wrapper_content_open($type = '', $id = '', $class = '')
454 454
 {
455 455
     if ($type == 'home-page' && $width = get_option('geodir_width_home_contant_section')) {
456
-        $width_css = 'style="width:' . $width . '%;"';
456
+        $width_css = 'style="width:'.$width.'%;"';
457 457
     } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_contant_section')) {
458
-        $width_css = 'style="width:' . $width . '%;"';
458
+        $width_css = 'style="width:'.$width.'%;"';
459 459
     } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_contant_section')) {
460
-        $width_css = 'style="width:' . $width . '%;"';
460
+        $width_css = 'style="width:'.$width.'%;"';
461 461
     } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_contant_section')) {
462
-        $width_css = 'style="width:' . $width . '%;"';
462
+        $width_css = 'style="width:'.$width.'%;"';
463 463
     } else {
464 464
         $width_css = '';
465 465
     }
@@ -573,13 +573,13 @@  discard block
 block discarded – undo
573 573
 function geodir_action_sidebar_right_open($type = '', $id = '', $class = '', $itemtype = '')
574 574
 {
575 575
     if ($type == 'home-page' && $width = get_option('geodir_width_home_right_section')) {
576
-        $width_css = 'style="width:' . $width . '%;"';
576
+        $width_css = 'style="width:'.$width.'%;"';
577 577
     } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_right_section')) {
578
-        $width_css = 'style="width:' . $width . '%;"';
578
+        $width_css = 'style="width:'.$width.'%;"';
579 579
     } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_right_section')) {
580
-        $width_css = 'style="width:' . $width . '%;"';
580
+        $width_css = 'style="width:'.$width.'%;"';
581 581
     } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_right_section')) {
582
-        $width_css = 'style="width:' . $width . '%;"';
582
+        $width_css = 'style="width:'.$width.'%;"';
583 583
     } else {
584 584
         $width_css = '';
585 585
     }
@@ -677,7 +677,7 @@  discard block
 block discarded – undo
677 677
         }
678 678
     }
679 679
 
680
-    $post = (object)$_REQUEST;
680
+    $post = (object) $_REQUEST;
681 681
 
682 682
 
683 683
     if (isset($post->video)) {
@@ -736,10 +736,10 @@  discard block
 block discarded – undo
736 736
 
737 737
     $json = '{';
738 738
     $json .= '"post_preview": "1",';
739
-    $json .= '"t": "' . $json_title . '",';
740
-    $json .= '"lt": "' . $post_latitude . '",';
741
-    $json .= '"ln": "' . $post_longitude . '",';
742
-    $json .= '"i":"' . $term_icon . '"';
739
+    $json .= '"t": "'.$json_title.'",';
740
+    $json .= '"lt": "'.$post_latitude.'",';
741
+    $json .= '"ln": "'.$post_longitude.'",';
742
+    $json .= '"i":"'.$term_icon.'"';
743 743
     $json .= '}';
744 744
 
745 745
     $post->marker_json = $json;
@@ -966,7 +966,7 @@  discard block
 block discarded – undo
966 966
      * @param string $class The class to use. Default is 'entry-header'.
967 967
      */
968 968
     $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
969
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . stripslashes(get_the_title()) . '</h1></header>';
969
+    echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'.stripslashes(get_the_title()).'</h1></header>';
970 970
 }
971 971
 
972 972
 
@@ -1004,7 +1004,7 @@  discard block
 block discarded – undo
1004 1004
     $package_info = geodir_post_package_info(array(), $post, (!empty($post->post_type) ? $post->post_type : ''));
1005 1005
     $image_limit = '';
1006 1006
     if (defined('GEODIRPAYMENT_VERSION') && !empty($package_info) && isset($package_info->image_limit) && $package_info->image_limit !== '') {
1007
-        $image_limit = (int)$package_info->image_limit;
1007
+        $image_limit = (int) $package_info->image_limit;
1008 1008
     }
1009 1009
 
1010 1010
     if ($preview) {
@@ -1020,7 +1020,7 @@  discard block
 block discarded – undo
1020 1020
 
1021 1021
         if (!empty($post_images)) {
1022 1022
             foreach ($post_images as $image) {
1023
-                if ($image_limit !== '' && ($slides+1) > $image_limit) {
1023
+                if ($image_limit !== '' && ($slides + 1) > $image_limit) {
1024 1024
                      break;
1025 1025
                 }
1026 1026
                 if (!empty($image)) {
@@ -1029,7 +1029,7 @@  discard block
 block discarded – undo
1029 1029
                     $height = !empty($sizes) && isset($sizes[1]) ? $sizes[1] : 0;
1030 1030
 
1031 1031
                     if ($image && $width && $height) {
1032
-                        $image = (object)array('src' => $image, 'width' => $width, 'height' => $height);
1032
+                        $image = (object) array('src' => $image, 'width' => $width, 'height' => $height);
1033 1033
                     }
1034 1034
 
1035 1035
                     if (isset($image->src)) {
@@ -1041,9 +1041,9 @@  discard block
 block discarded – undo
1041 1041
 
1042 1042
                         $image_title = isset($image->title) ? $image->title : '';
1043 1043
 
1044
-                        $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1045
-                        $main_slides .= '<img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:400px;margin:0 auto;" /></li>';
1046
-                        $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:48px;margin:0 auto;" /></li>';
1044
+                        $main_slides .= '<li><img src="'.geodir_plugin_url()."/geodirectory-assets/images/spacer.gif".'" alt="'.$image_title.'" title="'.$image_title.'" style="max-height:'.$spacer_height.'px;margin:0 auto;" />';
1045
+                        $main_slides .= '<img src="'.$image->src.'" alt="'.$image_title.'" title="'.$image_title.'" style="max-height:400px;margin:0 auto;" /></li>';
1046
+                        $nav_slides .= '<li><img src="'.$image->src.'" alt="'.$image_title.'" title="'.$image_title.'" style="max-height:48px;margin:0 auto;" /></li>';
1047 1047
                         $slides++;
1048 1048
                     }
1049 1049
                 }
@@ -1064,7 +1064,7 @@  discard block
 block discarded – undo
1064 1064
 
1065 1065
         if (!empty($post_images)) {
1066 1066
             foreach ($post_images as $image) {
1067
-                if ($image_limit !== '' && ($slides+1) > $image_limit) {
1067
+                if ($image_limit !== '' && ($slides + 1) > $image_limit) {
1068 1068
                      break;
1069 1069
                 }
1070 1070
                 if ($image->height >= 400) {
@@ -1073,9 +1073,9 @@  discard block
 block discarded – undo
1073 1073
                     $spacer_height = ((400 - $image->height) / 2);
1074 1074
                 }
1075 1075
 
1076
-                $caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : '';
1077
-                $main_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>';
1078
-                $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>';
1076
+                $caption = ''; //(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : '';
1077
+                $main_slides .= '<li><img src="'.$image->src.'" alt="'.$image->title.'" title="'.$image->title.'" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>';
1078
+                $nav_slides .= '<li><img src="'.$image->src.'" alt="'.$image->title.'" title="'.$image->title.'" style="max-height:48px;margin:0 auto;" /></li>';
1079 1079
                 $slides++;
1080 1080
             }
1081 1081
         }// endfore
@@ -1110,7 +1110,7 @@  discard block
 block discarded – undo
1110 1110
  */
1111 1111
 function geodir_action_details_taxonomies()
1112 1112
 {
1113
-    global $preview, $post;?>
1113
+    global $preview, $post; ?>
1114 1114
     <p class="geodir_post_taxomomies clearfix">
1115 1115
     <?php
1116 1116
     $taxonomies = array();
@@ -1119,11 +1119,11 @@  discard block
 block discarded – undo
1119 1119
 
1120 1120
     if ($preview && !$is_backend_preview) {
1121 1121
         $post_type = $post->listing_type;
1122
-        $post_taxonomy = $post_type . 'category';
1122
+        $post_taxonomy = $post_type.'category';
1123 1123
         $post->{$post_taxonomy} = $post->post_category[$post_taxonomy];
1124 1124
     } else {
1125 1125
         $post_type = $post->post_type;
1126
-        $post_taxonomy = $post_type . 'category';
1126
+        $post_taxonomy = $post_type.'category';
1127 1127
     }
1128 1128
 //{	
1129 1129
     $post_type_info = get_post_type_object($post_type);
@@ -1131,7 +1131,7 @@  discard block
 block discarded – undo
1131 1131
 
1132 1132
     if (!empty($post->post_tags)) {
1133 1133
 
1134
-        if (taxonomy_exists($post_type . '_tags')):
1134
+        if (taxonomy_exists($post_type.'_tags')):
1135 1135
             $links = array();
1136 1136
             $terms = array();
1137 1137
             // to limit post tags
@@ -1158,8 +1158,8 @@  discard block
 block discarded – undo
1158 1158
                 $post_term = trim($post_term);
1159 1159
 
1160 1160
                 $priority_location = false;
1161
-                if ($insert_term = term_exists($post_term, $post_type . '_tags')) {
1162
-                    $term = get_term_by('id', $insert_term['term_id'], $post_type . '_tags');
1161
+                if ($insert_term = term_exists($post_term, $post_type.'_tags')) {
1162
+                    $term = get_term_by('id', $insert_term['term_id'], $post_type.'_tags');
1163 1163
                 } else {
1164 1164
                     $post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL;
1165 1165
                     $post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL;
@@ -1169,10 +1169,10 @@  discard block
 block discarded – undo
1169 1169
                     $match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false;
1170 1170
                     if ($match_country || $match_region || $match_city) {
1171 1171
                         $priority_location = true;
1172
-                        $term = get_term_by('name', $post_term, $post_type . '_tags');
1172
+                        $term = get_term_by('name', $post_term, $post_type.'_tags');
1173 1173
                     } else {
1174
-                        $insert_term = wp_insert_term($post_term, $post_type . '_tags');
1175
-                        $term = get_term_by('name', $post_term, $post_type . '_tags');
1174
+                        $insert_term = wp_insert_term($post_term, $post_type.'_tags');
1175
+                        $term = get_term_by('name', $post_term, $post_type.'_tags');
1176 1176
                     }
1177 1177
                 }
1178 1178
 
@@ -1189,12 +1189,12 @@  discard block
 block discarded – undo
1189 1189
                          * @param string $tag_link The tag link html.
1190 1190
                          * @param object $term The tag term object.
1191 1191
                          */
1192
-                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1192
+                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link', $tag_link, $term);
1193 1193
                         $links[] = $tag_link;
1194 1194
                     } else {
1195
-                        $tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>";
1195
+                        $tag_link = "<a href='".esc_attr(get_term_link($term->term_id, $term->taxonomy))."'>$term->name</a>";
1196 1196
                         /** This action is documented in geodirectory-template_actions.php */
1197
-                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1197
+                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link', $tag_link, $term);
1198 1198
                         $links[] = $tag_link;
1199 1199
                     }
1200 1200
                     $terms[] = $term;
@@ -1204,7 +1204,7 @@  discard block
 block discarded – undo
1204 1204
             if (!isset($listing_label)) {
1205 1205
                 $listing_label = '';
1206 1206
             }
1207
-            $taxonomies[$post_type . '_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1207
+            $taxonomies[$post_type.'_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object) $terms);
1208 1208
         endif;
1209 1209
 
1210 1210
     }
@@ -1232,7 +1232,7 @@  discard block
 block discarded – undo
1232 1232
                     $term = get_term_by('id', $post_term, $post_taxonomy);
1233 1233
 
1234 1234
                     if (is_object($term)) {
1235
-                        $term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>";
1235
+                        $term_link = "<a href='".esc_attr(get_term_link($term, $post_taxonomy))."'>$term->name</a>";
1236 1236
                         /**
1237 1237
                          * Filter the category name on the details page.
1238 1238
                          *
@@ -1240,7 +1240,7 @@  discard block
 block discarded – undo
1240 1240
                          * @param string $term_link The link html to the category.
1241 1241
                          * @param object $term The category term object.
1242 1242
                          */
1243
-                        $term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term);
1243
+                        $term_link = apply_filters('geodir_details_taxonomies_cat_link', $term_link, $term);
1244 1244
                         $links[] = $term_link;
1245 1245
                         $terms[] = $term;
1246 1246
                     }
@@ -1258,7 +1258,7 @@  discard block
 block discarded – undo
1258 1258
         if (!isset($listing_label)) {
1259 1259
             $listing_label = '';
1260 1260
         }
1261
-        $taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1261
+        $taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object) $terms);
1262 1262
 
1263 1263
     }
1264 1264
 
@@ -1271,14 +1271,14 @@  discard block
 block discarded – undo
1271 1271
      * @param string $listing_label The post type label.
1272 1272
      * @param string $listing_label The post type label with ucwords function.
1273 1273
      */
1274
-    $taxonomies = apply_filters('geodir_details_taxonomies_output',$taxonomies,$post_type,$listing_label,geodir_ucwords($listing_label));
1274
+    $taxonomies = apply_filters('geodir_details_taxonomies_output', $taxonomies, $post_type, $listing_label, geodir_ucwords($listing_label));
1275 1275
 
1276 1276
     if (isset($taxonomies[$post_taxonomy])) {
1277
-        echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>';
1277
+        echo '<span class="geodir-category">'.$taxonomies[$post_taxonomy].'</span>';
1278 1278
     }
1279 1279
 
1280
-    if (isset($taxonomies[$post_type . '_tags']))
1281
-        echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>';
1280
+    if (isset($taxonomies[$post_type.'_tags']))
1281
+        echo '<span class="geodir-tags">'.$taxonomies[$post_type.'_tags'].'</span>';
1282 1282
 
1283 1283
     ?>
1284 1284
     </p><?php
@@ -1299,11 +1299,11 @@  discard block
 block discarded – undo
1299 1299
  * @param object $post Optional. The post object or blank.
1300 1300
  * @package GeoDirectory
1301 1301
  */
1302
-function geodir_action_details_micordata($post='')
1302
+function geodir_action_details_micordata($post = '')
1303 1303
 {
1304 1304
 
1305 1305
     global $preview;
1306
-    if(empty($post)){global $post;}
1306
+    if (empty($post)) {global $post; }
1307 1307
     if ($preview || !geodir_is_page('detail')) {
1308 1308
         return;
1309 1309
     }
@@ -1318,7 +1318,7 @@  discard block
 block discarded – undo
1318 1318
     } else {
1319 1319
         foreach ($post_reviews as $review) {
1320 1320
 
1321
-            if($rating_value = geodir_get_commentoverall($review->comment_ID)){
1321
+            if ($rating_value = geodir_get_commentoverall($review->comment_ID)) {
1322 1322
                 $reviews[] = array(
1323 1323
                     "@type" => "Review",
1324 1324
                     "author" => $review->comment_author,
@@ -1326,7 +1326,7 @@  discard block
 block discarded – undo
1326 1326
                     "description" => $review->comment_content,
1327 1327
                     "reviewRating" => array(
1328 1328
                         "@type" => "Rating",
1329
-                        "bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score.
1329
+                        "bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score.
1330 1330
                         "ratingValue" => $rating_value,
1331 1331
                         "worstRating" => "1"
1332 1332
                     )
@@ -1356,13 +1356,13 @@  discard block
 block discarded – undo
1356 1356
     }
1357 1357
     //print_r($post);
1358 1358
     // external links
1359
-    $external_links =  array();
1359
+    $external_links = array();
1360 1360
     $external_links[] = $post->geodir_website;
1361 1361
     $external_links[] = $post->geodir_twitter;
1362 1362
     $external_links[] = $post->geodir_facebook;
1363 1363
     $external_links = array_filter($external_links);
1364 1364
 
1365
-    if(!empty($external_links)){
1365
+    if (!empty($external_links)) {
1366 1366
         $external_links = array_values($external_links);
1367 1367
     }
1368 1368
 
@@ -1372,17 +1372,17 @@  discard block
 block discarded – undo
1372 1372
 
1373 1373
     // schema type
1374 1374
     $schema_type = 'LocalBusiness';
1375
-    if(isset($post->default_category) && $post->default_category){
1375
+    if (isset($post->default_category) && $post->default_category) {
1376 1376
         $cat_schema = geodir_get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type);
1377
-        if($cat_schema){$schema_type = $cat_schema;}
1378
-        if(!$cat_schema && $schema_type=='LocalBusiness' && $post->post_type=='gd_event'){$schema_type = 'Event';}
1377
+        if ($cat_schema) {$schema_type = $cat_schema; }
1378
+        if (!$cat_schema && $schema_type == 'LocalBusiness' && $post->post_type == 'gd_event') {$schema_type = 'Event'; }
1379 1379
     }
1380 1380
 
1381 1381
     $schema = array();
1382 1382
     $schema['@context'] = "https://schema.org";
1383 1383
     $schema['@type'] = $schema_type;
1384 1384
     $schema['name'] = $post->post_title;
1385
-    $schema['description'] = wp_strip_all_tags( $post->post_content, true );
1385
+    $schema['description'] = wp_strip_all_tags($post->post_content, true);
1386 1386
     $schema['telephone'] = $post->geodir_contact;
1387 1387
     $schema['url'] = $c_url;
1388 1388
     $schema['sameAs'] = $external_links;
@@ -1396,7 +1396,7 @@  discard block
 block discarded – undo
1396 1396
         "postalCode" => $post->post_zip
1397 1397
     );
1398 1398
 
1399
-    if($post->post_latitude && $post->post_longitude) {
1399
+    if ($post->post_latitude && $post->post_longitude) {
1400 1400
         $schema['geo'] = array(
1401 1401
             "@type" => "GeoCoordinates",
1402 1402
             "latitude" => $post->post_latitude,
@@ -1404,7 +1404,7 @@  discard block
 block discarded – undo
1404 1404
         );
1405 1405
     }
1406 1406
 
1407
-    if($post_avgratings) {
1407
+    if ($post_avgratings) {
1408 1408
         $schema['aggregateRating'] = array(
1409 1409
             "@type" => "AggregateRating",
1410 1410
             "ratingValue" => $post_avgratings,
@@ -1423,10 +1423,10 @@  discard block
 block discarded – undo
1423 1423
      * @param array $schema The array of schema data to be filtered.
1424 1424
      * @param object $post The post object.
1425 1425
      */
1426
-    $schema = apply_filters('geodir_details_schema', $schema,$post);
1426
+    $schema = apply_filters('geodir_details_schema', $schema, $post);
1427 1427
 
1428 1428
 
1429
-    echo '<script type="application/ld+json">' . json_encode($schema) . '</script>';
1429
+    echo '<script type="application/ld+json">'.json_encode($schema).'</script>';
1430 1430
 
1431 1431
 
1432 1432
     $uploads = wp_upload_dir();
@@ -1439,7 +1439,7 @@  discard block
 block discarded – undo
1439 1439
      * @param string $facebook_og The open graph html to be filtered.
1440 1440
      * @param object $post The post object.
1441 1441
      */
1442
-    echo apply_filters('geodir_details_facebook_og', $facebook_og,$post);
1442
+    echo apply_filters('geodir_details_facebook_og', $facebook_og, $post);
1443 1443
 
1444 1444
 
1445 1445
 
@@ -1462,9 +1462,9 @@  discard block
 block discarded – undo
1462 1462
     ?>
1463 1463
     <div class="geodir-pos_navigation clearfix">
1464 1464
     <div
1465
-        class="geodir-post_left"><?php previous_post_link('%link', '' . __('Previous', 'geodirectory'), false) ?></div>
1465
+        class="geodir-post_left"><?php previous_post_link('%link', ''.__('Previous', 'geodirectory'), false) ?></div>
1466 1466
     <div
1467
-        class="geodir-post_right"><?php next_post_link('%link', __('Next', 'geodirectory') . '', false) ?></div>
1467
+        class="geodir-post_right"><?php next_post_link('%link', __('Next', 'geodirectory').'', false) ?></div>
1468 1468
     </div><?php
1469 1469
 }
1470 1470
 
@@ -1533,12 +1533,12 @@  discard block
 block discarded – undo
1533 1533
     $gd_post_type = geodir_get_current_posttype();
1534 1534
     $post_type_info = get_post_type_object($gd_post_type);
1535 1535
 
1536
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
1536
+    $add_string_in_title = __('All', 'geodirectory').' ';
1537 1537
     if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
1538
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
1538
+        $add_string_in_title = __('My Favorite', 'geodirectory').' ';
1539 1539
     }
1540 1540
 
1541
-    $list_title = $add_string_in_title . __($post_type_info->labels->name, 'geodirectory');
1541
+    $list_title = $add_string_in_title.__($post_type_info->labels->name, 'geodirectory');
1542 1542
     $single_name = $post_type_info->labels->singular_name;
1543 1543
 
1544 1544
     $taxonomy = geodir_get_taxonomies($gd_post_type, true);
@@ -1566,12 +1566,12 @@  discard block
 block discarded – undo
1566 1566
         $current_term = get_term_by('slug', $term, $taxonomy[0]);
1567 1567
         if (!empty($current_term)) {
1568 1568
             $current_term_name = __(geodir_utf8_ucfirst($current_term->name), 'geodirectory');
1569
-            if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1569
+            if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type.'category') {
1570 1570
                 $location_last_char = substr($location_name, -1);
1571 1571
                 $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1572
-                $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1572
+                $list_title .= __(' in', 'geodirectory').' '.$location_name.$location_name_attach.' '.$current_term_name;
1573 1573
             } else {
1574
-                $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1574
+                $list_title .= __(' in', 'geodirectory')." '".$current_term_name."'";
1575 1575
             }
1576 1576
         } else {
1577 1577
             if (count($taxonomy) > 1) {
@@ -1579,12 +1579,12 @@  discard block
 block discarded – undo
1579 1579
 
1580 1580
                 if (!empty($current_term)) {
1581 1581
                     $current_term_name = __(geodir_utf8_ucfirst($current_term->name), 'geodirectory');
1582
-                    if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1582
+                    if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type.'category') {
1583 1583
                         $location_last_char = substr($location_name, -1);
1584 1584
                         $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1585
-                        $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1585
+                        $list_title .= __(' in', 'geodirectory').' '.$location_name.$location_name_attach.' '.$current_term_name;
1586 1586
                     } else {
1587
-                        $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1587
+                        $list_title .= __(' in', 'geodirectory')." '".$current_term_name."'";
1588 1588
                     }
1589 1589
                 }
1590 1590
             }
@@ -1612,7 +1612,7 @@  discard block
 block discarded – undo
1612 1612
                 $gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
1613 1613
             }
1614 1614
 
1615
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'";
1615
+            $list_title .= __(' in', 'geodirectory')." '".$gd_city."'";
1616 1616
         } else if ($gd_region != '') {
1617 1617
             if ($gd_region_actual != '') {
1618 1618
                 $gd_region = $gd_region_actual;
@@ -1622,7 +1622,7 @@  discard block
 block discarded – undo
1622 1622
                 $gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
1623 1623
             }
1624 1624
 
1625
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'";
1625
+            $list_title .= __(' in', 'geodirectory')." '".$gd_region."'";
1626 1626
         } else if ($gd_country != '') {
1627 1627
             if ($gd_country_actual != '') {
1628 1628
                 $gd_country = $gd_country_actual;
@@ -1632,12 +1632,12 @@  discard block
 block discarded – undo
1632 1632
                 $gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
1633 1633
             }
1634 1634
 
1635
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'";
1635
+            $list_title .= __(' in', 'geodirectory')." '".$gd_country."'";
1636 1636
         }
1637 1637
     }
1638 1638
 
1639 1639
     if (is_search()) {
1640
-        $list_title = __('Search', 'geodirectory') . ' ' . __(geodir_utf8_ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
1640
+        $list_title = __('Search', 'geodirectory').' '.__(geodir_utf8_ucfirst($post_type_info->labels->name), 'geodirectory').__(' For :', 'geodirectory')." '".get_search_query()."'";
1641 1641
     }
1642 1642
     /** This action is documented in geodirectory_template_actions.php */
1643 1643
     $class = apply_filters('geodir_page_title_class', 'entry-title fn');
@@ -1647,26 +1647,26 @@  discard block
 block discarded – undo
1647 1647
 
1648 1648
     $title = $list_title;
1649 1649
     $gd_page = '';
1650
-    if(geodir_is_page('pt')){
1650
+    if (geodir_is_page('pt')) {
1651 1651
         $gd_page = 'pt';
1652
-        $title  = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1652
+        $title = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1653 1653
     }
1654
-    elseif(geodir_is_page('listing')){
1654
+    elseif (geodir_is_page('listing')) {
1655 1655
         $gd_page = 'listing';
1656 1656
         global $wp_query;
1657 1657
         $current_term = $wp_query->get_queried_object();
1658
-        if (strpos($current_term->taxonomy,'_tags') !== false) {
1658
+        if (strpos($current_term->taxonomy, '_tags') !== false) {
1659 1659
             $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
1660
-        }else{
1660
+        } else {
1661 1661
             $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
1662 1662
         }
1663 1663
 
1664 1664
     }
1665
-    elseif(geodir_is_page('author')){
1665
+    elseif (geodir_is_page('author')) {
1666 1666
         $gd_page = 'author';
1667
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
1667
+        if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
1668 1668
             $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
1669
-        }else{
1669
+        } else {
1670 1670
             $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
1671 1671
         }
1672 1672
 
@@ -1680,16 +1680,16 @@  discard block
 block discarded – undo
1680 1680
      * @param string $title The page title including variables.
1681 1681
      * @param string $gd_page The GeoDirectory page type if any.
1682 1682
      */
1683
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
1683
+    $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
1684 1684
 
1685
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
1685
+    echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'.
1686 1686
         /**
1687 1687
          * Filter the listing page title.
1688 1688
          *
1689 1689
          * @since 1.0.0
1690 1690
          * @param string $list_title The title for the category page.
1691 1691
          */
1692
-        apply_filters('geodir_listing_page_title', $title) . '</h1></header>';
1692
+        apply_filters('geodir_listing_page_title', $title).'</h1></header>';
1693 1693
 }
1694 1694
 
1695 1695
 add_action('geodir_listings_page_description', 'geodir_action_listings_description', 10);
@@ -1708,16 +1708,16 @@  discard block
 block discarded – undo
1708 1708
     $gd_post_type = geodir_get_current_posttype();
1709 1709
     if (isset($current_term->term_id) && $current_term->term_id != '') {
1710 1710
 
1711
-        $term_desc = term_description($current_term->term_id, $gd_post_type . '_tags');
1711
+        $term_desc = term_description($current_term->term_id, $gd_post_type.'_tags');
1712 1712
         $saved_data = stripslashes(geodir_get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type));
1713 1713
         if ($term_desc && !$saved_data) {
1714 1714
             $saved_data = $term_desc;
1715 1715
         }
1716 1716
 
1717 1717
         // stop payment manager filtering content length
1718
-        $filter_priority = has_filter( 'the_content', 'geodir_payments_the_content' );
1719
-        if ( false !== $filter_priority ) {
1720
-            remove_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1718
+        $filter_priority = has_filter('the_content', 'geodir_payments_the_content');
1719
+        if (false !== $filter_priority) {
1720
+            remove_filter('the_content', 'geodir_payments_the_content', $filter_priority);
1721 1721
         }
1722 1722
 
1723 1723
         /**
@@ -1731,14 +1731,14 @@  discard block
 block discarded – undo
1731 1731
         $cat_description = apply_filters('the_content', $saved_data);
1732 1732
 
1733 1733
 
1734
-        if ( false !== $filter_priority ) {
1735
-            add_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1734
+        if (false !== $filter_priority) {
1735
+            add_filter('the_content', 'geodir_payments_the_content', $filter_priority);
1736 1736
         }
1737 1737
 
1738 1738
         if ($cat_description) {
1739 1739
             ?>
1740 1740
 
1741
-            <div class="term_description"><?php echo $cat_description;?></div> <?php
1741
+            <div class="term_description"><?php echo $cat_description; ?></div> <?php
1742 1742
         }
1743 1743
 
1744 1744
     }
@@ -1788,13 +1788,13 @@  discard block
 block discarded – undo
1788 1788
 function geodir_action_sidebar_left_open($type = '', $id = '', $class = '', $itemtype = '')
1789 1789
 {
1790 1790
     if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
1791
-        $width_css = 'style="width:' . $width . '%;"';
1791
+        $width_css = 'style="width:'.$width.'%;"';
1792 1792
     } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
1793
-        $width_css = 'style="width:' . $width . '%;"';
1793
+        $width_css = 'style="width:'.$width.'%;"';
1794 1794
     } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
1795
-        $width_css = 'style="width:' . $width . '%;"';
1795
+        $width_css = 'style="width:'.$width.'%;"';
1796 1796
     } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
1797
-        $width_css = 'style="width:' . $width . '%;"';
1797
+        $width_css = 'style="width:'.$width.'%;"';
1798 1798
     } else {
1799 1799
         $width_css = '';
1800 1800
     }
@@ -2099,11 +2099,11 @@  discard block
 block discarded – undo
2099 2099
 
2100 2100
     $title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
2101 2101
 
2102
-    if(geodir_is_page('add-listing')){
2102
+    if (geodir_is_page('add-listing')) {
2103 2103
         $gd_page = 'add-listing';
2104
-        if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
2104
+        if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2105 2105
             $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
2106
-        }elseif(isset($listing_type)){
2106
+        }elseif (isset($listing_type)) {
2107 2107
             $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
2108 2108
         }
2109 2109
 
@@ -2117,9 +2117,9 @@  discard block
 block discarded – undo
2117 2117
      * @param string $title The page title including variables.
2118 2118
      * @param string $gd_page The GeoDirectory page type if any.
2119 2119
      */
2120
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2120
+    $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2121 2121
 
2122
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">';
2122
+    echo '<header class="'.$class_header.'"><h1 class="'.$class.'">';
2123 2123
     echo $title;
2124 2124
     echo '</h1></header>';
2125 2125
 }
@@ -2133,7 +2133,7 @@  discard block
 block discarded – undo
2133 2133
  */
2134 2134
 function geodir_action_add_listing_page_mandatory()
2135 2135
 {?>
2136
-    <p class="geodir-note "><span class="geodir-required">*</span>&nbsp;<?php echo INDICATES_MANDATORY_FIELDS_TEXT;?></p>
2136
+    <p class="geodir-note "><span class="geodir-required">*</span>&nbsp;<?php echo INDICATES_MANDATORY_FIELDS_TEXT; ?></p>
2137 2137
 <?php
2138 2138
 }
2139 2139
 
@@ -2168,7 +2168,7 @@  discard block
 block discarded – undo
2168 2168
 
2169 2169
     if (isset($_REQUEST['backandedit'])) {
2170 2170
         global $post;
2171
-        $post = (object)$gd_session->get('listing');
2171
+        $post = (object) $gd_session->get('listing');
2172 2172
         $listing_type = $post->listing_type;
2173 2173
         $title = $post->post_title;
2174 2174
         $desc = $post->post_desc;
@@ -2183,7 +2183,7 @@  discard block
 block discarded – undo
2183 2183
         $thumb_img_arr = geodir_get_images($post->ID);
2184 2184
         if ($thumb_img_arr) {
2185 2185
             foreach ($thumb_img_arr as $post_img) {
2186
-                $curImages .= $post_img->src . ',';
2186
+                $curImages .= $post_img->src.',';
2187 2187
             }
2188 2188
         }
2189 2189
 
@@ -2191,7 +2191,7 @@  discard block
 block discarded – undo
2191 2191
         $title = $post->post_title;
2192 2192
         $desc = $post->post_content;
2193 2193
         $kw_tags = $post->post_tags;
2194
-        $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
2194
+        $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type.'_tags', array('fields' => 'names')));
2195 2195
     } else {
2196 2196
         $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2197 2197
     }
@@ -2202,20 +2202,20 @@  discard block
 block discarded – undo
2202 2202
 
2203 2203
     $post_type_info = geodir_get_posttype_info($listing_type);
2204 2204
 
2205
-    $cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? __($post_type_info['labels']['singular_name'], 'geodirectory') : __('Listing','geodirectory');
2205
+    $cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? __($post_type_info['labels']['singular_name'], 'geodirectory') : __('Listing', 'geodirectory');
2206 2206
     
2207 2207
     $package_info = array();
2208 2208
     $package_info = geodir_post_package_info($package_info, $post);
2209 2209
     ?>
2210
-    <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id());?>" method="post" enctype="multipart/form-data">
2211
-        <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type);?>"/>
2212
-        <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type);?>"/>
2210
+    <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id()); ?>" method="post" enctype="multipart/form-data">
2211
+        <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type); ?>"/>
2212
+        <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type); ?>"/>
2213 2213
         <?php if ($page_id) { ?>
2214
-        <input type="hidden" name="add_listing_page_id" value="<?php echo $page_id;?>"/>
2214
+        <input type="hidden" name="add_listing_page_id" value="<?php echo $page_id; ?>"/>
2215 2215
         <?php } if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { ?>
2216
-            <input type="hidden" name="pid" value="<?php echo sanitize_text_field($_REQUEST['pid']);?>"/>
2216
+            <input type="hidden" name="pid" value="<?php echo sanitize_text_field($_REQUEST['pid']); ?>"/>
2217 2217
         <?php } if (isset($_REQUEST['backandedit'])) { ?>
2218
-            <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']);?>"/>
2218
+            <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']); ?>"/>
2219 2219
         <?php
2220 2220
         } 
2221 2221
         /**
@@ -2227,7 +2227,7 @@  discard block
 block discarded – undo
2227 2227
          */
2228 2228
         do_action('geodir_before_detail_fields');
2229 2229
         ?>
2230
-        <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT;?></h5>
2230
+        <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT; ?></h5>
2231 2231
         <?php
2232 2232
         /**
2233 2233
          * Called at the top of the add listing page form for frontend.
@@ -2248,10 +2248,10 @@  discard block
 block discarded – undo
2248 2248
                  * @param string $cpt_singular_name The singular title of the curent CPT.
2249 2249
                  * @param string $listing_type The CPT being requested. ie: gd_place.
2250 2250
                  */
2251
-                echo apply_filters('geodir_add_listing_title_label', sprintf( __('%s Title', 'geodirectory'), $cpt_singular_name ),$cpt_singular_name,$listing_type); ?><span>*</span> </label>
2251
+                echo apply_filters('geodir_add_listing_title_label', sprintf(__('%s Title', 'geodirectory'), $cpt_singular_name), $cpt_singular_name, $listing_type); ?><span>*</span> </label>
2252 2252
             <input type="text" field_type="text" name="post_title" id="post_title" class="geodir_textfield"
2253 2253
                    value="<?php echo esc_attr(stripslashes($title)); ?>"/>
2254
-            <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory');?></span>
2254
+            <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span>
2255 2255
         </div>
2256 2256
         <?php
2257 2257
         $show_editor = get_option('geodir_tiny_editor_on_add_listing');
@@ -2297,7 +2297,7 @@  discard block
 block discarded – undo
2297 2297
         $desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
2298 2298
         
2299 2299
         $desc_class = '';
2300
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2300
+        if ($desc_limit === '' || (int) $desc_limit > 0) {
2301 2301
             /**
2302 2302
              * Called on the add listing page form for frontend just before the description field.
2303 2303
              *
@@ -2310,7 +2310,7 @@  discard block
 block discarded – undo
2310 2310
             $desc_class = ' hidden';
2311 2311
         }
2312 2312
         ?>
2313
-        <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class;?>">
2313
+        <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class; ?>">
2314 2314
             <label><?php
2315 2315
                 /**
2316 2316
                  * Filter the add listing page description input label.
@@ -2320,7 +2320,7 @@  discard block
 block discarded – undo
2320 2320
                  * @param string $cpt_singular_name The singular title of the curent CPT.
2321 2321
                  * @param string $listing_type The CPT being requested. ie: gd_place.
2322 2322
                  */
2323
-                echo apply_filters('geodir_add_listing_description_label',sprintf( __('%s Description', 'geodirectory'), $cpt_singular_name ),$cpt_singular_name,$listing_type); ?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
2323
+                echo apply_filters('geodir_add_listing_description_label', sprintf(__('%s Description', 'geodirectory'), $cpt_singular_name), $cpt_singular_name, $listing_type); ?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
2324 2324
             <?php
2325 2325
             if ($show_editor) {
2326 2326
                 $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
@@ -2329,16 +2329,16 @@  discard block
 block discarded – undo
2329 2329
                     <?php wp_editor($desc, "post_desc", $editor_settings); ?>
2330 2330
                 </div>
2331 2331
             <?php if ($desc_limit != '') { ?>
2332
-                <script type="text/javascript">jQuery('textarea#post_desc').attr('maxlength', "<?php echo $desc_limit;?>");</script>
2332
+                <script type="text/javascript">jQuery('textarea#post_desc').attr('maxlength', "<?php echo $desc_limit; ?>");</script>
2333 2333
             <?php } } else { ?>
2334 2334
                 <textarea field_type="textarea" name="post_desc" id="post_desc" class="geodir_textarea" maxlength="<?php echo $desc_limit; ?>"><?php echo $desc; ?></textarea>
2335 2335
             <?php } if ($desc_limit_msg != '') { ?>
2336 2336
                 <span class="geodir_message_note"><?php echo $desc_limit_msg; ?></span>
2337 2337
             <?php } ?>
2338
-            <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory');?></span>
2338
+            <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory'); ?></span>
2339 2339
         </div>
2340 2340
         <?php
2341
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2341
+        if ($desc_limit === '' || (int) $desc_limit > 0) {
2342 2342
             /**
2343 2343
              * Called on the add listing page form for frontend just after the description field.
2344 2344
              *
@@ -2377,7 +2377,7 @@  discard block
 block discarded – undo
2377 2377
         $kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
2378 2378
         
2379 2379
         $tags_class = '';
2380
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2380
+        if ($kw_tags_count === '' || (int) $kw_tags_count > 0) {
2381 2381
             /**
2382 2382
              * Called on the add listing page form for frontend just before the tags field.
2383 2383
              *
@@ -2388,14 +2388,14 @@  discard block
 block discarded – undo
2388 2388
             $tags_class = ' hidden';
2389 2389
         }
2390 2390
         ?>
2391
-        <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class;?>">
2391
+        <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class; ?>">
2392 2392
             <label><?php echo TAGKW_TEXT; ?></label>
2393 2393
             <input name="post_tags" id="post_tags" value="<?php echo $kw_tags; ?>" type="text" class="geodir_textfield"
2394
-                   maxlength="<?php echo $kw_tags_count;?>"/>
2395
-            <span class="geodir_message_note"><?php echo $kw_tags_msg;?></span>
2394
+                   maxlength="<?php echo $kw_tags_count; ?>"/>
2395
+            <span class="geodir_message_note"><?php echo $kw_tags_msg; ?></span>
2396 2396
         </div>
2397 2397
         <?php
2398
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2398
+        if ($kw_tags_count === '' || (int) $kw_tags_count > 0) {
2399 2399
             /**
2400 2400
              * Called on the add listing page form for frontend just after the tags field.
2401 2401
              *
@@ -2421,7 +2421,7 @@  discard block
 block discarded – undo
2421 2421
         $thumb_img_arr = array();
2422 2422
         $totImg = 0;
2423 2423
         if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2424
-            $post = (object)$gd_session->get('listing');
2424
+            $post = (object) $gd_session->get('listing');
2425 2425
             if (isset($post->post_images))
2426 2426
                 $curImages = trim($post->post_images, ",");
2427 2427
 
@@ -2434,7 +2434,7 @@  discard block
 block discarded – undo
2434 2434
             $listing_type = $post->listing_type;
2435 2435
 
2436 2436
         } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2437
-            $post = geodir_get_post_info((int)$_REQUEST['pid']);
2437
+            $post = geodir_get_post_info((int) $_REQUEST['pid']);
2438 2438
             $listing_type = $post->post_type;
2439 2439
             $thumb_img_arr = geodir_get_images($_REQUEST['pid']);
2440 2440
 
@@ -2448,7 +2448,7 @@  discard block
 block discarded – undo
2448 2448
                 //$curImages = $img->src.",";
2449 2449
             }
2450 2450
 
2451
-            $totImg = count((array)$thumb_img_arr);
2451
+            $totImg = count((array) $thumb_img_arr);
2452 2452
         }
2453 2453
 
2454 2454
         if ($curImages != '')
@@ -2469,15 +2469,15 @@  discard block
 block discarded – undo
2469 2469
         if ($show_image_input_box) {
2470 2470
             ?>
2471 2471
 
2472
-            <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT;?>
2472
+            <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT; ?>
2473 2473
                 <?php if ($image_limit == 1) {
2474
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
2474
+                    echo '<br /><small>('.__('You can upload', 'geodirectory').' '.$image_limit.' '.__('image with this package', 'geodirectory').')</small>';
2475 2475
                 } ?>
2476 2476
                 <?php if ($image_limit > 1) {
2477
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
2477
+                    echo '<br /><small>('.__('You can upload', 'geodirectory').' '.$image_limit.' '.__('images with this package', 'geodirectory').')</small>';
2478 2478
                 } ?>
2479 2479
                 <?php if ($image_limit == '') {
2480
-                    echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
2480
+                    echo '<br /><small>('.__('You can upload unlimited images with this package', 'geodirectory').')</small>';
2481 2481
                 } ?>
2482 2482
             </h5>
2483 2483
 
@@ -2492,11 +2492,11 @@  discard block
 block discarded – undo
2492 2492
                 <div
2493 2493
                     class="plupload-upload-uic hide-if-no-js <?php if ($multiple): ?>plupload-upload-uic-multiple<?php endif; ?>"
2494 2494
                     id="<?php echo $id; ?>plupload-upload-ui">
2495
-                    <h4><?php _e('Drop files to upload', 'geodirectory');?></h4><br/>
2495
+                    <h4><?php _e('Drop files to upload', 'geodirectory'); ?></h4><br/>
2496 2496
                     <input id="<?php echo $id; ?>plupload-browse-button" type="button"
2497 2497
                            value="<?php esc_attr_e('Select Files', 'geodirectory'); ?>" class="geodir_button"/>
2498 2498
                     <span class="ajaxnonceplu"
2499
-                          id="ajaxnonceplu<?php echo wp_create_nonce($id . 'pluploadan'); ?>"></span>
2499
+                          id="ajaxnonceplu<?php echo wp_create_nonce($id.'pluploadan'); ?>"></span>
2500 2500
                     <?php if ($width && $height): ?>
2501 2501
                         <span class="plupload-resize"></span>
2502 2502
                         <span class="plupload-width" id="plupload-width<?php echo $width; ?>"></span>
@@ -2509,7 +2509,7 @@  discard block
 block discarded – undo
2509 2509
                      id="<?php echo $id; ?>plupload-thumbs" style="border-top:1px solid #ccc; padding-top:10px;">
2510 2510
                 </div>
2511 2511
                 <span
2512
-                    id="upload-msg"><?php _e('Please drag &amp; drop the images to rearrange the order', 'geodirectory');?></span>
2512
+                    id="upload-msg"><?php _e('Please drag &amp; drop the images to rearrange the order', 'geodirectory'); ?></span>
2513 2513
                 <span id="<?php echo $id; ?>upload-error" style="display:none"></span>
2514 2514
             </div>
2515 2515
 
@@ -2521,7 +2521,7 @@  discard block
 block discarded – undo
2521 2521
          *
2522 2522
          * @since 1.0.0
2523 2523
          */
2524
-        do_action('geodir_after_main_form_fields');?>
2524
+        do_action('geodir_after_main_form_fields'); ?>
2525 2525
 
2526 2526
 
2527 2527
         <!-- add captcha code -->
@@ -2532,7 +2532,7 @@  discard block
 block discarded – undo
2532 2532
         </script>
2533 2533
         <noscript>
2534 2534
             <div>
2535
-                <label><?php _e('Type 64 into this box', 'geodirectory');?></label>
2535
+                <label><?php _e('Type 64 into this box', 'geodirectory'); ?></label>
2536 2536
                 <input type="text" id="geodir_spamblocker_top_form" name="geodir_spamblocker" value="" maxlength="10"/>
2537 2537
             </div>
2538 2538
         </noscript>
@@ -2542,10 +2542,10 @@  discard block
 block discarded – undo
2542 2542
         <!-- end captcha code -->
2543 2543
 
2544 2544
         <div id="geodir-add-listing-submit" class="geodir_form_row clear_both" style="padding:2px;text-align:center;">
2545
-            <input type="submit" value="<?php echo PRO_PREVIEW_BUTTON;?>"
2546
-                   class="geodir_button" <?php echo $submit_button;?>/>
2545
+            <input type="submit" value="<?php echo PRO_PREVIEW_BUTTON; ?>"
2546
+                   class="geodir_button" <?php echo $submit_button; ?>/>
2547 2547
             <span class="geodir_message_note"
2548
-                  style="padding-left:0px;"> <?php _e('Note: You will be able to see a preview in the next page', 'geodirectory');?></span>
2548
+                  style="padding-left:0px;"> <?php _e('Note: You will be able to see a preview in the next page', 'geodirectory'); ?></span>
2549 2549
         </div>
2550 2550
 
2551 2551
     </form>
@@ -2607,7 +2607,7 @@  discard block
 block discarded – undo
2607 2607
         class="<?php
2608 2608
         /** This action is documented in geodirectory_template_actions.php */
2609 2609
         echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
2610
-        <?php dynamic_sidebar('Reg/Login Top Section');?>
2610
+        <?php dynamic_sidebar('Reg/Login Top Section'); ?>
2611 2611
     </div><!-- clearfix ends here-->
2612 2612
 <?php
2613 2613
 }
@@ -2627,11 +2627,11 @@  discard block
 block discarded – undo
2627 2627
 
2628 2628
     global $user_login;
2629 2629
     
2630
-    $is_enable_signup = get_option( 'users_can_register' );
2630
+    $is_enable_signup = get_option('users_can_register');
2631 2631
     
2632 2632
     ?>
2633 2633
     <script type="text/javascript">
2634
-        <?php if ( $user_login ) { ?>
2634
+        <?php if ($user_login) { ?>
2635 2635
         setTimeout(function () {
2636 2636
             try {
2637 2637
                 d = document.getElementById('user_pass');
@@ -2648,7 +2648,7 @@  discard block
 block discarded – undo
2648 2648
         <?php } ?>
2649 2649
     </script>
2650 2650
     <script type="text/javascript">
2651
-        <?php if ( $user_login ) { ?>
2651
+        <?php if ($user_login) { ?>
2652 2652
         setTimeout(function () {
2653 2653
             try {
2654 2654
                 d = document.getElementById('user_pass');
@@ -2673,7 +2673,7 @@  discard block
 block discarded – undo
2673 2673
         foreach ($errors as $errorsObj) {
2674 2674
             foreach ($errorsObj as $key => $val) {
2675 2675
                 for ($i = 0; $i < count($val); $i++) {
2676
-                    echo "<div class=error_msg_fix>" . $val[$i] . '</div>';
2676
+                    echo "<div class=error_msg_fix>".$val[$i].'</div>';
2677 2677
                     $registration_error_msg = 1;
2678 2678
                 }
2679 2679
             }
@@ -2690,10 +2690,10 @@  discard block
 block discarded – undo
2690 2690
              *
2691 2691
              * @since 1.0.0
2692 2692
              */
2693
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2693
+            include(geodir_plugin_path()."/geodirectory-templates/login_frm.php"); ?>
2694 2694
         </div>
2695 2695
 
2696
-    <?php } elseif (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_up' && $is_enable_signup ) { ?>
2696
+    <?php } elseif (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_up' && $is_enable_signup) { ?>
2697 2697
 
2698 2698
         <div class="registration_form">
2699 2699
             <?php
@@ -2702,7 +2702,7 @@  discard block
 block discarded – undo
2702 2702
              *
2703 2703
              * @since 1.0.0
2704 2704
              */
2705
-            include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2705
+            include(geodir_plugin_path()."/geodirectory-templates/reg_frm.php"); ?>
2706 2706
         </div>
2707 2707
 
2708 2708
     <?php } else { ?>
@@ -2714,10 +2714,10 @@  discard block
 block discarded – undo
2714 2714
              *
2715 2715
              * @since 1.0.0
2716 2716
              */
2717
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2717
+            include(geodir_plugin_path()."/geodirectory-templates/login_frm.php"); ?>
2718 2718
         </div>
2719 2719
         
2720
-        <?php if ( $is_enable_signup ) { ?>
2720
+        <?php if ($is_enable_signup) { ?>
2721 2721
             <div class="registration_form_r">
2722 2722
                 <?php
2723 2723
                 /**
@@ -2725,7 +2725,7 @@  discard block
 block discarded – undo
2725 2725
                  *
2726 2726
                  * @since 1.0.0
2727 2727
                  */
2728
-                include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2728
+                include(geodir_plugin_path()."/geodirectory-templates/reg_frm.php"); ?>
2729 2729
             </div>
2730 2730
         <?php } ?>
2731 2731
 
@@ -2762,12 +2762,12 @@  discard block
 block discarded – undo
2762 2762
     $gd_post_type = geodir_get_current_posttype();
2763 2763
     $post_type_info = get_post_type_object($gd_post_type);
2764 2764
 
2765
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
2765
+    $add_string_in_title = __('All', 'geodirectory').' ';
2766 2766
     if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2767
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
2767
+        $add_string_in_title = __('My Favorite', 'geodirectory').' ';
2768 2768
     }
2769 2769
 
2770
-    $list_title = $add_string_in_title . $post_type_info->labels->name;
2770
+    $list_title = $add_string_in_title.$post_type_info->labels->name;
2771 2771
     $single_name = $post_type_info->labels->singular_name;
2772 2772
 
2773 2773
     $taxonomy = geodir_get_taxonomies($gd_post_type);
@@ -2775,12 +2775,12 @@  discard block
 block discarded – undo
2775 2775
     if (!empty($term)) {
2776 2776
         $current_term = get_term_by('slug', $term, $taxonomy[0]);
2777 2777
         if (!empty($current_term))
2778
-            $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2778
+            $list_title .= __(' in', 'geodirectory')." '".geodir_ucwords($current_term->name)."'";
2779 2779
     }
2780 2780
 
2781 2781
 
2782 2782
     if (is_search()) {
2783
-        $list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2783
+        $list_title = __('Search', 'geodirectory').' '.__($post_type_info->labels->name, 'geodirectory').__(' For :', 'geodirectory')." '".get_search_query()."'";
2784 2784
 
2785 2785
     }
2786 2786
     /** This action is documented in geodirectory_template_actions.php */
@@ -2789,11 +2789,11 @@  discard block
 block discarded – undo
2789 2789
     $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2790 2790
 
2791 2791
     $title = $list_title;
2792
-    if(geodir_is_page('author')){
2792
+    if (geodir_is_page('author')) {
2793 2793
         $gd_page = 'author';
2794
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2794
+        if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2795 2795
             $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2796
-        }else{
2796
+        } else {
2797 2797
             $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2798 2798
         }
2799 2799
 
@@ -2807,16 +2807,16 @@  discard block
 block discarded – undo
2807 2807
      * @param string $title The page title including variables.
2808 2808
      * @param string $gd_page The GeoDirectory page type if any.
2809 2809
      */
2810
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2810
+    $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2811 2811
 
2812
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2812
+    echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'.
2813 2813
         /**
2814 2814
          * Filter the author page title text.
2815 2815
          *
2816 2816
          * @since 1.0.0
2817 2817
          * @param string $list_title The title for the page.
2818 2818
          */
2819
-        apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
2819
+        apply_filters('geodir_author_page_title_text', $title).'</h1></header>';
2820 2820
 }
2821 2821
 
2822 2822
 
@@ -3021,19 +3021,19 @@  discard block
 block discarded – undo
3021 3021
     $post_type_info = get_post_type_object($gd_post_type);
3022 3022
 
3023 3023
     $pt_name = '';
3024
-    if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
3024
+    if (isset($post_type_info->labels->name)) {$pt_name = $post_type_info->labels->name; }
3025 3025
 
3026 3026
     if (is_search()) {
3027
-        $list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
3027
+        $list_title = __('Search', 'geodirectory').' '.__($pt_name, 'geodirectory').__(' For :', 'geodirectory')." '".get_search_query()."'";
3028 3028
 
3029 3029
     }
3030 3030
     /** This action is documented in geodirectory_template_actions.php */
3031 3031
     $class = apply_filters('geodir_page_title_class', 'entry-title fn');
3032 3032
     /** This action is documented in geodirectory_template_actions.php */
3033 3033
     $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
3034
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
3034
+    echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'.
3035 3035
         /** This action is documented in geodirectory_template_actions.php */
3036
-        apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
3036
+        apply_filters('geodir_listing_page_title', wptexturize($list_title)).'</h1></header>';
3037 3037
 }
3038 3038
 
3039 3039
 // action for adding the listings page top widget area
@@ -3437,7 +3437,7 @@  discard block
 block discarded – undo
3437 3437
         $gd_post_type = geodir_get_current_posttype();
3438 3438
         $post_type_info = get_post_type_object($gd_post_type);
3439 3439
 
3440
-        $list_title = __('Search', 'geodirectory') . ' ' . __(geodir_utf8_ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
3440
+        $list_title = __('Search', 'geodirectory').' '.__(geodir_utf8_ucfirst($post_type_info->labels->name), 'geodirectory').__(' :', 'geodirectory');
3441 3441
     }
3442 3442
     return $list_title;
3443 3443
 }
@@ -3453,7 +3453,7 @@  discard block
 block discarded – undo
3453 3453
  * @param string $position Position to add the post content. 'before' or 'after'. Default 'before'.
3454 3454
  * @param string $gd_page The geodirectory page type. Default null.
3455 3455
  */
3456
-function geodir_add_page_content( $position = 'before', $gd_page = '' ) {
3456
+function geodir_add_page_content($position = 'before', $gd_page = '') {
3457 3457
     global $post;
3458 3458
 
3459 3459
     $gd_page_id = NULL;
@@ -3529,17 +3529,17 @@  discard block
 block discarded – undo
3529 3529
  * @param WP_Post $post           WP_Post object.
3530 3530
  * @return string Filtered SQL JOIN clause.
3531 3531
  */
3532
-function geodir_previous_next_post_join( $join, $in_same_term, $excluded_terms, $taxonomy, $post ) {
3532
+function geodir_previous_next_post_join($join, $in_same_term, $excluded_terms, $taxonomy, $post) {
3533 3533
     global $plugin_prefix;
3534 3534
 
3535
-    if ( !empty($post->post_type) && in_array( $post->post_type, geodir_get_posttypes() ) ) {
3536
-        $join .= " INNER JOIN " . $plugin_prefix . $post->post_type . "_detail AS gd ON gd.post_id = p.ID";
3535
+    if (!empty($post->post_type) && in_array($post->post_type, geodir_get_posttypes())) {
3536
+        $join .= " INNER JOIN ".$plugin_prefix.$post->post_type."_detail AS gd ON gd.post_id = p.ID";
3537 3537
     }
3538 3538
     
3539 3539
     return $join;
3540 3540
 }
3541
-add_filter( 'get_previous_post_join', 'geodir_previous_next_post_join', 10, 5 );
3542
-add_filter( 'get_next_post_join', 'geodir_previous_next_post_join', 10, 5 );
3541
+add_filter('get_previous_post_join', 'geodir_previous_next_post_join', 10, 5);
3542
+add_filter('get_next_post_join', 'geodir_previous_next_post_join', 10, 5);
3543 3543
 
3544 3544
 /**
3545 3545
  * Filters the WHERE clause in the SQL for an adjacent post query.
@@ -3557,32 +3557,32 @@  discard block
 block discarded – undo
3557 3557
  * @param WP_Post $post          WP_Post object.
3558 3558
  * @return string Filtered SQL WHERE clause.
3559 3559
  */
3560
-function geodir_previous_next_post_where( $where, $in_same_term, $excluded_terms, $taxonomy, $post ) {
3560
+function geodir_previous_next_post_where($where, $in_same_term, $excluded_terms, $taxonomy, $post) {
3561 3561
     global $wpdb, $plugin_prefix;
3562 3562
 
3563
-    if ( !empty($post->post_type) && ( !empty( $post->country_slug ) || !empty( $post->region_slug ) || !empty( $post->city_slug ) ) && in_array( $post->post_type, geodir_get_posttypes() ) ) {
3563
+    if (!empty($post->post_type) && (!empty($post->country_slug) || !empty($post->region_slug) || !empty($post->city_slug)) && in_array($post->post_type, geodir_get_posttypes())) {
3564 3564
         $post_locations = '';
3565 3565
         $post_locations_var = array();
3566 3566
         
3567
-        if ( !empty( $post->country_slug ) ) {
3567
+        if (!empty($post->country_slug)) {
3568 3568
             $post_locations .= " AND post_locations LIKE %s";
3569
-            $post_locations_var[] = "%,[" . $post->country_slug . "]";
3569
+            $post_locations_var[] = "%,[".$post->country_slug."]";
3570 3570
         }
3571 3571
 
3572
-        if ( !empty( $post->region_slug ) ) {
3572
+        if (!empty($post->region_slug)) {
3573 3573
             $post_locations .= " AND post_locations LIKE %s";
3574
-            $post_locations_var[] = "%,[" . $post->region_slug . "],%";
3574
+            $post_locations_var[] = "%,[".$post->region_slug."],%";
3575 3575
         }
3576 3576
 
3577
-        if ( !empty( $post->city_slug ) ) {
3577
+        if (!empty($post->city_slug)) {
3578 3578
             $post_locations .= " AND post_locations LIKE %s";
3579
-            $post_locations_var[] = "[" . $post->city_slug . "],%";
3579
+            $post_locations_var[] = "[".$post->city_slug."],%";
3580 3580
         }
3581 3581
         
3582
-        $where .= $wpdb->prepare( $post_locations, $post_locations_var );
3582
+        $where .= $wpdb->prepare($post_locations, $post_locations_var);
3583 3583
     }
3584 3584
     
3585 3585
     return $where;
3586 3586
 }
3587
-add_filter( 'get_previous_post_where', 'geodir_previous_next_post_where', 10, 5 );
3588
-add_filter( 'get_next_post_where', 'geodir_previous_next_post_where', 10, 5 );
3589 3587
\ No newline at end of file
3588
+add_filter('get_previous_post_where', 'geodir_previous_next_post_where', 10, 5);
3589
+add_filter('get_next_post_where', 'geodir_previous_next_post_where', 10, 5);
3590 3590
\ No newline at end of file
Please login to merge, or discard this patch.
geodirectory-functions/cat-meta-functions/cat_meta.php 3 patches
Braces   +12 added lines, -9 removed lines patch added patch discarded remove patch
@@ -203,8 +203,9 @@  discard block
 block discarded – undo
203 203
 #############################################################
204 204
 function manage_category_custom_fields($deprecated, $column_name, $term_id)
205 205
 {
206
-    if ($column_name == 'cat_ID_num')
207
-        echo $term_id;
206
+    if ($column_name == 'cat_ID_num') {
207
+            echo $term_id;
208
+    }
208 209
 
209 210
     if ($column_name == 'cat_icon') {
210 211
         $term_icon_url = geodir_get_tax_meta($term_id, 'ct_cat_icon');
@@ -240,8 +241,9 @@  discard block
 block discarded – undo
240 241
 
241 242
     if ($column_name == 'cat_default_img') {
242 243
         $cat_default_img = geodir_get_tax_meta($term_id, 'ct_cat_default_img');
243
-        if ($cat_default_img != '')
244
-            echo '<img src="' . $cat_default_img['src'] . '" style="max-height:60px;max-width:60px;"/>';
244
+        if ($cat_default_img != '') {
245
+                    echo '<img src="' . $cat_default_img['src'] . '" style="max-height:60px;max-width:60px;"/>';
246
+        }
245 247
 
246 248
     }
247 249
 }
@@ -249,11 +251,12 @@  discard block
 block discarded – undo
249 251
 function geodir_get_default_catimage($term_id, $post_type = 'gd_place')
250 252
 {
251 253
 
252
-    if ($cat_default_img = geodir_get_tax_meta($term_id, 'ct_cat_default_img', '', $post_type))
253
-        return $cat_default_img;
254
-    else
255
-        return false;
256
-}
254
+    if ($cat_default_img = geodir_get_tax_meta($term_id, 'ct_cat_default_img', '', $post_type)) {
255
+            return $cat_default_img;
256
+    } else {
257
+            return false;
258
+    }
259
+    }
257 260
 
258 261
 //Clear custom fields
259 262
 add_action('in_admin_footer', 'geodir_tax_meta_clear_custom_field');
Please login to merge, or discard this patch.
Indentation   +168 added lines, -168 removed lines patch added patch discarded remove patch
@@ -11,146 +11,146 @@  discard block
 block discarded – undo
11 11
 //include the main class file
12 12
 require_once("Tax-meta-class.php");
13 13
 function geodir_set_tax_meta_fields() {
14
-    /*
14
+	/*
15 15
      * prefix of meta keys, optional
16 16
      * use underscore (_) at the beginning to make keys hidden, for example $prefix = '_ba_';
17 17
      *  you also can make prefix empty to disable it
18 18
      *
19 19
      */
20 20
 
21
-    $prefix = 'ct_';
22
-    /*
21
+	$prefix = 'ct_';
22
+	/*
23 23
      * configure your meta box
24 24
      */
25 25
 
26
-    $config = array(
27
-        'id' => 'demo_meta_box',                    // meta box id, unique per meta box
28
-        'title' => __('Demo Meta Box', 'geodirectory'),                    // meta box title
29
-        'pages' => geodir_get_taxonomies(),            // taxonomy name, accept categories, post_tag and custom taxonomies
30
-        'context' => 'normal',                        // where the meta box appear: normal (default), advanced, side; optional
31
-        'fields' => array(),                        // list of meta fields (can be added by field arrays)
32
-        'local_images' => false,                    // Use local or hosted images (meta box images for add/remove)
33
-        'use_with_theme' => true                    //change path if used with theme set to true, false for a plugin or anything else for a custom path(default false).
34
-    );
26
+	$config = array(
27
+		'id' => 'demo_meta_box',                    // meta box id, unique per meta box
28
+		'title' => __('Demo Meta Box', 'geodirectory'),                    // meta box title
29
+		'pages' => geodir_get_taxonomies(),            // taxonomy name, accept categories, post_tag and custom taxonomies
30
+		'context' => 'normal',                        // where the meta box appear: normal (default), advanced, side; optional
31
+		'fields' => array(),                        // list of meta fields (can be added by field arrays)
32
+		'local_images' => false,                    // Use local or hosted images (meta box images for add/remove)
33
+		'use_with_theme' => true                    //change path if used with theme set to true, false for a plugin or anything else for a custom path(default false).
34
+	);
35 35
 
36 36
 
37
-    /*
37
+	/*
38 38
      * Initiate your meta box
39 39
      */
40
-    $my_meta = new Geodir_Tax_Meta_Class($config);
41
-    $my_meta->addWysiwyg($prefix . 'cat_top_desc', array('name' => __('Category Top Description', 'geodirectory'), 'desc' => __('This will appear at the top of the category listing.', 'geodirectory')));
42
-    $my_meta->addImage($prefix . 'cat_default_img', array('name' => __('Default Listing Image', 'geodirectory'), 'desc' => __('Choose a default "no image"', 'geodirectory')));
43
-    $my_meta->addImage($prefix . 'cat_icon', array('name' => __('Category Icon', 'geodirectory'), 'desc' => __('Choose a category icon', 'geodirectory'), 'validate_func' => '!empty'));
44
-    /*$my_meta->addCheckbox($prefix.'pointless',array('name'=> __('<b>Exclude</b> Rating sort option','geodirectory'),'style'=>'hidden'));*/// hidden setting to trick WPML
40
+	$my_meta = new Geodir_Tax_Meta_Class($config);
41
+	$my_meta->addWysiwyg($prefix . 'cat_top_desc', array('name' => __('Category Top Description', 'geodirectory'), 'desc' => __('This will appear at the top of the category listing.', 'geodirectory')));
42
+	$my_meta->addImage($prefix . 'cat_default_img', array('name' => __('Default Listing Image', 'geodirectory'), 'desc' => __('Choose a default "no image"', 'geodirectory')));
43
+	$my_meta->addImage($prefix . 'cat_icon', array('name' => __('Category Icon', 'geodirectory'), 'desc' => __('Choose a category icon', 'geodirectory'), 'validate_func' => '!empty'));
44
+	/*$my_meta->addCheckbox($prefix.'pointless',array('name'=> __('<b>Exclude</b> Rating sort option','geodirectory'),'style'=>'hidden'));*/// hidden setting to trick WPML
45 45
 
46
-    $my_meta->addSelect($prefix . 'cat_schema',
47
-    /*
46
+	$my_meta->addSelect($prefix . 'cat_schema',
47
+	/*
48 48
      * Allows you to add/filter the cat schema types.
49 49
      *
50 50
      * @since 1.5.7
51 51
      */
52
-    apply_filters('geodir_cat_schemas',array(
53
-        '' => __('Default (LocalBusiness)', 'geodirectory'),
54
-        'AccountingService' => 'AccountingService',
55
-        'Attorney' => 'Attorney',
56
-        'AutoBodyShop' => 'AutoBodyShop',
57
-        'AutoDealer' => 'AutoDealer',
58
-        'AutoPartsStore' => 'AutoPartsStore',
59
-        'AutoRental' => 'AutoRental',
60
-        'AutoRepair' => 'AutoRepair',
61
-        'AutoWash' => 'AutoWash',
62
-        'Bakery' => 'Bakery',
63
-        'BarOrPub' => 'BarOrPub',
64
-        'BeautySalon' => 'BeautySalon',
65
-        'BedAndBreakfast' => 'BedAndBreakfast',
66
-        'BikeStore' => 'BikeStore',
67
-        'BookStore' => 'BookStore',
68
-        'CafeOrCoffeeShop' => 'CafeOrCoffeeShop',
69
-        'Campground' => 'Campground',
70
-        'ChildCare' => 'ChildCare',
71
-        'ClothingStore' => 'ClothingStore',
72
-        'ComputerStore' => 'ComputerStore',
73
-        'DaySpa' => 'DaySpa',
74
-        'Dentist' => 'Dentist',
75
-        'DryCleaningOrLaundry' => 'DryCleaningOrLaundry',
76
-        'Electrician' => 'Electrician',
77
-        'ElectronicsStore' => 'ElectronicsStore',
78
-        'EmergencyService' => 'EmergencyService',
79
-        'EntertainmentBusiness' => 'EntertainmentBusiness',
80
-        'Event' => 'Event',
81
-        'EventVenue' => 'EventVenue',
82
-        'ExerciseGym' => 'ExerciseGym',
83
-        'FinancialService' => 'FinancialService',
84
-        'Florist' => 'Florist',
85
-        'FoodEstablishment' => 'FoodEstablishment',
86
-        'FurnitureStore' => 'FurnitureStore',
87
-        'GardenStore' => 'GardenStore',
88
-        'GeneralContractor' => 'GeneralContractor',
89
-        'GolfCourse' => 'GolfCourse',
90
-        'HairSalon' => 'HairSalon',
91
-        'HardwareStore' => 'HardwareStore',
92
-        'HealthAndBeautyBusiness' => 'HealthAndBeautyBusiness',
93
-        'HobbyShop' => 'HobbyShop',
94
-        'HomeAndConstructionBusiness' => 'HomeAndConstructionBusiness',
95
-        'HomeGoodsStore' => 'HomeGoodsStore',
96
-        'Hospital' => 'Hospital',
97
-        'Hostel' => 'Hostel',
98
-        'Hotel' => 'Hotel',
99
-        'HousePainter' => 'HousePainter',
100
-        'HVACBusiness' => 'HVACBusiness',
101
-        'InsuranceAgency' => 'InsuranceAgency',
102
-        'JewelryStore' => 'JewelryStore',
103
-        'LiquorStore' => 'LiquorStore',
104
-        'Locksmith' => 'Locksmith',
105
-        'LodgingBusiness' => 'LodgingBusiness',
106
-        'MedicalClinic' => 'MedicalClinic',
107
-        'MensClothingStore' => 'MensClothingStore',
108
-        'MobilePhoneStore' => 'MobilePhoneStore',
109
-        'Motel' => 'Motel',
110
-        'MotorcycleDealer' => 'MotorcycleDealer',
111
-        'MotorcycleRepair' => 'MotorcycleRepair',
112
-        'MovingCompany' => 'MovingCompany',
113
-        'MusicStore' => 'MusicStore',
114
-        'NailSalon' => 'NailSalon',
115
-        'NightClub' => 'NightClub',
116
-        'Notary' => 'Notary',
117
-        'OfficeEquipmentStore' => 'OfficeEquipmentStore',
118
-        'Optician' => 'Optician',
119
-        'PetStore' => 'PetStore',
120
-        'Physician' => 'Physician',
121
-        'Plumber' => 'Plumber',
122
-        'ProfessionalService' => 'ProfessionalService',
123
-        'RealEstateAgent' => 'RealEstateAgent',
124
-        'Residence' => 'Residence',
125
-        'Restaurant' => 'Restaurant',
126
-        'RoofingContractor' => 'RoofingContractor',
127
-        'RVPark' => 'RVPark',
128
-        'School' => 'School',
129
-        'SelfStorage' => 'SelfStorage',
130
-        'ShoeStore' => 'ShoeStore',
131
-        'SkiResort' => 'SkiResort',
132
-        'SportingGoodsStore' => 'SportingGoodsStore',
133
-        'SportsClub' => 'SportsClub',
134
-        'Store' => 'Store',
135
-        'TattooParlor' => 'TattooParlor',
136
-        'Taxi' => 'Taxi',
137
-        'TennisComplex' => 'TennisComplex',
138
-        'TireShop' => 'TireShop',
139
-        'TouristAttraction' => 'TouristAttraction',
140
-        'ToyStore' => 'ToyStore',
141
-        'TravelAgency' => 'TravelAgency',
142
-        //'VacationRentals' => 'VacationRentals', // Not recognised by google yet
143
-        'VeterinaryCare' => 'VeterinaryCare',
144
-        'WholesaleStore' => 'WholesaleStore',
145
-        'Winery' => 'Winery'
146
-    )),
147
-    array('name' => __('Schema Type', 'geodirectory'), 'desc' => __('Select the Schema to use for this category', 'geodirectory') . "", 'std' => array('selectkey2')));
52
+	apply_filters('geodir_cat_schemas',array(
53
+		'' => __('Default (LocalBusiness)', 'geodirectory'),
54
+		'AccountingService' => 'AccountingService',
55
+		'Attorney' => 'Attorney',
56
+		'AutoBodyShop' => 'AutoBodyShop',
57
+		'AutoDealer' => 'AutoDealer',
58
+		'AutoPartsStore' => 'AutoPartsStore',
59
+		'AutoRental' => 'AutoRental',
60
+		'AutoRepair' => 'AutoRepair',
61
+		'AutoWash' => 'AutoWash',
62
+		'Bakery' => 'Bakery',
63
+		'BarOrPub' => 'BarOrPub',
64
+		'BeautySalon' => 'BeautySalon',
65
+		'BedAndBreakfast' => 'BedAndBreakfast',
66
+		'BikeStore' => 'BikeStore',
67
+		'BookStore' => 'BookStore',
68
+		'CafeOrCoffeeShop' => 'CafeOrCoffeeShop',
69
+		'Campground' => 'Campground',
70
+		'ChildCare' => 'ChildCare',
71
+		'ClothingStore' => 'ClothingStore',
72
+		'ComputerStore' => 'ComputerStore',
73
+		'DaySpa' => 'DaySpa',
74
+		'Dentist' => 'Dentist',
75
+		'DryCleaningOrLaundry' => 'DryCleaningOrLaundry',
76
+		'Electrician' => 'Electrician',
77
+		'ElectronicsStore' => 'ElectronicsStore',
78
+		'EmergencyService' => 'EmergencyService',
79
+		'EntertainmentBusiness' => 'EntertainmentBusiness',
80
+		'Event' => 'Event',
81
+		'EventVenue' => 'EventVenue',
82
+		'ExerciseGym' => 'ExerciseGym',
83
+		'FinancialService' => 'FinancialService',
84
+		'Florist' => 'Florist',
85
+		'FoodEstablishment' => 'FoodEstablishment',
86
+		'FurnitureStore' => 'FurnitureStore',
87
+		'GardenStore' => 'GardenStore',
88
+		'GeneralContractor' => 'GeneralContractor',
89
+		'GolfCourse' => 'GolfCourse',
90
+		'HairSalon' => 'HairSalon',
91
+		'HardwareStore' => 'HardwareStore',
92
+		'HealthAndBeautyBusiness' => 'HealthAndBeautyBusiness',
93
+		'HobbyShop' => 'HobbyShop',
94
+		'HomeAndConstructionBusiness' => 'HomeAndConstructionBusiness',
95
+		'HomeGoodsStore' => 'HomeGoodsStore',
96
+		'Hospital' => 'Hospital',
97
+		'Hostel' => 'Hostel',
98
+		'Hotel' => 'Hotel',
99
+		'HousePainter' => 'HousePainter',
100
+		'HVACBusiness' => 'HVACBusiness',
101
+		'InsuranceAgency' => 'InsuranceAgency',
102
+		'JewelryStore' => 'JewelryStore',
103
+		'LiquorStore' => 'LiquorStore',
104
+		'Locksmith' => 'Locksmith',
105
+		'LodgingBusiness' => 'LodgingBusiness',
106
+		'MedicalClinic' => 'MedicalClinic',
107
+		'MensClothingStore' => 'MensClothingStore',
108
+		'MobilePhoneStore' => 'MobilePhoneStore',
109
+		'Motel' => 'Motel',
110
+		'MotorcycleDealer' => 'MotorcycleDealer',
111
+		'MotorcycleRepair' => 'MotorcycleRepair',
112
+		'MovingCompany' => 'MovingCompany',
113
+		'MusicStore' => 'MusicStore',
114
+		'NailSalon' => 'NailSalon',
115
+		'NightClub' => 'NightClub',
116
+		'Notary' => 'Notary',
117
+		'OfficeEquipmentStore' => 'OfficeEquipmentStore',
118
+		'Optician' => 'Optician',
119
+		'PetStore' => 'PetStore',
120
+		'Physician' => 'Physician',
121
+		'Plumber' => 'Plumber',
122
+		'ProfessionalService' => 'ProfessionalService',
123
+		'RealEstateAgent' => 'RealEstateAgent',
124
+		'Residence' => 'Residence',
125
+		'Restaurant' => 'Restaurant',
126
+		'RoofingContractor' => 'RoofingContractor',
127
+		'RVPark' => 'RVPark',
128
+		'School' => 'School',
129
+		'SelfStorage' => 'SelfStorage',
130
+		'ShoeStore' => 'ShoeStore',
131
+		'SkiResort' => 'SkiResort',
132
+		'SportingGoodsStore' => 'SportingGoodsStore',
133
+		'SportsClub' => 'SportsClub',
134
+		'Store' => 'Store',
135
+		'TattooParlor' => 'TattooParlor',
136
+		'Taxi' => 'Taxi',
137
+		'TennisComplex' => 'TennisComplex',
138
+		'TireShop' => 'TireShop',
139
+		'TouristAttraction' => 'TouristAttraction',
140
+		'ToyStore' => 'ToyStore',
141
+		'TravelAgency' => 'TravelAgency',
142
+		//'VacationRentals' => 'VacationRentals', // Not recognised by google yet
143
+		'VeterinaryCare' => 'VeterinaryCare',
144
+		'WholesaleStore' => 'WholesaleStore',
145
+		'Winery' => 'Winery'
146
+	)),
147
+	array('name' => __('Schema Type', 'geodirectory'), 'desc' => __('Select the Schema to use for this category', 'geodirectory') . "", 'std' => array('selectkey2')));
148 148
 
149
-    // Finish Meta Box Declaration
150
-    $my_meta->Finish();
149
+	// Finish Meta Box Declaration
150
+	$my_meta->Finish();
151 151
 }
152 152
 if ( is_admin() ) {
153
-    add_action( 'init', 'geodir_set_tax_meta_fields', 10 );
153
+	add_action( 'init', 'geodir_set_tax_meta_fields', 10 );
154 154
 }
155 155
 
156 156
 
@@ -159,86 +159,86 @@  discard block
 block discarded – undo
159 159
 ##############################################################
160 160
 $gd_taxonomies = geodir_get_taxonomies();
161 161
 if (!empty($gd_taxonomies)) {
162
-    foreach ($gd_taxonomies as $gd_taxonomy) {
162
+	foreach ($gd_taxonomies as $gd_taxonomy) {
163 163
 
164
-        add_filter('manage_edit-' . $gd_taxonomy . '_columns', 'addCat_column', 10, 2);
165
-        add_action('manage_' . $gd_taxonomy . '_custom_column', 'manage_category_custom_fields', 10, 3);
164
+		add_filter('manage_edit-' . $gd_taxonomy . '_columns', 'addCat_column', 10, 2);
165
+		add_action('manage_' . $gd_taxonomy . '_custom_column', 'manage_category_custom_fields', 10, 3);
166 166
 
167
-    }
167
+	}
168 168
 }
169 169
 
170 170
 function addCat_column($columns)
171 171
 {
172
-    if (isset($columns['description']) && $posts = $columns['description']) {
173
-        unset($columns['description']);
174
-    }
172
+	if (isset($columns['description']) && $posts = $columns['description']) {
173
+		unset($columns['description']);
174
+	}
175 175
 
176
-    $columns['cat_icon'] = 'Icon';
177
-    $columns['cat_default_img'] = __('Default Image', 'geodirectory');
178
-    $columns['cat_ID_num'] = __('Cat ID', 'geodirectory');
179
-    return $columns;
176
+	$columns['cat_icon'] = 'Icon';
177
+	$columns['cat_default_img'] = __('Default Image', 'geodirectory');
178
+	$columns['cat_ID_num'] = __('Cat ID', 'geodirectory');
179
+	return $columns;
180 180
 }
181 181
 
182 182
 #############################################################
183 183
 function manage_category_custom_fields($deprecated, $column_name, $term_id)
184 184
 {
185
-    if ($column_name == 'cat_ID_num')
186
-        echo $term_id;
185
+	if ($column_name == 'cat_ID_num')
186
+		echo $term_id;
187 187
 
188
-    if ($column_name == 'cat_icon') {
189
-        $term_icon_url = geodir_get_tax_meta($term_id, 'ct_cat_icon');
188
+	if ($column_name == 'cat_icon') {
189
+		$term_icon_url = geodir_get_tax_meta($term_id, 'ct_cat_icon');
190 190
 
191
-        if ($term_icon_url != '') {
192
-            $file_info = pathinfo($term_icon_url['src']);
191
+		if ($term_icon_url != '') {
192
+			$file_info = pathinfo($term_icon_url['src']);
193 193
 
194
-            if (isset($file_info['dirname'] ) && $file_info['dirname'] != '.' && $file_info['dirname'] != '..') {
195
-                $sub_dir = $file_info['dirname'];
196
-            } else {
197
-                $sub_dir = '';
198
-            }
194
+			if (isset($file_info['dirname'] ) && $file_info['dirname'] != '.' && $file_info['dirname'] != '..') {
195
+				$sub_dir = $file_info['dirname'];
196
+			} else {
197
+				$sub_dir = '';
198
+			}
199 199
 
200
-            $uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs
201
-            $uploads_baseurl = $uploads['baseurl'];
202
-            $uploads_path = $uploads['path'];
200
+			$uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs
201
+			$uploads_baseurl = $uploads['baseurl'];
202
+			$uploads_path = $uploads['path'];
203 203
 
204
-            $file_name = $file_info['basename'];
204
+			$file_name = $file_info['basename'];
205 205
 
206
-            if (strpos($sub_dir, 'https://') !== false) {
207
-                $uploads['baseurl'] = str_replace('http://', 'https://', $uploads['baseurl']);
208
-            } else {
209
-                $uploads['baseurl'] = str_replace('https://', 'http://', $uploads['baseurl']);
210
-            }
211
-            $sub_dir = str_replace($uploads['baseurl'], '', $sub_dir);
206
+			if (strpos($sub_dir, 'https://') !== false) {
207
+				$uploads['baseurl'] = str_replace('http://', 'https://', $uploads['baseurl']);
208
+			} else {
209
+				$uploads['baseurl'] = str_replace('https://', 'http://', $uploads['baseurl']);
210
+			}
211
+			$sub_dir = str_replace($uploads['baseurl'], '', $sub_dir);
212 212
 
213
-            $uploads_url = $uploads_baseurl . $sub_dir;
213
+			$uploads_url = $uploads_baseurl . $sub_dir;
214 214
 
215
-            $term_icon_url['src'] = $uploads_url . '/' . $file_name;
216
-            echo '<img src="' . $term_icon_url['src'] . '" />';
217
-        }
218
-    }
215
+			$term_icon_url['src'] = $uploads_url . '/' . $file_name;
216
+			echo '<img src="' . $term_icon_url['src'] . '" />';
217
+		}
218
+	}
219 219
 
220
-    if ($column_name == 'cat_default_img') {
221
-        $cat_default_img = geodir_get_tax_meta($term_id, 'ct_cat_default_img');
222
-        if ($cat_default_img != '')
223
-            echo '<img src="' . $cat_default_img['src'] . '" style="max-height:60px;max-width:60px;"/>';
220
+	if ($column_name == 'cat_default_img') {
221
+		$cat_default_img = geodir_get_tax_meta($term_id, 'ct_cat_default_img');
222
+		if ($cat_default_img != '')
223
+			echo '<img src="' . $cat_default_img['src'] . '" style="max-height:60px;max-width:60px;"/>';
224 224
 
225
-    }
225
+	}
226 226
 }
227 227
 
228 228
 function geodir_get_default_catimage($term_id, $post_type = 'gd_place')
229 229
 {
230 230
 
231
-    if ($cat_default_img = geodir_get_tax_meta($term_id, 'ct_cat_default_img', '', $post_type))
232
-        return $cat_default_img;
233
-    else
234
-        return false;
231
+	if ($cat_default_img = geodir_get_tax_meta($term_id, 'ct_cat_default_img', '', $post_type))
232
+		return $cat_default_img;
233
+	else
234
+		return false;
235 235
 }
236 236
 
237 237
 //Clear custom fields
238 238
 add_action('in_admin_footer', 'geodir_tax_meta_clear_custom_field');
239 239
 function geodir_tax_meta_clear_custom_field() {
240
-    if (isset($_REQUEST['taxonomy']) && !empty($_REQUEST['taxonomy'])):
241
-        ?>
240
+	if (isset($_REQUEST['taxonomy']) && !empty($_REQUEST['taxonomy'])):
241
+		?>
242 242
         <script type="text/javascript">
243 243
             jQuery(document).ready(function () {
244 244
                 jQuery('#addtag #submit').click(function () {
@@ -267,5 +267,5 @@  discard block
 block discarded – undo
267 267
             });
268 268
         </script>
269 269
     <?php
270
-    endif;
270
+	endif;
271 271
 }
Please login to merge, or discard this patch.
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -24,12 +24,12 @@  discard block
 block discarded – undo
24 24
      */
25 25
 
26 26
     $config = array(
27
-        'id' => 'demo_meta_box',                    // meta box id, unique per meta box
28
-        'title' => __('Demo Meta Box', 'geodirectory'),                    // meta box title
29
-        'pages' => geodir_get_taxonomies(),            // taxonomy name, accept categories, post_tag and custom taxonomies
30
-        'context' => 'normal',                        // where the meta box appear: normal (default), advanced, side; optional
31
-        'fields' => array(),                        // list of meta fields (can be added by field arrays)
32
-        'local_images' => false,                    // Use local or hosted images (meta box images for add/remove)
27
+        'id' => 'demo_meta_box', // meta box id, unique per meta box
28
+        'title' => __('Demo Meta Box', 'geodirectory'), // meta box title
29
+        'pages' => geodir_get_taxonomies(), // taxonomy name, accept categories, post_tag and custom taxonomies
30
+        'context' => 'normal', // where the meta box appear: normal (default), advanced, side; optional
31
+        'fields' => array(), // list of meta fields (can be added by field arrays)
32
+        'local_images' => false, // Use local or hosted images (meta box images for add/remove)
33 33
         'use_with_theme' => true                    //change path if used with theme set to true, false for a plugin or anything else for a custom path(default false).
34 34
     );
35 35
 
@@ -38,18 +38,18 @@  discard block
 block discarded – undo
38 38
      * Initiate your meta box
39 39
      */
40 40
     $my_meta = new Geodir_Tax_Meta_Class($config);
41
-    $my_meta->addWysiwyg($prefix . 'cat_top_desc', array('name' => __('Category Top Description', 'geodirectory'), 'desc' => __('This will appear at the top of the category listing.', 'geodirectory')));
42
-    $my_meta->addImage($prefix . 'cat_default_img', array('name' => __('Default Listing Image', 'geodirectory'), 'desc' => __('Choose a default "no image"', 'geodirectory')));
43
-    $my_meta->addImage($prefix . 'cat_icon', array('name' => __('Category Icon', 'geodirectory'), 'desc' => __('Choose a category icon', 'geodirectory'), 'validate_func' => '!empty'));
41
+    $my_meta->addWysiwyg($prefix.'cat_top_desc', array('name' => __('Category Top Description', 'geodirectory'), 'desc' => __('This will appear at the top of the category listing.', 'geodirectory')));
42
+    $my_meta->addImage($prefix.'cat_default_img', array('name' => __('Default Listing Image', 'geodirectory'), 'desc' => __('Choose a default "no image"', 'geodirectory')));
43
+    $my_meta->addImage($prefix.'cat_icon', array('name' => __('Category Icon', 'geodirectory'), 'desc' => __('Choose a category icon', 'geodirectory'), 'validate_func' => '!empty'));
44 44
     /*$my_meta->addCheckbox($prefix.'pointless',array('name'=> __('<b>Exclude</b> Rating sort option','geodirectory'),'style'=>'hidden'));*/// hidden setting to trick WPML
45 45
 
46
-    $my_meta->addSelect($prefix . 'cat_schema',
46
+    $my_meta->addSelect($prefix.'cat_schema',
47 47
     /*
48 48
      * Allows you to add/filter the cat schema types.
49 49
      *
50 50
      * @since 1.5.7
51 51
      */
52
-    apply_filters('geodir_cat_schemas',array(
52
+    apply_filters('geodir_cat_schemas', array(
53 53
         '' => __('Default (LocalBusiness)', 'geodirectory'),
54 54
         'AccountingService' => 'AccountingService',
55 55
         'Attorney' => 'Attorney',
@@ -144,13 +144,13 @@  discard block
 block discarded – undo
144 144
         'WholesaleStore' => 'WholesaleStore',
145 145
         'Winery' => 'Winery'
146 146
     )),
147
-    array('name' => __('Schema Type', 'geodirectory'), 'desc' => __('Select the Schema to use for this category', 'geodirectory') . "", 'std' => array('selectkey2')));
147
+    array('name' => __('Schema Type', 'geodirectory'), 'desc' => __('Select the Schema to use for this category', 'geodirectory')."", 'std' => array('selectkey2')));
148 148
 
149 149
     // Finish Meta Box Declaration
150 150
     $my_meta->Finish();
151 151
 }
152
-if ( is_admin() ) {
153
-    add_action( 'init', 'geodir_set_tax_meta_fields', 10 );
152
+if (is_admin()) {
153
+    add_action('init', 'geodir_set_tax_meta_fields', 10);
154 154
 }
155 155
 
156 156
 
@@ -161,8 +161,8 @@  discard block
 block discarded – undo
161 161
 if (!empty($gd_taxonomies)) {
162 162
     foreach ($gd_taxonomies as $gd_taxonomy) {
163 163
 
164
-        add_filter('manage_edit-' . $gd_taxonomy . '_columns', 'addCat_column', 10, 2);
165
-        add_action('manage_' . $gd_taxonomy . '_custom_column', 'manage_category_custom_fields', 10, 3);
164
+        add_filter('manage_edit-'.$gd_taxonomy.'_columns', 'addCat_column', 10, 2);
165
+        add_action('manage_'.$gd_taxonomy.'_custom_column', 'manage_category_custom_fields', 10, 3);
166 166
 
167 167
     }
168 168
 }
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
         if ($term_icon_url != '') {
192 192
             $file_info = pathinfo($term_icon_url['src']);
193 193
 
194
-            if (isset($file_info['dirname'] ) && $file_info['dirname'] != '.' && $file_info['dirname'] != '..') {
194
+            if (isset($file_info['dirname']) && $file_info['dirname'] != '.' && $file_info['dirname'] != '..') {
195 195
                 $sub_dir = $file_info['dirname'];
196 196
             } else {
197 197
                 $sub_dir = '';
@@ -210,17 +210,17 @@  discard block
 block discarded – undo
210 210
             }
211 211
             $sub_dir = str_replace($uploads['baseurl'], '', $sub_dir);
212 212
 
213
-            $uploads_url = $uploads_baseurl . $sub_dir;
213
+            $uploads_url = $uploads_baseurl.$sub_dir;
214 214
 
215
-            $term_icon_url['src'] = $uploads_url . '/' . $file_name;
216
-            echo '<img src="' . $term_icon_url['src'] . '" />';
215
+            $term_icon_url['src'] = $uploads_url.'/'.$file_name;
216
+            echo '<img src="'.$term_icon_url['src'].'" />';
217 217
         }
218 218
     }
219 219
 
220 220
     if ($column_name == 'cat_default_img') {
221 221
         $cat_default_img = geodir_get_tax_meta($term_id, 'ct_cat_default_img');
222 222
         if ($cat_default_img != '')
223
-            echo '<img src="' . $cat_default_img['src'] . '" style="max-height:60px;max-width:60px;"/>';
223
+            echo '<img src="'.$cat_default_img['src'].'" style="max-height:60px;max-width:60px;"/>';
224 224
 
225 225
     }
226 226
 }
@@ -258,8 +258,8 @@  discard block
 block discarded – undo
258 258
                             jQuery("#addtag iframe").contents().find("body").html('');
259 259
                             jQuery('#addtag [rel="ct_cat_default_img"]').removeClass('at-delete_image_button').addClass('at-upload_image_button');
260 260
                             jQuery('#addtag [rel="ct_cat_icon"]').removeClass('at-delete_image_button').addClass('at-upload_image_button');
261
-                            jQuery('#addtag [rel="ct_cat_default_img"]').val('<?php _e('Upload Image','geodirectory');?>');
262
-                            jQuery('#addtag [rel="ct_cat_icon"]').val('<?php _e('Upload Image','geodirectory');?>');
261
+                            jQuery('#addtag [rel="ct_cat_default_img"]').val('<?php _e('Upload Image', 'geodirectory'); ?>');
262
+                            jQuery('#addtag [rel="ct_cat_icon"]').val('<?php _e('Upload Image', 'geodirectory'); ?>');
263 263
                         }
264 264
                     }, 1000);
265 265
 
Please login to merge, or discard this patch.
geodirectory-functions/compatibility/Kleo.php 3 patches
Indentation   +116 added lines, -116 removed lines patch added patch discarded remove patch
@@ -10,13 +10,13 @@  discard block
 block discarded – undo
10 10
 
11 11
 // Page titles translatable CPT names
12 12
 function geodir_kelo_title_translation( $args) {
13
-    if(function_exists('geodir_is_geodir_page') && geodir_is_page('preview') ){
14
-        $args['title'] = __(stripslashes_deep(esc_html($_POST['post_title'])),'geodirectory');
15
-    }elseif(function_exists('geodir_is_geodir_page')){
16
-        $args['title'] = __($args['title'],'geodirectory');
17
-    }
13
+	if(function_exists('geodir_is_geodir_page') && geodir_is_page('preview') ){
14
+		$args['title'] = __(stripslashes_deep(esc_html($_POST['post_title'])),'geodirectory');
15
+	}elseif(function_exists('geodir_is_geodir_page')){
16
+		$args['title'] = __($args['title'],'geodirectory');
17
+	}
18 18
 
19
-    return $args;
19
+	return $args;
20 20
 }
21 21
 add_filter( 'kleo_title_args', 'geodir_kelo_title_translation', 10, 1 );
22 22
 
@@ -31,17 +31,17 @@  discard block
 block discarded – undo
31 31
  * @return object Modified query object.
32 32
  */
33 33
 function geodir_kleo_search_filter( $query ) {
34
-    if ( !empty( $query->is_search ) && geodir_is_page('search') && is_search() ) {
35
-        $query->set( 'post_type', 'any' );
36
-    }
37
-    return $query;
34
+	if ( !empty( $query->is_search ) && geodir_is_page('search') && is_search() ) {
35
+		$query->set( 'post_type', 'any' );
36
+	}
37
+	return $query;
38 38
 }
39 39
 if ( !is_admin() ) {
40
-    add_filter( 'pre_get_posts', 'geodir_kleo_search_filter', 11 );
40
+	add_filter( 'pre_get_posts', 'geodir_kleo_search_filter', 11 );
41 41
 }
42 42
 
43 43
 if( ! function_exists( 'kleo_title' ) ){
44
-    function kleo_title(){ return geodir_kleo_custom_the_title();}
44
+	function kleo_title(){ return geodir_kleo_custom_the_title();}
45 45
 }
46 46
 
47 47
 /**
@@ -53,109 +53,109 @@  discard block
 block discarded – undo
53 53
 function geodir_kleo_custom_the_title()
54 54
 {
55 55
 
56
-    $output = '';
57
-    if (is_tag()) {
58
-        $output = __('Tag Archive for:','kleo_framework')." ".single_tag_title('',false);
59
-    }
60
-    elseif(is_tax()) {
61
-        $term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));
62
-        $output = $term->name;
63
-    }
64
-    elseif ( is_category() ) {
65
-        $output = __('Archive for category:', 'kleo_framework') . " " . single_cat_title('', false);
66
-    }
67
-    elseif (is_day())
68
-    {
69
-        $output = __('Archive for date:','kleo_framework')." ".get_the_time('F jS, Y');
70
-    }
71
-    elseif (is_month())
72
-    {
73
-        $output = __('Archive for month:','kleo_framework')." ".get_the_time('F, Y');
74
-    }
75
-    elseif (is_year())
76
-    {
77
-        $output = __('Archive for year:','kleo_framework')." ".get_the_time('Y');
78
-    }
79
-    elseif (is_author())  {
80
-        $curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
81
-        $output = __('Author Archive','kleo_framework')." ";
82
-
83
-        if( isset( $curauth->nickname ) ) {
84
-            $output .= __('for:','kleo_framework')." ".$curauth->nickname;
85
-        }
86
-    }
87
-    elseif ( is_archive() )  {
88
-        $output = post_type_archive_title( '', false );
89
-    }
90
-    elseif (is_search())
91
-    {
92
-        global $wp_query;
93
-        if(!empty($wp_query->found_posts))
94
-        {
95
-            if($wp_query->found_posts > 1)
96
-            {
97
-                $output =  $wp_query->found_posts ." ". __('search results for:','kleo_framework')." ".esc_attr( get_search_query() );
98
-            }
99
-            else
100
-            {
101
-                $output =  $wp_query->found_posts ." ". __('search result for:','kleo_framework')." ".esc_attr( get_search_query() );
102
-            }
103
-        }
104
-        else
105
-        {
106
-            if(!empty($_GET['s']))
107
-            {
108
-                $output = __('Search results for:','kleo_framework')." ".esc_attr( get_search_query() );
109
-            }
110
-            else
111
-            {
112
-                $output = __('To search the site please enter a valid term','kleo_framework');
113
-            }
114
-        }
115
-
116
-    }
117
-    elseif ( is_front_page() && !is_home() ) {
118
-        $output = get_the_title(get_option('page_on_front'));
119
-
120
-    } elseif ( is_home() ) {
121
-        if (get_option('page_for_posts')) {
122
-            $output = get_the_title(get_option('page_for_posts'));
123
-        } else {
124
-            $output = __( 'Blog', 'kleo_framework' );
125
-        }
126
-
127
-    } elseif ( is_404() ) {
128
-        $output = __('Error 404 - Page not found','kleo_framework');
129
-    }
130
-    else {
131
-        $output = get_the_title();
132
-    }
133
-
134
-    if (isset($_GET['paged']) && !empty($_GET['paged']))
135
-    {
136
-        $output .= " (".__('Page','kleo_framework')." ".$_GET['paged'].")";
137
-    }
138
-
139
-
140
-    $gd_page = '';
141
-    if(geodir_is_page('pt')){
142
-        $gd_page = 'pt';
143
-        $output = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : '';
144
-    }
145
-    elseif(geodir_is_page('listing')){
146
-        $gd_page = 'listing';
147
-        $output = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : '';
148
-    }
149
-
150
-
151
-
152
-    /**
153
-     * Filter page meta title to replace variables.
154
-     *
155
-     * @since 1.5.4
156
-     * @param string $title The page title including variables.
157
-     * @param string $gd_page The GeoDirectory page type if any.
158
-     */
159
-    return apply_filters('geodir_seo_meta_title', __($output, 'geodirectory'), $gd_page);
56
+	$output = '';
57
+	if (is_tag()) {
58
+		$output = __('Tag Archive for:','kleo_framework')." ".single_tag_title('',false);
59
+	}
60
+	elseif(is_tax()) {
61
+		$term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));
62
+		$output = $term->name;
63
+	}
64
+	elseif ( is_category() ) {
65
+		$output = __('Archive for category:', 'kleo_framework') . " " . single_cat_title('', false);
66
+	}
67
+	elseif (is_day())
68
+	{
69
+		$output = __('Archive for date:','kleo_framework')." ".get_the_time('F jS, Y');
70
+	}
71
+	elseif (is_month())
72
+	{
73
+		$output = __('Archive for month:','kleo_framework')." ".get_the_time('F, Y');
74
+	}
75
+	elseif (is_year())
76
+	{
77
+		$output = __('Archive for year:','kleo_framework')." ".get_the_time('Y');
78
+	}
79
+	elseif (is_author())  {
80
+		$curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
81
+		$output = __('Author Archive','kleo_framework')." ";
82
+
83
+		if( isset( $curauth->nickname ) ) {
84
+			$output .= __('for:','kleo_framework')." ".$curauth->nickname;
85
+		}
86
+	}
87
+	elseif ( is_archive() )  {
88
+		$output = post_type_archive_title( '', false );
89
+	}
90
+	elseif (is_search())
91
+	{
92
+		global $wp_query;
93
+		if(!empty($wp_query->found_posts))
94
+		{
95
+			if($wp_query->found_posts > 1)
96
+			{
97
+				$output =  $wp_query->found_posts ." ". __('search results for:','kleo_framework')." ".esc_attr( get_search_query() );
98
+			}
99
+			else
100
+			{
101
+				$output =  $wp_query->found_posts ." ". __('search result for:','kleo_framework')." ".esc_attr( get_search_query() );
102
+			}
103
+		}
104
+		else
105
+		{
106
+			if(!empty($_GET['s']))
107
+			{
108
+				$output = __('Search results for:','kleo_framework')." ".esc_attr( get_search_query() );
109
+			}
110
+			else
111
+			{
112
+				$output = __('To search the site please enter a valid term','kleo_framework');
113
+			}
114
+		}
115
+
116
+	}
117
+	elseif ( is_front_page() && !is_home() ) {
118
+		$output = get_the_title(get_option('page_on_front'));
119
+
120
+	} elseif ( is_home() ) {
121
+		if (get_option('page_for_posts')) {
122
+			$output = get_the_title(get_option('page_for_posts'));
123
+		} else {
124
+			$output = __( 'Blog', 'kleo_framework' );
125
+		}
126
+
127
+	} elseif ( is_404() ) {
128
+		$output = __('Error 404 - Page not found','kleo_framework');
129
+	}
130
+	else {
131
+		$output = get_the_title();
132
+	}
133
+
134
+	if (isset($_GET['paged']) && !empty($_GET['paged']))
135
+	{
136
+		$output .= " (".__('Page','kleo_framework')." ".$_GET['paged'].")";
137
+	}
138
+
139
+
140
+	$gd_page = '';
141
+	if(geodir_is_page('pt')){
142
+		$gd_page = 'pt';
143
+		$output = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : '';
144
+	}
145
+	elseif(geodir_is_page('listing')){
146
+		$gd_page = 'listing';
147
+		$output = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : '';
148
+	}
149
+
150
+
151
+
152
+	/**
153
+	 * Filter page meta title to replace variables.
154
+	 *
155
+	 * @since 1.5.4
156
+	 * @param string $title The page title including variables.
157
+	 * @param string $gd_page The GeoDirectory page type if any.
158
+	 */
159
+	return apply_filters('geodir_seo_meta_title', __($output, 'geodirectory'), $gd_page);
160 160
 
161 161
 }
162 162
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -9,16 +9,16 @@  discard block
 block discarded – undo
9 9
  */
10 10
 
11 11
 // Page titles translatable CPT names
12
-function geodir_kelo_title_translation( $args) {
13
-    if(function_exists('geodir_is_geodir_page') && geodir_is_page('preview') ){
14
-        $args['title'] = __(stripslashes_deep(esc_html($_POST['post_title'])),'geodirectory');
15
-    }elseif(function_exists('geodir_is_geodir_page')){
16
-        $args['title'] = __($args['title'],'geodirectory');
12
+function geodir_kelo_title_translation($args) {
13
+    if (function_exists('geodir_is_geodir_page') && geodir_is_page('preview')) {
14
+        $args['title'] = __(stripslashes_deep(esc_html($_POST['post_title'])), 'geodirectory');
15
+    }elseif (function_exists('geodir_is_geodir_page')) {
16
+        $args['title'] = __($args['title'], 'geodirectory');
17 17
     }
18 18
 
19 19
     return $args;
20 20
 }
21
-add_filter( 'kleo_title_args', 'geodir_kelo_title_translation', 10, 1 );
21
+add_filter('kleo_title_args', 'geodir_kelo_title_translation', 10, 1);
22 22
 
23 23
 /**
24 24
  * Fix search returns all the posts for Kleo theme.
@@ -30,18 +30,18 @@  discard block
 block discarded – undo
30 30
  * @param object $query Current query object.
31 31
  * @return object Modified query object.
32 32
  */
33
-function geodir_kleo_search_filter( $query ) {
34
-    if ( !empty( $query->is_search ) && geodir_is_page('search') && is_search() ) {
35
-        $query->set( 'post_type', 'any' );
33
+function geodir_kleo_search_filter($query) {
34
+    if (!empty($query->is_search) && geodir_is_page('search') && is_search()) {
35
+        $query->set('post_type', 'any');
36 36
     }
37 37
     return $query;
38 38
 }
39
-if ( !is_admin() ) {
40
-    add_filter( 'pre_get_posts', 'geodir_kleo_search_filter', 11 );
39
+if (!is_admin()) {
40
+    add_filter('pre_get_posts', 'geodir_kleo_search_filter', 11);
41 41
 }
42 42
 
43
-if( ! function_exists( 'kleo_title' ) ){
44
-    function kleo_title(){ return geodir_kleo_custom_the_title();}
43
+if (!function_exists('kleo_title')) {
44
+    function kleo_title() { return geodir_kleo_custom_the_title(); }
45 45
 }
46 46
 
47 47
 /**
@@ -55,77 +55,77 @@  discard block
 block discarded – undo
55 55
 
56 56
     $output = '';
57 57
     if (is_tag()) {
58
-        $output = __('Tag Archive for:','kleo_framework')." ".single_tag_title('',false);
58
+        $output = __('Tag Archive for:', 'kleo_framework')." ".single_tag_title('', false);
59 59
     }
60
-    elseif(is_tax()) {
60
+    elseif (is_tax()) {
61 61
         $term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));
62 62
         $output = $term->name;
63 63
     }
64
-    elseif ( is_category() ) {
65
-        $output = __('Archive for category:', 'kleo_framework') . " " . single_cat_title('', false);
64
+    elseif (is_category()) {
65
+        $output = __('Archive for category:', 'kleo_framework')." ".single_cat_title('', false);
66 66
     }
67 67
     elseif (is_day())
68 68
     {
69
-        $output = __('Archive for date:','kleo_framework')." ".get_the_time('F jS, Y');
69
+        $output = __('Archive for date:', 'kleo_framework')." ".get_the_time('F jS, Y');
70 70
     }
71 71
     elseif (is_month())
72 72
     {
73
-        $output = __('Archive for month:','kleo_framework')." ".get_the_time('F, Y');
73
+        $output = __('Archive for month:', 'kleo_framework')." ".get_the_time('F, Y');
74 74
     }
75 75
     elseif (is_year())
76 76
     {
77
-        $output = __('Archive for year:','kleo_framework')." ".get_the_time('Y');
77
+        $output = __('Archive for year:', 'kleo_framework')." ".get_the_time('Y');
78 78
     }
79
-    elseif (is_author())  {
79
+    elseif (is_author()) {
80 80
         $curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
81
-        $output = __('Author Archive','kleo_framework')." ";
81
+        $output = __('Author Archive', 'kleo_framework')." ";
82 82
 
83
-        if( isset( $curauth->nickname ) ) {
84
-            $output .= __('for:','kleo_framework')." ".$curauth->nickname;
83
+        if (isset($curauth->nickname)) {
84
+            $output .= __('for:', 'kleo_framework')." ".$curauth->nickname;
85 85
         }
86 86
     }
87
-    elseif ( is_archive() )  {
88
-        $output = post_type_archive_title( '', false );
87
+    elseif (is_archive()) {
88
+        $output = post_type_archive_title('', false);
89 89
     }
90 90
     elseif (is_search())
91 91
     {
92 92
         global $wp_query;
93
-        if(!empty($wp_query->found_posts))
93
+        if (!empty($wp_query->found_posts))
94 94
         {
95
-            if($wp_query->found_posts > 1)
95
+            if ($wp_query->found_posts > 1)
96 96
             {
97
-                $output =  $wp_query->found_posts ." ". __('search results for:','kleo_framework')." ".esc_attr( get_search_query() );
97
+                $output = $wp_query->found_posts." ".__('search results for:', 'kleo_framework')." ".esc_attr(get_search_query());
98 98
             }
99 99
             else
100 100
             {
101
-                $output =  $wp_query->found_posts ." ". __('search result for:','kleo_framework')." ".esc_attr( get_search_query() );
101
+                $output = $wp_query->found_posts." ".__('search result for:', 'kleo_framework')." ".esc_attr(get_search_query());
102 102
             }
103 103
         }
104 104
         else
105 105
         {
106
-            if(!empty($_GET['s']))
106
+            if (!empty($_GET['s']))
107 107
             {
108
-                $output = __('Search results for:','kleo_framework')." ".esc_attr( get_search_query() );
108
+                $output = __('Search results for:', 'kleo_framework')." ".esc_attr(get_search_query());
109 109
             }
110 110
             else
111 111
             {
112
-                $output = __('To search the site please enter a valid term','kleo_framework');
112
+                $output = __('To search the site please enter a valid term', 'kleo_framework');
113 113
             }
114 114
         }
115 115
 
116 116
     }
117
-    elseif ( is_front_page() && !is_home() ) {
117
+    elseif (is_front_page() && !is_home()) {
118 118
         $output = get_the_title(get_option('page_on_front'));
119 119
 
120
-    } elseif ( is_home() ) {
120
+    } elseif (is_home()) {
121 121
         if (get_option('page_for_posts')) {
122 122
             $output = get_the_title(get_option('page_for_posts'));
123 123
         } else {
124
-            $output = __( 'Blog', 'kleo_framework' );
124
+            $output = __('Blog', 'kleo_framework');
125 125
         }
126 126
 
127
-    } elseif ( is_404() ) {
128
-        $output = __('Error 404 - Page not found','kleo_framework');
127
+    } elseif (is_404()) {
128
+        $output = __('Error 404 - Page not found', 'kleo_framework');
129 129
     }
130 130
     else {
131 131
         $output = get_the_title();
@@ -133,16 +133,16 @@  discard block
 block discarded – undo
133 133
 
134 134
     if (isset($_GET['paged']) && !empty($_GET['paged']))
135 135
     {
136
-        $output .= " (".__('Page','kleo_framework')." ".$_GET['paged'].")";
136
+        $output .= " (".__('Page', 'kleo_framework')." ".$_GET['paged'].")";
137 137
     }
138 138
 
139 139
 
140 140
     $gd_page = '';
141
-    if(geodir_is_page('pt')){
141
+    if (geodir_is_page('pt')) {
142 142
         $gd_page = 'pt';
143 143
         $output = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : '';
144 144
     }
145
-    elseif(geodir_is_page('listing')){
145
+    elseif (geodir_is_page('listing')) {
146 146
         $gd_page = 'listing';
147 147
         $output = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : '';
148 148
     }
Please login to merge, or discard this patch.
Braces   +15 added lines, -29 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 function geodir_kelo_title_translation( $args) {
13 13
     if(function_exists('geodir_is_geodir_page') && geodir_is_page('preview') ){
14 14
         $args['title'] = __(stripslashes_deep(esc_html($_POST['post_title'])),'geodirectory');
15
-    }elseif(function_exists('geodir_is_geodir_page')){
15
+    } elseif(function_exists('geodir_is_geodir_page')){
16 16
         $args['title'] = __($args['title'],'geodirectory');
17 17
     }
18 18
 
@@ -56,38 +56,30 @@  discard block
 block discarded – undo
56 56
     $output = '';
57 57
     if (is_tag()) {
58 58
         $output = __('Tag Archive for:','kleo_framework')." ".single_tag_title('',false);
59
-    }
60
-    elseif(is_tax()) {
59
+    } elseif(is_tax()) {
61 60
         $term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));
62 61
         $output = $term->name;
63
-    }
64
-    elseif ( is_category() ) {
62
+    } elseif ( is_category() ) {
65 63
         $output = __('Archive for category:', 'kleo_framework') . " " . single_cat_title('', false);
66
-    }
67
-    elseif (is_day())
64
+    } elseif (is_day())
68 65
     {
69 66
         $output = __('Archive for date:','kleo_framework')." ".get_the_time('F jS, Y');
70
-    }
71
-    elseif (is_month())
67
+    } elseif (is_month())
72 68
     {
73 69
         $output = __('Archive for month:','kleo_framework')." ".get_the_time('F, Y');
74
-    }
75
-    elseif (is_year())
70
+    } elseif (is_year())
76 71
     {
77 72
         $output = __('Archive for year:','kleo_framework')." ".get_the_time('Y');
78
-    }
79
-    elseif (is_author())  {
73
+    } elseif (is_author())  {
80 74
         $curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
81 75
         $output = __('Author Archive','kleo_framework')." ";
82 76
 
83 77
         if( isset( $curauth->nickname ) ) {
84 78
             $output .= __('for:','kleo_framework')." ".$curauth->nickname;
85 79
         }
86
-    }
87
-    elseif ( is_archive() )  {
80
+    } elseif ( is_archive() )  {
88 81
         $output = post_type_archive_title( '', false );
89
-    }
90
-    elseif (is_search())
82
+    } elseif (is_search())
91 83
     {
92 84
         global $wp_query;
93 85
         if(!empty($wp_query->found_posts))
@@ -95,26 +87,22 @@  discard block
 block discarded – undo
95 87
             if($wp_query->found_posts > 1)
96 88
             {
97 89
                 $output =  $wp_query->found_posts ." ". __('search results for:','kleo_framework')." ".esc_attr( get_search_query() );
98
-            }
99
-            else
90
+            } else
100 91
             {
101 92
                 $output =  $wp_query->found_posts ." ". __('search result for:','kleo_framework')." ".esc_attr( get_search_query() );
102 93
             }
103
-        }
104
-        else
94
+        } else
105 95
         {
106 96
             if(!empty($_GET['s']))
107 97
             {
108 98
                 $output = __('Search results for:','kleo_framework')." ".esc_attr( get_search_query() );
109
-            }
110
-            else
99
+            } else
111 100
             {
112 101
                 $output = __('To search the site please enter a valid term','kleo_framework');
113 102
             }
114 103
         }
115 104
 
116
-    }
117
-    elseif ( is_front_page() && !is_home() ) {
105
+    } elseif ( is_front_page() && !is_home() ) {
118 106
         $output = get_the_title(get_option('page_on_front'));
119 107
 
120 108
     } elseif ( is_home() ) {
@@ -126,8 +114,7 @@  discard block
 block discarded – undo
126 114
 
127 115
     } elseif ( is_404() ) {
128 116
         $output = __('Error 404 - Page not found','kleo_framework');
129
-    }
130
-    else {
117
+    } else {
131 118
         $output = get_the_title();
132 119
     }
133 120
 
@@ -141,8 +128,7 @@  discard block
 block discarded – undo
141 128
     if(geodir_is_page('pt')){
142 129
         $gd_page = 'pt';
143 130
         $output = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : '';
144
-    }
145
-    elseif(geodir_is_page('listing')){
131
+    } elseif(geodir_is_page('listing')){
146 132
         $gd_page = 'listing';
147 133
         $output = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : '';
148 134
     }
Please login to merge, or discard this patch.
geodirectory-functions/wp-session/wp-cli.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -21,10 +21,10 @@  discard block
 block discarded – undo
21 21
 	 * @param array $args
22 22
 	 * @param array $assoc_args
23 23
 	 */
24
-	public function count( $args, $assoc_args ) {
24
+	public function count($args, $assoc_args) {
25 25
 		$sessions = WP_Session_Utils::count_sessions();
26 26
 
27
-		\WP_CLI::line( sprintf( '%d sessions currently exist.', absint( $sessions ) ) );
27
+		\WP_CLI::line(sprintf('%d sessions currently exist.', absint($sessions)));
28 28
 	}
29 29
 
30 30
 	/**
@@ -53,14 +53,14 @@  discard block
 block discarded – undo
53 53
 	 * @param array $args
54 54
 	 * @param array $assoc_args
55 55
 	 */
56
-	public function delete( $args, $assoc_args ) {
57
-		if ( isset( $assoc_args['limit'] ) ) {
58
-			$limit = absint( $assoc_args['limit'] );
56
+	public function delete($args, $assoc_args) {
57
+		if (isset($assoc_args['limit'])) {
58
+			$limit = absint($assoc_args['limit']);
59 59
 
60
-			$count = WP_Session_Utils::delete_old_sessions( $limit );
60
+			$count = WP_Session_Utils::delete_old_sessions($limit);
61 61
 
62
-			if ( $count > 0 ) {
63
-				\WP_CLI::line( sprintf( 'Deleted %d sessions.', $count ) );
62
+			if ($count > 0) {
63
+				\WP_CLI::line(sprintf('Deleted %d sessions.', $count));
64 64
 			}
65 65
 
66 66
 			// Clear memory
@@ -69,32 +69,32 @@  discard block
 block discarded – undo
69 69
 		}
70 70
 
71 71
 		// Determine if we're deleting all sessions or just a subset.
72
-		$all = isset( $assoc_args['all'] );
72
+		$all = isset($assoc_args['all']);
73 73
 
74 74
 		/**
75 75
 		 * Determine the size of each batch for deletion.
76 76
 		 *
77 77
 		 * @param int
78 78
 		 */
79
-		$batch = isset( $assoc_args['batch'] ) ? absint( $assoc_args['batch'] ) : apply_filters( 'wp_session_delete_batch_size', 1000 );
79
+		$batch = isset($assoc_args['batch']) ? absint($assoc_args['batch']) : apply_filters('wp_session_delete_batch_size', 1000);
80 80
 
81
-		switch ( $all ) {
81
+		switch ($all) {
82 82
 			case true:
83 83
 				$count = WP_Session_Utils::delete_all_sessions();
84 84
 
85
-				\WP_CLI::line( sprintf( 'Deleted all %d sessions.', $count ) );
85
+				\WP_CLI::line(sprintf('Deleted all %d sessions.', $count));
86 86
 				break;
87 87
 			case false:
88 88
 				do {
89
-					$count = WP_Session_Utils::delete_old_sessions( $batch );
89
+					$count = WP_Session_Utils::delete_old_sessions($batch);
90 90
 
91
-					if ( $count > 0 ) {
92
-						\WP_CLI::line( sprintf( 'Deleted %d sessions.', $count ) );
91
+					if ($count > 0) {
92
+						\WP_CLI::line(sprintf('Deleted %d sessions.', $count));
93 93
 					}
94 94
 
95 95
 					// Clear memory
96 96
 					self::free_up_memory();
97
-				} while ( $count > 0 );
97
+				} while ($count > 0);
98 98
 				break;
99 99
 		}
100 100
 	}
@@ -120,14 +120,14 @@  discard block
 block discarded – undo
120 120
 	 * @param array $args
121 121
 	 * @param array $assoc_args
122 122
 	 */
123
-	public function generate( $args, $assoc_args ) {
124
-		$count = absint( $args[0] );
125
-		$date  = isset( $assoc_args['expires'] ) ? $assoc_args['expires'] : null;
123
+	public function generate($args, $assoc_args) {
124
+		$count = absint($args[0]);
125
+		$date  = isset($assoc_args['expires']) ? $assoc_args['expires'] : null;
126 126
 
127
-		$notify = \WP_CLI\Utils\make_progress_bar( 'Generating sessions', $count );
127
+		$notify = \WP_CLI\Utils\make_progress_bar('Generating sessions', $count);
128 128
 
129
-		for ( $i = 0; $i < $count; $i ++ ) {
130
-			WP_Session_Utils::create_dummy_session( $date );
129
+		for ($i = 0; $i < $count; $i++) {
130
+			WP_Session_Utils::create_dummy_session($date);
131 131
 			$notify->tick();
132 132
 		}
133 133
 
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 		global $wp_object_cache, $wpdb;
145 145
 		$wpdb->queries = array();
146 146
 
147
-		if ( ! is_object( $wp_object_cache ) ) {
147
+		if (!is_object($wp_object_cache)) {
148 148
 			return;
149 149
 		}
150 150
 
@@ -155,4 +155,4 @@  discard block
 block discarded – undo
155 155
 	}
156 156
 }
157 157
 
158
-\WP_CLI::add_command( 'session', 'WP_Session_Command' );
159 158
\ No newline at end of file
159
+\WP_CLI::add_command('session', 'WP_Session_Command');
160 160
\ No newline at end of file
Please login to merge, or discard this patch.
geodirectory-functions/wp-session/class-wp-session-utils.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -99,11 +99,11 @@
 block discarded – undo
99 99
 
100 100
 		// Delete expired sessions
101 101
 		if ( ! empty( $expired ) ) {
102
-		    $placeholders = array_fill( 0, count( $expired ), '%s' );
103
-		    $format = implode( ', ', $placeholders );
104
-		    $query = "DELETE FROM $wpdb->options WHERE option_name IN ($format)";
102
+			$placeholders = array_fill( 0, count( $expired ), '%s' );
103
+			$format = implode( ', ', $placeholders );
104
+			$query = "DELETE FROM $wpdb->options WHERE option_name IN ($format)";
105 105
 
106
-		    $prepared = $wpdb->prepare( $query, $expired );
106
+			$prepared = $wpdb->prepare( $query, $expired );
107 107
 			$wpdb->query( $prepared );
108 108
 		}
109 109
 
Please login to merge, or discard this patch.
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -23,11 +23,11 @@  discard block
 block discarded – undo
23 23
 		 *
24 24
 		 * @param string $query Database count query
25 25
 		 */
26
-		$query = apply_filters( 'wp_session_count_query', $query );
26
+		$query = apply_filters('wp_session_count_query', $query);
27 27
 
28
-		$sessions = $wpdb->get_var( $query );
28
+		$sessions = $wpdb->get_var($query);
29 29
 
30
-		return absint( $sessions );
30
+		return absint($sessions);
31 31
 	}
32 32
 
33 33
 	/**
@@ -35,33 +35,33 @@  discard block
 block discarded – undo
35 35
 	 *
36 36
 	 * @param null|string $date
37 37
 	 */
38
-	public static function create_dummy_session( $date = null ) {
38
+	public static function create_dummy_session($date = null) {
39 39
 		// Generate our date
40
-		if ( null !== $date ) {
41
-			$time = strtotime( $date );
40
+		if (null !== $date) {
41
+			$time = strtotime($date);
42 42
 
43
-			if ( false === $time ) {
43
+			if (false === $time) {
44 44
 				$date = null;
45 45
 			} else {
46
-				$expires = date( 'U', strtotime( $date ) );
46
+				$expires = date('U', strtotime($date));
47 47
 			}
48 48
 		}
49 49
 
50 50
 		// If null was passed, or if the string parsing failed, fall back on a default
51
-		if ( null === $date ) {
51
+		if (null === $date) {
52 52
 			/**
53 53
 			 * Filter the expiration of the session in the database
54 54
 			 *
55 55
 			 * @param int
56 56
 			 */
57
-			$expires = time() + (int) apply_filters( 'wp_session_expiration', 30 * 60 );
57
+			$expires = time() + (int) apply_filters('wp_session_expiration', 30 * 60);
58 58
 		}
59 59
 
60 60
 		$session_id = self::generate_id();
61 61
 
62 62
 		// Store the session
63
-		add_option( "_wp_session_{$session_id}", array(), '', 'no' );
64
-		add_option( "_wp_session_expires_{$session_id}", $expires, '', 'no' );
63
+		add_option("_wp_session_{$session_id}", array(), '', 'no');
64
+		add_option("_wp_session_expires_{$session_id}", $expires, '', 'no');
65 65
 	}
66 66
 
67 67
 	/**
@@ -73,22 +73,22 @@  discard block
 block discarded – undo
73 73
 	 *
74 74
 	 * @return int Sessions deleted.
75 75
 	 */
76
-	public static function delete_old_sessions( $limit = 1000 ) {
76
+	public static function delete_old_sessions($limit = 1000) {
77 77
 		global $wpdb;
78 78
 
79
-		$limit = absint( $limit );
80
-		$keys = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options WHERE option_name LIKE '_wp_session_expires_%' ORDER BY option_value ASC LIMIT 0, {$limit}" );
79
+		$limit = absint($limit);
80
+		$keys = $wpdb->get_results("SELECT option_name, option_value FROM $wpdb->options WHERE option_name LIKE '_wp_session_expires_%' ORDER BY option_value ASC LIMIT 0, {$limit}");
81 81
 
82 82
 		$now = time();
83 83
 		$expired = array();
84 84
 		$count = 0;
85 85
 
86
-		foreach( $keys as $expiration ) {
86
+		foreach ($keys as $expiration) {
87 87
 			$key = $expiration->option_name;
88 88
 			$expires = $expiration->option_value;
89 89
 
90
-			if ( $now > $expires ) {
91
-				$session_id = preg_replace("/[^A-Za-z0-9_]/", '', substr( $key, 20 ) );
90
+			if ($now > $expires) {
91
+				$session_id = preg_replace("/[^A-Za-z0-9_]/", '', substr($key, 20));
92 92
 
93 93
 				$expired[] = $key;
94 94
 				$expired[] = "_wp_session_{$session_id}";
@@ -98,13 +98,13 @@  discard block
 block discarded – undo
98 98
 		}
99 99
 
100 100
 		// Delete expired sessions
101
-		if ( ! empty( $expired ) ) {
102
-		    $placeholders = array_fill( 0, count( $expired ), '%s' );
103
-		    $format = implode( ', ', $placeholders );
101
+		if (!empty($expired)) {
102
+		    $placeholders = array_fill(0, count($expired), '%s');
103
+		    $format = implode(', ', $placeholders);
104 104
 		    $query = "DELETE FROM $wpdb->options WHERE option_name IN ($format)";
105 105
 
106
-		    $prepared = $wpdb->prepare( $query, $expired );
107
-			$wpdb->query( $prepared );
106
+		    $prepared = $wpdb->prepare($query, $expired);
107
+			$wpdb->query($prepared);
108 108
 		}
109 109
 
110 110
 		return $count;
@@ -120,9 +120,9 @@  discard block
 block discarded – undo
120 120
 	public static function delete_all_sessions() {
121 121
 		global $wpdb;
122 122
 
123
-		$count = $wpdb->query( "DELETE FROM $wpdb->options WHERE option_name LIKE '_wp_session_%'" );
123
+		$count = $wpdb->query("DELETE FROM $wpdb->options WHERE option_name LIKE '_wp_session_%'");
124 124
 
125
-		return (int) ( $count / 2 );
125
+		return (int) ($count / 2);
126 126
 	}
127 127
 
128 128
 	/**
@@ -131,9 +131,9 @@  discard block
 block discarded – undo
131 131
 	 * @return string
132 132
 	 */
133 133
 	public static function generate_id() {
134
-		require_once( ABSPATH . 'wp-includes/class-phpass.php' );
135
-		$hash = new PasswordHash( 8, false );
134
+		require_once(ABSPATH.'wp-includes/class-phpass.php');
135
+		$hash = new PasswordHash(8, false);
136 136
 
137
-		return md5( $hash->get_random_bytes( 32 ) );
137
+		return md5($hash->get_random_bytes(32));
138 138
 	}
139 139
 } 
140 140
\ No newline at end of file
Please login to merge, or discard this patch.
geodirectory-functions/wp-session/wp-session.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -33,10 +33,10 @@  discard block
 block discarded – undo
33 33
  *
34 34
  * @param string $data
35 35
  */
36
-function wp_session_decode( $data ) {
36
+function wp_session_decode($data) {
37 37
 	$wp_session = WP_Session::get_instance();
38 38
 
39
-	return $wp_session->json_in( $data );
39
+	return $wp_session->json_in($data);
40 40
 }
41 41
 
42 42
 /**
@@ -57,10 +57,10 @@  discard block
 block discarded – undo
57 57
  *
58 58
  * @return bool
59 59
  */
60
-function wp_session_regenerate_id( $delete_old_session = false ) {
60
+function wp_session_regenerate_id($delete_old_session = false) {
61 61
 	$wp_session = WP_Session::get_instance();
62 62
 
63
-	$wp_session->regenerate_id( $delete_old_session );
63
+	$wp_session->regenerate_id($delete_old_session);
64 64
 
65 65
 	return true;
66 66
 }
@@ -74,12 +74,12 @@  discard block
 block discarded – undo
74 74
  */
75 75
 function wp_session_start() {
76 76
 	$wp_session = WP_Session::get_instance();
77
-	do_action( 'wp_session_start' );
77
+	do_action('wp_session_start');
78 78
 
79 79
 	return $wp_session->session_started();
80 80
 }
81
-if ( ! defined( 'WP_CLI' ) || false === WP_CLI ) {
82
-	add_action( 'plugins_loaded', 'wp_session_start' );
81
+if (!defined('WP_CLI') || false === WP_CLI) {
82
+	add_action('plugins_loaded', 'wp_session_start');
83 83
 }
84 84
 
85 85
 /**
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 function wp_session_status() {
91 91
 	$wp_session = WP_Session::get_instance();
92 92
 
93
-	if ( $wp_session->session_started() ) {
93
+	if ($wp_session->session_started()) {
94 94
 		return PHP_SESSION_ACTIVE;
95 95
 	}
96 96
 
@@ -113,10 +113,10 @@  discard block
 block discarded – undo
113 113
 	$wp_session = WP_Session::get_instance();
114 114
 
115 115
 	$wp_session->write_data();
116
-	do_action( 'wp_session_commit' );
116
+	do_action('wp_session_commit');
117 117
 }
118
-if ( ! defined( 'WP_CLI' ) || false === WP_CLI ) {
119
-	add_action( 'shutdown', 'wp_session_write_close' );
118
+if (!defined('WP_CLI') || false === WP_CLI) {
119
+	add_action('shutdown', 'wp_session_write_close');
120 120
 }
121 121
 
122 122
 /**
@@ -127,33 +127,33 @@  discard block
 block discarded – undo
127 127
  * of a scheduled task or cron job.
128 128
  */
129 129
 function wp_session_cleanup() {
130
-	if ( defined( 'WP_SETUP_CONFIG' ) ) {
130
+	if (defined('WP_SETUP_CONFIG')) {
131 131
 		return;
132 132
 	}
133 133
 
134
-	if ( ! defined( 'WP_INSTALLING' ) ) {
134
+	if (!defined('WP_INSTALLING')) {
135 135
 		/**
136 136
 		 * Determine the size of each batch for deletion.
137 137
 		 *
138 138
 		 * @param int
139 139
 		 */
140
-		$batch_size = apply_filters( 'wp_session_delete_batch_size', 1000 );
140
+		$batch_size = apply_filters('wp_session_delete_batch_size', 1000);
141 141
 
142 142
 		// Delete a batch of old sessions
143
-		WP_Session_Utils::delete_old_sessions( $batch_size );
143
+		WP_Session_Utils::delete_old_sessions($batch_size);
144 144
 	}
145 145
 
146 146
 	// Allow other plugins to hook in to the garbage collection process.
147
-	do_action( 'wp_session_cleanup' );
147
+	do_action('wp_session_cleanup');
148 148
 }
149
-add_action( 'wp_session_garbage_collection', 'wp_session_cleanup' );
149
+add_action('wp_session_garbage_collection', 'wp_session_cleanup');
150 150
 
151 151
 /**
152 152
  * Register the garbage collector as a twice daily event.
153 153
  */
154 154
 function wp_session_register_garbage_collection() {
155
-	if ( ! wp_next_scheduled( 'wp_session_garbage_collection' ) ) {
156
-		wp_schedule_event( time(), 'hourly', 'wp_session_garbage_collection' );
155
+	if (!wp_next_scheduled('wp_session_garbage_collection')) {
156
+		wp_schedule_event(time(), 'hourly', 'wp_session_garbage_collection');
157 157
 	}
158 158
 }
159
-add_action( 'wp', 'wp_session_register_garbage_collection' );
159
+add_action('wp', 'wp_session_register_garbage_collection');
Please login to merge, or discard this patch.
geodirectory-admin/dummy-data/standard_places.php 3 patches
Indentation   +1223 added lines, -1223 removed lines patch added patch discarded remove patch
@@ -12,38 +12,38 @@  discard block
 block discarded – undo
12 12
 $post_meta = array();
13 13
 
14 14
 if($dummy_post_index==1){
15
-    $category_array = array('Attractions', 'Hotels', 'Restaurants', 'Food Nightlife', 'Festival', 'Videos', 'Feature');
16
-    geodir_dummy_data_taxonomies($post_type,$category_array );
17
-    update_option($post_type.'_dummy_data_type','standard_places');
15
+	$category_array = array('Attractions', 'Hotels', 'Restaurants', 'Food Nightlife', 'Festival', 'Videos', 'Feature');
16
+	geodir_dummy_data_taxonomies($post_type,$category_array );
17
+	update_option($post_type.'_dummy_data_type','standard_places');
18 18
 }
19 19
 
20 20
 if (geodir_dummy_folder_exists())
21
-    $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy";
21
+	$dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy";
22 22
 else
23
-    $dummy_image_url = 'https://wpgeodirectory.com/dummy';
23
+	$dummy_image_url = 'https://wpgeodirectory.com/dummy';
24 24
 
25 25
 $dummy_image_url = apply_filters('place_dummy_image_url', $dummy_image_url);
26 26
 
27 27
 switch ($dummy_post_index) {
28 28
 
29
-    case(1):
30
-        $image_array[] = "$dummy_image_url/a1.jpg";
31
-        $image_array[] = "$dummy_image_url/a2.jpg";
32
-        $image_array[] = "$dummy_image_url/a3.jpg";
33
-        $image_array[] = "$dummy_image_url/a4.jpg";
34
-        $image_array[] = "$dummy_image_url/a5.jpg";
35
-        $image_array[] = "$dummy_image_url/a6.jpg";
36
-        $image_array[] = "$dummy_image_url/a7.jpg";
37
-        $image_array[] = "$dummy_image_url/a8.jpg";
38
-        $image_array[] = "$dummy_image_url/a9.jpg";
39
-        $image_array[] = "$dummy_image_url/a10.jpg";
40
-        $image_array[] = "$dummy_image_url/a11.jpg";
41
-
42
-
43
-        $post_info[] = array(
44
-            "listing_type" => $post_type,
45
-            "post_title" => 'Franklin Square',
46
-            "post_desc" => ' <h3> Location </h3>
29
+	case(1):
30
+		$image_array[] = "$dummy_image_url/a1.jpg";
31
+		$image_array[] = "$dummy_image_url/a2.jpg";
32
+		$image_array[] = "$dummy_image_url/a3.jpg";
33
+		$image_array[] = "$dummy_image_url/a4.jpg";
34
+		$image_array[] = "$dummy_image_url/a5.jpg";
35
+		$image_array[] = "$dummy_image_url/a6.jpg";
36
+		$image_array[] = "$dummy_image_url/a7.jpg";
37
+		$image_array[] = "$dummy_image_url/a8.jpg";
38
+		$image_array[] = "$dummy_image_url/a9.jpg";
39
+		$image_array[] = "$dummy_image_url/a10.jpg";
40
+		$image_array[] = "$dummy_image_url/a11.jpg";
41
+
42
+
43
+		$post_info[] = array(
44
+			"listing_type" => $post_type,
45
+			"post_title" => 'Franklin Square',
46
+			"post_desc" => ' <h3> Location </h3>
47 47
 		
48 48
 		6th and Race Streets in Historic Philadelphia
49 49
 		<h3>The Experience</h3>
@@ -78,42 +78,42 @@  discard block
 block discarded – undo
78 78
 		Just in time for summer, Franklin Square has opened SquareBurger, a Stephen Starr-run “burger shack” selling summer staples: hot dogs, fries, milkshakes (made with Tasty Kakes) and, of course, hamburgers and cheeseburgers.
79 79
 		
80 80
 		SquareBurger is open until October - perfect for a couple bites between rounds of miniature golf!',
81
-            "post_images" => $image_array,
82
-            "post_category" => array($post_type.'category' => array('Attractions', 'Feature')),
83
-            "post_tags" => array('Tags', 'Sample Tags'),
84
-            "geodir_video" => '',
85
-            "geodir_timing" => 'Open today until 1 p.m., Sunday 10 am to 9 pm',
86
-            "geodir_contact" => '(111) 677-4444',
87
-            "geodir_email" => '[email protected]',
88
-            "geodir_website" => 'http://franklinsquare.com',
89
-            "geodir_twitter" => 'http://twitter.com/franklinsquare',
90
-            "geodir_facebook" => 'http://facebook.com/franklinsquare',
91
-            "post_dummy" => '1'
92
-        );
93
-
94
-
95
-        break;
96
-    case 2:
97
-        $image_array = array();
98
-        $post_meta = array();
99
-
100
-        /// Attractions ////post start 2///
101
-        $image_array[] = "$dummy_image_url/a6.jpg";
102
-        $image_array[] = "$dummy_image_url/a1.jpg";
103
-        $image_array[] = "$dummy_image_url/a3.jpg";
104
-        $image_array[] = "$dummy_image_url/a4.jpg";
105
-        $image_array[] = "$dummy_image_url/a5.jpg";
106
-        $image_array[] = "$dummy_image_url/a2.jpg";
107
-        $image_array[] = "$dummy_image_url/a7.jpg";
108
-        $image_array[] = "$dummy_image_url/a8.jpg";
109
-        $image_array[] = "$dummy_image_url/a9.jpg";
110
-        $image_array[] = "$dummy_image_url/a10.jpg";
111
-        $image_array[] = "$dummy_image_url/a11.jpg";
112
-
113
-        $post_info[] = array(
114
-            "listing_type" => $post_type,
115
-            "post_title" => 'Please Touch Museum',
116
-            "post_desc" => '<h3>New Location! </h3>
81
+			"post_images" => $image_array,
82
+			"post_category" => array($post_type.'category' => array('Attractions', 'Feature')),
83
+			"post_tags" => array('Tags', 'Sample Tags'),
84
+			"geodir_video" => '',
85
+			"geodir_timing" => 'Open today until 1 p.m., Sunday 10 am to 9 pm',
86
+			"geodir_contact" => '(111) 677-4444',
87
+			"geodir_email" => '[email protected]',
88
+			"geodir_website" => 'http://franklinsquare.com',
89
+			"geodir_twitter" => 'http://twitter.com/franklinsquare',
90
+			"geodir_facebook" => 'http://facebook.com/franklinsquare',
91
+			"post_dummy" => '1'
92
+		);
93
+
94
+
95
+		break;
96
+	case 2:
97
+		$image_array = array();
98
+		$post_meta = array();
99
+
100
+		/// Attractions ////post start 2///
101
+		$image_array[] = "$dummy_image_url/a6.jpg";
102
+		$image_array[] = "$dummy_image_url/a1.jpg";
103
+		$image_array[] = "$dummy_image_url/a3.jpg";
104
+		$image_array[] = "$dummy_image_url/a4.jpg";
105
+		$image_array[] = "$dummy_image_url/a5.jpg";
106
+		$image_array[] = "$dummy_image_url/a2.jpg";
107
+		$image_array[] = "$dummy_image_url/a7.jpg";
108
+		$image_array[] = "$dummy_image_url/a8.jpg";
109
+		$image_array[] = "$dummy_image_url/a9.jpg";
110
+		$image_array[] = "$dummy_image_url/a10.jpg";
111
+		$image_array[] = "$dummy_image_url/a11.jpg";
112
+
113
+		$post_info[] = array(
114
+			"listing_type" => $post_type,
115
+			"post_title" => 'Please Touch Museum',
116
+			"post_desc" => '<h3>New Location! </h3>
117 117
 		
118 118
 		Who doesn&acute;t love the Please Touch Museum? And now, taking kids to the Museum is better than ever. The nation&acute;s premier children&acute;s museum - which has been a beloved landmark since it opened in 1976 - has a new home in Fairmount Park, opening its doors to a world of educational, hands-on fun.
119 119
 		
@@ -145,42 +145,42 @@  discard block
 block discarded – undo
145 145
 		
146 146
 		You can buy admission tickets to the Please Touch Museum online through our partners at the Independence Visitor Center. Just click the button below.',
147 147
 
148
-            "post_images" => $image_array,
149
-            "post_category" => array($post_type.'category' => array('Attractions', 'Feature')),
150
-            "post_tags" => array('Tags', 'Sample Tags'),
151
-            "geodir_video" => '',
152
-            "geodir_timing" => 'Open today until 1 p.m., Sunday 10 am to 9 pm',
153
-            "geodir_contact" => '(222) 777-1111',
154
-            "geodir_email" => '[email protected]',
155
-            "geodir_website" => 'http://pleasetouchmuseum.com',
156
-            "geodir_twitter" => 'http://twitter.com/pleasetouchmuseum',
157
-            "geodir_facebook" => 'http://facebook.com/pleasetouchmuseum',
158
-            "post_dummy" => '1'
159
-        );
160
-
161
-        break;
162
-    case 3:
163
-        $image_array = array();
164
-        $post_meta = array();
165
-
166
-        ////post end///
167
-        /// Attractions ////post start 3///
168
-        $image_array[] = "$dummy_image_url/a9.jpg";
169
-        $image_array[] = "$dummy_image_url/a10.jpg";
170
-        $image_array[] = "$dummy_image_url/a3.jpg";
171
-        $image_array[] = "$dummy_image_url/a4.jpg";
172
-        $image_array[] = "$dummy_image_url/a5.jpg";
173
-        $image_array[] = "$dummy_image_url/a2.jpg";
174
-        $image_array[] = "$dummy_image_url/a7.jpg";
175
-        $image_array[] = "$dummy_image_url/a8.jpg";
176
-        $image_array[] = "$dummy_image_url/a6.jpg";
177
-        $image_array[] = "$dummy_image_url/a1.jpg";
178
-        $image_array[] = "$dummy_image_url/a11.jpg";
179
-
180
-        $post_info[] = array(
181
-            "listing_type" => $post_type,
182
-            "post_title" => 'Longwood Gardens',
183
-            "post_desc" => '<h3>The Experience </h3>
148
+			"post_images" => $image_array,
149
+			"post_category" => array($post_type.'category' => array('Attractions', 'Feature')),
150
+			"post_tags" => array('Tags', 'Sample Tags'),
151
+			"geodir_video" => '',
152
+			"geodir_timing" => 'Open today until 1 p.m., Sunday 10 am to 9 pm',
153
+			"geodir_contact" => '(222) 777-1111',
154
+			"geodir_email" => '[email protected]',
155
+			"geodir_website" => 'http://pleasetouchmuseum.com',
156
+			"geodir_twitter" => 'http://twitter.com/pleasetouchmuseum',
157
+			"geodir_facebook" => 'http://facebook.com/pleasetouchmuseum',
158
+			"post_dummy" => '1'
159
+		);
160
+
161
+		break;
162
+	case 3:
163
+		$image_array = array();
164
+		$post_meta = array();
165
+
166
+		////post end///
167
+		/// Attractions ////post start 3///
168
+		$image_array[] = "$dummy_image_url/a9.jpg";
169
+		$image_array[] = "$dummy_image_url/a10.jpg";
170
+		$image_array[] = "$dummy_image_url/a3.jpg";
171
+		$image_array[] = "$dummy_image_url/a4.jpg";
172
+		$image_array[] = "$dummy_image_url/a5.jpg";
173
+		$image_array[] = "$dummy_image_url/a2.jpg";
174
+		$image_array[] = "$dummy_image_url/a7.jpg";
175
+		$image_array[] = "$dummy_image_url/a8.jpg";
176
+		$image_array[] = "$dummy_image_url/a6.jpg";
177
+		$image_array[] = "$dummy_image_url/a1.jpg";
178
+		$image_array[] = "$dummy_image_url/a11.jpg";
179
+
180
+		$post_info[] = array(
181
+			"listing_type" => $post_type,
182
+			"post_title" => 'Longwood Gardens',
183
+			"post_desc" => '<h3>The Experience </h3>
184 184
 		
185 185
 		When you&acute;re at Longwood Gardens, it&acute;s easy to imagine that you&acute;re at a giant, royal garden in Europe. Stroll along the many paths through acres of exquisitely maintained grounds featuring 11,000 different types of plants.
186 186
 		
@@ -205,42 +205,42 @@  discard block
 block discarded – undo
205 205
 		<h3>Buy Tickets Online In Advance </h3>
206 206
 		
207 207
 		You can buy admission tickets to Longwood Gardens online through our partners at the Independence Visitor Center. Just click the button below.',
208
-            "post_images" => $image_array,
209
-            "post_category" => array($post_type.'category' => array('Attractions')),
210
-            "post_tags" => array('wood', 'garden'),
211
-            "geodir_video" => '',
212
-            "geodir_timing" => 'Open today until 1 p.m., Sunday 10 am to 9 pm',
213
-            "geodir_contact" => '(111) 888-1111',
214
-            "geodir_email" => '[email protected]',
215
-            "geodir_website" => 'http://longwoodgardens.com',
216
-            "geodir_twitter" => 'http://twitter.com/longwoodgardens',
217
-            "geodir_facebook" => 'http://facebook.com/longwoodgardens',
218
-            "post_dummy" => '1'
219
-        );
220
-        break;
221
-    ////post end///
222
-    /// Attractions ////post start 4///
223
-
224
-    case 4:
225
-
226
-        $image_array = array();
227
-        $post_meta = array();
228
-        $image_array[] = "$dummy_image_url/a11.jpg";
229
-        $image_array[] = "$dummy_image_url/a10.jpg";
230
-        $image_array[] = "$dummy_image_url/a3.jpg";
231
-        $image_array[] = "$dummy_image_url/a4.jpg";
232
-        $image_array[] = "$dummy_image_url/a5.jpg";
233
-        $image_array[] = "$dummy_image_url/a2.jpg";
234
-        $image_array[] = "$dummy_image_url/a7.jpg";
235
-        $image_array[] = "$dummy_image_url/a8.jpg";
236
-        $image_array[] = "$dummy_image_url/a6.jpg";
237
-        $image_array[] = "$dummy_image_url/a1.jpg";
238
-        $image_array[] = "$dummy_image_url/a9.jpg";
239
-
240
-        $post_info[] = array(
241
-            "listing_type" => $post_type,
242
-            "post_title" => 'The Philadelphia Zoo',
243
-            "post_desc" => '<h3>The Zoo 150th Birthday</h3>
208
+			"post_images" => $image_array,
209
+			"post_category" => array($post_type.'category' => array('Attractions')),
210
+			"post_tags" => array('wood', 'garden'),
211
+			"geodir_video" => '',
212
+			"geodir_timing" => 'Open today until 1 p.m., Sunday 10 am to 9 pm',
213
+			"geodir_contact" => '(111) 888-1111',
214
+			"geodir_email" => '[email protected]',
215
+			"geodir_website" => 'http://longwoodgardens.com',
216
+			"geodir_twitter" => 'http://twitter.com/longwoodgardens',
217
+			"geodir_facebook" => 'http://facebook.com/longwoodgardens',
218
+			"post_dummy" => '1'
219
+		);
220
+		break;
221
+	////post end///
222
+	/// Attractions ////post start 4///
223
+
224
+	case 4:
225
+
226
+		$image_array = array();
227
+		$post_meta = array();
228
+		$image_array[] = "$dummy_image_url/a11.jpg";
229
+		$image_array[] = "$dummy_image_url/a10.jpg";
230
+		$image_array[] = "$dummy_image_url/a3.jpg";
231
+		$image_array[] = "$dummy_image_url/a4.jpg";
232
+		$image_array[] = "$dummy_image_url/a5.jpg";
233
+		$image_array[] = "$dummy_image_url/a2.jpg";
234
+		$image_array[] = "$dummy_image_url/a7.jpg";
235
+		$image_array[] = "$dummy_image_url/a8.jpg";
236
+		$image_array[] = "$dummy_image_url/a6.jpg";
237
+		$image_array[] = "$dummy_image_url/a1.jpg";
238
+		$image_array[] = "$dummy_image_url/a9.jpg";
239
+
240
+		$post_info[] = array(
241
+			"listing_type" => $post_type,
242
+			"post_title" => 'The Philadelphia Zoo',
243
+			"post_desc" => '<h3>The Zoo 150th Birthday</h3>
244 244
 		
245 245
 		The Philadelphia Zoo celebrated its 150th anniversary in 2009. So stop by and celebrate this major achievement at America&acute;s first zoo!
246 246
 		
@@ -275,45 +275,45 @@  discard block
 block discarded – undo
275 275
 		The nation&acute;s oldest zoo was chartered in 1859, but the impending Civil War delayed its opening until 1874. In addition to its animals, the zoo is known for its historic architecture, which includes the country home of William Penn&acute;s grandson; its botanical collections of over 500 plant species; its groundbreaking research and its fine veterinary facilities.
276 276
 		
277 277
 		The Primate Reserve, Carnivore Kingdom, and Rare Animal Conservation Center, with its tree kangaroos and blue-eyed lemurs, are brand new, but there&acute;s still fun to be had in the historic, old-style bird, pachyderm and carnivore houses. In the Treehouse, kids can investigate the world from an animal&acute;s perspective; outdoors, the Zoo Balloon lifts passengers 400 feet into the air for a bird&acute;s-eye view of the zoo.',
278
-            "post_images" => $image_array,
279
-            "post_category" => array($post_type.'category' => array('Attractions')),
280
-            "post_tags" => array('wood', 'garden'),
281
-            "geodir_video" => '',
282
-            "geodir_timing" => 'Open today until 11.30 a.m., Sunday 11 am to 7 pm',
283
-            "geodir_contact" => '(211) 143-1900',
284
-            "geodir_email" => '[email protected]',
285
-            "geodir_website" => 'http://philadelphiazoo.com',
286
-            "geodir_twitter" => 'http://twitter.com/philadelphiazoo',
287
-            "geodir_facebook" => 'http://facebook.com/philadelphiazoo',
288
-            "post_dummy" => '1'
289
-        );
290
-
291
-        ////post end///
292
-        /// Attractions ////post start 4///
293
-        break;
294
-    case 5:
295
-
296
-
297
-        $image_array = array();
298
-        $post_meta = array();
299
-
300
-        /// Attractions ////post start 5///
301
-        $image_array[] = "$dummy_image_url/a12.jpg";
302
-        $image_array[] = "$dummy_image_url/a13.jpg";
303
-        $image_array[] = "$dummy_image_url/a3.jpg";
304
-        $image_array[] = "$dummy_image_url/a4.jpg";
305
-        $image_array[] = "$dummy_image_url/a5.jpg";
306
-        $image_array[] = "$dummy_image_url/a2.jpg";
307
-        $image_array[] = "$dummy_image_url/a7.jpg";
308
-        $image_array[] = "$dummy_image_url/a8.jpg";
309
-        $image_array[] = "$dummy_image_url/a6.jpg";
310
-        $image_array[] = "$dummy_image_url/a1.jpg";
311
-        $image_array[] = "$dummy_image_url/a9.jpg";
312
-
313
-        $post_info[] = array(
314
-            "listing_type" => $post_type,
315
-            "post_title" => 'National Constitution Center',
316
-            "post_desc" => '<h3>The Experience</h3>
278
+			"post_images" => $image_array,
279
+			"post_category" => array($post_type.'category' => array('Attractions')),
280
+			"post_tags" => array('wood', 'garden'),
281
+			"geodir_video" => '',
282
+			"geodir_timing" => 'Open today until 11.30 a.m., Sunday 11 am to 7 pm',
283
+			"geodir_contact" => '(211) 143-1900',
284
+			"geodir_email" => '[email protected]',
285
+			"geodir_website" => 'http://philadelphiazoo.com',
286
+			"geodir_twitter" => 'http://twitter.com/philadelphiazoo',
287
+			"geodir_facebook" => 'http://facebook.com/philadelphiazoo',
288
+			"post_dummy" => '1'
289
+		);
290
+
291
+		////post end///
292
+		/// Attractions ////post start 4///
293
+		break;
294
+	case 5:
295
+
296
+
297
+		$image_array = array();
298
+		$post_meta = array();
299
+
300
+		/// Attractions ////post start 5///
301
+		$image_array[] = "$dummy_image_url/a12.jpg";
302
+		$image_array[] = "$dummy_image_url/a13.jpg";
303
+		$image_array[] = "$dummy_image_url/a3.jpg";
304
+		$image_array[] = "$dummy_image_url/a4.jpg";
305
+		$image_array[] = "$dummy_image_url/a5.jpg";
306
+		$image_array[] = "$dummy_image_url/a2.jpg";
307
+		$image_array[] = "$dummy_image_url/a7.jpg";
308
+		$image_array[] = "$dummy_image_url/a8.jpg";
309
+		$image_array[] = "$dummy_image_url/a6.jpg";
310
+		$image_array[] = "$dummy_image_url/a1.jpg";
311
+		$image_array[] = "$dummy_image_url/a9.jpg";
312
+
313
+		$post_info[] = array(
314
+			"listing_type" => $post_type,
315
+			"post_title" => 'National Constitution Center',
316
+			"post_desc" => '<h3>The Experience</h3>
317 317
 	
318 318
 	It only four pages long, but the U.S. Constitution is among the most influential and important documents in the history of the world.
319 319
 	
@@ -335,45 +335,45 @@  discard block
 block discarded – undo
335 335
 	<h3>Kids Stuff </h3>
336 336
 	
337 337
 	The Center frequently hosts special events with a focus on children that include informative and engaging hands-on activities. For specific information, check out the Center website.',
338
-            "post_images" => $image_array,
339
-            "post_category" => array($post_type.'category' => array('Attractions', 'Feature')),
340
-            "post_tags" => array('Tag', 'Center'),
341
-            "geodir_video" => '',
342
-            "geodir_timing" => 'Open today until 9.30 a.m., Sunday 11 am to 7 pm',
343
-            "geodir_contact" => '(111) 111-1111',
344
-            "geodir_email" => '[email protected]',
345
-            "geodir_website" => 'http://ncc.com',
346
-            "geodir_twitter" => 'http://twitter.com/ncc',
347
-            "geodir_facebook" => 'http://facebook.com/ncc',
348
-            "post_dummy" => '1'
349
-        );
350
-
351
-        ////post end///
352
-        /// Attractions ////post start 5///
353
-        break;
354
-    case 6:
355
-
356
-
357
-        $image_array = array();
358
-        $post_meta = array();
359
-
360
-        /// Attractions ////post start 6///
361
-        $image_array[] = "$dummy_image_url/a14.jpg";
362
-        $image_array[] = "$dummy_image_url/a13.jpg";
363
-        $image_array[] = "$dummy_image_url/a3.jpg";
364
-        $image_array[] = "$dummy_image_url/a4.jpg";
365
-        $image_array[] = "$dummy_image_url/a5.jpg";
366
-        $image_array[] = "$dummy_image_url/a2.jpg";
367
-        $image_array[] = "$dummy_image_url/a7.jpg";
368
-        $image_array[] = "$dummy_image_url/a8.jpg";
369
-        $image_array[] = "$dummy_image_url/a6.jpg";
370
-        $image_array[] = "$dummy_image_url/a1.jpg";
371
-        $image_array[] = "$dummy_image_url/a9.jpg";
372
-
373
-        $post_info[] = array(
374
-            "listing_type" => $post_type,
375
-            "post_title" => 'Sadsbury Woods Preserve',
376
-            "post_desc" => 'A more than 500-acre nature preserve ideal for walking and hiking, Sadsbury Woods is also an important habitat for interior nesting birds and small mammals. An increasingly rare area of interior woodlands, defined as an area at least 300 feet from any road, lawn or meadow, provides a critical habitat for many species of birds, especially neo-tropical migrant songbirds.
338
+			"post_images" => $image_array,
339
+			"post_category" => array($post_type.'category' => array('Attractions', 'Feature')),
340
+			"post_tags" => array('Tag', 'Center'),
341
+			"geodir_video" => '',
342
+			"geodir_timing" => 'Open today until 9.30 a.m., Sunday 11 am to 7 pm',
343
+			"geodir_contact" => '(111) 111-1111',
344
+			"geodir_email" => '[email protected]',
345
+			"geodir_website" => 'http://ncc.com',
346
+			"geodir_twitter" => 'http://twitter.com/ncc',
347
+			"geodir_facebook" => 'http://facebook.com/ncc',
348
+			"post_dummy" => '1'
349
+		);
350
+
351
+		////post end///
352
+		/// Attractions ////post start 5///
353
+		break;
354
+	case 6:
355
+
356
+
357
+		$image_array = array();
358
+		$post_meta = array();
359
+
360
+		/// Attractions ////post start 6///
361
+		$image_array[] = "$dummy_image_url/a14.jpg";
362
+		$image_array[] = "$dummy_image_url/a13.jpg";
363
+		$image_array[] = "$dummy_image_url/a3.jpg";
364
+		$image_array[] = "$dummy_image_url/a4.jpg";
365
+		$image_array[] = "$dummy_image_url/a5.jpg";
366
+		$image_array[] = "$dummy_image_url/a2.jpg";
367
+		$image_array[] = "$dummy_image_url/a7.jpg";
368
+		$image_array[] = "$dummy_image_url/a8.jpg";
369
+		$image_array[] = "$dummy_image_url/a6.jpg";
370
+		$image_array[] = "$dummy_image_url/a1.jpg";
371
+		$image_array[] = "$dummy_image_url/a9.jpg";
372
+
373
+		$post_info[] = array(
374
+			"listing_type" => $post_type,
375
+			"post_title" => 'Sadsbury Woods Preserve',
376
+			"post_desc" => 'A more than 500-acre nature preserve ideal for walking and hiking, Sadsbury Woods is also an important habitat for interior nesting birds and small mammals. An increasingly rare area of interior woodlands, defined as an area at least 300 feet from any road, lawn or meadow, provides a critical habitat for many species of birds, especially neo-tropical migrant songbirds.
377 377
 	
378 378
 	Situated on the western edge of Chester County, the land remains much as it did centuries ago, and now serves as a permanent refuge in an area facing dramatically increasing development pressure.
379 379
 	
@@ -389,45 +389,45 @@  discard block
 block discarded – undo
389 389
 	Outsider Tip
390 390
 	
391 391
 	The deep forest is a great place for spotting neo-tropical songbirds in the spring and summer months',
392
-            "post_images" => $image_array,
393
-            "post_category" => array($post_type.'category' => array('Attractions')),
394
-            "post_tags" => array('sample', 'tags'),
395
-            "geodir_video" => '',
396
-            "geodir_timing" => 'Open today until 12.30 p.m., Sunday 12 pm to 7 pm',
397
-            "geodir_contact" => '(222) 999-9999',
398
-            "geodir_email" => '[email protected]',
399
-            "geodir_website" => 'http://swp.com',
400
-            "geodir_twitter" => 'http://twitter.com/swp',
401
-            "geodir_facebook" => 'http://facebook.com/swp',
402
-            "post_dummy" => '1'
403
-        );
404
-
405
-        ////post end///
406
-        /// Attractions ////post start 6///
407
-
408
-        break;
409
-    case 7:
410
-
411
-        $image_array = array();
412
-        $post_meta = array();
413
-
414
-        /// Attractions ////post start 7///
415
-        $image_array[] = "$dummy_image_url/a15.jpg";
416
-        $image_array[] = "$dummy_image_url/a16.jpg";
417
-        $image_array[] = "$dummy_image_url/a17.jpg";
418
-        $image_array[] = "$dummy_image_url/a4.jpg";
419
-        $image_array[] = "$dummy_image_url/a5.jpg";
420
-        $image_array[] = "$dummy_image_url/a2.jpg";
421
-        $image_array[] = "$dummy_image_url/a7.jpg";
422
-        $image_array[] = "$dummy_image_url/a8.jpg";
423
-        $image_array[] = "$dummy_image_url/a6.jpg";
424
-        $image_array[] = "$dummy_image_url/a1.jpg";
425
-        $image_array[] = "$dummy_image_url/a9.jpg";
426
-
427
-        $post_info[] = array(
428
-            "listing_type" => $post_type,
429
-            "post_title" => 'Museum Without Walls',
430
-            "post_desc" => '<h3>The Experience </h3>
392
+			"post_images" => $image_array,
393
+			"post_category" => array($post_type.'category' => array('Attractions')),
394
+			"post_tags" => array('sample', 'tags'),
395
+			"geodir_video" => '',
396
+			"geodir_timing" => 'Open today until 12.30 p.m., Sunday 12 pm to 7 pm',
397
+			"geodir_contact" => '(222) 999-9999',
398
+			"geodir_email" => '[email protected]',
399
+			"geodir_website" => 'http://swp.com',
400
+			"geodir_twitter" => 'http://twitter.com/swp',
401
+			"geodir_facebook" => 'http://facebook.com/swp',
402
+			"post_dummy" => '1'
403
+		);
404
+
405
+		////post end///
406
+		/// Attractions ////post start 6///
407
+
408
+		break;
409
+	case 7:
410
+
411
+		$image_array = array();
412
+		$post_meta = array();
413
+
414
+		/// Attractions ////post start 7///
415
+		$image_array[] = "$dummy_image_url/a15.jpg";
416
+		$image_array[] = "$dummy_image_url/a16.jpg";
417
+		$image_array[] = "$dummy_image_url/a17.jpg";
418
+		$image_array[] = "$dummy_image_url/a4.jpg";
419
+		$image_array[] = "$dummy_image_url/a5.jpg";
420
+		$image_array[] = "$dummy_image_url/a2.jpg";
421
+		$image_array[] = "$dummy_image_url/a7.jpg";
422
+		$image_array[] = "$dummy_image_url/a8.jpg";
423
+		$image_array[] = "$dummy_image_url/a6.jpg";
424
+		$image_array[] = "$dummy_image_url/a1.jpg";
425
+		$image_array[] = "$dummy_image_url/a9.jpg";
426
+
427
+		$post_info[] = array(
428
+			"listing_type" => $post_type,
429
+			"post_title" => 'Museum Without Walls',
430
+			"post_desc" => '<h3>The Experience </h3>
431 431
 	
432 432
 	Museum Without Walls: AUDIO is a multi-platform, interactive audio tour, designed to allow locals and visitors alike to experience Philadelphia extensive collection of public art and outdoor sculpture along the Benjamin Franklin Parkway and Kelly Drive. This innovative program invites passersby to stop, look, listen and see this city public art in a new way. Discover the untold histories of the 51 outdoor sculptures at 35 stops through these professionally produced three-minute interpretive audio segments. The many narratives have been spoken by more than 100 individuals, all with personal connections to the pieces of art.
433 433
 	
@@ -437,45 +437,45 @@  discard block
 block discarded – undo
437 437
 	<h3>History </h3>
438 438
 	
439 439
 	Philadelphia has more outdoor sculpture than any other American city, yet this extensive collection often goes unnoticed. This program is intended to reveal the distinct stories behind each of these works, that have become visual white noise for so many of the city residents and visitors. ',
440
-            "post_images" => $image_array,
441
-            "post_category" => array($post_type.'category' => array('Attractions')),
442
-            "post_tags" => array('Museum'),
443
-            "geodir_video" => '',
444
-            "geodir_timing" => 'Open today until 10.30 a.m., Sunday 10 am to 7 pm',
445
-            "geodir_contact" => '(222) 999-9999',
446
-            "geodir_email" => '[email protected]',
447
-            "geodir_website" => 'http://museumwithoutwallsaudio.org/',
448
-            "geodir_twitter" => 'http://twitter.com/mwwalls',
449
-            "geodir_facebook" => 'http://facebook.com/mwwalls',
450
-            "post_dummy" => '1'
451
-        );
452
-
453
-        ////post end///
454
-        /// Attractions ////post start 7///
455
-
456
-        break;
457
-    case 8:
458
-
459
-        $image_array = array();
460
-        $post_meta = array();
461
-
462
-        /// Attractions ////post start 8///
463
-        $image_array[] = "$dummy_image_url/a18.jpg";
464
-        $image_array[] = "$dummy_image_url/a10.jpg";
465
-        $image_array[] = "$dummy_image_url/a3.jpg";
466
-        $image_array[] = "$dummy_image_url/a4.jpg";
467
-        $image_array[] = "$dummy_image_url/a5.jpg";
468
-        $image_array[] = "$dummy_image_url/a2.jpg";
469
-        $image_array[] = "$dummy_image_url/a7.jpg";
470
-        $image_array[] = "$dummy_image_url/a8.jpg";
471
-        $image_array[] = "$dummy_image_url/a6.jpg";
472
-        $image_array[] = "$dummy_image_url/a1.jpg";
473
-        $image_array[] = "$dummy_image_url/a9.jpg";
474
-
475
-        $post_info[] = array(
476
-            "listing_type" => $post_type,
477
-            "post_title" => 'Audacious Freedom',
478
-            "post_desc" => 'Audacious Freedom, the major, new exhibit at the African American Museum in Philadelphia , explores the lives of people of African descent living in Philadelphia between 1776 and 1876.
440
+			"post_images" => $image_array,
441
+			"post_category" => array($post_type.'category' => array('Attractions')),
442
+			"post_tags" => array('Museum'),
443
+			"geodir_video" => '',
444
+			"geodir_timing" => 'Open today until 10.30 a.m., Sunday 10 am to 7 pm',
445
+			"geodir_contact" => '(222) 999-9999',
446
+			"geodir_email" => '[email protected]',
447
+			"geodir_website" => 'http://museumwithoutwallsaudio.org/',
448
+			"geodir_twitter" => 'http://twitter.com/mwwalls',
449
+			"geodir_facebook" => 'http://facebook.com/mwwalls',
450
+			"post_dummy" => '1'
451
+		);
452
+
453
+		////post end///
454
+		/// Attractions ////post start 7///
455
+
456
+		break;
457
+	case 8:
458
+
459
+		$image_array = array();
460
+		$post_meta = array();
461
+
462
+		/// Attractions ////post start 8///
463
+		$image_array[] = "$dummy_image_url/a18.jpg";
464
+		$image_array[] = "$dummy_image_url/a10.jpg";
465
+		$image_array[] = "$dummy_image_url/a3.jpg";
466
+		$image_array[] = "$dummy_image_url/a4.jpg";
467
+		$image_array[] = "$dummy_image_url/a5.jpg";
468
+		$image_array[] = "$dummy_image_url/a2.jpg";
469
+		$image_array[] = "$dummy_image_url/a7.jpg";
470
+		$image_array[] = "$dummy_image_url/a8.jpg";
471
+		$image_array[] = "$dummy_image_url/a6.jpg";
472
+		$image_array[] = "$dummy_image_url/a1.jpg";
473
+		$image_array[] = "$dummy_image_url/a9.jpg";
474
+
475
+		$post_info[] = array(
476
+			"listing_type" => $post_type,
477
+			"post_title" => 'Audacious Freedom',
478
+			"post_desc" => 'Audacious Freedom, the major, new exhibit at the African American Museum in Philadelphia , explores the lives of people of African descent living in Philadelphia between 1776 and 1876.
479 479
 	
480 480
 	Discover how African Americans in Philadelphia lived and worked while helping to shape the young nation in its formative stages.
481 481
 	
@@ -483,45 +483,45 @@  discard block
 block discarded – undo
483 483
 	
484 484
 	The groundbreaking exhibit allows visitors to “walk the streets” of Historic Philadelphia using a large-scale map. Young children can join the action with Children&acute;s Corner, which highlights the daily lives of children during that period.
485 485
 	',
486
-            "post_images" => $image_array,
487
-            "post_category" => array($post_type.'category' => array('Attractions')),
488
-            "post_tags" => array('Tag1'),
489
-            "geodir_video" => '',
490
-            "geodir_timing" => 'Open today until 11.30 a.m., Sunday 1 pm to 7 pm',
491
-            "geodir_contact" => '(777) 777-7777',
492
-            "geodir_email" => '[email protected]',
493
-            "geodir_website" => 'http://www.aampmuseum.org/',
494
-            "geodir_twitter" => 'http://twitter.com/aampmuseum',
495
-            "geodir_facebook" => 'http://facebook.com/aampmuseum',
496
-            "post_dummy" => '1'
497
-        );
498
-
499
-        ////post end///
500
-        /// Attractions ////post start 8///
501
-
502
-
503
-        break;
504
-    case 9:
505
-        $image_array = array();
506
-        $post_meta = array();
507
-
508
-        /// Attractions ////post start 9///
509
-        $image_array[] = "$dummy_image_url/a19.jpg";
510
-        $image_array[] = "$dummy_image_url/a20.jpg";
511
-        $image_array[] = "$dummy_image_url/a3.jpg";
512
-        $image_array[] = "$dummy_image_url/a4.jpg";
513
-        $image_array[] = "$dummy_image_url/a5.jpg";
514
-        $image_array[] = "$dummy_image_url/a2.jpg";
515
-        $image_array[] = "$dummy_image_url/a7.jpg";
516
-        $image_array[] = "$dummy_image_url/a8.jpg";
517
-        $image_array[] = "$dummy_image_url/a6.jpg";
518
-        $image_array[] = "$dummy_image_url/a1.jpg";
519
-        $image_array[] = "$dummy_image_url/a9.jpg";
520
-
521
-        $post_info[] = array(
522
-            "listing_type" => $post_type,
523
-            "post_title" => 'The Liberty Bell Center',
524
-            "post_desc" => '<h3>The Experience </h3>
486
+			"post_images" => $image_array,
487
+			"post_category" => array($post_type.'category' => array('Attractions')),
488
+			"post_tags" => array('Tag1'),
489
+			"geodir_video" => '',
490
+			"geodir_timing" => 'Open today until 11.30 a.m., Sunday 1 pm to 7 pm',
491
+			"geodir_contact" => '(777) 777-7777',
492
+			"geodir_email" => '[email protected]',
493
+			"geodir_website" => 'http://www.aampmuseum.org/',
494
+			"geodir_twitter" => 'http://twitter.com/aampmuseum',
495
+			"geodir_facebook" => 'http://facebook.com/aampmuseum',
496
+			"post_dummy" => '1'
497
+		);
498
+
499
+		////post end///
500
+		/// Attractions ////post start 8///
501
+
502
+
503
+		break;
504
+	case 9:
505
+		$image_array = array();
506
+		$post_meta = array();
507
+
508
+		/// Attractions ////post start 9///
509
+		$image_array[] = "$dummy_image_url/a19.jpg";
510
+		$image_array[] = "$dummy_image_url/a20.jpg";
511
+		$image_array[] = "$dummy_image_url/a3.jpg";
512
+		$image_array[] = "$dummy_image_url/a4.jpg";
513
+		$image_array[] = "$dummy_image_url/a5.jpg";
514
+		$image_array[] = "$dummy_image_url/a2.jpg";
515
+		$image_array[] = "$dummy_image_url/a7.jpg";
516
+		$image_array[] = "$dummy_image_url/a8.jpg";
517
+		$image_array[] = "$dummy_image_url/a6.jpg";
518
+		$image_array[] = "$dummy_image_url/a1.jpg";
519
+		$image_array[] = "$dummy_image_url/a9.jpg";
520
+
521
+		$post_info[] = array(
522
+			"listing_type" => $post_type,
523
+			"post_title" => 'The Liberty Bell Center',
524
+			"post_desc" => '<h3>The Experience </h3>
525 525
 	
526 526
 	The Liberty Bell has a new home, and it is as powerful and dramatic as the Bell itself. Throughout the expansive, light-filled Center, larger-than-life historic documents and graphic images explore the facts and the myths surrounding the Bell.
527 527
 	
@@ -542,45 +542,45 @@  discard block
 block discarded – undo
542 542
 	The Bell is suspended from what is believed to be its original yoke, made of American elm.
543 543
 	
544 544
 	The Liberty Bell weighs 2,080 pounds. The yoke weighs about 100 pounds.',
545
-            "post_images" => $image_array,
546
-            "post_category" => array($post_type.'category' => array('Attractions', 'Feature')),
547
-            "post_tags" => array(''),
548
-            "geodir_video" => '',
549
-            "geodir_timing" => 'The center is open year round, 9 a.m. – 5 p.m., with extended hours in the summer.',
550
-            "geodir_contact" => '(777) 666-6666',
551
-            "geodir_email" => '[email protected]',
552
-            "geodir_website" => 'http://www.nps.gov/inde',
553
-            "geodir_twitter" => 'http://twitter.com/nps',
554
-            "geodir_facebook" => 'http://facebook.com/nps',
555
-            "post_dummy" => '1'
556
-        );
557
-
558
-        ////post end///
559
-        /// Attractions ////post start 9///
560
-        break;
561
-    case 10:
562
-
563
-
564
-        $image_array = array();
565
-        $post_meta = array();
566
-
567
-        /// Attractions ////post start 10///
568
-        $image_array[] = "$dummy_image_url/a19.jpg";
569
-        $image_array[] = "$dummy_image_url/a20.jpg";
570
-        $image_array[] = "$dummy_image_url/a3.jpg";
571
-        $image_array[] = "$dummy_image_url/a4.jpg";
572
-        $image_array[] = "$dummy_image_url/a5.jpg";
573
-        $image_array[] = "$dummy_image_url/a2.jpg";
574
-        $image_array[] = "$dummy_image_url/a7.jpg";
575
-        $image_array[] = "$dummy_image_url/a8.jpg";
576
-        $image_array[] = "$dummy_image_url/a6.jpg";
577
-        $image_array[] = "$dummy_image_url/a1.jpg";
578
-        $image_array[] = "$dummy_image_url/a9.jpg";
579
-
580
-        $post_info[] = array(
581
-            "listing_type" => $post_type,
582
-            "post_title" => 'Rittenhouse Square',
583
-            "post_desc" => '
545
+			"post_images" => $image_array,
546
+			"post_category" => array($post_type.'category' => array('Attractions', 'Feature')),
547
+			"post_tags" => array(''),
548
+			"geodir_video" => '',
549
+			"geodir_timing" => 'The center is open year round, 9 a.m. – 5 p.m., with extended hours in the summer.',
550
+			"geodir_contact" => '(777) 666-6666',
551
+			"geodir_email" => '[email protected]',
552
+			"geodir_website" => 'http://www.nps.gov/inde',
553
+			"geodir_twitter" => 'http://twitter.com/nps',
554
+			"geodir_facebook" => 'http://facebook.com/nps',
555
+			"post_dummy" => '1'
556
+		);
557
+
558
+		////post end///
559
+		/// Attractions ////post start 9///
560
+		break;
561
+	case 10:
562
+
563
+
564
+		$image_array = array();
565
+		$post_meta = array();
566
+
567
+		/// Attractions ////post start 10///
568
+		$image_array[] = "$dummy_image_url/a19.jpg";
569
+		$image_array[] = "$dummy_image_url/a20.jpg";
570
+		$image_array[] = "$dummy_image_url/a3.jpg";
571
+		$image_array[] = "$dummy_image_url/a4.jpg";
572
+		$image_array[] = "$dummy_image_url/a5.jpg";
573
+		$image_array[] = "$dummy_image_url/a2.jpg";
574
+		$image_array[] = "$dummy_image_url/a7.jpg";
575
+		$image_array[] = "$dummy_image_url/a8.jpg";
576
+		$image_array[] = "$dummy_image_url/a6.jpg";
577
+		$image_array[] = "$dummy_image_url/a1.jpg";
578
+		$image_array[] = "$dummy_image_url/a9.jpg";
579
+
580
+		$post_info[] = array(
581
+			"listing_type" => $post_type,
582
+			"post_title" => 'Rittenhouse Square',
583
+			"post_desc" => '
584 584
 	
585 585
 	Unlike the other squares, the early Southwest Square was never used as a burial ground, although it offered pasturage for local livestock and a convenient dumping spot for “night soil”.
586 586
 	<h3> History </h3>
@@ -613,45 +613,45 @@  discard block
 block discarded – undo
613 613
 	
614 614
 	Meanwhile, several more restaurants, bars and clubs have opened along the surrounding blocks in recent years, like Parc, Tria, Continental Midtown, Alfa, Walnut Room, and Twenty Manning just to name a few.
615 615
 	',
616
-            "post_images" => $image_array,
617
-            "post_category" => array($post_type.'category' => array('Attractions')),
618
-            "post_tags" => array('Museum'),
619
-            "geodir_video" => '',
620
-            "geodir_timing" => 'The center is open year round, 9 a.m. – 5 p.m., with extended hours in the summer.',
621
-            "geodir_contact" => '(777) 666-6666',
622
-            "geodir_email" => '[email protected]',
623
-            "geodir_website" => 'http://www.fairmountpark.org/rittenhousesquare.asp',
624
-            "geodir_twitter" => 'http://twitter.com/fairmountpark',
625
-            "geodir_facebook" => 'http://facebook.com/fairmountpark',
626
-            "post_dummy" => '1'
627
-        );
628
-
629
-        ////post end///
630
-        /// Attractions ////post start 10///
631
-        break;
632
-    case 11:
633
-
634
-
635
-        $image_array = array();
636
-        $post_meta = array();
637
-
638
-        /// Hotels ////post start 1///
639
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
640
-        $image_array[] = "$dummy_image_url/hotels2.jpg";
641
-        $image_array[] = "$dummy_image_url/hotels3.jpg";
642
-        $image_array[] = "$dummy_image_url/hotels4.jpg";
643
-        $image_array[] = "$dummy_image_url/hotels5.jpg";
644
-        $image_array[] = "$dummy_image_url/hotels6.jpg";
645
-        $image_array[] = "$dummy_image_url/hotels7.jpg";
646
-        $image_array[] = "$dummy_image_url/hotels8.jpg";
647
-        $image_array[] = "$dummy_image_url/hotels9.jpg";
648
-        $image_array[] = "$dummy_image_url/hotels10.jpg";
649
-        $image_array[] = "$dummy_image_url/hotels11.jpg";
650
-
651
-        $post_info[] = array(
652
-            "listing_type" => $post_type,
653
-            "post_title" => 'Loews Philadelphia Hotel',
654
-            "post_desc" => '
616
+			"post_images" => $image_array,
617
+			"post_category" => array($post_type.'category' => array('Attractions')),
618
+			"post_tags" => array('Museum'),
619
+			"geodir_video" => '',
620
+			"geodir_timing" => 'The center is open year round, 9 a.m. – 5 p.m., with extended hours in the summer.',
621
+			"geodir_contact" => '(777) 666-6666',
622
+			"geodir_email" => '[email protected]',
623
+			"geodir_website" => 'http://www.fairmountpark.org/rittenhousesquare.asp',
624
+			"geodir_twitter" => 'http://twitter.com/fairmountpark',
625
+			"geodir_facebook" => 'http://facebook.com/fairmountpark',
626
+			"post_dummy" => '1'
627
+		);
628
+
629
+		////post end///
630
+		/// Attractions ////post start 10///
631
+		break;
632
+	case 11:
633
+
634
+
635
+		$image_array = array();
636
+		$post_meta = array();
637
+
638
+		/// Hotels ////post start 1///
639
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
640
+		$image_array[] = "$dummy_image_url/hotels2.jpg";
641
+		$image_array[] = "$dummy_image_url/hotels3.jpg";
642
+		$image_array[] = "$dummy_image_url/hotels4.jpg";
643
+		$image_array[] = "$dummy_image_url/hotels5.jpg";
644
+		$image_array[] = "$dummy_image_url/hotels6.jpg";
645
+		$image_array[] = "$dummy_image_url/hotels7.jpg";
646
+		$image_array[] = "$dummy_image_url/hotels8.jpg";
647
+		$image_array[] = "$dummy_image_url/hotels9.jpg";
648
+		$image_array[] = "$dummy_image_url/hotels10.jpg";
649
+		$image_array[] = "$dummy_image_url/hotels11.jpg";
650
+
651
+		$post_info[] = array(
652
+			"listing_type" => $post_type,
653
+			"post_title" => 'Loews Philadelphia Hotel',
654
+			"post_desc" => '
655 655
 	
656 656
 	<h3>OVERVIEW </h3>
657 657
 	
@@ -718,45 +718,45 @@  discard block
 block discarded – undo
718 718
 	
719 719
 	SoleFood Restaurant is proud to be serving Starbucks. Come in and enjoy a fresh cup of coffee during your morning rush. The Coffee Bar also offer small breakfast items for your enjoyment.
720 720
 	',
721
-            "post_images" => $image_array,
722
-            "post_category" => array($post_type.'category' => array('Hotels', 'Feature')),
723
-            "post_tags" => array(''),
724
-            "geodir_video" => '',
725
-            "geodir_timing" => 'Daily, 6:30 am – 12:00 pm',
726
-            "geodir_contact" => '(111) 111-0000',
727
-            "geodir_email" => '[email protected]',
728
-            "geodir_website" => 'http://www.loewshotels.com/en/hotels/philadelphia-hotel/overview.aspx',
729
-            "geodir_twitter" => 'http://twitter.com/loewshotels',
730
-            "geodir_facebook" => 'http://facebook.com/loewshotels',
731
-            "post_dummy" => '1'
732
-        );
733
-
734
-        ////post end///
735
-        /// Hotels ////post start 1///
736
-        break;
737
-    case 12:
738
-
739
-
740
-        $image_array = array();
741
-        $post_meta = array();
742
-
743
-        /// Hotels ////post start 2///
744
-        $image_array[] = "$dummy_image_url/hotels5.jpg";
745
-        $image_array[] = "$dummy_image_url/hotels2.jpg";
746
-        $image_array[] = "$dummy_image_url/hotels3.jpg";
747
-        $image_array[] = "$dummy_image_url/hotels4.jpg";
748
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
749
-        $image_array[] = "$dummy_image_url/hotels6.jpg";
750
-        $image_array[] = "$dummy_image_url/hotels7.jpg";
751
-        $image_array[] = "$dummy_image_url/hotels8.jpg";
752
-        $image_array[] = "$dummy_image_url/hotels9.jpg";
753
-        $image_array[] = "$dummy_image_url/hotels10.jpg";
754
-        $image_array[] = "$dummy_image_url/hotels11.jpg";
755
-
756
-        $post_info[] = array(
757
-            "listing_type" => $post_type,
758
-            "post_title" => 'Embassy Suites Philadelphia',
759
-            "post_desc" => '
721
+			"post_images" => $image_array,
722
+			"post_category" => array($post_type.'category' => array('Hotels', 'Feature')),
723
+			"post_tags" => array(''),
724
+			"geodir_video" => '',
725
+			"geodir_timing" => 'Daily, 6:30 am – 12:00 pm',
726
+			"geodir_contact" => '(111) 111-0000',
727
+			"geodir_email" => '[email protected]',
728
+			"geodir_website" => 'http://www.loewshotels.com/en/hotels/philadelphia-hotel/overview.aspx',
729
+			"geodir_twitter" => 'http://twitter.com/loewshotels',
730
+			"geodir_facebook" => 'http://facebook.com/loewshotels',
731
+			"post_dummy" => '1'
732
+		);
733
+
734
+		////post end///
735
+		/// Hotels ////post start 1///
736
+		break;
737
+	case 12:
738
+
739
+
740
+		$image_array = array();
741
+		$post_meta = array();
742
+
743
+		/// Hotels ////post start 2///
744
+		$image_array[] = "$dummy_image_url/hotels5.jpg";
745
+		$image_array[] = "$dummy_image_url/hotels2.jpg";
746
+		$image_array[] = "$dummy_image_url/hotels3.jpg";
747
+		$image_array[] = "$dummy_image_url/hotels4.jpg";
748
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
749
+		$image_array[] = "$dummy_image_url/hotels6.jpg";
750
+		$image_array[] = "$dummy_image_url/hotels7.jpg";
751
+		$image_array[] = "$dummy_image_url/hotels8.jpg";
752
+		$image_array[] = "$dummy_image_url/hotels9.jpg";
753
+		$image_array[] = "$dummy_image_url/hotels10.jpg";
754
+		$image_array[] = "$dummy_image_url/hotels11.jpg";
755
+
756
+		$post_info[] = array(
757
+			"listing_type" => $post_type,
758
+			"post_title" => 'Embassy Suites Philadelphia',
759
+			"post_desc" => '
760 760
 	The newly renovated Embassy Suites Philadelphia – Center City hotel is conveniently situated in the heart of downtown Philadelphia, Pennsylvania and Philadelphia&acute;s Center City business district. This hotel in Philadelphia is located only eight miles from Philadelphia International Airport and just minutes from top Philadelphia attractions, including:
761 761
 	
762 762
 	Philadelphia Museum of Art
@@ -772,45 +772,45 @@  discard block
 block discarded – undo
772 772
 	
773 773
 	A delicious, complimentary cooked-to-order breakfast is offered each morning, and a hotel Manager&acute;s Reception every night – featuring complimentary refreshments and great company.
774 774
 	',
775
-            "post_images" => $image_array,
776
-            "post_category" => array($post_type.'category' => array('Hotels')),
777
-            "post_tags" => array(''),
778
-            "geodir_video" => '',
779
-            "geodir_timing" => 'Daily, 10:30 am – 10 pm',
780
-            "geodir_contact" => '(111) 111-0000',
781
-            "geodir_email" => '[email protected]',
782
-            "geodir_website" => 'http://embassysuites1.hilton.com/en_US/es/hotel/PHLDTES-Embassy-Suites-Philadelphia-Center-City-Pennsylvania/index.do',
783
-            "geodir_twitter" => 'http://twitter.com/embassysuites1',
784
-            "geodir_facebook" => 'http://facebook.com/embassysuites1',
785
-            "post_dummy" => '1'
786
-        );
787
-
788
-        ////post end///
789
-        /// Hotels ////post start 2///
790
-
791
-        break;
792
-    case 13:
793
-
794
-        $image_array = array();
795
-        $post_meta = array();
796
-
797
-        /// Hotels ////post start 3///
798
-        $image_array[] = "$dummy_image_url/hotels10.jpg";
799
-        $image_array[] = "$dummy_image_url/hotels11.jpg";
800
-        $image_array[] = "$dummy_image_url/hotels12.jpg";
801
-        $image_array[] = "$dummy_image_url/hotels4.jpg";
802
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
803
-        $image_array[] = "$dummy_image_url/hotels6.jpg";
804
-        $image_array[] = "$dummy_image_url/hotels7.jpg";
805
-        $image_array[] = "$dummy_image_url/hotels8.jpg";
806
-        $image_array[] = "$dummy_image_url/hotels9.jpg";
807
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
808
-        $image_array[] = "$dummy_image_url/hotels2.jpg";
809
-
810
-        $post_info[] = array(
811
-            "listing_type" => $post_type,
812
-            "post_title" => 'Doubletree Hotel Philadelphia',
813
-            "post_desc" => '
775
+			"post_images" => $image_array,
776
+			"post_category" => array($post_type.'category' => array('Hotels')),
777
+			"post_tags" => array(''),
778
+			"geodir_video" => '',
779
+			"geodir_timing" => 'Daily, 10:30 am – 10 pm',
780
+			"geodir_contact" => '(111) 111-0000',
781
+			"geodir_email" => '[email protected]',
782
+			"geodir_website" => 'http://embassysuites1.hilton.com/en_US/es/hotel/PHLDTES-Embassy-Suites-Philadelphia-Center-City-Pennsylvania/index.do',
783
+			"geodir_twitter" => 'http://twitter.com/embassysuites1',
784
+			"geodir_facebook" => 'http://facebook.com/embassysuites1',
785
+			"post_dummy" => '1'
786
+		);
787
+
788
+		////post end///
789
+		/// Hotels ////post start 2///
790
+
791
+		break;
792
+	case 13:
793
+
794
+		$image_array = array();
795
+		$post_meta = array();
796
+
797
+		/// Hotels ////post start 3///
798
+		$image_array[] = "$dummy_image_url/hotels10.jpg";
799
+		$image_array[] = "$dummy_image_url/hotels11.jpg";
800
+		$image_array[] = "$dummy_image_url/hotels12.jpg";
801
+		$image_array[] = "$dummy_image_url/hotels4.jpg";
802
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
803
+		$image_array[] = "$dummy_image_url/hotels6.jpg";
804
+		$image_array[] = "$dummy_image_url/hotels7.jpg";
805
+		$image_array[] = "$dummy_image_url/hotels8.jpg";
806
+		$image_array[] = "$dummy_image_url/hotels9.jpg";
807
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
808
+		$image_array[] = "$dummy_image_url/hotels2.jpg";
809
+
810
+		$post_info[] = array(
811
+			"listing_type" => $post_type,
812
+			"post_title" => 'Doubletree Hotel Philadelphia',
813
+			"post_desc" => '
814 814
 	With 434 rooms, the Doubletree Hotel is a great option for your upcoming stay in Philadelphia.
815 815
 	
816 816
 	<h3>Location </h3>
@@ -840,47 +840,47 @@  discard block
 block discarded – undo
840 840
 	Stop in the restaurant - which serves lunch and dinner daily - for a drink and some light fare. With its location right on Broad Street, you&acute;re close to everything you could ever want in a night on the town.
841 841
 	',
842 842
 
843
-            "post_images" => $image_array,
844
-
845
-            "post_category" => array($post_type.'category' => array('Hotels')),
846
-            "post_tags" => array(''),
847
-            "geodir_video" => '',
848
-            "geodir_timing" => 'Daily, 10:30 am – 10 pm',
849
-            "geodir_contact" => '(111) 111-0000',
850
-            "geodir_email" => '[email protected]',
851
-            "geodir_website" => 'http://doubletree1.hilton.com/en_US/dt/hotel/PHLBLDT-Doubletree-Hotel-Philadelphia-Pennsylvania/index.do',
852
-            "geodir_twitter" => 'http://twitter.com/doubletree1',
853
-            "geodir_facebook" => 'http://facebook.com/doubletree1',
854
-            "post_dummy" => '1'
855
-        );
856
-
857
-        ////post end///
858
-        /// Hotels ////post start 3///
859
-
860
-        break;
861
-    case 14:
862
-
863
-
864
-        $image_array = array();
865
-        $post_meta = array();
866
-
867
-        /// Hotels ////post start 4///
868
-        $image_array[] = "$dummy_image_url/hotels15.jpg";
869
-        $image_array[] = "$dummy_image_url/hotels16.jpg";
870
-        $image_array[] = "$dummy_image_url/hotels12.jpg";
871
-        $image_array[] = "$dummy_image_url/hotels4.jpg";
872
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
873
-        $image_array[] = "$dummy_image_url/hotels6.jpg";
874
-        $image_array[] = "$dummy_image_url/hotels7.jpg";
875
-        $image_array[] = "$dummy_image_url/hotels8.jpg";
876
-        $image_array[] = "$dummy_image_url/hotels9.jpg";
877
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
878
-        $image_array[] = "$dummy_image_url/hotels2.jpg";
879
-
880
-        $post_info[] = array(
881
-            "listing_type" => $post_type,
882
-            "post_title" => 'Philadelphia Marriott Downtown',
883
-            "post_desc" => '
843
+			"post_images" => $image_array,
844
+
845
+			"post_category" => array($post_type.'category' => array('Hotels')),
846
+			"post_tags" => array(''),
847
+			"geodir_video" => '',
848
+			"geodir_timing" => 'Daily, 10:30 am – 10 pm',
849
+			"geodir_contact" => '(111) 111-0000',
850
+			"geodir_email" => '[email protected]',
851
+			"geodir_website" => 'http://doubletree1.hilton.com/en_US/dt/hotel/PHLBLDT-Doubletree-Hotel-Philadelphia-Pennsylvania/index.do',
852
+			"geodir_twitter" => 'http://twitter.com/doubletree1',
853
+			"geodir_facebook" => 'http://facebook.com/doubletree1',
854
+			"post_dummy" => '1'
855
+		);
856
+
857
+		////post end///
858
+		/// Hotels ////post start 3///
859
+
860
+		break;
861
+	case 14:
862
+
863
+
864
+		$image_array = array();
865
+		$post_meta = array();
866
+
867
+		/// Hotels ////post start 4///
868
+		$image_array[] = "$dummy_image_url/hotels15.jpg";
869
+		$image_array[] = "$dummy_image_url/hotels16.jpg";
870
+		$image_array[] = "$dummy_image_url/hotels12.jpg";
871
+		$image_array[] = "$dummy_image_url/hotels4.jpg";
872
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
873
+		$image_array[] = "$dummy_image_url/hotels6.jpg";
874
+		$image_array[] = "$dummy_image_url/hotels7.jpg";
875
+		$image_array[] = "$dummy_image_url/hotels8.jpg";
876
+		$image_array[] = "$dummy_image_url/hotels9.jpg";
877
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
878
+		$image_array[] = "$dummy_image_url/hotels2.jpg";
879
+
880
+		$post_info[] = array(
881
+			"listing_type" => $post_type,
882
+			"post_title" => 'Philadelphia Marriott Downtown',
883
+			"post_desc" => '
884 884
 	Get ready to stay and play at the new aloft Philadelphia Airport!
885 885
 	
886 886
 	This incredibly modern hotel is located just five minutes from Philadelphia International Airport, offering a great convenience to travelers looking for fresh and fun accommodations.
@@ -907,45 +907,45 @@  discard block
 block discarded – undo
907 907
 	
908 908
 	Aahh…breathe deep at Aloft. This hotel is smoke-free.
909 909
 	',
910
-            "post_images" => $image_array,
911
-            "post_category" => array($post_type.'category' => array('Hotels', 'Feature')),
912
-            "post_tags" => array(''),
913
-            "geodir_video" => '',
914
-            "geodir_timing" => '24 Hours',
915
-            "geodir_contact" => '(123) 111-2222',
916
-            "geodir_email" => '[email protected]',
917
-            "geodir_website" => 'http://www.marriott.com/hotels/travel/phldt-philadelphia-marriott-downtown/',
918
-            "geodir_twitter" => 'http://twitter.com/marriott',
919
-            "geodir_facebook" => 'http://facebook.com/marriott',
920
-            "post_dummy" => '1'
921
-        );
922
-
923
-        ////post end///
924
-        /// Hotels ////post start 4///
925
-        break;
926
-    case 15:
927
-
928
-
929
-        $image_array = array();
930
-        $post_meta = array();
931
-
932
-        /// Hotels ////post start 5///
933
-        $image_array[] = "$dummy_image_url/hotels10.jpg";
934
-        $image_array[] = "$dummy_image_url/hotels16.jpg";
935
-        $image_array[] = "$dummy_image_url/hotels12.jpg";
936
-        $image_array[] = "$dummy_image_url/hotels4.jpg";
937
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
938
-        $image_array[] = "$dummy_image_url/hotels6.jpg";
939
-        $image_array[] = "$dummy_image_url/hotels7.jpg";
940
-        $image_array[] = "$dummy_image_url/hotels8.jpg";
941
-        $image_array[] = "$dummy_image_url/hotels9.jpg";
942
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
943
-        $image_array[] = "$dummy_image_url/hotels2.jpg";
944
-
945
-        $post_info[] = array(
946
-            "listing_type" => $post_type,
947
-            "post_title" => 'Hilton Inn at Penn',
948
-            "post_desc" => '
910
+			"post_images" => $image_array,
911
+			"post_category" => array($post_type.'category' => array('Hotels', 'Feature')),
912
+			"post_tags" => array(''),
913
+			"geodir_video" => '',
914
+			"geodir_timing" => '24 Hours',
915
+			"geodir_contact" => '(123) 111-2222',
916
+			"geodir_email" => '[email protected]',
917
+			"geodir_website" => 'http://www.marriott.com/hotels/travel/phldt-philadelphia-marriott-downtown/',
918
+			"geodir_twitter" => 'http://twitter.com/marriott',
919
+			"geodir_facebook" => 'http://facebook.com/marriott',
920
+			"post_dummy" => '1'
921
+		);
922
+
923
+		////post end///
924
+		/// Hotels ////post start 4///
925
+		break;
926
+	case 15:
927
+
928
+
929
+		$image_array = array();
930
+		$post_meta = array();
931
+
932
+		/// Hotels ////post start 5///
933
+		$image_array[] = "$dummy_image_url/hotels10.jpg";
934
+		$image_array[] = "$dummy_image_url/hotels16.jpg";
935
+		$image_array[] = "$dummy_image_url/hotels12.jpg";
936
+		$image_array[] = "$dummy_image_url/hotels4.jpg";
937
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
938
+		$image_array[] = "$dummy_image_url/hotels6.jpg";
939
+		$image_array[] = "$dummy_image_url/hotels7.jpg";
940
+		$image_array[] = "$dummy_image_url/hotels8.jpg";
941
+		$image_array[] = "$dummy_image_url/hotels9.jpg";
942
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
943
+		$image_array[] = "$dummy_image_url/hotels2.jpg";
944
+
945
+		$post_info[] = array(
946
+			"listing_type" => $post_type,
947
+			"post_title" => 'Hilton Inn at Penn',
948
+			"post_desc" => '
949 949
 	Located in the heart of Penn&acute;s campus in the beautiful University City neighborhood of Philadelphia, The Hilton Inn at Penn is a great choice for accommodations during your upcoming visit to Philadelphia.
950 950
 	
951 951
 	The location puts you right in the middle of the prestigious University of Pennsylvania and its many nearby educational, medical and corporate centers. And Center City Philadelphia is only a short cab ride away. So if you want to get out and explore the city, you are set.
@@ -961,45 +961,45 @@  discard block
 block discarded – undo
961 961
 	
962 962
 	The pasta is handmade right in front of you and then dished up along side delectable entrées such as grilled veal tenderloin and honey glazed sea scallops. And the wine bar offers more than 30 varieties by the glass and more than 100 by the bottle.  
963 963
 	',
964
-            "post_images" => $image_array,
965
-            "post_category" => array($post_type.'category' => array('Hotels', 'Food Nightlife')),
966
-            "post_tags" => array(''),
967
-            "geodir_video" => '',
968
-            "geodir_timing" => 'Daily : 11 am to 11 pm',
969
-            "geodir_contact" => '(888) 888-8888',
970
-            "geodir_email" => '[email protected]',
971
-            "geodir_website" => 'http://www.theinnatpenn.com/',
972
-            "geodir_twitter" => 'http://twitter.com/theinnatpenn',
973
-            "geodir_facebook" => 'http://facebook.com/theinnatpenn',
974
-            "post_dummy" => '1'
975
-        );
976
-
977
-        ////post end///
978
-        /// Hotels ////post start 5///
979
-        break;
980
-    case 16:
981
-
982
-
983
-        $image_array = array();
984
-        $post_meta = array();
985
-
986
-        /// Hotels ////post start 6///
987
-        $image_array[] = "$dummy_image_url/hotels17.jpg";
988
-        $image_array[] = "$dummy_image_url/hotels18.jpg";
989
-        $image_array[] = "$dummy_image_url/hotels12.jpg";
990
-        $image_array[] = "$dummy_image_url/hotels4.jpg";
991
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
992
-        $image_array[] = "$dummy_image_url/hotels6.jpg";
993
-        $image_array[] = "$dummy_image_url/hotels7.jpg";
994
-        $image_array[] = "$dummy_image_url/hotels8.jpg";
995
-        $image_array[] = "$dummy_image_url/hotels9.jpg";
996
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
997
-        $image_array[] = "$dummy_image_url/hotels2.jpg";
998
-
999
-        $post_info[] = array(
1000
-            "listing_type" => $post_type,
1001
-            "post_title" => 'Courtyard Philadelphia Downtown',
1002
-            "post_desc" => '
964
+			"post_images" => $image_array,
965
+			"post_category" => array($post_type.'category' => array('Hotels', 'Food Nightlife')),
966
+			"post_tags" => array(''),
967
+			"geodir_video" => '',
968
+			"geodir_timing" => 'Daily : 11 am to 11 pm',
969
+			"geodir_contact" => '(888) 888-8888',
970
+			"geodir_email" => '[email protected]',
971
+			"geodir_website" => 'http://www.theinnatpenn.com/',
972
+			"geodir_twitter" => 'http://twitter.com/theinnatpenn',
973
+			"geodir_facebook" => 'http://facebook.com/theinnatpenn',
974
+			"post_dummy" => '1'
975
+		);
976
+
977
+		////post end///
978
+		/// Hotels ////post start 5///
979
+		break;
980
+	case 16:
981
+
982
+
983
+		$image_array = array();
984
+		$post_meta = array();
985
+
986
+		/// Hotels ////post start 6///
987
+		$image_array[] = "$dummy_image_url/hotels17.jpg";
988
+		$image_array[] = "$dummy_image_url/hotels18.jpg";
989
+		$image_array[] = "$dummy_image_url/hotels12.jpg";
990
+		$image_array[] = "$dummy_image_url/hotels4.jpg";
991
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
992
+		$image_array[] = "$dummy_image_url/hotels6.jpg";
993
+		$image_array[] = "$dummy_image_url/hotels7.jpg";
994
+		$image_array[] = "$dummy_image_url/hotels8.jpg";
995
+		$image_array[] = "$dummy_image_url/hotels9.jpg";
996
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
997
+		$image_array[] = "$dummy_image_url/hotels2.jpg";
998
+
999
+		$post_info[] = array(
1000
+			"listing_type" => $post_type,
1001
+			"post_title" => 'Courtyard Philadelphia Downtown',
1002
+			"post_desc" => '
1003 1003
 	<h3>Overview </h3>
1004 1004
 	
1005 1005
 	The Philadelphia Downtown Courtyard opened it&acute;s doors after a grand $75 million restoration, recapturing the grandeur of its 1926 origins while incorporating state of the art systems throughout.
@@ -1029,45 +1029,45 @@  discard block
 block discarded – undo
1029 1029
 	
1030 1030
 	Recently featured on WE TV&acute;s “My Fair Wedding”, the Courtyard Marriott Philadelphia is one of the city&acute;s leading venues for corporate and social affairs with over 10,000 sq ft of flexible meeting space, including two Grand Ballrooms each with over 3,000 square feet accommodating up to 250 people. In addition, the hotel has a total of 11 meeting rooms making it an ideal home for all occasions. The hotel boasts an experienced full-service Event and Culinary Teams, ready to take care of all the details and ensure your event is not only a success, but a lasting memory. 
1031 1031
 	',
1032
-            "post_images" => $image_array,
1033
-            "post_category" => array($post_type.'category' => array('Hotels', 'Food Nightlife')),
1034
-            "post_tags" => array(''),
1035
-            "geodir_video" => '',
1036
-            "geodir_timing" => 'Daily : 11 am to 11 pm',
1037
-            "geodir_contact" => '(888) 888-8888',
1038
-            "geodir_email" => '[email protected]',
1039
-            "geodir_website" => 'http://www.theinnatpenn.com/',
1040
-            "geodir_twitter" => 'http://twitter.com/theinnatpenn',
1041
-            "geodir_facebook" => 'http://facebook.com/theinnatpenn',
1042
-            "post_dummy" => '1'
1043
-        );
1044
-
1045
-        ////post end///
1046
-        /// Hotels ////post start 6///
1047
-
1048
-        break;
1049
-    case 17:
1050
-
1051
-        $image_array = array();
1052
-        $post_meta = array();
1053
-
1054
-        /// Hotels ////post start 7///
1055
-        $image_array[] = "$dummy_image_url/hotels11.jpg";
1056
-        $image_array[] = "$dummy_image_url/hotels10.jpg";
1057
-        $image_array[] = "$dummy_image_url/hotels12.jpg";
1058
-        $image_array[] = "$dummy_image_url/hotels4.jpg";
1059
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
1060
-        $image_array[] = "$dummy_image_url/hotels6.jpg";
1061
-        $image_array[] = "$dummy_image_url/hotels7.jpg";
1062
-        $image_array[] = "$dummy_image_url/hotels8.jpg";
1063
-        $image_array[] = "$dummy_image_url/hotels9.jpg";
1064
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
1065
-        $image_array[] = "$dummy_image_url/hotels2.jpg";
1066
-
1067
-        $post_info[] = array(
1068
-            "listing_type" => $post_type,
1069
-            "post_title" => 'Four Seasons Philadelphia',
1070
-            "post_desc" => '
1032
+			"post_images" => $image_array,
1033
+			"post_category" => array($post_type.'category' => array('Hotels', 'Food Nightlife')),
1034
+			"post_tags" => array(''),
1035
+			"geodir_video" => '',
1036
+			"geodir_timing" => 'Daily : 11 am to 11 pm',
1037
+			"geodir_contact" => '(888) 888-8888',
1038
+			"geodir_email" => '[email protected]',
1039
+			"geodir_website" => 'http://www.theinnatpenn.com/',
1040
+			"geodir_twitter" => 'http://twitter.com/theinnatpenn',
1041
+			"geodir_facebook" => 'http://facebook.com/theinnatpenn',
1042
+			"post_dummy" => '1'
1043
+		);
1044
+
1045
+		////post end///
1046
+		/// Hotels ////post start 6///
1047
+
1048
+		break;
1049
+	case 17:
1050
+
1051
+		$image_array = array();
1052
+		$post_meta = array();
1053
+
1054
+		/// Hotels ////post start 7///
1055
+		$image_array[] = "$dummy_image_url/hotels11.jpg";
1056
+		$image_array[] = "$dummy_image_url/hotels10.jpg";
1057
+		$image_array[] = "$dummy_image_url/hotels12.jpg";
1058
+		$image_array[] = "$dummy_image_url/hotels4.jpg";
1059
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
1060
+		$image_array[] = "$dummy_image_url/hotels6.jpg";
1061
+		$image_array[] = "$dummy_image_url/hotels7.jpg";
1062
+		$image_array[] = "$dummy_image_url/hotels8.jpg";
1063
+		$image_array[] = "$dummy_image_url/hotels9.jpg";
1064
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
1065
+		$image_array[] = "$dummy_image_url/hotels2.jpg";
1066
+
1067
+		$post_info[] = array(
1068
+			"listing_type" => $post_type,
1069
+			"post_title" => 'Four Seasons Philadelphia',
1070
+			"post_desc" => '
1071 1071
 	<h3>Overview </h3>
1072 1072
 	
1073 1073
 	The Philadelphia Downtown Courtyard opened it&acute;s doors after a grand $75 million restoration, recapturing the grandeur of its 1926 origins while incorporating state of the art systems throughout.
@@ -1097,45 +1097,45 @@  discard block
 block discarded – undo
1097 1097
 	
1098 1098
 	Recently featured on WE TV&acute;s “My Fair Wedding”, the Courtyard Marriott Philadelphia is one of the city&acute;s leading venues for corporate and social affairs with over 10,000 sq ft of flexible meeting space, including two Grand Ballrooms each with over 3,000 square feet accommodating up to 250 people. In addition, the hotel has a total of 11 meeting rooms making it an ideal home for all occasions. The hotel boasts an experienced full-service Event and Culinary Teams, ready to take care of all the details and ensure your event is not only a success, but a lasting memory. 
1099 1099
 	',
1100
-            "post_images" => $image_array,
1101
-            "post_category" => array($post_type.'category' => array('Hotels', 'Food Nightlife')),
1102
-            "post_tags" => array(''),
1103
-            "geodir_video" => '',
1104
-            "geodir_timing" => 'Daily : 11 am to 11 pm',
1105
-            "geodir_contact" => '(143) 888-8888',
1106
-            "geodir_email" => '[email protected]',
1107
-            "geodir_website" => 'http://www.fourseasons.com/philadelphia/',
1108
-            "geodir_twitter" => 'http://twitter.com/fourseasons',
1109
-            "geodir_facebook" => 'http://facebook.com/fourseasons',
1110
-            "post_dummy" => '1'
1111
-        );
1112
-
1113
-        ////post end///
1114
-        /// Hotels ////post start 7///
1115
-        break;
1116
-    case 18:
1117
-
1118
-
1119
-        $image_array = array();
1120
-        $post_meta = array();
1121
-
1122
-        /// Hotels ////post start 8///
1123
-        $image_array[] = "$dummy_image_url/hotels11.jpg";
1124
-        $image_array[] = "$dummy_image_url/hotels10.jpg";
1125
-        $image_array[] = "$dummy_image_url/hotels12.jpg";
1126
-        $image_array[] = "$dummy_image_url/hotels4.jpg";
1127
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
1128
-        $image_array[] = "$dummy_image_url/hotels6.jpg";
1129
-        $image_array[] = "$dummy_image_url/hotels7.jpg";
1130
-        $image_array[] = "$dummy_image_url/hotels8.jpg";
1131
-        $image_array[] = "$dummy_image_url/hotels9.jpg";
1132
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
1133
-        $image_array[] = "$dummy_image_url/hotels2.jpg";
1134
-
1135
-        $post_info[] = array(
1136
-            "listing_type" => $post_type,
1137
-            "post_title" => 'Alexander Inn',
1138
-            "post_desc" => '
1100
+			"post_images" => $image_array,
1101
+			"post_category" => array($post_type.'category' => array('Hotels', 'Food Nightlife')),
1102
+			"post_tags" => array(''),
1103
+			"geodir_video" => '',
1104
+			"geodir_timing" => 'Daily : 11 am to 11 pm',
1105
+			"geodir_contact" => '(143) 888-8888',
1106
+			"geodir_email" => '[email protected]',
1107
+			"geodir_website" => 'http://www.fourseasons.com/philadelphia/',
1108
+			"geodir_twitter" => 'http://twitter.com/fourseasons',
1109
+			"geodir_facebook" => 'http://facebook.com/fourseasons',
1110
+			"post_dummy" => '1'
1111
+		);
1112
+
1113
+		////post end///
1114
+		/// Hotels ////post start 7///
1115
+		break;
1116
+	case 18:
1117
+
1118
+
1119
+		$image_array = array();
1120
+		$post_meta = array();
1121
+
1122
+		/// Hotels ////post start 8///
1123
+		$image_array[] = "$dummy_image_url/hotels11.jpg";
1124
+		$image_array[] = "$dummy_image_url/hotels10.jpg";
1125
+		$image_array[] = "$dummy_image_url/hotels12.jpg";
1126
+		$image_array[] = "$dummy_image_url/hotels4.jpg";
1127
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
1128
+		$image_array[] = "$dummy_image_url/hotels6.jpg";
1129
+		$image_array[] = "$dummy_image_url/hotels7.jpg";
1130
+		$image_array[] = "$dummy_image_url/hotels8.jpg";
1131
+		$image_array[] = "$dummy_image_url/hotels9.jpg";
1132
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
1133
+		$image_array[] = "$dummy_image_url/hotels2.jpg";
1134
+
1135
+		$post_info[] = array(
1136
+			"listing_type" => $post_type,
1137
+			"post_title" => 'Alexander Inn',
1138
+			"post_desc" => '
1139 1139
 	The Alexander Inn is one of Philadelphia&acute;s most popular and reasonably priced small hotels.
1140 1140
 	
1141 1141
 	Conveniently located in the heart of the Washington Square West neighborhood in Center City Philadelphia, the Alexander Inn is a great place to base your stay in Philadelphia.
@@ -1144,45 +1144,45 @@  discard block
 block discarded – undo
1144 1144
 	
1145 1145
 	Rooms are also fitted with DirecTV (including many complimentary channels like CNN, ESPN, eight movie channels, etc.) and telephones with modem ports and direct dial. You will also have access to the hotel&acute;s free 24-hour fitness and e-mail centers.  
1146 1146
 	',
1147
-            "post_images" => $image_array,
1148
-            "post_category" => array($post_type.'category' => array('Hotels')),
1149
-            "post_tags" => array(''),
1150
-            "geodir_video" => '',
1151
-            "geodir_timing" => 'Daily : 11 am to 11 pm',
1152
-            "geodir_contact" => '(143) 888-8888',
1153
-            "geodir_email" => '[email protected]',
1154
-            "geodir_website" => 'http://www.alexanderinn.com/',
1155
-            "geodir_twitter" => 'http://twitter.com/alexanderinn',
1156
-            "geodir_facebook" => 'http://facebook.com/alexanderinn',
1157
-            "post_dummy" => '1'
1158
-        );
1159
-
1160
-        ////post end///
1161
-        /// Hotels ////post start 8///
1162
-        break;
1163
-    case 19:
1164
-
1165
-
1166
-        $image_array = array();
1167
-        $post_meta = array();
1168
-
1169
-        /// Hotels ////post start 9///
1170
-        $image_array[] = "$dummy_image_url/hotels5.jpg";
1171
-        $image_array[] = "$dummy_image_url/hotels10.jpg";
1172
-        $image_array[] = "$dummy_image_url/hotels12.jpg";
1173
-        $image_array[] = "$dummy_image_url/hotels4.jpg";
1174
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
1175
-        $image_array[] = "$dummy_image_url/hotels6.jpg";
1176
-        $image_array[] = "$dummy_image_url/hotels7.jpg";
1177
-        $image_array[] = "$dummy_image_url/hotels8.jpg";
1178
-        $image_array[] = "$dummy_image_url/hotels9.jpg";
1179
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
1180
-        $image_array[] = "$dummy_image_url/hotels2.jpg";
1181
-
1182
-        $post_info[] = array(
1183
-            "listing_type" => $post_type,
1184
-            "post_title" => 'Best Western Center City Hotel',
1185
-            "post_desc" => '
1147
+			"post_images" => $image_array,
1148
+			"post_category" => array($post_type.'category' => array('Hotels')),
1149
+			"post_tags" => array(''),
1150
+			"geodir_video" => '',
1151
+			"geodir_timing" => 'Daily : 11 am to 11 pm',
1152
+			"geodir_contact" => '(143) 888-8888',
1153
+			"geodir_email" => '[email protected]',
1154
+			"geodir_website" => 'http://www.alexanderinn.com/',
1155
+			"geodir_twitter" => 'http://twitter.com/alexanderinn',
1156
+			"geodir_facebook" => 'http://facebook.com/alexanderinn',
1157
+			"post_dummy" => '1'
1158
+		);
1159
+
1160
+		////post end///
1161
+		/// Hotels ////post start 8///
1162
+		break;
1163
+	case 19:
1164
+
1165
+
1166
+		$image_array = array();
1167
+		$post_meta = array();
1168
+
1169
+		/// Hotels ////post start 9///
1170
+		$image_array[] = "$dummy_image_url/hotels5.jpg";
1171
+		$image_array[] = "$dummy_image_url/hotels10.jpg";
1172
+		$image_array[] = "$dummy_image_url/hotels12.jpg";
1173
+		$image_array[] = "$dummy_image_url/hotels4.jpg";
1174
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
1175
+		$image_array[] = "$dummy_image_url/hotels6.jpg";
1176
+		$image_array[] = "$dummy_image_url/hotels7.jpg";
1177
+		$image_array[] = "$dummy_image_url/hotels8.jpg";
1178
+		$image_array[] = "$dummy_image_url/hotels9.jpg";
1179
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
1180
+		$image_array[] = "$dummy_image_url/hotels2.jpg";
1181
+
1182
+		$post_info[] = array(
1183
+			"listing_type" => $post_type,
1184
+			"post_title" => 'Best Western Center City Hotel',
1185
+			"post_desc" => '
1186 1186
 	The Alexander Inn is one of Philadelphia&acute;s most popular and reasonably priced small hotels.
1187 1187
 	
1188 1188
 	Conveniently located in the heart of the Washington Square West neighborhood in Center City Philadelphia, the Alexander Inn is a great place to base your stay in Philadelphia.
@@ -1191,91 +1191,91 @@  discard block
 block discarded – undo
1191 1191
 	
1192 1192
 	Rooms are also fitted with DirecTV (including many complimentary channels like CNN, ESPN, eight movie channels, etc.) and telephones with modem ports and direct dial. You will also have access to the hotel&acute;s free 24-hour fitness and e-mail centers.  
1193 1193
 	',
1194
-            "post_images" => $image_array,
1195
-            "post_category" => array($post_type.'category' => array('Hotels', 'Food Nightlife')),
1196
-            "post_tags" => array(''),
1197
-            "geodir_video" => '',
1198
-            "geodir_timing" => 'Daily : 10 am to 11 pm',
1199
-            "geodir_contact" => '(243) 222-12344',
1200
-            "geodir_email" => '[email protected]',
1201
-            "geodir_website" => 'http://book.bestwestern.com/bestwestern/productInfo.do?propertyCode=39087',
1202
-            "geodir_twitter" => 'http://twitter.com/bestwestern',
1203
-            "geodir_facebook" => 'http://facebook.com/bestwestern',
1204
-            "post_dummy" => '1'
1205
-        );
1206
-
1207
-        ////post end///
1208
-        /// Hotels ////post start 9///
1209
-        break;
1210
-    case 20:
1211
-
1212
-
1213
-        $image_array = array();
1214
-        $post_meta = array();
1215
-
1216
-        /// Hotels ////post start 10///
1217
-        $image_array[] = "$dummy_image_url/hotels7.jpg";
1218
-        $image_array[] = "$dummy_image_url/hotels10.jpg";
1219
-        $image_array[] = "$dummy_image_url/hotels12.jpg";
1220
-        $image_array[] = "$dummy_image_url/hotels4.jpg";
1221
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
1222
-        $image_array[] = "$dummy_image_url/hotels6.jpg";
1223
-        $image_array[] = "$dummy_image_url/hotels12.jpg";
1224
-        $image_array[] = "$dummy_image_url/hotels8.jpg";
1225
-        $image_array[] = "$dummy_image_url/hotels9.jpg";
1226
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
1227
-        $image_array[] = "$dummy_image_url/hotels2.jpg";
1228
-
1229
-        $post_info[] = array(
1230
-            "listing_type" => $post_type,
1231
-            "post_title" => 'Chestnut Hill Hotel',
1232
-            "post_desc" => '
1194
+			"post_images" => $image_array,
1195
+			"post_category" => array($post_type.'category' => array('Hotels', 'Food Nightlife')),
1196
+			"post_tags" => array(''),
1197
+			"geodir_video" => '',
1198
+			"geodir_timing" => 'Daily : 10 am to 11 pm',
1199
+			"geodir_contact" => '(243) 222-12344',
1200
+			"geodir_email" => '[email protected]',
1201
+			"geodir_website" => 'http://book.bestwestern.com/bestwestern/productInfo.do?propertyCode=39087',
1202
+			"geodir_twitter" => 'http://twitter.com/bestwestern',
1203
+			"geodir_facebook" => 'http://facebook.com/bestwestern',
1204
+			"post_dummy" => '1'
1205
+		);
1206
+
1207
+		////post end///
1208
+		/// Hotels ////post start 9///
1209
+		break;
1210
+	case 20:
1211
+
1212
+
1213
+		$image_array = array();
1214
+		$post_meta = array();
1215
+
1216
+		/// Hotels ////post start 10///
1217
+		$image_array[] = "$dummy_image_url/hotels7.jpg";
1218
+		$image_array[] = "$dummy_image_url/hotels10.jpg";
1219
+		$image_array[] = "$dummy_image_url/hotels12.jpg";
1220
+		$image_array[] = "$dummy_image_url/hotels4.jpg";
1221
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
1222
+		$image_array[] = "$dummy_image_url/hotels6.jpg";
1223
+		$image_array[] = "$dummy_image_url/hotels12.jpg";
1224
+		$image_array[] = "$dummy_image_url/hotels8.jpg";
1225
+		$image_array[] = "$dummy_image_url/hotels9.jpg";
1226
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
1227
+		$image_array[] = "$dummy_image_url/hotels2.jpg";
1228
+
1229
+		$post_info[] = array(
1230
+			"listing_type" => $post_type,
1231
+			"post_title" => 'Chestnut Hill Hotel',
1232
+			"post_desc" => '
1233 1233
 	The Chestnut Hill Hotel is located in the historic community of Chestnut Hill, approximately nine miles northwest from Center City Philadelphia. Although Chestnut Hill is close to Center City by today&acute;s standards, it was originally a distant “suburb” on the outskirts of the Philadelphia countryside.
1234 1234
 	
1235 1235
 	Today, it is one of the region&acute;s most charming neighborhoods. Tree-lined streets and grand estates surround its main street, Germantown Avenue, where you can stroll and shop at more than 200 specialty shops and restaurants, along with trendy salons and other modern boutiques.
1236 1236
 	
1237 1237
 	The Chestnut Hill Hotel fits perfectly in this setting - the hotel&acute;s 36 rooms and suites, decorated in an 18th-century style, hold the hotel to its boutique roots. It&acute;s a perfect place at which to enjoy a romantic getaway in Philadelphia. 
1238 1238
 	',
1239
-            "post_images" => $image_array,
1240
-            "post_category" => array($post_type.'category' => array('Hotels', 'Feature')),
1241
-            "post_tags" => array(''),
1242
-            "geodir_video" => '',
1243
-            "geodir_timing" => 'Daily : 10 am to 11 pm',
1244
-            "geodir_contact" => '(243) 222-12344',
1245
-            "geodir_email" => '[email protected]',
1246
-            "geodir_website" => 'http://www.chestnuthillhotel.com/',
1247
-            "geodir_twitter" => 'http://twitter.com/chestnuthillhotel',
1248
-            "geodir_facebook" => 'http://facebook.com/chestnuthillhotel',
1249
-            "post_dummy" => '1'
1250
-        );
1251
-
1252
-        ////post end///
1253
-        /// Hotels ////post start 10///
1254
-
1255
-        break;
1256
-    case 21:
1257
-
1258
-
1259
-        $image_array = array();
1260
-        $post_meta = array();
1261
-
1262
-        /// Restaurants ////post start 1//
1263
-        $image_array[] = "$dummy_image_url/restaurants1.jpg";
1264
-        $image_array[] = "$dummy_image_url/restaurants2.jpg";
1265
-        $image_array[] = "$dummy_image_url/restaurants3.jpg";
1266
-        $image_array[] = "$dummy_image_url/restaurants4.jpg";
1267
-        $image_array[] = "$dummy_image_url/restaurants5.jpg";
1268
-        $image_array[] = "$dummy_image_url/restaurants6.jpg";
1269
-        $image_array[] = "$dummy_image_url/restaurants7.jpg";
1270
-        $image_array[] = "$dummy_image_url/restaurants8.jpg";
1271
-        $image_array[] = "$dummy_image_url/restaurants9.jpg";
1272
-        $image_array[] = "$dummy_image_url/restaurants10.jpg";
1273
-        $image_array[] = "$dummy_image_url/restaurants11.jpg";
1274
-
1275
-        $post_info[] = array(
1276
-            "listing_type" => $post_type,
1277
-            "post_title" => 'Village Whiskey',
1278
-            "post_desc" => '
1239
+			"post_images" => $image_array,
1240
+			"post_category" => array($post_type.'category' => array('Hotels', 'Feature')),
1241
+			"post_tags" => array(''),
1242
+			"geodir_video" => '',
1243
+			"geodir_timing" => 'Daily : 10 am to 11 pm',
1244
+			"geodir_contact" => '(243) 222-12344',
1245
+			"geodir_email" => '[email protected]',
1246
+			"geodir_website" => 'http://www.chestnuthillhotel.com/',
1247
+			"geodir_twitter" => 'http://twitter.com/chestnuthillhotel',
1248
+			"geodir_facebook" => 'http://facebook.com/chestnuthillhotel',
1249
+			"post_dummy" => '1'
1250
+		);
1251
+
1252
+		////post end///
1253
+		/// Hotels ////post start 10///
1254
+
1255
+		break;
1256
+	case 21:
1257
+
1258
+
1259
+		$image_array = array();
1260
+		$post_meta = array();
1261
+
1262
+		/// Restaurants ////post start 1//
1263
+		$image_array[] = "$dummy_image_url/restaurants1.jpg";
1264
+		$image_array[] = "$dummy_image_url/restaurants2.jpg";
1265
+		$image_array[] = "$dummy_image_url/restaurants3.jpg";
1266
+		$image_array[] = "$dummy_image_url/restaurants4.jpg";
1267
+		$image_array[] = "$dummy_image_url/restaurants5.jpg";
1268
+		$image_array[] = "$dummy_image_url/restaurants6.jpg";
1269
+		$image_array[] = "$dummy_image_url/restaurants7.jpg";
1270
+		$image_array[] = "$dummy_image_url/restaurants8.jpg";
1271
+		$image_array[] = "$dummy_image_url/restaurants9.jpg";
1272
+		$image_array[] = "$dummy_image_url/restaurants10.jpg";
1273
+		$image_array[] = "$dummy_image_url/restaurants11.jpg";
1274
+
1275
+		$post_info[] = array(
1276
+			"listing_type" => $post_type,
1277
+			"post_title" => 'Village Whiskey',
1278
+			"post_desc" => '
1279 1279
 	
1280 1280
 	
1281 1281
 	Located in a Rittenhouse Square space evoking the free-wheeling spirit of a speakeasy, Village Whiskey is prolific Chef Jose Garces’ intimate, 30-seat tribute to the time-honored liquor.
@@ -1301,45 +1301,45 @@  discard block
 block discarded – undo
1301 1301
 	
1302 1302
 	During the warmer months, diners can sit at large, wooden tables placed along Sansom Street for whiskey alfresco.
1303 1303
 	',
1304
-            "post_images" => $image_array,
1305
-            "post_category" => array($post_type.'category' => array('Restaurants', 'Feature')),
1306
-            "post_tags" => array('Sample Tag1'),
1307
-            "geodir_video" => '',
1308
-            "geodir_timing" => 'Daily : 10 am to 11 pm',
1309
-            "geodir_contact" => '(243) 222-12344',
1310
-            "geodir_email" => '[email protected]',
1311
-            "geodir_website" => 'http://www.villagewhiskey.com/',
1312
-            "geodir_twitter" => 'http://twitter.com/villagewhiskey',
1313
-            "geodir_facebook" => 'http://facebook.com/villagewhiskey',
1314
-            "post_dummy" => '1'
1315
-        );
1316
-
1317
-        ////post end///
1318
-        /// Restaurants ////post start 1///
1319
-        break;
1320
-    case 22:
1321
-
1322
-
1323
-        $image_array = array();
1324
-        $post_meta = array();
1325
-
1326
-        /// Restaurants ////post start 2//
1327
-        $image_array[] = "$dummy_image_url/restaurants4.jpg";
1328
-        $image_array[] = "$dummy_image_url/restaurants2.jpg";
1329
-        $image_array[] = "$dummy_image_url/restaurants3.jpg";
1330
-        $image_array[] = "$dummy_image_url/restaurants1.jpg";
1331
-        $image_array[] = "$dummy_image_url/restaurants5.jpg";
1332
-        $image_array[] = "$dummy_image_url/restaurants6.jpg";
1333
-        $image_array[] = "$dummy_image_url/restaurants7.jpg";
1334
-        $image_array[] = "$dummy_image_url/restaurants8.jpg";
1335
-        $image_array[] = "$dummy_image_url/restaurants9.jpg";
1336
-        $image_array[] = "$dummy_image_url/restaurants10.jpg";
1337
-        $image_array[] = "$dummy_image_url/restaurants11.jpg";
1338
-
1339
-        $post_info[] = array(
1340
-            "listing_type" => $post_type,
1341
-            "post_title" => 'Zavino Pizzeria and Wine Bar',
1342
-            "post_desc" => '
1304
+			"post_images" => $image_array,
1305
+			"post_category" => array($post_type.'category' => array('Restaurants', 'Feature')),
1306
+			"post_tags" => array('Sample Tag1'),
1307
+			"geodir_video" => '',
1308
+			"geodir_timing" => 'Daily : 10 am to 11 pm',
1309
+			"geodir_contact" => '(243) 222-12344',
1310
+			"geodir_email" => '[email protected]',
1311
+			"geodir_website" => 'http://www.villagewhiskey.com/',
1312
+			"geodir_twitter" => 'http://twitter.com/villagewhiskey',
1313
+			"geodir_facebook" => 'http://facebook.com/villagewhiskey',
1314
+			"post_dummy" => '1'
1315
+		);
1316
+
1317
+		////post end///
1318
+		/// Restaurants ////post start 1///
1319
+		break;
1320
+	case 22:
1321
+
1322
+
1323
+		$image_array = array();
1324
+		$post_meta = array();
1325
+
1326
+		/// Restaurants ////post start 2//
1327
+		$image_array[] = "$dummy_image_url/restaurants4.jpg";
1328
+		$image_array[] = "$dummy_image_url/restaurants2.jpg";
1329
+		$image_array[] = "$dummy_image_url/restaurants3.jpg";
1330
+		$image_array[] = "$dummy_image_url/restaurants1.jpg";
1331
+		$image_array[] = "$dummy_image_url/restaurants5.jpg";
1332
+		$image_array[] = "$dummy_image_url/restaurants6.jpg";
1333
+		$image_array[] = "$dummy_image_url/restaurants7.jpg";
1334
+		$image_array[] = "$dummy_image_url/restaurants8.jpg";
1335
+		$image_array[] = "$dummy_image_url/restaurants9.jpg";
1336
+		$image_array[] = "$dummy_image_url/restaurants10.jpg";
1337
+		$image_array[] = "$dummy_image_url/restaurants11.jpg";
1338
+
1339
+		$post_info[] = array(
1340
+			"listing_type" => $post_type,
1341
+			"post_title" => 'Zavino Pizzeria and Wine Bar',
1342
+			"post_desc" => '
1343 1343
 	Zavino is a new pizzeria and wine bar located at the epicenter of the city&acute;s trendy Midtown Village neighborhood. The restaurant features a seasonal menu, classic cocktails, an approachable selection of wine and beer and some of the best late night menu offerings in the area.
1344 1344
 	
1345 1345
 	The restaurant&acute;s interior looks great - it has a simple, rustic feel with an original brick wall, large picture windows, a long bar and a large outdoor cafe coming this spring.
@@ -1358,46 +1358,46 @@  discard block
 block discarded – undo
1358 1358
 	
1359 1359
 	Pizzas vary in price from $8 to $12.
1360 1360
 	',
1361
-            "post_images" => $image_array,
1362
-            "post_category" => array($post_type.'category' => array('Restaurants')),
1363
-            "post_tags" => array('Sample Tag1'),
1364
-            "geodir_video" => '',
1365
-            "geodir_timing" => 'Daily : 10 am to 11 pm',
1366
-            "geodir_contact" => '(243) 222-12344',
1367
-            "geodir_email" => '[email protected]',
1368
-            "geodir_website" => 'http://www.villagewhiskey.com/',
1369
-            "geodir_twitter" => 'http://twitter.com/villagewhiskey',
1370
-            "geodir_facebook" => 'http://facebook.com/villagewhiskey',
1371
-            "post_dummy" => '1'
1372
-        );
1373
-
1374
-        ////post end///
1375
-        /// Restaurants ////post start 2///
1376
-
1377
-        break;
1378
-    case 23:
1379
-
1380
-
1381
-        $image_array = array();
1382
-        $post_meta = array();
1383
-
1384
-        /// Restaurants ////post start 3//
1385
-        $image_array[] = "$dummy_image_url/restaurants5.jpg";
1386
-        $image_array[] = "$dummy_image_url/restaurants6.jpg";
1387
-        $image_array[] = "$dummy_image_url/restaurants7.jpg";
1388
-        $image_array[] = "$dummy_image_url/restaurants1.jpg";
1389
-        $image_array[] = "$dummy_image_url/restaurants2.jpg";
1390
-        $image_array[] = "$dummy_image_url/restaurants3.jpg";
1391
-        $image_array[] = "$dummy_image_url/restaurants4.jpg";
1392
-        $image_array[] = "$dummy_image_url/restaurants8.jpg";
1393
-        $image_array[] = "$dummy_image_url/restaurants9.jpg";
1394
-        $image_array[] = "$dummy_image_url/restaurants10.jpg";
1395
-        $image_array[] = "$dummy_image_url/restaurants11.jpg";
1396
-
1397
-        $post_info[] = array(
1398
-            "listing_type" => $post_type,
1399
-            "post_title" => 'Parc',
1400
-            "post_desc" => '
1361
+			"post_images" => $image_array,
1362
+			"post_category" => array($post_type.'category' => array('Restaurants')),
1363
+			"post_tags" => array('Sample Tag1'),
1364
+			"geodir_video" => '',
1365
+			"geodir_timing" => 'Daily : 10 am to 11 pm',
1366
+			"geodir_contact" => '(243) 222-12344',
1367
+			"geodir_email" => '[email protected]',
1368
+			"geodir_website" => 'http://www.villagewhiskey.com/',
1369
+			"geodir_twitter" => 'http://twitter.com/villagewhiskey',
1370
+			"geodir_facebook" => 'http://facebook.com/villagewhiskey',
1371
+			"post_dummy" => '1'
1372
+		);
1373
+
1374
+		////post end///
1375
+		/// Restaurants ////post start 2///
1376
+
1377
+		break;
1378
+	case 23:
1379
+
1380
+
1381
+		$image_array = array();
1382
+		$post_meta = array();
1383
+
1384
+		/// Restaurants ////post start 3//
1385
+		$image_array[] = "$dummy_image_url/restaurants5.jpg";
1386
+		$image_array[] = "$dummy_image_url/restaurants6.jpg";
1387
+		$image_array[] = "$dummy_image_url/restaurants7.jpg";
1388
+		$image_array[] = "$dummy_image_url/restaurants1.jpg";
1389
+		$image_array[] = "$dummy_image_url/restaurants2.jpg";
1390
+		$image_array[] = "$dummy_image_url/restaurants3.jpg";
1391
+		$image_array[] = "$dummy_image_url/restaurants4.jpg";
1392
+		$image_array[] = "$dummy_image_url/restaurants8.jpg";
1393
+		$image_array[] = "$dummy_image_url/restaurants9.jpg";
1394
+		$image_array[] = "$dummy_image_url/restaurants10.jpg";
1395
+		$image_array[] = "$dummy_image_url/restaurants11.jpg";
1396
+
1397
+		$post_info[] = array(
1398
+			"listing_type" => $post_type,
1399
+			"post_title" => 'Parc',
1400
+			"post_desc" => '
1401 1401
 	If you love Paris in the springtime, Parc is a veritable grand cru.
1402 1402
 	
1403 1403
 	With Parc, famed restaurateur Stephen Starr brings a certain je ne sais quoi to Rittenhouse Square. Parc offers an authentic French bistro experience, fully equipped with a chic Parisian ambiance and gorgeous sidewalk seating overlooking the Square.
@@ -1425,45 +1425,45 @@  discard block
 block discarded – undo
1425 1425
 	
1426 1426
 	To put it simply, Parc is nothing short of an authentic Parisian dining experience - right here in the heart of Rittenhouse Square.
1427 1427
 	',
1428
-            "post_images" => $image_array,
1429
-            "post_category" => array($post_type.'category' => array('Restaurants')),
1430
-            "post_tags" => array('Sample Tag1'),
1431
-            "geodir_video" => '',
1432
-            "geodir_timing" => 'Daily : 10 am to 12 pm',
1433
-            "geodir_contact" => '(143) 222-12344',
1434
-            "geodir_email" => '[email protected]',
1435
-            "geodir_website" => 'http://www.parc-restaurant.com/',
1436
-            "geodir_twitter" => 'http://twitter.com/parc-restaurant',
1437
-            "geodir_facebook" => 'http://facebook.com/parc-restaurant',
1438
-            "post_dummy" => '1'
1439
-        );
1440
-
1441
-        ////post end///
1442
-        /// Restaurants ////post start 3///
1443
-        break;
1444
-    case 24:
1445
-
1446
-
1447
-        $image_array = array();
1448
-        $post_meta = array();
1449
-
1450
-        /// Restaurants ////post start 4//
1451
-        $image_array[] = "$dummy_image_url/restaurants9.jpg";
1452
-        $image_array[] = "$dummy_image_url/restaurants10.jpg";
1453
-        $image_array[] = "$dummy_image_url/restaurants3.jpg";
1454
-        $image_array[] = "$dummy_image_url/restaurants1.jpg";
1455
-        $image_array[] = "$dummy_image_url/restaurants5.jpg";
1456
-        $image_array[] = "$dummy_image_url/restaurants6.jpg";
1457
-        $image_array[] = "$dummy_image_url/restaurants7.jpg";
1458
-        $image_array[] = "$dummy_image_url/restaurants8.jpg";
1459
-        $image_array[] = "$dummy_image_url/restaurants9.jpg";
1460
-        $image_array[] = "$dummy_image_url/restaurants2.jpg";
1461
-        $image_array[] = "$dummy_image_url/restaurants4.jpg";
1462
-
1463
-        $post_info[] = array(
1464
-            "listing_type" => $post_type,
1465
-            "post_title" => 'Percy Street Barbecue',
1466
-            "post_desc" => '
1428
+			"post_images" => $image_array,
1429
+			"post_category" => array($post_type.'category' => array('Restaurants')),
1430
+			"post_tags" => array('Sample Tag1'),
1431
+			"geodir_video" => '',
1432
+			"geodir_timing" => 'Daily : 10 am to 12 pm',
1433
+			"geodir_contact" => '(143) 222-12344',
1434
+			"geodir_email" => '[email protected]',
1435
+			"geodir_website" => 'http://www.parc-restaurant.com/',
1436
+			"geodir_twitter" => 'http://twitter.com/parc-restaurant',
1437
+			"geodir_facebook" => 'http://facebook.com/parc-restaurant',
1438
+			"post_dummy" => '1'
1439
+		);
1440
+
1441
+		////post end///
1442
+		/// Restaurants ////post start 3///
1443
+		break;
1444
+	case 24:
1445
+
1446
+
1447
+		$image_array = array();
1448
+		$post_meta = array();
1449
+
1450
+		/// Restaurants ////post start 4//
1451
+		$image_array[] = "$dummy_image_url/restaurants9.jpg";
1452
+		$image_array[] = "$dummy_image_url/restaurants10.jpg";
1453
+		$image_array[] = "$dummy_image_url/restaurants3.jpg";
1454
+		$image_array[] = "$dummy_image_url/restaurants1.jpg";
1455
+		$image_array[] = "$dummy_image_url/restaurants5.jpg";
1456
+		$image_array[] = "$dummy_image_url/restaurants6.jpg";
1457
+		$image_array[] = "$dummy_image_url/restaurants7.jpg";
1458
+		$image_array[] = "$dummy_image_url/restaurants8.jpg";
1459
+		$image_array[] = "$dummy_image_url/restaurants9.jpg";
1460
+		$image_array[] = "$dummy_image_url/restaurants2.jpg";
1461
+		$image_array[] = "$dummy_image_url/restaurants4.jpg";
1462
+
1463
+		$post_info[] = array(
1464
+			"listing_type" => $post_type,
1465
+			"post_title" => 'Percy Street Barbecue',
1466
+			"post_desc" => '
1467 1467
 	Percy Street Barbecue sees the South Street debut of restaurateurs Steven Cook and Michael Solomonov (Zahav, Xochitl).
1468 1468
 	
1469 1469
 	Serving a straightforward selection of slowly smoked meats and homey side dishes alongside craft beers and tasty cocktails, Percy Street is an ideal venue for Chef Erin OShea much-lauded Southern cooking, and is on its way to become the city top spot for barbecue.
@@ -1489,46 +1489,46 @@  discard block
 block discarded – undo
1489 1489
 	
1490 1490
 	Seating in the form of repurposed church pews, and bare light bulbs overhead in the dining room lend to the restaurant Texas-esque aesthetic.
1491 1491
 	',
1492
-            "post_images" => $image_array,
1493
-            "post_category" => array($post_type.'category' => array('Restaurants', 'Feature')),
1494
-            "post_tags" => array('Sample Tag1'),
1495
-            "geodir_video" => '',
1496
-            "geodir_timing" => 'Percy Street is closed on Mondays. The restaurant is also open for weekend lunch/brunch from 11:30 a.m. to 2:30 p.m.',
1497
-            "geodir_contact" => '(143) 222-12344',
1498
-            "geodir_email" => '[email protected]',
1499
-            "geodir_website" => 'http://www.percystreet.com/',
1500
-            "geodir_twitter" => 'http://twitter.com/percystreet',
1501
-            "geodir_facebook" => 'http://facebook.com/percystreet',
1502
-            "post_dummy" => '1'
1503
-        );
1504
-
1505
-        ////post end///
1506
-        /// Restaurants ////post start 4///
1507
-
1508
-        break;
1509
-    case 25:
1510
-
1511
-
1512
-        $image_array = array();
1513
-        $post_meta = array();
1514
-
1515
-        /// Restaurants ////post start 5//
1516
-        $image_array[] = "$dummy_image_url/restaurants4.jpg";
1517
-        $image_array[] = "$dummy_image_url/restaurants10.jpg";
1518
-        $image_array[] = "$dummy_image_url/restaurants3.jpg";
1519
-        $image_array[] = "$dummy_image_url/restaurants1.jpg";
1520
-        $image_array[] = "$dummy_image_url/restaurants5.jpg";
1521
-        $image_array[] = "$dummy_image_url/restaurants6.jpg";
1522
-        $image_array[] = "$dummy_image_url/restaurants7.jpg";
1523
-        $image_array[] = "$dummy_image_url/restaurants8.jpg";
1524
-        $image_array[] = "$dummy_image_url/restaurants9.jpg";
1525
-        $image_array[] = "$dummy_image_url/restaurants2.jpg";
1526
-        $image_array[] = "$dummy_image_url/restaurants4.jpg";
1527
-
1528
-        $post_info[] = array(
1529
-            "listing_type" => $post_type,
1530
-            "post_title" => 'The Fountain Restaurant',
1531
-            "post_desc" => '
1492
+			"post_images" => $image_array,
1493
+			"post_category" => array($post_type.'category' => array('Restaurants', 'Feature')),
1494
+			"post_tags" => array('Sample Tag1'),
1495
+			"geodir_video" => '',
1496
+			"geodir_timing" => 'Percy Street is closed on Mondays. The restaurant is also open for weekend lunch/brunch from 11:30 a.m. to 2:30 p.m.',
1497
+			"geodir_contact" => '(143) 222-12344',
1498
+			"geodir_email" => '[email protected]',
1499
+			"geodir_website" => 'http://www.percystreet.com/',
1500
+			"geodir_twitter" => 'http://twitter.com/percystreet',
1501
+			"geodir_facebook" => 'http://facebook.com/percystreet',
1502
+			"post_dummy" => '1'
1503
+		);
1504
+
1505
+		////post end///
1506
+		/// Restaurants ////post start 4///
1507
+
1508
+		break;
1509
+	case 25:
1510
+
1511
+
1512
+		$image_array = array();
1513
+		$post_meta = array();
1514
+
1515
+		/// Restaurants ////post start 5//
1516
+		$image_array[] = "$dummy_image_url/restaurants4.jpg";
1517
+		$image_array[] = "$dummy_image_url/restaurants10.jpg";
1518
+		$image_array[] = "$dummy_image_url/restaurants3.jpg";
1519
+		$image_array[] = "$dummy_image_url/restaurants1.jpg";
1520
+		$image_array[] = "$dummy_image_url/restaurants5.jpg";
1521
+		$image_array[] = "$dummy_image_url/restaurants6.jpg";
1522
+		$image_array[] = "$dummy_image_url/restaurants7.jpg";
1523
+		$image_array[] = "$dummy_image_url/restaurants8.jpg";
1524
+		$image_array[] = "$dummy_image_url/restaurants9.jpg";
1525
+		$image_array[] = "$dummy_image_url/restaurants2.jpg";
1526
+		$image_array[] = "$dummy_image_url/restaurants4.jpg";
1527
+
1528
+		$post_info[] = array(
1529
+			"listing_type" => $post_type,
1530
+			"post_title" => 'The Fountain Restaurant',
1531
+			"post_desc" => '
1532 1532
 	The Fountain Restaurant in the Four Seasons Hotel Philadelphia has received seemingly every type of accolade there is, from top honors in Gourmet magazine to Forbes Travel Guide&acute;s 2010 Five Star award to a perfect Five Diamond rating from AAA. It&acute;s been a Philadelphia favorite for special occasion meals for decades.
1533 1533
 	
1534 1534
 	Additionally rated as the best restaurant in Philadelphia by Zagat&acute;s, the Fountain Restaurant overlooks the majestic Swann Memorial Fountain sculpture by Alexander Stirling Calder in the center of Logan Square. You&acute;ll also enjoy sweeping views of the grand Benjamin Franklin Parkway and its gorgeous Beaux Arts architecture.
@@ -1538,45 +1538,45 @@  discard block
 block discarded – undo
1538 1538
 	You can order a la carte or select the prix fix option to enjoy the “spontaneous tastes” menu which gives the chef control of a few courses. The menu changes regularly, but you can expect to see globaly influenced items like Pan-fried Veal Sweetbreads, Braised Dover Sole Roulade, Sautéed Venison Medallions and Roasted Australian Lamb Saddle.
1539 1539
 	
1540 1540
 	',
1541
-            "post_images" => $image_array,
1542
-            "post_category" => array($post_type.'category' => array('Restaurants')),
1543
-            "post_tags" => array('food'),
1544
-            "geodir_video" => '',
1545
-            "geodir_timing" => 'The restaurant is also open for weekend lunch/brunch from 11:30 a.m. to 2:30 p.m.',
1546
-            "geodir_contact" => '(103) 100-12344',
1547
-            "geodir_email" => '[email protected]',
1548
-            "geodir_website" => 'http://www.fourseasons.com/philadelphia/dining',
1549
-            "geodir_twitter" => 'http://twitter.com/fourseasons',
1550
-            "geodir_facebook" => 'http://facebook.com/fourseasons',
1551
-            "post_dummy" => '1'
1552
-        );
1553
-
1554
-        ////post end///
1555
-        /// Restaurants ////post start 5///
1556
-        break;
1557
-    case 26:
1558
-
1559
-
1560
-        $image_array = array();
1561
-        $post_meta = array();
1562
-
1563
-        /// Restaurants ////post start 6//
1564
-        $image_array[] = "$dummy_image_url/restaurants11.jpg";
1565
-        $image_array[] = "$dummy_image_url/restaurants10.jpg";
1566
-        $image_array[] = "$dummy_image_url/restaurants3.jpg";
1567
-        $image_array[] = "$dummy_image_url/restaurants1.jpg";
1568
-        $image_array[] = "$dummy_image_url/restaurants5.jpg";
1569
-        $image_array[] = "$dummy_image_url/restaurants6.jpg";
1570
-        $image_array[] = "$dummy_image_url/restaurants7.jpg";
1571
-        $image_array[] = "$dummy_image_url/restaurants8.jpg";
1572
-        $image_array[] = "$dummy_image_url/restaurants9.jpg";
1573
-        $image_array[] = "$dummy_image_url/restaurants2.jpg";
1574
-        $image_array[] = "$dummy_image_url/restaurants4.jpg";
1575
-
1576
-        $post_info[] = array(
1577
-            "listing_type" => $post_type,
1578
-            "post_title" => 'Lacroix at The Rittenhouse',
1579
-            "post_desc" => '
1541
+			"post_images" => $image_array,
1542
+			"post_category" => array($post_type.'category' => array('Restaurants')),
1543
+			"post_tags" => array('food'),
1544
+			"geodir_video" => '',
1545
+			"geodir_timing" => 'The restaurant is also open for weekend lunch/brunch from 11:30 a.m. to 2:30 p.m.',
1546
+			"geodir_contact" => '(103) 100-12344',
1547
+			"geodir_email" => '[email protected]',
1548
+			"geodir_website" => 'http://www.fourseasons.com/philadelphia/dining',
1549
+			"geodir_twitter" => 'http://twitter.com/fourseasons',
1550
+			"geodir_facebook" => 'http://facebook.com/fourseasons',
1551
+			"post_dummy" => '1'
1552
+		);
1553
+
1554
+		////post end///
1555
+		/// Restaurants ////post start 5///
1556
+		break;
1557
+	case 26:
1558
+
1559
+
1560
+		$image_array = array();
1561
+		$post_meta = array();
1562
+
1563
+		/// Restaurants ////post start 6//
1564
+		$image_array[] = "$dummy_image_url/restaurants11.jpg";
1565
+		$image_array[] = "$dummy_image_url/restaurants10.jpg";
1566
+		$image_array[] = "$dummy_image_url/restaurants3.jpg";
1567
+		$image_array[] = "$dummy_image_url/restaurants1.jpg";
1568
+		$image_array[] = "$dummy_image_url/restaurants5.jpg";
1569
+		$image_array[] = "$dummy_image_url/restaurants6.jpg";
1570
+		$image_array[] = "$dummy_image_url/restaurants7.jpg";
1571
+		$image_array[] = "$dummy_image_url/restaurants8.jpg";
1572
+		$image_array[] = "$dummy_image_url/restaurants9.jpg";
1573
+		$image_array[] = "$dummy_image_url/restaurants2.jpg";
1574
+		$image_array[] = "$dummy_image_url/restaurants4.jpg";
1575
+
1576
+		$post_info[] = array(
1577
+			"listing_type" => $post_type,
1578
+			"post_title" => 'Lacroix at The Rittenhouse',
1579
+			"post_desc" => '
1580 1580
 	A deluxe hotel like The Rittenhouse deserves a deluxe restaurant, a fitting description for Lacroix, named “Restaurant of the Year” in 2003 by Esquire magazine.
1581 1581
 	
1582 1582
 	Located on the second floor of the Rittenhouse Hotel, Lacroix features elegant décor and a broad view of Rittenhouse Square, which combine to make the ambiance at Lacroix as enjoyable as the meal itself.
@@ -1587,46 +1587,46 @@  discard block
 block discarded – undo
1587 1587
 	
1588 1588
 	Sunday Brunch at Lacroix - which features such delectable dishes as baby lamb chops with garlic crust and banyuls sauce, niman ranch smoked bacon, quail eggs with artichoke, golden beet and shiitakes, and french baguette toast with apple, raspberry and rosemary jam - is also highly recommended.
1589 1589
 	',
1590
-            "post_images" => $image_array,
1591
-            "post_category" => array($post_type.'category' => array('Restaurants')),
1592
-            "post_tags" => array('food'),
1593
-            "geodir_video" => '',
1594
-            "geodir_timing" => 'The restaurant is also open for weekend lunch/brunch from 10:30 a.m. to 6:30 p.m.',
1595
-            "geodir_contact" => '(113) 121-12344',
1596
-            "geodir_email" => '[email protected]',
1597
-            "geodir_website" => 'http://www.rittenhousehotel.com/lacroix.cfm',
1598
-            "geodir_twitter" => 'http://twitter.com/rittenhousehotel',
1599
-            "geodir_facebook" => 'http://facebook.com/rittenhousehotel',
1600
-            "post_dummy" => '1'
1601
-        );
1602
-
1603
-        ////post end///
1604
-        /// Restaurants ////post start 6///
1605
-
1606
-        break;
1607
-    case 27:
1608
-
1609
-
1610
-        $image_array = array();
1611
-        $post_meta = array();
1612
-
1613
-        /// Restaurants ////post start 7//
1614
-        $image_array[] = "$dummy_image_url/restaurants12.jpg";
1615
-        $image_array[] = "$dummy_image_url/restaurants13.jpg";
1616
-        $image_array[] = "$dummy_image_url/restaurants14.jpg";
1617
-        $image_array[] = "$dummy_image_url/restaurants15.jpg";
1618
-        $image_array[] = "$dummy_image_url/restaurants5.jpg";
1619
-        $image_array[] = "$dummy_image_url/restaurants6.jpg";
1620
-        $image_array[] = "$dummy_image_url/restaurants7.jpg";
1621
-        $image_array[] = "$dummy_image_url/restaurants8.jpg";
1622
-        $image_array[] = "$dummy_image_url/restaurants9.jpg";
1623
-        $image_array[] = "$dummy_image_url/restaurants2.jpg";
1624
-        $image_array[] = "$dummy_image_url/restaurants4.jpg";
1625
-
1626
-        $post_info[] = array(
1627
-            "listing_type" => $post_type,
1628
-            "post_title" => 'Lacroix at The Rittenhouse',
1629
-            "post_desc" => '
1590
+			"post_images" => $image_array,
1591
+			"post_category" => array($post_type.'category' => array('Restaurants')),
1592
+			"post_tags" => array('food'),
1593
+			"geodir_video" => '',
1594
+			"geodir_timing" => 'The restaurant is also open for weekend lunch/brunch from 10:30 a.m. to 6:30 p.m.',
1595
+			"geodir_contact" => '(113) 121-12344',
1596
+			"geodir_email" => '[email protected]',
1597
+			"geodir_website" => 'http://www.rittenhousehotel.com/lacroix.cfm',
1598
+			"geodir_twitter" => 'http://twitter.com/rittenhousehotel',
1599
+			"geodir_facebook" => 'http://facebook.com/rittenhousehotel',
1600
+			"post_dummy" => '1'
1601
+		);
1602
+
1603
+		////post end///
1604
+		/// Restaurants ////post start 6///
1605
+
1606
+		break;
1607
+	case 27:
1608
+
1609
+
1610
+		$image_array = array();
1611
+		$post_meta = array();
1612
+
1613
+		/// Restaurants ////post start 7//
1614
+		$image_array[] = "$dummy_image_url/restaurants12.jpg";
1615
+		$image_array[] = "$dummy_image_url/restaurants13.jpg";
1616
+		$image_array[] = "$dummy_image_url/restaurants14.jpg";
1617
+		$image_array[] = "$dummy_image_url/restaurants15.jpg";
1618
+		$image_array[] = "$dummy_image_url/restaurants5.jpg";
1619
+		$image_array[] = "$dummy_image_url/restaurants6.jpg";
1620
+		$image_array[] = "$dummy_image_url/restaurants7.jpg";
1621
+		$image_array[] = "$dummy_image_url/restaurants8.jpg";
1622
+		$image_array[] = "$dummy_image_url/restaurants9.jpg";
1623
+		$image_array[] = "$dummy_image_url/restaurants2.jpg";
1624
+		$image_array[] = "$dummy_image_url/restaurants4.jpg";
1625
+
1626
+		$post_info[] = array(
1627
+			"listing_type" => $post_type,
1628
+			"post_title" => 'Lacroix at The Rittenhouse',
1629
+			"post_desc" => '
1630 1630
 	A deluxe hotel like The Rittenhouse deserves a deluxe restaurant, a fitting description for Lacroix, named “Restaurant of the Year” in 2003 by Esquire magazine.
1631 1631
 	
1632 1632
 	Located on the second floor of the Rittenhouse Hotel, Lacroix features elegant décor and a broad view of Rittenhouse Square, which combine to make the ambiance at Lacroix as enjoyable as the meal itself.
@@ -1637,45 +1637,45 @@  discard block
 block discarded – undo
1637 1637
 	
1638 1638
 	Sunday Brunch at Lacroix - which features such delectable dishes as baby lamb chops with garlic crust and banyuls sauce, niman ranch smoked bacon, quail eggs with artichoke, golden beet and shiitakes, and french baguette toast with apple, raspberry and rosemary jam - is also highly recommended.
1639 1639
 	',
1640
-            "post_images" => $image_array,
1641
-            "post_category" => array($post_type.'category' => array('Restaurants', 'Food Nightlife')),
1642
-            "post_tags" => array('food'),
1643
-            "geodir_video" => '',
1644
-            "geodir_timing" => 'The restaurant is also open for weekend lunch/brunch from 10:30 a.m. to 6:30 p.m.',
1645
-            "geodir_contact" => '(113) 121-12344',
1646
-            "geodir_email" => '[email protected]',
1647
-            "geodir_website" => 'http://www.zamarestaurant.com/',
1648
-            "geodir_twitter" => 'http://twitter.com/zamarestaurant',
1649
-            "geodir_facebook" => 'http://facebook.com/zamarestaurant',
1650
-            "post_dummy" => '1'
1651
-        );
1652
-
1653
-        ////post end///
1654
-        /// Restaurants ////post start 7///
1655
-
1656
-        break;
1657
-    case 28:
1658
-
1659
-        $image_array = array();
1660
-        $post_meta = array();
1661
-
1662
-        /// Restaurants ////post start 8//
1663
-        $image_array[] = "$dummy_image_url/restaurants16.jpg";
1664
-        $image_array[] = "$dummy_image_url/restaurants17.jpg";
1665
-        $image_array[] = "$dummy_image_url/restaurants18.jpg";
1666
-        $image_array[] = "$dummy_image_url/restaurants19.jpg";
1667
-        $image_array[] = "$dummy_image_url/restaurants5.jpg";
1668
-        $image_array[] = "$dummy_image_url/restaurants6.jpg";
1669
-        $image_array[] = "$dummy_image_url/restaurants7.jpg";
1670
-        $image_array[] = "$dummy_image_url/restaurants8.jpg";
1671
-        $image_array[] = "$dummy_image_url/restaurants9.jpg";
1672
-        $image_array[] = "$dummy_image_url/restaurants2.jpg";
1673
-        $image_array[] = "$dummy_image_url/restaurants4.jpg";
1674
-
1675
-        $post_info[] = array(
1676
-            "listing_type" => $post_type,
1677
-            "post_title" => 'Sampan',
1678
-            "post_desc" => '
1640
+			"post_images" => $image_array,
1641
+			"post_category" => array($post_type.'category' => array('Restaurants', 'Food Nightlife')),
1642
+			"post_tags" => array('food'),
1643
+			"geodir_video" => '',
1644
+			"geodir_timing" => 'The restaurant is also open for weekend lunch/brunch from 10:30 a.m. to 6:30 p.m.',
1645
+			"geodir_contact" => '(113) 121-12344',
1646
+			"geodir_email" => '[email protected]',
1647
+			"geodir_website" => 'http://www.zamarestaurant.com/',
1648
+			"geodir_twitter" => 'http://twitter.com/zamarestaurant',
1649
+			"geodir_facebook" => 'http://facebook.com/zamarestaurant',
1650
+			"post_dummy" => '1'
1651
+		);
1652
+
1653
+		////post end///
1654
+		/// Restaurants ////post start 7///
1655
+
1656
+		break;
1657
+	case 28:
1658
+
1659
+		$image_array = array();
1660
+		$post_meta = array();
1661
+
1662
+		/// Restaurants ////post start 8//
1663
+		$image_array[] = "$dummy_image_url/restaurants16.jpg";
1664
+		$image_array[] = "$dummy_image_url/restaurants17.jpg";
1665
+		$image_array[] = "$dummy_image_url/restaurants18.jpg";
1666
+		$image_array[] = "$dummy_image_url/restaurants19.jpg";
1667
+		$image_array[] = "$dummy_image_url/restaurants5.jpg";
1668
+		$image_array[] = "$dummy_image_url/restaurants6.jpg";
1669
+		$image_array[] = "$dummy_image_url/restaurants7.jpg";
1670
+		$image_array[] = "$dummy_image_url/restaurants8.jpg";
1671
+		$image_array[] = "$dummy_image_url/restaurants9.jpg";
1672
+		$image_array[] = "$dummy_image_url/restaurants2.jpg";
1673
+		$image_array[] = "$dummy_image_url/restaurants4.jpg";
1674
+
1675
+		$post_info[] = array(
1676
+			"listing_type" => $post_type,
1677
+			"post_title" => 'Sampan',
1678
+			"post_desc" => '
1679 1679
 	Chef and charismatic television star Michael Schulson returns to Philadelphia with the opening of Sampan, a modern Asian restaurant where he serves the acclaimed cuisine that has made him one of the country&acute;s highly sought-after culinary talents.
1680 1680
 	
1681 1681
 	Schulson returns to Philadelphia after having opened Buddakan in New York City for Stephen Starr and Izakaya at the Borgata in Atlantic City and then having gone on to star in Style network&acute;s popular series Pantry Raid and TLC Ultimate Cake Off.
@@ -1694,45 +1694,45 @@  discard block
 block discarded – undo
1694 1694
 	
1695 1695
 	Prices range from $5 to $19.
1696 1696
 	',
1697
-            "post_images" => $image_array,
1698
-            "post_category" => array($post_type.'category' => array('Restaurants', 'Food Nightlife')),
1699
-            "post_tags" => array('restaurant'),
1700
-            "geodir_video" => '',
1701
-            "geodir_timing" => 'The restaurant is also open for weekend lunch/brunch from 10:30 a.m. to 6:30 p.m.',
1702
-            "geodir_contact" => '(000) 111-2222',
1703
-            "geodir_email" => '[email protected]',
1704
-            "geodir_website" => 'http://www.sampanphilly.com/',
1705
-            "geodir_twitter" => 'http://twitter.com/sampanphilly',
1706
-            "geodir_facebook" => 'http://facebook.com/sampanphilly',
1707
-            "post_dummy" => '1'
1708
-        );
1709
-
1710
-        ////post end///
1711
-        /// Restaurants ////post start 8///
1712
-
1713
-        break;
1714
-    case 29:
1715
-
1716
-        $image_array = array();
1717
-        $post_meta = array();
1718
-
1719
-        /// Restaurants ////post start 9//
1720
-        $image_array[] = "$dummy_image_url/restaurants17.jpg";
1721
-        $image_array[] = "$dummy_image_url/restaurants16.jpg";
1722
-        $image_array[] = "$dummy_image_url/restaurants18.jpg";
1723
-        $image_array[] = "$dummy_image_url/restaurants19.jpg";
1724
-        $image_array[] = "$dummy_image_url/restaurants5.jpg";
1725
-        $image_array[] = "$dummy_image_url/restaurants6.jpg";
1726
-        $image_array[] = "$dummy_image_url/restaurants7.jpg";
1727
-        $image_array[] = "$dummy_image_url/restaurants8.jpg";
1728
-        $image_array[] = "$dummy_image_url/restaurants9.jpg";
1729
-        $image_array[] = "$dummy_image_url/restaurants2.jpg";
1730
-        $image_array[] = "$dummy_image_url/restaurants4.jpg";
1731
-
1732
-        $post_info[] = array(
1733
-            "listing_type" => $post_type,
1734
-            "post_title" => 'Morimoto',
1735
-            "post_desc" => '
1697
+			"post_images" => $image_array,
1698
+			"post_category" => array($post_type.'category' => array('Restaurants', 'Food Nightlife')),
1699
+			"post_tags" => array('restaurant'),
1700
+			"geodir_video" => '',
1701
+			"geodir_timing" => 'The restaurant is also open for weekend lunch/brunch from 10:30 a.m. to 6:30 p.m.',
1702
+			"geodir_contact" => '(000) 111-2222',
1703
+			"geodir_email" => '[email protected]',
1704
+			"geodir_website" => 'http://www.sampanphilly.com/',
1705
+			"geodir_twitter" => 'http://twitter.com/sampanphilly',
1706
+			"geodir_facebook" => 'http://facebook.com/sampanphilly',
1707
+			"post_dummy" => '1'
1708
+		);
1709
+
1710
+		////post end///
1711
+		/// Restaurants ////post start 8///
1712
+
1713
+		break;
1714
+	case 29:
1715
+
1716
+		$image_array = array();
1717
+		$post_meta = array();
1718
+
1719
+		/// Restaurants ////post start 9//
1720
+		$image_array[] = "$dummy_image_url/restaurants17.jpg";
1721
+		$image_array[] = "$dummy_image_url/restaurants16.jpg";
1722
+		$image_array[] = "$dummy_image_url/restaurants18.jpg";
1723
+		$image_array[] = "$dummy_image_url/restaurants19.jpg";
1724
+		$image_array[] = "$dummy_image_url/restaurants5.jpg";
1725
+		$image_array[] = "$dummy_image_url/restaurants6.jpg";
1726
+		$image_array[] = "$dummy_image_url/restaurants7.jpg";
1727
+		$image_array[] = "$dummy_image_url/restaurants8.jpg";
1728
+		$image_array[] = "$dummy_image_url/restaurants9.jpg";
1729
+		$image_array[] = "$dummy_image_url/restaurants2.jpg";
1730
+		$image_array[] = "$dummy_image_url/restaurants4.jpg";
1731
+
1732
+		$post_info[] = array(
1733
+			"listing_type" => $post_type,
1734
+			"post_title" => 'Morimoto',
1735
+			"post_desc" => '
1736 1736
 	Stephen Starr creative Japanese restaurant has garnered all kinds of national and international attention since opening a few years back. Located a block from Independence Hall on Chestnut Street, Morimoto has an interior - awash in glass and colors - that is both striking and serene in its design.
1737 1737
 	
1738 1738
 	The restaurant&acute;s namesake and head chef, Morimoto (of Food Network&acute;s Iron Chef fame), has created a menu offering the very best in contemporary Japanese cusine. While regulars flock here for the exquisitely prepared sushi, Morimoto offers diners a broad spectrum of flavors that delve beyond nigiri and sashimi.
@@ -1745,45 +1745,45 @@  discard block
 block discarded – undo
1745 1745
 	
1746 1746
 	The mezzanine level lounge is a great spot to have a pre-meal cocktail while waiting for your table. You can enjoy a sake or try a “Sakura” - a cosmo made with Sake - in the sleek space that overlooks the brilliant restaurant below.
1747 1747
 	',
1748
-            "post_images" => $image_array,
1749
-            "post_category" => array($post_type.'category' => array('Restaurants', 'Food Nightlife', 'Feature')),
1750
-            "post_tags" => array('America'),
1751
-            "geodir_video" => '',
1752
-            "geodir_timing" => 'The restaurant is also open for weekend lunch/brunch from 10:30 a.m. to 6:30 p.m.',
1753
-            "geodir_contact" => '(000) 111-2222',
1754
-            "geodir_email" => '[email protected]',
1755
-            "geodir_website" => 'http://www.morimotorestaurant.com/',
1756
-            "geodir_twitter" => 'http://twitter.com/morimotorestaurant',
1757
-            "geodir_facebook" => 'http://facebook.com/morimotorestaurant',
1758
-            "post_dummy" => '1'
1759
-        );
1760
-
1761
-        ////post end///
1762
-        /// Restaurants ////post start 9///
1763
-        break;
1764
-    case 30:
1765
-
1766
-
1767
-        $image_array = array();
1768
-        $post_meta = array();
1769
-
1770
-        /// Restaurants ////post start 10//
1771
-        $image_array[] = "$dummy_image_url/restaurants19.jpg";
1772
-        $image_array[] = "$dummy_image_url/restaurants17.jpg";
1773
-        $image_array[] = "$dummy_image_url/restaurants18.jpg";
1774
-        $image_array[] = "$dummy_image_url/restaurants16.jpg";
1775
-        $image_array[] = "$dummy_image_url/restaurants5.jpg";
1776
-        $image_array[] = "$dummy_image_url/restaurants6.jpg";
1777
-        $image_array[] = "$dummy_image_url/restaurants7.jpg";
1778
-        $image_array[] = "$dummy_image_url/restaurants8.jpg";
1779
-        $image_array[] = "$dummy_image_url/restaurants9.jpg";
1780
-        $image_array[] = "$dummy_image_url/restaurants2.jpg";
1781
-        $image_array[] = "$dummy_image_url/restaurants4.jpg";
1782
-
1783
-        $post_info[] = array(
1784
-            "listing_type" => $post_type,
1785
-            "post_title" => 'Buddakan',
1786
-            "post_desc" => '
1748
+			"post_images" => $image_array,
1749
+			"post_category" => array($post_type.'category' => array('Restaurants', 'Food Nightlife', 'Feature')),
1750
+			"post_tags" => array('America'),
1751
+			"geodir_video" => '',
1752
+			"geodir_timing" => 'The restaurant is also open for weekend lunch/brunch from 10:30 a.m. to 6:30 p.m.',
1753
+			"geodir_contact" => '(000) 111-2222',
1754
+			"geodir_email" => '[email protected]',
1755
+			"geodir_website" => 'http://www.morimotorestaurant.com/',
1756
+			"geodir_twitter" => 'http://twitter.com/morimotorestaurant',
1757
+			"geodir_facebook" => 'http://facebook.com/morimotorestaurant',
1758
+			"post_dummy" => '1'
1759
+		);
1760
+
1761
+		////post end///
1762
+		/// Restaurants ////post start 9///
1763
+		break;
1764
+	case 30:
1765
+
1766
+
1767
+		$image_array = array();
1768
+		$post_meta = array();
1769
+
1770
+		/// Restaurants ////post start 10//
1771
+		$image_array[] = "$dummy_image_url/restaurants19.jpg";
1772
+		$image_array[] = "$dummy_image_url/restaurants17.jpg";
1773
+		$image_array[] = "$dummy_image_url/restaurants18.jpg";
1774
+		$image_array[] = "$dummy_image_url/restaurants16.jpg";
1775
+		$image_array[] = "$dummy_image_url/restaurants5.jpg";
1776
+		$image_array[] = "$dummy_image_url/restaurants6.jpg";
1777
+		$image_array[] = "$dummy_image_url/restaurants7.jpg";
1778
+		$image_array[] = "$dummy_image_url/restaurants8.jpg";
1779
+		$image_array[] = "$dummy_image_url/restaurants9.jpg";
1780
+		$image_array[] = "$dummy_image_url/restaurants2.jpg";
1781
+		$image_array[] = "$dummy_image_url/restaurants4.jpg";
1782
+
1783
+		$post_info[] = array(
1784
+			"listing_type" => $post_type,
1785
+			"post_title" => 'Buddakan',
1786
+			"post_desc" => '
1787 1787
 	<h3>The Experience </h3>
1788 1788
 	
1789 1789
 	A towering gilded statue of the Buddha generates elegant calm in this 175-seat, Pan Asian restaurant with sleek, modern decor. Immensely popular, Buddakan is a restaurant that is great for both large parties and intimate dinners.
@@ -1794,85 +1794,85 @@  discard block
 block discarded – undo
1794 1794
 	
1795 1795
 	Be sure to make your reservation before coming to town as Buddakan fills up quickly especially on weekends. Better yet, make your reservation right now .
1796 1796
 	',
1797
-            "post_images" => $image_array,
1798
-            "post_category" => array($post_type.'category' => array('Restaurants', 'Food Nightlife')),
1799
-            "post_tags" => array('America'),
1800
-            "geodir_video" => '',
1801
-            "geodir_timing" => 'The restaurant is also open for weekend lunch/brunch from 10:30 a.m. to 6:30 p.m.',
1802
-            "geodir_contact" => '(000) 111-2222',
1803
-            "geodir_email" => '[email protected]',
1804
-            "geodir_website" => 'http://www.buddakan.com/',
1805
-            "geodir_twitter" => 'http://twitter.com/buddakan',
1806
-            "geodir_facebook" => 'http://facebook.com/buddakan',
1807
-            "post_dummy" => '1'
1808
-        );
1809
-        break;
1810
-
1811
-    ////post end///
1812
-    /// Restaurants ////post start 10///
1797
+			"post_images" => $image_array,
1798
+			"post_category" => array($post_type.'category' => array('Restaurants', 'Food Nightlife')),
1799
+			"post_tags" => array('America'),
1800
+			"geodir_video" => '',
1801
+			"geodir_timing" => 'The restaurant is also open for weekend lunch/brunch from 10:30 a.m. to 6:30 p.m.',
1802
+			"geodir_contact" => '(000) 111-2222',
1803
+			"geodir_email" => '[email protected]',
1804
+			"geodir_website" => 'http://www.buddakan.com/',
1805
+			"geodir_twitter" => 'http://twitter.com/buddakan',
1806
+			"geodir_facebook" => 'http://facebook.com/buddakan',
1807
+			"post_dummy" => '1'
1808
+		);
1809
+		break;
1810
+
1811
+	////post end///
1812
+	/// Restaurants ////post start 10///
1813 1813
 } // end of switch
1814 1814
 
1815 1815
 foreach ($post_info as $post_info) {
1816
-    $default_location = geodir_get_default_location();
1817
-    if ($city_bound_lat1 > $city_bound_lat2)
1818
-        $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat1, $city_bound_lat2), geodir_random_float($city_bound_lat2, $city_bound_lat1));
1819
-    else
1820
-        $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat2, $city_bound_lat1), geodir_random_float($city_bound_lat1, $city_bound_lat2));
1816
+	$default_location = geodir_get_default_location();
1817
+	if ($city_bound_lat1 > $city_bound_lat2)
1818
+		$dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat1, $city_bound_lat2), geodir_random_float($city_bound_lat2, $city_bound_lat1));
1819
+	else
1820
+		$dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat2, $city_bound_lat1), geodir_random_float($city_bound_lat1, $city_bound_lat2));
1821 1821
 
1822 1822
 
1823
-    if ($city_bound_lng1 > $city_bound_lng2)
1824
-        $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng1, $city_bound_lng2), geodir_random_float($city_bound_lng2, $city_bound_lng1));
1825
-    else
1826
-        $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng2, $city_bound_lng1), geodir_random_float($city_bound_lng1, $city_bound_lng2));
1823
+	if ($city_bound_lng1 > $city_bound_lng2)
1824
+		$dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng1, $city_bound_lng2), geodir_random_float($city_bound_lng2, $city_bound_lng1));
1825
+	else
1826
+		$dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng2, $city_bound_lng1), geodir_random_float($city_bound_lng1, $city_bound_lng2));
1827 1827
 
1828
-    $load_map = get_option('geodir_load_map');
1828
+	$load_map = get_option('geodir_load_map');
1829 1829
     
1830
-    if ($load_map == 'osm') {
1831
-        $post_address = geodir_get_osm_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude);
1832
-    } else {
1833
-        $post_address = geodir_get_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude);
1834
-    }
1835
-
1836
-    $postal_code = '';
1837
-    if (!empty($post_address)) {
1838
-        if ($load_map == 'osm') {
1839
-            $address = !empty($post_address->formatted_address) ? $post_address->formatted_address : '';
1840
-            $postal_code = !empty($post_address->address->postcode) ? $post_address->address->postcode : '';
1841
-        } else {
1842
-            $addresses = array();
1843
-            $addresses_default = array();
1830
+	if ($load_map == 'osm') {
1831
+		$post_address = geodir_get_osm_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude);
1832
+	} else {
1833
+		$post_address = geodir_get_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude);
1834
+	}
1835
+
1836
+	$postal_code = '';
1837
+	if (!empty($post_address)) {
1838
+		if ($load_map == 'osm') {
1839
+			$address = !empty($post_address->formatted_address) ? $post_address->formatted_address : '';
1840
+			$postal_code = !empty($post_address->address->postcode) ? $post_address->address->postcode : '';
1841
+		} else {
1842
+			$addresses = array();
1843
+			$addresses_default = array();
1844 1844
             
1845
-            foreach ($post_address as $add_key => $add_value) {
1846
-                if ($add_key < 2 && !empty($add_value->long_name)) {
1847
-                    $addresses_default[] = $add_value->long_name;
1848
-                }
1849
-                if ($add_value->types[0] == 'postal_code') {
1850
-                    $postal_code = $add_value->long_name;
1851
-                }
1852
-                if ($add_value->types[0] == 'street_number') {
1853
-                    $addresses[] = $add_value->long_name;
1854
-                }
1855
-                if ($add_value->types[0] == 'route') {
1856
-                    $addresses[] = $add_value->long_name;
1857
-                }
1858
-                if ($add_value->types[0] == 'neighborhood') {
1859
-                    $addresses[] = $add_value->long_name;
1860
-                }
1861
-                if ($add_value->types[0] == 'sublocality') {
1862
-                    $addresses[] = $add_value->long_name;
1863
-                }
1864
-            }
1865
-            $address = !empty($addresses) ? implode(', ', $addresses) : (!empty($addresses_default) ? implode(', ', $addresses_default) : '');
1866
-        }
1867
-
1868
-        $post_info['post_address'] = !empty($address) ? $address : $default_location->city;
1869
-        $post_info['post_city'] = $default_location->city;
1870
-        $post_info['post_region'] = $default_location->region;
1871
-        $post_info['post_country'] = $default_location->country;
1872
-        $post_info['post_zip'] = $postal_code;
1873
-        $post_info['post_latitude'] = $dummy_post_latitude;
1874
-        $post_info['post_longitude'] = $dummy_post_longitude;
1875
-    }
1845
+			foreach ($post_address as $add_key => $add_value) {
1846
+				if ($add_key < 2 && !empty($add_value->long_name)) {
1847
+					$addresses_default[] = $add_value->long_name;
1848
+				}
1849
+				if ($add_value->types[0] == 'postal_code') {
1850
+					$postal_code = $add_value->long_name;
1851
+				}
1852
+				if ($add_value->types[0] == 'street_number') {
1853
+					$addresses[] = $add_value->long_name;
1854
+				}
1855
+				if ($add_value->types[0] == 'route') {
1856
+					$addresses[] = $add_value->long_name;
1857
+				}
1858
+				if ($add_value->types[0] == 'neighborhood') {
1859
+					$addresses[] = $add_value->long_name;
1860
+				}
1861
+				if ($add_value->types[0] == 'sublocality') {
1862
+					$addresses[] = $add_value->long_name;
1863
+				}
1864
+			}
1865
+			$address = !empty($addresses) ? implode(', ', $addresses) : (!empty($addresses_default) ? implode(', ', $addresses_default) : '');
1866
+		}
1867
+
1868
+		$post_info['post_address'] = !empty($address) ? $address : $default_location->city;
1869
+		$post_info['post_city'] = $default_location->city;
1870
+		$post_info['post_region'] = $default_location->region;
1871
+		$post_info['post_country'] = $default_location->country;
1872
+		$post_info['post_zip'] = $postal_code;
1873
+		$post_info['post_latitude'] = $dummy_post_latitude;
1874
+		$post_info['post_longitude'] = $dummy_post_longitude;
1875
+	}
1876 1876
     
1877
-    geodir_save_listing($post_info, true);
1877
+	geodir_save_listing($post_info, true);
1878 1878
 }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -6,19 +6,19 @@
 block discarded – undo
6 6
  * @package GeoDirectory
7 7
  */
8 8
 
9
-global $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2,$wpdb, $current_user,$dummy_post_index;
9
+global $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2, $wpdb, $current_user, $dummy_post_index;
10 10
 $post_info = array();
11 11
 $image_array = array();
12 12
 $post_meta = array();
13 13
 
14
-if($dummy_post_index==1){
14
+if ($dummy_post_index == 1) {
15 15
     $category_array = array('Attractions', 'Hotels', 'Restaurants', 'Food Nightlife', 'Festival', 'Videos', 'Feature');
16
-    geodir_dummy_data_taxonomies($post_type,$category_array );
17
-    update_option($post_type.'_dummy_data_type','standard_places');
16
+    geodir_dummy_data_taxonomies($post_type, $category_array);
17
+    update_option($post_type.'_dummy_data_type', 'standard_places');
18 18
 }
19 19
 
20 20
 if (geodir_dummy_folder_exists())
21
-    $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy";
21
+    $dummy_image_url = geodir_plugin_url()."/geodirectory-admin/dummy";
22 22
 else
23 23
     $dummy_image_url = 'https://wpgeodirectory.com/dummy';
24 24
 
Please login to merge, or discard this patch.
Braces   +13 added lines, -10 removed lines patch added patch discarded remove patch
@@ -17,10 +17,11 @@  discard block
 block discarded – undo
17 17
     update_option($post_type.'_dummy_data_type','standard_places');
18 18
 }
19 19
 
20
-if (geodir_dummy_folder_exists())
20
+if (geodir_dummy_folder_exists()) {
21 21
     $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy";
22
-else
22
+} else {
23 23
     $dummy_image_url = 'https://wpgeodirectory.com/dummy';
24
+}
24 25
 
25 26
 $dummy_image_url = apply_filters('place_dummy_image_url', $dummy_image_url);
26 27
 
@@ -1814,16 +1815,18 @@  discard block
 block discarded – undo
1814 1815
 
1815 1816
 foreach ($post_info as $post_info) {
1816 1817
     $default_location = geodir_get_default_location();
1817
-    if ($city_bound_lat1 > $city_bound_lat2)
1818
-        $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat1, $city_bound_lat2), geodir_random_float($city_bound_lat2, $city_bound_lat1));
1819
-    else
1820
-        $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat2, $city_bound_lat1), geodir_random_float($city_bound_lat1, $city_bound_lat2));
1818
+    if ($city_bound_lat1 > $city_bound_lat2) {
1819
+            $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat1, $city_bound_lat2), geodir_random_float($city_bound_lat2, $city_bound_lat1));
1820
+    } else {
1821
+            $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat2, $city_bound_lat1), geodir_random_float($city_bound_lat1, $city_bound_lat2));
1822
+    }
1821 1823
 
1822 1824
 
1823
-    if ($city_bound_lng1 > $city_bound_lng2)
1824
-        $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng1, $city_bound_lng2), geodir_random_float($city_bound_lng2, $city_bound_lng1));
1825
-    else
1826
-        $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng2, $city_bound_lng1), geodir_random_float($city_bound_lng1, $city_bound_lng2));
1825
+    if ($city_bound_lng1 > $city_bound_lng2) {
1826
+            $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng1, $city_bound_lng2), geodir_random_float($city_bound_lng2, $city_bound_lng1));
1827
+    } else {
1828
+            $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng2, $city_bound_lng1), geodir_random_float($city_bound_lng1, $city_bound_lng2));
1829
+    }
1827 1830
 
1828 1831
     $load_map = get_option('geodir_load_map');
1829 1832
     
Please login to merge, or discard this patch.
geodirectory-admin/dummy-data/property_sale.php 3 patches
Indentation   +873 added lines, -873 removed lines patch added patch discarded remove patch
@@ -7,453 +7,453 @@  discard block
 block discarded – undo
7 7
  */
8 8
 
9 9
 function geodir_property_sale_custom_fields($post_type='gd_place',$package_id=''){
10
-    $fields = array();
11
-    $package = ($package_id=='') ? '' : array($package_id);
12
-
13
-    // price
14
-    $fields[] = array('listing_type' => $post_type,
15
-                      'field_type'          =>  'text',
16
-                      'data_type'           =>  'FLOAT',
17
-                      'decimal_point'       =>  '2',
18
-                      'admin_title'         =>  __('Price', 'geodirectory'),
19
-                      'site_title'          =>  __('Price', 'geodirectory'),
20
-                      'admin_desc'          =>  __('Enter the price in $ (no currency symbol)', 'geodirectory'),
21
-                      'htmlvar_name'        =>  'price',
22
-                      'is_active'           =>  true,
23
-                      'for_admin_use'       =>  false,
24
-                      'default_value'       =>  '',
25
-                      'show_in' 	        =>  '[detail],[listing]',
26
-                      'is_required'         =>  false,
27
-                      'validation_pattern'  =>  addslashes_gpc('\d+(\.\d{2})?'), // add slashes required
28
-                      'validation_msg'      =>  'Please enter number and decimal only ie: 100.50',
29
-                      'required_msg'        =>  '',
30
-                      'field_icon'          =>  'fa fa-usd',
31
-                      'css_class'           =>  '',
32
-                      'cat_sort'            =>  true,
33
-                      'cat_filter'	        =>  true,
34
-                      'extra'        =>  array(
35
-                          'is_price'                  =>  1,
36
-                          'thousand_separator'        =>  'comma',
37
-                          'decimal_separator'         =>  'period',
38
-                          'decimal_display'           =>  'if',
39
-                          'currency_symbol'           =>  '$',
40
-                          'currency_symbol_placement' =>  'left'
41
-                      )
42
-    );
43
-
44
-    // property status
45
-    $fields[] = array('listing_type' => $post_type,
46
-                      'data_type' => 'VARCHAR',
47
-                      'field_type' => 'select',
48
-                      'field_type_key' => 'property_status',
49
-                      'is_active' => 1,
50
-                      'for_admin_use' => 0,
51
-                      'is_default' => 0,
52
-                      'admin_title' => __('Property Status', 'geodirectory'),
53
-                      'admin_desc' => __('Enter the status of the property.', 'geodirectory'),
54
-                      'site_title' => __('Property Status', 'geodirectory'),
55
-                      'htmlvar_name' => 'property_status',
56
-                      'default_value' => '',
57
-                      'is_required' => '1',
58
-                      'required_msg' => '',
59
-                      'show_in'   =>  '[detail],[listing]',
60
-                      'show_on_pkg' => $package,
61
-                      'option_values' => 'Select Status/,For Sale,Sold,Under Offer',
62
-                      'field_icon' => 'fa fa-home',
63
-                      'css_class' => '',
64
-                      'cat_sort' => 1,
65
-                      'cat_filter' => 1,
66
-    );
67
-
68
-    // property furnishing
69
-    $fields[] = array('listing_type' => $post_type,
70
-                      'field_type'          =>  'select',
71
-                      'data_type'           =>  'VARCHAR',
72
-                      'admin_title'         =>  __('Furnishing', 'geodirectory'),
73
-                      'site_title'          =>  __('Furnishing', 'geodirectory'),
74
-                      'admin_desc'          =>  __('Enter the furnishing status of the property.', 'geodirectory'),
75
-                      'htmlvar_name'        =>  'property_furnishing',
76
-                      'is_active'           =>  true,
77
-                      'for_admin_use'       =>  false,
78
-                      'default_value'       =>  '',
79
-                      'show_in' 	        =>  '[detail],[listing]',
80
-                      'is_required'         =>  true,
81
-                      'option_values'       =>  __('Select Status/,Unfurnished,Furnished,Partially furnished,Optional','geodirectory'),
82
-                      'validation_pattern'  =>  '',
83
-                      'validation_msg'      =>  '',
84
-                      'required_msg'        =>  '',
85
-                      'field_icon'          =>  'fa fa-th-large',
86
-                      'css_class'           =>  '',
87
-                      'cat_sort'            =>  true,
88
-                      'cat_filter'	        =>  true
89
-    );
90
-
91
-    // property type
92
-    $fields[] = array('listing_type' => $post_type,
93
-                      'field_type'          =>  'select',
94
-                      'data_type'           =>  'VARCHAR',
95
-                      'admin_title'         =>  __('Property Type', 'geodirectory'),
96
-                      'site_title'          =>  __('Property Type', 'geodirectory'),
97
-                      'admin_desc'          =>  __('Select the property type.', 'geodirectory'),
98
-                      'htmlvar_name'        =>  'property_type',
99
-                      'is_active'           =>  true,
100
-                      'for_admin_use'       =>  false,
101
-                      'default_value'       =>  '',
102
-                      'show_in' 	        =>  '[detail],[listing]',
103
-                      'is_required'         =>  true,
104
-                      'option_values'       =>  __('Select Type/,Detached house,Semi-detached house,Apartment,Bungalow,Semi-detached bungalow,Chalet,Town House,End-terrace house,Terrace house,Cottage,Hotel,Land','geodirectory'),
105
-                      'validation_pattern'  =>  '',
106
-                      'validation_msg'      =>  '',
107
-                      'required_msg'        =>  '',
108
-                      'field_icon'          =>  'fa fa-home',
109
-                      'css_class'           =>  '',
110
-                      'cat_sort'            =>  true,
111
-                      'cat_filter'	        =>  true
112
-    );
113
-
114
-    // property bedrooms
115
-    $fields[] = array('listing_type' => $post_type,
116
-                      'field_type'          =>  'select',
117
-                      'data_type'           =>  'VARCHAR',
118
-                      'admin_title'         =>  __('Property Bedrooms', 'geodirectory'),
119
-                      'site_title'          =>  __('Bedrooms', 'geodirectory'),
120
-                      'admin_desc'          =>  __('Select the number of bedrooms', 'geodirectory'),
121
-                      'htmlvar_name'        =>  'property_bedrooms',
122
-                      'is_active'           =>  true,
123
-                      'for_admin_use'       =>  false,
124
-                      'default_value'       =>  '',
125
-                      'show_in' 	        =>  '[detail],[listing]',
126
-                      'is_required'         =>  true,
127
-                      'option_values'       =>  __('Select Bedrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'),
128
-                      'validation_pattern'  =>  '',
129
-                      'validation_msg'      =>  '',
130
-                      'required_msg'        =>  '',
131
-                      'field_icon'          =>  'fa fa-bed',
132
-                      'css_class'           =>  '',
133
-                      'cat_sort'            =>  true,
134
-                      'cat_filter'	        =>  true
135
-    );
136
-
137
-    // property bathrooms
138
-    $fields[] = array('listing_type' => $post_type,
139
-                      'field_type'          =>  'select',
140
-                      'data_type'           =>  'VARCHAR',
141
-                      'admin_title'         =>  __('Property Bathrooms', 'geodirectory'),
142
-                      'site_title'          =>  __('Bathrooms', 'geodirectory'),
143
-                      'admin_desc'          =>  __('Select the number of bathrooms', 'geodirectory'),
144
-                      'htmlvar_name'        =>  'property_bathrooms',
145
-                      'is_active'           =>  true,
146
-                      'for_admin_use'       =>  false,
147
-                      'default_value'       =>  '',
148
-                      'show_in' 	        =>  '[detail],[listing]',
149
-                      'is_required'         =>  true,
150
-                      'option_values'       =>  __('Select Bathrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'),
151
-                      'validation_pattern'  =>  '',
152
-                      'validation_msg'      =>  '',
153
-                      'required_msg'        =>  '',
154
-                      'field_icon'          =>  'fa fa-bold',
155
-                      'css_class'           =>  '',
156
-                      'cat_sort'            =>  true,
157
-                      'cat_filter'	        =>  true
158
-    );
159
-
160
-    // property area
161
-    $fields[] = array('listing_type' => $post_type,
162
-                      'field_type'          =>  'text',
163
-                      'data_type'           =>  'INT',
164
-                      'admin_title'         =>  __('Property Area', 'geodirectory'),
165
-                      'site_title'          =>  __('Area (Sq Ft)', 'geodirectory'),
166
-                      'admin_desc'          =>  __('Enter the Sq Ft value for the property', 'geodirectory'),
167
-                      'htmlvar_name'        =>  'property_area',
168
-                      'is_active'           =>  true,
169
-                      'for_admin_use'       =>  false,
170
-                      'default_value'       =>  '',
171
-                      'show_in' 	        =>  '[detail],[listing]',
172
-                      'is_required'         =>  false,
173
-                      'validation_pattern'  =>  addslashes_gpc('\d+(\.\d{2})?'), // add slashes required
174
-                      'validation_msg'      =>  'Please enter the property area in numbers only: 1500',
175
-                      'required_msg'        =>  '',
176
-                      'field_icon'          =>  'fa fa-area-chart',
177
-                      'css_class'           =>  '',
178
-                      'cat_sort'            =>  true,
179
-                      'cat_filter'	        =>  true
180
-    );
181
-
182
-    // property features
183
-    $fields[] = array('listing_type' => $post_type,
184
-                      'field_type'          =>  'multiselect',
185
-                      'data_type'           =>  'VARCHAR',
186
-                      'admin_title'         =>  __('Property Features', 'geodirectory'),
187
-                      'site_title'          =>  __('Features', 'geodirectory'),
188
-                      'admin_desc'          =>  __('Select the property features.', 'geodirectory'),
189
-                      'htmlvar_name'        =>  'property_features',
190
-                      'is_active'           =>  true,
191
-                      'for_admin_use'       =>  false,
192
-                      'default_value'       =>  '',
193
-                      'show_in' 	        =>  '[detail],[listing]',
194
-                      'is_required'         =>  false,
195
-                      'option_values'       =>  __('Gas Central Heating,Oil Central Heating,Double Glazing,Triple Glazing,Front Garden,Garage,Private driveway,Off Road Parking,Fireplace','geodirectory'),
196
-                      'validation_pattern'  =>  '',
197
-                      'validation_msg'      =>  '',
198
-                      'required_msg'        =>  '',
199
-                      'field_icon'          =>  'fa fa-plus-square',
200
-                      'css_class'           =>  'gd-comma-list',
201
-                      'cat_sort'            =>  true,
202
-                      'cat_filter'	        =>  true
203
-    );
204
-
205
-
206
-
207
-    /**
208
-     * Filter the array of default custom fields DB table data.
209
-     *
210
-     * @since 1.6.6
211
-     * @param string $fields The default custom fields as an array.
212
-     */
213
-    $fields = apply_filters('geodir_property_sale_custom_fields', $fields);
214
-
215
-    return  $fields;
10
+	$fields = array();
11
+	$package = ($package_id=='') ? '' : array($package_id);
12
+
13
+	// price
14
+	$fields[] = array('listing_type' => $post_type,
15
+					  'field_type'          =>  'text',
16
+					  'data_type'           =>  'FLOAT',
17
+					  'decimal_point'       =>  '2',
18
+					  'admin_title'         =>  __('Price', 'geodirectory'),
19
+					  'site_title'          =>  __('Price', 'geodirectory'),
20
+					  'admin_desc'          =>  __('Enter the price in $ (no currency symbol)', 'geodirectory'),
21
+					  'htmlvar_name'        =>  'price',
22
+					  'is_active'           =>  true,
23
+					  'for_admin_use'       =>  false,
24
+					  'default_value'       =>  '',
25
+					  'show_in' 	        =>  '[detail],[listing]',
26
+					  'is_required'         =>  false,
27
+					  'validation_pattern'  =>  addslashes_gpc('\d+(\.\d{2})?'), // add slashes required
28
+					  'validation_msg'      =>  'Please enter number and decimal only ie: 100.50',
29
+					  'required_msg'        =>  '',
30
+					  'field_icon'          =>  'fa fa-usd',
31
+					  'css_class'           =>  '',
32
+					  'cat_sort'            =>  true,
33
+					  'cat_filter'	        =>  true,
34
+					  'extra'        =>  array(
35
+						  'is_price'                  =>  1,
36
+						  'thousand_separator'        =>  'comma',
37
+						  'decimal_separator'         =>  'period',
38
+						  'decimal_display'           =>  'if',
39
+						  'currency_symbol'           =>  '$',
40
+						  'currency_symbol_placement' =>  'left'
41
+					  )
42
+	);
43
+
44
+	// property status
45
+	$fields[] = array('listing_type' => $post_type,
46
+					  'data_type' => 'VARCHAR',
47
+					  'field_type' => 'select',
48
+					  'field_type_key' => 'property_status',
49
+					  'is_active' => 1,
50
+					  'for_admin_use' => 0,
51
+					  'is_default' => 0,
52
+					  'admin_title' => __('Property Status', 'geodirectory'),
53
+					  'admin_desc' => __('Enter the status of the property.', 'geodirectory'),
54
+					  'site_title' => __('Property Status', 'geodirectory'),
55
+					  'htmlvar_name' => 'property_status',
56
+					  'default_value' => '',
57
+					  'is_required' => '1',
58
+					  'required_msg' => '',
59
+					  'show_in'   =>  '[detail],[listing]',
60
+					  'show_on_pkg' => $package,
61
+					  'option_values' => 'Select Status/,For Sale,Sold,Under Offer',
62
+					  'field_icon' => 'fa fa-home',
63
+					  'css_class' => '',
64
+					  'cat_sort' => 1,
65
+					  'cat_filter' => 1,
66
+	);
67
+
68
+	// property furnishing
69
+	$fields[] = array('listing_type' => $post_type,
70
+					  'field_type'          =>  'select',
71
+					  'data_type'           =>  'VARCHAR',
72
+					  'admin_title'         =>  __('Furnishing', 'geodirectory'),
73
+					  'site_title'          =>  __('Furnishing', 'geodirectory'),
74
+					  'admin_desc'          =>  __('Enter the furnishing status of the property.', 'geodirectory'),
75
+					  'htmlvar_name'        =>  'property_furnishing',
76
+					  'is_active'           =>  true,
77
+					  'for_admin_use'       =>  false,
78
+					  'default_value'       =>  '',
79
+					  'show_in' 	        =>  '[detail],[listing]',
80
+					  'is_required'         =>  true,
81
+					  'option_values'       =>  __('Select Status/,Unfurnished,Furnished,Partially furnished,Optional','geodirectory'),
82
+					  'validation_pattern'  =>  '',
83
+					  'validation_msg'      =>  '',
84
+					  'required_msg'        =>  '',
85
+					  'field_icon'          =>  'fa fa-th-large',
86
+					  'css_class'           =>  '',
87
+					  'cat_sort'            =>  true,
88
+					  'cat_filter'	        =>  true
89
+	);
90
+
91
+	// property type
92
+	$fields[] = array('listing_type' => $post_type,
93
+					  'field_type'          =>  'select',
94
+					  'data_type'           =>  'VARCHAR',
95
+					  'admin_title'         =>  __('Property Type', 'geodirectory'),
96
+					  'site_title'          =>  __('Property Type', 'geodirectory'),
97
+					  'admin_desc'          =>  __('Select the property type.', 'geodirectory'),
98
+					  'htmlvar_name'        =>  'property_type',
99
+					  'is_active'           =>  true,
100
+					  'for_admin_use'       =>  false,
101
+					  'default_value'       =>  '',
102
+					  'show_in' 	        =>  '[detail],[listing]',
103
+					  'is_required'         =>  true,
104
+					  'option_values'       =>  __('Select Type/,Detached house,Semi-detached house,Apartment,Bungalow,Semi-detached bungalow,Chalet,Town House,End-terrace house,Terrace house,Cottage,Hotel,Land','geodirectory'),
105
+					  'validation_pattern'  =>  '',
106
+					  'validation_msg'      =>  '',
107
+					  'required_msg'        =>  '',
108
+					  'field_icon'          =>  'fa fa-home',
109
+					  'css_class'           =>  '',
110
+					  'cat_sort'            =>  true,
111
+					  'cat_filter'	        =>  true
112
+	);
113
+
114
+	// property bedrooms
115
+	$fields[] = array('listing_type' => $post_type,
116
+					  'field_type'          =>  'select',
117
+					  'data_type'           =>  'VARCHAR',
118
+					  'admin_title'         =>  __('Property Bedrooms', 'geodirectory'),
119
+					  'site_title'          =>  __('Bedrooms', 'geodirectory'),
120
+					  'admin_desc'          =>  __('Select the number of bedrooms', 'geodirectory'),
121
+					  'htmlvar_name'        =>  'property_bedrooms',
122
+					  'is_active'           =>  true,
123
+					  'for_admin_use'       =>  false,
124
+					  'default_value'       =>  '',
125
+					  'show_in' 	        =>  '[detail],[listing]',
126
+					  'is_required'         =>  true,
127
+					  'option_values'       =>  __('Select Bedrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'),
128
+					  'validation_pattern'  =>  '',
129
+					  'validation_msg'      =>  '',
130
+					  'required_msg'        =>  '',
131
+					  'field_icon'          =>  'fa fa-bed',
132
+					  'css_class'           =>  '',
133
+					  'cat_sort'            =>  true,
134
+					  'cat_filter'	        =>  true
135
+	);
136
+
137
+	// property bathrooms
138
+	$fields[] = array('listing_type' => $post_type,
139
+					  'field_type'          =>  'select',
140
+					  'data_type'           =>  'VARCHAR',
141
+					  'admin_title'         =>  __('Property Bathrooms', 'geodirectory'),
142
+					  'site_title'          =>  __('Bathrooms', 'geodirectory'),
143
+					  'admin_desc'          =>  __('Select the number of bathrooms', 'geodirectory'),
144
+					  'htmlvar_name'        =>  'property_bathrooms',
145
+					  'is_active'           =>  true,
146
+					  'for_admin_use'       =>  false,
147
+					  'default_value'       =>  '',
148
+					  'show_in' 	        =>  '[detail],[listing]',
149
+					  'is_required'         =>  true,
150
+					  'option_values'       =>  __('Select Bathrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'),
151
+					  'validation_pattern'  =>  '',
152
+					  'validation_msg'      =>  '',
153
+					  'required_msg'        =>  '',
154
+					  'field_icon'          =>  'fa fa-bold',
155
+					  'css_class'           =>  '',
156
+					  'cat_sort'            =>  true,
157
+					  'cat_filter'	        =>  true
158
+	);
159
+
160
+	// property area
161
+	$fields[] = array('listing_type' => $post_type,
162
+					  'field_type'          =>  'text',
163
+					  'data_type'           =>  'INT',
164
+					  'admin_title'         =>  __('Property Area', 'geodirectory'),
165
+					  'site_title'          =>  __('Area (Sq Ft)', 'geodirectory'),
166
+					  'admin_desc'          =>  __('Enter the Sq Ft value for the property', 'geodirectory'),
167
+					  'htmlvar_name'        =>  'property_area',
168
+					  'is_active'           =>  true,
169
+					  'for_admin_use'       =>  false,
170
+					  'default_value'       =>  '',
171
+					  'show_in' 	        =>  '[detail],[listing]',
172
+					  'is_required'         =>  false,
173
+					  'validation_pattern'  =>  addslashes_gpc('\d+(\.\d{2})?'), // add slashes required
174
+					  'validation_msg'      =>  'Please enter the property area in numbers only: 1500',
175
+					  'required_msg'        =>  '',
176
+					  'field_icon'          =>  'fa fa-area-chart',
177
+					  'css_class'           =>  '',
178
+					  'cat_sort'            =>  true,
179
+					  'cat_filter'	        =>  true
180
+	);
181
+
182
+	// property features
183
+	$fields[] = array('listing_type' => $post_type,
184
+					  'field_type'          =>  'multiselect',
185
+					  'data_type'           =>  'VARCHAR',
186
+					  'admin_title'         =>  __('Property Features', 'geodirectory'),
187
+					  'site_title'          =>  __('Features', 'geodirectory'),
188
+					  'admin_desc'          =>  __('Select the property features.', 'geodirectory'),
189
+					  'htmlvar_name'        =>  'property_features',
190
+					  'is_active'           =>  true,
191
+					  'for_admin_use'       =>  false,
192
+					  'default_value'       =>  '',
193
+					  'show_in' 	        =>  '[detail],[listing]',
194
+					  'is_required'         =>  false,
195
+					  'option_values'       =>  __('Gas Central Heating,Oil Central Heating,Double Glazing,Triple Glazing,Front Garden,Garage,Private driveway,Off Road Parking,Fireplace','geodirectory'),
196
+					  'validation_pattern'  =>  '',
197
+					  'validation_msg'      =>  '',
198
+					  'required_msg'        =>  '',
199
+					  'field_icon'          =>  'fa fa-plus-square',
200
+					  'css_class'           =>  'gd-comma-list',
201
+					  'cat_sort'            =>  true,
202
+					  'cat_filter'	        =>  true
203
+	);
204
+
205
+
206
+
207
+	/**
208
+	 * Filter the array of default custom fields DB table data.
209
+	 *
210
+	 * @since 1.6.6
211
+	 * @param string $fields The default custom fields as an array.
212
+	 */
213
+	$fields = apply_filters('geodir_property_sale_custom_fields', $fields);
214
+
215
+	return  $fields;
216 216
 }
217 217
 
218 218
 function geodir_property_sale_custom_fields_sort($post_type='gd_place') {
219 219
 
220 220
 
221
-    $fields = array();
222
-
223
-    // price sort
224
-    $fields[] = array(
225
-        'create_field'            => true,
226
-        'listing_type'            => $post_type,
227
-        'field_type'              => 'text',
228
-        'data_type'               => '',
229
-        'htmlvar_name'            => 'geodir_price',
230
-        'site_title'              => __('Price','geodirectory'),
231
-        'asc'                     => 1,
232
-        'asc_title'               => __('Price (lowest first)','geodirectory'),
233
-        'desc'                    => 1,
234
-        'desc_title'              => __('Price (highest first)','geodirectory'),
235
-        'is_active'               => 1
236
-    );
237
-
238
-    // area sort
239
-    $fields[] = array(
240
-        'create_field'            => true,
241
-        'listing_type'            => $post_type,
242
-        'field_type'              => 'text',
243
-        'data_type'               => '',
244
-        'htmlvar_name'            => 'geodir_property_area',
245
-        'site_title'              => __('Area (Sq Ft)','geodirectory'),
246
-        'asc'                     => 1,
247
-        'asc_title'               => __('Area (smallest first)','geodirectory'),
248
-        'desc'                    => 1,
249
-        'desc_title'              => __('Area (largest first)','geodirectory'),
250
-        'is_active'               => 1
251
-    );
252
-
253
-    // bedrooms sort
254
-    $fields[] = array(
255
-        'create_field'            => true,
256
-        'listing_type'            => $post_type,
257
-        'field_type'              => 'select',
258
-        'data_type'               => '',
259
-        'htmlvar_name'            => 'geodir_property_bedrooms',
260
-        'site_title'              => __('Area (Sq Ft)','geodirectory'),
261
-        'asc'                     => 1,
262
-        'asc_title'               => __('Bedrooms (least)','geodirectory'),
263
-        'desc'                    => 1,
264
-        'desc_title'              => __('Bedrooms (most)','geodirectory'),
265
-        'is_active'               => 1
266
-    );
267
-
268
-
269
-    /**
270
-     * Filter the array of advanced search fields DB table data.
271
-     *
272
-     * @since 1.6.6
273
-     * @param string $fields The default custom fields as an array.
274
-     */
275
-    $fields = apply_filters('geodir_property_sale_custom_fields_sort', $fields);
276
-
277
-    return $fields;
221
+	$fields = array();
222
+
223
+	// price sort
224
+	$fields[] = array(
225
+		'create_field'            => true,
226
+		'listing_type'            => $post_type,
227
+		'field_type'              => 'text',
228
+		'data_type'               => '',
229
+		'htmlvar_name'            => 'geodir_price',
230
+		'site_title'              => __('Price','geodirectory'),
231
+		'asc'                     => 1,
232
+		'asc_title'               => __('Price (lowest first)','geodirectory'),
233
+		'desc'                    => 1,
234
+		'desc_title'              => __('Price (highest first)','geodirectory'),
235
+		'is_active'               => 1
236
+	);
237
+
238
+	// area sort
239
+	$fields[] = array(
240
+		'create_field'            => true,
241
+		'listing_type'            => $post_type,
242
+		'field_type'              => 'text',
243
+		'data_type'               => '',
244
+		'htmlvar_name'            => 'geodir_property_area',
245
+		'site_title'              => __('Area (Sq Ft)','geodirectory'),
246
+		'asc'                     => 1,
247
+		'asc_title'               => __('Area (smallest first)','geodirectory'),
248
+		'desc'                    => 1,
249
+		'desc_title'              => __('Area (largest first)','geodirectory'),
250
+		'is_active'               => 1
251
+	);
252
+
253
+	// bedrooms sort
254
+	$fields[] = array(
255
+		'create_field'            => true,
256
+		'listing_type'            => $post_type,
257
+		'field_type'              => 'select',
258
+		'data_type'               => '',
259
+		'htmlvar_name'            => 'geodir_property_bedrooms',
260
+		'site_title'              => __('Area (Sq Ft)','geodirectory'),
261
+		'asc'                     => 1,
262
+		'asc_title'               => __('Bedrooms (least)','geodirectory'),
263
+		'desc'                    => 1,
264
+		'desc_title'              => __('Bedrooms (most)','geodirectory'),
265
+		'is_active'               => 1
266
+	);
267
+
268
+
269
+	/**
270
+	 * Filter the array of advanced search fields DB table data.
271
+	 *
272
+	 * @since 1.6.6
273
+	 * @param string $fields The default custom fields as an array.
274
+	 */
275
+	$fields = apply_filters('geodir_property_sale_custom_fields_sort', $fields);
276
+
277
+	return $fields;
278 278
 
279 279
 }
280 280
 
281 281
 function geodir_property_sale_custom_fields_advanced_search($post_type='gd_place') {
282 282
 
283 283
 
284
-    $fields = array();
285
-
286
-    // price range
287
-    $fields[] = array(
288
-        'create_field'            => true,
289
-        'listing_type'            => $post_type,
290
-        'field_type'              => 'text',
291
-        'data_type'               => 'RANGE',
292
-        'is_active'               => 1,
293
-        'site_field_title'        => 'Price',
294
-        'field_data_type'         => 'FLOAT',
295
-        'main_search'             => 1,
296
-        'main_search_priority'    => 15,
297
-        'data_type_change'        => 'SELECT',
298
-        'search_condition_select' => 'SINGLE',
299
-        'search_min_value'        => '50000',
300
-        'search_max_value'        => '1000000',
301
-        'search_diff_value'       => '100000',
302
-        'first_search_value'      => '0',
303
-        'first_search_text'       => '',
304
-        'last_search_text'        => '',
305
-        'search_condition'        => 'SELECT',
306
-        'site_htmlvar_name'       => 'geodir_price',
307
-        'htmlvar_name'            => 'geodir_price',
308
-        'field_title'             => 'geodir_price',
309
-        'expand_custom_value'     => '',
310
-        'front_search_title'      => 'Price Range',
311
-        'field_desc'              => ''
312
-    );
313
-
314
-    // bedrooms
315
-    $fields[] = array(
316
-        'create_field'            => true,
317
-        'listing_type'            => $post_type,
318
-        'field_type'              => 'select',
319
-        'data_type'               => 'CHECK',
320
-        'is_active'               => 1,
321
-        'site_field_title'        => 'Bedrooms',
322
-        'field_data_type'         => 'VARCHAR',
323
-        'main_search'             => 1,
324
-        'main_search_priority'    => 16,
325
-        'search_condition'        => 'SINGLE',
326
-        'site_htmlvar_name'       => 'geodir_property_bedrooms',
327
-        'htmlvar_name'            => 'geodir_property_bedrooms',
328
-        'field_title'             => 'geodir_property_bedrooms',
329
-        'front_search_title'      => 'Bedrooms',
330
-        'field_desc'              => '',
331
-        'expand_custom_value'     => 5,
332
-        'expand_search'           => 1,
333
-        'search_operator'         => 'OR'
334
-    );
335
-
336
-    // Property type
337
-    $fields[] = array(
338
-        'create_field'            => true,
339
-        'listing_type'            => $post_type,
340
-        'field_type'              => 'select',
341
-        'data_type'               => 'CHECK',
342
-        'is_active'               => 1,
343
-        'site_field_title'        => 'Property Type',
344
-        'field_data_type'         => 'VARCHAR',
345
-        'main_search'             => 0,
346
-        //'main_search_priority'    => 16,
347
-        'search_condition'        => 'SINGLE',
348
-        'site_htmlvar_name'       => 'geodir_property_type',
349
-        'htmlvar_name'            => 'geodir_property_type',
350
-        'field_title'             => 'geodir_property_type',
351
-        'front_search_title'      => 'Property Type',
352
-        'field_desc'              => '',
353
-        'expand_custom_value'     => 5,
354
-        'expand_search'           => 1,
355
-        'search_operator'         => 'OR'
356
-    );
357
-
358
-    // Property Features
359
-    $fields[] = array(
360
-        'create_field'            => true,
361
-        'listing_type'            => $post_type,
362
-        'field_type'              => 'multiselect',
363
-        'data_type'               => 'CHECK',
364
-        'is_active'               => 1,
365
-        'site_field_title'        => 'Features',
366
-        'field_data_type'         => 'VARCHAR',
367
-        'main_search'             => 0,
368
-        //'main_search_priority'    => 16,
369
-        'search_condition'        => 'SINGLE',
370
-        'site_htmlvar_name'       => 'geodir_property_features',
371
-        'htmlvar_name'            => 'geodir_property_features',
372
-        'field_title'             => 'geodir_property_features',
373
-        'front_search_title'      => 'Property Features',
374
-        'field_desc'              => '',
375
-        'expand_custom_value'     => 5,
376
-        'expand_search'           => 1,
377
-        'search_operator'         => 'AND'
378
-    );
379
-
380
-    // Property Bathrooms
381
-    $fields[] = array(
382
-        'create_field'            => true,
383
-        'listing_type'            => $post_type,
384
-        'field_type'              => 'select',
385
-        'data_type'               => 'CHECK',
386
-        'is_active'               => 1,
387
-        'site_field_title'        => 'Bathrooms',
388
-        'field_data_type'         => 'VARCHAR',
389
-        'main_search'             => 0,
390
-        //'main_search_priority'    => 16,
391
-        'search_condition'        => 'SINGLE',
392
-        'site_htmlvar_name'       => 'geodir_property_bathrooms',
393
-        'htmlvar_name'            => 'geodir_property_bathrooms',
394
-        'field_title'             => 'geodir_property_bathrooms',
395
-        'front_search_title'      => 'Bathrooms',
396
-        'field_desc'              => '',
397
-        'expand_custom_value'     => 5,
398
-        'expand_search'           => 1,
399
-        'search_operator'         => 'OR'
400
-    );
401
-
402
-    // Property Furnishing
403
-    $fields[] = array(
404
-        'create_field'            => true,
405
-        'listing_type'            => $post_type,
406
-        'field_type'              => 'select',
407
-        'data_type'               => 'CHECK',
408
-        'is_active'               => 1,
409
-        'site_field_title'        => 'Furnishing',
410
-        'field_data_type'         => 'VARCHAR',
411
-        'main_search'             => 0,
412
-        //'main_search_priority'    => 16,
413
-        'search_condition'        => 'SINGLE',
414
-        'site_htmlvar_name'       => 'geodir_property_furnishing',
415
-        'htmlvar_name'            => 'geodir_property_furnishing',
416
-        'field_title'             => 'geodir_property_furnishing',
417
-        'front_search_title'      => 'Furnishing',
418
-        'field_desc'              => '',
419
-        'expand_custom_value'     => 5,
420
-        'expand_search'           => 1,
421
-        'search_operator'         => 'OR'
422
-    );
423
-
424
-    // Property Status
425
-    $fields[] = array(
426
-        'create_field'            => true,
427
-        'listing_type'            => $post_type,
428
-        'field_type'              => 'select',
429
-        'data_type'               => 'CHECK',
430
-        'is_active'               => 1,
431
-        'site_field_title'        => 'Property Status',
432
-        'field_data_type'         => 'VARCHAR',
433
-        'main_search'             => 0,
434
-        //'main_search_priority'    => 16,
435
-        'search_condition'        => 'SINGLE',
436
-        'site_htmlvar_name'       => 'geodir_property_status',
437
-        'htmlvar_name'            => 'geodir_property_status',
438
-        'field_title'             => 'geodir_property_status',
439
-        'front_search_title'      => 'Property Status',
440
-        'field_desc'              => '',
441
-        'expand_custom_value'     => 5,
442
-        'expand_search'           => 1,
443
-        'search_operator'         => 'OR'
444
-    );
445
-
446
-
447
-
448
-    /**
449
-     * Filter the array of advanced search fields DB table data.
450
-     *
451
-     * @since 1.6.6
452
-     * @param string $fields The default custom fields as an array.
453
-     */
454
-    $fields = apply_filters('geodir_property_sale_custom_fields_advanced_search', $fields);
455
-
456
-    return $fields;
284
+	$fields = array();
285
+
286
+	// price range
287
+	$fields[] = array(
288
+		'create_field'            => true,
289
+		'listing_type'            => $post_type,
290
+		'field_type'              => 'text',
291
+		'data_type'               => 'RANGE',
292
+		'is_active'               => 1,
293
+		'site_field_title'        => 'Price',
294
+		'field_data_type'         => 'FLOAT',
295
+		'main_search'             => 1,
296
+		'main_search_priority'    => 15,
297
+		'data_type_change'        => 'SELECT',
298
+		'search_condition_select' => 'SINGLE',
299
+		'search_min_value'        => '50000',
300
+		'search_max_value'        => '1000000',
301
+		'search_diff_value'       => '100000',
302
+		'first_search_value'      => '0',
303
+		'first_search_text'       => '',
304
+		'last_search_text'        => '',
305
+		'search_condition'        => 'SELECT',
306
+		'site_htmlvar_name'       => 'geodir_price',
307
+		'htmlvar_name'            => 'geodir_price',
308
+		'field_title'             => 'geodir_price',
309
+		'expand_custom_value'     => '',
310
+		'front_search_title'      => 'Price Range',
311
+		'field_desc'              => ''
312
+	);
313
+
314
+	// bedrooms
315
+	$fields[] = array(
316
+		'create_field'            => true,
317
+		'listing_type'            => $post_type,
318
+		'field_type'              => 'select',
319
+		'data_type'               => 'CHECK',
320
+		'is_active'               => 1,
321
+		'site_field_title'        => 'Bedrooms',
322
+		'field_data_type'         => 'VARCHAR',
323
+		'main_search'             => 1,
324
+		'main_search_priority'    => 16,
325
+		'search_condition'        => 'SINGLE',
326
+		'site_htmlvar_name'       => 'geodir_property_bedrooms',
327
+		'htmlvar_name'            => 'geodir_property_bedrooms',
328
+		'field_title'             => 'geodir_property_bedrooms',
329
+		'front_search_title'      => 'Bedrooms',
330
+		'field_desc'              => '',
331
+		'expand_custom_value'     => 5,
332
+		'expand_search'           => 1,
333
+		'search_operator'         => 'OR'
334
+	);
335
+
336
+	// Property type
337
+	$fields[] = array(
338
+		'create_field'            => true,
339
+		'listing_type'            => $post_type,
340
+		'field_type'              => 'select',
341
+		'data_type'               => 'CHECK',
342
+		'is_active'               => 1,
343
+		'site_field_title'        => 'Property Type',
344
+		'field_data_type'         => 'VARCHAR',
345
+		'main_search'             => 0,
346
+		//'main_search_priority'    => 16,
347
+		'search_condition'        => 'SINGLE',
348
+		'site_htmlvar_name'       => 'geodir_property_type',
349
+		'htmlvar_name'            => 'geodir_property_type',
350
+		'field_title'             => 'geodir_property_type',
351
+		'front_search_title'      => 'Property Type',
352
+		'field_desc'              => '',
353
+		'expand_custom_value'     => 5,
354
+		'expand_search'           => 1,
355
+		'search_operator'         => 'OR'
356
+	);
357
+
358
+	// Property Features
359
+	$fields[] = array(
360
+		'create_field'            => true,
361
+		'listing_type'            => $post_type,
362
+		'field_type'              => 'multiselect',
363
+		'data_type'               => 'CHECK',
364
+		'is_active'               => 1,
365
+		'site_field_title'        => 'Features',
366
+		'field_data_type'         => 'VARCHAR',
367
+		'main_search'             => 0,
368
+		//'main_search_priority'    => 16,
369
+		'search_condition'        => 'SINGLE',
370
+		'site_htmlvar_name'       => 'geodir_property_features',
371
+		'htmlvar_name'            => 'geodir_property_features',
372
+		'field_title'             => 'geodir_property_features',
373
+		'front_search_title'      => 'Property Features',
374
+		'field_desc'              => '',
375
+		'expand_custom_value'     => 5,
376
+		'expand_search'           => 1,
377
+		'search_operator'         => 'AND'
378
+	);
379
+
380
+	// Property Bathrooms
381
+	$fields[] = array(
382
+		'create_field'            => true,
383
+		'listing_type'            => $post_type,
384
+		'field_type'              => 'select',
385
+		'data_type'               => 'CHECK',
386
+		'is_active'               => 1,
387
+		'site_field_title'        => 'Bathrooms',
388
+		'field_data_type'         => 'VARCHAR',
389
+		'main_search'             => 0,
390
+		//'main_search_priority'    => 16,
391
+		'search_condition'        => 'SINGLE',
392
+		'site_htmlvar_name'       => 'geodir_property_bathrooms',
393
+		'htmlvar_name'            => 'geodir_property_bathrooms',
394
+		'field_title'             => 'geodir_property_bathrooms',
395
+		'front_search_title'      => 'Bathrooms',
396
+		'field_desc'              => '',
397
+		'expand_custom_value'     => 5,
398
+		'expand_search'           => 1,
399
+		'search_operator'         => 'OR'
400
+	);
401
+
402
+	// Property Furnishing
403
+	$fields[] = array(
404
+		'create_field'            => true,
405
+		'listing_type'            => $post_type,
406
+		'field_type'              => 'select',
407
+		'data_type'               => 'CHECK',
408
+		'is_active'               => 1,
409
+		'site_field_title'        => 'Furnishing',
410
+		'field_data_type'         => 'VARCHAR',
411
+		'main_search'             => 0,
412
+		//'main_search_priority'    => 16,
413
+		'search_condition'        => 'SINGLE',
414
+		'site_htmlvar_name'       => 'geodir_property_furnishing',
415
+		'htmlvar_name'            => 'geodir_property_furnishing',
416
+		'field_title'             => 'geodir_property_furnishing',
417
+		'front_search_title'      => 'Furnishing',
418
+		'field_desc'              => '',
419
+		'expand_custom_value'     => 5,
420
+		'expand_search'           => 1,
421
+		'search_operator'         => 'OR'
422
+	);
423
+
424
+	// Property Status
425
+	$fields[] = array(
426
+		'create_field'            => true,
427
+		'listing_type'            => $post_type,
428
+		'field_type'              => 'select',
429
+		'data_type'               => 'CHECK',
430
+		'is_active'               => 1,
431
+		'site_field_title'        => 'Property Status',
432
+		'field_data_type'         => 'VARCHAR',
433
+		'main_search'             => 0,
434
+		//'main_search_priority'    => 16,
435
+		'search_condition'        => 'SINGLE',
436
+		'site_htmlvar_name'       => 'geodir_property_status',
437
+		'htmlvar_name'            => 'geodir_property_status',
438
+		'field_title'             => 'geodir_property_status',
439
+		'front_search_title'      => 'Property Status',
440
+		'field_desc'              => '',
441
+		'expand_custom_value'     => 5,
442
+		'expand_search'           => 1,
443
+		'search_operator'         => 'OR'
444
+	);
445
+
446
+
447
+
448
+	/**
449
+	 * Filter the array of advanced search fields DB table data.
450
+	 *
451
+	 * @since 1.6.6
452
+	 * @param string $fields The default custom fields as an array.
453
+	 */
454
+	$fields = apply_filters('geodir_property_sale_custom_fields_advanced_search', $fields);
455
+
456
+	return $fields;
457 457
 }
458 458
 
459 459
 global $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2,$wpdb, $current_user,$dummy_post_index;
@@ -463,52 +463,52 @@  discard block
 block discarded – undo
463 463
 $category_array = array('Apartments', 'Houses', 'Commercial', 'Land');
464 464
 
465 465
 if($dummy_post_index==1){
466
-    // add the dummy categories
467
-    geodir_dummy_data_taxonomies($post_type,$category_array );
468
-
469
-    // add the dummy custom fields
470
-    $fields = geodir_property_sale_custom_fields($post_type);
471
-    geodir_create_dummy_fields($fields);
472
-
473
-    // add sort order items
474
-    $sort_fields = geodir_property_sale_custom_fields_sort($post_type);
475
-    foreach($sort_fields as $sort){
476
-        geodir_custom_sort_field_save($sort);
477
-    }
478
-
479
-    // update the type currently installed
480
-    update_option($post_type.'_dummy_data_type','property_sale');
481
-
482
-    // add the advanced search fields
483
-    if (defined('GEODIRADVANCESEARCH_VERSION')){
484
-        $search_fields = geodir_property_sale_custom_fields_advanced_search($post_type);
485
-        foreach($search_fields as $sfield){
486
-            geodir_custom_advance_search_field_save( $sfield );
487
-        }
488
-    }
466
+	// add the dummy categories
467
+	geodir_dummy_data_taxonomies($post_type,$category_array );
468
+
469
+	// add the dummy custom fields
470
+	$fields = geodir_property_sale_custom_fields($post_type);
471
+	geodir_create_dummy_fields($fields);
472
+
473
+	// add sort order items
474
+	$sort_fields = geodir_property_sale_custom_fields_sort($post_type);
475
+	foreach($sort_fields as $sort){
476
+		geodir_custom_sort_field_save($sort);
477
+	}
478
+
479
+	// update the type currently installed
480
+	update_option($post_type.'_dummy_data_type','property_sale');
481
+
482
+	// add the advanced search fields
483
+	if (defined('GEODIRADVANCESEARCH_VERSION')){
484
+		$search_fields = geodir_property_sale_custom_fields_advanced_search($post_type);
485
+		foreach($search_fields as $sfield){
486
+			geodir_custom_advance_search_field_save( $sfield );
487
+		}
488
+	}
489 489
 }
490 490
 
491 491
 if (geodir_dummy_folder_exists())
492
-    $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy";
492
+	$dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy";
493 493
 else
494
-    $dummy_image_url = 'https://wpgeodirectory.com/dummy';
494
+	$dummy_image_url = 'https://wpgeodirectory.com/dummy';
495 495
 
496 496
 $dummy_image_url = apply_filters('place_dummy_image_url', $dummy_image_url);
497 497
 
498 498
 switch ($dummy_post_index) {
499 499
 
500
-    case(1):
501
-        $image_array[] = "$dummy_image_url/ps/psf1.jpg";
502
-        $image_array[] = "$dummy_image_url/ps/psl1.jpg";
503
-        $image_array[] = "$dummy_image_url/ps/psb1.jpg";
504
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
505
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
500
+	case(1):
501
+		$image_array[] = "$dummy_image_url/ps/psf1.jpg";
502
+		$image_array[] = "$dummy_image_url/ps/psl1.jpg";
503
+		$image_array[] = "$dummy_image_url/ps/psb1.jpg";
504
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
505
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
506 506
 
507 507
 
508
-        $post_info[] = array(
509
-            "listing_type" => $post_type,
510
-            "post_title" => 'Eastern Lodge',
511
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec non augue ultrices, vulputate nulla at, consectetur ante. Quisque neque mi, vulputate quis nulla a, sollicitudin fringilla leo. Nam dictum id neque eu imperdiet. Curabitur ligula turpis, malesuada at lobortis commodo, vulputate volutpat arcu. Duis bibendum blandit aliquam. In ipsum diam, tristique ut bibendum vel, lobortis non tellus. Nulla ultricies, ante vitae placerat auctor, nisi quam blandit enim, sit amet aliquam est diam id urna. Suspendisse eget nibh volutpat, malesuada enim sed, egestas massa.
508
+		$post_info[] = array(
509
+			"listing_type" => $post_type,
510
+			"post_title" => 'Eastern Lodge',
511
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec non augue ultrices, vulputate nulla at, consectetur ante. Quisque neque mi, vulputate quis nulla a, sollicitudin fringilla leo. Nam dictum id neque eu imperdiet. Curabitur ligula turpis, malesuada at lobortis commodo, vulputate volutpat arcu. Duis bibendum blandit aliquam. In ipsum diam, tristique ut bibendum vel, lobortis non tellus. Nulla ultricies, ante vitae placerat auctor, nisi quam blandit enim, sit amet aliquam est diam id urna. Suspendisse eget nibh volutpat, malesuada enim sed, egestas massa.
512 512
 
513 513
 Aliquam ut odio ullamcorper, posuere enim sed, venenatis tortor. Donec justo elit, aliquam sed cursus sed, semper eget libero. Mauris consequat lorem sed fringilla tincidunt. Phasellus suscipit velit et elit tristique, ac commodo metus scelerisque. Vivamus finibus ipsum placerat pulvinar aliquet. Maecenas augue orci, blandit at nibh pharetra, condimentum congue ligula. Duis non ante sagittis odio convallis lacinia in quis sapien.
514 514
 
@@ -517,42 +517,42 @@  discard block
 block discarded – undo
517 517
 Vestibulum tristique quam eget bibendum pulvinar. Mauris sit amet magna ut arcu rutrum pellentesque feugiat et ipsum. Proin porta quam sed risus accumsan pharetra. Nulla quis semper nisl. Nulla facilisi. Nulla facilisi. Pellentesque euismod sollicitudin lacus vel ultricies. Vestibulum ut sem ut nulla ultricies convallis in at mi. Nunc vitae nibh arcu. Maecenas nunc enim, tempus a rhoncus eget, pellentesque ut erat.
518 518
 
519 519
 Suspendisse interdum accumsan magna et tempor. Suspendisse scelerisque at lorem sit amet faucibus. Aenean quis consectetur enim. Duis aliquet tristique tempus. Suspendisse id ullamcorper mauris. Aliquam in libero eu justo porttitor pulvinar. Nulla semper placerat lectus. Nulla mollis suscipit lacus, a blandit purus cursus non. Maecenas id tellus mi. Pellentesque sollicitudin nibh eget magna scelerisque consequat. Aliquam convallis orci arcu, et euismod dui cursus et. Donec nec pellentesque nulla, ac pretium massa. In gravida bibendum ornare.',
520
-            "post_images" => $image_array,
521
-            "post_category" => array($post_type.'category' => array($category_array[1])),
522
-            "post_tags" => array('Tags', 'Sample Tags'),
523
-            "geodir_video" => '',
524
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
525
-            "geodir_contact" => '(111) 677-4444',
526
-            "geodir_email" => '[email protected]',
527
-            "geodir_website" => 'http://example.com/',
528
-            "geodir_twitter" => 'http://example.com/',
529
-            "geodir_facebook" => 'http://example.com/',
530
-            "geodir_price" => '350000',
531
-            "geodir_property_status" => 'For Sale',
532
-            'geodir_property_furnishing' => 'Furnished',
533
-            'geodir_property_type' => 'Detached house',
534
-            'geodir_property_bedrooms' => '3',
535
-            'geodir_property_bathrooms' => '2',
536
-            'geodir_property_area' => '1850',
537
-            'geodir_property_features' => 'Gas Central Heating,Triple Glazing,Front Garden,Private driveway,Fireplace',
538
-            "post_dummy" => '1'
539
-        );
540
-
541
-
542
-        break;
543
-    case 2:
544
-        $image_array = array();
545
-        $post_meta = array();
546
-        $image_array[] = "$dummy_image_url/ps/psf2.jpg";
547
-        $image_array[] = "$dummy_image_url/ps/psl2.jpg";
548
-        $image_array[] = "$dummy_image_url/ps/psb2.jpg";
549
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
550
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
551
-
552
-        $post_info[] = array(
553
-            "listing_type" => $post_type,
554
-            "post_title" => 'Daisy Street',
555
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
520
+			"post_images" => $image_array,
521
+			"post_category" => array($post_type.'category' => array($category_array[1])),
522
+			"post_tags" => array('Tags', 'Sample Tags'),
523
+			"geodir_video" => '',
524
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
525
+			"geodir_contact" => '(111) 677-4444',
526
+			"geodir_email" => '[email protected]',
527
+			"geodir_website" => 'http://example.com/',
528
+			"geodir_twitter" => 'http://example.com/',
529
+			"geodir_facebook" => 'http://example.com/',
530
+			"geodir_price" => '350000',
531
+			"geodir_property_status" => 'For Sale',
532
+			'geodir_property_furnishing' => 'Furnished',
533
+			'geodir_property_type' => 'Detached house',
534
+			'geodir_property_bedrooms' => '3',
535
+			'geodir_property_bathrooms' => '2',
536
+			'geodir_property_area' => '1850',
537
+			'geodir_property_features' => 'Gas Central Heating,Triple Glazing,Front Garden,Private driveway,Fireplace',
538
+			"post_dummy" => '1'
539
+		);
540
+
541
+
542
+		break;
543
+	case 2:
544
+		$image_array = array();
545
+		$post_meta = array();
546
+		$image_array[] = "$dummy_image_url/ps/psf2.jpg";
547
+		$image_array[] = "$dummy_image_url/ps/psl2.jpg";
548
+		$image_array[] = "$dummy_image_url/ps/psb2.jpg";
549
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
550
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
551
+
552
+		$post_info[] = array(
553
+			"listing_type" => $post_type,
554
+			"post_title" => 'Daisy Street',
555
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
556 556
 
557 557
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
558 558
 
@@ -562,42 +562,42 @@  discard block
 block discarded – undo
562 562
 
563 563
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
564 564
 
565
-            "post_images" => $image_array,
566
-            "post_category" => array($post_type.'category' => array($category_array[1])),
567
-            "post_tags" => array('Garage'),
568
-            "geodir_video" => '',
569
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
570
-            "geodir_contact" => '(222) 777-1111',
571
-            "geodir_email" => '[email protected]',
572
-            "geodir_website" => 'http://example.com/',
573
-            "geodir_twitter" => 'http://example.com/',
574
-            "geodir_facebook" => 'http://example.com/',
575
-            "geodir_price" => '230000',
576
-            "geodir_property_status" => 'Sold',
577
-            'geodir_property_furnishing' => 'Unfurnished',
578
-            'geodir_property_type' => 'Detached house',
579
-            'geodir_property_bedrooms' => '5',
580
-            'geodir_property_bathrooms' => '3',
581
-            'geodir_property_area' => '2650',
582
-            'geodir_property_features' => 'Select Features/,Oil Central Heating,Front Garden,Garage,Private driveway,Fireplace',
583
-            "post_dummy" => '1'
584
-        );
585
-
586
-        break;
587
-
588
-    case 3:
589
-        $image_array = array();
590
-        $post_meta = array();
591
-        $image_array[] = "$dummy_image_url/ps/psf3.jpg";
592
-        $image_array[] = "$dummy_image_url/ps/psl3.jpg";
593
-        $image_array[] = "$dummy_image_url/ps/psb3.jpg";
594
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
595
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
596
-
597
-        $post_info[] = array(
598
-            "listing_type" => $post_type,
599
-            "post_title" => 'Northbay House',
600
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
565
+			"post_images" => $image_array,
566
+			"post_category" => array($post_type.'category' => array($category_array[1])),
567
+			"post_tags" => array('Garage'),
568
+			"geodir_video" => '',
569
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
570
+			"geodir_contact" => '(222) 777-1111',
571
+			"geodir_email" => '[email protected]',
572
+			"geodir_website" => 'http://example.com/',
573
+			"geodir_twitter" => 'http://example.com/',
574
+			"geodir_facebook" => 'http://example.com/',
575
+			"geodir_price" => '230000',
576
+			"geodir_property_status" => 'Sold',
577
+			'geodir_property_furnishing' => 'Unfurnished',
578
+			'geodir_property_type' => 'Detached house',
579
+			'geodir_property_bedrooms' => '5',
580
+			'geodir_property_bathrooms' => '3',
581
+			'geodir_property_area' => '2650',
582
+			'geodir_property_features' => 'Select Features/,Oil Central Heating,Front Garden,Garage,Private driveway,Fireplace',
583
+			"post_dummy" => '1'
584
+		);
585
+
586
+		break;
587
+
588
+	case 3:
589
+		$image_array = array();
590
+		$post_meta = array();
591
+		$image_array[] = "$dummy_image_url/ps/psf3.jpg";
592
+		$image_array[] = "$dummy_image_url/ps/psl3.jpg";
593
+		$image_array[] = "$dummy_image_url/ps/psb3.jpg";
594
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
595
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
596
+
597
+		$post_info[] = array(
598
+			"listing_type" => $post_type,
599
+			"post_title" => 'Northbay House',
600
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
601 601
 
602 602
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
603 603
 
@@ -607,43 +607,43 @@  discard block
 block discarded – undo
607 607
 
608 608
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
609 609
 
610
-            "post_images" => $image_array,
611
-            "post_category" => array($post_type.'category' => array($category_array[1])),
612
-            "post_tags" => array('Tags', 'Sample Tags'),
613
-            "geodir_video" => '',
614
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
615
-            "geodir_contact" => '(222) 777-1111',
616
-            "geodir_email" => '[email protected]',
617
-            "geodir_website" => 'http://example.com/',
618
-            "geodir_twitter" => 'http://example.com/',
619
-            "geodir_facebook" => 'http://example.com/',
620
-            "geodir_price" => '260000',
621
-            "geodir_property_status" => 'Under Offer',
622
-            'geodir_property_furnishing' => 'Unfurnished',
623
-            'geodir_property_type' => 'Detached house',
624
-            'geodir_property_bedrooms' => '6',
625
-            'geodir_property_bathrooms' => '6',
626
-            'geodir_property_area' => '1650',
627
-            'geodir_property_features' => 'Select Features/,Gas Central Heating,Triple Glazing,Off Road Parking,Fireplace',
628
-            "post_dummy" => '1'
629
-        );
630
-
631
-        break;
632
-
633
-
634
-    case 4:
635
-        $image_array = array();
636
-        $post_meta = array();
637
-        $image_array[] = "$dummy_image_url/ps/psf4.jpg";
638
-        $image_array[] = "$dummy_image_url/ps/psl4.jpg";
639
-        $image_array[] = "$dummy_image_url/ps/psb4.jpg";
640
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
641
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
642
-
643
-        $post_info[] = array(
644
-            "listing_type" => $post_type,
645
-            "post_title" => 'Jesmond Mansion',
646
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
610
+			"post_images" => $image_array,
611
+			"post_category" => array($post_type.'category' => array($category_array[1])),
612
+			"post_tags" => array('Tags', 'Sample Tags'),
613
+			"geodir_video" => '',
614
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
615
+			"geodir_contact" => '(222) 777-1111',
616
+			"geodir_email" => '[email protected]',
617
+			"geodir_website" => 'http://example.com/',
618
+			"geodir_twitter" => 'http://example.com/',
619
+			"geodir_facebook" => 'http://example.com/',
620
+			"geodir_price" => '260000',
621
+			"geodir_property_status" => 'Under Offer',
622
+			'geodir_property_furnishing' => 'Unfurnished',
623
+			'geodir_property_type' => 'Detached house',
624
+			'geodir_property_bedrooms' => '6',
625
+			'geodir_property_bathrooms' => '6',
626
+			'geodir_property_area' => '1650',
627
+			'geodir_property_features' => 'Select Features/,Gas Central Heating,Triple Glazing,Off Road Parking,Fireplace',
628
+			"post_dummy" => '1'
629
+		);
630
+
631
+		break;
632
+
633
+
634
+	case 4:
635
+		$image_array = array();
636
+		$post_meta = array();
637
+		$image_array[] = "$dummy_image_url/ps/psf4.jpg";
638
+		$image_array[] = "$dummy_image_url/ps/psl4.jpg";
639
+		$image_array[] = "$dummy_image_url/ps/psb4.jpg";
640
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
641
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
642
+
643
+		$post_info[] = array(
644
+			"listing_type" => $post_type,
645
+			"post_title" => 'Jesmond Mansion',
646
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
647 647
 
648 648
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
649 649
 
@@ -653,42 +653,42 @@  discard block
 block discarded – undo
653 653
 
654 654
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
655 655
 
656
-            "post_images" => $image_array,
657
-            "post_category" => array($post_type.'category' => array($category_array[1])),
658
-            "post_tags" => array('Tags', 'Sample Tags'),
659
-            "geodir_video" => '',
660
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
661
-            "geodir_contact" => '(222) 777-1111',
662
-            "geodir_email" => '[email protected]',
663
-            "geodir_website" => 'http://example.com/',
664
-            "geodir_twitter" => 'http://example.com/',
665
-            "geodir_facebook" => 'http://example.com/',
666
-            "geodir_price" => '2300000',
667
-            "geodir_property_status" => 'Under Offer',
668
-            'geodir_property_furnishing' => 'Partially furnished',
669
-            'geodir_property_type' => 'Detached house',
670
-            'geodir_property_bedrooms' => '10',
671
-            'geodir_property_bathrooms' => '7',
672
-            'geodir_property_area' => '6600',
673
-            'geodir_property_features' => 'Select Features/,Oil Central Heating,Double Glazing,Front Garden,Garage,Private driveway,Fireplace',
674
-            "post_dummy" => '1'
675
-        );
676
-
677
-        break;
678
-
679
-    case 5:
680
-        $image_array = array();
681
-        $post_meta = array();
682
-        $image_array[] = "$dummy_image_url/ps/psf5.jpg";
683
-        $image_array[] = "$dummy_image_url/ps/psl5.jpg";
684
-        $image_array[] = "$dummy_image_url/ps/psb5.jpg";
685
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
686
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
687
-
688
-        $post_info[] = array(
689
-            "listing_type" => $post_type,
690
-            "post_title" => 'Springfield Lodge',
691
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
656
+			"post_images" => $image_array,
657
+			"post_category" => array($post_type.'category' => array($category_array[1])),
658
+			"post_tags" => array('Tags', 'Sample Tags'),
659
+			"geodir_video" => '',
660
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
661
+			"geodir_contact" => '(222) 777-1111',
662
+			"geodir_email" => '[email protected]',
663
+			"geodir_website" => 'http://example.com/',
664
+			"geodir_twitter" => 'http://example.com/',
665
+			"geodir_facebook" => 'http://example.com/',
666
+			"geodir_price" => '2300000',
667
+			"geodir_property_status" => 'Under Offer',
668
+			'geodir_property_furnishing' => 'Partially furnished',
669
+			'geodir_property_type' => 'Detached house',
670
+			'geodir_property_bedrooms' => '10',
671
+			'geodir_property_bathrooms' => '7',
672
+			'geodir_property_area' => '6600',
673
+			'geodir_property_features' => 'Select Features/,Oil Central Heating,Double Glazing,Front Garden,Garage,Private driveway,Fireplace',
674
+			"post_dummy" => '1'
675
+		);
676
+
677
+		break;
678
+
679
+	case 5:
680
+		$image_array = array();
681
+		$post_meta = array();
682
+		$image_array[] = "$dummy_image_url/ps/psf5.jpg";
683
+		$image_array[] = "$dummy_image_url/ps/psl5.jpg";
684
+		$image_array[] = "$dummy_image_url/ps/psb5.jpg";
685
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
686
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
687
+
688
+		$post_info[] = array(
689
+			"listing_type" => $post_type,
690
+			"post_title" => 'Springfield Lodge',
691
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
692 692
 
693 693
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
694 694
 
@@ -698,42 +698,42 @@  discard block
 block discarded – undo
698 698
 
699 699
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
700 700
 
701
-            "post_images" => $image_array,
702
-            "post_category" => array($post_type.'category' => array($category_array[1])),
703
-            "post_tags" => array('Tags', 'Sample Tags'),
704
-            "geodir_video" => '',
705
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
706
-            "geodir_contact" => '(222) 777-1111',
707
-            "geodir_email" => '[email protected]',
708
-            "geodir_website" => 'http://example.com/',
709
-            "geodir_twitter" => 'http://example.com/',
710
-            "geodir_facebook" => 'http://example.com/',
711
-            "geodir_price" => '330000',
712
-            "geodir_property_status" => 'For Sale',
713
-            'geodir_property_furnishing' => 'Optional',
714
-            'geodir_property_type' => 'Detached house',
715
-            'geodir_property_bedrooms' => '4',
716
-            'geodir_property_bathrooms' => '3',
717
-            'geodir_property_area' => '3700',
718
-            'geodir_property_features' => 'Select Features/,Oil Central Heating,Double Glazing,Front Garden',
719
-            "post_dummy" => '1'
720
-        );
721
-
722
-        break;
723
-
724
-    case 6:
725
-        $image_array = array();
726
-        $post_meta = array();
727
-        $image_array[] = "$dummy_image_url/ps/psf6.jpg";
728
-        $image_array[] = "$dummy_image_url/ps/psl6.jpg";
729
-        $image_array[] = "$dummy_image_url/ps/psb5.jpg";
730
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
731
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
732
-
733
-        $post_info[] = array(
734
-            "listing_type" => $post_type,
735
-            "post_title" => 'Forrest Park',
736
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
701
+			"post_images" => $image_array,
702
+			"post_category" => array($post_type.'category' => array($category_array[1])),
703
+			"post_tags" => array('Tags', 'Sample Tags'),
704
+			"geodir_video" => '',
705
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
706
+			"geodir_contact" => '(222) 777-1111',
707
+			"geodir_email" => '[email protected]',
708
+			"geodir_website" => 'http://example.com/',
709
+			"geodir_twitter" => 'http://example.com/',
710
+			"geodir_facebook" => 'http://example.com/',
711
+			"geodir_price" => '330000',
712
+			"geodir_property_status" => 'For Sale',
713
+			'geodir_property_furnishing' => 'Optional',
714
+			'geodir_property_type' => 'Detached house',
715
+			'geodir_property_bedrooms' => '4',
716
+			'geodir_property_bathrooms' => '3',
717
+			'geodir_property_area' => '3700',
718
+			'geodir_property_features' => 'Select Features/,Oil Central Heating,Double Glazing,Front Garden',
719
+			"post_dummy" => '1'
720
+		);
721
+
722
+		break;
723
+
724
+	case 6:
725
+		$image_array = array();
726
+		$post_meta = array();
727
+		$image_array[] = "$dummy_image_url/ps/psf6.jpg";
728
+		$image_array[] = "$dummy_image_url/ps/psl6.jpg";
729
+		$image_array[] = "$dummy_image_url/ps/psb5.jpg";
730
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
731
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
732
+
733
+		$post_info[] = array(
734
+			"listing_type" => $post_type,
735
+			"post_title" => 'Forrest Park',
736
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
737 737
 
738 738
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
739 739
 
@@ -743,42 +743,42 @@  discard block
 block discarded – undo
743 743
 
744 744
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
745 745
 
746
-            "post_images" => $image_array,
747
-            "post_category" => array($post_type.'category' => array($category_array[1])),
748
-            "post_tags" => array('Tags', 'Sample Tags'),
749
-            "geodir_video" => '',
750
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
751
-            "geodir_contact" => '(222) 777-1111',
752
-            "geodir_email" => '[email protected]',
753
-            "geodir_website" => 'http://example.com/',
754
-            "geodir_twitter" => 'http://example.com/',
755
-            "geodir_facebook" => 'http://example.com/',
756
-            "geodir_price" => '530000',
757
-            "geodir_property_status" => 'For Sale',
758
-            'geodir_property_furnishing' => 'Unfurnished',
759
-            'geodir_property_type' => 'Detached house',
760
-            'geodir_property_bedrooms' => '5',
761
-            'geodir_property_bathrooms' => '4',
762
-            'geodir_property_area' => '2250',
763
-            'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Front Garden,Private driveway',
764
-            "post_dummy" => '1'
765
-        );
766
-
767
-        break;
768
-
769
-    case 7:
770
-        $image_array = array();
771
-        $post_meta = array();
772
-        $image_array[] = "$dummy_image_url/ps/psf7.jpg";
773
-        $image_array[] = "$dummy_image_url/ps/psl4.jpg";
774
-        $image_array[] = "$dummy_image_url/ps/psb4.jpg";
775
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
776
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
777
-
778
-        $post_info[] = array(
779
-            "listing_type" => $post_type,
780
-            "post_title" => 'Fraser Suites',
781
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
746
+			"post_images" => $image_array,
747
+			"post_category" => array($post_type.'category' => array($category_array[1])),
748
+			"post_tags" => array('Tags', 'Sample Tags'),
749
+			"geodir_video" => '',
750
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
751
+			"geodir_contact" => '(222) 777-1111',
752
+			"geodir_email" => '[email protected]',
753
+			"geodir_website" => 'http://example.com/',
754
+			"geodir_twitter" => 'http://example.com/',
755
+			"geodir_facebook" => 'http://example.com/',
756
+			"geodir_price" => '530000',
757
+			"geodir_property_status" => 'For Sale',
758
+			'geodir_property_furnishing' => 'Unfurnished',
759
+			'geodir_property_type' => 'Detached house',
760
+			'geodir_property_bedrooms' => '5',
761
+			'geodir_property_bathrooms' => '4',
762
+			'geodir_property_area' => '2250',
763
+			'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Front Garden,Private driveway',
764
+			"post_dummy" => '1'
765
+		);
766
+
767
+		break;
768
+
769
+	case 7:
770
+		$image_array = array();
771
+		$post_meta = array();
772
+		$image_array[] = "$dummy_image_url/ps/psf7.jpg";
773
+		$image_array[] = "$dummy_image_url/ps/psl4.jpg";
774
+		$image_array[] = "$dummy_image_url/ps/psb4.jpg";
775
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
776
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
777
+
778
+		$post_info[] = array(
779
+			"listing_type" => $post_type,
780
+			"post_title" => 'Fraser Suites',
781
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
782 782
 
783 783
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
784 784
 
@@ -788,42 +788,42 @@  discard block
 block discarded – undo
788 788
 
789 789
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
790 790
 
791
-            "post_images" => $image_array,
792
-            "post_category" => array($post_type.'category' => array($category_array[0])),
793
-            "post_tags" => array('Tags', 'Sample Tags'),
794
-            "geodir_video" => '',
795
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
796
-            "geodir_contact" => '(222) 777-1111',
797
-            "geodir_email" => '[email protected]',
798
-            "geodir_website" => 'http://example.com/',
799
-            "geodir_twitter" => 'http://example.com/',
800
-            "geodir_facebook" => 'http://example.com/',
801
-            "geodir_price" => '245000',
802
-            "geodir_property_status" => 'For Sale',
803
-            'geodir_property_furnishing' => 'Unfurnished',
804
-            'geodir_property_type' => 'Apartment',
805
-            'geodir_property_bedrooms' => '3',
806
-            'geodir_property_bathrooms' => '2',
807
-            'geodir_property_area' => '1250',
808
-            'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing',
809
-            "post_dummy" => '1'
810
-        );
811
-
812
-        break;
813
-
814
-    case 8:
815
-        $image_array = array();
816
-        $post_meta = array();
817
-        $image_array[] = "$dummy_image_url/ps/psf8.jpg";
818
-        $image_array[] = "$dummy_image_url/ps/psl2.jpg";
819
-        $image_array[] = "$dummy_image_url/ps/psb2.jpg";
820
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
821
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
822
-
823
-        $post_info[] = array(
824
-            "listing_type" => $post_type,
825
-            "post_title" => 'Richmore Apartments',
826
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
791
+			"post_images" => $image_array,
792
+			"post_category" => array($post_type.'category' => array($category_array[0])),
793
+			"post_tags" => array('Tags', 'Sample Tags'),
794
+			"geodir_video" => '',
795
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
796
+			"geodir_contact" => '(222) 777-1111',
797
+			"geodir_email" => '[email protected]',
798
+			"geodir_website" => 'http://example.com/',
799
+			"geodir_twitter" => 'http://example.com/',
800
+			"geodir_facebook" => 'http://example.com/',
801
+			"geodir_price" => '245000',
802
+			"geodir_property_status" => 'For Sale',
803
+			'geodir_property_furnishing' => 'Unfurnished',
804
+			'geodir_property_type' => 'Apartment',
805
+			'geodir_property_bedrooms' => '3',
806
+			'geodir_property_bathrooms' => '2',
807
+			'geodir_property_area' => '1250',
808
+			'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing',
809
+			"post_dummy" => '1'
810
+		);
811
+
812
+		break;
813
+
814
+	case 8:
815
+		$image_array = array();
816
+		$post_meta = array();
817
+		$image_array[] = "$dummy_image_url/ps/psf8.jpg";
818
+		$image_array[] = "$dummy_image_url/ps/psl2.jpg";
819
+		$image_array[] = "$dummy_image_url/ps/psb2.jpg";
820
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
821
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
822
+
823
+		$post_info[] = array(
824
+			"listing_type" => $post_type,
825
+			"post_title" => 'Richmore Apartments',
826
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
827 827
 
828 828
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
829 829
 
@@ -833,43 +833,43 @@  discard block
 block discarded – undo
833 833
 
834 834
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
835 835
 
836
-            "post_images" => $image_array,
837
-            "post_category" => array($post_type.'category' => array($category_array[0])),
838
-            "post_tags" => array('Tags', 'Sample Tags'),
839
-            "geodir_video" => '',
840
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
841
-            "geodir_contact" => '(222) 777-1111',
842
-            "geodir_email" => '[email protected]',
843
-            "geodir_website" => 'http://example.com/',
844
-            "geodir_twitter" => 'http://example.com/',
845
-            "geodir_facebook" => 'http://example.com/',
846
-            "geodir_price" => '395000',
847
-            "geodir_property_status" => 'For Sale',
848
-            'geodir_property_furnishing' => 'Unfurnished',
849
-            'geodir_property_type' => 'Apartment',
850
-            'geodir_property_bedrooms' => '2',
851
-            'geodir_property_bathrooms' => '2',
852
-            'geodir_property_area' => '1750',
853
-            'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Garage',
854
-            "post_dummy" => '1'
855
-        );
856
-
857
-        break;
858
-
859
-
860
-    case 9:
861
-        $image_array = array();
862
-        $post_meta = array();
863
-        $image_array[] = "$dummy_image_url/ps/psf9.jpg";
864
-        $image_array[] = "$dummy_image_url/ps/psc9.jpg";
865
-        $image_array[] = "$dummy_image_url/ps/psb2.jpg";
866
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
867
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
868
-
869
-        $post_info[] = array(
870
-            "listing_type" => $post_type,
871
-            "post_title" => 'Hotel Alpina',
872
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
836
+			"post_images" => $image_array,
837
+			"post_category" => array($post_type.'category' => array($category_array[0])),
838
+			"post_tags" => array('Tags', 'Sample Tags'),
839
+			"geodir_video" => '',
840
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
841
+			"geodir_contact" => '(222) 777-1111',
842
+			"geodir_email" => '[email protected]',
843
+			"geodir_website" => 'http://example.com/',
844
+			"geodir_twitter" => 'http://example.com/',
845
+			"geodir_facebook" => 'http://example.com/',
846
+			"geodir_price" => '395000',
847
+			"geodir_property_status" => 'For Sale',
848
+			'geodir_property_furnishing' => 'Unfurnished',
849
+			'geodir_property_type' => 'Apartment',
850
+			'geodir_property_bedrooms' => '2',
851
+			'geodir_property_bathrooms' => '2',
852
+			'geodir_property_area' => '1750',
853
+			'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Garage',
854
+			"post_dummy" => '1'
855
+		);
856
+
857
+		break;
858
+
859
+
860
+	case 9:
861
+		$image_array = array();
862
+		$post_meta = array();
863
+		$image_array[] = "$dummy_image_url/ps/psf9.jpg";
864
+		$image_array[] = "$dummy_image_url/ps/psc9.jpg";
865
+		$image_array[] = "$dummy_image_url/ps/psb2.jpg";
866
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
867
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
868
+
869
+		$post_info[] = array(
870
+			"listing_type" => $post_type,
871
+			"post_title" => 'Hotel Alpina',
872
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
873 873
 
874 874
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
875 875
 
@@ -879,39 +879,39 @@  discard block
 block discarded – undo
879 879
 
880 880
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
881 881
 
882
-            "post_images" => $image_array,
883
-            "post_category" => array($post_type.'category' => array($category_array[2])),
884
-            "post_tags" => array('Tags', 'Sample Tags'),
885
-            "geodir_video" => '',
886
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
887
-            "geodir_contact" => '(222) 777-1111',
888
-            "geodir_email" => '[email protected]',
889
-            "geodir_website" => 'http://example.com/',
890
-            "geodir_twitter" => 'http://example.com/',
891
-            "geodir_facebook" => 'http://example.com/',
892
-            "geodir_price" => '12500000',
893
-            "geodir_property_status" => 'For Sale',
894
-            'geodir_property_furnishing' => 'Furnished',
895
-            'geodir_property_type' => 'Hotel',
896
-            'geodir_property_bedrooms' => '120',
897
-            'geodir_property_bathrooms' => '133',
898
-            'geodir_property_area' => '35000',
899
-            'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Garage',
900
-            "post_dummy" => '1'
901
-        );
902
-
903
-        break;
904
-
905
-    case 10:
906
-        $image_array = array();
907
-        $post_meta = array();
908
-        $image_array[] = "$dummy_image_url/ps/psf10.jpg";
909
-        $image_array[] = "$dummy_image_url/ps/psf102.jpg";
910
-
911
-        $post_info[] = array(
912
-            "listing_type" => $post_type,
913
-            "post_title" => 'Development Land',
914
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
882
+			"post_images" => $image_array,
883
+			"post_category" => array($post_type.'category' => array($category_array[2])),
884
+			"post_tags" => array('Tags', 'Sample Tags'),
885
+			"geodir_video" => '',
886
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
887
+			"geodir_contact" => '(222) 777-1111',
888
+			"geodir_email" => '[email protected]',
889
+			"geodir_website" => 'http://example.com/',
890
+			"geodir_twitter" => 'http://example.com/',
891
+			"geodir_facebook" => 'http://example.com/',
892
+			"geodir_price" => '12500000',
893
+			"geodir_property_status" => 'For Sale',
894
+			'geodir_property_furnishing' => 'Furnished',
895
+			'geodir_property_type' => 'Hotel',
896
+			'geodir_property_bedrooms' => '120',
897
+			'geodir_property_bathrooms' => '133',
898
+			'geodir_property_area' => '35000',
899
+			'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Garage',
900
+			"post_dummy" => '1'
901
+		);
902
+
903
+		break;
904
+
905
+	case 10:
906
+		$image_array = array();
907
+		$post_meta = array();
908
+		$image_array[] = "$dummy_image_url/ps/psf10.jpg";
909
+		$image_array[] = "$dummy_image_url/ps/psf102.jpg";
910
+
911
+		$post_info[] = array(
912
+			"listing_type" => $post_type,
913
+			"post_title" => 'Development Land',
914
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
915 915
 
916 916
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
917 917
 
@@ -921,93 +921,93 @@  discard block
 block discarded – undo
921 921
 
922 922
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
923 923
 
924
-            "post_images" => $image_array,
925
-            "post_category" => array($post_type.'category' => array($category_array[3])),
926
-            "post_tags" => array('Tags', 'Sample Tags'),
927
-            "geodir_video" => '',
928
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
929
-            "geodir_contact" => '(222) 777-1111',
930
-            "geodir_email" => '[email protected]',
931
-            "geodir_website" => 'http://example.com/',
932
-            "geodir_twitter" => 'http://example.com/',
933
-            "geodir_facebook" => 'http://example.com/',
934
-            "geodir_price" => '80000',
935
-            "geodir_property_status" => 'For Sale',
936
-            'geodir_property_furnishing' => '',
937
-            'geodir_property_type' => 'Land',
938
-            'geodir_property_bedrooms' => '',
939
-            'geodir_property_bathrooms' => '',
940
-            'geodir_property_area' => '250000',
941
-            'geodir_property_features' => '',
942
-            "post_dummy" => '1'
943
-        );
944
-
945
-        break;
924
+			"post_images" => $image_array,
925
+			"post_category" => array($post_type.'category' => array($category_array[3])),
926
+			"post_tags" => array('Tags', 'Sample Tags'),
927
+			"geodir_video" => '',
928
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
929
+			"geodir_contact" => '(222) 777-1111',
930
+			"geodir_email" => '[email protected]',
931
+			"geodir_website" => 'http://example.com/',
932
+			"geodir_twitter" => 'http://example.com/',
933
+			"geodir_facebook" => 'http://example.com/',
934
+			"geodir_price" => '80000',
935
+			"geodir_property_status" => 'For Sale',
936
+			'geodir_property_furnishing' => '',
937
+			'geodir_property_type' => 'Land',
938
+			'geodir_property_bedrooms' => '',
939
+			'geodir_property_bathrooms' => '',
940
+			'geodir_property_area' => '250000',
941
+			'geodir_property_features' => '',
942
+			"post_dummy" => '1'
943
+		);
944
+
945
+		break;
946 946
 
947 947
 } // end of switch
948 948
 
949 949
 foreach ($post_info as $post_info) {
950
-    $default_location = geodir_get_default_location();
951
-    if ($city_bound_lat1 > $city_bound_lat2)
952
-        $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat1, $city_bound_lat2), geodir_random_float($city_bound_lat2, $city_bound_lat1));
953
-    else
954
-        $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat2, $city_bound_lat1), geodir_random_float($city_bound_lat1, $city_bound_lat2));
950
+	$default_location = geodir_get_default_location();
951
+	if ($city_bound_lat1 > $city_bound_lat2)
952
+		$dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat1, $city_bound_lat2), geodir_random_float($city_bound_lat2, $city_bound_lat1));
953
+	else
954
+		$dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat2, $city_bound_lat1), geodir_random_float($city_bound_lat1, $city_bound_lat2));
955 955
 
956 956
 
957
-    if ($city_bound_lng1 > $city_bound_lng2)
958
-        $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng1, $city_bound_lng2), geodir_random_float($city_bound_lng2, $city_bound_lng1));
959
-    else
960
-        $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng2, $city_bound_lng1), geodir_random_float($city_bound_lng1, $city_bound_lng2));
957
+	if ($city_bound_lng1 > $city_bound_lng2)
958
+		$dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng1, $city_bound_lng2), geodir_random_float($city_bound_lng2, $city_bound_lng1));
959
+	else
960
+		$dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng2, $city_bound_lng1), geodir_random_float($city_bound_lng1, $city_bound_lng2));
961 961
 
962
-    $load_map = get_option('geodir_load_map');
962
+	$load_map = get_option('geodir_load_map');
963 963
     
964
-    if ($load_map == 'osm') {
965
-        $post_address = geodir_get_osm_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude);
966
-    } else {
967
-        $post_address = geodir_get_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude);
968
-    }
969
-
970
-    $postal_code = '';
971
-    if (!empty($post_address)) {
972
-        if ($load_map == 'osm') {
973
-            $address = !empty($post_address->formatted_address) ? $post_address->formatted_address : '';
974
-            $postal_code = !empty($post_address->address->postcode) ? $post_address->address->postcode : '';
975
-        } else {
976
-            $addresses = array();
977
-            $addresses_default = array();
964
+	if ($load_map == 'osm') {
965
+		$post_address = geodir_get_osm_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude);
966
+	} else {
967
+		$post_address = geodir_get_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude);
968
+	}
969
+
970
+	$postal_code = '';
971
+	if (!empty($post_address)) {
972
+		if ($load_map == 'osm') {
973
+			$address = !empty($post_address->formatted_address) ? $post_address->formatted_address : '';
974
+			$postal_code = !empty($post_address->address->postcode) ? $post_address->address->postcode : '';
975
+		} else {
976
+			$addresses = array();
977
+			$addresses_default = array();
978 978
             
979
-            foreach ($post_address as $add_key => $add_value) {
980
-                if ($add_key < 2 && !empty($add_value->long_name)) {
981
-                    $addresses_default[] = $add_value->long_name;
982
-                }
983
-                if ($add_value->types[0] == 'postal_code') {
984
-                    $postal_code = $add_value->long_name;
985
-                }
986
-                if ($add_value->types[0] == 'street_number') {
987
-                    $addresses[] = $add_value->long_name;
988
-                }
989
-                if ($add_value->types[0] == 'route') {
990
-                    $addresses[] = $add_value->long_name;
991
-                }
992
-                if ($add_value->types[0] == 'neighborhood') {
993
-                    $addresses[] = $add_value->long_name;
994
-                }
995
-                if ($add_value->types[0] == 'sublocality') {
996
-                    $addresses[] = $add_value->long_name;
997
-                }
998
-            }
999
-            $address = !empty($addresses) ? implode(', ', $addresses) : (!empty($addresses_default) ? implode(', ', $addresses_default) : '');
1000
-        }
1001
-
1002
-        $post_info['post_address'] = !empty($address) ? $address : $default_location->city;
1003
-        $post_info['post_city'] = $default_location->city;
1004
-        $post_info['post_region'] = $default_location->region;
1005
-        $post_info['post_country'] = $default_location->country;
1006
-        $post_info['post_zip'] = $postal_code;
1007
-        $post_info['post_latitude'] = $dummy_post_latitude;
1008
-        $post_info['post_longitude'] = $dummy_post_longitude;
1009
-    }
979
+			foreach ($post_address as $add_key => $add_value) {
980
+				if ($add_key < 2 && !empty($add_value->long_name)) {
981
+					$addresses_default[] = $add_value->long_name;
982
+				}
983
+				if ($add_value->types[0] == 'postal_code') {
984
+					$postal_code = $add_value->long_name;
985
+				}
986
+				if ($add_value->types[0] == 'street_number') {
987
+					$addresses[] = $add_value->long_name;
988
+				}
989
+				if ($add_value->types[0] == 'route') {
990
+					$addresses[] = $add_value->long_name;
991
+				}
992
+				if ($add_value->types[0] == 'neighborhood') {
993
+					$addresses[] = $add_value->long_name;
994
+				}
995
+				if ($add_value->types[0] == 'sublocality') {
996
+					$addresses[] = $add_value->long_name;
997
+				}
998
+			}
999
+			$address = !empty($addresses) ? implode(', ', $addresses) : (!empty($addresses_default) ? implode(', ', $addresses_default) : '');
1000
+		}
1001
+
1002
+		$post_info['post_address'] = !empty($address) ? $address : $default_location->city;
1003
+		$post_info['post_city'] = $default_location->city;
1004
+		$post_info['post_region'] = $default_location->region;
1005
+		$post_info['post_country'] = $default_location->country;
1006
+		$post_info['post_zip'] = $postal_code;
1007
+		$post_info['post_latitude'] = $dummy_post_latitude;
1008
+		$post_info['post_longitude'] = $dummy_post_longitude;
1009
+	}
1010 1010
     
1011
-    geodir_save_listing($post_info, true);
1012
-    echo 1;
1011
+	geodir_save_listing($post_info, true);
1012
+	echo 1;
1013 1013
 }
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -6,9 +6,9 @@  discard block
 block discarded – undo
6 6
  * @package GeoDirectory
7 7
  */
8 8
 
9
-function geodir_property_sale_custom_fields($post_type='gd_place',$package_id=''){
9
+function geodir_property_sale_custom_fields($post_type = 'gd_place', $package_id = '') {
10 10
     $fields = array();
11
-    $package = ($package_id=='') ? '' : array($package_id);
11
+    $package = ($package_id == '') ? '' : array($package_id);
12 12
 
13 13
     // price
14 14
     $fields[] = array('listing_type' => $post_type,
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
                       'default_value'       =>  '',
79 79
                       'show_in' 	        =>  '[detail],[listing]',
80 80
                       'is_required'         =>  true,
81
-                      'option_values'       =>  __('Select Status/,Unfurnished,Furnished,Partially furnished,Optional','geodirectory'),
81
+                      'option_values'       =>  __('Select Status/,Unfurnished,Furnished,Partially furnished,Optional', 'geodirectory'),
82 82
                       'validation_pattern'  =>  '',
83 83
                       'validation_msg'      =>  '',
84 84
                       'required_msg'        =>  '',
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
                       'default_value'       =>  '',
102 102
                       'show_in' 	        =>  '[detail],[listing]',
103 103
                       'is_required'         =>  true,
104
-                      'option_values'       =>  __('Select Type/,Detached house,Semi-detached house,Apartment,Bungalow,Semi-detached bungalow,Chalet,Town House,End-terrace house,Terrace house,Cottage,Hotel,Land','geodirectory'),
104
+                      'option_values'       =>  __('Select Type/,Detached house,Semi-detached house,Apartment,Bungalow,Semi-detached bungalow,Chalet,Town House,End-terrace house,Terrace house,Cottage,Hotel,Land', 'geodirectory'),
105 105
                       'validation_pattern'  =>  '',
106 106
                       'validation_msg'      =>  '',
107 107
                       'required_msg'        =>  '',
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
                       'default_value'       =>  '',
125 125
                       'show_in' 	        =>  '[detail],[listing]',
126 126
                       'is_required'         =>  true,
127
-                      'option_values'       =>  __('Select Bedrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'),
127
+                      'option_values'       =>  __('Select Bedrooms/,1,2,3,4,5,6,7,8,9,10', 'geodirectory'),
128 128
                       'validation_pattern'  =>  '',
129 129
                       'validation_msg'      =>  '',
130 130
                       'required_msg'        =>  '',
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
                       'default_value'       =>  '',
148 148
                       'show_in' 	        =>  '[detail],[listing]',
149 149
                       'is_required'         =>  true,
150
-                      'option_values'       =>  __('Select Bathrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'),
150
+                      'option_values'       =>  __('Select Bathrooms/,1,2,3,4,5,6,7,8,9,10', 'geodirectory'),
151 151
                       'validation_pattern'  =>  '',
152 152
                       'validation_msg'      =>  '',
153 153
                       'required_msg'        =>  '',
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
                       'default_value'       =>  '',
193 193
                       'show_in' 	        =>  '[detail],[listing]',
194 194
                       'is_required'         =>  false,
195
-                      'option_values'       =>  __('Gas Central Heating,Oil Central Heating,Double Glazing,Triple Glazing,Front Garden,Garage,Private driveway,Off Road Parking,Fireplace','geodirectory'),
195
+                      'option_values'       =>  __('Gas Central Heating,Oil Central Heating,Double Glazing,Triple Glazing,Front Garden,Garage,Private driveway,Off Road Parking,Fireplace', 'geodirectory'),
196 196
                       'validation_pattern'  =>  '',
197 197
                       'validation_msg'      =>  '',
198 198
                       'required_msg'        =>  '',
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
     return  $fields;
216 216
 }
217 217
 
218
-function geodir_property_sale_custom_fields_sort($post_type='gd_place') {
218
+function geodir_property_sale_custom_fields_sort($post_type = 'gd_place') {
219 219
 
220 220
 
221 221
     $fields = array();
@@ -227,11 +227,11 @@  discard block
 block discarded – undo
227 227
         'field_type'              => 'text',
228 228
         'data_type'               => '',
229 229
         'htmlvar_name'            => 'geodir_price',
230
-        'site_title'              => __('Price','geodirectory'),
230
+        'site_title'              => __('Price', 'geodirectory'),
231 231
         'asc'                     => 1,
232
-        'asc_title'               => __('Price (lowest first)','geodirectory'),
232
+        'asc_title'               => __('Price (lowest first)', 'geodirectory'),
233 233
         'desc'                    => 1,
234
-        'desc_title'              => __('Price (highest first)','geodirectory'),
234
+        'desc_title'              => __('Price (highest first)', 'geodirectory'),
235 235
         'is_active'               => 1
236 236
     );
237 237
 
@@ -242,11 +242,11 @@  discard block
 block discarded – undo
242 242
         'field_type'              => 'text',
243 243
         'data_type'               => '',
244 244
         'htmlvar_name'            => 'geodir_property_area',
245
-        'site_title'              => __('Area (Sq Ft)','geodirectory'),
245
+        'site_title'              => __('Area (Sq Ft)', 'geodirectory'),
246 246
         'asc'                     => 1,
247
-        'asc_title'               => __('Area (smallest first)','geodirectory'),
247
+        'asc_title'               => __('Area (smallest first)', 'geodirectory'),
248 248
         'desc'                    => 1,
249
-        'desc_title'              => __('Area (largest first)','geodirectory'),
249
+        'desc_title'              => __('Area (largest first)', 'geodirectory'),
250 250
         'is_active'               => 1
251 251
     );
252 252
 
@@ -257,11 +257,11 @@  discard block
 block discarded – undo
257 257
         'field_type'              => 'select',
258 258
         'data_type'               => '',
259 259
         'htmlvar_name'            => 'geodir_property_bedrooms',
260
-        'site_title'              => __('Area (Sq Ft)','geodirectory'),
260
+        'site_title'              => __('Area (Sq Ft)', 'geodirectory'),
261 261
         'asc'                     => 1,
262
-        'asc_title'               => __('Bedrooms (least)','geodirectory'),
262
+        'asc_title'               => __('Bedrooms (least)', 'geodirectory'),
263 263
         'desc'                    => 1,
264
-        'desc_title'              => __('Bedrooms (most)','geodirectory'),
264
+        'desc_title'              => __('Bedrooms (most)', 'geodirectory'),
265 265
         'is_active'               => 1
266 266
     );
267 267
 
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
 
279 279
 }
280 280
 
281
-function geodir_property_sale_custom_fields_advanced_search($post_type='gd_place') {
281
+function geodir_property_sale_custom_fields_advanced_search($post_type = 'gd_place') {
282 282
 
283 283
 
284 284
     $fields = array();
@@ -456,15 +456,15 @@  discard block
 block discarded – undo
456 456
     return $fields;
457 457
 }
458 458
 
459
-global $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2,$wpdb, $current_user,$dummy_post_index;
459
+global $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2, $wpdb, $current_user, $dummy_post_index;
460 460
 $post_info = array();
461 461
 $image_array = array();
462 462
 $post_meta = array();
463 463
 $category_array = array('Apartments', 'Houses', 'Commercial', 'Land');
464 464
 
465
-if($dummy_post_index==1){
465
+if ($dummy_post_index == 1) {
466 466
     // add the dummy categories
467
-    geodir_dummy_data_taxonomies($post_type,$category_array );
467
+    geodir_dummy_data_taxonomies($post_type, $category_array);
468 468
 
469 469
     // add the dummy custom fields
470 470
     $fields = geodir_property_sale_custom_fields($post_type);
@@ -472,24 +472,24 @@  discard block
 block discarded – undo
472 472
 
473 473
     // add sort order items
474 474
     $sort_fields = geodir_property_sale_custom_fields_sort($post_type);
475
-    foreach($sort_fields as $sort){
475
+    foreach ($sort_fields as $sort) {
476 476
         geodir_custom_sort_field_save($sort);
477 477
     }
478 478
 
479 479
     // update the type currently installed
480
-    update_option($post_type.'_dummy_data_type','property_sale');
480
+    update_option($post_type.'_dummy_data_type', 'property_sale');
481 481
 
482 482
     // add the advanced search fields
483
-    if (defined('GEODIRADVANCESEARCH_VERSION')){
483
+    if (defined('GEODIRADVANCESEARCH_VERSION')) {
484 484
         $search_fields = geodir_property_sale_custom_fields_advanced_search($post_type);
485
-        foreach($search_fields as $sfield){
486
-            geodir_custom_advance_search_field_save( $sfield );
485
+        foreach ($search_fields as $sfield) {
486
+            geodir_custom_advance_search_field_save($sfield);
487 487
         }
488 488
     }
489 489
 }
490 490
 
491 491
 if (geodir_dummy_folder_exists())
492
-    $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy";
492
+    $dummy_image_url = geodir_plugin_url()."/geodirectory-admin/dummy";
493 493
 else
494 494
     $dummy_image_url = 'https://wpgeodirectory.com/dummy';
495 495
 
Please login to merge, or discard this patch.
Braces   +13 added lines, -10 removed lines patch added patch discarded remove patch
@@ -488,10 +488,11 @@  discard block
 block discarded – undo
488 488
     }
489 489
 }
490 490
 
491
-if (geodir_dummy_folder_exists())
491
+if (geodir_dummy_folder_exists()) {
492 492
     $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy";
493
-else
493
+} else {
494 494
     $dummy_image_url = 'https://wpgeodirectory.com/dummy';
495
+}
495 496
 
496 497
 $dummy_image_url = apply_filters('place_dummy_image_url', $dummy_image_url);
497 498
 
@@ -948,16 +949,18 @@  discard block
 block discarded – undo
948 949
 
949 950
 foreach ($post_info as $post_info) {
950 951
     $default_location = geodir_get_default_location();
951
-    if ($city_bound_lat1 > $city_bound_lat2)
952
-        $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat1, $city_bound_lat2), geodir_random_float($city_bound_lat2, $city_bound_lat1));
953
-    else
954
-        $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat2, $city_bound_lat1), geodir_random_float($city_bound_lat1, $city_bound_lat2));
952
+    if ($city_bound_lat1 > $city_bound_lat2) {
953
+            $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat1, $city_bound_lat2), geodir_random_float($city_bound_lat2, $city_bound_lat1));
954
+    } else {
955
+            $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat2, $city_bound_lat1), geodir_random_float($city_bound_lat1, $city_bound_lat2));
956
+    }
955 957
 
956 958
 
957
-    if ($city_bound_lng1 > $city_bound_lng2)
958
-        $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng1, $city_bound_lng2), geodir_random_float($city_bound_lng2, $city_bound_lng1));
959
-    else
960
-        $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng2, $city_bound_lng1), geodir_random_float($city_bound_lng1, $city_bound_lng2));
959
+    if ($city_bound_lng1 > $city_bound_lng2) {
960
+            $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng1, $city_bound_lng2), geodir_random_float($city_bound_lng2, $city_bound_lng1));
961
+    } else {
962
+            $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng2, $city_bound_lng1), geodir_random_float($city_bound_lng1, $city_bound_lng2));
963
+    }
961 964
 
962 965
     $load_map = get_option('geodir_load_map');
963 966
     
Please login to merge, or discard this patch.