@@ -714,8 +714,9 @@ discard block |
||
| 714 | 714 | |
| 715 | 715 | if (isset($post->post_default_category) && $post->post_default_category == $cat_id) {
|
| 716 | 716 | if ($term_icon_url = get_tax_meta($cat_id, 'ct_cat_icon', false, $post_type)) {
|
| 717 | - if (isset($term_icon_url['src']) && $term_icon_url['src'] != '') |
|
| 718 | - $term_icon = $term_icon_url['src']; |
|
| 717 | + if (isset($term_icon_url['src']) && $term_icon_url['src'] != '') { |
|
| 718 | + $term_icon = $term_icon_url['src']; |
|
| 719 | + } |
|
| 719 | 720 | break; |
| 720 | 721 | } |
| 721 | 722 | } |
@@ -1246,8 +1247,9 @@ discard block |
||
| 1246 | 1247 | echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>'; |
| 1247 | 1248 | } |
| 1248 | 1249 | |
| 1249 | - if (isset($taxonomies[$post_type . '_tags'])) |
|
| 1250 | - echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>'; |
|
| 1250 | + if (isset($taxonomies[$post_type . '_tags'])) { |
|
| 1251 | + echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>'; |
|
| 1252 | + } |
|
| 1251 | 1253 | |
| 1252 | 1254 | ?> |
| 1253 | 1255 | </p><?php |
@@ -1598,23 +1600,21 @@ discard block |
||
| 1598 | 1600 | if(geodir_is_page('pt')){
|
| 1599 | 1601 | $gd_page = 'pt'; |
| 1600 | 1602 | $title = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
|
| 1601 | - } |
|
| 1602 | - elseif(geodir_is_page('listing')){
|
|
| 1603 | + } elseif(geodir_is_page('listing')){
|
|
| 1603 | 1604 | $gd_page = 'listing'; |
| 1604 | 1605 | global $wp_query; |
| 1605 | 1606 | $current_term = $wp_query->get_queried_object(); |
| 1606 | 1607 | if (strpos($current_term->taxonomy,'_tags') !== false) {
|
| 1607 | 1608 | $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
|
| 1608 | - }else{
|
|
| 1609 | + } else{
|
|
| 1609 | 1610 | $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
|
| 1610 | 1611 | } |
| 1611 | 1612 | |
| 1612 | - } |
|
| 1613 | - elseif(geodir_is_page('author')){
|
|
| 1613 | + } elseif(geodir_is_page('author')){
|
|
| 1614 | 1614 | $gd_page = 'author'; |
| 1615 | 1615 | if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
|
| 1616 | 1616 | $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
|
| 1617 | - }else{
|
|
| 1617 | + } else{
|
|
| 1618 | 1618 | $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
|
| 1619 | 1619 | } |
| 1620 | 1620 | |
@@ -2025,8 +2025,9 @@ discard block |
||
| 2025 | 2025 | */ |
| 2026 | 2026 | function geodir_action_add_listing_page_title() |
| 2027 | 2027 | {
|
| 2028 | - if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '') |
|
| 2029 | - $listing_type = sanitize_text_field($_REQUEST['listing_type']); |
|
| 2028 | + if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '') { |
|
| 2029 | + $listing_type = sanitize_text_field($_REQUEST['listing_type']); |
|
| 2030 | + } |
|
| 2030 | 2031 | /** This action is documented in geodirectory_template_actions.php */ |
| 2031 | 2032 | $class = apply_filters('geodir_page_title_class', 'entry-title fn');
|
| 2032 | 2033 | /** This action is documented in geodirectory_template_actions.php */ |
@@ -2038,7 +2039,7 @@ discard block |
||
| 2038 | 2039 | $gd_page = 'add-listing'; |
| 2039 | 2040 | if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
|
| 2040 | 2041 | $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
|
| 2041 | - }elseif(isset($listing_type)){
|
|
| 2042 | + } elseif(isset($listing_type)){
|
|
| 2042 | 2043 | $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
|
| 2043 | 2044 | } |
| 2044 | 2045 | |
@@ -2321,8 +2322,9 @@ discard block |
||
| 2321 | 2322 | $totImg = 0; |
| 2322 | 2323 | if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
|
| 2323 | 2324 | $post = (object)$gd_session->get('listing');
|
| 2324 | - if (isset($post->post_images)) |
|
| 2325 | - $curImages = trim($post->post_images, ","); |
|
| 2325 | + if (isset($post->post_images)) { |
|
| 2326 | + $curImages = trim($post->post_images, ","); |
|
| 2327 | + } |
|
| 2326 | 2328 | |
| 2327 | 2329 | |
| 2328 | 2330 | if ($curImages != '') {
|
@@ -2350,10 +2352,13 @@ discard block |
||
| 2350 | 2352 | $totImg = count((array)$thumb_img_arr); |
| 2351 | 2353 | } |
| 2352 | 2354 | |
| 2353 | - if ($curImages != '') |
|
| 2354 | - $svalue = $curImages; // this will be initial value of the above form field. Image urls. |
|
| 2355 | - else |
|
| 2356 | - $svalue = ''; |
|
| 2355 | + if ($curImages != '') { |
|
| 2356 | + $svalue = $curImages; |
|
| 2357 | + } |
|
| 2358 | + // this will be initial value of the above form field. Image urls. |
|
| 2359 | + else { |
|
| 2360 | + $svalue = ''; |
|
| 2361 | + } |
|
| 2357 | 2362 | |
| 2358 | 2363 | $image_limit = $package_info->image_limit; |
| 2359 | 2364 | $show_image_input_box = ($image_limit != '0'); |
@@ -2563,8 +2568,9 @@ discard block |
||
| 2563 | 2568 | </script><?php |
| 2564 | 2569 | |
| 2565 | 2570 | global $errors; |
| 2566 | - if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim') |
|
| 2567 | - $errors->add('claim_login', LOGIN_CLAIM);
|
|
| 2571 | + if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim') { |
|
| 2572 | + $errors->add('claim_login', LOGIN_CLAIM); |
|
| 2573 | + } |
|
| 2568 | 2574 | |
| 2569 | 2575 | if (!empty($errors)) {
|
| 2570 | 2576 | foreach ($errors as $errorsObj) {
|
@@ -2668,8 +2674,9 @@ discard block |
||
| 2668 | 2674 | |
| 2669 | 2675 | if (!empty($term)) {
|
| 2670 | 2676 | $current_term = get_term_by('slug', $term, $taxonomy[0]);
|
| 2671 | - if (!empty($current_term)) |
|
| 2672 | - $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
|
|
| 2677 | + if (!empty($current_term)) { |
|
| 2678 | + $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'"; |
|
| 2679 | + } |
|
| 2673 | 2680 | } |
| 2674 | 2681 | |
| 2675 | 2682 | |
@@ -2687,7 +2694,7 @@ discard block |
||
| 2687 | 2694 | $gd_page = 'author'; |
| 2688 | 2695 | if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
|
| 2689 | 2696 | $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
|
| 2690 | - }else{
|
|
| 2697 | + } else{
|
|
| 2691 | 2698 | $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
|
| 2692 | 2699 | } |
| 2693 | 2700 | |
@@ -17,10 +17,10 @@ discard block |
||
| 17 | 17 | */ |
| 18 | 18 | function gd_compat_styles() |
| 19 | 19 | {
|
| 20 | - $tc = get_option('theme_compatibility_setting');
|
|
| 21 | - echo "<style id='gd-compat-styles' type='text/css'>"; |
|
| 22 | - echo $tc['geodir_theme_compat_css']; |
|
| 23 | - echo "</style>"; |
|
| 20 | + $tc = get_option('theme_compatibility_setting');
|
|
| 21 | + echo "<style id='gd-compat-styles' type='text/css'>"; |
|
| 22 | + echo $tc['geodir_theme_compat_css']; |
|
| 23 | + echo "</style>"; |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | /** |
@@ -31,10 +31,10 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | function gd_compat_script() |
| 33 | 33 | {
|
| 34 | - $tc = get_option('theme_compatibility_setting');
|
|
| 35 | - echo "<script>"; |
|
| 36 | - echo $tc['geodir_theme_compat_js']; |
|
| 37 | - echo " </script>"; |
|
| 34 | + $tc = get_option('theme_compatibility_setting');
|
|
| 35 | + echo "<script>"; |
|
| 36 | + echo $tc['geodir_theme_compat_js']; |
|
| 37 | + echo " </script>"; |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | /** |
@@ -47,8 +47,8 @@ discard block |
||
| 47 | 47 | */ |
| 48 | 48 | function geodir_top_content_add_dynamic() |
| 49 | 49 | {
|
| 50 | - $tc = get_option('theme_compatibility_setting');
|
|
| 51 | - echo $tc['geodir_top_content_add']; |
|
| 50 | + $tc = get_option('theme_compatibility_setting');
|
|
| 51 | + echo $tc['geodir_top_content_add']; |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | /** |
@@ -61,8 +61,8 @@ discard block |
||
| 61 | 61 | */ |
| 62 | 62 | function geodir_before_main_content_add_dynamic() |
| 63 | 63 | {
|
| 64 | - $tc = get_option('theme_compatibility_setting');
|
|
| 65 | - echo $tc['geodir_before_main_content_add']; |
|
| 64 | + $tc = get_option('theme_compatibility_setting');
|
|
| 65 | + echo $tc['geodir_before_main_content_add']; |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | /** |
@@ -75,8 +75,8 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | function geodir_full_page_class_dynamic() |
| 77 | 77 | {
|
| 78 | - $tc = get_option('theme_compatibility_setting');
|
|
| 79 | - return $tc['geodir_full_page_class_filter']; |
|
| 78 | + $tc = get_option('theme_compatibility_setting');
|
|
| 79 | + return $tc['geodir_full_page_class_filter']; |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | /** |
@@ -89,8 +89,8 @@ discard block |
||
| 89 | 89 | */ |
| 90 | 90 | function geodir_before_widget_dynamic() |
| 91 | 91 | {
|
| 92 | - $tc = get_option('theme_compatibility_setting');
|
|
| 93 | - return $tc['geodir_before_widget_filter']; |
|
| 92 | + $tc = get_option('theme_compatibility_setting');
|
|
| 93 | + return $tc['geodir_before_widget_filter']; |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | /** |
@@ -103,8 +103,8 @@ discard block |
||
| 103 | 103 | */ |
| 104 | 104 | function geodir_after_widget_dynamic() |
| 105 | 105 | {
|
| 106 | - $tc = get_option('theme_compatibility_setting');
|
|
| 107 | - return $tc['geodir_after_widget_filter']; |
|
| 106 | + $tc = get_option('theme_compatibility_setting');
|
|
| 107 | + return $tc['geodir_after_widget_filter']; |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | /** |
@@ -117,8 +117,8 @@ discard block |
||
| 117 | 117 | */ |
| 118 | 118 | function geodir_before_title_dynamic() |
| 119 | 119 | {
|
| 120 | - $tc = get_option('theme_compatibility_setting');
|
|
| 121 | - return $tc['geodir_before_title_filter']; |
|
| 120 | + $tc = get_option('theme_compatibility_setting');
|
|
| 121 | + return $tc['geodir_before_title_filter']; |
|
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | /** |
@@ -131,8 +131,8 @@ discard block |
||
| 131 | 131 | */ |
| 132 | 132 | function geodir_after_title_dynamic() |
| 133 | 133 | {
|
| 134 | - $tc = get_option('theme_compatibility_setting');
|
|
| 135 | - return $tc['geodir_after_title_filter']; |
|
| 134 | + $tc = get_option('theme_compatibility_setting');
|
|
| 135 | + return $tc['geodir_after_title_filter']; |
|
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | /** |
@@ -145,8 +145,8 @@ discard block |
||
| 145 | 145 | */ |
| 146 | 146 | function geodir_menu_li_class_dynamic() |
| 147 | 147 | {
|
| 148 | - $tc = get_option('theme_compatibility_setting');
|
|
| 149 | - return $tc['geodir_menu_li_class_filter']; |
|
| 148 | + $tc = get_option('theme_compatibility_setting');
|
|
| 149 | + return $tc['geodir_menu_li_class_filter']; |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | /** |
@@ -159,8 +159,8 @@ discard block |
||
| 159 | 159 | */ |
| 160 | 160 | function geodir_sub_menu_ul_class_dynamic() |
| 161 | 161 | {
|
| 162 | - $tc = get_option('theme_compatibility_setting');
|
|
| 163 | - return $tc['geodir_sub_menu_ul_class_filter']; |
|
| 162 | + $tc = get_option('theme_compatibility_setting');
|
|
| 163 | + return $tc['geodir_sub_menu_ul_class_filter']; |
|
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | /** |
@@ -173,8 +173,8 @@ discard block |
||
| 173 | 173 | */ |
| 174 | 174 | function geodir_sub_menu_li_class_dynamic() |
| 175 | 175 | {
|
| 176 | - $tc = get_option('theme_compatibility_setting');
|
|
| 177 | - return $tc['geodir_sub_menu_li_class_filter']; |
|
| 176 | + $tc = get_option('theme_compatibility_setting');
|
|
| 177 | + return $tc['geodir_sub_menu_li_class_filter']; |
|
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | /** |
@@ -187,8 +187,8 @@ discard block |
||
| 187 | 187 | */ |
| 188 | 188 | function geodir_menu_a_class_dynamic() |
| 189 | 189 | {
|
| 190 | - $tc = get_option('theme_compatibility_setting');
|
|
| 191 | - return $tc['geodir_menu_a_class_filter']; |
|
| 190 | + $tc = get_option('theme_compatibility_setting');
|
|
| 191 | + return $tc['geodir_menu_a_class_filter']; |
|
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | /** |
@@ -201,8 +201,8 @@ discard block |
||
| 201 | 201 | */ |
| 202 | 202 | function geodir_sub_menu_a_class_dynamic() |
| 203 | 203 | {
|
| 204 | - $tc = get_option('theme_compatibility_setting');
|
|
| 205 | - return $tc['geodir_sub_menu_a_class_filter']; |
|
| 204 | + $tc = get_option('theme_compatibility_setting');
|
|
| 205 | + return $tc['geodir_sub_menu_a_class_filter']; |
|
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | /** |
@@ -215,8 +215,8 @@ discard block |
||
| 215 | 215 | */ |
| 216 | 216 | function geodir_location_switcher_menu_li_class_dynamic() |
| 217 | 217 | {
|
| 218 | - $tc = get_option('theme_compatibility_setting');
|
|
| 219 | - return $tc['geodir_location_switcher_menu_li_class_filter']; |
|
| 218 | + $tc = get_option('theme_compatibility_setting');
|
|
| 219 | + return $tc['geodir_location_switcher_menu_li_class_filter']; |
|
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | /** |
@@ -229,8 +229,8 @@ discard block |
||
| 229 | 229 | */ |
| 230 | 230 | function geodir_location_switcher_menu_a_class_dynamic() |
| 231 | 231 | {
|
| 232 | - $tc = get_option('theme_compatibility_setting');
|
|
| 233 | - return $tc['geodir_location_switcher_menu_a_class_filter']; |
|
| 232 | + $tc = get_option('theme_compatibility_setting');
|
|
| 233 | + return $tc['geodir_location_switcher_menu_a_class_filter']; |
|
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | /** |
@@ -243,8 +243,8 @@ discard block |
||
| 243 | 243 | */ |
| 244 | 244 | function geodir_location_switcher_menu_sub_ul_class_dynamic() |
| 245 | 245 | {
|
| 246 | - $tc = get_option('theme_compatibility_setting');
|
|
| 247 | - return $tc['geodir_location_switcher_menu_sub_ul_class_filter']; |
|
| 246 | + $tc = get_option('theme_compatibility_setting');
|
|
| 247 | + return $tc['geodir_location_switcher_menu_sub_ul_class_filter']; |
|
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | /** |
@@ -257,8 +257,8 @@ discard block |
||
| 257 | 257 | */ |
| 258 | 258 | function geodir_location_switcher_menu_sub_li_class_dynamic() |
| 259 | 259 | {
|
| 260 | - $tc = get_option('theme_compatibility_setting');
|
|
| 261 | - return $tc['geodir_location_switcher_menu_sub_li_class_filter']; |
|
| 260 | + $tc = get_option('theme_compatibility_setting');
|
|
| 261 | + return $tc['geodir_location_switcher_menu_sub_li_class_filter']; |
|
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | |
@@ -275,106 +275,106 @@ discard block |
||
| 275 | 275 | function geodir_content_actions_dynamic() |
| 276 | 276 | {
|
| 277 | 277 | |
| 278 | - $tc = get_option('theme_compatibility_setting');
|
|
| 279 | - if (empty($tc)) {
|
|
| 280 | - return; |
|
| 281 | - } |
|
| 278 | + $tc = get_option('theme_compatibility_setting');
|
|
| 279 | + if (empty($tc)) {
|
|
| 280 | + return; |
|
| 281 | + } |
|
| 282 | 282 | |
| 283 | - //php |
|
| 284 | - if (!empty($tc['geodir_theme_compat_code'])) {
|
|
| 285 | - include_once('geodirectory-functions/compatibility/' . $tc['geodir_theme_compat_code'] . '.php');
|
|
| 286 | - } |
|
| 283 | + //php |
|
| 284 | + if (!empty($tc['geodir_theme_compat_code'])) {
|
|
| 285 | + include_once('geodirectory-functions/compatibility/' . $tc['geodir_theme_compat_code'] . '.php');
|
|
| 286 | + } |
|
| 287 | 287 | |
| 288 | - //geodir_full_page_class |
|
| 289 | - if (!empty($tc['geodir_full_page_class_filter'])) {
|
|
| 290 | - add_filter('geodir_full_page_class', 'geodir_full_page_class_dynamic', 10);
|
|
| 291 | - } |
|
| 288 | + //geodir_full_page_class |
|
| 289 | + if (!empty($tc['geodir_full_page_class_filter'])) {
|
|
| 290 | + add_filter('geodir_full_page_class', 'geodir_full_page_class_dynamic', 10);
|
|
| 291 | + } |
|
| 292 | 292 | |
| 293 | - //widget before filter |
|
| 294 | - if (!empty($tc['geodir_before_widget_filter'])) {
|
|
| 295 | - add_filter('geodir_before_widget', 'geodir_before_widget_dynamic', 10);
|
|
| 296 | - } |
|
| 293 | + //widget before filter |
|
| 294 | + if (!empty($tc['geodir_before_widget_filter'])) {
|
|
| 295 | + add_filter('geodir_before_widget', 'geodir_before_widget_dynamic', 10);
|
|
| 296 | + } |
|
| 297 | 297 | |
| 298 | - //widget after filter |
|
| 299 | - if (!empty($tc['geodir_after_widget_filter'])) {
|
|
| 300 | - add_filter('geodir_after_widget', 'geodir_after_widget_dynamic', 10);
|
|
| 301 | - } |
|
| 298 | + //widget after filter |
|
| 299 | + if (!empty($tc['geodir_after_widget_filter'])) {
|
|
| 300 | + add_filter('geodir_after_widget', 'geodir_after_widget_dynamic', 10);
|
|
| 301 | + } |
|
| 302 | 302 | |
| 303 | - //widget before title filter |
|
| 304 | - if (!empty($tc['geodir_before_title_filter'])) {
|
|
| 305 | - add_filter('geodir_before_title', 'geodir_before_title_dynamic', 10);
|
|
| 306 | - } |
|
| 303 | + //widget before title filter |
|
| 304 | + if (!empty($tc['geodir_before_title_filter'])) {
|
|
| 305 | + add_filter('geodir_before_title', 'geodir_before_title_dynamic', 10);
|
|
| 306 | + } |
|
| 307 | 307 | |
| 308 | - //widget before title filter |
|
| 309 | - if (!empty($tc['geodir_after_title_filter'])) {
|
|
| 310 | - add_filter('geodir_after_title', 'geodir_after_title_dynamic', 10);
|
|
| 311 | - } |
|
| 308 | + //widget before title filter |
|
| 309 | + if (!empty($tc['geodir_after_title_filter'])) {
|
|
| 310 | + add_filter('geodir_after_title', 'geodir_after_title_dynamic', 10);
|
|
| 311 | + } |
|
| 312 | 312 | |
| 313 | - //menu li class |
|
| 314 | - if (!empty($tc['geodir_menu_li_class_filter'])) {
|
|
| 315 | - add_filter('geodir_menu_li_class', 'geodir_menu_li_class_dynamic', 10);
|
|
| 316 | - } |
|
| 313 | + //menu li class |
|
| 314 | + if (!empty($tc['geodir_menu_li_class_filter'])) {
|
|
| 315 | + add_filter('geodir_menu_li_class', 'geodir_menu_li_class_dynamic', 10);
|
|
| 316 | + } |
|
| 317 | 317 | |
| 318 | - //menu ul class |
|
| 319 | - if (!empty($tc['geodir_sub_menu_ul_class_filter'])) {
|
|
| 320 | - add_filter('geodir_sub_menu_ul_class', 'geodir_sub_menu_ul_class_dynamic', 10);
|
|
| 321 | - } |
|
| 318 | + //menu ul class |
|
| 319 | + if (!empty($tc['geodir_sub_menu_ul_class_filter'])) {
|
|
| 320 | + add_filter('geodir_sub_menu_ul_class', 'geodir_sub_menu_ul_class_dynamic', 10);
|
|
| 321 | + } |
|
| 322 | 322 | |
| 323 | - //menu sub li class |
|
| 324 | - if (!empty($tc['geodir_sub_menu_li_class_filter'])) {
|
|
| 325 | - add_filter('geodir_sub_menu_li_class', 'geodir_sub_menu_li_class_dynamic', 10);
|
|
| 326 | - } |
|
| 323 | + //menu sub li class |
|
| 324 | + if (!empty($tc['geodir_sub_menu_li_class_filter'])) {
|
|
| 325 | + add_filter('geodir_sub_menu_li_class', 'geodir_sub_menu_li_class_dynamic', 10);
|
|
| 326 | + } |
|
| 327 | 327 | |
| 328 | - //menu a class |
|
| 329 | - if (!empty($tc['geodir_menu_a_class_filter'])) {
|
|
| 330 | - add_filter('geodir_menu_a_class', 'geodir_menu_a_class_dynamic', 10);
|
|
| 331 | - } |
|
| 328 | + //menu a class |
|
| 329 | + if (!empty($tc['geodir_menu_a_class_filter'])) {
|
|
| 330 | + add_filter('geodir_menu_a_class', 'geodir_menu_a_class_dynamic', 10);
|
|
| 331 | + } |
|
| 332 | 332 | |
| 333 | - //menu sub a class |
|
| 334 | - if (!empty($tc['geodir_sub_menu_a_class_filter'])) {
|
|
| 335 | - add_filter('geodir_sub_menu_a_class', 'geodir_sub_menu_a_class_dynamic', 10);
|
|
| 336 | - } |
|
| 333 | + //menu sub a class |
|
| 334 | + if (!empty($tc['geodir_sub_menu_a_class_filter'])) {
|
|
| 335 | + add_filter('geodir_sub_menu_a_class', 'geodir_sub_menu_a_class_dynamic', 10);
|
|
| 336 | + } |
|
| 337 | 337 | |
| 338 | - //location menu li class |
|
| 339 | - if (!empty($tc['geodir_location_switcher_menu_li_class_filter'])) {
|
|
| 340 | - add_filter('geodir_location_switcher_menu_li_class', 'geodir_location_switcher_menu_li_class_dynamic', 10);
|
|
| 341 | - } |
|
| 338 | + //location menu li class |
|
| 339 | + if (!empty($tc['geodir_location_switcher_menu_li_class_filter'])) {
|
|
| 340 | + add_filter('geodir_location_switcher_menu_li_class', 'geodir_location_switcher_menu_li_class_dynamic', 10);
|
|
| 341 | + } |
|
| 342 | 342 | |
| 343 | - //location menu sub ul class |
|
| 344 | - if (!empty($tc['geodir_location_switcher_menu_sub_ul_class_filter'])) {
|
|
| 345 | - add_filter('geodir_location_switcher_menu_sub_ul_class', 'geodir_location_switcher_menu_sub_ul_class_dynamic', 10);
|
|
| 346 | - } |
|
| 343 | + //location menu sub ul class |
|
| 344 | + if (!empty($tc['geodir_location_switcher_menu_sub_ul_class_filter'])) {
|
|
| 345 | + add_filter('geodir_location_switcher_menu_sub_ul_class', 'geodir_location_switcher_menu_sub_ul_class_dynamic', 10);
|
|
| 346 | + } |
|
| 347 | 347 | |
| 348 | - //location menu sub li class |
|
| 349 | - if (!empty($tc['geodir_location_switcher_menu_sub_li_class_filter'])) {
|
|
| 350 | - add_filter('geodir_location_switcher_menu_sub_li_class', 'geodir_location_switcher_menu_sub_li_class_dynamic', 10);
|
|
| 351 | - } |
|
| 348 | + //location menu sub li class |
|
| 349 | + if (!empty($tc['geodir_location_switcher_menu_sub_li_class_filter'])) {
|
|
| 350 | + add_filter('geodir_location_switcher_menu_sub_li_class', 'geodir_location_switcher_menu_sub_li_class_dynamic', 10);
|
|
| 351 | + } |
|
| 352 | 352 | |
| 353 | - //location menu a class |
|
| 354 | - if (!empty($tc['geodir_location_switcher_menu_a_class_filter'])) {
|
|
| 355 | - add_filter('geodir_location_switcher_menu_a_class', 'geodir_location_switcher_menu_a_class_dynamic', 10);
|
|
| 356 | - } |
|
| 353 | + //location menu a class |
|
| 354 | + if (!empty($tc['geodir_location_switcher_menu_a_class_filter'])) {
|
|
| 355 | + add_filter('geodir_location_switcher_menu_a_class', 'geodir_location_switcher_menu_a_class_dynamic', 10);
|
|
| 356 | + } |
|
| 357 | 357 | |
| 358 | - // compat styles |
|
| 359 | - if (!empty($tc['geodir_theme_compat_css'])) {
|
|
| 360 | - add_action('wp_head', 'gd_compat_styles');
|
|
| 361 | - } |
|
| 358 | + // compat styles |
|
| 359 | + if (!empty($tc['geodir_theme_compat_css'])) {
|
|
| 360 | + add_action('wp_head', 'gd_compat_styles');
|
|
| 361 | + } |
|
| 362 | 362 | |
| 363 | - // compat js |
|
| 364 | - if (!empty($tc['geodir_theme_compat_js'])) {
|
|
| 365 | - add_action('wp_footer', 'gd_compat_script');
|
|
| 366 | - } |
|
| 363 | + // compat js |
|
| 364 | + if (!empty($tc['geodir_theme_compat_js'])) {
|
|
| 365 | + add_action('wp_footer', 'gd_compat_script');
|
|
| 366 | + } |
|
| 367 | 367 | |
| 368 | 368 | |
| 369 | - // geodir_top_content_add |
|
| 370 | - if (!empty($tc['geodir_top_content_add'])) {
|
|
| 371 | - add_action('geodir_top_content', 'geodir_top_content_add_dynamic', 10, 1);
|
|
| 372 | - } |
|
| 369 | + // geodir_top_content_add |
|
| 370 | + if (!empty($tc['geodir_top_content_add'])) {
|
|
| 371 | + add_action('geodir_top_content', 'geodir_top_content_add_dynamic', 10, 1);
|
|
| 372 | + } |
|
| 373 | 373 | |
| 374 | - // geodir_before_main_content_add |
|
| 375 | - if (!empty($tc['geodir_before_main_content_add'])) {
|
|
| 376 | - add_action('geodir_before_main_content', 'geodir_before_main_content_add_dynamic', 10, 1);
|
|
| 377 | - } |
|
| 374 | + // geodir_before_main_content_add |
|
| 375 | + if (!empty($tc['geodir_before_main_content_add'])) {
|
|
| 376 | + add_action('geodir_before_main_content', 'geodir_before_main_content_add_dynamic', 10, 1);
|
|
| 377 | + } |
|
| 378 | 378 | |
| 379 | 379 | |
| 380 | 380 | } |
@@ -397,23 +397,23 @@ discard block |
||
| 397 | 397 | */ |
| 398 | 398 | function geodir_action_wrapper_open($type = '', $id = '', $class = '') |
| 399 | 399 | {
|
| 400 | - $tc = get_option('theme_compatibility_setting');
|
|
| 401 | - if (!empty($tc['geodir_wrapper_open_replace'])) {
|
|
| 402 | - $text = $tc['geodir_wrapper_open_replace']; |
|
| 403 | - } else {
|
|
| 404 | - $text = '<div id="[id]" class="[class]">'; |
|
| 405 | - } |
|
| 400 | + $tc = get_option('theme_compatibility_setting');
|
|
| 401 | + if (!empty($tc['geodir_wrapper_open_replace'])) {
|
|
| 402 | + $text = $tc['geodir_wrapper_open_replace']; |
|
| 403 | + } else {
|
|
| 404 | + $text = '<div id="[id]" class="[class]">'; |
|
| 405 | + } |
|
| 406 | 406 | |
| 407 | - if (!empty($tc['geodir_wrapper_open_id'])) {
|
|
| 408 | - $id = $tc['geodir_wrapper_open_id']; |
|
| 409 | - } |
|
| 410 | - if (!empty($tc['geodir_wrapper_open_class'])) {
|
|
| 411 | - $class = $tc['geodir_wrapper_open_class']; |
|
| 412 | - } |
|
| 407 | + if (!empty($tc['geodir_wrapper_open_id'])) {
|
|
| 408 | + $id = $tc['geodir_wrapper_open_id']; |
|
| 409 | + } |
|
| 410 | + if (!empty($tc['geodir_wrapper_open_class'])) {
|
|
| 411 | + $class = $tc['geodir_wrapper_open_class']; |
|
| 412 | + } |
|
| 413 | 413 | |
| 414 | - $text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
|
|
| 414 | + $text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
|
|
| 415 | 415 | |
| 416 | - echo $text; |
|
| 416 | + echo $text; |
|
| 417 | 417 | } |
| 418 | 418 | |
| 419 | 419 | // action for adding the wrapperdiv closing tag |
@@ -428,14 +428,14 @@ discard block |
||
| 428 | 428 | */ |
| 429 | 429 | function geodir_action_wrapper_close($type = '') |
| 430 | 430 | {
|
| 431 | - $tc = get_option('theme_compatibility_setting');
|
|
| 432 | - if (!empty($tc['geodir_wrapper_close_replace'])) {
|
|
| 433 | - $text = $tc['geodir_wrapper_close_replace']; |
|
| 434 | - } else {
|
|
| 435 | - $text = '</div><!-- wrapper ends here-->'; |
|
| 436 | - } |
|
| 431 | + $tc = get_option('theme_compatibility_setting');
|
|
| 432 | + if (!empty($tc['geodir_wrapper_close_replace'])) {
|
|
| 433 | + $text = $tc['geodir_wrapper_close_replace']; |
|
| 434 | + } else {
|
|
| 435 | + $text = '</div><!-- wrapper ends here-->'; |
|
| 436 | + } |
|
| 437 | 437 | |
| 438 | - echo $text; |
|
| 438 | + echo $text; |
|
| 439 | 439 | } |
| 440 | 440 | |
| 441 | 441 | // action for adding the content div opening tag |
@@ -451,35 +451,35 @@ discard block |
||
| 451 | 451 | */ |
| 452 | 452 | function geodir_action_wrapper_content_open($type = '', $id = '', $class = '') |
| 453 | 453 | {
|
| 454 | - if ($type == 'home-page' && $width = get_option('geodir_width_home_contant_section')) {
|
|
| 455 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 456 | - } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_contant_section')) {
|
|
| 457 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 458 | - } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_contant_section')) {
|
|
| 459 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 460 | - } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_contant_section')) {
|
|
| 461 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 462 | - } else {
|
|
| 463 | - $width_css = ''; |
|
| 464 | - } |
|
| 465 | - |
|
| 466 | - $tc = get_option('theme_compatibility_setting');
|
|
| 467 | - if (!empty($tc['geodir_wrapper_content_open_replace'])) {
|
|
| 468 | - $text = $tc['geodir_wrapper_content_open_replace']; |
|
| 469 | - } else {
|
|
| 470 | - $text = '<div id="[id]" class="[class]" role="main" [width_css]>'; |
|
| 471 | - } |
|
| 472 | - |
|
| 473 | - if (!empty($tc['geodir_wrapper_content_open_id'])) {
|
|
| 474 | - $id = $tc['geodir_wrapper_content_open_id']; |
|
| 475 | - } |
|
| 476 | - if (!empty($tc['geodir_wrapper_content_open_class'])) {
|
|
| 477 | - $class = $tc['geodir_wrapper_content_open_class']; |
|
| 478 | - } |
|
| 479 | - |
|
| 480 | - $text = str_replace(array("[id]", "[class]", "[width_css]"), array($id, $class, $width_css), $text);
|
|
| 481 | - |
|
| 482 | - echo $text; |
|
| 454 | + if ($type == 'home-page' && $width = get_option('geodir_width_home_contant_section')) {
|
|
| 455 | + $width_css = 'style="width:' . $width . '%;"'; |
|
| 456 | + } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_contant_section')) {
|
|
| 457 | + $width_css = 'style="width:' . $width . '%;"'; |
|
| 458 | + } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_contant_section')) {
|
|
| 459 | + $width_css = 'style="width:' . $width . '%;"'; |
|
| 460 | + } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_contant_section')) {
|
|
| 461 | + $width_css = 'style="width:' . $width . '%;"'; |
|
| 462 | + } else {
|
|
| 463 | + $width_css = ''; |
|
| 464 | + } |
|
| 465 | + |
|
| 466 | + $tc = get_option('theme_compatibility_setting');
|
|
| 467 | + if (!empty($tc['geodir_wrapper_content_open_replace'])) {
|
|
| 468 | + $text = $tc['geodir_wrapper_content_open_replace']; |
|
| 469 | + } else {
|
|
| 470 | + $text = '<div id="[id]" class="[class]" role="main" [width_css]>'; |
|
| 471 | + } |
|
| 472 | + |
|
| 473 | + if (!empty($tc['geodir_wrapper_content_open_id'])) {
|
|
| 474 | + $id = $tc['geodir_wrapper_content_open_id']; |
|
| 475 | + } |
|
| 476 | + if (!empty($tc['geodir_wrapper_content_open_class'])) {
|
|
| 477 | + $class = $tc['geodir_wrapper_content_open_class']; |
|
| 478 | + } |
|
| 479 | + |
|
| 480 | + $text = str_replace(array("[id]", "[class]", "[width_css]"), array($id, $class, $width_css), $text);
|
|
| 481 | + |
|
| 482 | + echo $text; |
|
| 483 | 483 | } |
| 484 | 484 | |
| 485 | 485 | // action for adding the primary div closing tag |
@@ -493,13 +493,13 @@ discard block |
||
| 493 | 493 | */ |
| 494 | 494 | function geodir_action_wrapper_content_close($type = '') |
| 495 | 495 | {
|
| 496 | - $tc = get_option('theme_compatibility_setting');
|
|
| 497 | - if (!empty($tc['geodir_wrapper_content_close_replace'])) {
|
|
| 498 | - $text = $tc['geodir_wrapper_content_close_replace']; |
|
| 499 | - } else {
|
|
| 500 | - $text = '</div><!-- content ends here-->'; |
|
| 501 | - } |
|
| 502 | - echo $text; |
|
| 496 | + $tc = get_option('theme_compatibility_setting');
|
|
| 497 | + if (!empty($tc['geodir_wrapper_content_close_replace'])) {
|
|
| 498 | + $text = $tc['geodir_wrapper_content_close_replace']; |
|
| 499 | + } else {
|
|
| 500 | + $text = '</div><!-- content ends here-->'; |
|
| 501 | + } |
|
| 502 | + echo $text; |
|
| 503 | 503 | } |
| 504 | 504 | |
| 505 | 505 | // action for adding the <article> opening tag |
@@ -517,24 +517,24 @@ discard block |
||
| 517 | 517 | */ |
| 518 | 518 | function geodir_action_article_open($type = '', $id = '', $class = '', $itemtype = '') |
| 519 | 519 | {
|
| 520 | - $class = implode(" ", $class);
|
|
| 521 | - $tc = get_option('theme_compatibility_setting');
|
|
| 522 | - if (!empty($tc['geodir_article_open_replace'])) {
|
|
| 523 | - $text = $tc['geodir_article_open_replace']; |
|
| 524 | - } else {
|
|
| 525 | - $text = '<article id="[id]" class="[class]" >'; |
|
| 526 | - } |
|
| 520 | + $class = implode(" ", $class);
|
|
| 521 | + $tc = get_option('theme_compatibility_setting');
|
|
| 522 | + if (!empty($tc['geodir_article_open_replace'])) {
|
|
| 523 | + $text = $tc['geodir_article_open_replace']; |
|
| 524 | + } else {
|
|
| 525 | + $text = '<article id="[id]" class="[class]" >'; |
|
| 526 | + } |
|
| 527 | 527 | |
| 528 | - if (!empty($tc['geodir_article_open_id'])) {
|
|
| 529 | - $id = $tc['geodir_article_open_id']; |
|
| 530 | - } |
|
| 531 | - if (!empty($tc['geodir_article_open_class'])) {
|
|
| 532 | - $class = $tc['geodir_article_open_class']; |
|
| 533 | - } |
|
| 528 | + if (!empty($tc['geodir_article_open_id'])) {
|
|
| 529 | + $id = $tc['geodir_article_open_id']; |
|
| 530 | + } |
|
| 531 | + if (!empty($tc['geodir_article_open_class'])) {
|
|
| 532 | + $class = $tc['geodir_article_open_class']; |
|
| 533 | + } |
|
| 534 | 534 | |
| 535 | - $text = str_replace(array("[id]", "[class]", "[itemtype]"), array($id, $class, $itemtype), $text);
|
|
| 535 | + $text = str_replace(array("[id]", "[class]", "[itemtype]"), array($id, $class, $itemtype), $text);
|
|
| 536 | 536 | |
| 537 | - echo $text; |
|
| 537 | + echo $text; |
|
| 538 | 538 | } |
| 539 | 539 | |
| 540 | 540 | // action for adding the primary div closing tag |
@@ -548,13 +548,13 @@ discard block |
||
| 548 | 548 | */ |
| 549 | 549 | function geodir_action_article_close($type = '') |
| 550 | 550 | {
|
| 551 | - $tc = get_option('theme_compatibility_setting');
|
|
| 552 | - if (!empty($tc['geodir_article_close_replace'])) {
|
|
| 553 | - $text = $tc['geodir_article_close_replace']; |
|
| 554 | - } else {
|
|
| 555 | - $text = '</article><!-- article ends here-->'; |
|
| 556 | - } |
|
| 557 | - echo $text; |
|
| 551 | + $tc = get_option('theme_compatibility_setting');
|
|
| 552 | + if (!empty($tc['geodir_article_close_replace'])) {
|
|
| 553 | + $text = $tc['geodir_article_close_replace']; |
|
| 554 | + } else {
|
|
| 555 | + $text = '</article><!-- article ends here-->'; |
|
| 556 | + } |
|
| 557 | + echo $text; |
|
| 558 | 558 | } |
| 559 | 559 | |
| 560 | 560 | // action for adding the sidebar opening tag |
@@ -571,35 +571,35 @@ discard block |
||
| 571 | 571 | */ |
| 572 | 572 | function geodir_action_sidebar_right_open($type = '', $id = '', $class = '', $itemtype = '') |
| 573 | 573 | {
|
| 574 | - if ($type == 'home-page' && $width = get_option('geodir_width_home_right_section')) {
|
|
| 575 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 576 | - } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_right_section')) {
|
|
| 577 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 578 | - } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_right_section')) {
|
|
| 579 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 580 | - } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_right_section')) {
|
|
| 581 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 582 | - } else {
|
|
| 583 | - $width_css = ''; |
|
| 584 | - } |
|
| 585 | - |
|
| 586 | - $tc = get_option('theme_compatibility_setting');
|
|
| 587 | - if (!empty($tc['geodir_sidebar_right_open_replace'])) {
|
|
| 588 | - $text = $tc['geodir_sidebar_right_open_replace']; |
|
| 589 | - } else {
|
|
| 590 | - $text = '<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>'; |
|
| 591 | - } |
|
| 592 | - |
|
| 593 | - if (!empty($tc['geodir_sidebar_right_open_id'])) {
|
|
| 594 | - $id = $tc['geodir_sidebar_right_open_id']; |
|
| 595 | - } |
|
| 596 | - if (!empty($tc['geodir_sidebar_right_open_class'])) {
|
|
| 597 | - $class = $tc['geodir_sidebar_right_open_class']; |
|
| 598 | - } |
|
| 599 | - |
|
| 600 | - $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
|
|
| 601 | - |
|
| 602 | - echo $text; |
|
| 574 | + if ($type == 'home-page' && $width = get_option('geodir_width_home_right_section')) {
|
|
| 575 | + $width_css = 'style="width:' . $width . '%;"'; |
|
| 576 | + } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_right_section')) {
|
|
| 577 | + $width_css = 'style="width:' . $width . '%;"'; |
|
| 578 | + } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_right_section')) {
|
|
| 579 | + $width_css = 'style="width:' . $width . '%;"'; |
|
| 580 | + } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_right_section')) {
|
|
| 581 | + $width_css = 'style="width:' . $width . '%;"'; |
|
| 582 | + } else {
|
|
| 583 | + $width_css = ''; |
|
| 584 | + } |
|
| 585 | + |
|
| 586 | + $tc = get_option('theme_compatibility_setting');
|
|
| 587 | + if (!empty($tc['geodir_sidebar_right_open_replace'])) {
|
|
| 588 | + $text = $tc['geodir_sidebar_right_open_replace']; |
|
| 589 | + } else {
|
|
| 590 | + $text = '<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>'; |
|
| 591 | + } |
|
| 592 | + |
|
| 593 | + if (!empty($tc['geodir_sidebar_right_open_id'])) {
|
|
| 594 | + $id = $tc['geodir_sidebar_right_open_id']; |
|
| 595 | + } |
|
| 596 | + if (!empty($tc['geodir_sidebar_right_open_class'])) {
|
|
| 597 | + $class = $tc['geodir_sidebar_right_open_class']; |
|
| 598 | + } |
|
| 599 | + |
|
| 600 | + $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
|
|
| 601 | + |
|
| 602 | + echo $text; |
|
| 603 | 603 | } |
| 604 | 604 | |
| 605 | 605 | // action for adding the primary div closing tag |
@@ -613,13 +613,13 @@ discard block |
||
| 613 | 613 | */ |
| 614 | 614 | function geodir_action_sidebar_right_close($type = '') |
| 615 | 615 | {
|
| 616 | - $tc = get_option('theme_compatibility_setting');
|
|
| 617 | - if (!empty($tc['geodir_sidebar_right_close_replace'])) {
|
|
| 618 | - $text = $tc['geodir_sidebar_right_close_replace']; |
|
| 619 | - } else {
|
|
| 620 | - $text = '</aside><!-- sidebar ends here-->'; |
|
| 621 | - } |
|
| 622 | - echo $text; |
|
| 616 | + $tc = get_option('theme_compatibility_setting');
|
|
| 617 | + if (!empty($tc['geodir_sidebar_right_close_replace'])) {
|
|
| 618 | + $text = $tc['geodir_sidebar_right_close_replace']; |
|
| 619 | + } else {
|
|
| 620 | + $text = '</aside><!-- sidebar ends here-->'; |
|
| 621 | + } |
|
| 622 | + echo $text; |
|
| 623 | 623 | } |
| 624 | 624 | |
| 625 | 625 | |
@@ -640,121 +640,121 @@ discard block |
||
| 640 | 640 | */ |
| 641 | 641 | function geodir_action_geodir_set_preview_post() |
| 642 | 642 | {
|
| 643 | - global $post, $preview, $gd_session; |
|
| 644 | - $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend |
|
| 645 | - if (!$preview || $is_backend_preview) {
|
|
| 646 | - return; |
|
| 647 | - }// bail if not previewing |
|
| 648 | - |
|
| 649 | - $listing_type = isset($_REQUEST['listing_type']) ? sanitize_text_field($_REQUEST['listing_type']) : ''; |
|
| 650 | - |
|
| 651 | - $fields_info = geodir_get_custom_fields_type($listing_type); |
|
| 652 | - |
|
| 653 | - foreach ($_REQUEST as $pkey => $pval) {
|
|
| 654 | - if ($pkey == 'geodir_video') {
|
|
| 655 | - $tags = '<iframe>'; |
|
| 656 | - } else if ($pkey == 'post_desc') {
|
|
| 657 | - $tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'; |
|
| 658 | - } else if (is_array($fields_info) && isset($fields_info[$pkey]) && ($fields_info[$pkey] == 'textarea' || $fields_info[$pkey] == 'html')) {
|
|
| 659 | - $tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'; |
|
| 660 | - } else if (is_array($_REQUEST[$pkey])) {
|
|
| 661 | - $tags = 'skip_field'; |
|
| 662 | - } else {
|
|
| 663 | - $tags = ''; |
|
| 664 | - } |
|
| 665 | - /** |
|
| 666 | - * Allows the filtering of the allowed HTML tags per field when submitting from frontend add listing page. |
|
| 667 | - * |
|
| 668 | - * @since 1.0.0 |
|
| 669 | - * @param string $tags The allowed HTML tags for the field. Can be many things, for example the description allows these tags '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'. |
|
| 670 | - * @param string|array $pkey The field id/name. If array then value is set as "skip_field". |
|
| 671 | - */ |
|
| 672 | - $tags = apply_filters('geodir_save_post_key', $tags, $pkey);
|
|
| 673 | - |
|
| 674 | - if ($tags != 'skip_field') {
|
|
| 675 | - $_REQUEST[$pkey] = strip_tags($_REQUEST[$pkey], $tags); |
|
| 676 | - } |
|
| 677 | - } |
|
| 678 | - |
|
| 679 | - $post = (object)$_REQUEST; |
|
| 680 | - |
|
| 681 | - |
|
| 682 | - if (isset($post->video)) {
|
|
| 683 | - $post->video = stripslashes($post->video); |
|
| 684 | - } |
|
| 685 | - |
|
| 686 | - if (isset($post->Video2)) {
|
|
| 687 | - $post->Video2 = stripslashes($post->Video2); |
|
| 688 | - } |
|
| 689 | - |
|
| 690 | - $post_type = $post->listing_type; |
|
| 691 | - $post_type_info = get_post_type_object($post_type); |
|
| 692 | - |
|
| 693 | - $listing_label = $post_type_info->labels->singular_name; |
|
| 694 | - |
|
| 695 | - $term_icon = ''; |
|
| 696 | - |
|
| 697 | - if (!empty($post->post_category)) {
|
|
| 698 | - foreach ($post->post_category as $post_taxonomy => $post_term) {
|
|
| 699 | - |
|
| 700 | - if ($post_term != '' && !is_array($post_term)) {
|
|
| 701 | - $post_term = explode(',', trim($post_term, ','));
|
|
| 702 | - } |
|
| 643 | + global $post, $preview, $gd_session; |
|
| 644 | + $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend |
|
| 645 | + if (!$preview || $is_backend_preview) {
|
|
| 646 | + return; |
|
| 647 | + }// bail if not previewing |
|
| 648 | + |
|
| 649 | + $listing_type = isset($_REQUEST['listing_type']) ? sanitize_text_field($_REQUEST['listing_type']) : ''; |
|
| 650 | + |
|
| 651 | + $fields_info = geodir_get_custom_fields_type($listing_type); |
|
| 652 | + |
|
| 653 | + foreach ($_REQUEST as $pkey => $pval) {
|
|
| 654 | + if ($pkey == 'geodir_video') {
|
|
| 655 | + $tags = '<iframe>'; |
|
| 656 | + } else if ($pkey == 'post_desc') {
|
|
| 657 | + $tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'; |
|
| 658 | + } else if (is_array($fields_info) && isset($fields_info[$pkey]) && ($fields_info[$pkey] == 'textarea' || $fields_info[$pkey] == 'html')) {
|
|
| 659 | + $tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'; |
|
| 660 | + } else if (is_array($_REQUEST[$pkey])) {
|
|
| 661 | + $tags = 'skip_field'; |
|
| 662 | + } else {
|
|
| 663 | + $tags = ''; |
|
| 664 | + } |
|
| 665 | + /** |
|
| 666 | + * Allows the filtering of the allowed HTML tags per field when submitting from frontend add listing page. |
|
| 667 | + * |
|
| 668 | + * @since 1.0.0 |
|
| 669 | + * @param string $tags The allowed HTML tags for the field. Can be many things, for example the description allows these tags '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'. |
|
| 670 | + * @param string|array $pkey The field id/name. If array then value is set as "skip_field". |
|
| 671 | + */ |
|
| 672 | + $tags = apply_filters('geodir_save_post_key', $tags, $pkey);
|
|
| 673 | + |
|
| 674 | + if ($tags != 'skip_field') {
|
|
| 675 | + $_REQUEST[$pkey] = strip_tags($_REQUEST[$pkey], $tags); |
|
| 676 | + } |
|
| 677 | + } |
|
| 678 | + |
|
| 679 | + $post = (object)$_REQUEST; |
|
| 680 | + |
|
| 681 | + |
|
| 682 | + if (isset($post->video)) {
|
|
| 683 | + $post->video = stripslashes($post->video); |
|
| 684 | + } |
|
| 685 | + |
|
| 686 | + if (isset($post->Video2)) {
|
|
| 687 | + $post->Video2 = stripslashes($post->Video2); |
|
| 688 | + } |
|
| 689 | + |
|
| 690 | + $post_type = $post->listing_type; |
|
| 691 | + $post_type_info = get_post_type_object($post_type); |
|
| 692 | + |
|
| 693 | + $listing_label = $post_type_info->labels->singular_name; |
|
| 694 | + |
|
| 695 | + $term_icon = ''; |
|
| 696 | + |
|
| 697 | + if (!empty($post->post_category)) {
|
|
| 698 | + foreach ($post->post_category as $post_taxonomy => $post_term) {
|
|
| 699 | + |
|
| 700 | + if ($post_term != '' && !is_array($post_term)) {
|
|
| 701 | + $post_term = explode(',', trim($post_term, ','));
|
|
| 702 | + } |
|
| 703 | 703 | |
| 704 | - if (is_array($post_term)) {
|
|
| 705 | - $post_term = array_unique($post_term); |
|
| 706 | - } |
|
| 704 | + if (is_array($post_term)) {
|
|
| 705 | + $post_term = array_unique($post_term); |
|
| 706 | + } |
|
| 707 | 707 | |
| 708 | - if (!empty($post_term)) {
|
|
| 709 | - foreach ($post_term as $cat_id) {
|
|
| 710 | - $cat_id = trim($cat_id); |
|
| 711 | - |
|
| 712 | - if ($cat_id != '') {
|
|
| 713 | - $term_icon = get_option('geodir_default_marker_icon');
|
|
| 714 | - |
|
| 715 | - if (isset($post->post_default_category) && $post->post_default_category == $cat_id) {
|
|
| 716 | - if ($term_icon_url = get_tax_meta($cat_id, 'ct_cat_icon', false, $post_type)) {
|
|
| 717 | - if (isset($term_icon_url['src']) && $term_icon_url['src'] != '') |
|
| 718 | - $term_icon = $term_icon_url['src']; |
|
| 719 | - break; |
|
| 720 | - } |
|
| 721 | - } |
|
| 722 | - } |
|
| 723 | - } |
|
| 724 | - } |
|
| 725 | - } |
|
| 726 | - } |
|
| 708 | + if (!empty($post_term)) {
|
|
| 709 | + foreach ($post_term as $cat_id) {
|
|
| 710 | + $cat_id = trim($cat_id); |
|
| 711 | + |
|
| 712 | + if ($cat_id != '') {
|
|
| 713 | + $term_icon = get_option('geodir_default_marker_icon');
|
|
| 714 | + |
|
| 715 | + if (isset($post->post_default_category) && $post->post_default_category == $cat_id) {
|
|
| 716 | + if ($term_icon_url = get_tax_meta($cat_id, 'ct_cat_icon', false, $post_type)) {
|
|
| 717 | + if (isset($term_icon_url['src']) && $term_icon_url['src'] != '') |
|
| 718 | + $term_icon = $term_icon_url['src']; |
|
| 719 | + break; |
|
| 720 | + } |
|
| 721 | + } |
|
| 722 | + } |
|
| 723 | + } |
|
| 724 | + } |
|
| 725 | + } |
|
| 726 | + } |
|
| 727 | 727 | |
| 728 | - $post_latitude = isset($post->post_latitude) ? $post->post_latitude : ''; |
|
| 729 | - $post_longitude = isset($post->post_longitude) ? $post->post_longitude : ''; |
|
| 728 | + $post_latitude = isset($post->post_latitude) ? $post->post_latitude : ''; |
|
| 729 | + $post_longitude = isset($post->post_longitude) ? $post->post_longitude : ''; |
|
| 730 | 730 | |
| 731 | - $srcharr = array("'", "/", "-", '"', '\\');
|
|
| 732 | - $replarr = array("′", "⁄", "–", "“", '');
|
|
| 731 | + $srcharr = array("'", "/", "-", '"', '\\');
|
|
| 732 | + $replarr = array("′", "⁄", "–", "“", '');
|
|
| 733 | 733 | |
| 734 | - $json_title = str_replace($srcharr, $replarr, $post->post_title); |
|
| 734 | + $json_title = str_replace($srcharr, $replarr, $post->post_title); |
|
| 735 | 735 | |
| 736 | - $json = '{';
|
|
| 737 | - $json .= '"post_preview": "1",'; |
|
| 738 | - $json .= '"t": "' . $json_title . '",'; |
|
| 739 | - $json .= '"lt": "' . $post_latitude . '",'; |
|
| 740 | - $json .= '"ln": "' . $post_longitude . '",'; |
|
| 741 | - $json .= '"i":"' . $term_icon . '"'; |
|
| 742 | - $json .= '}'; |
|
| 736 | + $json = '{';
|
|
| 737 | + $json .= '"post_preview": "1",'; |
|
| 738 | + $json .= '"t": "' . $json_title . '",'; |
|
| 739 | + $json .= '"lt": "' . $post_latitude . '",'; |
|
| 740 | + $json .= '"ln": "' . $post_longitude . '",'; |
|
| 741 | + $json .= '"i":"' . $term_icon . '"'; |
|
| 742 | + $json .= '}'; |
|
| 743 | 743 | |
| 744 | - $post->marker_json = $json; |
|
| 744 | + $post->marker_json = $json; |
|
| 745 | 745 | |
| 746 | - $gd_session->set('listing', $_REQUEST);
|
|
| 746 | + $gd_session->set('listing', $_REQUEST);
|
|
| 747 | 747 | |
| 748 | - // we need to define a few things to trick the setup_postdata |
|
| 749 | - if (!isset($post->ID)) {
|
|
| 750 | - $post->ID = ''; |
|
| 751 | - $post->post_author = ''; |
|
| 752 | - $post->post_date = ''; |
|
| 753 | - $post->post_content = ''; |
|
| 754 | - $post->default_category = ''; |
|
| 755 | - $post->post_type = ''; |
|
| 756 | - } |
|
| 757 | - setup_postdata($post); |
|
| 748 | + // we need to define a few things to trick the setup_postdata |
|
| 749 | + if (!isset($post->ID)) {
|
|
| 750 | + $post->ID = ''; |
|
| 751 | + $post->post_author = ''; |
|
| 752 | + $post->post_date = ''; |
|
| 753 | + $post->post_content = ''; |
|
| 754 | + $post->default_category = ''; |
|
| 755 | + $post->post_type = ''; |
|
| 756 | + } |
|
| 757 | + setup_postdata($post); |
|
| 758 | 758 | } |
| 759 | 759 | |
| 760 | 760 | /** |
@@ -766,15 +766,15 @@ discard block |
||
| 766 | 766 | */ |
| 767 | 767 | function geodir_action_geodir_preview_code() |
| 768 | 768 | {
|
| 769 | - global $preview; |
|
| 769 | + global $preview; |
|
| 770 | 770 | |
| 771 | - $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend |
|
| 771 | + $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend |
|
| 772 | 772 | |
| 773 | - if (!$preview || $is_backend_preview) {
|
|
| 774 | - return; |
|
| 775 | - }// bail if not previewing |
|
| 773 | + if (!$preview || $is_backend_preview) {
|
|
| 774 | + return; |
|
| 775 | + }// bail if not previewing |
|
| 776 | 776 | |
| 777 | - geodir_get_template_part('preview', 'buttons');
|
|
| 777 | + geodir_get_template_part('preview', 'buttons');
|
|
| 778 | 778 | } |
| 779 | 779 | |
| 780 | 780 | // action for adding the details page top widget area |
@@ -790,20 +790,20 @@ discard block |
||
| 790 | 790 | */ |
| 791 | 791 | function geodir_action_geodir_sidebar_detail_top($class = '') |
| 792 | 792 | {
|
| 793 | - if (get_option('geodir_show_detail_top_section')) { ?>
|
|
| 793 | + if (get_option('geodir_show_detail_top_section')) { ?>
|
|
| 794 | 794 | <div |
| 795 | 795 | class="<?php |
| 796 | - /** |
|
| 797 | - * Filter the div class for the wrapper of the full width widget areas. |
|
| 798 | - * |
|
| 799 | - * Allows you to filter the class of the div for the HTML Container wrapper for the full width widget areas referred to as "Top Section" or "Bottom Section" in the widget areas. |
|
| 800 | - * |
|
| 801 | - * @since 1.0.0 |
|
| 802 | - * @param string $class The class of the div. |
|
| 803 | - * @param string $type The page type the widget area is being used on. Values can be 'geodir_detail_top', 'geodir_detail_bottom', 'geodir_listing_top', 'geodir_listing_bottom', 'Reg/Login Top Section', |
|
| 804 | - * 'geodir_author_top','geodir_author_bottom', 'geodir_search_top', 'geodir_search_bottom', 'geodir_home_top' or 'geodir_home_bottom'. |
|
| 805 | - */ |
|
| 806 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_top'); ?> <?php echo $class; ?>">
|
|
| 796 | + /** |
|
| 797 | + * Filter the div class for the wrapper of the full width widget areas. |
|
| 798 | + * |
|
| 799 | + * Allows you to filter the class of the div for the HTML Container wrapper for the full width widget areas referred to as "Top Section" or "Bottom Section" in the widget areas. |
|
| 800 | + * |
|
| 801 | + * @since 1.0.0 |
|
| 802 | + * @param string $class The class of the div. |
|
| 803 | + * @param string $type The page type the widget area is being used on. Values can be 'geodir_detail_top', 'geodir_detail_bottom', 'geodir_listing_top', 'geodir_listing_bottom', 'Reg/Login Top Section', |
|
| 804 | + * 'geodir_author_top','geodir_author_bottom', 'geodir_search_top', 'geodir_search_bottom', 'geodir_home_top' or 'geodir_home_bottom'. |
|
| 805 | + */ |
|
| 806 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_top'); ?> <?php echo $class; ?>">
|
|
| 807 | 807 | <?php dynamic_sidebar('geodir_detail_top'); ?>
|
| 808 | 808 | </div> |
| 809 | 809 | <?php } |
@@ -827,11 +827,11 @@ discard block |
||
| 827 | 827 | */ |
| 828 | 828 | function geodir_action_geodir_sidebar_detail_bottom_section($class = '') |
| 829 | 829 | {
|
| 830 | - if (get_option('geodir_show_detail_bottom_section')) { ?>
|
|
| 830 | + if (get_option('geodir_show_detail_bottom_section')) { ?>
|
|
| 831 | 831 | <div |
| 832 | 832 | class="<?php |
| 833 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 834 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_bottom'); ?> <?php echo $class; ?>">
|
|
| 833 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 834 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_bottom'); ?> <?php echo $class; ?>">
|
|
| 835 | 835 | <?php dynamic_sidebar('geodir_detail_bottom'); ?>
|
| 836 | 836 | </div><!-- clearfix ends here--> |
| 837 | 837 | <?php } |
@@ -845,7 +845,7 @@ discard block |
||
| 845 | 845 | */ |
| 846 | 846 | function geodir_details_sidebar_widget_area() |
| 847 | 847 | {
|
| 848 | - dynamic_sidebar('geodir_detail_sidebar');
|
|
| 848 | + dynamic_sidebar('geodir_detail_sidebar');
|
|
| 849 | 849 | } |
| 850 | 850 | |
| 851 | 851 | /** |
@@ -856,12 +856,12 @@ discard block |
||
| 856 | 856 | */ |
| 857 | 857 | function geodir_details_sidebar_place_details() |
| 858 | 858 | {
|
| 859 | - /** |
|
| 860 | - * Used to add items to the details page sidebar. |
|
| 861 | - * |
|
| 862 | - * @since 1.0.0 |
|
| 863 | - */ |
|
| 864 | - do_action('geodir_detail_page_sidebar');
|
|
| 859 | + /** |
|
| 860 | + * Used to add items to the details page sidebar. |
|
| 861 | + * |
|
| 862 | + * @since 1.0.0 |
|
| 863 | + */ |
|
| 864 | + do_action('geodir_detail_page_sidebar');
|
|
| 865 | 865 | } |
| 866 | 866 | |
| 867 | 867 | add_action('geodir_detail_sidebar_inside', 'geodir_details_sidebar_place_details', 10);
|
@@ -876,68 +876,68 @@ discard block |
||
| 876 | 876 | */ |
| 877 | 877 | function geodir_action_details_sidebar() |
| 878 | 878 | {
|
| 879 | - // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='') |
|
| 880 | - if (get_option('geodir_detail_sidebar_left_section')) {
|
|
| 881 | - /** |
|
| 882 | - * Called before the details page left sidebar is opened. |
|
| 883 | - * |
|
| 884 | - * This is used to add opening wrapper HTML to the details page left sidebar. |
|
| 885 | - * |
|
| 886 | - * @since 1.0.0 |
|
| 887 | - * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
| 888 | - * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-left'. |
|
| 889 | - * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-left geodir-details-sidebar-left'. |
|
| 890 | - * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'. |
|
| 891 | - */ |
|
| 892 | - do_action('geodir_sidebar_left_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-left geodir-details-sidebar-left', 'http://schema.org/WPSideBar');
|
|
| 893 | - ?> |
|
| 879 | + // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='') |
|
| 880 | + if (get_option('geodir_detail_sidebar_left_section')) {
|
|
| 881 | + /** |
|
| 882 | + * Called before the details page left sidebar is opened. |
|
| 883 | + * |
|
| 884 | + * This is used to add opening wrapper HTML to the details page left sidebar. |
|
| 885 | + * |
|
| 886 | + * @since 1.0.0 |
|
| 887 | + * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
| 888 | + * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-left'. |
|
| 889 | + * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-left geodir-details-sidebar-left'. |
|
| 890 | + * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'. |
|
| 891 | + */ |
|
| 892 | + do_action('geodir_sidebar_left_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-left geodir-details-sidebar-left', 'http://schema.org/WPSideBar');
|
|
| 893 | + ?> |
|
| 894 | 894 | <div class="geodir-content-left geodir-sidebar-wrap"><?php |
| 895 | - /** |
|
| 896 | - * Called inside the HTML wrapper of the details sidebar for either the left and right sidebar. |
|
| 897 | - * |
|
| 898 | - * This is used to add all info to the details page sidebars. |
|
| 899 | - * |
|
| 900 | - * @since 1.0.0 |
|
| 901 | - */ |
|
| 902 | - do_action('geodir_detail_sidebar_inside');
|
|
| 903 | - ?></div><!-- end geodir-content-left --><?php |
|
| 904 | - /** |
|
| 905 | - * Called after the details page left sidebar. |
|
| 906 | - * |
|
| 907 | - * This is used to add closing wrapper HTML to the details page left sidebar. |
|
| 908 | - * |
|
| 909 | - * @since 1.0.0 |
|
| 910 | - * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
| 911 | - */ |
|
| 912 | - do_action('geodir_sidebar_left_close', 'details-page');
|
|
| 913 | - } else {
|
|
| 914 | - /** |
|
| 915 | - * Called before the details page right sidebar is opened. |
|
| 916 | - * |
|
| 917 | - * This is used to add opening wrapper HTML to the details page right sidebar. |
|
| 918 | - * |
|
| 919 | - * @since 1.0.0 |
|
| 920 | - * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'add-listing-page', 'author-page', 'search-page' or 'home-page'. |
|
| 921 | - * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-right'. |
|
| 922 | - * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-right geodir-details-sidebar-right'. |
|
| 923 | - * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'. |
|
| 924 | - */ |
|
| 925 | - do_action('geodir_sidebar_right_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-right geodir-details-sidebar-right', 'http://schema.org/WPSideBar');
|
|
| 926 | - ?> |
|
| 895 | + /** |
|
| 896 | + * Called inside the HTML wrapper of the details sidebar for either the left and right sidebar. |
|
| 897 | + * |
|
| 898 | + * This is used to add all info to the details page sidebars. |
|
| 899 | + * |
|
| 900 | + * @since 1.0.0 |
|
| 901 | + */ |
|
| 902 | + do_action('geodir_detail_sidebar_inside');
|
|
| 903 | + ?></div><!-- end geodir-content-left --><?php |
|
| 904 | + /** |
|
| 905 | + * Called after the details page left sidebar. |
|
| 906 | + * |
|
| 907 | + * This is used to add closing wrapper HTML to the details page left sidebar. |
|
| 908 | + * |
|
| 909 | + * @since 1.0.0 |
|
| 910 | + * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
| 911 | + */ |
|
| 912 | + do_action('geodir_sidebar_left_close', 'details-page');
|
|
| 913 | + } else {
|
|
| 914 | + /** |
|
| 915 | + * Called before the details page right sidebar is opened. |
|
| 916 | + * |
|
| 917 | + * This is used to add opening wrapper HTML to the details page right sidebar. |
|
| 918 | + * |
|
| 919 | + * @since 1.0.0 |
|
| 920 | + * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'add-listing-page', 'author-page', 'search-page' or 'home-page'. |
|
| 921 | + * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-right'. |
|
| 922 | + * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-right geodir-details-sidebar-right'. |
|
| 923 | + * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'. |
|
| 924 | + */ |
|
| 925 | + do_action('geodir_sidebar_right_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-right geodir-details-sidebar-right', 'http://schema.org/WPSideBar');
|
|
| 926 | + ?> |
|
| 927 | 927 | <div class="geodir-content-right geodir-sidebar-wrap"><?php |
| 928 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 929 | - do_action('geodir_detail_sidebar_inside');
|
|
| 930 | - ?></div><!-- end geodir-content-right --><?php |
|
| 931 | - /** |
|
| 932 | - * Called after the details page right sidebar. |
|
| 933 | - * |
|
| 934 | - * This is used to add closing wrapper HTML to the details page right sidebar. |
|
| 935 | - * |
|
| 936 | - * @since 1.0.0 |
|
| 937 | - * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
| 938 | - */ |
|
| 939 | - do_action('geodir_sidebar_right_close', 'details-page');
|
|
| 940 | - } |
|
| 928 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 929 | + do_action('geodir_detail_sidebar_inside');
|
|
| 930 | + ?></div><!-- end geodir-content-right --><?php |
|
| 931 | + /** |
|
| 932 | + * Called after the details page right sidebar. |
|
| 933 | + * |
|
| 934 | + * This is used to add closing wrapper HTML to the details page right sidebar. |
|
| 935 | + * |
|
| 936 | + * @since 1.0.0 |
|
| 937 | + * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
| 938 | + */ |
|
| 939 | + do_action('geodir_sidebar_right_close', 'details-page');
|
|
| 940 | + } |
|
| 941 | 941 | } |
| 942 | 942 | |
| 943 | 943 | add_action('geodir_page_title', 'geodir_action_page_title', 10);
|
@@ -951,21 +951,21 @@ discard block |
||
| 951 | 951 | */ |
| 952 | 952 | function geodir_action_page_title() |
| 953 | 953 | {
|
| 954 | - /** |
|
| 955 | - * Filter the page title HTML h1 class. |
|
| 956 | - * |
|
| 957 | - * @since 1.0.0 |
|
| 958 | - * @param string $class The class to use. Default is 'entry-title fn'. |
|
| 959 | - */ |
|
| 960 | - $class = apply_filters('geodir_page_title_class', 'entry-title fn');
|
|
| 961 | - /** |
|
| 962 | - * Filter the page title HTML header wrapper class. |
|
| 963 | - * |
|
| 964 | - * @since 1.0.0 |
|
| 965 | - * @param string $class The class to use. Default is 'entry-header'. |
|
| 966 | - */ |
|
| 967 | - $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
|
|
| 968 | - echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . stripslashes(get_the_title()) . '</h1></header>'; |
|
| 954 | + /** |
|
| 955 | + * Filter the page title HTML h1 class. |
|
| 956 | + * |
|
| 957 | + * @since 1.0.0 |
|
| 958 | + * @param string $class The class to use. Default is 'entry-title fn'. |
|
| 959 | + */ |
|
| 960 | + $class = apply_filters('geodir_page_title_class', 'entry-title fn');
|
|
| 961 | + /** |
|
| 962 | + * Filter the page title HTML header wrapper class. |
|
| 963 | + * |
|
| 964 | + * @since 1.0.0 |
|
| 965 | + * @param string $class The class to use. Default is 'entry-header'. |
|
| 966 | + */ |
|
| 967 | + $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
|
|
| 968 | + echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . stripslashes(get_the_title()) . '</h1></header>'; |
|
| 969 | 969 | } |
| 970 | 970 | |
| 971 | 971 | |
@@ -982,87 +982,87 @@ discard block |
||
| 982 | 982 | */ |
| 983 | 983 | function geodir_action_details_slider() |
| 984 | 984 | {
|
| 985 | - global $preview, $post; |
|
| 985 | + global $preview, $post; |
|
| 986 | 986 | |
| 987 | - $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // preview from backend |
|
| 987 | + $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // preview from backend |
|
| 988 | 988 | |
| 989 | - if ($is_backend_preview && !empty($post) && !empty($post->ID) && !isset($post->post_images)) {
|
|
| 990 | - $preview_get_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
|
|
| 989 | + if ($is_backend_preview && !empty($post) && !empty($post->ID) && !isset($post->post_images)) {
|
|
| 990 | + $preview_get_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
|
|
| 991 | 991 | |
| 992 | - $preview_post_images = array(); |
|
| 993 | - if ($preview_get_images) {
|
|
| 994 | - foreach ($preview_get_images as $row) {
|
|
| 995 | - $preview_post_images[] = $row->src; |
|
| 996 | - } |
|
| 997 | - } |
|
| 998 | - if (!empty($preview_post_images)) {
|
|
| 999 | - $post->post_images = implode(',', $preview_post_images);
|
|
| 1000 | - } |
|
| 1001 | - } |
|
| 1002 | - |
|
| 1003 | - if ($preview) {
|
|
| 1004 | - $post_images = array(); |
|
| 1005 | - if (isset($post->post_images) && !empty($post->post_images)) {
|
|
| 1006 | - $post->post_images = trim($post->post_images, ","); |
|
| 1007 | - $post_images = explode(",", $post->post_images);
|
|
| 1008 | - } |
|
| 1009 | - |
|
| 1010 | - $main_slides = ''; |
|
| 1011 | - $nav_slides = ''; |
|
| 1012 | - $slides = 0; |
|
| 1013 | - |
|
| 1014 | - if (!empty($post_images)) {
|
|
| 1015 | - foreach ($post_images as $image) {
|
|
| 1016 | - if (!empty($image)) {
|
|
| 1017 | - $sizes = getimagesize(trim($image)); |
|
| 1018 | - $width = !empty($sizes) && isset($sizes[0]) ? $sizes[0] : 0; |
|
| 1019 | - $height = !empty($sizes) && isset($sizes[1]) ? $sizes[1] : 0; |
|
| 1020 | - |
|
| 1021 | - if ($image && $width && $height) {
|
|
| 1022 | - $image = (object)array('src' => $image, 'width' => $width, 'height' => $height);
|
|
| 1023 | - } |
|
| 1024 | - |
|
| 1025 | - if (isset($image->src)) {
|
|
| 1026 | - if ($image->height >= 400) {
|
|
| 1027 | - $spacer_height = 0; |
|
| 1028 | - } else {
|
|
| 1029 | - $spacer_height = ((400 - $image->height) / 2); |
|
| 1030 | - } |
|
| 1031 | - |
|
| 1032 | - $image_title = isset($image->title) ? $image->title : ''; |
|
| 1033 | - |
|
| 1034 | - $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />'; |
|
| 1035 | - $main_slides .= '<img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:400px;margin:0 auto;" /></li>'; |
|
| 1036 | - $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:48px;margin:0 auto;" /></li>'; |
|
| 1037 | - $slides++; |
|
| 1038 | - } |
|
| 1039 | - } |
|
| 1040 | - }// endfore |
|
| 1041 | - } //end if |
|
| 1042 | - } else {
|
|
| 1043 | - $main_slides = ''; |
|
| 1044 | - $nav_slides = ''; |
|
| 1045 | - $post_images = geodir_get_images($post->ID, 'thumbnail', false); // Hide default image on listing preview/detail page. |
|
| 1046 | - $slides = 0; |
|
| 1047 | - |
|
| 1048 | - if (!empty($post_images)) {
|
|
| 1049 | - foreach ($post_images as $image) {
|
|
| 1050 | - if ($image->height >= 400) {
|
|
| 1051 | - $spacer_height = 0; |
|
| 1052 | - } else {
|
|
| 1053 | - $spacer_height = ((400 - $image->height) / 2); |
|
| 1054 | - } |
|
| 1055 | - $caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : ''; |
|
| 1056 | - $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />'; |
|
| 1057 | - $main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>'; |
|
| 1058 | - $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>'; |
|
| 1059 | - $slides++; |
|
| 1060 | - } |
|
| 1061 | - }// endfore |
|
| 1062 | - } |
|
| 992 | + $preview_post_images = array(); |
|
| 993 | + if ($preview_get_images) {
|
|
| 994 | + foreach ($preview_get_images as $row) {
|
|
| 995 | + $preview_post_images[] = $row->src; |
|
| 996 | + } |
|
| 997 | + } |
|
| 998 | + if (!empty($preview_post_images)) {
|
|
| 999 | + $post->post_images = implode(',', $preview_post_images);
|
|
| 1000 | + } |
|
| 1001 | + } |
|
| 1002 | + |
|
| 1003 | + if ($preview) {
|
|
| 1004 | + $post_images = array(); |
|
| 1005 | + if (isset($post->post_images) && !empty($post->post_images)) {
|
|
| 1006 | + $post->post_images = trim($post->post_images, ","); |
|
| 1007 | + $post_images = explode(",", $post->post_images);
|
|
| 1008 | + } |
|
| 1009 | + |
|
| 1010 | + $main_slides = ''; |
|
| 1011 | + $nav_slides = ''; |
|
| 1012 | + $slides = 0; |
|
| 1013 | + |
|
| 1014 | + if (!empty($post_images)) {
|
|
| 1015 | + foreach ($post_images as $image) {
|
|
| 1016 | + if (!empty($image)) {
|
|
| 1017 | + $sizes = getimagesize(trim($image)); |
|
| 1018 | + $width = !empty($sizes) && isset($sizes[0]) ? $sizes[0] : 0; |
|
| 1019 | + $height = !empty($sizes) && isset($sizes[1]) ? $sizes[1] : 0; |
|
| 1020 | + |
|
| 1021 | + if ($image && $width && $height) {
|
|
| 1022 | + $image = (object)array('src' => $image, 'width' => $width, 'height' => $height);
|
|
| 1023 | + } |
|
| 1024 | + |
|
| 1025 | + if (isset($image->src)) {
|
|
| 1026 | + if ($image->height >= 400) {
|
|
| 1027 | + $spacer_height = 0; |
|
| 1028 | + } else {
|
|
| 1029 | + $spacer_height = ((400 - $image->height) / 2); |
|
| 1030 | + } |
|
| 1031 | + |
|
| 1032 | + $image_title = isset($image->title) ? $image->title : ''; |
|
| 1033 | + |
|
| 1034 | + $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />'; |
|
| 1035 | + $main_slides .= '<img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:400px;margin:0 auto;" /></li>'; |
|
| 1036 | + $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:48px;margin:0 auto;" /></li>'; |
|
| 1037 | + $slides++; |
|
| 1038 | + } |
|
| 1039 | + } |
|
| 1040 | + }// endfore |
|
| 1041 | + } //end if |
|
| 1042 | + } else {
|
|
| 1043 | + $main_slides = ''; |
|
| 1044 | + $nav_slides = ''; |
|
| 1045 | + $post_images = geodir_get_images($post->ID, 'thumbnail', false); // Hide default image on listing preview/detail page. |
|
| 1046 | + $slides = 0; |
|
| 1047 | + |
|
| 1048 | + if (!empty($post_images)) {
|
|
| 1049 | + foreach ($post_images as $image) {
|
|
| 1050 | + if ($image->height >= 400) {
|
|
| 1051 | + $spacer_height = 0; |
|
| 1052 | + } else {
|
|
| 1053 | + $spacer_height = ((400 - $image->height) / 2); |
|
| 1054 | + } |
|
| 1055 | + $caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : ''; |
|
| 1056 | + $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />'; |
|
| 1057 | + $main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>'; |
|
| 1058 | + $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>'; |
|
| 1059 | + $slides++; |
|
| 1060 | + } |
|
| 1061 | + }// endfore |
|
| 1062 | + } |
|
| 1063 | 1063 | |
| 1064 | - if (!empty($post_images)) {
|
|
| 1065 | - ?> |
|
| 1064 | + if (!empty($post_images)) {
|
|
| 1065 | + ?> |
|
| 1066 | 1066 | <div class="geodir_flex-container"> |
| 1067 | 1067 | <div class="geodir_flex-loader"><i class="fa fa-refresh fa-spin"></i></div> |
| 1068 | 1068 | <div id="geodir_slider" class="geodir_flexslider "> |
@@ -1075,7 +1075,7 @@ discard block |
||
| 1075 | 1075 | <?php } ?> |
| 1076 | 1076 | </div> |
| 1077 | 1077 | <?php |
| 1078 | - } |
|
| 1078 | + } |
|
| 1079 | 1079 | } |
| 1080 | 1080 | |
| 1081 | 1081 | add_action('geodir_details_taxonomies', 'geodir_action_details_taxonomies', 10);
|
@@ -1090,177 +1090,177 @@ discard block |
||
| 1090 | 1090 | */ |
| 1091 | 1091 | function geodir_action_details_taxonomies() |
| 1092 | 1092 | {
|
| 1093 | - global $preview, $post;?> |
|
| 1093 | + global $preview, $post;?> |
|
| 1094 | 1094 | <p class="geodir_post_taxomomies clearfix"> |
| 1095 | 1095 | <?php |
| 1096 | - $taxonomies = array(); |
|
| 1097 | - |
|
| 1098 | - $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend |
|
| 1099 | - |
|
| 1100 | - if ($preview && !$is_backend_preview) {
|
|
| 1101 | - $post_type = $post->listing_type; |
|
| 1102 | - $post_taxonomy = $post_type . 'category'; |
|
| 1103 | - $post->{$post_taxonomy} = $post->post_category[$post_taxonomy];
|
|
| 1104 | - } else {
|
|
| 1105 | - $post_type = $post->post_type; |
|
| 1106 | - $post_taxonomy = $post_type . 'category'; |
|
| 1107 | - } |
|
| 1096 | + $taxonomies = array(); |
|
| 1097 | + |
|
| 1098 | + $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend |
|
| 1099 | + |
|
| 1100 | + if ($preview && !$is_backend_preview) {
|
|
| 1101 | + $post_type = $post->listing_type; |
|
| 1102 | + $post_taxonomy = $post_type . 'category'; |
|
| 1103 | + $post->{$post_taxonomy} = $post->post_category[$post_taxonomy];
|
|
| 1104 | + } else {
|
|
| 1105 | + $post_type = $post->post_type; |
|
| 1106 | + $post_taxonomy = $post_type . 'category'; |
|
| 1107 | + } |
|
| 1108 | 1108 | //{
|
| 1109 | - $post_type_info = get_post_type_object($post_type); |
|
| 1110 | - $listing_label = __($post_type_info->labels->singular_name, 'geodirectory'); |
|
| 1111 | - |
|
| 1112 | - if (!empty($post->post_tags)) {
|
|
| 1113 | - |
|
| 1114 | - if (taxonomy_exists($post_type . '_tags')): |
|
| 1115 | - $links = array(); |
|
| 1116 | - $terms = array(); |
|
| 1117 | - // to limit post tags |
|
| 1118 | - $post_tags = trim($post->post_tags, ","); |
|
| 1119 | - $post_id = isset($post->ID) ? $post->ID : ''; |
|
| 1120 | - /** |
|
| 1121 | - * Filter the post tags. |
|
| 1122 | - * |
|
| 1123 | - * Allows you to filter the post tags output on the details page of a post. |
|
| 1124 | - * |
|
| 1125 | - * @since 1.0.0 |
|
| 1126 | - * @param string $post_tags A comma seperated list of tags. |
|
| 1127 | - * @param int $post_id The current post id. |
|
| 1128 | - */ |
|
| 1129 | - $post_tags = apply_filters('geodir_action_details_post_tags', $post_tags, $post_id);
|
|
| 1130 | - |
|
| 1131 | - $post->post_tags = $post_tags; |
|
| 1132 | - $post_tags = explode(",", trim($post->post_tags, ","));
|
|
| 1133 | - |
|
| 1134 | - |
|
| 1135 | - foreach ($post_tags as $post_term) {
|
|
| 1136 | - |
|
| 1137 | - // fix slug creation order for tags & location |
|
| 1138 | - $post_term = trim($post_term); |
|
| 1139 | - |
|
| 1140 | - $priority_location = false; |
|
| 1141 | - if ($insert_term = term_exists($post_term, $post_type . '_tags')) {
|
|
| 1142 | - $term = get_term_by('id', $insert_term['term_id'], $post_type . '_tags');
|
|
| 1143 | - } else {
|
|
| 1144 | - $post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL; |
|
| 1145 | - $post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL; |
|
| 1146 | - $post_city = isset($_REQUEST['post_city']) && $_REQUEST['post_city'] != '' ? sanitize_text_field($_REQUEST['post_city']) : NULL; |
|
| 1147 | - $match_country = $post_country && sanitize_title($post_term) == sanitize_title($post_country) ? true : false; |
|
| 1148 | - $match_region = $post_region && sanitize_title($post_term) == sanitize_title($post_region) ? true : false; |
|
| 1149 | - $match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false; |
|
| 1150 | - if ($match_country || $match_region || $match_city) {
|
|
| 1151 | - $priority_location = true; |
|
| 1152 | - $term = get_term_by('name', $post_term, $post_type . '_tags');
|
|
| 1153 | - } else {
|
|
| 1154 | - $insert_term = wp_insert_term($post_term, $post_type . '_tags'); |
|
| 1155 | - $term = get_term_by('name', $post_term, $post_type . '_tags');
|
|
| 1156 | - } |
|
| 1157 | - } |
|
| 1158 | - |
|
| 1159 | - if (!is_wp_error($term) && is_object($term)) {
|
|
| 1160 | - |
|
| 1161 | - // fix tag link on detail page |
|
| 1162 | - if ($priority_location) {
|
|
| 1163 | - |
|
| 1164 | - $tag_link = "<a href=''>$post_term</a>"; |
|
| 1165 | - /** |
|
| 1166 | - * Filter the tag name on the details page. |
|
| 1167 | - * |
|
| 1168 | - * @since 1.5.6 |
|
| 1169 | - * @param string $tag_link The tag link html. |
|
| 1170 | - * @param object $term The tag term object. |
|
| 1171 | - */ |
|
| 1172 | - $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
|
|
| 1173 | - $links[] = $tag_link; |
|
| 1174 | - } else {
|
|
| 1175 | - $tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>"; |
|
| 1176 | - /** This action is documented in geodirectory-template_actions.php */ |
|
| 1177 | - $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
|
|
| 1178 | - $links[] = $tag_link; |
|
| 1179 | - } |
|
| 1180 | - $terms[] = $term; |
|
| 1181 | - } |
|
| 1182 | - // |
|
| 1183 | - } |
|
| 1184 | - if (!isset($listing_label)) {
|
|
| 1185 | - $listing_label = ''; |
|
| 1186 | - } |
|
| 1187 | - $taxonomies[$post_type . '_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
|
|
| 1188 | - endif; |
|
| 1189 | - |
|
| 1190 | - } |
|
| 1191 | - |
|
| 1192 | - if (!empty($post->{$post_taxonomy})) {
|
|
| 1193 | - $links = array(); |
|
| 1194 | - $terms = array(); |
|
| 1195 | - $termsOrdered = array(); |
|
| 1196 | - if (!is_array($post->{$post_taxonomy})) {
|
|
| 1197 | - $post_term = explode(",", trim($post->{$post_taxonomy}, ","));
|
|
| 1198 | - } else {
|
|
| 1199 | - $post_term = $post->{$post_taxonomy};
|
|
| 1109 | + $post_type_info = get_post_type_object($post_type); |
|
| 1110 | + $listing_label = __($post_type_info->labels->singular_name, 'geodirectory'); |
|
| 1111 | + |
|
| 1112 | + if (!empty($post->post_tags)) {
|
|
| 1113 | + |
|
| 1114 | + if (taxonomy_exists($post_type . '_tags')): |
|
| 1115 | + $links = array(); |
|
| 1116 | + $terms = array(); |
|
| 1117 | + // to limit post tags |
|
| 1118 | + $post_tags = trim($post->post_tags, ","); |
|
| 1119 | + $post_id = isset($post->ID) ? $post->ID : ''; |
|
| 1120 | + /** |
|
| 1121 | + * Filter the post tags. |
|
| 1122 | + * |
|
| 1123 | + * Allows you to filter the post tags output on the details page of a post. |
|
| 1124 | + * |
|
| 1125 | + * @since 1.0.0 |
|
| 1126 | + * @param string $post_tags A comma seperated list of tags. |
|
| 1127 | + * @param int $post_id The current post id. |
|
| 1128 | + */ |
|
| 1129 | + $post_tags = apply_filters('geodir_action_details_post_tags', $post_tags, $post_id);
|
|
| 1130 | + |
|
| 1131 | + $post->post_tags = $post_tags; |
|
| 1132 | + $post_tags = explode(",", trim($post->post_tags, ","));
|
|
| 1133 | + |
|
| 1134 | + |
|
| 1135 | + foreach ($post_tags as $post_term) {
|
|
| 1136 | + |
|
| 1137 | + // fix slug creation order for tags & location |
|
| 1138 | + $post_term = trim($post_term); |
|
| 1139 | + |
|
| 1140 | + $priority_location = false; |
|
| 1141 | + if ($insert_term = term_exists($post_term, $post_type . '_tags')) {
|
|
| 1142 | + $term = get_term_by('id', $insert_term['term_id'], $post_type . '_tags');
|
|
| 1143 | + } else {
|
|
| 1144 | + $post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL; |
|
| 1145 | + $post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL; |
|
| 1146 | + $post_city = isset($_REQUEST['post_city']) && $_REQUEST['post_city'] != '' ? sanitize_text_field($_REQUEST['post_city']) : NULL; |
|
| 1147 | + $match_country = $post_country && sanitize_title($post_term) == sanitize_title($post_country) ? true : false; |
|
| 1148 | + $match_region = $post_region && sanitize_title($post_term) == sanitize_title($post_region) ? true : false; |
|
| 1149 | + $match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false; |
|
| 1150 | + if ($match_country || $match_region || $match_city) {
|
|
| 1151 | + $priority_location = true; |
|
| 1152 | + $term = get_term_by('name', $post_term, $post_type . '_tags');
|
|
| 1153 | + } else {
|
|
| 1154 | + $insert_term = wp_insert_term($post_term, $post_type . '_tags'); |
|
| 1155 | + $term = get_term_by('name', $post_term, $post_type . '_tags');
|
|
| 1156 | + } |
|
| 1157 | + } |
|
| 1158 | + |
|
| 1159 | + if (!is_wp_error($term) && is_object($term)) {
|
|
| 1160 | + |
|
| 1161 | + // fix tag link on detail page |
|
| 1162 | + if ($priority_location) {
|
|
| 1163 | + |
|
| 1164 | + $tag_link = "<a href=''>$post_term</a>"; |
|
| 1165 | + /** |
|
| 1166 | + * Filter the tag name on the details page. |
|
| 1167 | + * |
|
| 1168 | + * @since 1.5.6 |
|
| 1169 | + * @param string $tag_link The tag link html. |
|
| 1170 | + * @param object $term The tag term object. |
|
| 1171 | + */ |
|
| 1172 | + $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
|
|
| 1173 | + $links[] = $tag_link; |
|
| 1174 | + } else {
|
|
| 1175 | + $tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>"; |
|
| 1176 | + /** This action is documented in geodirectory-template_actions.php */ |
|
| 1177 | + $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
|
|
| 1178 | + $links[] = $tag_link; |
|
| 1179 | + } |
|
| 1180 | + $terms[] = $term; |
|
| 1181 | + } |
|
| 1182 | + // |
|
| 1183 | + } |
|
| 1184 | + if (!isset($listing_label)) {
|
|
| 1185 | + $listing_label = ''; |
|
| 1186 | + } |
|
| 1187 | + $taxonomies[$post_type . '_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
|
|
| 1188 | + endif; |
|
| 1189 | + |
|
| 1190 | + } |
|
| 1191 | + |
|
| 1192 | + if (!empty($post->{$post_taxonomy})) {
|
|
| 1193 | + $links = array(); |
|
| 1194 | + $terms = array(); |
|
| 1195 | + $termsOrdered = array(); |
|
| 1196 | + if (!is_array($post->{$post_taxonomy})) {
|
|
| 1197 | + $post_term = explode(",", trim($post->{$post_taxonomy}, ","));
|
|
| 1198 | + } else {
|
|
| 1199 | + $post_term = $post->{$post_taxonomy};
|
|
| 1200 | 1200 | |
| 1201 | 1201 | if ($preview && !$is_backend_preview) {
|
| 1202 | 1202 | $post_term = geodir_add_parent_terms($post_term, $post_taxonomy); |
| 1203 | 1203 | } |
| 1204 | - } |
|
| 1205 | - |
|
| 1206 | - $post_term = array_unique($post_term); |
|
| 1207 | - if (!empty($post_term)) {
|
|
| 1208 | - foreach ($post_term as $post_term) {
|
|
| 1209 | - $post_term = trim($post_term); |
|
| 1210 | - |
|
| 1211 | - if ($post_term != ''): |
|
| 1212 | - $term = get_term_by('id', $post_term, $post_taxonomy);
|
|
| 1213 | - |
|
| 1214 | - if (is_object($term)) {
|
|
| 1215 | - $term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>"; |
|
| 1216 | - /** |
|
| 1217 | - * Filter the category name on the details page. |
|
| 1218 | - * |
|
| 1219 | - * @since 1.5.6 |
|
| 1220 | - * @param string $term_link The link html to the category. |
|
| 1221 | - * @param object $term The category term object. |
|
| 1222 | - */ |
|
| 1223 | - $term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term);
|
|
| 1224 | - $links[] = $term_link; |
|
| 1225 | - $terms[] = $term; |
|
| 1226 | - } |
|
| 1227 | - endif; |
|
| 1228 | - } |
|
| 1229 | - // order alphabetically |
|
| 1230 | - asort($links); |
|
| 1231 | - foreach (array_keys($links) as $key) {
|
|
| 1232 | - $termsOrdered[$key] = $terms[$key]; |
|
| 1233 | - } |
|
| 1234 | - $terms = $termsOrdered; |
|
| 1204 | + } |
|
| 1205 | + |
|
| 1206 | + $post_term = array_unique($post_term); |
|
| 1207 | + if (!empty($post_term)) {
|
|
| 1208 | + foreach ($post_term as $post_term) {
|
|
| 1209 | + $post_term = trim($post_term); |
|
| 1210 | + |
|
| 1211 | + if ($post_term != ''): |
|
| 1212 | + $term = get_term_by('id', $post_term, $post_taxonomy);
|
|
| 1213 | + |
|
| 1214 | + if (is_object($term)) {
|
|
| 1215 | + $term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>"; |
|
| 1216 | + /** |
|
| 1217 | + * Filter the category name on the details page. |
|
| 1218 | + * |
|
| 1219 | + * @since 1.5.6 |
|
| 1220 | + * @param string $term_link The link html to the category. |
|
| 1221 | + * @param object $term The category term object. |
|
| 1222 | + */ |
|
| 1223 | + $term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term);
|
|
| 1224 | + $links[] = $term_link; |
|
| 1225 | + $terms[] = $term; |
|
| 1226 | + } |
|
| 1227 | + endif; |
|
| 1228 | + } |
|
| 1229 | + // order alphabetically |
|
| 1230 | + asort($links); |
|
| 1231 | + foreach (array_keys($links) as $key) {
|
|
| 1232 | + $termsOrdered[$key] = $terms[$key]; |
|
| 1233 | + } |
|
| 1234 | + $terms = $termsOrdered; |
|
| 1235 | 1235 | |
| 1236 | - } |
|
| 1236 | + } |
|
| 1237 | 1237 | |
| 1238 | - if (!isset($listing_label)) {
|
|
| 1239 | - $listing_label = ''; |
|
| 1240 | - } |
|
| 1241 | - $taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
|
|
| 1238 | + if (!isset($listing_label)) {
|
|
| 1239 | + $listing_label = ''; |
|
| 1240 | + } |
|
| 1241 | + $taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
|
|
| 1242 | 1242 | |
| 1243 | - } |
|
| 1243 | + } |
|
| 1244 | 1244 | |
| 1245 | - /** |
|
| 1246 | - * Filter the taxonomies array before output. |
|
| 1247 | - * |
|
| 1248 | - * @since 1.5.9 |
|
| 1249 | - * @param array $taxonomies The array of cats and tags. |
|
| 1250 | - * @param string $post_type The post type being output. |
|
| 1251 | - * @param string $listing_label The post type label. |
|
| 1252 | - * @param string $listing_label The post type label with ucwords function. |
|
| 1253 | - */ |
|
| 1254 | - $taxonomies = apply_filters('geodir_details_taxonomies_output',$taxonomies,$post_type,$listing_label,geodir_ucwords($listing_label));
|
|
| 1245 | + /** |
|
| 1246 | + * Filter the taxonomies array before output. |
|
| 1247 | + * |
|
| 1248 | + * @since 1.5.9 |
|
| 1249 | + * @param array $taxonomies The array of cats and tags. |
|
| 1250 | + * @param string $post_type The post type being output. |
|
| 1251 | + * @param string $listing_label The post type label. |
|
| 1252 | + * @param string $listing_label The post type label with ucwords function. |
|
| 1253 | + */ |
|
| 1254 | + $taxonomies = apply_filters('geodir_details_taxonomies_output',$taxonomies,$post_type,$listing_label,geodir_ucwords($listing_label));
|
|
| 1255 | 1255 | |
| 1256 | - if (isset($taxonomies[$post_taxonomy])) {
|
|
| 1257 | - echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>'; |
|
| 1258 | - } |
|
| 1256 | + if (isset($taxonomies[$post_taxonomy])) {
|
|
| 1257 | + echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>'; |
|
| 1258 | + } |
|
| 1259 | 1259 | |
| 1260 | - if (isset($taxonomies[$post_type . '_tags'])) |
|
| 1261 | - echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>'; |
|
| 1260 | + if (isset($taxonomies[$post_type . '_tags'])) |
|
| 1261 | + echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>'; |
|
| 1262 | 1262 | |
| 1263 | - ?> |
|
| 1263 | + ?> |
|
| 1264 | 1264 | </p><?php |
| 1265 | 1265 | } |
| 1266 | 1266 | |
@@ -1282,127 +1282,127 @@ discard block |
||
| 1282 | 1282 | function geodir_action_details_micordata($post='') |
| 1283 | 1283 | {
|
| 1284 | 1284 | |
| 1285 | - global $preview; |
|
| 1286 | - if(empty($post)){global $post;}
|
|
| 1287 | - if ($preview || !geodir_is_page('detail')) {
|
|
| 1288 | - return; |
|
| 1289 | - } |
|
| 1290 | - |
|
| 1291 | - // url |
|
| 1292 | - $c_url = geodir_curPageURL(); |
|
| 1293 | - |
|
| 1294 | - // post reviews |
|
| 1295 | - $post_reviews = get_comments(array('post_id' => $post->ID, 'status' => 'approve'));
|
|
| 1296 | - if (empty($post_reviews)) {
|
|
| 1297 | - $reviews = ''; |
|
| 1298 | - } else {
|
|
| 1299 | - foreach ($post_reviews as $review) {
|
|
| 1300 | - $reviews[] = array( |
|
| 1301 | - "@type" => "Review", |
|
| 1302 | - "author" => $review->comment_author, |
|
| 1303 | - "datePublished" => $review->comment_date, |
|
| 1304 | - "description" => $review->comment_content, |
|
| 1305 | - "reviewRating" => array( |
|
| 1306 | - "@type" => "Rating", |
|
| 1307 | - "bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score. |
|
| 1308 | - "ratingValue" => geodir_get_commentoverall($review->comment_ID), |
|
| 1309 | - "worstRating" => "1" |
|
| 1310 | - ) |
|
| 1311 | - ); |
|
| 1312 | - } |
|
| 1313 | - |
|
| 1314 | - } |
|
| 1315 | - |
|
| 1316 | - // post images |
|
| 1317 | - $post_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
|
|
| 1318 | - if (empty($post_images)) {
|
|
| 1319 | - $images = ''; |
|
| 1320 | - } else {
|
|
| 1321 | - $i_arr = array(); |
|
| 1322 | - foreach ($post_images as $img) {
|
|
| 1323 | - $i_arr[] = $img->src; |
|
| 1324 | - } |
|
| 1325 | - |
|
| 1326 | - if (count($i_arr) == 1) {
|
|
| 1327 | - $images = $i_arr[0]; |
|
| 1328 | - } else {
|
|
| 1329 | - $images = $i_arr; |
|
| 1330 | - } |
|
| 1331 | - |
|
| 1332 | - } |
|
| 1333 | - //print_r($post); |
|
| 1334 | - // external links |
|
| 1335 | - $external_links = array(); |
|
| 1336 | - $external_links[] = $post->geodir_website; |
|
| 1337 | - $external_links[] = $post->geodir_twitter; |
|
| 1338 | - $external_links[] = $post->geodir_facebook; |
|
| 1339 | - $external_links = array_filter($external_links); |
|
| 1340 | - |
|
| 1341 | - if(!empty($external_links)){
|
|
| 1342 | - $external_links = array_values($external_links); |
|
| 1343 | - } |
|
| 1344 | - |
|
| 1345 | - // reviews |
|
| 1346 | - $comment_count = geodir_get_review_count_total($post->ID); |
|
| 1347 | - $post_avgratings = geodir_get_post_rating($post->ID); |
|
| 1348 | - |
|
| 1349 | - // schema type |
|
| 1350 | - $schema_type = 'LocalBusiness'; |
|
| 1351 | - if(isset($post->default_category) && $post->default_category){
|
|
| 1352 | - $cat_schema = get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type); |
|
| 1353 | - if($cat_schema){$schema_type = $cat_schema;}
|
|
| 1354 | - if(!$schema_type && $post->post_type=='gd_event'){$schema_type = 'Event';}
|
|
| 1355 | - } |
|
| 1356 | - |
|
| 1357 | - $schema = array(); |
|
| 1358 | - $schema['@context'] = "http://schema.org"; |
|
| 1359 | - $schema['@type'] = $schema_type; |
|
| 1360 | - $schema['name'] = $post->post_name; |
|
| 1361 | - $schema['description'] = wp_strip_all_tags( $post->post_content, true ); |
|
| 1362 | - $schema['telephone'] = $post->geodir_contact; |
|
| 1363 | - $schema['url'] = $c_url; |
|
| 1364 | - $schema['sameAs'] = $external_links; |
|
| 1365 | - $schema['image'] = $images; |
|
| 1366 | - $schema['address'] = array( |
|
| 1367 | - "@type" => "PostalAddress", |
|
| 1368 | - "streetAddress" => $post->post_address, |
|
| 1369 | - "addressLocality" => $post->post_city, |
|
| 1370 | - "addressRegion" => $post->post_region, |
|
| 1371 | - "addressCountry" => $post->post_country, |
|
| 1372 | - "postalCode" => $post->post_zip |
|
| 1373 | - ); |
|
| 1374 | - |
|
| 1375 | - if($post->post_latitude && $post->post_longitude) {
|
|
| 1376 | - $schema['geo'] = array( |
|
| 1377 | - "@type" => "GeoCoordinates", |
|
| 1378 | - "latitude" => $post->post_latitude, |
|
| 1379 | - "longitude" => $post->post_longitude |
|
| 1380 | - ); |
|
| 1381 | - } |
|
| 1382 | - |
|
| 1383 | - if($post_avgratings) {
|
|
| 1384 | - $schema['aggregateRating'] = array( |
|
| 1385 | - "@type" => "AggregateRating", |
|
| 1386 | - "ratingValue" => $post_avgratings, |
|
| 1387 | - "bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score. |
|
| 1388 | - "worstRating" => "1", |
|
| 1389 | - "ratingCount" => $comment_count |
|
| 1390 | - ); |
|
| 1391 | - } |
|
| 1392 | - $schema['review'] = $reviews; |
|
| 1393 | - |
|
| 1394 | - /** |
|
| 1395 | - * Allow the schema JSON-LD info to be filtered. |
|
| 1396 | - * |
|
| 1397 | - * @since 1.5.4 |
|
| 1398 | - * @since 1.5.7 Added $post variable. |
|
| 1399 | - * @param array $schema The array of schema data to be filtered. |
|
| 1400 | - * @param object $post The post object. |
|
| 1401 | - */ |
|
| 1402 | - $schema = apply_filters('geodir_details_schema', $schema,$post);
|
|
| 1403 | - |
|
| 1404 | - |
|
| 1405 | - echo '<script type="application/ld+json">' . json_encode($schema) . '</script>'; |
|
| 1285 | + global $preview; |
|
| 1286 | + if(empty($post)){global $post;}
|
|
| 1287 | + if ($preview || !geodir_is_page('detail')) {
|
|
| 1288 | + return; |
|
| 1289 | + } |
|
| 1290 | + |
|
| 1291 | + // url |
|
| 1292 | + $c_url = geodir_curPageURL(); |
|
| 1293 | + |
|
| 1294 | + // post reviews |
|
| 1295 | + $post_reviews = get_comments(array('post_id' => $post->ID, 'status' => 'approve'));
|
|
| 1296 | + if (empty($post_reviews)) {
|
|
| 1297 | + $reviews = ''; |
|
| 1298 | + } else {
|
|
| 1299 | + foreach ($post_reviews as $review) {
|
|
| 1300 | + $reviews[] = array( |
|
| 1301 | + "@type" => "Review", |
|
| 1302 | + "author" => $review->comment_author, |
|
| 1303 | + "datePublished" => $review->comment_date, |
|
| 1304 | + "description" => $review->comment_content, |
|
| 1305 | + "reviewRating" => array( |
|
| 1306 | + "@type" => "Rating", |
|
| 1307 | + "bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score. |
|
| 1308 | + "ratingValue" => geodir_get_commentoverall($review->comment_ID), |
|
| 1309 | + "worstRating" => "1" |
|
| 1310 | + ) |
|
| 1311 | + ); |
|
| 1312 | + } |
|
| 1313 | + |
|
| 1314 | + } |
|
| 1315 | + |
|
| 1316 | + // post images |
|
| 1317 | + $post_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
|
|
| 1318 | + if (empty($post_images)) {
|
|
| 1319 | + $images = ''; |
|
| 1320 | + } else {
|
|
| 1321 | + $i_arr = array(); |
|
| 1322 | + foreach ($post_images as $img) {
|
|
| 1323 | + $i_arr[] = $img->src; |
|
| 1324 | + } |
|
| 1325 | + |
|
| 1326 | + if (count($i_arr) == 1) {
|
|
| 1327 | + $images = $i_arr[0]; |
|
| 1328 | + } else {
|
|
| 1329 | + $images = $i_arr; |
|
| 1330 | + } |
|
| 1331 | + |
|
| 1332 | + } |
|
| 1333 | + //print_r($post); |
|
| 1334 | + // external links |
|
| 1335 | + $external_links = array(); |
|
| 1336 | + $external_links[] = $post->geodir_website; |
|
| 1337 | + $external_links[] = $post->geodir_twitter; |
|
| 1338 | + $external_links[] = $post->geodir_facebook; |
|
| 1339 | + $external_links = array_filter($external_links); |
|
| 1340 | + |
|
| 1341 | + if(!empty($external_links)){
|
|
| 1342 | + $external_links = array_values($external_links); |
|
| 1343 | + } |
|
| 1344 | + |
|
| 1345 | + // reviews |
|
| 1346 | + $comment_count = geodir_get_review_count_total($post->ID); |
|
| 1347 | + $post_avgratings = geodir_get_post_rating($post->ID); |
|
| 1348 | + |
|
| 1349 | + // schema type |
|
| 1350 | + $schema_type = 'LocalBusiness'; |
|
| 1351 | + if(isset($post->default_category) && $post->default_category){
|
|
| 1352 | + $cat_schema = get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type); |
|
| 1353 | + if($cat_schema){$schema_type = $cat_schema;}
|
|
| 1354 | + if(!$schema_type && $post->post_type=='gd_event'){$schema_type = 'Event';}
|
|
| 1355 | + } |
|
| 1356 | + |
|
| 1357 | + $schema = array(); |
|
| 1358 | + $schema['@context'] = "http://schema.org"; |
|
| 1359 | + $schema['@type'] = $schema_type; |
|
| 1360 | + $schema['name'] = $post->post_name; |
|
| 1361 | + $schema['description'] = wp_strip_all_tags( $post->post_content, true ); |
|
| 1362 | + $schema['telephone'] = $post->geodir_contact; |
|
| 1363 | + $schema['url'] = $c_url; |
|
| 1364 | + $schema['sameAs'] = $external_links; |
|
| 1365 | + $schema['image'] = $images; |
|
| 1366 | + $schema['address'] = array( |
|
| 1367 | + "@type" => "PostalAddress", |
|
| 1368 | + "streetAddress" => $post->post_address, |
|
| 1369 | + "addressLocality" => $post->post_city, |
|
| 1370 | + "addressRegion" => $post->post_region, |
|
| 1371 | + "addressCountry" => $post->post_country, |
|
| 1372 | + "postalCode" => $post->post_zip |
|
| 1373 | + ); |
|
| 1374 | + |
|
| 1375 | + if($post->post_latitude && $post->post_longitude) {
|
|
| 1376 | + $schema['geo'] = array( |
|
| 1377 | + "@type" => "GeoCoordinates", |
|
| 1378 | + "latitude" => $post->post_latitude, |
|
| 1379 | + "longitude" => $post->post_longitude |
|
| 1380 | + ); |
|
| 1381 | + } |
|
| 1382 | + |
|
| 1383 | + if($post_avgratings) {
|
|
| 1384 | + $schema['aggregateRating'] = array( |
|
| 1385 | + "@type" => "AggregateRating", |
|
| 1386 | + "ratingValue" => $post_avgratings, |
|
| 1387 | + "bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score. |
|
| 1388 | + "worstRating" => "1", |
|
| 1389 | + "ratingCount" => $comment_count |
|
| 1390 | + ); |
|
| 1391 | + } |
|
| 1392 | + $schema['review'] = $reviews; |
|
| 1393 | + |
|
| 1394 | + /** |
|
| 1395 | + * Allow the schema JSON-LD info to be filtered. |
|
| 1396 | + * |
|
| 1397 | + * @since 1.5.4 |
|
| 1398 | + * @since 1.5.7 Added $post variable. |
|
| 1399 | + * @param array $schema The array of schema data to be filtered. |
|
| 1400 | + * @param object $post The post object. |
|
| 1401 | + */ |
|
| 1402 | + $schema = apply_filters('geodir_details_schema', $schema,$post);
|
|
| 1403 | + |
|
| 1404 | + |
|
| 1405 | + echo '<script type="application/ld+json">' . json_encode($schema) . '</script>'; |
|
| 1406 | 1406 | |
| 1407 | 1407 | } |
| 1408 | 1408 | |
@@ -1420,7 +1420,7 @@ discard block |
||
| 1420 | 1420 | */ |
| 1421 | 1421 | function geodir_action_details_next_prev() |
| 1422 | 1422 | {
|
| 1423 | - ?> |
|
| 1423 | + ?> |
|
| 1424 | 1424 | <div class="geodir-pos_navigation clearfix"> |
| 1425 | 1425 | <div |
| 1426 | 1426 | class="geodir-post_left"><?php previous_post_link('%link', '' . __('Previous', 'geodirectory'), false) ?></div>
|
@@ -1438,15 +1438,15 @@ discard block |
||
| 1438 | 1438 | */ |
| 1439 | 1439 | function geodir_action_before_single_post() |
| 1440 | 1440 | {
|
| 1441 | - global $post; |
|
| 1442 | - /** |
|
| 1443 | - * Called at the very start of the details page output, before the title section. |
|
| 1444 | - * |
|
| 1445 | - * @since 1.0.0 |
|
| 1446 | - * @param object $post The current post object. |
|
| 1447 | - * @global WP_Post|null $post The current post, if available. |
|
| 1448 | - */ |
|
| 1449 | - do_action('geodir_before_single_post', $post); // extra action
|
|
| 1441 | + global $post; |
|
| 1442 | + /** |
|
| 1443 | + * Called at the very start of the details page output, before the title section. |
|
| 1444 | + * |
|
| 1445 | + * @since 1.0.0 |
|
| 1446 | + * @param object $post The current post object. |
|
| 1447 | + * @global WP_Post|null $post The current post, if available. |
|
| 1448 | + */ |
|
| 1449 | + do_action('geodir_before_single_post', $post); // extra action
|
|
| 1450 | 1450 | } |
| 1451 | 1451 | |
| 1452 | 1452 | /** |
@@ -1457,13 +1457,13 @@ discard block |
||
| 1457 | 1457 | */ |
| 1458 | 1458 | function geodir_action_after_single_post($post) |
| 1459 | 1459 | {
|
| 1460 | - /** |
|
| 1461 | - * Called on the details page after the details page tabs section and before the next/prev buttons. |
|
| 1462 | - * |
|
| 1463 | - * @since 1.0.0 |
|
| 1464 | - * @param object $post The current post object. |
|
| 1465 | - */ |
|
| 1466 | - do_action('geodir_after_single_post', $post); // extra action
|
|
| 1460 | + /** |
|
| 1461 | + * Called on the details page after the details page tabs section and before the next/prev buttons. |
|
| 1462 | + * |
|
| 1463 | + * @since 1.0.0 |
|
| 1464 | + * @param object $post The current post object. |
|
| 1465 | + */ |
|
| 1466 | + do_action('geodir_after_single_post', $post); // extra action
|
|
| 1467 | 1467 | } |
| 1468 | 1468 | |
| 1469 | 1469 | add_action('geodir_details_main_content', 'geodir_action_before_single_post', 10);
|
@@ -1489,167 +1489,167 @@ discard block |
||
| 1489 | 1489 | */ |
| 1490 | 1490 | function geodir_action_listings_title() |
| 1491 | 1491 | {
|
| 1492 | - global $wp, $term; |
|
| 1492 | + global $wp, $term; |
|
| 1493 | 1493 | |
| 1494 | - $gd_post_type = geodir_get_current_posttype(); |
|
| 1495 | - $post_type_info = get_post_type_object($gd_post_type); |
|
| 1494 | + $gd_post_type = geodir_get_current_posttype(); |
|
| 1495 | + $post_type_info = get_post_type_object($gd_post_type); |
|
| 1496 | 1496 | |
| 1497 | - $add_string_in_title = __('All', 'geodirectory') . ' ';
|
|
| 1498 | - if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
|
|
| 1499 | - $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
|
|
| 1500 | - } |
|
| 1497 | + $add_string_in_title = __('All', 'geodirectory') . ' ';
|
|
| 1498 | + if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
|
|
| 1499 | + $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
|
|
| 1500 | + } |
|
| 1501 | 1501 | |
| 1502 | - $list_title = $add_string_in_title . __(ucfirst($post_type_info->labels->name), 'geodirectory'); |
|
| 1503 | - $single_name = $post_type_info->labels->singular_name; |
|
| 1502 | + $list_title = $add_string_in_title . __(ucfirst($post_type_info->labels->name), 'geodirectory'); |
|
| 1503 | + $single_name = $post_type_info->labels->singular_name; |
|
| 1504 | 1504 | |
| 1505 | - $taxonomy = geodir_get_taxonomies($gd_post_type, true); |
|
| 1505 | + $taxonomy = geodir_get_taxonomies($gd_post_type, true); |
|
| 1506 | 1506 | |
| 1507 | - $gd_country = get_query_var('gd_country');
|
|
| 1508 | - $gd_region = get_query_var('gd_region');
|
|
| 1509 | - $gd_city = get_query_var('gd_city');
|
|
| 1507 | + $gd_country = get_query_var('gd_country');
|
|
| 1508 | + $gd_region = get_query_var('gd_region');
|
|
| 1509 | + $gd_city = get_query_var('gd_city');
|
|
| 1510 | 1510 | |
| 1511 | - if (!empty($term)) {
|
|
| 1512 | - $location_name = ''; |
|
| 1513 | - if ($gd_country != '' || $gd_region != '' || $gd_city != '') {
|
|
| 1514 | - if ($gd_country != '') {
|
|
| 1515 | - $location_name = geodir_sanitize_location_name('gd_country', $gd_country);
|
|
| 1516 | - } |
|
| 1517 | - |
|
| 1518 | - if ($gd_region != '') {
|
|
| 1519 | - $location_name = geodir_sanitize_location_name('gd_region', $gd_region);
|
|
| 1520 | - } |
|
| 1521 | - |
|
| 1522 | - if ($gd_city != '') {
|
|
| 1523 | - $location_name = geodir_sanitize_location_name('gd_city', $gd_city);
|
|
| 1524 | - } |
|
| 1525 | - } |
|
| 1526 | - |
|
| 1527 | - $current_term = get_term_by('slug', $term, $taxonomy[0]);
|
|
| 1528 | - if (!empty($current_term)) {
|
|
| 1529 | - $current_term_name = __(ucfirst($current_term->name), 'geodirectory'); |
|
| 1530 | - if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
|
|
| 1531 | - $location_last_char = substr($location_name, -1); |
|
| 1532 | - $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
|
|
| 1533 | - $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
|
|
| 1534 | - } else {
|
|
| 1535 | - $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
|
|
| 1536 | - } |
|
| 1537 | - } else {
|
|
| 1538 | - if (count($taxonomy) > 1) {
|
|
| 1539 | - $current_term = get_term_by('slug', $term, $taxonomy[1]);
|
|
| 1540 | - |
|
| 1541 | - if (!empty($current_term)) {
|
|
| 1542 | - $current_term_name = __(ucfirst($current_term->name), 'geodirectory'); |
|
| 1543 | - if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
|
|
| 1544 | - $location_last_char = substr($location_name, -1); |
|
| 1545 | - $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
|
|
| 1546 | - $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
|
|
| 1547 | - } else {
|
|
| 1548 | - $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
|
|
| 1549 | - } |
|
| 1550 | - } |
|
| 1551 | - } |
|
| 1552 | - } |
|
| 1553 | - |
|
| 1554 | - } else {
|
|
| 1555 | - $gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : ''; |
|
| 1556 | - $gd_region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : ''; |
|
| 1557 | - $gd_city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : ''; |
|
| 1558 | - |
|
| 1559 | - $gd_country_actual = $gd_region_actual = $gd_city_actual = ''; |
|
| 1560 | - |
|
| 1561 | - if (function_exists('get_actual_location_name')) {
|
|
| 1562 | - $gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
|
|
| 1563 | - $gd_region_actual = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
|
|
| 1564 | - $gd_city_actual = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
|
|
| 1565 | - } |
|
| 1566 | - |
|
| 1567 | - if ($gd_city != '') {
|
|
| 1568 | - if ($gd_city_actual != '') {
|
|
| 1569 | - $gd_city = $gd_city_actual; |
|
| 1570 | - } else {
|
|
| 1571 | - $gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
|
|
| 1572 | - $gd_city = preg_replace('/[_-]/', ' ', $gd_city);
|
|
| 1573 | - $gd_city = __(geodir_ucwords($gd_city), 'geodirectory'); |
|
| 1574 | - } |
|
| 1575 | - |
|
| 1576 | - $list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'";
|
|
| 1577 | - } else if ($gd_region != '') {
|
|
| 1578 | - if ($gd_region_actual != '') {
|
|
| 1579 | - $gd_region = $gd_region_actual; |
|
| 1580 | - } else {
|
|
| 1581 | - $gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
|
|
| 1582 | - $gd_region = preg_replace('/[_-]/', ' ', $gd_region);
|
|
| 1583 | - $gd_region = __(geodir_ucwords($gd_region), 'geodirectory'); |
|
| 1584 | - } |
|
| 1585 | - |
|
| 1586 | - $list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'";
|
|
| 1587 | - } else if ($gd_country != '') {
|
|
| 1588 | - if ($gd_country_actual != '') {
|
|
| 1589 | - $gd_country = $gd_country_actual; |
|
| 1590 | - } else {
|
|
| 1591 | - $gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
|
|
| 1592 | - $gd_country = preg_replace('/[_-]/', ' ', $gd_country);
|
|
| 1593 | - $gd_country = __(geodir_ucwords($gd_country), 'geodirectory'); |
|
| 1594 | - } |
|
| 1595 | - |
|
| 1596 | - $list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'";
|
|
| 1597 | - } |
|
| 1598 | - } |
|
| 1599 | - |
|
| 1600 | - if (is_search()) {
|
|
| 1601 | - $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
|
|
| 1602 | - } |
|
| 1603 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 1604 | - $class = apply_filters('geodir_page_title_class', 'entry-title fn');
|
|
| 1605 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 1606 | - $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
|
|
| 1607 | - |
|
| 1608 | - |
|
| 1609 | - $title = $list_title; |
|
| 1610 | - if(geodir_is_page('pt')){
|
|
| 1611 | - $gd_page = 'pt'; |
|
| 1612 | - $title = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
|
|
| 1613 | - } |
|
| 1614 | - elseif(geodir_is_page('listing')){
|
|
| 1615 | - $gd_page = 'listing'; |
|
| 1616 | - global $wp_query; |
|
| 1617 | - $current_term = $wp_query->get_queried_object(); |
|
| 1618 | - if (strpos($current_term->taxonomy,'_tags') !== false) {
|
|
| 1619 | - $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
|
|
| 1620 | - }else{
|
|
| 1621 | - $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
|
|
| 1622 | - } |
|
| 1511 | + if (!empty($term)) {
|
|
| 1512 | + $location_name = ''; |
|
| 1513 | + if ($gd_country != '' || $gd_region != '' || $gd_city != '') {
|
|
| 1514 | + if ($gd_country != '') {
|
|
| 1515 | + $location_name = geodir_sanitize_location_name('gd_country', $gd_country);
|
|
| 1516 | + } |
|
| 1623 | 1517 | |
| 1624 | - } |
|
| 1625 | - elseif(geodir_is_page('author')){
|
|
| 1626 | - $gd_page = 'author'; |
|
| 1627 | - if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
|
|
| 1628 | - $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
|
|
| 1629 | - }else{
|
|
| 1630 | - $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
|
|
| 1631 | - } |
|
| 1518 | + if ($gd_region != '') {
|
|
| 1519 | + $location_name = geodir_sanitize_location_name('gd_region', $gd_region);
|
|
| 1520 | + } |
|
| 1632 | 1521 | |
| 1633 | - } |
|
| 1522 | + if ($gd_city != '') {
|
|
| 1523 | + $location_name = geodir_sanitize_location_name('gd_city', $gd_city);
|
|
| 1524 | + } |
|
| 1525 | + } |
|
| 1526 | + |
|
| 1527 | + $current_term = get_term_by('slug', $term, $taxonomy[0]);
|
|
| 1528 | + if (!empty($current_term)) {
|
|
| 1529 | + $current_term_name = __(ucfirst($current_term->name), 'geodirectory'); |
|
| 1530 | + if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
|
|
| 1531 | + $location_last_char = substr($location_name, -1); |
|
| 1532 | + $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
|
|
| 1533 | + $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
|
|
| 1534 | + } else {
|
|
| 1535 | + $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
|
|
| 1536 | + } |
|
| 1537 | + } else {
|
|
| 1538 | + if (count($taxonomy) > 1) {
|
|
| 1539 | + $current_term = get_term_by('slug', $term, $taxonomy[1]);
|
|
| 1540 | + |
|
| 1541 | + if (!empty($current_term)) {
|
|
| 1542 | + $current_term_name = __(ucfirst($current_term->name), 'geodirectory'); |
|
| 1543 | + if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
|
|
| 1544 | + $location_last_char = substr($location_name, -1); |
|
| 1545 | + $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
|
|
| 1546 | + $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
|
|
| 1547 | + } else {
|
|
| 1548 | + $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
|
|
| 1549 | + } |
|
| 1550 | + } |
|
| 1551 | + } |
|
| 1552 | + } |
|
| 1553 | + |
|
| 1554 | + } else {
|
|
| 1555 | + $gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : ''; |
|
| 1556 | + $gd_region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : ''; |
|
| 1557 | + $gd_city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : ''; |
|
| 1558 | + |
|
| 1559 | + $gd_country_actual = $gd_region_actual = $gd_city_actual = ''; |
|
| 1560 | + |
|
| 1561 | + if (function_exists('get_actual_location_name')) {
|
|
| 1562 | + $gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
|
|
| 1563 | + $gd_region_actual = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
|
|
| 1564 | + $gd_city_actual = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
|
|
| 1565 | + } |
|
| 1566 | + |
|
| 1567 | + if ($gd_city != '') {
|
|
| 1568 | + if ($gd_city_actual != '') {
|
|
| 1569 | + $gd_city = $gd_city_actual; |
|
| 1570 | + } else {
|
|
| 1571 | + $gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
|
|
| 1572 | + $gd_city = preg_replace('/[_-]/', ' ', $gd_city);
|
|
| 1573 | + $gd_city = __(geodir_ucwords($gd_city), 'geodirectory'); |
|
| 1574 | + } |
|
| 1634 | 1575 | |
| 1576 | + $list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'";
|
|
| 1577 | + } else if ($gd_region != '') {
|
|
| 1578 | + if ($gd_region_actual != '') {
|
|
| 1579 | + $gd_region = $gd_region_actual; |
|
| 1580 | + } else {
|
|
| 1581 | + $gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
|
|
| 1582 | + $gd_region = preg_replace('/[_-]/', ' ', $gd_region);
|
|
| 1583 | + $gd_region = __(geodir_ucwords($gd_region), 'geodirectory'); |
|
| 1584 | + } |
|
| 1635 | 1585 | |
| 1636 | - /** |
|
| 1637 | - * Filter page title to replace variables. |
|
| 1638 | - * |
|
| 1639 | - * @since 1.5.4 |
|
| 1640 | - * @param string $title The page title including variables. |
|
| 1641 | - * @param string $gd_page The GeoDirectory page type if any. |
|
| 1642 | - */ |
|
| 1643 | - $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 1586 | + $list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'";
|
|
| 1587 | + } else if ($gd_country != '') {
|
|
| 1588 | + if ($gd_country_actual != '') {
|
|
| 1589 | + $gd_country = $gd_country_actual; |
|
| 1590 | + } else {
|
|
| 1591 | + $gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
|
|
| 1592 | + $gd_country = preg_replace('/[_-]/', ' ', $gd_country);
|
|
| 1593 | + $gd_country = __(geodir_ucwords($gd_country), 'geodirectory'); |
|
| 1594 | + } |
|
| 1644 | 1595 | |
| 1645 | - echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
|
| 1646 | - /** |
|
| 1647 | - * Filter the listing page title. |
|
| 1648 | - * |
|
| 1649 | - * @since 1.0.0 |
|
| 1650 | - * @param string $list_title The title for the category page. |
|
| 1651 | - */ |
|
| 1652 | - apply_filters('geodir_listing_page_title', $title) . '</h1></header>';
|
|
| 1596 | + $list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'";
|
|
| 1597 | + } |
|
| 1598 | + } |
|
| 1599 | + |
|
| 1600 | + if (is_search()) {
|
|
| 1601 | + $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
|
|
| 1602 | + } |
|
| 1603 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 1604 | + $class = apply_filters('geodir_page_title_class', 'entry-title fn');
|
|
| 1605 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 1606 | + $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
|
|
| 1607 | + |
|
| 1608 | + |
|
| 1609 | + $title = $list_title; |
|
| 1610 | + if(geodir_is_page('pt')){
|
|
| 1611 | + $gd_page = 'pt'; |
|
| 1612 | + $title = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
|
|
| 1613 | + } |
|
| 1614 | + elseif(geodir_is_page('listing')){
|
|
| 1615 | + $gd_page = 'listing'; |
|
| 1616 | + global $wp_query; |
|
| 1617 | + $current_term = $wp_query->get_queried_object(); |
|
| 1618 | + if (strpos($current_term->taxonomy,'_tags') !== false) {
|
|
| 1619 | + $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
|
|
| 1620 | + }else{
|
|
| 1621 | + $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
|
|
| 1622 | + } |
|
| 1623 | + |
|
| 1624 | + } |
|
| 1625 | + elseif(geodir_is_page('author')){
|
|
| 1626 | + $gd_page = 'author'; |
|
| 1627 | + if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
|
|
| 1628 | + $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
|
|
| 1629 | + }else{
|
|
| 1630 | + $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
|
|
| 1631 | + } |
|
| 1632 | + |
|
| 1633 | + } |
|
| 1634 | + |
|
| 1635 | + |
|
| 1636 | + /** |
|
| 1637 | + * Filter page title to replace variables. |
|
| 1638 | + * |
|
| 1639 | + * @since 1.5.4 |
|
| 1640 | + * @param string $title The page title including variables. |
|
| 1641 | + * @param string $gd_page The GeoDirectory page type if any. |
|
| 1642 | + */ |
|
| 1643 | + $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 1644 | + |
|
| 1645 | + echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
|
| 1646 | + /** |
|
| 1647 | + * Filter the listing page title. |
|
| 1648 | + * |
|
| 1649 | + * @since 1.0.0 |
|
| 1650 | + * @param string $list_title The title for the category page. |
|
| 1651 | + */ |
|
| 1652 | + apply_filters('geodir_listing_page_title', $title) . '</h1></header>';
|
|
| 1653 | 1653 | } |
| 1654 | 1654 | |
| 1655 | 1655 | add_action('geodir_listings_page_description', 'geodir_action_listings_description', 10);
|
@@ -1662,33 +1662,33 @@ discard block |
||
| 1662 | 1662 | */ |
| 1663 | 1663 | function geodir_action_listings_description() |
| 1664 | 1664 | {
|
| 1665 | - global $wp_query; |
|
| 1666 | - $current_term = $wp_query->get_queried_object(); |
|
| 1667 | - |
|
| 1668 | - $gd_post_type = geodir_get_current_posttype(); |
|
| 1669 | - if (isset($current_term->term_id) && $current_term->term_id != '') {
|
|
| 1670 | - |
|
| 1671 | - $term_desc = term_description($current_term->term_id, $gd_post_type . '_tags'); |
|
| 1672 | - $saved_data = stripslashes(get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type)); |
|
| 1673 | - if ($term_desc && !$saved_data) {
|
|
| 1674 | - $saved_data = $term_desc; |
|
| 1675 | - } |
|
| 1676 | - /** |
|
| 1677 | - * Apply the core filter `the_content` filter to the variable string. |
|
| 1678 | - * |
|
| 1679 | - * This is a WordPress core filter that does many things. |
|
| 1680 | - * |
|
| 1681 | - * @since 1.0.0 |
|
| 1682 | - * @param string $var The string to apply the filter to. |
|
| 1683 | - */ |
|
| 1684 | - $cat_description = apply_filters('the_content', $saved_data);
|
|
| 1685 | - if ($cat_description) {
|
|
| 1686 | - ?> |
|
| 1665 | + global $wp_query; |
|
| 1666 | + $current_term = $wp_query->get_queried_object(); |
|
| 1667 | + |
|
| 1668 | + $gd_post_type = geodir_get_current_posttype(); |
|
| 1669 | + if (isset($current_term->term_id) && $current_term->term_id != '') {
|
|
| 1670 | + |
|
| 1671 | + $term_desc = term_description($current_term->term_id, $gd_post_type . '_tags'); |
|
| 1672 | + $saved_data = stripslashes(get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type)); |
|
| 1673 | + if ($term_desc && !$saved_data) {
|
|
| 1674 | + $saved_data = $term_desc; |
|
| 1675 | + } |
|
| 1676 | + /** |
|
| 1677 | + * Apply the core filter `the_content` filter to the variable string. |
|
| 1678 | + * |
|
| 1679 | + * This is a WordPress core filter that does many things. |
|
| 1680 | + * |
|
| 1681 | + * @since 1.0.0 |
|
| 1682 | + * @param string $var The string to apply the filter to. |
|
| 1683 | + */ |
|
| 1684 | + $cat_description = apply_filters('the_content', $saved_data);
|
|
| 1685 | + if ($cat_description) {
|
|
| 1686 | + ?> |
|
| 1687 | 1687 | |
| 1688 | 1688 | <div class="term_description"><?php echo $cat_description;?></div> <?php |
| 1689 | - } |
|
| 1689 | + } |
|
| 1690 | 1690 | |
| 1691 | - } |
|
| 1691 | + } |
|
| 1692 | 1692 | } |
| 1693 | 1693 | |
| 1694 | 1694 | // action for adding the listings page top widget area |
@@ -1707,11 +1707,11 @@ discard block |
||
| 1707 | 1707 | */ |
| 1708 | 1708 | function geodir_action_geodir_sidebar_listings_top() |
| 1709 | 1709 | {
|
| 1710 | - if (get_option('geodir_show_listing_top_section')) { ?>
|
|
| 1710 | + if (get_option('geodir_show_listing_top_section')) { ?>
|
|
| 1711 | 1711 | <div |
| 1712 | 1712 | class="<?php |
| 1713 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 1714 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_top'); ?>">
|
|
| 1713 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 1714 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_top'); ?>">
|
|
| 1715 | 1715 | <?php dynamic_sidebar('geodir_listing_top'); ?>
|
| 1716 | 1716 | </div><!-- clearfix ends here--> |
| 1717 | 1717 | <?php } |
@@ -1734,35 +1734,35 @@ discard block |
||
| 1734 | 1734 | */ |
| 1735 | 1735 | function geodir_action_sidebar_left_open($type = '', $id = '', $class = '', $itemtype = '') |
| 1736 | 1736 | {
|
| 1737 | - if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
|
|
| 1738 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 1739 | - } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
|
|
| 1740 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 1741 | - } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
|
|
| 1742 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 1743 | - } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
|
|
| 1744 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 1745 | - } else {
|
|
| 1746 | - $width_css = ''; |
|
| 1747 | - } |
|
| 1748 | - |
|
| 1749 | - $tc = get_option('theme_compatibility_setting');
|
|
| 1750 | - if (!empty($tc['geodir_sidebar_left_open_replace'])) {
|
|
| 1751 | - $text = $tc['geodir_sidebar_left_open_replace']; |
|
| 1752 | - } else {
|
|
| 1753 | - $text = '<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>'; |
|
| 1754 | - } |
|
| 1755 | - |
|
| 1756 | - if (!empty($tc['geodir_sidebar_left_open_id'])) {
|
|
| 1757 | - $id = $tc['geodir_sidebar_left_open_id']; |
|
| 1758 | - } |
|
| 1759 | - if (!empty($tc['geodir_sidebar_left_open_class'])) {
|
|
| 1760 | - $class = $tc['geodir_sidebar_left_open_class']; |
|
| 1761 | - } |
|
| 1762 | - |
|
| 1763 | - $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
|
|
| 1764 | - |
|
| 1765 | - echo $text; |
|
| 1737 | + if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
|
|
| 1738 | + $width_css = 'style="width:' . $width . '%;"'; |
|
| 1739 | + } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
|
|
| 1740 | + $width_css = 'style="width:' . $width . '%;"'; |
|
| 1741 | + } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
|
|
| 1742 | + $width_css = 'style="width:' . $width . '%;"'; |
|
| 1743 | + } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
|
|
| 1744 | + $width_css = 'style="width:' . $width . '%;"'; |
|
| 1745 | + } else {
|
|
| 1746 | + $width_css = ''; |
|
| 1747 | + } |
|
| 1748 | + |
|
| 1749 | + $tc = get_option('theme_compatibility_setting');
|
|
| 1750 | + if (!empty($tc['geodir_sidebar_left_open_replace'])) {
|
|
| 1751 | + $text = $tc['geodir_sidebar_left_open_replace']; |
|
| 1752 | + } else {
|
|
| 1753 | + $text = '<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>'; |
|
| 1754 | + } |
|
| 1755 | + |
|
| 1756 | + if (!empty($tc['geodir_sidebar_left_open_id'])) {
|
|
| 1757 | + $id = $tc['geodir_sidebar_left_open_id']; |
|
| 1758 | + } |
|
| 1759 | + if (!empty($tc['geodir_sidebar_left_open_class'])) {
|
|
| 1760 | + $class = $tc['geodir_sidebar_left_open_class']; |
|
| 1761 | + } |
|
| 1762 | + |
|
| 1763 | + $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
|
|
| 1764 | + |
|
| 1765 | + echo $text; |
|
| 1766 | 1766 | } |
| 1767 | 1767 | |
| 1768 | 1768 | // action for adding the primary div closing tag |
@@ -1778,13 +1778,13 @@ discard block |
||
| 1778 | 1778 | */ |
| 1779 | 1779 | function geodir_action_sidebar_left_close($type = '') |
| 1780 | 1780 | {
|
| 1781 | - $tc = get_option('theme_compatibility_setting');
|
|
| 1782 | - if (!empty($tc['geodir_sidebar_left_close_replace'])) {
|
|
| 1783 | - $text = $tc['geodir_sidebar_left_close_replace']; |
|
| 1784 | - } else {
|
|
| 1785 | - $text = '</aside><!-- sidebar ends here-->'; |
|
| 1786 | - } |
|
| 1787 | - echo $text; |
|
| 1781 | + $tc = get_option('theme_compatibility_setting');
|
|
| 1782 | + if (!empty($tc['geodir_sidebar_left_close_replace'])) {
|
|
| 1783 | + $text = $tc['geodir_sidebar_left_close_replace']; |
|
| 1784 | + } else {
|
|
| 1785 | + $text = '</aside><!-- sidebar ends here-->'; |
|
| 1786 | + } |
|
| 1787 | + echo $text; |
|
| 1788 | 1788 | } |
| 1789 | 1789 | |
| 1790 | 1790 | /** |
@@ -1797,7 +1797,7 @@ discard block |
||
| 1797 | 1797 | */ |
| 1798 | 1798 | function geodir_listing_left_section() |
| 1799 | 1799 | {
|
| 1800 | - if (get_option('geodir_show_listing_left_section')) { ?>
|
|
| 1800 | + if (get_option('geodir_show_listing_left_section')) { ?>
|
|
| 1801 | 1801 | <div class="geodir-content-left geodir-sidebar-wrap"> |
| 1802 | 1802 | <?php dynamic_sidebar('geodir_listing_left_sidebar'); ?>
|
| 1803 | 1803 | </div><!-- end geodir-content-left --> |
@@ -1815,20 +1815,20 @@ discard block |
||
| 1815 | 1815 | */ |
| 1816 | 1816 | function geodir_action_listings_sidebar_left() |
| 1817 | 1817 | {
|
| 1818 | - if (get_option('geodir_show_listing_left_section')) {
|
|
| 1819 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 1820 | - do_action('geodir_sidebar_left_open', 'listings-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
|
|
| 1821 | - /** |
|
| 1822 | - * Calls the listings page (category) left sidebar content. |
|
| 1823 | - * |
|
| 1824 | - * All the content for the listings page left sidebar is added via this hook. |
|
| 1825 | - * |
|
| 1826 | - * @since 1.0.0 |
|
| 1827 | - */ |
|
| 1828 | - do_action('geodir_listings_sidebar_left_inside');
|
|
| 1829 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 1830 | - do_action('geodir_sidebar_left_close', 'listings-page');
|
|
| 1831 | - } |
|
| 1818 | + if (get_option('geodir_show_listing_left_section')) {
|
|
| 1819 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 1820 | + do_action('geodir_sidebar_left_open', 'listings-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
|
|
| 1821 | + /** |
|
| 1822 | + * Calls the listings page (category) left sidebar content. |
|
| 1823 | + * |
|
| 1824 | + * All the content for the listings page left sidebar is added via this hook. |
|
| 1825 | + * |
|
| 1826 | + * @since 1.0.0 |
|
| 1827 | + */ |
|
| 1828 | + do_action('geodir_listings_sidebar_left_inside');
|
|
| 1829 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 1830 | + do_action('geodir_sidebar_left_close', 'listings-page');
|
|
| 1831 | + } |
|
| 1832 | 1832 | } |
| 1833 | 1833 | |
| 1834 | 1834 | /** |
@@ -1841,7 +1841,7 @@ discard block |
||
| 1841 | 1841 | */ |
| 1842 | 1842 | function geodir_listing_right_section() |
| 1843 | 1843 | {
|
| 1844 | - if (get_option('geodir_show_listing_right_section')) { ?>
|
|
| 1844 | + if (get_option('geodir_show_listing_right_section')) { ?>
|
|
| 1845 | 1845 | <div class="geodir-content-right geodir-sidebar-wrap"> |
| 1846 | 1846 | <?php dynamic_sidebar('geodir_listing_right_sidebar'); ?>
|
| 1847 | 1847 | </div><!-- end geodir-content-right --> |
@@ -1859,20 +1859,20 @@ discard block |
||
| 1859 | 1859 | */ |
| 1860 | 1860 | function geodir_action_listings_sidebar_right() |
| 1861 | 1861 | {
|
| 1862 | - if (get_option('geodir_show_listing_right_section')) {
|
|
| 1863 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 1864 | - do_action('geodir_sidebar_right_open', 'listings-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
|
|
| 1865 | - /** |
|
| 1866 | - * Calls the listings page (category) right sidebar content. |
|
| 1867 | - * |
|
| 1868 | - * All the content for the listings page right sidebar is added via this hook. |
|
| 1869 | - * |
|
| 1870 | - * @since 1.0.0 |
|
| 1871 | - */ |
|
| 1872 | - do_action('geodir_listings_sidebar_right_inside');
|
|
| 1873 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 1874 | - do_action('geodir_sidebar_right_close', 'listings-page');
|
|
| 1875 | - } |
|
| 1862 | + if (get_option('geodir_show_listing_right_section')) {
|
|
| 1863 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 1864 | + do_action('geodir_sidebar_right_open', 'listings-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
|
|
| 1865 | + /** |
|
| 1866 | + * Calls the listings page (category) right sidebar content. |
|
| 1867 | + * |
|
| 1868 | + * All the content for the listings page right sidebar is added via this hook. |
|
| 1869 | + * |
|
| 1870 | + * @since 1.0.0 |
|
| 1871 | + */ |
|
| 1872 | + do_action('geodir_listings_sidebar_right_inside');
|
|
| 1873 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 1874 | + do_action('geodir_sidebar_right_close', 'listings-page');
|
|
| 1875 | + } |
|
| 1876 | 1876 | } |
| 1877 | 1877 | |
| 1878 | 1878 | |
@@ -1889,23 +1889,23 @@ discard block |
||
| 1889 | 1889 | */ |
| 1890 | 1890 | function geodir_action_main_content_open($type = '', $id = '', $class = '') |
| 1891 | 1891 | {
|
| 1892 | - $tc = get_option('theme_compatibility_setting');
|
|
| 1893 | - if (!empty($tc['geodir_main_content_open_replace'])) {
|
|
| 1894 | - $text = $tc['geodir_main_content_open_replace']; |
|
| 1895 | - } else {
|
|
| 1896 | - $text = '<main id="[id]" class="[class]" role="main">'; |
|
| 1897 | - } |
|
| 1892 | + $tc = get_option('theme_compatibility_setting');
|
|
| 1893 | + if (!empty($tc['geodir_main_content_open_replace'])) {
|
|
| 1894 | + $text = $tc['geodir_main_content_open_replace']; |
|
| 1895 | + } else {
|
|
| 1896 | + $text = '<main id="[id]" class="[class]" role="main">'; |
|
| 1897 | + } |
|
| 1898 | 1898 | |
| 1899 | - if (!empty($tc['geodir_main_content_open_id'])) {
|
|
| 1900 | - $id = $tc['geodir_main_content_open_id']; |
|
| 1901 | - } |
|
| 1902 | - if (!empty($tc['geodir_main_content_open_class'])) {
|
|
| 1903 | - $class = $tc['geodir_main_content_open_class']; |
|
| 1904 | - } |
|
| 1899 | + if (!empty($tc['geodir_main_content_open_id'])) {
|
|
| 1900 | + $id = $tc['geodir_main_content_open_id']; |
|
| 1901 | + } |
|
| 1902 | + if (!empty($tc['geodir_main_content_open_class'])) {
|
|
| 1903 | + $class = $tc['geodir_main_content_open_class']; |
|
| 1904 | + } |
|
| 1905 | 1905 | |
| 1906 | - $text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
|
|
| 1906 | + $text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
|
|
| 1907 | 1907 | |
| 1908 | - echo $text; |
|
| 1908 | + echo $text; |
|
| 1909 | 1909 | } |
| 1910 | 1910 | |
| 1911 | 1911 | // action for adding the primary div closing tag |
@@ -1918,13 +1918,13 @@ discard block |
||
| 1918 | 1918 | */ |
| 1919 | 1919 | function geodir_action_main_content_close() |
| 1920 | 1920 | {
|
| 1921 | - $tc = get_option('theme_compatibility_setting');
|
|
| 1922 | - if (!empty($tc['geodir_main_content_close_replace'])) {
|
|
| 1923 | - $text = $tc['geodir_main_content_close_replace']; |
|
| 1924 | - } else {
|
|
| 1925 | - $text = '</main><!-- main ends here-->'; |
|
| 1926 | - } |
|
| 1927 | - echo $text; |
|
| 1921 | + $tc = get_option('theme_compatibility_setting');
|
|
| 1922 | + if (!empty($tc['geodir_main_content_close_replace'])) {
|
|
| 1923 | + $text = $tc['geodir_main_content_close_replace']; |
|
| 1924 | + } else {
|
|
| 1925 | + $text = '</main><!-- main ends here-->'; |
|
| 1926 | + } |
|
| 1927 | + echo $text; |
|
| 1928 | 1928 | } |
| 1929 | 1929 | |
| 1930 | 1930 | /** |
@@ -1936,14 +1936,14 @@ discard block |
||
| 1936 | 1936 | */ |
| 1937 | 1937 | function geodir_action_listings_content_inside() |
| 1938 | 1938 | {
|
| 1939 | - global $gridview_columns; |
|
| 1940 | - $listing_view = get_option('geodir_listing_view');
|
|
| 1941 | - if (strstr($listing_view, 'gridview')) {
|
|
| 1942 | - $gridview_columns = $listing_view; |
|
| 1943 | - $listing_view_exp = explode('_', $listing_view);
|
|
| 1944 | - $listing_view = $listing_view_exp[0]; |
|
| 1945 | - } |
|
| 1946 | - geodir_get_template_part('listing', 'listview');
|
|
| 1939 | + global $gridview_columns; |
|
| 1940 | + $listing_view = get_option('geodir_listing_view');
|
|
| 1941 | + if (strstr($listing_view, 'gridview')) {
|
|
| 1942 | + $gridview_columns = $listing_view; |
|
| 1943 | + $listing_view_exp = explode('_', $listing_view);
|
|
| 1944 | + $listing_view = $listing_view_exp[0]; |
|
| 1945 | + } |
|
| 1946 | + geodir_get_template_part('listing', 'listview');
|
|
| 1947 | 1947 | } |
| 1948 | 1948 | |
| 1949 | 1949 | add_action('geodir_listings_content_inside', 'geodir_action_listings_content_inside', 10);
|
@@ -1959,47 +1959,47 @@ discard block |
||
| 1959 | 1959 | */ |
| 1960 | 1960 | function geodir_action_listings_content() |
| 1961 | 1961 | {
|
| 1962 | - /** |
|
| 1963 | - * This is used to add HTML opening wrappers to the main content of most pages including listings, author, search, home etc. |
|
| 1964 | - * |
|
| 1965 | - * @since 1.0.0 |
|
| 1966 | - * @param string $type The page type. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
| 1967 | - * @param string $id The id for the div. Usually 'geodir-main-content'. |
|
| 1968 | - * @param string $class The class for the div. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
| 1969 | - * @see 'geodir_main_content_close' Where the oposing closing tag is added. |
|
| 1970 | - */ |
|
| 1971 | - do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page');
|
|
| 1972 | - $extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page');
|
|
| 1973 | - echo '<div class="clearfix '.$extra_class.'">'; |
|
| 1974 | - /** |
|
| 1975 | - * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages. |
|
| 1976 | - * |
|
| 1977 | - * @since 1.0.0 |
|
| 1978 | - */ |
|
| 1979 | - do_action('geodir_before_listing');
|
|
| 1980 | - echo '</div>'; |
|
| 1981 | - |
|
| 1982 | - /** |
|
| 1983 | - * This actions calls the listings list content. Used on listings pages and search and author pages. |
|
| 1984 | - * |
|
| 1985 | - * @since 1.0.0 |
|
| 1986 | - */ |
|
| 1987 | - do_action('geodir_listings_content_inside');
|
|
| 1988 | - |
|
| 1989 | - /** |
|
| 1990 | - * Called after the listings content, inside the outer wrapper HTML. Used on listings pages and search and author pages. |
|
| 1991 | - * |
|
| 1992 | - * @since 1.0.0 |
|
| 1993 | - */ |
|
| 1994 | - do_action('geodir_after_listing');
|
|
| 1995 | - |
|
| 1996 | - /** |
|
| 1997 | - * This is used to add HTML closing wrappers to the main content of most pages including listings, author, search, home etc. |
|
| 1998 | - * |
|
| 1999 | - * @since 1.0.0 |
|
| 2000 | - * @see 'geodir_main_content_open' Where the oposing opening tag is added. |
|
| 2001 | - */ |
|
| 2002 | - do_action('geodir_main_content_close', 'listings-page');
|
|
| 1962 | + /** |
|
| 1963 | + * This is used to add HTML opening wrappers to the main content of most pages including listings, author, search, home etc. |
|
| 1964 | + * |
|
| 1965 | + * @since 1.0.0 |
|
| 1966 | + * @param string $type The page type. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
| 1967 | + * @param string $id The id for the div. Usually 'geodir-main-content'. |
|
| 1968 | + * @param string $class The class for the div. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
| 1969 | + * @see 'geodir_main_content_close' Where the oposing closing tag is added. |
|
| 1970 | + */ |
|
| 1971 | + do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page');
|
|
| 1972 | + $extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page');
|
|
| 1973 | + echo '<div class="clearfix '.$extra_class.'">'; |
|
| 1974 | + /** |
|
| 1975 | + * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages. |
|
| 1976 | + * |
|
| 1977 | + * @since 1.0.0 |
|
| 1978 | + */ |
|
| 1979 | + do_action('geodir_before_listing');
|
|
| 1980 | + echo '</div>'; |
|
| 1981 | + |
|
| 1982 | + /** |
|
| 1983 | + * This actions calls the listings list content. Used on listings pages and search and author pages. |
|
| 1984 | + * |
|
| 1985 | + * @since 1.0.0 |
|
| 1986 | + */ |
|
| 1987 | + do_action('geodir_listings_content_inside');
|
|
| 1988 | + |
|
| 1989 | + /** |
|
| 1990 | + * Called after the listings content, inside the outer wrapper HTML. Used on listings pages and search and author pages. |
|
| 1991 | + * |
|
| 1992 | + * @since 1.0.0 |
|
| 1993 | + */ |
|
| 1994 | + do_action('geodir_after_listing');
|
|
| 1995 | + |
|
| 1996 | + /** |
|
| 1997 | + * This is used to add HTML closing wrappers to the main content of most pages including listings, author, search, home etc. |
|
| 1998 | + * |
|
| 1999 | + * @since 1.0.0 |
|
| 2000 | + * @see 'geodir_main_content_open' Where the oposing opening tag is added. |
|
| 2001 | + */ |
|
| 2002 | + do_action('geodir_main_content_close', 'listings-page');
|
|
| 2003 | 2003 | } |
| 2004 | 2004 | |
| 2005 | 2005 | |
@@ -2014,10 +2014,10 @@ discard block |
||
| 2014 | 2014 | */ |
| 2015 | 2015 | function geodir_action_sidebar_listings_bottom_section() |
| 2016 | 2016 | {
|
| 2017 | - if (get_option('geodir_show_listing_bottom_section')) { ?>
|
|
| 2017 | + if (get_option('geodir_show_listing_bottom_section')) { ?>
|
|
| 2018 | 2018 | <div class="<?php |
| 2019 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2020 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_bottom'); ?>">
|
|
| 2019 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2020 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_bottom'); ?>">
|
|
| 2021 | 2021 | <?php dynamic_sidebar('geodir_listing_bottom'); ?>
|
| 2022 | 2022 | </div><!-- clearfix ends here--> |
| 2023 | 2023 | <?php } |
@@ -2037,38 +2037,38 @@ discard block |
||
| 2037 | 2037 | */ |
| 2038 | 2038 | function geodir_action_add_listing_page_title() |
| 2039 | 2039 | {
|
| 2040 | - if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '') |
|
| 2041 | - $listing_type = sanitize_text_field($_REQUEST['listing_type']); |
|
| 2042 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2043 | - $class = apply_filters('geodir_page_title_class', 'entry-title fn');
|
|
| 2044 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2045 | - $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
|
|
| 2046 | - |
|
| 2047 | - $title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
|
|
| 2048 | - |
|
| 2049 | - if(geodir_is_page('add-listing')){
|
|
| 2050 | - $gd_page = 'add-listing'; |
|
| 2051 | - if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
|
|
| 2052 | - $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
|
|
| 2053 | - }elseif(isset($listing_type)){
|
|
| 2054 | - $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
|
|
| 2055 | - } |
|
| 2040 | + if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '') |
|
| 2041 | + $listing_type = sanitize_text_field($_REQUEST['listing_type']); |
|
| 2042 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2043 | + $class = apply_filters('geodir_page_title_class', 'entry-title fn');
|
|
| 2044 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2045 | + $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
|
|
| 2046 | + |
|
| 2047 | + $title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
|
|
| 2048 | + |
|
| 2049 | + if(geodir_is_page('add-listing')){
|
|
| 2050 | + $gd_page = 'add-listing'; |
|
| 2051 | + if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
|
|
| 2052 | + $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
|
|
| 2053 | + }elseif(isset($listing_type)){
|
|
| 2054 | + $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
|
|
| 2055 | + } |
|
| 2056 | 2056 | |
| 2057 | - } |
|
| 2057 | + } |
|
| 2058 | 2058 | |
| 2059 | 2059 | |
| 2060 | - /** |
|
| 2061 | - * Filter page title to replace variables. |
|
| 2062 | - * |
|
| 2063 | - * @since 1.5.4 |
|
| 2064 | - * @param string $title The page title including variables. |
|
| 2065 | - * @param string $gd_page The GeoDirectory page type if any. |
|
| 2066 | - */ |
|
| 2067 | - $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 2060 | + /** |
|
| 2061 | + * Filter page title to replace variables. |
|
| 2062 | + * |
|
| 2063 | + * @since 1.5.4 |
|
| 2064 | + * @param string $title The page title including variables. |
|
| 2065 | + * @param string $gd_page The GeoDirectory page type if any. |
|
| 2066 | + */ |
|
| 2067 | + $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 2068 | 2068 | |
| 2069 | - echo '<header class="' . $class_header . '"><h1 class="' . $class . '">'; |
|
| 2070 | - echo $title; |
|
| 2071 | - echo '</h1></header>'; |
|
| 2069 | + echo '<header class="' . $class_header . '"><h1 class="' . $class . '">'; |
|
| 2070 | + echo $title; |
|
| 2071 | + echo '</h1></header>'; |
|
| 2072 | 2072 | } |
| 2073 | 2073 | |
| 2074 | 2074 | add_action('geodir_add_listing_page_mandatory', 'geodir_action_add_listing_page_mandatory', 10);
|
@@ -2099,59 +2099,59 @@ discard block |
||
| 2099 | 2099 | */ |
| 2100 | 2100 | function geodir_action_add_listing_form() |
| 2101 | 2101 | {
|
| 2102 | - global $cat_display, $post_cat, $current_user, $gd_session; |
|
| 2103 | - $page_id = get_the_ID(); |
|
| 2104 | - $post = ''; |
|
| 2105 | - $title = ''; |
|
| 2106 | - $desc = ''; |
|
| 2107 | - $kw_tags = ''; |
|
| 2108 | - $required_msg = ''; |
|
| 2109 | - $submit_button = ''; |
|
| 2110 | - |
|
| 2111 | - $ajax_action = isset($_REQUEST['ajax_action']) ? $_REQUEST['ajax_action'] : 'add'; |
|
| 2112 | - |
|
| 2113 | - $thumb_img_arr = array(); |
|
| 2114 | - $curImages = ''; |
|
| 2115 | - |
|
| 2116 | - if (isset($_REQUEST['backandedit'])) {
|
|
| 2117 | - global $post; |
|
| 2118 | - $post = (object)$gd_session->get('listing');
|
|
| 2119 | - $listing_type = $post->listing_type; |
|
| 2120 | - $title = $post->post_title; |
|
| 2121 | - $desc = $post->post_desc; |
|
| 2122 | - $post_cat = $post->post_category; |
|
| 2123 | - |
|
| 2124 | - $kw_tags = $post->post_tags; |
|
| 2125 | - $curImages = isset($post->post_images) ? $post->post_images : ''; |
|
| 2126 | - } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 2127 | - global $post, $post_images; |
|
| 2128 | - |
|
| 2129 | - $post = geodir_get_post_info($_REQUEST['pid']); |
|
| 2130 | - $thumb_img_arr = geodir_get_images($post->ID); |
|
| 2131 | - if ($thumb_img_arr) {
|
|
| 2132 | - foreach ($thumb_img_arr as $post_img) {
|
|
| 2133 | - $curImages .= $post_img->src . ','; |
|
| 2134 | - } |
|
| 2135 | - } |
|
| 2102 | + global $cat_display, $post_cat, $current_user, $gd_session; |
|
| 2103 | + $page_id = get_the_ID(); |
|
| 2104 | + $post = ''; |
|
| 2105 | + $title = ''; |
|
| 2106 | + $desc = ''; |
|
| 2107 | + $kw_tags = ''; |
|
| 2108 | + $required_msg = ''; |
|
| 2109 | + $submit_button = ''; |
|
| 2110 | + |
|
| 2111 | + $ajax_action = isset($_REQUEST['ajax_action']) ? $_REQUEST['ajax_action'] : 'add'; |
|
| 2112 | + |
|
| 2113 | + $thumb_img_arr = array(); |
|
| 2114 | + $curImages = ''; |
|
| 2115 | + |
|
| 2116 | + if (isset($_REQUEST['backandedit'])) {
|
|
| 2117 | + global $post; |
|
| 2118 | + $post = (object)$gd_session->get('listing');
|
|
| 2119 | + $listing_type = $post->listing_type; |
|
| 2120 | + $title = $post->post_title; |
|
| 2121 | + $desc = $post->post_desc; |
|
| 2122 | + $post_cat = $post->post_category; |
|
| 2123 | + |
|
| 2124 | + $kw_tags = $post->post_tags; |
|
| 2125 | + $curImages = isset($post->post_images) ? $post->post_images : ''; |
|
| 2126 | + } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 2127 | + global $post, $post_images; |
|
| 2128 | + |
|
| 2129 | + $post = geodir_get_post_info($_REQUEST['pid']); |
|
| 2130 | + $thumb_img_arr = geodir_get_images($post->ID); |
|
| 2131 | + if ($thumb_img_arr) {
|
|
| 2132 | + foreach ($thumb_img_arr as $post_img) {
|
|
| 2133 | + $curImages .= $post_img->src . ','; |
|
| 2134 | + } |
|
| 2135 | + } |
|
| 2136 | 2136 | |
| 2137 | - $listing_type = $post->post_type; |
|
| 2138 | - $title = $post->post_title; |
|
| 2139 | - $desc = $post->post_content; |
|
| 2140 | - $kw_tags = $post->post_tags; |
|
| 2141 | - $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
|
|
| 2142 | - } else {
|
|
| 2143 | - $listing_type = sanitize_text_field($_REQUEST['listing_type']); |
|
| 2144 | - } |
|
| 2137 | + $listing_type = $post->post_type; |
|
| 2138 | + $title = $post->post_title; |
|
| 2139 | + $desc = $post->post_content; |
|
| 2140 | + $kw_tags = $post->post_tags; |
|
| 2141 | + $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
|
|
| 2142 | + } else {
|
|
| 2143 | + $listing_type = sanitize_text_field($_REQUEST['listing_type']); |
|
| 2144 | + } |
|
| 2145 | 2145 | |
| 2146 | - if ($current_user->ID != '0') {
|
|
| 2147 | - $user_login = true; |
|
| 2148 | - } |
|
| 2146 | + if ($current_user->ID != '0') {
|
|
| 2147 | + $user_login = true; |
|
| 2148 | + } |
|
| 2149 | 2149 | |
| 2150 | - $post_type_info = geodir_get_posttype_info($listing_type); |
|
| 2150 | + $post_type_info = geodir_get_posttype_info($listing_type); |
|
| 2151 | 2151 | |
| 2152 | - $cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? $post_type_info['labels']['singular_name'] : __('Listing','geodirectory');
|
|
| 2152 | + $cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? $post_type_info['labels']['singular_name'] : __('Listing','geodirectory');
|
|
| 2153 | 2153 | |
| 2154 | - ?> |
|
| 2154 | + ?> |
|
| 2155 | 2155 | <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id());?>" method="post" enctype="multipart/form-data"> |
| 2156 | 2156 | <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type);?>"/> |
| 2157 | 2157 | <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type);?>"/> |
@@ -2162,27 +2162,27 @@ discard block |
||
| 2162 | 2162 | <?php } if (isset($_REQUEST['backandedit'])) { ?>
|
| 2163 | 2163 | <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']);?>"/> |
| 2164 | 2164 | <?php |
| 2165 | - } |
|
| 2166 | - /** |
|
| 2167 | - * Called at the very top of the add listing page form for frontend. |
|
| 2168 | - * |
|
| 2169 | - * This is called just before the "Enter Listing Details" text. |
|
| 2170 | - * |
|
| 2171 | - * @since 1.0.0 |
|
| 2172 | - */ |
|
| 2173 | - do_action('geodir_before_detail_fields');
|
|
| 2174 | - ?> |
|
| 2165 | + } |
|
| 2166 | + /** |
|
| 2167 | + * Called at the very top of the add listing page form for frontend. |
|
| 2168 | + * |
|
| 2169 | + * This is called just before the "Enter Listing Details" text. |
|
| 2170 | + * |
|
| 2171 | + * @since 1.0.0 |
|
| 2172 | + */ |
|
| 2173 | + do_action('geodir_before_detail_fields');
|
|
| 2174 | + ?> |
|
| 2175 | 2175 | <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT;?></h5> |
| 2176 | 2176 | <?php |
| 2177 | - /** |
|
| 2178 | - * Called at the top of the add listing page form for frontend. |
|
| 2179 | - * |
|
| 2180 | - * This is called after the "Enter Listing Details" text. |
|
| 2181 | - * |
|
| 2182 | - * @since 1.0.0 |
|
| 2183 | - */ |
|
| 2184 | - do_action('geodir_before_main_form_fields');
|
|
| 2185 | - ?> |
|
| 2177 | + /** |
|
| 2178 | + * Called at the top of the add listing page form for frontend. |
|
| 2179 | + * |
|
| 2180 | + * This is called after the "Enter Listing Details" text. |
|
| 2181 | + * |
|
| 2182 | + * @since 1.0.0 |
|
| 2183 | + */ |
|
| 2184 | + do_action('geodir_before_main_form_fields');
|
|
| 2185 | + ?> |
|
| 2186 | 2186 | <div id="geodir_post_title_row" class="required_field geodir_form_row clearfix gd-fieldset-details"> |
| 2187 | 2187 | <label><?php echo sprintf( __('%s Title', 'geodirectory'), $cpt_singular_name ); ?><span>*</span> </label>
|
| 2188 | 2188 | <input type="text" field_type="text" name="post_title" id="post_title" class="geodir_textfield" |
@@ -2190,57 +2190,57 @@ discard block |
||
| 2190 | 2190 | <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory');?></span> |
| 2191 | 2191 | </div> |
| 2192 | 2192 | <?php |
| 2193 | - $show_editor = get_option('geodir_tiny_editor_on_add_listing');
|
|
| 2194 | - |
|
| 2195 | - $desc = $show_editor ? stripslashes($desc) : esc_attr(stripslashes($desc)); |
|
| 2196 | - $desc_limit = ''; |
|
| 2197 | - /** |
|
| 2198 | - * Filter the add listing description field character limit number. |
|
| 2199 | - * |
|
| 2200 | - * @since 1.0.0 |
|
| 2201 | - * @param int $desc_limit The amount of characters to limit the description to. |
|
| 2202 | - */ |
|
| 2203 | - $desc_limit = apply_filters('geodir_description_field_desc_limit', $desc_limit);
|
|
| 2204 | - /** |
|
| 2205 | - * Filter the add listing description field text. |
|
| 2206 | - * |
|
| 2207 | - * @since 1.0.0 |
|
| 2208 | - * @param string $desc The text for the description field. |
|
| 2209 | - * @param int $desc_limit The character limit number if any. |
|
| 2210 | - */ |
|
| 2211 | - $desc = apply_filters('geodir_description_field_desc', $desc, $desc_limit);
|
|
| 2212 | - $desc_limit_msg = ''; |
|
| 2213 | - /** |
|
| 2214 | - * Filter the add listing description limit message. |
|
| 2215 | - * |
|
| 2216 | - * This is the message shown if there is a limit applied to the amount of characters the description can use. |
|
| 2217 | - * |
|
| 2218 | - * @since 1.0.0 |
|
| 2219 | - * @param string $desc_limit_msg The limit message string if any. |
|
| 2220 | - * @param int $desc_limit The character limit numer if any. |
|
| 2221 | - */ |
|
| 2222 | - $desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
|
|
| 2193 | + $show_editor = get_option('geodir_tiny_editor_on_add_listing');
|
|
| 2194 | + |
|
| 2195 | + $desc = $show_editor ? stripslashes($desc) : esc_attr(stripslashes($desc)); |
|
| 2196 | + $desc_limit = ''; |
|
| 2197 | + /** |
|
| 2198 | + * Filter the add listing description field character limit number. |
|
| 2199 | + * |
|
| 2200 | + * @since 1.0.0 |
|
| 2201 | + * @param int $desc_limit The amount of characters to limit the description to. |
|
| 2202 | + */ |
|
| 2203 | + $desc_limit = apply_filters('geodir_description_field_desc_limit', $desc_limit);
|
|
| 2204 | + /** |
|
| 2205 | + * Filter the add listing description field text. |
|
| 2206 | + * |
|
| 2207 | + * @since 1.0.0 |
|
| 2208 | + * @param string $desc The text for the description field. |
|
| 2209 | + * @param int $desc_limit The character limit number if any. |
|
| 2210 | + */ |
|
| 2211 | + $desc = apply_filters('geodir_description_field_desc', $desc, $desc_limit);
|
|
| 2212 | + $desc_limit_msg = ''; |
|
| 2213 | + /** |
|
| 2214 | + * Filter the add listing description limit message. |
|
| 2215 | + * |
|
| 2216 | + * This is the message shown if there is a limit applied to the amount of characters the description can use. |
|
| 2217 | + * |
|
| 2218 | + * @since 1.0.0 |
|
| 2219 | + * @param string $desc_limit_msg The limit message string if any. |
|
| 2220 | + * @param int $desc_limit The character limit numer if any. |
|
| 2221 | + */ |
|
| 2222 | + $desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
|
|
| 2223 | 2223 | |
| 2224 | - $desc_class = ''; |
|
| 2225 | - if ($desc_limit === '' || (int)$desc_limit > 0) {
|
|
| 2226 | - /** |
|
| 2227 | - * Called on the add listing page form for frontend just before the description field. |
|
| 2228 | - * |
|
| 2229 | - * @since 1.0.0 |
|
| 2230 | - */ |
|
| 2231 | - do_action('geodir_before_description_field');
|
|
| 2224 | + $desc_class = ''; |
|
| 2225 | + if ($desc_limit === '' || (int)$desc_limit > 0) {
|
|
| 2226 | + /** |
|
| 2227 | + * Called on the add listing page form for frontend just before the description field. |
|
| 2228 | + * |
|
| 2229 | + * @since 1.0.0 |
|
| 2230 | + */ |
|
| 2231 | + do_action('geodir_before_description_field');
|
|
| 2232 | 2232 | |
| 2233 | - $desc_class = ' required_field'; |
|
| 2234 | - } else {
|
|
| 2235 | - $desc_class = ' hidden'; |
|
| 2236 | - } |
|
| 2237 | - ?> |
|
| 2233 | + $desc_class = ' required_field'; |
|
| 2234 | + } else {
|
|
| 2235 | + $desc_class = ' hidden'; |
|
| 2236 | + } |
|
| 2237 | + ?> |
|
| 2238 | 2238 | <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class;?>"> |
| 2239 | 2239 | <label><?php echo sprintf( __('%s Description', 'geodirectory'), $cpt_singular_name ); ?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
|
| 2240 | 2240 | <?php |
| 2241 | - if (!empty($show_editor) && in_array($listing_type, $show_editor)) {
|
|
| 2242 | - $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
|
|
| 2243 | - ?> |
|
| 2241 | + if (!empty($show_editor) && in_array($listing_type, $show_editor)) {
|
|
| 2242 | + $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
|
|
| 2243 | + ?> |
|
| 2244 | 2244 | <div class="editor" field_id="post_desc" field_type="editor"> |
| 2245 | 2245 | <?php wp_editor($desc, "post_desc", $editor_settings); ?> |
| 2246 | 2246 | </div> |
@@ -2254,56 +2254,56 @@ discard block |
||
| 2254 | 2254 | <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory');?></span> |
| 2255 | 2255 | </div> |
| 2256 | 2256 | <?php |
| 2257 | - if ($desc_limit === '' || (int)$desc_limit > 0) {
|
|
| 2258 | - /** |
|
| 2259 | - * Called on the add listing page form for frontend just after the description field. |
|
| 2260 | - * |
|
| 2261 | - * @since 1.0.0 |
|
| 2262 | - */ |
|
| 2263 | - do_action('geodir_after_description_field');
|
|
| 2264 | - } |
|
| 2257 | + if ($desc_limit === '' || (int)$desc_limit > 0) {
|
|
| 2258 | + /** |
|
| 2259 | + * Called on the add listing page form for frontend just after the description field. |
|
| 2260 | + * |
|
| 2261 | + * @since 1.0.0 |
|
| 2262 | + */ |
|
| 2263 | + do_action('geodir_after_description_field');
|
|
| 2264 | + } |
|
| 2265 | 2265 | |
| 2266 | - $kw_tags = esc_attr(stripslashes($kw_tags)); |
|
| 2267 | - $kw_tags_count = TAGKW_TEXT_COUNT; |
|
| 2268 | - $kw_tags_msg = TAGKW_MSG; |
|
| 2269 | - /** |
|
| 2270 | - * Filter the add listing tags character limit. |
|
| 2271 | - * |
|
| 2272 | - * @since 1.0.0 |
|
| 2273 | - * @param int $kw_tags_count The character count limit if any. |
|
| 2274 | - */ |
|
| 2275 | - $kw_tags_count = apply_filters('geodir_listing_tags_field_tags_count', $kw_tags_count);
|
|
| 2276 | - /** |
|
| 2277 | - * Filter the add listing tags field value. |
|
| 2278 | - * |
|
| 2279 | - * You can use the $_REQUEST values to check if this is a go back and edit value etc. |
|
| 2280 | - * |
|
| 2281 | - * @since 1.0.0 |
|
| 2282 | - * @param string $kw_tags The tag field value, usually a comma separated list of tags. |
|
| 2283 | - * @param int $kw_tags_count The character count limit if any. |
|
| 2284 | - */ |
|
| 2285 | - $kw_tags = apply_filters('geodir_listing_tags_field_tags', $kw_tags, $kw_tags_count);
|
|
| 2286 | - /** |
|
| 2287 | - * Filter the add listing tags field message text. |
|
| 2288 | - * |
|
| 2289 | - * @since 1.0.0 |
|
| 2290 | - * @param string $kw_tags_msg The message shown under the field. |
|
| 2291 | - * @param int $kw_tags_count The character count limit if any. |
|
| 2292 | - */ |
|
| 2293 | - $kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
|
|
| 2266 | + $kw_tags = esc_attr(stripslashes($kw_tags)); |
|
| 2267 | + $kw_tags_count = TAGKW_TEXT_COUNT; |
|
| 2268 | + $kw_tags_msg = TAGKW_MSG; |
|
| 2269 | + /** |
|
| 2270 | + * Filter the add listing tags character limit. |
|
| 2271 | + * |
|
| 2272 | + * @since 1.0.0 |
|
| 2273 | + * @param int $kw_tags_count The character count limit if any. |
|
| 2274 | + */ |
|
| 2275 | + $kw_tags_count = apply_filters('geodir_listing_tags_field_tags_count', $kw_tags_count);
|
|
| 2276 | + /** |
|
| 2277 | + * Filter the add listing tags field value. |
|
| 2278 | + * |
|
| 2279 | + * You can use the $_REQUEST values to check if this is a go back and edit value etc. |
|
| 2280 | + * |
|
| 2281 | + * @since 1.0.0 |
|
| 2282 | + * @param string $kw_tags The tag field value, usually a comma separated list of tags. |
|
| 2283 | + * @param int $kw_tags_count The character count limit if any. |
|
| 2284 | + */ |
|
| 2285 | + $kw_tags = apply_filters('geodir_listing_tags_field_tags', $kw_tags, $kw_tags_count);
|
|
| 2286 | + /** |
|
| 2287 | + * Filter the add listing tags field message text. |
|
| 2288 | + * |
|
| 2289 | + * @since 1.0.0 |
|
| 2290 | + * @param string $kw_tags_msg The message shown under the field. |
|
| 2291 | + * @param int $kw_tags_count The character count limit if any. |
|
| 2292 | + */ |
|
| 2293 | + $kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
|
|
| 2294 | 2294 | |
| 2295 | - $tags_class = ''; |
|
| 2296 | - if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
|
|
| 2297 | - /** |
|
| 2298 | - * Called on the add listing page form for frontend just before the tags field. |
|
| 2299 | - * |
|
| 2300 | - * @since 1.0.0 |
|
| 2301 | - */ |
|
| 2302 | - do_action('geodir_before_listing_tags_field');
|
|
| 2303 | - } else {
|
|
| 2304 | - $tags_class = ' hidden'; |
|
| 2305 | - } |
|
| 2306 | - ?> |
|
| 2295 | + $tags_class = ''; |
|
| 2296 | + if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
|
|
| 2297 | + /** |
|
| 2298 | + * Called on the add listing page form for frontend just before the tags field. |
|
| 2299 | + * |
|
| 2300 | + * @since 1.0.0 |
|
| 2301 | + */ |
|
| 2302 | + do_action('geodir_before_listing_tags_field');
|
|
| 2303 | + } else {
|
|
| 2304 | + $tags_class = ' hidden'; |
|
| 2305 | + } |
|
| 2306 | + ?> |
|
| 2307 | 2307 | <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class;?>"> |
| 2308 | 2308 | <label><?php echo TAGKW_TEXT; ?></label> |
| 2309 | 2309 | <input name="post_tags" id="post_tags" value="<?php echo $kw_tags; ?>" type="text" class="geodir_textfield" |
@@ -2311,90 +2311,90 @@ discard block |
||
| 2311 | 2311 | <span class="geodir_message_note"><?php echo $kw_tags_msg;?></span> |
| 2312 | 2312 | </div> |
| 2313 | 2313 | <?php |
| 2314 | - if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
|
|
| 2315 | - /** |
|
| 2316 | - * Called on the add listing page form for frontend just after the tags field. |
|
| 2317 | - * |
|
| 2318 | - * @since 1.0.0 |
|
| 2319 | - */ |
|
| 2320 | - do_action('geodir_after_listing_tags_field');
|
|
| 2321 | - } |
|
| 2314 | + if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
|
|
| 2315 | + /** |
|
| 2316 | + * Called on the add listing page form for frontend just after the tags field. |
|
| 2317 | + * |
|
| 2318 | + * @since 1.0.0 |
|
| 2319 | + */ |
|
| 2320 | + do_action('geodir_after_listing_tags_field');
|
|
| 2321 | + } |
|
| 2322 | 2322 | |
| 2323 | - $package_info = array(); |
|
| 2324 | - $package_info = geodir_post_package_info($package_info, $post); |
|
| 2323 | + $package_info = array(); |
|
| 2324 | + $package_info = geodir_post_package_info($package_info, $post); |
|
| 2325 | 2325 | |
| 2326 | - geodir_get_custom_fields_html($package_info->pid, 'all', $listing_type); |
|
| 2326 | + geodir_get_custom_fields_html($package_info->pid, 'all', $listing_type); |
|
| 2327 | 2327 | |
| 2328 | - // adjust values here |
|
| 2329 | - $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 |
|
| 2330 | - |
|
| 2331 | - $multiple = true; // allow multiple files upload |
|
| 2328 | + // adjust values here |
|
| 2329 | + $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 |
|
| 2332 | 2330 | |
| 2333 | - $width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels) |
|
| 2331 | + $multiple = true; // allow multiple files upload |
|
| 2334 | 2332 | |
| 2335 | - $height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels) |
|
| 2333 | + $width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels) |
|
| 2336 | 2334 | |
| 2337 | - $thumb_img_arr = array(); |
|
| 2338 | - $totImg = 0; |
|
| 2339 | - if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
|
|
| 2340 | - $post = (object)$gd_session->get('listing');
|
|
| 2341 | - if (isset($post->post_images)) |
|
| 2342 | - $curImages = trim($post->post_images, ","); |
|
| 2335 | + $height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels) |
|
| 2343 | 2336 | |
| 2337 | + $thumb_img_arr = array(); |
|
| 2338 | + $totImg = 0; |
|
| 2339 | + if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
|
|
| 2340 | + $post = (object)$gd_session->get('listing');
|
|
| 2341 | + if (isset($post->post_images)) |
|
| 2342 | + $curImages = trim($post->post_images, ","); |
|
| 2344 | 2343 | |
| 2345 | - if ($curImages != '') {
|
|
| 2346 | - $curImages_array = explode(',', $curImages);
|
|
| 2347 | - $totImg = count($curImages_array); |
|
| 2348 | - } |
|
| 2349 | 2344 | |
| 2350 | - $listing_type = $post->listing_type; |
|
| 2345 | + if ($curImages != '') {
|
|
| 2346 | + $curImages_array = explode(',', $curImages);
|
|
| 2347 | + $totImg = count($curImages_array); |
|
| 2348 | + } |
|
| 2351 | 2349 | |
| 2352 | - } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 2353 | - $post = geodir_get_post_info((int)$_REQUEST['pid']); |
|
| 2354 | - $listing_type = $post->post_type; |
|
| 2355 | - $thumb_img_arr = geodir_get_images($_REQUEST['pid']); |
|
| 2350 | + $listing_type = $post->listing_type; |
|
| 2356 | 2351 | |
| 2357 | - } else {
|
|
| 2358 | - $listing_type = sanitize_text_field($_REQUEST['listing_type']); |
|
| 2359 | - } |
|
| 2352 | + } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 2353 | + $post = geodir_get_post_info((int)$_REQUEST['pid']); |
|
| 2354 | + $listing_type = $post->post_type; |
|
| 2355 | + $thumb_img_arr = geodir_get_images($_REQUEST['pid']); |
|
| 2360 | 2356 | |
| 2357 | + } else {
|
|
| 2358 | + $listing_type = sanitize_text_field($_REQUEST['listing_type']); |
|
| 2359 | + } |
|
| 2361 | 2360 | |
| 2362 | - if (!empty($thumb_img_arr)) {
|
|
| 2363 | - foreach ($thumb_img_arr as $img) {
|
|
| 2364 | - //$curImages = $img->src.","; |
|
| 2365 | - } |
|
| 2366 | 2361 | |
| 2367 | - $totImg = count((array)$thumb_img_arr); |
|
| 2368 | - } |
|
| 2362 | + if (!empty($thumb_img_arr)) {
|
|
| 2363 | + foreach ($thumb_img_arr as $img) {
|
|
| 2364 | + //$curImages = $img->src.","; |
|
| 2365 | + } |
|
| 2369 | 2366 | |
| 2370 | - if ($curImages != '') |
|
| 2371 | - $svalue = $curImages; // this will be initial value of the above form field. Image urls. |
|
| 2372 | - else |
|
| 2373 | - $svalue = ''; |
|
| 2374 | - |
|
| 2375 | - $image_limit = $package_info->image_limit; |
|
| 2376 | - $show_image_input_box = ($image_limit != '0'); |
|
| 2377 | - /** |
|
| 2378 | - * Filter to be able to show/hide the image upload section of the add listing form. |
|
| 2379 | - * |
|
| 2380 | - * @since 1.0.0 |
|
| 2381 | - * @param bool $show_image_input_box Set true to show. Set false to not show. |
|
| 2382 | - * @param string $listing_type The custom post type slug. |
|
| 2383 | - */ |
|
| 2384 | - $show_image_input_box = apply_filters('geodir_image_uploader_on_add_listing', $show_image_input_box, $listing_type);
|
|
| 2385 | - if ($show_image_input_box) {
|
|
| 2386 | - ?> |
|
| 2367 | + $totImg = count((array)$thumb_img_arr); |
|
| 2368 | + } |
|
| 2369 | + |
|
| 2370 | + if ($curImages != '') |
|
| 2371 | + $svalue = $curImages; // this will be initial value of the above form field. Image urls. |
|
| 2372 | + else |
|
| 2373 | + $svalue = ''; |
|
| 2374 | + |
|
| 2375 | + $image_limit = $package_info->image_limit; |
|
| 2376 | + $show_image_input_box = ($image_limit != '0'); |
|
| 2377 | + /** |
|
| 2378 | + * Filter to be able to show/hide the image upload section of the add listing form. |
|
| 2379 | + * |
|
| 2380 | + * @since 1.0.0 |
|
| 2381 | + * @param bool $show_image_input_box Set true to show. Set false to not show. |
|
| 2382 | + * @param string $listing_type The custom post type slug. |
|
| 2383 | + */ |
|
| 2384 | + $show_image_input_box = apply_filters('geodir_image_uploader_on_add_listing', $show_image_input_box, $listing_type);
|
|
| 2385 | + if ($show_image_input_box) {
|
|
| 2386 | + ?> |
|
| 2387 | 2387 | |
| 2388 | 2388 | <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT;?> |
| 2389 | 2389 | <?php if ($image_limit == 1) {
|
| 2390 | - echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
|
|
| 2391 | - } ?> |
|
| 2390 | + echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
|
|
| 2391 | + } ?> |
|
| 2392 | 2392 | <?php if ($image_limit > 1) {
|
| 2393 | - echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
|
|
| 2394 | - } ?> |
|
| 2393 | + echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
|
|
| 2394 | + } ?> |
|
| 2395 | 2395 | <?php if ($image_limit == '') {
|
| 2396 | - echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
|
|
| 2397 | - } ?> |
|
| 2396 | + echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
|
|
| 2397 | + } ?> |
|
| 2398 | 2398 | </h5> |
| 2399 | 2399 | |
| 2400 | 2400 | <div class="geodir_form_row clearfix" id="<?php echo $id; ?>dropbox" |
@@ -2432,12 +2432,12 @@ discard block |
||
| 2432 | 2432 | <?php } ?> |
| 2433 | 2433 | |
| 2434 | 2434 | <?php |
| 2435 | - /** |
|
| 2436 | - * Called on the add listing page form for frontend just after the image upload field. |
|
| 2437 | - * |
|
| 2438 | - * @since 1.0.0 |
|
| 2439 | - */ |
|
| 2440 | - do_action('geodir_after_main_form_fields');?>
|
|
| 2435 | + /** |
|
| 2436 | + * Called on the add listing page form for frontend just after the image upload field. |
|
| 2437 | + * |
|
| 2438 | + * @since 1.0.0 |
|
| 2439 | + */ |
|
| 2440 | + do_action('geodir_after_main_form_fields');?>
|
|
| 2441 | 2441 | |
| 2442 | 2442 | |
| 2443 | 2443 | <!-- add captcha code --> |
@@ -2466,7 +2466,7 @@ discard block |
||
| 2466 | 2466 | |
| 2467 | 2467 | </form> |
| 2468 | 2468 | <?php |
| 2469 | - wp_reset_query(); |
|
| 2469 | + wp_reset_query(); |
|
| 2470 | 2470 | } |
| 2471 | 2471 | |
| 2472 | 2472 | /** |
@@ -2477,7 +2477,7 @@ discard block |
||
| 2477 | 2477 | */ |
| 2478 | 2478 | function geodir_add_listing_sidebar_widget_area() |
| 2479 | 2479 | {
|
| 2480 | - dynamic_sidebar('geodir_add_listing_sidebar');
|
|
| 2480 | + dynamic_sidebar('geodir_add_listing_sidebar');
|
|
| 2481 | 2481 | } |
| 2482 | 2482 | |
| 2483 | 2483 | add_action('geodir_add_listing_sidebar_inside', 'geodir_add_listing_sidebar_widget_area', 10);
|
@@ -2492,16 +2492,16 @@ discard block |
||
| 2492 | 2492 | */ |
| 2493 | 2493 | function geodir_action_add_listing_sidebar() |
| 2494 | 2494 | {
|
| 2495 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2496 | - do_action('geodir_sidebar_right_open', 'add-listing-page', 'geodir-sidebar', 'geodir-sidebar-right', 'http://schema.org/WPSideBar');
|
|
| 2497 | - /** |
|
| 2498 | - * This is used to add the content to the add listing page sidebar. |
|
| 2499 | - * |
|
| 2500 | - * @since 1.0.0 |
|
| 2501 | - */ |
|
| 2502 | - do_action('geodir_add_listing_sidebar_inside');
|
|
| 2503 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2504 | - do_action('geodir_sidebar_right_close', 'details-page');
|
|
| 2495 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2496 | + do_action('geodir_sidebar_right_open', 'add-listing-page', 'geodir-sidebar', 'geodir-sidebar-right', 'http://schema.org/WPSideBar');
|
|
| 2497 | + /** |
|
| 2498 | + * This is used to add the content to the add listing page sidebar. |
|
| 2499 | + * |
|
| 2500 | + * @since 1.0.0 |
|
| 2501 | + */ |
|
| 2502 | + do_action('geodir_add_listing_sidebar_inside');
|
|
| 2503 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2504 | + do_action('geodir_sidebar_right_close', 'details-page');
|
|
| 2505 | 2505 | } |
| 2506 | 2506 | |
| 2507 | 2507 | ############################################### |
@@ -2518,11 +2518,11 @@ discard block |
||
| 2518 | 2518 | */ |
| 2519 | 2519 | function geodir_action_geodir_sidebar_signup_top() |
| 2520 | 2520 | {
|
| 2521 | - ?> |
|
| 2521 | + ?> |
|
| 2522 | 2522 | <div |
| 2523 | 2523 | class="<?php |
| 2524 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2525 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
|
|
| 2524 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2525 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
|
|
| 2526 | 2526 | <?php dynamic_sidebar('Reg/Login Top Section');?>
|
| 2527 | 2527 | </div><!-- clearfix ends here--> |
| 2528 | 2528 | <?php |
@@ -2541,9 +2541,9 @@ discard block |
||
| 2541 | 2541 | function geodir_action_signup_forms() |
| 2542 | 2542 | {
|
| 2543 | 2543 | |
| 2544 | - global $user_login; |
|
| 2544 | + global $user_login; |
|
| 2545 | 2545 | |
| 2546 | - ?> |
|
| 2546 | + ?> |
|
| 2547 | 2547 | <script type="text/javascript"> |
| 2548 | 2548 | <?php if ( $user_login ) { ?>
|
| 2549 | 2549 | setTimeout(function () {
|
@@ -2579,65 +2579,65 @@ discard block |
||
| 2579 | 2579 | <?php } ?> |
| 2580 | 2580 | </script><?php |
| 2581 | 2581 | |
| 2582 | - global $errors; |
|
| 2583 | - if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim') |
|
| 2584 | - $errors->add('claim_login', LOGIN_CLAIM);
|
|
| 2585 | - |
|
| 2586 | - if (!empty($errors)) {
|
|
| 2587 | - foreach ($errors as $errorsObj) {
|
|
| 2588 | - foreach ($errorsObj as $key => $val) {
|
|
| 2589 | - for ($i = 0; $i < count($val); $i++) {
|
|
| 2590 | - echo "<div class=sucess_msg>" . $val[$i] . '</div>'; |
|
| 2591 | - $registration_error_msg = 1; |
|
| 2592 | - } |
|
| 2593 | - } |
|
| 2594 | - } |
|
| 2595 | - } |
|
| 2582 | + global $errors; |
|
| 2583 | + if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim') |
|
| 2584 | + $errors->add('claim_login', LOGIN_CLAIM);
|
|
| 2585 | + |
|
| 2586 | + if (!empty($errors)) {
|
|
| 2587 | + foreach ($errors as $errorsObj) {
|
|
| 2588 | + foreach ($errorsObj as $key => $val) {
|
|
| 2589 | + for ($i = 0; $i < count($val); $i++) {
|
|
| 2590 | + echo "<div class=sucess_msg>" . $val[$i] . '</div>'; |
|
| 2591 | + $registration_error_msg = 1; |
|
| 2592 | + } |
|
| 2593 | + } |
|
| 2594 | + } |
|
| 2595 | + } |
|
| 2596 | 2596 | |
| 2597 | - if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_in') {
|
|
| 2598 | - ?> |
|
| 2597 | + if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_in') {
|
|
| 2598 | + ?> |
|
| 2599 | 2599 | |
| 2600 | 2600 | <div class="login_form"> |
| 2601 | 2601 | <?php |
| 2602 | - /** |
|
| 2603 | - * Contains login form template. |
|
| 2604 | - * |
|
| 2605 | - * @since 1.0.0 |
|
| 2606 | - */ |
|
| 2607 | - include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?> |
|
| 2602 | + /** |
|
| 2603 | + * Contains login form template. |
|
| 2604 | + * |
|
| 2605 | + * @since 1.0.0 |
|
| 2606 | + */ |
|
| 2607 | + include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?> |
|
| 2608 | 2608 | </div> |
| 2609 | 2609 | |
| 2610 | 2610 | <?php } elseif (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_up') { ?>
|
| 2611 | 2611 | |
| 2612 | 2612 | <div class="registration_form"> |
| 2613 | 2613 | <?php |
| 2614 | - /** |
|
| 2615 | - * Contains registration form template. |
|
| 2616 | - * |
|
| 2617 | - * @since 1.0.0 |
|
| 2618 | - */ |
|
| 2619 | - include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?> |
|
| 2614 | + /** |
|
| 2615 | + * Contains registration form template. |
|
| 2616 | + * |
|
| 2617 | + * @since 1.0.0 |
|
| 2618 | + */ |
|
| 2619 | + include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?> |
|
| 2620 | 2620 | </div> |
| 2621 | 2621 | |
| 2622 | 2622 | <?php } else { ?>
|
| 2623 | 2623 | |
| 2624 | 2624 | <div class="login_form_l"> |
| 2625 | 2625 | <?php |
| 2626 | - /** |
|
| 2627 | - * Contains login form template. |
|
| 2628 | - * |
|
| 2629 | - * @since 1.0.0 |
|
| 2630 | - */ |
|
| 2631 | - include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?> |
|
| 2626 | + /** |
|
| 2627 | + * Contains login form template. |
|
| 2628 | + * |
|
| 2629 | + * @since 1.0.0 |
|
| 2630 | + */ |
|
| 2631 | + include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?> |
|
| 2632 | 2632 | </div> |
| 2633 | 2633 | <div class="registration_form_r"> |
| 2634 | 2634 | <?php |
| 2635 | - /** |
|
| 2636 | - * Contains registration form template. |
|
| 2637 | - * |
|
| 2638 | - * @since 1.0.0 |
|
| 2639 | - */ |
|
| 2640 | - include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?> |
|
| 2635 | + /** |
|
| 2636 | + * Contains registration form template. |
|
| 2637 | + * |
|
| 2638 | + * @since 1.0.0 |
|
| 2639 | + */ |
|
| 2640 | + include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?> |
|
| 2641 | 2641 | </div> |
| 2642 | 2642 | |
| 2643 | 2643 | <?php }?> |
@@ -2668,66 +2668,66 @@ discard block |
||
| 2668 | 2668 | */ |
| 2669 | 2669 | function geodir_action_author_page_title() |
| 2670 | 2670 | {
|
| 2671 | - global $term; |
|
| 2671 | + global $term; |
|
| 2672 | 2672 | |
| 2673 | - $gd_post_type = geodir_get_current_posttype(); |
|
| 2674 | - $post_type_info = get_post_type_object($gd_post_type); |
|
| 2673 | + $gd_post_type = geodir_get_current_posttype(); |
|
| 2674 | + $post_type_info = get_post_type_object($gd_post_type); |
|
| 2675 | 2675 | |
| 2676 | - $add_string_in_title = __('All', 'geodirectory') . ' ';
|
|
| 2677 | - if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
|
|
| 2678 | - $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
|
|
| 2679 | - } |
|
| 2676 | + $add_string_in_title = __('All', 'geodirectory') . ' ';
|
|
| 2677 | + if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
|
|
| 2678 | + $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
|
|
| 2679 | + } |
|
| 2680 | 2680 | |
| 2681 | - $list_title = $add_string_in_title . $post_type_info->labels->name; |
|
| 2682 | - $single_name = $post_type_info->labels->singular_name; |
|
| 2681 | + $list_title = $add_string_in_title . $post_type_info->labels->name; |
|
| 2682 | + $single_name = $post_type_info->labels->singular_name; |
|
| 2683 | 2683 | |
| 2684 | - $taxonomy = geodir_get_taxonomies($gd_post_type); |
|
| 2684 | + $taxonomy = geodir_get_taxonomies($gd_post_type); |
|
| 2685 | 2685 | |
| 2686 | - if (!empty($term)) {
|
|
| 2687 | - $current_term = get_term_by('slug', $term, $taxonomy[0]);
|
|
| 2688 | - if (!empty($current_term)) |
|
| 2689 | - $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
|
|
| 2690 | - } |
|
| 2686 | + if (!empty($term)) {
|
|
| 2687 | + $current_term = get_term_by('slug', $term, $taxonomy[0]);
|
|
| 2688 | + if (!empty($current_term)) |
|
| 2689 | + $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
|
|
| 2690 | + } |
|
| 2691 | 2691 | |
| 2692 | 2692 | |
| 2693 | - if (is_search()) {
|
|
| 2694 | - $list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
|
|
| 2693 | + if (is_search()) {
|
|
| 2694 | + $list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
|
|
| 2695 | 2695 | |
| 2696 | - } |
|
| 2697 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2698 | - $class = apply_filters('geodir_page_title_class', 'entry-title fn');
|
|
| 2699 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2700 | - $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
|
|
| 2696 | + } |
|
| 2697 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2698 | + $class = apply_filters('geodir_page_title_class', 'entry-title fn');
|
|
| 2699 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2700 | + $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
|
|
| 2701 | 2701 | |
| 2702 | - $title = $list_title; |
|
| 2703 | - if(geodir_is_page('author')){
|
|
| 2704 | - $gd_page = 'author'; |
|
| 2705 | - if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
|
|
| 2706 | - $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
|
|
| 2707 | - }else{
|
|
| 2708 | - $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
|
|
| 2709 | - } |
|
| 2702 | + $title = $list_title; |
|
| 2703 | + if(geodir_is_page('author')){
|
|
| 2704 | + $gd_page = 'author'; |
|
| 2705 | + if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
|
|
| 2706 | + $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
|
|
| 2707 | + }else{
|
|
| 2708 | + $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
|
|
| 2709 | + } |
|
| 2710 | 2710 | |
| 2711 | - } |
|
| 2711 | + } |
|
| 2712 | 2712 | |
| 2713 | 2713 | |
| 2714 | - /** |
|
| 2715 | - * Filter page title to replace variables. |
|
| 2716 | - * |
|
| 2717 | - * @since 1.5.4 |
|
| 2718 | - * @param string $title The page title including variables. |
|
| 2719 | - * @param string $gd_page The GeoDirectory page type if any. |
|
| 2720 | - */ |
|
| 2721 | - $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 2714 | + /** |
|
| 2715 | + * Filter page title to replace variables. |
|
| 2716 | + * |
|
| 2717 | + * @since 1.5.4 |
|
| 2718 | + * @param string $title The page title including variables. |
|
| 2719 | + * @param string $gd_page The GeoDirectory page type if any. |
|
| 2720 | + */ |
|
| 2721 | + $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 2722 | 2722 | |
| 2723 | - echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
|
| 2724 | - /** |
|
| 2725 | - * Filter the author page title text. |
|
| 2726 | - * |
|
| 2727 | - * @since 1.0.0 |
|
| 2728 | - * @param string $list_title The title for the page. |
|
| 2729 | - */ |
|
| 2730 | - apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
|
|
| 2723 | + echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
|
| 2724 | + /** |
|
| 2725 | + * Filter the author page title text. |
|
| 2726 | + * |
|
| 2727 | + * @since 1.0.0 |
|
| 2728 | + * @param string $list_title The title for the page. |
|
| 2729 | + */ |
|
| 2730 | + apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
|
|
| 2731 | 2731 | } |
| 2732 | 2732 | |
| 2733 | 2733 | |
@@ -2745,11 +2745,11 @@ discard block |
||
| 2745 | 2745 | */ |
| 2746 | 2746 | function geodir_action_geodir_sidebar_author_top() |
| 2747 | 2747 | {
|
| 2748 | - if (get_option('geodir_show_author_top_section')) { ?>
|
|
| 2748 | + if (get_option('geodir_show_author_top_section')) { ?>
|
|
| 2749 | 2749 | <div |
| 2750 | 2750 | class="<?php |
| 2751 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2752 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_top'); ?>">
|
|
| 2751 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2752 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_top'); ?>">
|
|
| 2753 | 2753 | <?php dynamic_sidebar('geodir_author_top'); ?>
|
| 2754 | 2754 | </div><!-- clearfix ends here--> |
| 2755 | 2755 | <?php } |
@@ -2765,7 +2765,7 @@ discard block |
||
| 2765 | 2765 | */ |
| 2766 | 2766 | function geodir_author_left_section() |
| 2767 | 2767 | {
|
| 2768 | - if (get_option('geodir_show_author_left_section')) { ?>
|
|
| 2768 | + if (get_option('geodir_show_author_left_section')) { ?>
|
|
| 2769 | 2769 | <div class="geodir-content-left geodir-sidebar-wrap"> |
| 2770 | 2770 | <?php dynamic_sidebar('geodir_author_left_sidebar'); ?>
|
| 2771 | 2771 | </div><!-- end geodir-content-left --> |
@@ -2786,19 +2786,19 @@ discard block |
||
| 2786 | 2786 | */ |
| 2787 | 2787 | function geodir_action_author_sidebar_left() |
| 2788 | 2788 | {
|
| 2789 | - if (get_option('geodir_show_author_left_section')) {
|
|
| 2789 | + if (get_option('geodir_show_author_left_section')) {
|
|
| 2790 | 2790 | // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='') |
| 2791 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2792 | - do_action('geodir_sidebar_left_open', 'author-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
|
|
| 2793 | - /** |
|
| 2794 | - * This is used to add the content to the author page left sidebar (if active). |
|
| 2795 | - * |
|
| 2796 | - * @since 1.0.0 |
|
| 2797 | - */ |
|
| 2798 | - do_action('geodir_author_sidebar_left_inside');
|
|
| 2799 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2800 | - do_action('geodir_sidebar_left_close', 'author-page');
|
|
| 2801 | - } |
|
| 2791 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2792 | + do_action('geodir_sidebar_left_open', 'author-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
|
|
| 2793 | + /** |
|
| 2794 | + * This is used to add the content to the author page left sidebar (if active). |
|
| 2795 | + * |
|
| 2796 | + * @since 1.0.0 |
|
| 2797 | + */ |
|
| 2798 | + do_action('geodir_author_sidebar_left_inside');
|
|
| 2799 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2800 | + do_action('geodir_sidebar_left_close', 'author-page');
|
|
| 2801 | + } |
|
| 2802 | 2802 | } |
| 2803 | 2803 | |
| 2804 | 2804 | /** |
@@ -2811,7 +2811,7 @@ discard block |
||
| 2811 | 2811 | */ |
| 2812 | 2812 | function geodir_author_right_section() |
| 2813 | 2813 | {
|
| 2814 | - if (get_option('geodir_show_author_right_section')) { ?>
|
|
| 2814 | + if (get_option('geodir_show_author_right_section')) { ?>
|
|
| 2815 | 2815 | <div class="geodir-content-right geodir-sidebar-wrap"> |
| 2816 | 2816 | <?php dynamic_sidebar('geodir_author_right_sidebar'); ?>
|
| 2817 | 2817 | </div><!-- end geodir-content-right --> |
@@ -2831,18 +2831,18 @@ discard block |
||
| 2831 | 2831 | */ |
| 2832 | 2832 | function geodir_action_author_sidebar_right() |
| 2833 | 2833 | {
|
| 2834 | - if (get_option('geodir_show_author_right_section')) {
|
|
| 2835 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2836 | - do_action('geodir_sidebar_right_open', 'author-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
|
|
| 2837 | - /** |
|
| 2838 | - * This is used to add the content to the author page right sidebar (if active). |
|
| 2839 | - * |
|
| 2840 | - * @since 1.0.0 |
|
| 2841 | - */ |
|
| 2842 | - do_action('geodir_author_sidebar_right_inside');
|
|
| 2843 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2844 | - do_action('geodir_sidebar_right_close', 'author-page');
|
|
| 2845 | - } |
|
| 2834 | + if (get_option('geodir_show_author_right_section')) {
|
|
| 2835 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2836 | + do_action('geodir_sidebar_right_open', 'author-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
|
|
| 2837 | + /** |
|
| 2838 | + * This is used to add the content to the author page right sidebar (if active). |
|
| 2839 | + * |
|
| 2840 | + * @since 1.0.0 |
|
| 2841 | + */ |
|
| 2842 | + do_action('geodir_author_sidebar_right_inside');
|
|
| 2843 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2844 | + do_action('geodir_sidebar_right_close', 'author-page');
|
|
| 2845 | + } |
|
| 2846 | 2846 | } |
| 2847 | 2847 | |
| 2848 | 2848 | /** |
@@ -2854,14 +2854,14 @@ discard block |
||
| 2854 | 2854 | */ |
| 2855 | 2855 | function geodir_action_author_content_inside() |
| 2856 | 2856 | {
|
| 2857 | - global $gridview_columns; |
|
| 2858 | - $listing_view = get_option('geodir_author_view');
|
|
| 2859 | - if (strstr($listing_view, 'gridview')) {
|
|
| 2860 | - $gridview_columns = $listing_view; |
|
| 2861 | - $listing_view_exp = explode('_', $listing_view);
|
|
| 2862 | - $listing_view = $listing_view_exp[0]; |
|
| 2863 | - } |
|
| 2864 | - geodir_get_template_part('listing', 'listview');
|
|
| 2857 | + global $gridview_columns; |
|
| 2858 | + $listing_view = get_option('geodir_author_view');
|
|
| 2859 | + if (strstr($listing_view, 'gridview')) {
|
|
| 2860 | + $gridview_columns = $listing_view; |
|
| 2861 | + $listing_view_exp = explode('_', $listing_view);
|
|
| 2862 | + $listing_view = $listing_view_exp[0]; |
|
| 2863 | + } |
|
| 2864 | + geodir_get_template_part('listing', 'listview');
|
|
| 2865 | 2865 | } |
| 2866 | 2866 | |
| 2867 | 2867 | add_action('geodir_author_content_inside', 'geodir_action_author_content_inside', 10);
|
@@ -2876,22 +2876,22 @@ discard block |
||
| 2876 | 2876 | */ |
| 2877 | 2877 | function geodir_action_author_content() |
| 2878 | 2878 | {
|
| 2879 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2880 | - do_action('geodir_main_content_open', 'author-page', 'geodir-main-content', 'author-page');
|
|
| 2881 | - echo '<div class="clearfix">'; |
|
| 2882 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2883 | - do_action('geodir_before_listing');
|
|
| 2884 | - echo '</div>'; |
|
| 2885 | - /** |
|
| 2886 | - * This is used to add the content to the author page main content. |
|
| 2887 | - * |
|
| 2888 | - * @since 1.0.0 |
|
| 2889 | - */ |
|
| 2890 | - do_action('geodir_author_content_inside');
|
|
| 2891 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2892 | - do_action('geodir_after_listing');
|
|
| 2893 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2894 | - do_action('geodir_main_content_close', 'author-page');
|
|
| 2879 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2880 | + do_action('geodir_main_content_open', 'author-page', 'geodir-main-content', 'author-page');
|
|
| 2881 | + echo '<div class="clearfix">'; |
|
| 2882 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2883 | + do_action('geodir_before_listing');
|
|
| 2884 | + echo '</div>'; |
|
| 2885 | + /** |
|
| 2886 | + * This is used to add the content to the author page main content. |
|
| 2887 | + * |
|
| 2888 | + * @since 1.0.0 |
|
| 2889 | + */ |
|
| 2890 | + do_action('geodir_author_content_inside');
|
|
| 2891 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2892 | + do_action('geodir_after_listing');
|
|
| 2893 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2894 | + do_action('geodir_main_content_close', 'author-page');
|
|
| 2895 | 2895 | } |
| 2896 | 2896 | |
| 2897 | 2897 | add_action('geodir_sidebar_author_bottom_section', 'geodir_action_sidebar_author_bottom_section', 10);
|
@@ -2905,11 +2905,11 @@ discard block |
||
| 2905 | 2905 | */ |
| 2906 | 2906 | function geodir_action_sidebar_author_bottom_section() |
| 2907 | 2907 | {
|
| 2908 | - if (get_option('geodir_show_author_bottom_section')) { ?>
|
|
| 2908 | + if (get_option('geodir_show_author_bottom_section')) { ?>
|
|
| 2909 | 2909 | <div |
| 2910 | 2910 | class="<?php |
| 2911 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2912 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_bottom'); ?>">
|
|
| 2911 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2912 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_bottom'); ?>">
|
|
| 2913 | 2913 | <?php dynamic_sidebar('geodir_author_bottom'); ?>
|
| 2914 | 2914 | </div><!-- clearfix ends here--> |
| 2915 | 2915 | <?php } |
@@ -2928,23 +2928,23 @@ discard block |
||
| 2928 | 2928 | */ |
| 2929 | 2929 | function geodir_action_search_page_title() |
| 2930 | 2930 | {
|
| 2931 | - $gd_post_type = geodir_get_current_posttype(); |
|
| 2932 | - $post_type_info = get_post_type_object($gd_post_type); |
|
| 2931 | + $gd_post_type = geodir_get_current_posttype(); |
|
| 2932 | + $post_type_info = get_post_type_object($gd_post_type); |
|
| 2933 | 2933 | |
| 2934 | - $pt_name = ''; |
|
| 2935 | - if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
|
|
| 2934 | + $pt_name = ''; |
|
| 2935 | + if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
|
|
| 2936 | 2936 | |
| 2937 | - if (is_search()) {
|
|
| 2938 | - $list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
|
|
| 2937 | + if (is_search()) {
|
|
| 2938 | + $list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
|
|
| 2939 | 2939 | |
| 2940 | - } |
|
| 2941 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2942 | - $class = apply_filters('geodir_page_title_class', 'entry-title fn');
|
|
| 2943 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2944 | - $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
|
|
| 2945 | - echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
|
| 2946 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2947 | - apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
|
|
| 2940 | + } |
|
| 2941 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2942 | + $class = apply_filters('geodir_page_title_class', 'entry-title fn');
|
|
| 2943 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2944 | + $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
|
|
| 2945 | + echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
|
| 2946 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2947 | + apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
|
|
| 2948 | 2948 | } |
| 2949 | 2949 | |
| 2950 | 2950 | // action for adding the listings page top widget area |
@@ -2960,11 +2960,11 @@ discard block |
||
| 2960 | 2960 | */ |
| 2961 | 2961 | function geodir_action_geodir_sidebar_search_top() |
| 2962 | 2962 | {
|
| 2963 | - if (get_option('geodir_show_search_top_section')) { ?>
|
|
| 2963 | + if (get_option('geodir_show_search_top_section')) { ?>
|
|
| 2964 | 2964 | <div |
| 2965 | 2965 | class="<?php |
| 2966 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2967 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_top'); ?>">
|
|
| 2966 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2967 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_top'); ?>">
|
|
| 2968 | 2968 | <?php dynamic_sidebar('geodir_search_top'); ?>
|
| 2969 | 2969 | </div><!-- clearfix ends here--> |
| 2970 | 2970 | <?php } |
@@ -2980,7 +2980,7 @@ discard block |
||
| 2980 | 2980 | */ |
| 2981 | 2981 | function geodir_search_left_section() |
| 2982 | 2982 | {
|
| 2983 | - if (get_option('geodir_show_search_left_section')) { ?>
|
|
| 2983 | + if (get_option('geodir_show_search_left_section')) { ?>
|
|
| 2984 | 2984 | <div class="geodir-content-left geodir-sidebar-wrap"> |
| 2985 | 2985 | <?php dynamic_sidebar('geodir_search_left_sidebar'); ?>
|
| 2986 | 2986 | </div><!-- end geodir-content-left --> |
@@ -3000,19 +3000,19 @@ discard block |
||
| 3000 | 3000 | */ |
| 3001 | 3001 | function geodir_action_search_sidebar_left() |
| 3002 | 3002 | {
|
| 3003 | - if (get_option('geodir_show_search_left_section')) {
|
|
| 3003 | + if (get_option('geodir_show_search_left_section')) {
|
|
| 3004 | 3004 | // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='') |
| 3005 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3006 | - do_action('geodir_sidebar_left_open', 'search-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
|
|
| 3007 | - /** |
|
| 3008 | - * This is used to add the content to the search page left sidebar (if active). |
|
| 3009 | - * |
|
| 3010 | - * @since 1.0.0 |
|
| 3011 | - */ |
|
| 3012 | - do_action('geodir_search_sidebar_left_inside');
|
|
| 3013 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3014 | - do_action('geodir_sidebar_left_close', 'search-page');
|
|
| 3015 | - } |
|
| 3005 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3006 | + do_action('geodir_sidebar_left_open', 'search-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
|
|
| 3007 | + /** |
|
| 3008 | + * This is used to add the content to the search page left sidebar (if active). |
|
| 3009 | + * |
|
| 3010 | + * @since 1.0.0 |
|
| 3011 | + */ |
|
| 3012 | + do_action('geodir_search_sidebar_left_inside');
|
|
| 3013 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3014 | + do_action('geodir_sidebar_left_close', 'search-page');
|
|
| 3015 | + } |
|
| 3016 | 3016 | } |
| 3017 | 3017 | |
| 3018 | 3018 | /** |
@@ -3025,7 +3025,7 @@ discard block |
||
| 3025 | 3025 | */ |
| 3026 | 3026 | function geodir_search_right_section() |
| 3027 | 3027 | {
|
| 3028 | - if (get_option('geodir_show_search_right_section')) { ?>
|
|
| 3028 | + if (get_option('geodir_show_search_right_section')) { ?>
|
|
| 3029 | 3029 | <div class="geodir-content-right geodir-sidebar-wrap"> |
| 3030 | 3030 | <?php dynamic_sidebar('geodir_search_right_sidebar'); ?>
|
| 3031 | 3031 | </div><!-- end geodir-content-right --> |
@@ -3045,18 +3045,18 @@ discard block |
||
| 3045 | 3045 | */ |
| 3046 | 3046 | function geodir_action_search_sidebar_right() |
| 3047 | 3047 | {
|
| 3048 | - if (get_option('geodir_show_search_right_section')) {
|
|
| 3049 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3050 | - do_action('geodir_sidebar_right_open', 'search-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
|
|
| 3051 | - /** |
|
| 3052 | - * This is used to add the content to the search page right sidebar (if active). |
|
| 3053 | - * |
|
| 3054 | - * @since 1.0.0 |
|
| 3055 | - */ |
|
| 3056 | - do_action('geodir_search_sidebar_right_inside');
|
|
| 3057 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3058 | - do_action('geodir_sidebar_right_close', 'search-page');
|
|
| 3059 | - } |
|
| 3048 | + if (get_option('geodir_show_search_right_section')) {
|
|
| 3049 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3050 | + do_action('geodir_sidebar_right_open', 'search-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
|
|
| 3051 | + /** |
|
| 3052 | + * This is used to add the content to the search page right sidebar (if active). |
|
| 3053 | + * |
|
| 3054 | + * @since 1.0.0 |
|
| 3055 | + */ |
|
| 3056 | + do_action('geodir_search_sidebar_right_inside');
|
|
| 3057 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3058 | + do_action('geodir_sidebar_right_close', 'search-page');
|
|
| 3059 | + } |
|
| 3060 | 3060 | } |
| 3061 | 3061 | |
| 3062 | 3062 | |
@@ -3071,11 +3071,11 @@ discard block |
||
| 3071 | 3071 | */ |
| 3072 | 3072 | function geodir_action_sidebar_search_bottom_section() |
| 3073 | 3073 | {
|
| 3074 | - if (get_option('geodir_show_search_bottom_section')) { ?>
|
|
| 3074 | + if (get_option('geodir_show_search_bottom_section')) { ?>
|
|
| 3075 | 3075 | <div |
| 3076 | 3076 | class="<?php |
| 3077 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3078 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_bottom'); ?>">
|
|
| 3077 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3078 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_bottom'); ?>">
|
|
| 3079 | 3079 | <?php dynamic_sidebar('geodir_search_bottom'); ?>
|
| 3080 | 3080 | </div><!-- clearfix ends here--> |
| 3081 | 3081 | <?php } |
@@ -3090,14 +3090,14 @@ discard block |
||
| 3090 | 3090 | */ |
| 3091 | 3091 | function geodir_action_search_content_inside() |
| 3092 | 3092 | {
|
| 3093 | - global $gridview_columns; |
|
| 3094 | - $listing_view = get_option('geodir_search_view');
|
|
| 3095 | - if (strstr($listing_view, 'gridview')) {
|
|
| 3096 | - $gridview_columns = $listing_view; |
|
| 3097 | - $listing_view_exp = explode('_', $listing_view);
|
|
| 3098 | - $listing_view = $listing_view_exp[0]; |
|
| 3099 | - } |
|
| 3100 | - geodir_get_template_part('listing', 'listview');
|
|
| 3093 | + global $gridview_columns; |
|
| 3094 | + $listing_view = get_option('geodir_search_view');
|
|
| 3095 | + if (strstr($listing_view, 'gridview')) {
|
|
| 3096 | + $gridview_columns = $listing_view; |
|
| 3097 | + $listing_view_exp = explode('_', $listing_view);
|
|
| 3098 | + $listing_view = $listing_view_exp[0]; |
|
| 3099 | + } |
|
| 3100 | + geodir_get_template_part('listing', 'listview');
|
|
| 3101 | 3101 | } |
| 3102 | 3102 | |
| 3103 | 3103 | add_action('geodir_search_content_inside', 'geodir_action_search_content_inside', 10);
|
@@ -3113,22 +3113,22 @@ discard block |
||
| 3113 | 3113 | */ |
| 3114 | 3114 | function geodir_action_search_content() |
| 3115 | 3115 | {
|
| 3116 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3117 | - do_action('geodir_main_content_open', 'search-page', 'geodir-main-content', 'search-page');
|
|
| 3118 | - echo '<div class="clearfix">'; |
|
| 3119 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3120 | - do_action('geodir_before_listing');
|
|
| 3121 | - echo '</div>'; |
|
| 3122 | - /** |
|
| 3123 | - * This is used to add the content to the search page main content. |
|
| 3124 | - * |
|
| 3125 | - * @since 1.0.0 |
|
| 3126 | - */ |
|
| 3127 | - do_action('geodir_search_content_inside');
|
|
| 3128 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3129 | - do_action('geodir_after_listing');
|
|
| 3130 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3131 | - do_action('geodir_main_content_close', 'search-page');
|
|
| 3116 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3117 | + do_action('geodir_main_content_open', 'search-page', 'geodir-main-content', 'search-page');
|
|
| 3118 | + echo '<div class="clearfix">'; |
|
| 3119 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3120 | + do_action('geodir_before_listing');
|
|
| 3121 | + echo '</div>'; |
|
| 3122 | + /** |
|
| 3123 | + * This is used to add the content to the search page main content. |
|
| 3124 | + * |
|
| 3125 | + * @since 1.0.0 |
|
| 3126 | + */ |
|
| 3127 | + do_action('geodir_search_content_inside');
|
|
| 3128 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3129 | + do_action('geodir_after_listing');
|
|
| 3130 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3131 | + do_action('geodir_main_content_close', 'search-page');
|
|
| 3132 | 3132 | } |
| 3133 | 3133 | |
| 3134 | 3134 | ############################################### |
@@ -3151,11 +3151,11 @@ discard block |
||
| 3151 | 3151 | */ |
| 3152 | 3152 | function geodir_action_geodir_sidebar_home_top() |
| 3153 | 3153 | {
|
| 3154 | - if (get_option('geodir_show_home_top_section')) { ?>
|
|
| 3154 | + if (get_option('geodir_show_home_top_section')) { ?>
|
|
| 3155 | 3155 | <div |
| 3156 | 3156 | class="<?php |
| 3157 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3158 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_top'); ?>">
|
|
| 3157 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3158 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_top'); ?>">
|
|
| 3159 | 3159 | <?php dynamic_sidebar('geodir_home_top'); ?>
|
| 3160 | 3160 | </div><!-- clearfix ends here--> |
| 3161 | 3161 | <?php } |
@@ -3171,7 +3171,7 @@ discard block |
||
| 3171 | 3171 | */ |
| 3172 | 3172 | function geodir_home_left_section() |
| 3173 | 3173 | {
|
| 3174 | - if (get_option('geodir_show_home_left_section')) { ?>
|
|
| 3174 | + if (get_option('geodir_show_home_left_section')) { ?>
|
|
| 3175 | 3175 | <div class="geodir-content-left geodir-sidebar-wrap"> |
| 3176 | 3176 | <?php dynamic_sidebar('geodir_home_left'); ?>
|
| 3177 | 3177 | </div><!-- end geodir-content-left --> |
@@ -3193,19 +3193,19 @@ discard block |
||
| 3193 | 3193 | */ |
| 3194 | 3194 | function geodir_action_home_sidebar_left() |
| 3195 | 3195 | {
|
| 3196 | - if (get_option('geodir_show_home_left_section')) {
|
|
| 3196 | + if (get_option('geodir_show_home_left_section')) {
|
|
| 3197 | 3197 | // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='') |
| 3198 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3199 | - do_action('geodir_sidebar_left_open', 'home-page', 'geodir-sidebar-left', 'geodir-sidebar geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
|
|
| 3200 | - /** |
|
| 3201 | - * This is used to add the content to the home page left sidebar (if active). |
|
| 3202 | - * |
|
| 3203 | - * @since 1.0.0 |
|
| 3204 | - */ |
|
| 3205 | - do_action('geodir_home_sidebar_left_inside');
|
|
| 3206 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3207 | - do_action('geodir_sidebar_left_close', 'home-page');
|
|
| 3208 | - } |
|
| 3198 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3199 | + do_action('geodir_sidebar_left_open', 'home-page', 'geodir-sidebar-left', 'geodir-sidebar geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
|
|
| 3200 | + /** |
|
| 3201 | + * This is used to add the content to the home page left sidebar (if active). |
|
| 3202 | + * |
|
| 3203 | + * @since 1.0.0 |
|
| 3204 | + */ |
|
| 3205 | + do_action('geodir_home_sidebar_left_inside');
|
|
| 3206 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3207 | + do_action('geodir_sidebar_left_close', 'home-page');
|
|
| 3208 | + } |
|
| 3209 | 3209 | } |
| 3210 | 3210 | |
| 3211 | 3211 | /** |
@@ -3218,7 +3218,7 @@ discard block |
||
| 3218 | 3218 | */ |
| 3219 | 3219 | function geodir_home_right_section() |
| 3220 | 3220 | {
|
| 3221 | - if (get_option('geodir_show_home_right_section')) { ?>
|
|
| 3221 | + if (get_option('geodir_show_home_right_section')) { ?>
|
|
| 3222 | 3222 | <div class="geodir-content-right geodir-sidebar-wrap"> |
| 3223 | 3223 | <?php dynamic_sidebar('geodir_home_right'); ?>
|
| 3224 | 3224 | </div><!-- end geodir-content-right --> |
@@ -3239,18 +3239,18 @@ discard block |
||
| 3239 | 3239 | */ |
| 3240 | 3240 | function geodir_action_home_sidebar_right() |
| 3241 | 3241 | {
|
| 3242 | - if (get_option('geodir_show_home_right_section')) {
|
|
| 3243 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3244 | - do_action('geodir_sidebar_right_open', 'home-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
|
|
| 3245 | - /** |
|
| 3246 | - * This is used to add the content to the home page right sidebar (if active). |
|
| 3247 | - * |
|
| 3248 | - * @since 1.0.0 |
|
| 3249 | - */ |
|
| 3250 | - do_action('geodir_home_sidebar_right_inside');
|
|
| 3251 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3252 | - do_action('geodir_sidebar_right_close', 'home-page');
|
|
| 3253 | - } |
|
| 3242 | + if (get_option('geodir_show_home_right_section')) {
|
|
| 3243 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3244 | + do_action('geodir_sidebar_right_open', 'home-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
|
|
| 3245 | + /** |
|
| 3246 | + * This is used to add the content to the home page right sidebar (if active). |
|
| 3247 | + * |
|
| 3248 | + * @since 1.0.0 |
|
| 3249 | + */ |
|
| 3250 | + do_action('geodir_home_sidebar_right_inside');
|
|
| 3251 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3252 | + do_action('geodir_sidebar_right_close', 'home-page');
|
|
| 3253 | + } |
|
| 3254 | 3254 | } |
| 3255 | 3255 | |
| 3256 | 3256 | /** |
@@ -3261,7 +3261,7 @@ discard block |
||
| 3261 | 3261 | */ |
| 3262 | 3262 | function geodir_action_home_content_inside() |
| 3263 | 3263 | {
|
| 3264 | - dynamic_sidebar('geodir_home_content');
|
|
| 3264 | + dynamic_sidebar('geodir_home_content');
|
|
| 3265 | 3265 | } |
| 3266 | 3266 | |
| 3267 | 3267 | add_action('geodir_home_content_inside', 'geodir_action_home_content_inside', 10);
|
@@ -3276,28 +3276,28 @@ discard block |
||
| 3276 | 3276 | */ |
| 3277 | 3277 | function geodir_action_home_content() |
| 3278 | 3278 | {
|
| 3279 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3280 | - do_action('geodir_main_content_open', 'home-page', 'geodir-main-content', 'home-page');
|
|
| 3281 | - /** |
|
| 3282 | - * This called before the home page main content. |
|
| 3283 | - * |
|
| 3284 | - * @since 1.0.0 |
|
| 3285 | - */ |
|
| 3286 | - do_action('geodir_before_home_content');
|
|
| 3287 | - /** |
|
| 3288 | - * This is used to add the content to the home page main content. |
|
| 3289 | - * |
|
| 3290 | - * @since 1.0.0 |
|
| 3291 | - */ |
|
| 3292 | - do_action('geodir_home_content_inside');
|
|
| 3293 | - /** |
|
| 3294 | - * This is called after the homepage main content. |
|
| 3295 | - * |
|
| 3296 | - * @since 1.0.0 |
|
| 3297 | - */ |
|
| 3298 | - do_action('geodir_after_home_content');
|
|
| 3299 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3300 | - do_action('geodir_main_content_close', 'home-page');
|
|
| 3279 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3280 | + do_action('geodir_main_content_open', 'home-page', 'geodir-main-content', 'home-page');
|
|
| 3281 | + /** |
|
| 3282 | + * This called before the home page main content. |
|
| 3283 | + * |
|
| 3284 | + * @since 1.0.0 |
|
| 3285 | + */ |
|
| 3286 | + do_action('geodir_before_home_content');
|
|
| 3287 | + /** |
|
| 3288 | + * This is used to add the content to the home page main content. |
|
| 3289 | + * |
|
| 3290 | + * @since 1.0.0 |
|
| 3291 | + */ |
|
| 3292 | + do_action('geodir_home_content_inside');
|
|
| 3293 | + /** |
|
| 3294 | + * This is called after the homepage main content. |
|
| 3295 | + * |
|
| 3296 | + * @since 1.0.0 |
|
| 3297 | + */ |
|
| 3298 | + do_action('geodir_after_home_content');
|
|
| 3299 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3300 | + do_action('geodir_main_content_close', 'home-page');
|
|
| 3301 | 3301 | } |
| 3302 | 3302 | |
| 3303 | 3303 | add_action('geodir_sidebar_location_bottom_section', 'geodir_action_sidebar_home_bottom_section', 10);
|
@@ -3312,11 +3312,11 @@ discard block |
||
| 3312 | 3312 | */ |
| 3313 | 3313 | function geodir_action_sidebar_home_bottom_section() |
| 3314 | 3314 | {
|
| 3315 | - if (get_option('geodir_show_home_bottom_section')) { ?>
|
|
| 3315 | + if (get_option('geodir_show_home_bottom_section')) { ?>
|
|
| 3316 | 3316 | <div |
| 3317 | 3317 | class="<?php |
| 3318 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3319 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_bottom'); ?>">
|
|
| 3318 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3319 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_bottom'); ?>">
|
|
| 3320 | 3320 | <?php dynamic_sidebar('geodir_home_bottom'); ?>
|
| 3321 | 3321 | </div><!-- clearfix ends here--> |
| 3322 | 3322 | <?php } |
@@ -3344,13 +3344,13 @@ discard block |
||
| 3344 | 3344 | */ |
| 3345 | 3345 | function geodir_filter_listing_page_title($list_title) |
| 3346 | 3346 | {
|
| 3347 | - if (is_search() && trim(get_search_query()) == '') {
|
|
| 3348 | - $gd_post_type = geodir_get_current_posttype(); |
|
| 3349 | - $post_type_info = get_post_type_object($gd_post_type); |
|
| 3347 | + if (is_search() && trim(get_search_query()) == '') {
|
|
| 3348 | + $gd_post_type = geodir_get_current_posttype(); |
|
| 3349 | + $post_type_info = get_post_type_object($gd_post_type); |
|
| 3350 | 3350 | |
| 3351 | - $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
|
|
| 3352 | - } |
|
| 3353 | - return $list_title; |
|
| 3351 | + $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
|
|
| 3352 | + } |
|
| 3353 | + return $list_title; |
|
| 3354 | 3354 | } |
| 3355 | 3355 | |
| 3356 | 3356 | add_action('geodir_message_not_found_on_listing', 'geodir_display_message_not_found_on_listing');
|
@@ -3365,61 +3365,61 @@ discard block |
||
| 3365 | 3365 | * @param string $gd_page The geodirectory page type. Default null. |
| 3366 | 3366 | */ |
| 3367 | 3367 | function geodir_add_page_content( $position = 'before', $gd_page = '' ) {
|
| 3368 | - global $post; |
|
| 3368 | + global $post; |
|
| 3369 | 3369 | |
| 3370 | - $gd_page_id = NULL; |
|
| 3371 | - if ($gd_page == 'home-page' && geodir_is_page('home')) {
|
|
| 3372 | - $gd_page_id = geodir_home_page_id(); |
|
| 3373 | - } else if ($gd_page == 'details-page' && geodir_is_page('preview')) {
|
|
| 3374 | - $gd_page_id = geodir_preview_page_id(); |
|
| 3375 | - } else if ($gd_page == 'add-listing-page' && geodir_is_page('add-listing')) {
|
|
| 3376 | - $gd_page_id = geodir_add_listing_page_id(); |
|
| 3377 | - } else if ($gd_page == 'success-page' && geodir_is_page('listing-success')) {
|
|
| 3378 | - $gd_page_id = geodir_success_page_id(); |
|
| 3379 | - } else if ($gd_page == 'location-page' && geodir_is_page('location')) {
|
|
| 3380 | - $gd_page_id = geodir_location_page_id(); |
|
| 3381 | - } else if ($gd_page == 'info-page' && geodir_is_page('info')) {
|
|
| 3382 | - $gd_page_id = geodir_info_page_id(); |
|
| 3383 | - } else if ($gd_page == 'signup-page' && geodir_is_page('login')) {
|
|
| 3384 | - $gd_page_id = geodir_login_page_id(); |
|
| 3385 | - } else if ($gd_page == 'checkout-page' && geodir_is_page('checkout')) {
|
|
| 3386 | - $gd_page_id = geodir_payment_checkout_page_id(); |
|
| 3387 | - } else if ($gd_page == 'invoices-page' && geodir_is_page('invoices')) {
|
|
| 3388 | - $gd_page_id = geodir_payment_invoices_page_id(); |
|
| 3389 | - } |
|
| 3370 | + $gd_page_id = NULL; |
|
| 3371 | + if ($gd_page == 'home-page' && geodir_is_page('home')) {
|
|
| 3372 | + $gd_page_id = geodir_home_page_id(); |
|
| 3373 | + } else if ($gd_page == 'details-page' && geodir_is_page('preview')) {
|
|
| 3374 | + $gd_page_id = geodir_preview_page_id(); |
|
| 3375 | + } else if ($gd_page == 'add-listing-page' && geodir_is_page('add-listing')) {
|
|
| 3376 | + $gd_page_id = geodir_add_listing_page_id(); |
|
| 3377 | + } else if ($gd_page == 'success-page' && geodir_is_page('listing-success')) {
|
|
| 3378 | + $gd_page_id = geodir_success_page_id(); |
|
| 3379 | + } else if ($gd_page == 'location-page' && geodir_is_page('location')) {
|
|
| 3380 | + $gd_page_id = geodir_location_page_id(); |
|
| 3381 | + } else if ($gd_page == 'info-page' && geodir_is_page('info')) {
|
|
| 3382 | + $gd_page_id = geodir_info_page_id(); |
|
| 3383 | + } else if ($gd_page == 'signup-page' && geodir_is_page('login')) {
|
|
| 3384 | + $gd_page_id = geodir_login_page_id(); |
|
| 3385 | + } else if ($gd_page == 'checkout-page' && geodir_is_page('checkout')) {
|
|
| 3386 | + $gd_page_id = geodir_payment_checkout_page_id(); |
|
| 3387 | + } else if ($gd_page == 'invoices-page' && geodir_is_page('invoices')) {
|
|
| 3388 | + $gd_page_id = geodir_payment_invoices_page_id(); |
|
| 3389 | + } |
|
| 3390 | 3390 | |
| 3391 | - if (!$gd_page_id > 0) {
|
|
| 3392 | - return; |
|
| 3393 | - } |
|
| 3391 | + if (!$gd_page_id > 0) {
|
|
| 3392 | + return; |
|
| 3393 | + } |
|
| 3394 | 3394 | |
| 3395 | - $display = 'before'; |
|
| 3396 | - /** |
|
| 3397 | - * Filter the position to display the page content. |
|
| 3398 | - * |
|
| 3399 | - * @since 1.6.3 |
|
| 3400 | - * |
|
| 3401 | - * @param string $display Position to add the post content. |
|
| 3402 | - * @param string $gd_page The geodirectory page type. |
|
| 3403 | - */ |
|
| 3404 | - $display = apply_filters('geodir_add_page_content_position', $display, $gd_page);
|
|
| 3395 | + $display = 'before'; |
|
| 3396 | + /** |
|
| 3397 | + * Filter the position to display the page content. |
|
| 3398 | + * |
|
| 3399 | + * @since 1.6.3 |
|
| 3400 | + * |
|
| 3401 | + * @param string $display Position to add the post content. |
|
| 3402 | + * @param string $gd_page The geodirectory page type. |
|
| 3403 | + */ |
|
| 3404 | + $display = apply_filters('geodir_add_page_content_position', $display, $gd_page);
|
|
| 3405 | 3405 | |
| 3406 | - if ($position !== $display) {
|
|
| 3407 | - return; |
|
| 3408 | - } |
|
| 3406 | + if ($position !== $display) {
|
|
| 3407 | + return; |
|
| 3408 | + } |
|
| 3409 | 3409 | |
| 3410 | - $gd_post = $post; |
|
| 3410 | + $gd_post = $post; |
|
| 3411 | 3411 | |
| 3412 | - setup_postdata(get_post($gd_page_id)); |
|
| 3412 | + setup_postdata(get_post($gd_page_id)); |
|
| 3413 | 3413 | |
| 3414 | - if (get_the_content()) {
|
|
| 3415 | - ?> |
|
| 3414 | + if (get_the_content()) {
|
|
| 3415 | + ?> |
|
| 3416 | 3416 | <section class="entry-content clearfix" itemprop="articleBody"><?php the_content(); ?></section> |
| 3417 | 3417 | <?php |
| 3418 | - } |
|
| 3418 | + } |
|
| 3419 | 3419 | |
| 3420 | - $post = $gd_post; |
|
| 3421 | - if (!empty($gd_post) && is_object($gd_post)) {
|
|
| 3422 | - setup_postdata($gd_post); |
|
| 3423 | - } |
|
| 3420 | + $post = $gd_post; |
|
| 3421 | + if (!empty($gd_post) && is_object($gd_post)) {
|
|
| 3422 | + setup_postdata($gd_post); |
|
| 3423 | + } |
|
| 3424 | 3424 | } |
| 3425 | 3425 | add_action('geodir_add_page_content', 'geodir_add_page_content', 10, 2); |
| 3426 | 3426 | \ No newline at end of file |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | |
| 283 | 283 | //php |
| 284 | 284 | if (!empty($tc['geodir_theme_compat_code'])) {
|
| 285 | - include_once('geodirectory-functions/compatibility/' . $tc['geodir_theme_compat_code'] . '.php');
|
|
| 285 | + include_once('geodirectory-functions/compatibility/'.$tc['geodir_theme_compat_code'].'.php');
|
|
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 | //geodir_full_page_class |
@@ -452,13 +452,13 @@ discard block |
||
| 452 | 452 | function geodir_action_wrapper_content_open($type = '', $id = '', $class = '') |
| 453 | 453 | {
|
| 454 | 454 | if ($type == 'home-page' && $width = get_option('geodir_width_home_contant_section')) {
|
| 455 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 455 | + $width_css = 'style="width:'.$width.'%;"'; |
|
| 456 | 456 | } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_contant_section')) {
|
| 457 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 457 | + $width_css = 'style="width:'.$width.'%;"'; |
|
| 458 | 458 | } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_contant_section')) {
|
| 459 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 459 | + $width_css = 'style="width:'.$width.'%;"'; |
|
| 460 | 460 | } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_contant_section')) {
|
| 461 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 461 | + $width_css = 'style="width:'.$width.'%;"'; |
|
| 462 | 462 | } else {
|
| 463 | 463 | $width_css = ''; |
| 464 | 464 | } |
@@ -572,13 +572,13 @@ discard block |
||
| 572 | 572 | function geodir_action_sidebar_right_open($type = '', $id = '', $class = '', $itemtype = '') |
| 573 | 573 | {
|
| 574 | 574 | if ($type == 'home-page' && $width = get_option('geodir_width_home_right_section')) {
|
| 575 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 575 | + $width_css = 'style="width:'.$width.'%;"'; |
|
| 576 | 576 | } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_right_section')) {
|
| 577 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 577 | + $width_css = 'style="width:'.$width.'%;"'; |
|
| 578 | 578 | } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_right_section')) {
|
| 579 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 579 | + $width_css = 'style="width:'.$width.'%;"'; |
|
| 580 | 580 | } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_right_section')) {
|
| 581 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 581 | + $width_css = 'style="width:'.$width.'%;"'; |
|
| 582 | 582 | } else {
|
| 583 | 583 | $width_css = ''; |
| 584 | 584 | } |
@@ -676,7 +676,7 @@ discard block |
||
| 676 | 676 | } |
| 677 | 677 | } |
| 678 | 678 | |
| 679 | - $post = (object)$_REQUEST; |
|
| 679 | + $post = (object) $_REQUEST; |
|
| 680 | 680 | |
| 681 | 681 | |
| 682 | 682 | if (isset($post->video)) {
|
@@ -735,10 +735,10 @@ discard block |
||
| 735 | 735 | |
| 736 | 736 | $json = '{';
|
| 737 | 737 | $json .= '"post_preview": "1",'; |
| 738 | - $json .= '"t": "' . $json_title . '",'; |
|
| 739 | - $json .= '"lt": "' . $post_latitude . '",'; |
|
| 740 | - $json .= '"ln": "' . $post_longitude . '",'; |
|
| 741 | - $json .= '"i":"' . $term_icon . '"'; |
|
| 738 | + $json .= '"t": "'.$json_title.'",'; |
|
| 739 | + $json .= '"lt": "'.$post_latitude.'",'; |
|
| 740 | + $json .= '"ln": "'.$post_longitude.'",'; |
|
| 741 | + $json .= '"i":"'.$term_icon.'"'; |
|
| 742 | 742 | $json .= '}'; |
| 743 | 743 | |
| 744 | 744 | $post->marker_json = $json; |
@@ -965,7 +965,7 @@ discard block |
||
| 965 | 965 | * @param string $class The class to use. Default is 'entry-header'. |
| 966 | 966 | */ |
| 967 | 967 | $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
|
| 968 | - echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . stripslashes(get_the_title()) . '</h1></header>'; |
|
| 968 | + echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'.stripslashes(get_the_title()).'</h1></header>'; |
|
| 969 | 969 | } |
| 970 | 970 | |
| 971 | 971 | |
@@ -1019,7 +1019,7 @@ discard block |
||
| 1019 | 1019 | $height = !empty($sizes) && isset($sizes[1]) ? $sizes[1] : 0; |
| 1020 | 1020 | |
| 1021 | 1021 | if ($image && $width && $height) {
|
| 1022 | - $image = (object)array('src' => $image, 'width' => $width, 'height' => $height);
|
|
| 1022 | + $image = (object) array('src' => $image, 'width' => $width, 'height' => $height);
|
|
| 1023 | 1023 | } |
| 1024 | 1024 | |
| 1025 | 1025 | if (isset($image->src)) {
|
@@ -1031,9 +1031,9 @@ discard block |
||
| 1031 | 1031 | |
| 1032 | 1032 | $image_title = isset($image->title) ? $image->title : ''; |
| 1033 | 1033 | |
| 1034 | - $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />'; |
|
| 1035 | - $main_slides .= '<img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:400px;margin:0 auto;" /></li>'; |
|
| 1036 | - $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:48px;margin:0 auto;" /></li>'; |
|
| 1034 | + $main_slides .= '<li><img src="'.geodir_plugin_url()."/geodirectory-assets/images/spacer.gif".'" alt="'.$image_title.'" title="'.$image_title.'" style="max-height:'.$spacer_height.'px;margin:0 auto;" />'; |
|
| 1035 | + $main_slides .= '<img src="'.$image->src.'" alt="'.$image_title.'" title="'.$image_title.'" style="max-height:400px;margin:0 auto;" /></li>'; |
|
| 1036 | + $nav_slides .= '<li><img src="'.$image->src.'" alt="'.$image_title.'" title="'.$image_title.'" style="max-height:48px;margin:0 auto;" /></li>'; |
|
| 1037 | 1037 | $slides++; |
| 1038 | 1038 | } |
| 1039 | 1039 | } |
@@ -1052,10 +1052,10 @@ discard block |
||
| 1052 | 1052 | } else {
|
| 1053 | 1053 | $spacer_height = ((400 - $image->height) / 2); |
| 1054 | 1054 | } |
| 1055 | - $caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : ''; |
|
| 1056 | - $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />'; |
|
| 1057 | - $main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>'; |
|
| 1058 | - $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>'; |
|
| 1055 | + $caption = ''; //(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : ''; |
|
| 1056 | + $main_slides .= '<li><img src="'.geodir_plugin_url()."/geodirectory-assets/images/spacer.gif".'" alt="'.$image->title.'" title="'.$image->title.'" style="max-height:'.$spacer_height.'px;margin:0 auto;" />'; |
|
| 1057 | + $main_slides .= '<img src="'.$image->src.'" alt="'.$image->title.'" title="'.$image->title.'" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>'; |
|
| 1058 | + $nav_slides .= '<li><img src="'.$image->src.'" alt="'.$image->title.'" title="'.$image->title.'" style="max-height:48px;margin:0 auto;" /></li>'; |
|
| 1059 | 1059 | $slides++; |
| 1060 | 1060 | } |
| 1061 | 1061 | }// endfore |
@@ -1090,7 +1090,7 @@ discard block |
||
| 1090 | 1090 | */ |
| 1091 | 1091 | function geodir_action_details_taxonomies() |
| 1092 | 1092 | {
|
| 1093 | - global $preview, $post;?> |
|
| 1093 | + global $preview, $post; ?> |
|
| 1094 | 1094 | <p class="geodir_post_taxomomies clearfix"> |
| 1095 | 1095 | <?php |
| 1096 | 1096 | $taxonomies = array(); |
@@ -1099,11 +1099,11 @@ discard block |
||
| 1099 | 1099 | |
| 1100 | 1100 | if ($preview && !$is_backend_preview) {
|
| 1101 | 1101 | $post_type = $post->listing_type; |
| 1102 | - $post_taxonomy = $post_type . 'category'; |
|
| 1102 | + $post_taxonomy = $post_type.'category'; |
|
| 1103 | 1103 | $post->{$post_taxonomy} = $post->post_category[$post_taxonomy];
|
| 1104 | 1104 | } else {
|
| 1105 | 1105 | $post_type = $post->post_type; |
| 1106 | - $post_taxonomy = $post_type . 'category'; |
|
| 1106 | + $post_taxonomy = $post_type.'category'; |
|
| 1107 | 1107 | } |
| 1108 | 1108 | //{
|
| 1109 | 1109 | $post_type_info = get_post_type_object($post_type); |
@@ -1111,7 +1111,7 @@ discard block |
||
| 1111 | 1111 | |
| 1112 | 1112 | if (!empty($post->post_tags)) {
|
| 1113 | 1113 | |
| 1114 | - if (taxonomy_exists($post_type . '_tags')): |
|
| 1114 | + if (taxonomy_exists($post_type.'_tags')): |
|
| 1115 | 1115 | $links = array(); |
| 1116 | 1116 | $terms = array(); |
| 1117 | 1117 | // to limit post tags |
@@ -1138,8 +1138,8 @@ discard block |
||
| 1138 | 1138 | $post_term = trim($post_term); |
| 1139 | 1139 | |
| 1140 | 1140 | $priority_location = false; |
| 1141 | - if ($insert_term = term_exists($post_term, $post_type . '_tags')) {
|
|
| 1142 | - $term = get_term_by('id', $insert_term['term_id'], $post_type . '_tags');
|
|
| 1141 | + if ($insert_term = term_exists($post_term, $post_type.'_tags')) {
|
|
| 1142 | + $term = get_term_by('id', $insert_term['term_id'], $post_type.'_tags');
|
|
| 1143 | 1143 | } else {
|
| 1144 | 1144 | $post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL; |
| 1145 | 1145 | $post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL; |
@@ -1149,10 +1149,10 @@ discard block |
||
| 1149 | 1149 | $match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false; |
| 1150 | 1150 | if ($match_country || $match_region || $match_city) {
|
| 1151 | 1151 | $priority_location = true; |
| 1152 | - $term = get_term_by('name', $post_term, $post_type . '_tags');
|
|
| 1152 | + $term = get_term_by('name', $post_term, $post_type.'_tags');
|
|
| 1153 | 1153 | } else {
|
| 1154 | - $insert_term = wp_insert_term($post_term, $post_type . '_tags'); |
|
| 1155 | - $term = get_term_by('name', $post_term, $post_type . '_tags');
|
|
| 1154 | + $insert_term = wp_insert_term($post_term, $post_type.'_tags'); |
|
| 1155 | + $term = get_term_by('name', $post_term, $post_type.'_tags');
|
|
| 1156 | 1156 | } |
| 1157 | 1157 | } |
| 1158 | 1158 | |
@@ -1169,12 +1169,12 @@ discard block |
||
| 1169 | 1169 | * @param string $tag_link The tag link html. |
| 1170 | 1170 | * @param object $term The tag term object. |
| 1171 | 1171 | */ |
| 1172 | - $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
|
|
| 1172 | + $tag_link = apply_filters('geodir_details_taxonomies_tag_link', $tag_link, $term);
|
|
| 1173 | 1173 | $links[] = $tag_link; |
| 1174 | 1174 | } else {
|
| 1175 | - $tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>"; |
|
| 1175 | + $tag_link = "<a href='".esc_attr(get_term_link($term->term_id, $term->taxonomy))."'>$term->name</a>"; |
|
| 1176 | 1176 | /** This action is documented in geodirectory-template_actions.php */ |
| 1177 | - $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
|
|
| 1177 | + $tag_link = apply_filters('geodir_details_taxonomies_tag_link', $tag_link, $term);
|
|
| 1178 | 1178 | $links[] = $tag_link; |
| 1179 | 1179 | } |
| 1180 | 1180 | $terms[] = $term; |
@@ -1184,7 +1184,7 @@ discard block |
||
| 1184 | 1184 | if (!isset($listing_label)) {
|
| 1185 | 1185 | $listing_label = ''; |
| 1186 | 1186 | } |
| 1187 | - $taxonomies[$post_type . '_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
|
|
| 1187 | + $taxonomies[$post_type.'_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object) $terms);
|
|
| 1188 | 1188 | endif; |
| 1189 | 1189 | |
| 1190 | 1190 | } |
@@ -1212,7 +1212,7 @@ discard block |
||
| 1212 | 1212 | $term = get_term_by('id', $post_term, $post_taxonomy);
|
| 1213 | 1213 | |
| 1214 | 1214 | if (is_object($term)) {
|
| 1215 | - $term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>"; |
|
| 1215 | + $term_link = "<a href='".esc_attr(get_term_link($term, $post_taxonomy))."'>$term->name</a>"; |
|
| 1216 | 1216 | /** |
| 1217 | 1217 | * Filter the category name on the details page. |
| 1218 | 1218 | * |
@@ -1220,7 +1220,7 @@ discard block |
||
| 1220 | 1220 | * @param string $term_link The link html to the category. |
| 1221 | 1221 | * @param object $term The category term object. |
| 1222 | 1222 | */ |
| 1223 | - $term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term);
|
|
| 1223 | + $term_link = apply_filters('geodir_details_taxonomies_cat_link', $term_link, $term);
|
|
| 1224 | 1224 | $links[] = $term_link; |
| 1225 | 1225 | $terms[] = $term; |
| 1226 | 1226 | } |
@@ -1238,7 +1238,7 @@ discard block |
||
| 1238 | 1238 | if (!isset($listing_label)) {
|
| 1239 | 1239 | $listing_label = ''; |
| 1240 | 1240 | } |
| 1241 | - $taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
|
|
| 1241 | + $taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object) $terms);
|
|
| 1242 | 1242 | |
| 1243 | 1243 | } |
| 1244 | 1244 | |
@@ -1251,14 +1251,14 @@ discard block |
||
| 1251 | 1251 | * @param string $listing_label The post type label. |
| 1252 | 1252 | * @param string $listing_label The post type label with ucwords function. |
| 1253 | 1253 | */ |
| 1254 | - $taxonomies = apply_filters('geodir_details_taxonomies_output',$taxonomies,$post_type,$listing_label,geodir_ucwords($listing_label));
|
|
| 1254 | + $taxonomies = apply_filters('geodir_details_taxonomies_output', $taxonomies, $post_type, $listing_label, geodir_ucwords($listing_label));
|
|
| 1255 | 1255 | |
| 1256 | 1256 | if (isset($taxonomies[$post_taxonomy])) {
|
| 1257 | - echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>'; |
|
| 1257 | + echo '<span class="geodir-category">'.$taxonomies[$post_taxonomy].'</span>'; |
|
| 1258 | 1258 | } |
| 1259 | 1259 | |
| 1260 | - if (isset($taxonomies[$post_type . '_tags'])) |
|
| 1261 | - echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>'; |
|
| 1260 | + if (isset($taxonomies[$post_type.'_tags'])) |
|
| 1261 | + echo '<span class="geodir-tags">'.$taxonomies[$post_type.'_tags'].'</span>'; |
|
| 1262 | 1262 | |
| 1263 | 1263 | ?> |
| 1264 | 1264 | </p><?php |
@@ -1279,11 +1279,11 @@ discard block |
||
| 1279 | 1279 | * @param object $post Optional. The post object or blank. |
| 1280 | 1280 | * @package GeoDirectory |
| 1281 | 1281 | */ |
| 1282 | -function geodir_action_details_micordata($post='') |
|
| 1282 | +function geodir_action_details_micordata($post = '') |
|
| 1283 | 1283 | {
|
| 1284 | 1284 | |
| 1285 | 1285 | global $preview; |
| 1286 | - if(empty($post)){global $post;}
|
|
| 1286 | + if (empty($post)) {global $post; }
|
|
| 1287 | 1287 | if ($preview || !geodir_is_page('detail')) {
|
| 1288 | 1288 | return; |
| 1289 | 1289 | } |
@@ -1304,7 +1304,7 @@ discard block |
||
| 1304 | 1304 | "description" => $review->comment_content, |
| 1305 | 1305 | "reviewRating" => array( |
| 1306 | 1306 | "@type" => "Rating", |
| 1307 | - "bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score. |
|
| 1307 | + "bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score. |
|
| 1308 | 1308 | "ratingValue" => geodir_get_commentoverall($review->comment_ID), |
| 1309 | 1309 | "worstRating" => "1" |
| 1310 | 1310 | ) |
@@ -1332,13 +1332,13 @@ discard block |
||
| 1332 | 1332 | } |
| 1333 | 1333 | //print_r($post); |
| 1334 | 1334 | // external links |
| 1335 | - $external_links = array(); |
|
| 1335 | + $external_links = array(); |
|
| 1336 | 1336 | $external_links[] = $post->geodir_website; |
| 1337 | 1337 | $external_links[] = $post->geodir_twitter; |
| 1338 | 1338 | $external_links[] = $post->geodir_facebook; |
| 1339 | 1339 | $external_links = array_filter($external_links); |
| 1340 | 1340 | |
| 1341 | - if(!empty($external_links)){
|
|
| 1341 | + if (!empty($external_links)) {
|
|
| 1342 | 1342 | $external_links = array_values($external_links); |
| 1343 | 1343 | } |
| 1344 | 1344 | |
@@ -1348,17 +1348,17 @@ discard block |
||
| 1348 | 1348 | |
| 1349 | 1349 | // schema type |
| 1350 | 1350 | $schema_type = 'LocalBusiness'; |
| 1351 | - if(isset($post->default_category) && $post->default_category){
|
|
| 1351 | + if (isset($post->default_category) && $post->default_category) {
|
|
| 1352 | 1352 | $cat_schema = get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type); |
| 1353 | - if($cat_schema){$schema_type = $cat_schema;}
|
|
| 1354 | - if(!$schema_type && $post->post_type=='gd_event'){$schema_type = 'Event';}
|
|
| 1353 | + if ($cat_schema) {$schema_type = $cat_schema; }
|
|
| 1354 | + if (!$schema_type && $post->post_type == 'gd_event') {$schema_type = 'Event'; }
|
|
| 1355 | 1355 | } |
| 1356 | 1356 | |
| 1357 | 1357 | $schema = array(); |
| 1358 | 1358 | $schema['@context'] = "http://schema.org"; |
| 1359 | 1359 | $schema['@type'] = $schema_type; |
| 1360 | 1360 | $schema['name'] = $post->post_name; |
| 1361 | - $schema['description'] = wp_strip_all_tags( $post->post_content, true ); |
|
| 1361 | + $schema['description'] = wp_strip_all_tags($post->post_content, true); |
|
| 1362 | 1362 | $schema['telephone'] = $post->geodir_contact; |
| 1363 | 1363 | $schema['url'] = $c_url; |
| 1364 | 1364 | $schema['sameAs'] = $external_links; |
@@ -1372,7 +1372,7 @@ discard block |
||
| 1372 | 1372 | "postalCode" => $post->post_zip |
| 1373 | 1373 | ); |
| 1374 | 1374 | |
| 1375 | - if($post->post_latitude && $post->post_longitude) {
|
|
| 1375 | + if ($post->post_latitude && $post->post_longitude) {
|
|
| 1376 | 1376 | $schema['geo'] = array( |
| 1377 | 1377 | "@type" => "GeoCoordinates", |
| 1378 | 1378 | "latitude" => $post->post_latitude, |
@@ -1380,7 +1380,7 @@ discard block |
||
| 1380 | 1380 | ); |
| 1381 | 1381 | } |
| 1382 | 1382 | |
| 1383 | - if($post_avgratings) {
|
|
| 1383 | + if ($post_avgratings) {
|
|
| 1384 | 1384 | $schema['aggregateRating'] = array( |
| 1385 | 1385 | "@type" => "AggregateRating", |
| 1386 | 1386 | "ratingValue" => $post_avgratings, |
@@ -1399,10 +1399,10 @@ discard block |
||
| 1399 | 1399 | * @param array $schema The array of schema data to be filtered. |
| 1400 | 1400 | * @param object $post The post object. |
| 1401 | 1401 | */ |
| 1402 | - $schema = apply_filters('geodir_details_schema', $schema,$post);
|
|
| 1402 | + $schema = apply_filters('geodir_details_schema', $schema, $post);
|
|
| 1403 | 1403 | |
| 1404 | 1404 | |
| 1405 | - echo '<script type="application/ld+json">' . json_encode($schema) . '</script>'; |
|
| 1405 | + echo '<script type="application/ld+json">'.json_encode($schema).'</script>'; |
|
| 1406 | 1406 | |
| 1407 | 1407 | } |
| 1408 | 1408 | |
@@ -1423,9 +1423,9 @@ discard block |
||
| 1423 | 1423 | ?> |
| 1424 | 1424 | <div class="geodir-pos_navigation clearfix"> |
| 1425 | 1425 | <div |
| 1426 | - class="geodir-post_left"><?php previous_post_link('%link', '' . __('Previous', 'geodirectory'), false) ?></div>
|
|
| 1426 | + class="geodir-post_left"><?php previous_post_link('%link', ''.__('Previous', 'geodirectory'), false) ?></div>
|
|
| 1427 | 1427 | <div |
| 1428 | - class="geodir-post_right"><?php next_post_link('%link', __('Next', 'geodirectory') . '', false) ?></div>
|
|
| 1428 | + class="geodir-post_right"><?php next_post_link('%link', __('Next', 'geodirectory').'', false) ?></div>
|
|
| 1429 | 1429 | </div><?php |
| 1430 | 1430 | } |
| 1431 | 1431 | |
@@ -1494,12 +1494,12 @@ discard block |
||
| 1494 | 1494 | $gd_post_type = geodir_get_current_posttype(); |
| 1495 | 1495 | $post_type_info = get_post_type_object($gd_post_type); |
| 1496 | 1496 | |
| 1497 | - $add_string_in_title = __('All', 'geodirectory') . ' ';
|
|
| 1497 | + $add_string_in_title = __('All', 'geodirectory').' ';
|
|
| 1498 | 1498 | if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
|
| 1499 | - $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
|
|
| 1499 | + $add_string_in_title = __('My Favorite', 'geodirectory').' ';
|
|
| 1500 | 1500 | } |
| 1501 | 1501 | |
| 1502 | - $list_title = $add_string_in_title . __(ucfirst($post_type_info->labels->name), 'geodirectory'); |
|
| 1502 | + $list_title = $add_string_in_title.__(ucfirst($post_type_info->labels->name), 'geodirectory'); |
|
| 1503 | 1503 | $single_name = $post_type_info->labels->singular_name; |
| 1504 | 1504 | |
| 1505 | 1505 | $taxonomy = geodir_get_taxonomies($gd_post_type, true); |
@@ -1527,12 +1527,12 @@ discard block |
||
| 1527 | 1527 | $current_term = get_term_by('slug', $term, $taxonomy[0]);
|
| 1528 | 1528 | if (!empty($current_term)) {
|
| 1529 | 1529 | $current_term_name = __(ucfirst($current_term->name), 'geodirectory'); |
| 1530 | - if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
|
|
| 1530 | + if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type.'category') {
|
|
| 1531 | 1531 | $location_last_char = substr($location_name, -1); |
| 1532 | 1532 | $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
|
| 1533 | - $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
|
|
| 1533 | + $list_title .= __(' in', 'geodirectory').' '.$location_name.$location_name_attach.' '.$current_term_name;
|
|
| 1534 | 1534 | } else {
|
| 1535 | - $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
|
|
| 1535 | + $list_title .= __(' in', 'geodirectory')." '".$current_term_name."'";
|
|
| 1536 | 1536 | } |
| 1537 | 1537 | } else {
|
| 1538 | 1538 | if (count($taxonomy) > 1) {
|
@@ -1540,12 +1540,12 @@ discard block |
||
| 1540 | 1540 | |
| 1541 | 1541 | if (!empty($current_term)) {
|
| 1542 | 1542 | $current_term_name = __(ucfirst($current_term->name), 'geodirectory'); |
| 1543 | - if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
|
|
| 1543 | + if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type.'category') {
|
|
| 1544 | 1544 | $location_last_char = substr($location_name, -1); |
| 1545 | 1545 | $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
|
| 1546 | - $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
|
|
| 1546 | + $list_title .= __(' in', 'geodirectory').' '.$location_name.$location_name_attach.' '.$current_term_name;
|
|
| 1547 | 1547 | } else {
|
| 1548 | - $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
|
|
| 1548 | + $list_title .= __(' in', 'geodirectory')." '".$current_term_name."'";
|
|
| 1549 | 1549 | } |
| 1550 | 1550 | } |
| 1551 | 1551 | } |
@@ -1573,7 +1573,7 @@ discard block |
||
| 1573 | 1573 | $gd_city = __(geodir_ucwords($gd_city), 'geodirectory'); |
| 1574 | 1574 | } |
| 1575 | 1575 | |
| 1576 | - $list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'";
|
|
| 1576 | + $list_title .= __(' in', 'geodirectory')." '".$gd_city."'";
|
|
| 1577 | 1577 | } else if ($gd_region != '') {
|
| 1578 | 1578 | if ($gd_region_actual != '') {
|
| 1579 | 1579 | $gd_region = $gd_region_actual; |
@@ -1583,7 +1583,7 @@ discard block |
||
| 1583 | 1583 | $gd_region = __(geodir_ucwords($gd_region), 'geodirectory'); |
| 1584 | 1584 | } |
| 1585 | 1585 | |
| 1586 | - $list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'";
|
|
| 1586 | + $list_title .= __(' in', 'geodirectory')." '".$gd_region."'";
|
|
| 1587 | 1587 | } else if ($gd_country != '') {
|
| 1588 | 1588 | if ($gd_country_actual != '') {
|
| 1589 | 1589 | $gd_country = $gd_country_actual; |
@@ -1593,12 +1593,12 @@ discard block |
||
| 1593 | 1593 | $gd_country = __(geodir_ucwords($gd_country), 'geodirectory'); |
| 1594 | 1594 | } |
| 1595 | 1595 | |
| 1596 | - $list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'";
|
|
| 1596 | + $list_title .= __(' in', 'geodirectory')." '".$gd_country."'";
|
|
| 1597 | 1597 | } |
| 1598 | 1598 | } |
| 1599 | 1599 | |
| 1600 | 1600 | if (is_search()) {
|
| 1601 | - $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
|
|
| 1601 | + $list_title = __('Search', 'geodirectory').' '.__(ucfirst($post_type_info->labels->name), 'geodirectory').__(' For :', 'geodirectory')." '".get_search_query()."'";
|
|
| 1602 | 1602 | } |
| 1603 | 1603 | /** This action is documented in geodirectory_template_actions.php */ |
| 1604 | 1604 | $class = apply_filters('geodir_page_title_class', 'entry-title fn');
|
@@ -1607,26 +1607,26 @@ discard block |
||
| 1607 | 1607 | |
| 1608 | 1608 | |
| 1609 | 1609 | $title = $list_title; |
| 1610 | - if(geodir_is_page('pt')){
|
|
| 1610 | + if (geodir_is_page('pt')) {
|
|
| 1611 | 1611 | $gd_page = 'pt'; |
| 1612 | - $title = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
|
|
| 1612 | + $title = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
|
|
| 1613 | 1613 | } |
| 1614 | - elseif(geodir_is_page('listing')){
|
|
| 1614 | + elseif (geodir_is_page('listing')) {
|
|
| 1615 | 1615 | $gd_page = 'listing'; |
| 1616 | 1616 | global $wp_query; |
| 1617 | 1617 | $current_term = $wp_query->get_queried_object(); |
| 1618 | - if (strpos($current_term->taxonomy,'_tags') !== false) {
|
|
| 1618 | + if (strpos($current_term->taxonomy, '_tags') !== false) {
|
|
| 1619 | 1619 | $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
|
| 1620 | - }else{
|
|
| 1620 | + } else {
|
|
| 1621 | 1621 | $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
|
| 1622 | 1622 | } |
| 1623 | 1623 | |
| 1624 | 1624 | } |
| 1625 | - elseif(geodir_is_page('author')){
|
|
| 1625 | + elseif (geodir_is_page('author')) {
|
|
| 1626 | 1626 | $gd_page = 'author'; |
| 1627 | - if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
|
|
| 1627 | + if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
|
|
| 1628 | 1628 | $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
|
| 1629 | - }else{
|
|
| 1629 | + } else {
|
|
| 1630 | 1630 | $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
|
| 1631 | 1631 | } |
| 1632 | 1632 | |
@@ -1640,16 +1640,16 @@ discard block |
||
| 1640 | 1640 | * @param string $title The page title including variables. |
| 1641 | 1641 | * @param string $gd_page The GeoDirectory page type if any. |
| 1642 | 1642 | */ |
| 1643 | - $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 1643 | + $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 1644 | 1644 | |
| 1645 | - echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
|
| 1645 | + echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'. |
|
| 1646 | 1646 | /** |
| 1647 | 1647 | * Filter the listing page title. |
| 1648 | 1648 | * |
| 1649 | 1649 | * @since 1.0.0 |
| 1650 | 1650 | * @param string $list_title The title for the category page. |
| 1651 | 1651 | */ |
| 1652 | - apply_filters('geodir_listing_page_title', $title) . '</h1></header>';
|
|
| 1652 | + apply_filters('geodir_listing_page_title', $title).'</h1></header>';
|
|
| 1653 | 1653 | } |
| 1654 | 1654 | |
| 1655 | 1655 | add_action('geodir_listings_page_description', 'geodir_action_listings_description', 10);
|
@@ -1668,7 +1668,7 @@ discard block |
||
| 1668 | 1668 | $gd_post_type = geodir_get_current_posttype(); |
| 1669 | 1669 | if (isset($current_term->term_id) && $current_term->term_id != '') {
|
| 1670 | 1670 | |
| 1671 | - $term_desc = term_description($current_term->term_id, $gd_post_type . '_tags'); |
|
| 1671 | + $term_desc = term_description($current_term->term_id, $gd_post_type.'_tags'); |
|
| 1672 | 1672 | $saved_data = stripslashes(get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type)); |
| 1673 | 1673 | if ($term_desc && !$saved_data) {
|
| 1674 | 1674 | $saved_data = $term_desc; |
@@ -1685,7 +1685,7 @@ discard block |
||
| 1685 | 1685 | if ($cat_description) {
|
| 1686 | 1686 | ?> |
| 1687 | 1687 | |
| 1688 | - <div class="term_description"><?php echo $cat_description;?></div> <?php |
|
| 1688 | + <div class="term_description"><?php echo $cat_description; ?></div> <?php |
|
| 1689 | 1689 | } |
| 1690 | 1690 | |
| 1691 | 1691 | } |
@@ -1735,13 +1735,13 @@ discard block |
||
| 1735 | 1735 | function geodir_action_sidebar_left_open($type = '', $id = '', $class = '', $itemtype = '') |
| 1736 | 1736 | {
|
| 1737 | 1737 | if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
|
| 1738 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 1738 | + $width_css = 'style="width:'.$width.'%;"'; |
|
| 1739 | 1739 | } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
|
| 1740 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 1740 | + $width_css = 'style="width:'.$width.'%;"'; |
|
| 1741 | 1741 | } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
|
| 1742 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 1742 | + $width_css = 'style="width:'.$width.'%;"'; |
|
| 1743 | 1743 | } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
|
| 1744 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 1744 | + $width_css = 'style="width:'.$width.'%;"'; |
|
| 1745 | 1745 | } else {
|
| 1746 | 1746 | $width_css = ''; |
| 1747 | 1747 | } |
@@ -2046,11 +2046,11 @@ discard block |
||
| 2046 | 2046 | |
| 2047 | 2047 | $title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
|
| 2048 | 2048 | |
| 2049 | - if(geodir_is_page('add-listing')){
|
|
| 2049 | + if (geodir_is_page('add-listing')) {
|
|
| 2050 | 2050 | $gd_page = 'add-listing'; |
| 2051 | - if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
|
|
| 2051 | + if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 2052 | 2052 | $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
|
| 2053 | - }elseif(isset($listing_type)){
|
|
| 2053 | + }elseif (isset($listing_type)) {
|
|
| 2054 | 2054 | $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
|
| 2055 | 2055 | } |
| 2056 | 2056 | |
@@ -2064,9 +2064,9 @@ discard block |
||
| 2064 | 2064 | * @param string $title The page title including variables. |
| 2065 | 2065 | * @param string $gd_page The GeoDirectory page type if any. |
| 2066 | 2066 | */ |
| 2067 | - $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 2067 | + $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 2068 | 2068 | |
| 2069 | - echo '<header class="' . $class_header . '"><h1 class="' . $class . '">'; |
|
| 2069 | + echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'; |
|
| 2070 | 2070 | echo $title; |
| 2071 | 2071 | echo '</h1></header>'; |
| 2072 | 2072 | } |
@@ -2080,7 +2080,7 @@ discard block |
||
| 2080 | 2080 | */ |
| 2081 | 2081 | function geodir_action_add_listing_page_mandatory() |
| 2082 | 2082 | {?>
|
| 2083 | - <p class="geodir-note "><span class="geodir-required">*</span> <?php echo INDICATES_MANDATORY_FIELDS_TEXT;?></p> |
|
| 2083 | + <p class="geodir-note "><span class="geodir-required">*</span> <?php echo INDICATES_MANDATORY_FIELDS_TEXT; ?></p> |
|
| 2084 | 2084 | <?php |
| 2085 | 2085 | } |
| 2086 | 2086 | |
@@ -2115,7 +2115,7 @@ discard block |
||
| 2115 | 2115 | |
| 2116 | 2116 | if (isset($_REQUEST['backandedit'])) {
|
| 2117 | 2117 | global $post; |
| 2118 | - $post = (object)$gd_session->get('listing');
|
|
| 2118 | + $post = (object) $gd_session->get('listing');
|
|
| 2119 | 2119 | $listing_type = $post->listing_type; |
| 2120 | 2120 | $title = $post->post_title; |
| 2121 | 2121 | $desc = $post->post_desc; |
@@ -2130,7 +2130,7 @@ discard block |
||
| 2130 | 2130 | $thumb_img_arr = geodir_get_images($post->ID); |
| 2131 | 2131 | if ($thumb_img_arr) {
|
| 2132 | 2132 | foreach ($thumb_img_arr as $post_img) {
|
| 2133 | - $curImages .= $post_img->src . ','; |
|
| 2133 | + $curImages .= $post_img->src.','; |
|
| 2134 | 2134 | } |
| 2135 | 2135 | } |
| 2136 | 2136 | |
@@ -2138,7 +2138,7 @@ discard block |
||
| 2138 | 2138 | $title = $post->post_title; |
| 2139 | 2139 | $desc = $post->post_content; |
| 2140 | 2140 | $kw_tags = $post->post_tags; |
| 2141 | - $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
|
|
| 2141 | + $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type.'_tags', array('fields' => 'names')));
|
|
| 2142 | 2142 | } else {
|
| 2143 | 2143 | $listing_type = sanitize_text_field($_REQUEST['listing_type']); |
| 2144 | 2144 | } |
@@ -2149,18 +2149,18 @@ discard block |
||
| 2149 | 2149 | |
| 2150 | 2150 | $post_type_info = geodir_get_posttype_info($listing_type); |
| 2151 | 2151 | |
| 2152 | - $cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? $post_type_info['labels']['singular_name'] : __('Listing','geodirectory');
|
|
| 2152 | + $cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? $post_type_info['labels']['singular_name'] : __('Listing', 'geodirectory');
|
|
| 2153 | 2153 | |
| 2154 | 2154 | ?> |
| 2155 | - <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id());?>" method="post" enctype="multipart/form-data"> |
|
| 2156 | - <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type);?>"/> |
|
| 2157 | - <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type);?>"/> |
|
| 2155 | + <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id()); ?>" method="post" enctype="multipart/form-data"> |
|
| 2156 | + <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type); ?>"/> |
|
| 2157 | + <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type); ?>"/> |
|
| 2158 | 2158 | <?php if ($page_id) { ?>
|
| 2159 | - <input type="hidden" name="add_listing_page_id" value="<?php echo $page_id;?>"/> |
|
| 2159 | + <input type="hidden" name="add_listing_page_id" value="<?php echo $page_id; ?>"/> |
|
| 2160 | 2160 | <?php } if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { ?>
|
| 2161 | - <input type="hidden" name="pid" value="<?php echo sanitize_text_field($_REQUEST['pid']);?>"/> |
|
| 2161 | + <input type="hidden" name="pid" value="<?php echo sanitize_text_field($_REQUEST['pid']); ?>"/> |
|
| 2162 | 2162 | <?php } if (isset($_REQUEST['backandedit'])) { ?>
|
| 2163 | - <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']);?>"/> |
|
| 2163 | + <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']); ?>"/> |
|
| 2164 | 2164 | <?php |
| 2165 | 2165 | } |
| 2166 | 2166 | /** |
@@ -2172,7 +2172,7 @@ discard block |
||
| 2172 | 2172 | */ |
| 2173 | 2173 | do_action('geodir_before_detail_fields');
|
| 2174 | 2174 | ?> |
| 2175 | - <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT;?></h5> |
|
| 2175 | + <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT; ?></h5> |
|
| 2176 | 2176 | <?php |
| 2177 | 2177 | /** |
| 2178 | 2178 | * Called at the top of the add listing page form for frontend. |
@@ -2184,10 +2184,10 @@ discard block |
||
| 2184 | 2184 | do_action('geodir_before_main_form_fields');
|
| 2185 | 2185 | ?> |
| 2186 | 2186 | <div id="geodir_post_title_row" class="required_field geodir_form_row clearfix gd-fieldset-details"> |
| 2187 | - <label><?php echo sprintf( __('%s Title', 'geodirectory'), $cpt_singular_name ); ?><span>*</span> </label>
|
|
| 2187 | + <label><?php echo sprintf(__('%s Title', 'geodirectory'), $cpt_singular_name); ?><span>*</span> </label>
|
|
| 2188 | 2188 | <input type="text" field_type="text" name="post_title" id="post_title" class="geodir_textfield" |
| 2189 | 2189 | value="<?php echo esc_attr(stripslashes($title)); ?>"/> |
| 2190 | - <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory');?></span> |
|
| 2190 | + <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span> |
|
| 2191 | 2191 | </div> |
| 2192 | 2192 | <?php |
| 2193 | 2193 | $show_editor = get_option('geodir_tiny_editor_on_add_listing');
|
@@ -2222,7 +2222,7 @@ discard block |
||
| 2222 | 2222 | $desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
|
| 2223 | 2223 | |
| 2224 | 2224 | $desc_class = ''; |
| 2225 | - if ($desc_limit === '' || (int)$desc_limit > 0) {
|
|
| 2225 | + if ($desc_limit === '' || (int) $desc_limit > 0) {
|
|
| 2226 | 2226 | /** |
| 2227 | 2227 | * Called on the add listing page form for frontend just before the description field. |
| 2228 | 2228 | * |
@@ -2235,8 +2235,8 @@ discard block |
||
| 2235 | 2235 | $desc_class = ' hidden'; |
| 2236 | 2236 | } |
| 2237 | 2237 | ?> |
| 2238 | - <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class;?>"> |
|
| 2239 | - <label><?php echo sprintf( __('%s Description', 'geodirectory'), $cpt_singular_name ); ?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
|
|
| 2238 | + <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class; ?>"> |
|
| 2239 | + <label><?php echo sprintf(__('%s Description', 'geodirectory'), $cpt_singular_name); ?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
|
|
| 2240 | 2240 | <?php |
| 2241 | 2241 | if (!empty($show_editor) && in_array($listing_type, $show_editor)) {
|
| 2242 | 2242 | $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
|
@@ -2245,16 +2245,16 @@ discard block |
||
| 2245 | 2245 | <?php wp_editor($desc, "post_desc", $editor_settings); ?> |
| 2246 | 2246 | </div> |
| 2247 | 2247 | <?php if ($desc_limit != '') { ?>
|
| 2248 | - <script type="text/javascript">jQuery('textarea#post_desc').attr('maxlength', "<?php echo $desc_limit;?>");</script>
|
|
| 2248 | + <script type="text/javascript">jQuery('textarea#post_desc').attr('maxlength', "<?php echo $desc_limit; ?>");</script>
|
|
| 2249 | 2249 | <?php } } else { ?>
|
| 2250 | 2250 | <textarea field_type="textarea" name="post_desc" id="post_desc" class="geodir_textarea" maxlength="<?php echo $desc_limit; ?>"><?php echo $desc; ?></textarea> |
| 2251 | 2251 | <?php } if ($desc_limit_msg != '') { ?>
|
| 2252 | 2252 | <span class="geodir_message_note"><?php echo $desc_limit_msg; ?></span> |
| 2253 | 2253 | <?php } ?> |
| 2254 | - <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory');?></span> |
|
| 2254 | + <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory'); ?></span> |
|
| 2255 | 2255 | </div> |
| 2256 | 2256 | <?php |
| 2257 | - if ($desc_limit === '' || (int)$desc_limit > 0) {
|
|
| 2257 | + if ($desc_limit === '' || (int) $desc_limit > 0) {
|
|
| 2258 | 2258 | /** |
| 2259 | 2259 | * Called on the add listing page form for frontend just after the description field. |
| 2260 | 2260 | * |
@@ -2293,7 +2293,7 @@ discard block |
||
| 2293 | 2293 | $kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
|
| 2294 | 2294 | |
| 2295 | 2295 | $tags_class = ''; |
| 2296 | - if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
|
|
| 2296 | + if ($kw_tags_count === '' || (int) $kw_tags_count > 0) {
|
|
| 2297 | 2297 | /** |
| 2298 | 2298 | * Called on the add listing page form for frontend just before the tags field. |
| 2299 | 2299 | * |
@@ -2304,14 +2304,14 @@ discard block |
||
| 2304 | 2304 | $tags_class = ' hidden'; |
| 2305 | 2305 | } |
| 2306 | 2306 | ?> |
| 2307 | - <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class;?>"> |
|
| 2307 | + <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class; ?>"> |
|
| 2308 | 2308 | <label><?php echo TAGKW_TEXT; ?></label> |
| 2309 | 2309 | <input name="post_tags" id="post_tags" value="<?php echo $kw_tags; ?>" type="text" class="geodir_textfield" |
| 2310 | - maxlength="<?php echo $kw_tags_count;?>"/> |
|
| 2311 | - <span class="geodir_message_note"><?php echo $kw_tags_msg;?></span> |
|
| 2310 | + maxlength="<?php echo $kw_tags_count; ?>"/> |
|
| 2311 | + <span class="geodir_message_note"><?php echo $kw_tags_msg; ?></span> |
|
| 2312 | 2312 | </div> |
| 2313 | 2313 | <?php |
| 2314 | - if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
|
|
| 2314 | + if ($kw_tags_count === '' || (int) $kw_tags_count > 0) {
|
|
| 2315 | 2315 | /** |
| 2316 | 2316 | * Called on the add listing page form for frontend just after the tags field. |
| 2317 | 2317 | * |
@@ -2337,7 +2337,7 @@ discard block |
||
| 2337 | 2337 | $thumb_img_arr = array(); |
| 2338 | 2338 | $totImg = 0; |
| 2339 | 2339 | if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
|
| 2340 | - $post = (object)$gd_session->get('listing');
|
|
| 2340 | + $post = (object) $gd_session->get('listing');
|
|
| 2341 | 2341 | if (isset($post->post_images)) |
| 2342 | 2342 | $curImages = trim($post->post_images, ","); |
| 2343 | 2343 | |
@@ -2350,7 +2350,7 @@ discard block |
||
| 2350 | 2350 | $listing_type = $post->listing_type; |
| 2351 | 2351 | |
| 2352 | 2352 | } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
| 2353 | - $post = geodir_get_post_info((int)$_REQUEST['pid']); |
|
| 2353 | + $post = geodir_get_post_info((int) $_REQUEST['pid']); |
|
| 2354 | 2354 | $listing_type = $post->post_type; |
| 2355 | 2355 | $thumb_img_arr = geodir_get_images($_REQUEST['pid']); |
| 2356 | 2356 | |
@@ -2364,7 +2364,7 @@ discard block |
||
| 2364 | 2364 | //$curImages = $img->src.","; |
| 2365 | 2365 | } |
| 2366 | 2366 | |
| 2367 | - $totImg = count((array)$thumb_img_arr); |
|
| 2367 | + $totImg = count((array) $thumb_img_arr); |
|
| 2368 | 2368 | } |
| 2369 | 2369 | |
| 2370 | 2370 | if ($curImages != '') |
@@ -2385,15 +2385,15 @@ discard block |
||
| 2385 | 2385 | if ($show_image_input_box) {
|
| 2386 | 2386 | ?> |
| 2387 | 2387 | |
| 2388 | - <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT;?> |
|
| 2388 | + <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT; ?> |
|
| 2389 | 2389 | <?php if ($image_limit == 1) {
|
| 2390 | - echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
|
|
| 2390 | + echo '<br /><small>('.__('You can upload', 'geodirectory').' '.$image_limit.' '.__('image with this package', 'geodirectory').')</small>';
|
|
| 2391 | 2391 | } ?> |
| 2392 | 2392 | <?php if ($image_limit > 1) {
|
| 2393 | - echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
|
|
| 2393 | + echo '<br /><small>('.__('You can upload', 'geodirectory').' '.$image_limit.' '.__('images with this package', 'geodirectory').')</small>';
|
|
| 2394 | 2394 | } ?> |
| 2395 | 2395 | <?php if ($image_limit == '') {
|
| 2396 | - echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
|
|
| 2396 | + echo '<br /><small>('.__('You can upload unlimited images with this package', 'geodirectory').')</small>';
|
|
| 2397 | 2397 | } ?> |
| 2398 | 2398 | </h5> |
| 2399 | 2399 | |
@@ -2408,11 +2408,11 @@ discard block |
||
| 2408 | 2408 | <div |
| 2409 | 2409 | class="plupload-upload-uic hide-if-no-js <?php if ($multiple): ?>plupload-upload-uic-multiple<?php endif; ?>" |
| 2410 | 2410 | id="<?php echo $id; ?>plupload-upload-ui"> |
| 2411 | - <h4><?php _e('Drop files to upload', 'geodirectory');?></h4><br/>
|
|
| 2411 | + <h4><?php _e('Drop files to upload', 'geodirectory'); ?></h4><br/>
|
|
| 2412 | 2412 | <input id="<?php echo $id; ?>plupload-browse-button" type="button" |
| 2413 | 2413 | value="<?php esc_attr_e('Select Files', 'geodirectory'); ?>" class="geodir_button"/>
|
| 2414 | 2414 | <span class="ajaxnonceplu" |
| 2415 | - id="ajaxnonceplu<?php echo wp_create_nonce($id . 'pluploadan'); ?>"></span> |
|
| 2415 | + id="ajaxnonceplu<?php echo wp_create_nonce($id.'pluploadan'); ?>"></span> |
|
| 2416 | 2416 | <?php if ($width && $height): ?> |
| 2417 | 2417 | <span class="plupload-resize"></span> |
| 2418 | 2418 | <span class="plupload-width" id="plupload-width<?php echo $width; ?>"></span> |
@@ -2425,7 +2425,7 @@ discard block |
||
| 2425 | 2425 | id="<?php echo $id; ?>plupload-thumbs" style="border-top:1px solid #ccc; padding-top:10px;"> |
| 2426 | 2426 | </div> |
| 2427 | 2427 | <span |
| 2428 | - id="upload-msg"><?php _e('Please drag & drop the images to rearrange the order', 'geodirectory');?></span>
|
|
| 2428 | + id="upload-msg"><?php _e('Please drag & drop the images to rearrange the order', 'geodirectory'); ?></span>
|
|
| 2429 | 2429 | <span id="<?php echo $id; ?>upload-error" style="display:none"></span> |
| 2430 | 2430 | </div> |
| 2431 | 2431 | |
@@ -2437,7 +2437,7 @@ discard block |
||
| 2437 | 2437 | * |
| 2438 | 2438 | * @since 1.0.0 |
| 2439 | 2439 | */ |
| 2440 | - do_action('geodir_after_main_form_fields');?>
|
|
| 2440 | + do_action('geodir_after_main_form_fields'); ?>
|
|
| 2441 | 2441 | |
| 2442 | 2442 | |
| 2443 | 2443 | <!-- add captcha code --> |
@@ -2448,7 +2448,7 @@ discard block |
||
| 2448 | 2448 | </script> |
| 2449 | 2449 | <noscript> |
| 2450 | 2450 | <div> |
| 2451 | - <label><?php _e('Type 64 into this box', 'geodirectory');?></label>
|
|
| 2451 | + <label><?php _e('Type 64 into this box', 'geodirectory'); ?></label>
|
|
| 2452 | 2452 | <input type="text" id="geodir_spamblocker_top_form" name="geodir_spamblocker" value="" maxlength="10"/> |
| 2453 | 2453 | </div> |
| 2454 | 2454 | </noscript> |
@@ -2458,10 +2458,10 @@ discard block |
||
| 2458 | 2458 | <!-- end captcha code --> |
| 2459 | 2459 | |
| 2460 | 2460 | <div id="geodir-add-listing-submit" class="geodir_form_row clear_both" style="padding:2px;text-align:center;"> |
| 2461 | - <input type="submit" value="<?php echo PRO_PREVIEW_BUTTON;?>" |
|
| 2462 | - class="geodir_button" <?php echo $submit_button;?>/> |
|
| 2461 | + <input type="submit" value="<?php echo PRO_PREVIEW_BUTTON; ?>" |
|
| 2462 | + class="geodir_button" <?php echo $submit_button; ?>/> |
|
| 2463 | 2463 | <span class="geodir_message_note" |
| 2464 | - style="padding-left:0px;"> <?php _e('Note: You will be able to see a preview in the next page', 'geodirectory');?></span>
|
|
| 2464 | + style="padding-left:0px;"> <?php _e('Note: You will be able to see a preview in the next page', 'geodirectory'); ?></span>
|
|
| 2465 | 2465 | </div> |
| 2466 | 2466 | |
| 2467 | 2467 | </form> |
@@ -2523,7 +2523,7 @@ discard block |
||
| 2523 | 2523 | class="<?php |
| 2524 | 2524 | /** This action is documented in geodirectory_template_actions.php */ |
| 2525 | 2525 | echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
|
| 2526 | - <?php dynamic_sidebar('Reg/Login Top Section');?>
|
|
| 2526 | + <?php dynamic_sidebar('Reg/Login Top Section'); ?>
|
|
| 2527 | 2527 | </div><!-- clearfix ends here--> |
| 2528 | 2528 | <?php |
| 2529 | 2529 | } |
@@ -2545,7 +2545,7 @@ discard block |
||
| 2545 | 2545 | |
| 2546 | 2546 | ?> |
| 2547 | 2547 | <script type="text/javascript"> |
| 2548 | - <?php if ( $user_login ) { ?>
|
|
| 2548 | + <?php if ($user_login) { ?>
|
|
| 2549 | 2549 | setTimeout(function () {
|
| 2550 | 2550 | try {
|
| 2551 | 2551 | d = document.getElementById('user_pass');
|
@@ -2562,7 +2562,7 @@ discard block |
||
| 2562 | 2562 | <?php } ?> |
| 2563 | 2563 | </script> |
| 2564 | 2564 | <script type="text/javascript"> |
| 2565 | - <?php if ( $user_login ) { ?>
|
|
| 2565 | + <?php if ($user_login) { ?>
|
|
| 2566 | 2566 | setTimeout(function () {
|
| 2567 | 2567 | try {
|
| 2568 | 2568 | d = document.getElementById('user_pass');
|
@@ -2587,7 +2587,7 @@ discard block |
||
| 2587 | 2587 | foreach ($errors as $errorsObj) {
|
| 2588 | 2588 | foreach ($errorsObj as $key => $val) {
|
| 2589 | 2589 | for ($i = 0; $i < count($val); $i++) {
|
| 2590 | - echo "<div class=sucess_msg>" . $val[$i] . '</div>'; |
|
| 2590 | + echo "<div class=sucess_msg>".$val[$i].'</div>'; |
|
| 2591 | 2591 | $registration_error_msg = 1; |
| 2592 | 2592 | } |
| 2593 | 2593 | } |
@@ -2604,7 +2604,7 @@ discard block |
||
| 2604 | 2604 | * |
| 2605 | 2605 | * @since 1.0.0 |
| 2606 | 2606 | */ |
| 2607 | - include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?> |
|
| 2607 | + include(geodir_plugin_path()."/geodirectory-templates/login_frm.php"); ?> |
|
| 2608 | 2608 | </div> |
| 2609 | 2609 | |
| 2610 | 2610 | <?php } elseif (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_up') { ?>
|
@@ -2616,7 +2616,7 @@ discard block |
||
| 2616 | 2616 | * |
| 2617 | 2617 | * @since 1.0.0 |
| 2618 | 2618 | */ |
| 2619 | - include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?> |
|
| 2619 | + include(geodir_plugin_path()."/geodirectory-templates/reg_frm.php"); ?> |
|
| 2620 | 2620 | </div> |
| 2621 | 2621 | |
| 2622 | 2622 | <?php } else { ?>
|
@@ -2628,7 +2628,7 @@ discard block |
||
| 2628 | 2628 | * |
| 2629 | 2629 | * @since 1.0.0 |
| 2630 | 2630 | */ |
| 2631 | - include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?> |
|
| 2631 | + include(geodir_plugin_path()."/geodirectory-templates/login_frm.php"); ?> |
|
| 2632 | 2632 | </div> |
| 2633 | 2633 | <div class="registration_form_r"> |
| 2634 | 2634 | <?php |
@@ -2637,7 +2637,7 @@ discard block |
||
| 2637 | 2637 | * |
| 2638 | 2638 | * @since 1.0.0 |
| 2639 | 2639 | */ |
| 2640 | - include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?> |
|
| 2640 | + include(geodir_plugin_path()."/geodirectory-templates/reg_frm.php"); ?> |
|
| 2641 | 2641 | </div> |
| 2642 | 2642 | |
| 2643 | 2643 | <?php }?> |
@@ -2673,12 +2673,12 @@ discard block |
||
| 2673 | 2673 | $gd_post_type = geodir_get_current_posttype(); |
| 2674 | 2674 | $post_type_info = get_post_type_object($gd_post_type); |
| 2675 | 2675 | |
| 2676 | - $add_string_in_title = __('All', 'geodirectory') . ' ';
|
|
| 2676 | + $add_string_in_title = __('All', 'geodirectory').' ';
|
|
| 2677 | 2677 | if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
|
| 2678 | - $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
|
|
| 2678 | + $add_string_in_title = __('My Favorite', 'geodirectory').' ';
|
|
| 2679 | 2679 | } |
| 2680 | 2680 | |
| 2681 | - $list_title = $add_string_in_title . $post_type_info->labels->name; |
|
| 2681 | + $list_title = $add_string_in_title.$post_type_info->labels->name; |
|
| 2682 | 2682 | $single_name = $post_type_info->labels->singular_name; |
| 2683 | 2683 | |
| 2684 | 2684 | $taxonomy = geodir_get_taxonomies($gd_post_type); |
@@ -2686,12 +2686,12 @@ discard block |
||
| 2686 | 2686 | if (!empty($term)) {
|
| 2687 | 2687 | $current_term = get_term_by('slug', $term, $taxonomy[0]);
|
| 2688 | 2688 | if (!empty($current_term)) |
| 2689 | - $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
|
|
| 2689 | + $list_title .= __(' in', 'geodirectory')." '".geodir_ucwords($current_term->name)."'";
|
|
| 2690 | 2690 | } |
| 2691 | 2691 | |
| 2692 | 2692 | |
| 2693 | 2693 | if (is_search()) {
|
| 2694 | - $list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
|
|
| 2694 | + $list_title = __('Search', 'geodirectory').' '.__($post_type_info->labels->name, 'geodirectory').__(' For :', 'geodirectory')." '".get_search_query()."'";
|
|
| 2695 | 2695 | |
| 2696 | 2696 | } |
| 2697 | 2697 | /** This action is documented in geodirectory_template_actions.php */ |
@@ -2700,11 +2700,11 @@ discard block |
||
| 2700 | 2700 | $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
|
| 2701 | 2701 | |
| 2702 | 2702 | $title = $list_title; |
| 2703 | - if(geodir_is_page('author')){
|
|
| 2703 | + if (geodir_is_page('author')) {
|
|
| 2704 | 2704 | $gd_page = 'author'; |
| 2705 | - if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
|
|
| 2705 | + if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
|
|
| 2706 | 2706 | $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
|
| 2707 | - }else{
|
|
| 2707 | + } else {
|
|
| 2708 | 2708 | $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
|
| 2709 | 2709 | } |
| 2710 | 2710 | |
@@ -2718,16 +2718,16 @@ discard block |
||
| 2718 | 2718 | * @param string $title The page title including variables. |
| 2719 | 2719 | * @param string $gd_page The GeoDirectory page type if any. |
| 2720 | 2720 | */ |
| 2721 | - $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 2721 | + $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 2722 | 2722 | |
| 2723 | - echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
|
| 2723 | + echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'. |
|
| 2724 | 2724 | /** |
| 2725 | 2725 | * Filter the author page title text. |
| 2726 | 2726 | * |
| 2727 | 2727 | * @since 1.0.0 |
| 2728 | 2728 | * @param string $list_title The title for the page. |
| 2729 | 2729 | */ |
| 2730 | - apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
|
|
| 2730 | + apply_filters('geodir_author_page_title_text', $title).'</h1></header>';
|
|
| 2731 | 2731 | } |
| 2732 | 2732 | |
| 2733 | 2733 | |
@@ -2932,19 +2932,19 @@ discard block |
||
| 2932 | 2932 | $post_type_info = get_post_type_object($gd_post_type); |
| 2933 | 2933 | |
| 2934 | 2934 | $pt_name = ''; |
| 2935 | - if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
|
|
| 2935 | + if (isset($post_type_info->labels->name)) {$pt_name = $post_type_info->labels->name; }
|
|
| 2936 | 2936 | |
| 2937 | 2937 | if (is_search()) {
|
| 2938 | - $list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
|
|
| 2938 | + $list_title = __('Search', 'geodirectory').' '.__($pt_name, 'geodirectory').__(' For :', 'geodirectory')." '".get_search_query()."'";
|
|
| 2939 | 2939 | |
| 2940 | 2940 | } |
| 2941 | 2941 | /** This action is documented in geodirectory_template_actions.php */ |
| 2942 | 2942 | $class = apply_filters('geodir_page_title_class', 'entry-title fn');
|
| 2943 | 2943 | /** This action is documented in geodirectory_template_actions.php */ |
| 2944 | 2944 | $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
|
| 2945 | - echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
|
| 2945 | + echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'. |
|
| 2946 | 2946 | /** This action is documented in geodirectory_template_actions.php */ |
| 2947 | - apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
|
|
| 2947 | + apply_filters('geodir_listing_page_title', wptexturize($list_title)).'</h1></header>';
|
|
| 2948 | 2948 | } |
| 2949 | 2949 | |
| 2950 | 2950 | // action for adding the listings page top widget area |
@@ -3348,7 +3348,7 @@ discard block |
||
| 3348 | 3348 | $gd_post_type = geodir_get_current_posttype(); |
| 3349 | 3349 | $post_type_info = get_post_type_object($gd_post_type); |
| 3350 | 3350 | |
| 3351 | - $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
|
|
| 3351 | + $list_title = __('Search', 'geodirectory').' '.__(ucfirst($post_type_info->labels->name), 'geodirectory').__(' :', 'geodirectory');
|
|
| 3352 | 3352 | } |
| 3353 | 3353 | return $list_title; |
| 3354 | 3354 | } |
@@ -3364,7 +3364,7 @@ discard block |
||
| 3364 | 3364 | * @param string $position Position to add the post content. 'before' or 'after'. Default 'before'. |
| 3365 | 3365 | * @param string $gd_page The geodirectory page type. Default null. |
| 3366 | 3366 | */ |
| 3367 | -function geodir_add_page_content( $position = 'before', $gd_page = '' ) {
|
|
| 3367 | +function geodir_add_page_content($position = 'before', $gd_page = '') {
|
|
| 3368 | 3368 | global $post; |
| 3369 | 3369 | |
| 3370 | 3370 | $gd_page_id = NULL; |
@@ -16,7 +16,9 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | function geodir_session_start() |
| 18 | 18 | {
|
| 19 | - if (!session_id()) session_start(); |
|
| 19 | + if (!session_id()) { |
|
| 20 | + session_start(); |
|
| 21 | + } |
|
| 20 | 22 | global $geodir_add_location_url; |
| 21 | 23 | |
| 22 | 24 | $geodir_add_location_url = NULL; |
@@ -86,7 +88,9 @@ discard block |
||
| 86 | 88 | |
| 87 | 89 | if ((is_search() && isset($_REQUEST['geodir_search']) && $_REQUEST['geodir_search'] != '')): |
| 88 | 90 | |
| 89 | - if (isset($_REQUEST['scat']) && $_REQUEST['scat'] == 'all') $_REQUEST['scat'] = ''; |
|
| 91 | + if (isset($_REQUEST['scat']) && $_REQUEST['scat'] == 'all') { |
|
| 92 | + $_REQUEST['scat'] = ''; |
|
| 93 | + } |
|
| 90 | 94 | //if(isset($_REQUEST['s']) && $_REQUEST['s'] == '+') $_REQUEST['s'] = ''; |
| 91 | 95 | |
| 92 | 96 | if (isset($_REQUEST['sdist'])) {
|
@@ -198,8 +202,9 @@ discard block |
||
| 198 | 202 | add_filter('posts_fields', 'geodir_posts_fields', 1);
|
| 199 | 203 | add_filter('posts_join', 'geodir_posts_join', 1);
|
| 200 | 204 | geodir_post_where(); |
| 201 | - if (!is_admin()) |
|
| 202 | - add_filter('posts_orderby', 'geodir_posts_orderby', 1);
|
|
| 205 | + if (!is_admin()) { |
|
| 206 | + add_filter('posts_orderby', 'geodir_posts_orderby', 1); |
|
| 207 | + } |
|
| 203 | 208 | |
| 204 | 209 | // advanced filter for popular post view widget |
| 205 | 210 | global $wp_query; |
@@ -346,8 +351,9 @@ discard block |
||
| 346 | 351 | $sort_by = ''; |
| 347 | 352 | $orderby = ' '; |
| 348 | 353 | |
| 349 | - if (get_query_var('order_by'))
|
|
| 350 | - $sort_by = get_query_var('order_by');
|
|
| 354 | + if (get_query_var('order_by')) { |
|
| 355 | + $sort_by = get_query_var('order_by'); |
|
| 356 | + } |
|
| 351 | 357 | |
| 352 | 358 | /*if(isset($wp_query->tax_query->queries) && $wp_query->tax_query->queries){
|
| 353 | 359 | $current_term = $wp_query->get_queried_object(); |
@@ -367,14 +373,16 @@ discard block |
||
| 367 | 373 | $orderby .= " distance,"; |
| 368 | 374 | } |
| 369 | 375 | |
| 370 | - if (isset($_REQUEST['sort_by']) && $_REQUEST['sort_by'] != '' && is_main_query()) |
|
| 371 | - $sort_by = esc_attr($_REQUEST['sort_by']); |
|
| 376 | + if (isset($_REQUEST['sort_by']) && $_REQUEST['sort_by'] != '' && is_main_query()) { |
|
| 377 | + $sort_by = esc_attr($_REQUEST['sort_by']); |
|
| 378 | + } |
|
| 372 | 379 | |
| 373 | 380 | |
| 374 | 381 | if ($sort_by == '') {
|
| 375 | 382 | $default_sort = geodir_get_posts_default_sort($geodir_post_type); |
| 376 | - if (!empty($default_sort)) |
|
| 377 | - $sort_by = $default_sort; |
|
| 383 | + if (!empty($default_sort)) { |
|
| 384 | + $sort_by = $default_sort; |
|
| 385 | + } |
|
| 378 | 386 | } |
| 379 | 387 | |
| 380 | 388 | /* |
@@ -562,8 +570,9 @@ discard block |
||
| 562 | 570 | |
| 563 | 571 | add_filter('posts_where', 'searching_filter_where', 1);
|
| 564 | 572 | |
| 565 | - if ($snear != '') |
|
| 566 | - add_filter('posts_where', 'searching_filter_where', 1);
|
|
| 573 | + if ($snear != '') { |
|
| 574 | + add_filter('posts_where', 'searching_filter_where', 1); |
|
| 575 | + } |
|
| 567 | 576 | |
| 568 | 577 | add_filter('posts_orderby', 'geodir_posts_orderby', 1);
|
| 569 | 578 | |
@@ -731,10 +740,11 @@ discard block |
||
| 731 | 740 | } |
| 732 | 741 | |
| 733 | 742 | $better_search_terms = ''; |
| 734 | - if (isset($_REQUEST['stype'])) |
|
| 735 | - $post_types = esc_attr(wp_strip_all_tags($_REQUEST['stype'])); |
|
| 736 | - else |
|
| 737 | - $post_types = 'gd_place'; |
|
| 743 | + if (isset($_REQUEST['stype'])) { |
|
| 744 | + $post_types = esc_attr(wp_strip_all_tags($_REQUEST['stype'])); |
|
| 745 | + } else { |
|
| 746 | + $post_types = 'gd_place'; |
|
| 747 | + } |
|
| 738 | 748 | |
| 739 | 749 | if ($s != '') {
|
| 740 | 750 | $keywords = explode(" ", $s);
|
@@ -762,7 +772,7 @@ discard block |
||
| 762 | 772 | if($taxonomies) {
|
| 763 | 773 | $taxonomies = implode("','", $taxonomies);
|
| 764 | 774 | $taxonomies = "'" . $taxonomies . "'"; |
| 765 | - }else{$taxonomies='';}
|
|
| 775 | + } else{$taxonomies='';}
|
|
| 766 | 776 | |
| 767 | 777 | $content_where = $terms_where = ''; |
| 768 | 778 | if ($s != '') {
|
@@ -878,8 +888,9 @@ discard block |
||
| 878 | 888 | $user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true); |
| 879 | 889 | $user_fav_posts = !empty($user_fav_posts) && is_array($user_fav_posts) ? implode("','", $user_fav_posts) : '-1';
|
| 880 | 890 | $where .= " AND $wpdb->posts.ID IN ('$user_fav_posts')";
|
| 881 | - } else |
|
| 882 | - $where .= " AND $wpdb->posts.post_author = $user_id"; |
|
| 891 | + } else { |
|
| 892 | + $where .= " AND $wpdb->posts.post_author = $user_id"; |
|
| 893 | + } |
|
| 883 | 894 | |
| 884 | 895 | if ($user_id == (int)get_current_user_id()) {
|
| 885 | 896 | $where .= " AND $wpdb->posts.post_status IN ('publish','draft','pending') ";
|
@@ -16,10 +16,10 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | function geodir_session_start() |
| 18 | 18 | {
|
| 19 | - if (!session_id()) session_start(); |
|
| 20 | - global $geodir_add_location_url; |
|
| 19 | + if (!session_id()) session_start(); |
|
| 20 | + global $geodir_add_location_url; |
|
| 21 | 21 | |
| 22 | - $geodir_add_location_url = NULL; |
|
| 22 | + $geodir_add_location_url = NULL; |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | /** |
@@ -33,18 +33,18 @@ discard block |
||
| 33 | 33 | */ |
| 34 | 34 | function geodir_modified_query($query) |
| 35 | 35 | {
|
| 36 | - if ($query->is_main_query() && ( |
|
| 37 | - (geodir_is_page('add-listing') && isset($_REQUEST['pid']) && $_REQUEST['pid'] != '')
|
|
| 38 | - || geodir_is_page('listing')
|
|
| 39 | - || geodir_is_page('author')
|
|
| 40 | - || geodir_is_page('search')
|
|
| 41 | - || geodir_is_page('detail'))
|
|
| 42 | - ) {
|
|
| 43 | - |
|
| 44 | - $query->set('is_geodir_loop', true);
|
|
| 45 | - } |
|
| 36 | + if ($query->is_main_query() && ( |
|
| 37 | + (geodir_is_page('add-listing') && isset($_REQUEST['pid']) && $_REQUEST['pid'] != '')
|
|
| 38 | + || geodir_is_page('listing')
|
|
| 39 | + || geodir_is_page('author')
|
|
| 40 | + || geodir_is_page('search')
|
|
| 41 | + || geodir_is_page('detail'))
|
|
| 42 | + ) {
|
|
| 43 | + |
|
| 44 | + $query->set('is_geodir_loop', true);
|
|
| 45 | + } |
|
| 46 | 46 | |
| 47 | - return $query; |
|
| 47 | + return $query; |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | /** |
@@ -67,81 +67,81 @@ discard block |
||
| 67 | 67 | */ |
| 68 | 68 | function set_listing_request() |
| 69 | 69 | {
|
| 70 | - global $wp_query, $wpdb, $geodir_post_type, $table, $dist, $mylat, $mylon, $s, $snear, $s, $s_A, $s_SA; |
|
| 70 | + global $wp_query, $wpdb, $geodir_post_type, $table, $dist, $mylat, $mylon, $s, $snear, $s, $s_A, $s_SA; |
|
| 71 | 71 | |
| 72 | 72 | |
| 73 | - // fix woocommerce shop products filtered by language for GD + WPML + Woocommerce |
|
| 74 | - if (!geodir_is_geodir_page()) {
|
|
| 75 | - return; |
|
| 76 | - } |
|
| 73 | + // fix woocommerce shop products filtered by language for GD + WPML + Woocommerce |
|
| 74 | + if (!geodir_is_geodir_page()) {
|
|
| 75 | + return; |
|
| 76 | + } |
|
| 77 | 77 | |
| 78 | - /* remove all pre filters */ |
|
| 79 | - remove_all_filters('query');
|
|
| 80 | - remove_all_filters('posts_search');
|
|
| 81 | - remove_all_filters('posts_fields');
|
|
| 82 | - remove_all_filters('posts_join');
|
|
| 83 | - remove_all_filters('posts_orderby');
|
|
| 84 | - remove_all_filters('posts_where');
|
|
| 78 | + /* remove all pre filters */ |
|
| 79 | + remove_all_filters('query');
|
|
| 80 | + remove_all_filters('posts_search');
|
|
| 81 | + remove_all_filters('posts_fields');
|
|
| 82 | + remove_all_filters('posts_join');
|
|
| 83 | + remove_all_filters('posts_orderby');
|
|
| 84 | + remove_all_filters('posts_where');
|
|
| 85 | 85 | |
| 86 | 86 | |
| 87 | - if ((is_search() && isset($_REQUEST['geodir_search']) && $_REQUEST['geodir_search'] != '')): |
|
| 87 | + if ((is_search() && isset($_REQUEST['geodir_search']) && $_REQUEST['geodir_search'] != '')): |
|
| 88 | 88 | |
| 89 | - if (isset($_REQUEST['scat']) && $_REQUEST['scat'] == 'all') $_REQUEST['scat'] = ''; |
|
| 90 | - //if(isset($_REQUEST['s']) && $_REQUEST['s'] == '+') $_REQUEST['s'] = ''; |
|
| 89 | + if (isset($_REQUEST['scat']) && $_REQUEST['scat'] == 'all') $_REQUEST['scat'] = ''; |
|
| 90 | + //if(isset($_REQUEST['s']) && $_REQUEST['s'] == '+') $_REQUEST['s'] = ''; |
|
| 91 | 91 | |
| 92 | - if (isset($_REQUEST['sdist'])) {
|
|
| 93 | - ($_REQUEST['sdist'] != '0' && $_REQUEST['sdist'] != '') ? $dist = esc_attr($_REQUEST['sdist']) : $dist = 25000; |
|
| 94 | - } elseif (get_option('geodir_search_dist') != '') {
|
|
| 95 | - $dist = get_option('geodir_search_dist');
|
|
| 92 | + if (isset($_REQUEST['sdist'])) {
|
|
| 93 | + ($_REQUEST['sdist'] != '0' && $_REQUEST['sdist'] != '') ? $dist = esc_attr($_REQUEST['sdist']) : $dist = 25000; |
|
| 94 | + } elseif (get_option('geodir_search_dist') != '') {
|
|
| 95 | + $dist = get_option('geodir_search_dist');
|
|
| 96 | 96 | |
| 97 | - } else {
|
|
| 98 | - $dist = 25000; |
|
| 99 | - } // Distance |
|
| 97 | + } else {
|
|
| 98 | + $dist = 25000; |
|
| 99 | + } // Distance |
|
| 100 | 100 | |
| 101 | - if (isset($_REQUEST['sgeo_lat'])) {
|
|
| 102 | - $mylat = (float)esc_attr($_REQUEST['sgeo_lat']); |
|
| 103 | - } else {
|
|
| 104 | - $mylat = (float)geodir_get_current_city_lat(); |
|
| 105 | - } // Latatude |
|
| 101 | + if (isset($_REQUEST['sgeo_lat'])) {
|
|
| 102 | + $mylat = (float)esc_attr($_REQUEST['sgeo_lat']); |
|
| 103 | + } else {
|
|
| 104 | + $mylat = (float)geodir_get_current_city_lat(); |
|
| 105 | + } // Latatude |
|
| 106 | 106 | |
| 107 | - if (isset($_REQUEST['sgeo_lon'])) {
|
|
| 108 | - $mylon = (float)esc_attr($_REQUEST['sgeo_lon']); |
|
| 109 | - } else {
|
|
| 110 | - $mylon = (float)geodir_get_current_city_lng(); |
|
| 111 | - } // Distance |
|
| 107 | + if (isset($_REQUEST['sgeo_lon'])) {
|
|
| 108 | + $mylon = (float)esc_attr($_REQUEST['sgeo_lon']); |
|
| 109 | + } else {
|
|
| 110 | + $mylon = (float)geodir_get_current_city_lng(); |
|
| 111 | + } // Distance |
|
| 112 | 112 | |
| 113 | - if (isset($_REQUEST['snear'])) {
|
|
| 114 | - $snear = trim(esc_attr($_REQUEST['snear'])); |
|
| 115 | - } |
|
| 113 | + if (isset($_REQUEST['snear'])) {
|
|
| 114 | + $snear = trim(esc_attr($_REQUEST['snear'])); |
|
| 115 | + } |
|
| 116 | 116 | |
| 117 | - if (isset($_REQUEST['s'])) {
|
|
| 118 | - $s = trim(esc_attr(wp_strip_all_tags($_REQUEST['s']))); |
|
| 119 | - } |
|
| 117 | + if (isset($_REQUEST['s'])) {
|
|
| 118 | + $s = trim(esc_attr(wp_strip_all_tags($_REQUEST['s']))); |
|
| 119 | + } |
|
| 120 | 120 | |
| 121 | - if ($snear == 'NEAR ME') {
|
|
| 122 | - $ip = $_SERVER['REMOTE_ADDR']; |
|
| 123 | - $addr_details = unserialize(file_get_contents('http://www.geoplugin.net/php.gp?ip=' . $ip));
|
|
| 124 | - $mylat = stripslashes(ucfirst($addr_details[geoplugin_latitude])); |
|
| 125 | - $mylon = stripslashes(ucfirst($addr_details[geoplugin_longitude])); |
|
| 126 | - } |
|
| 121 | + if ($snear == 'NEAR ME') {
|
|
| 122 | + $ip = $_SERVER['REMOTE_ADDR']; |
|
| 123 | + $addr_details = unserialize(file_get_contents('http://www.geoplugin.net/php.gp?ip=' . $ip));
|
|
| 124 | + $mylat = stripslashes(ucfirst($addr_details[geoplugin_latitude])); |
|
| 125 | + $mylon = stripslashes(ucfirst($addr_details[geoplugin_longitude])); |
|
| 126 | + } |
|
| 127 | 127 | |
| 128 | 128 | |
| 129 | - if (strstr($s, ',')) {
|
|
| 130 | - $s_AA = str_replace(" ", "", $s);
|
|
| 131 | - $s_A = explode(",", $s_AA);
|
|
| 132 | - $s_A = implode('","', $s_A);
|
|
| 133 | - $s_A = '"' . $s_A . '"'; |
|
| 134 | - } else {
|
|
| 135 | - $s_A = '"' . $s . '"'; |
|
| 136 | - } |
|
| 129 | + if (strstr($s, ',')) {
|
|
| 130 | + $s_AA = str_replace(" ", "", $s);
|
|
| 131 | + $s_A = explode(",", $s_AA);
|
|
| 132 | + $s_A = implode('","', $s_A);
|
|
| 133 | + $s_A = '"' . $s_A . '"'; |
|
| 134 | + } else {
|
|
| 135 | + $s_A = '"' . $s . '"'; |
|
| 136 | + } |
|
| 137 | 137 | |
| 138 | - if (strstr($s, ' ')) {
|
|
| 139 | - $s_SA = explode(" ", $s);
|
|
| 140 | - } else {
|
|
| 141 | - $s_SA = ''; |
|
| 142 | - } |
|
| 138 | + if (strstr($s, ' ')) {
|
|
| 139 | + $s_SA = explode(" ", $s);
|
|
| 140 | + } else {
|
|
| 141 | + $s_SA = ''; |
|
| 142 | + } |
|
| 143 | 143 | |
| 144 | - endif; |
|
| 144 | + endif; |
|
| 145 | 145 | |
| 146 | 146 | |
| 147 | 147 | |
@@ -162,56 +162,56 @@ discard block |
||
| 162 | 162 | */ |
| 163 | 163 | function geodir_listing_loop_filter($query) |
| 164 | 164 | {
|
| 165 | - global $wp_query, $geodir_post_type, $table, $plugin_prefix, $table, $term; |
|
| 165 | + global $wp_query, $geodir_post_type, $table, $plugin_prefix, $table, $term; |
|
| 166 | 166 | |
| 167 | - // fix wp_reset_query for popular post view widget |
|
| 168 | - if (!geodir_is_geodir_page()) {
|
|
| 169 | - return; |
|
| 170 | - } |
|
| 167 | + // fix wp_reset_query for popular post view widget |
|
| 168 | + if (!geodir_is_geodir_page()) {
|
|
| 169 | + return; |
|
| 170 | + } |
|
| 171 | 171 | |
| 172 | - $geodir_post_type = geodir_get_current_posttype(); |
|
| 173 | - |
|
| 174 | - if (isset($wp_query->tax_query->queries) && $wp_query->tax_query->queries) {
|
|
| 175 | - $taxonomies = wp_list_pluck($wp_query->tax_query->queries, 'taxonomy'); |
|
| 176 | - |
|
| 177 | - if (isset($wp_query->query[$taxonomies[0]])) {
|
|
| 178 | - $request_term = explode("/", $wp_query->query[$taxonomies[0]]);
|
|
| 179 | - $request_term = end($request_term); |
|
| 180 | - if (!term_exists($request_term)) {
|
|
| 181 | - $args = array('number' => '1',);
|
|
| 182 | - $terms_arr = get_terms($taxonomies[0], $args); |
|
| 183 | - foreach ($terms_arr as $location_term) {
|
|
| 184 | - $term_arr = $location_term; |
|
| 185 | - $term_arr->name = geodir_ucwords(str_replace('-', ' ', $request_term));
|
|
| 186 | - } |
|
| 187 | - $wp_query->queried_object_id = 1; |
|
| 188 | - $wp_query->queried_object = $term_arr; |
|
| 189 | - //print_r($wp_query) ; |
|
| 190 | - } |
|
| 191 | - } |
|
| 172 | + $geodir_post_type = geodir_get_current_posttype(); |
|
| 173 | + |
|
| 174 | + if (isset($wp_query->tax_query->queries) && $wp_query->tax_query->queries) {
|
|
| 175 | + $taxonomies = wp_list_pluck($wp_query->tax_query->queries, 'taxonomy'); |
|
| 176 | + |
|
| 177 | + if (isset($wp_query->query[$taxonomies[0]])) {
|
|
| 178 | + $request_term = explode("/", $wp_query->query[$taxonomies[0]]);
|
|
| 179 | + $request_term = end($request_term); |
|
| 180 | + if (!term_exists($request_term)) {
|
|
| 181 | + $args = array('number' => '1',);
|
|
| 182 | + $terms_arr = get_terms($taxonomies[0], $args); |
|
| 183 | + foreach ($terms_arr as $location_term) {
|
|
| 184 | + $term_arr = $location_term; |
|
| 185 | + $term_arr->name = geodir_ucwords(str_replace('-', ' ', $request_term));
|
|
| 186 | + } |
|
| 187 | + $wp_query->queried_object_id = 1; |
|
| 188 | + $wp_query->queried_object = $term_arr; |
|
| 189 | + //print_r($wp_query) ; |
|
| 190 | + } |
|
| 191 | + } |
|
| 192 | 192 | |
| 193 | - } |
|
| 194 | - if (isset($query->query_vars['is_geodir_loop']) && $query->query_vars['is_geodir_loop']) {
|
|
| 195 | - |
|
| 196 | - $table = $plugin_prefix . $geodir_post_type . '_detail'; |
|
| 197 | - |
|
| 198 | - add_filter('posts_fields', 'geodir_posts_fields', 1);
|
|
| 199 | - add_filter('posts_join', 'geodir_posts_join', 1);
|
|
| 200 | - geodir_post_where(); |
|
| 201 | - if (!is_admin()) |
|
| 202 | - add_filter('posts_orderby', 'geodir_posts_orderby', 1);
|
|
| 203 | - |
|
| 204 | - // advanced filter for popular post view widget |
|
| 205 | - global $wp_query; |
|
| 206 | - if (!is_admin()) {
|
|
| 207 | - if (!empty($wp_query->query['with_pics_only'])) {
|
|
| 208 | - add_filter('posts_join', 'geodir_filter_widget_join', 1000);
|
|
| 209 | - } |
|
| 210 | - add_filter('posts_where', 'geodir_filter_widget_where', 1000);
|
|
| 211 | - } |
|
| 193 | + } |
|
| 194 | + if (isset($query->query_vars['is_geodir_loop']) && $query->query_vars['is_geodir_loop']) {
|
|
| 212 | 195 | |
| 213 | - } |
|
| 214 | - return $query; |
|
| 196 | + $table = $plugin_prefix . $geodir_post_type . '_detail'; |
|
| 197 | + |
|
| 198 | + add_filter('posts_fields', 'geodir_posts_fields', 1);
|
|
| 199 | + add_filter('posts_join', 'geodir_posts_join', 1);
|
|
| 200 | + geodir_post_where(); |
|
| 201 | + if (!is_admin()) |
|
| 202 | + add_filter('posts_orderby', 'geodir_posts_orderby', 1);
|
|
| 203 | + |
|
| 204 | + // advanced filter for popular post view widget |
|
| 205 | + global $wp_query; |
|
| 206 | + if (!is_admin()) {
|
|
| 207 | + if (!empty($wp_query->query['with_pics_only'])) {
|
|
| 208 | + add_filter('posts_join', 'geodir_filter_widget_join', 1000);
|
|
| 209 | + } |
|
| 210 | + add_filter('posts_where', 'geodir_filter_widget_where', 1000);
|
|
| 211 | + } |
|
| 212 | + |
|
| 213 | + } |
|
| 214 | + return $query; |
|
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | |
@@ -230,67 +230,67 @@ discard block |
||
| 230 | 230 | * @return string Modified fields query string. |
| 231 | 231 | */ |
| 232 | 232 | function geodir_posts_fields($fields) {
|
| 233 | - global $wp_query, $wpdb, $geodir_post_type, $table, $plugin_prefix, $dist, $mylat, $mylon, $snear, $gd_session; |
|
| 233 | + global $wp_query, $wpdb, $geodir_post_type, $table, $plugin_prefix, $dist, $mylat, $mylon, $snear, $gd_session; |
|
| 234 | 234 | |
| 235 | - // Filter-Location-Manager to add location table. |
|
| 236 | - $fields .= ", " . $table . ".* "; |
|
| 235 | + // Filter-Location-Manager to add location table. |
|
| 236 | + $fields .= ", " . $table . ".* "; |
|
| 237 | 237 | |
| 238 | 238 | if ($snear != '' || $gd_session->get('all_near_me')) {
|
| 239 | - $DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
|
|
| 239 | + $DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
|
|
| 240 | 240 | |
| 241 | 241 | if ($gd_session->get('all_near_me')) {
|
| 242 | - $mylat = $gd_session->get('user_lat');
|
|
| 243 | - $mylon = $gd_session->get('user_lon');
|
|
| 244 | - } |
|
| 245 | - |
|
| 246 | - $fields .= " , (" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) )))as distance ";
|
|
| 247 | - } |
|
| 248 | - |
|
| 249 | - global $s; |
|
| 250 | - if (is_search() && isset($_REQUEST['geodir_search']) && $s && trim($s) != '') {
|
|
| 251 | - $keywords = explode(" ", $s);
|
|
| 252 | - |
|
| 253 | - if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
|
|
| 254 | - foreach($keywords as $kkey=>$kword){
|
|
| 255 | - if(mb_strlen($kword, 'UTF-8')<=$klimit){
|
|
| 256 | - unset($keywords[$kkey]); |
|
| 257 | - } |
|
| 258 | - } |
|
| 259 | - } |
|
| 242 | + $mylat = $gd_session->get('user_lat');
|
|
| 243 | + $mylon = $gd_session->get('user_lon');
|
|
| 244 | + } |
|
| 260 | 245 | |
| 246 | + $fields .= " , (" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) )))as distance ";
|
|
| 247 | + } |
|
| 261 | 248 | |
| 262 | - if (count($keywords) > 1) {
|
|
| 263 | - $parts = array( |
|
| 264 | - 'AND' => 'gd_alltitlematch_part', |
|
| 265 | - 'OR' => 'gd_titlematch_part' |
|
| 266 | - ); |
|
| 267 | - $gd_titlematch_part = ""; |
|
| 268 | - foreach ($parts as $key => $part) {
|
|
| 269 | - $gd_titlematch_part .= " CASE WHEN "; |
|
| 270 | - $count = 0; |
|
| 271 | - foreach ($keywords as $keyword) {
|
|
| 272 | - $keyword = trim($keyword); |
|
| 273 | - $keyword = wp_specialchars_decode($keyword ,ENT_QUOTES); |
|
| 249 | + global $s; |
|
| 250 | + if (is_search() && isset($_REQUEST['geodir_search']) && $s && trim($s) != '') {
|
|
| 251 | + $keywords = explode(" ", $s);
|
|
| 252 | + |
|
| 253 | + if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
|
|
| 254 | + foreach($keywords as $kkey=>$kword){
|
|
| 255 | + if(mb_strlen($kword, 'UTF-8')<=$klimit){
|
|
| 256 | + unset($keywords[$kkey]); |
|
| 257 | + } |
|
| 258 | + } |
|
| 259 | + } |
|
| 260 | + |
|
| 261 | + |
|
| 262 | + if (count($keywords) > 1) {
|
|
| 263 | + $parts = array( |
|
| 264 | + 'AND' => 'gd_alltitlematch_part', |
|
| 265 | + 'OR' => 'gd_titlematch_part' |
|
| 266 | + ); |
|
| 267 | + $gd_titlematch_part = ""; |
|
| 268 | + foreach ($parts as $key => $part) {
|
|
| 269 | + $gd_titlematch_part .= " CASE WHEN "; |
|
| 270 | + $count = 0; |
|
| 271 | + foreach ($keywords as $keyword) {
|
|
| 272 | + $keyword = trim($keyword); |
|
| 273 | + $keyword = wp_specialchars_decode($keyword ,ENT_QUOTES); |
|
| 274 | 274 | $count++; |
| 275 | - if ($count < count($keywords)) {
|
|
| 276 | - // $gd_titlematch_part .= $wpdb->posts . ".post_title LIKE '%%" . $keyword . "%%' " . $key . " "; |
|
| 275 | + if ($count < count($keywords)) {
|
|
| 276 | + // $gd_titlematch_part .= $wpdb->posts . ".post_title LIKE '%%" . $keyword . "%%' " . $key . " "; |
|
| 277 | 277 | $gd_titlematch_part .= "( " . $wpdb->posts . ".post_title LIKE '" . $keyword . "' OR " . $wpdb->posts . ".post_title LIKE '" . $keyword . "%%' OR " . $wpdb->posts . ".post_title LIKE '%% " . $keyword . "%%' ) " . $key . " "; |
| 278 | - } else {
|
|
| 279 | - //$gd_titlematch_part .= $wpdb->posts . ".post_title LIKE '%%" . $keyword . "%%' "; |
|
| 278 | + } else {
|
|
| 279 | + //$gd_titlematch_part .= $wpdb->posts . ".post_title LIKE '%%" . $keyword . "%%' "; |
|
| 280 | 280 | $gd_titlematch_part .= "( " . $wpdb->posts . ".post_title LIKE '" . $keyword . "' OR " . $wpdb->posts . ".post_title LIKE '" . $keyword . "%%' OR " . $wpdb->posts . ".post_title LIKE '%% " . $keyword . "%%' ) "; |
| 281 | - } |
|
| 282 | - } |
|
| 283 | - $gd_titlematch_part .= "THEN 1 ELSE 0 END AS " . $part . ","; |
|
| 284 | - } |
|
| 285 | - } else {
|
|
| 286 | - $gd_titlematch_part = ""; |
|
| 287 | - } |
|
| 288 | - $s = stripslashes_deep( $s ); |
|
| 289 | - $s = wp_specialchars_decode($s,ENT_QUOTES); |
|
| 281 | + } |
|
| 282 | + } |
|
| 283 | + $gd_titlematch_part .= "THEN 1 ELSE 0 END AS " . $part . ","; |
|
| 284 | + } |
|
| 285 | + } else {
|
|
| 286 | + $gd_titlematch_part = ""; |
|
| 287 | + } |
|
| 288 | + $s = stripslashes_deep( $s ); |
|
| 289 | + $s = wp_specialchars_decode($s,ENT_QUOTES); |
|
| 290 | 290 | $fields .= $wpdb->prepare(", CASE WHEN " . $table . ".is_featured='1' THEN 1 ELSE 0 END AS gd_featured, CASE WHEN " . $wpdb->posts . ".post_title LIKE %s THEN 1 ELSE 0 END AS gd_exacttitle," . $gd_titlematch_part . " CASE WHEN ( " . $wpdb->posts . ".post_title LIKE %s OR " . $wpdb->posts . ".post_title LIKE %s OR " . $wpdb->posts . ".post_title LIKE %s ) THEN 1 ELSE 0 END AS gd_titlematch, CASE WHEN ( " . $wpdb->posts . ".post_content LIKE %s OR " . $wpdb->posts . ".post_content LIKE %s OR " . $wpdb->posts . ".post_content LIKE %s OR " . $wpdb->posts . ".post_content LIKE %s ) THEN 1 ELSE 0 END AS gd_content", array($s, $s, $s . '%', '% ' . $s . '%', $s, $s . ' %', '% ' . $s . ' %', '% ' . $s));
|
| 291 | - } |
|
| 291 | + } |
|
| 292 | 292 | |
| 293 | - return $fields; |
|
| 293 | + return $fields; |
|
| 294 | 294 | } |
| 295 | 295 | |
| 296 | 296 | |
@@ -307,26 +307,26 @@ discard block |
||
| 307 | 307 | */ |
| 308 | 308 | function geodir_posts_join($join) |
| 309 | 309 | {
|
| 310 | - global $wpdb, $geodir_post_type, $table, $table_prefix, $plugin_prefix; |
|
| 310 | + global $wpdb, $geodir_post_type, $table, $table_prefix, $plugin_prefix; |
|
| 311 | 311 | |
| 312 | - ########### WPML ########### |
|
| 312 | + ########### WPML ########### |
|
| 313 | 313 | |
| 314 | - if (function_exists('icl_object_id')) {
|
|
| 315 | - global $sitepress; |
|
| 316 | - $lang_code = ICL_LANGUAGE_CODE; |
|
| 317 | - $default_lang_code = $sitepress->get_default_language(); |
|
| 318 | - if ($lang_code) {
|
|
| 319 | - $join .= "JOIN " . $table_prefix . "icl_translations icl_t ON icl_t.element_id = " . $table_prefix . "posts.ID"; |
|
| 320 | - } |
|
| 314 | + if (function_exists('icl_object_id')) {
|
|
| 315 | + global $sitepress; |
|
| 316 | + $lang_code = ICL_LANGUAGE_CODE; |
|
| 317 | + $default_lang_code = $sitepress->get_default_language(); |
|
| 318 | + if ($lang_code) {
|
|
| 319 | + $join .= "JOIN " . $table_prefix . "icl_translations icl_t ON icl_t.element_id = " . $table_prefix . "posts.ID"; |
|
| 320 | + } |
|
| 321 | 321 | |
| 322 | - } |
|
| 323 | - ########### WPML ########### |
|
| 322 | + } |
|
| 323 | + ########### WPML ########### |
|
| 324 | 324 | |
| 325 | - $join .= " INNER JOIN " . $table . " ON (" . $table . ".post_id = $wpdb->posts.ID) ";
|
|
| 326 | - //===old code start |
|
| 327 | - //$join .= " INNER JOIN ".POST_LOCATION_TABLE." ON (".$table.".post_location_id = ".POST_LOCATION_TABLE.".location_id) " ;//===old code end
|
|
| 325 | + $join .= " INNER JOIN " . $table . " ON (" . $table . ".post_id = $wpdb->posts.ID) ";
|
|
| 326 | + //===old code start |
|
| 327 | + //$join .= " INNER JOIN ".POST_LOCATION_TABLE." ON (".$table.".post_location_id = ".POST_LOCATION_TABLE.".location_id) " ;//===old code end
|
|
| 328 | 328 | |
| 329 | - return $join; |
|
| 329 | + return $join; |
|
| 330 | 330 | } |
| 331 | 331 | |
| 332 | 332 | |
@@ -344,15 +344,15 @@ discard block |
||
| 344 | 344 | */ |
| 345 | 345 | function geodir_posts_orderby($orderby) |
| 346 | 346 | {
|
| 347 | - global $wpdb, $wp_query, $geodir_post_type, $table, $plugin_prefix, $snear, $default_sort; |
|
| 347 | + global $wpdb, $wp_query, $geodir_post_type, $table, $plugin_prefix, $snear, $default_sort; |
|
| 348 | 348 | |
| 349 | - $sort_by = ''; |
|
| 350 | - $orderby = ' '; |
|
| 349 | + $sort_by = ''; |
|
| 350 | + $orderby = ' '; |
|
| 351 | 351 | |
| 352 | - if (get_query_var('order_by'))
|
|
| 353 | - $sort_by = get_query_var('order_by');
|
|
| 352 | + if (get_query_var('order_by'))
|
|
| 353 | + $sort_by = get_query_var('order_by');
|
|
| 354 | 354 | |
| 355 | - /*if(isset($wp_query->tax_query->queries) && $wp_query->tax_query->queries){
|
|
| 355 | + /*if(isset($wp_query->tax_query->queries) && $wp_query->tax_query->queries){
|
|
| 356 | 356 | $current_term = $wp_query->get_queried_object(); |
| 357 | 357 | } |
| 358 | 358 | |
@@ -366,116 +366,116 @@ discard block |
||
| 366 | 366 | }*/ |
| 367 | 367 | |
| 368 | 368 | |
| 369 | - if ($snear != '') {
|
|
| 370 | - $orderby .= " distance,"; |
|
| 371 | - } |
|
| 369 | + if ($snear != '') {
|
|
| 370 | + $orderby .= " distance,"; |
|
| 371 | + } |
|
| 372 | 372 | |
| 373 | - if (isset($_REQUEST['sort_by']) && $_REQUEST['sort_by'] != '' && is_main_query()) |
|
| 374 | - $sort_by = esc_attr($_REQUEST['sort_by']); |
|
| 373 | + if (isset($_REQUEST['sort_by']) && $_REQUEST['sort_by'] != '' && is_main_query()) |
|
| 374 | + $sort_by = esc_attr($_REQUEST['sort_by']); |
|
| 375 | 375 | |
| 376 | 376 | |
| 377 | - if ($sort_by == '') {
|
|
| 378 | - $default_sort = geodir_get_posts_default_sort($geodir_post_type); |
|
| 379 | - if (!empty($default_sort)) |
|
| 380 | - $sort_by = $default_sort; |
|
| 381 | - } |
|
| 377 | + if ($sort_by == '') {
|
|
| 378 | + $default_sort = geodir_get_posts_default_sort($geodir_post_type); |
|
| 379 | + if (!empty($default_sort)) |
|
| 380 | + $sort_by = $default_sort; |
|
| 381 | + } |
|
| 382 | 382 | |
| 383 | - /* |
|
| 383 | + /* |
|
| 384 | 384 | if search by term & no location then order always "relevance" |
| 385 | 385 | if search by location then order always "nearest" |
| 386 | 386 | */ |
| 387 | - if (is_main_query() && geodir_is_page('search')) {
|
|
| 388 | - $search_term = get_query_var('s');
|
|
| 387 | + if (is_main_query() && geodir_is_page('search')) {
|
|
| 388 | + $search_term = get_query_var('s');
|
|
| 389 | 389 | |
| 390 | - if (trim($search_term) != '' && !isset($_REQUEST['sort_by'])) {
|
|
| 391 | - $sort_by = 'az'; |
|
| 392 | - } |
|
| 390 | + if (trim($search_term) != '' && !isset($_REQUEST['sort_by'])) {
|
|
| 391 | + $sort_by = 'az'; |
|
| 392 | + } |
|
| 393 | 393 | |
| 394 | - if ($snear != '') {
|
|
| 395 | - $sort_by = 'nearest'; |
|
| 396 | - } |
|
| 397 | - } |
|
| 394 | + if ($snear != '') {
|
|
| 395 | + $sort_by = 'nearest'; |
|
| 396 | + } |
|
| 397 | + } |
|
| 398 | 398 | |
| 399 | - switch ($sort_by): |
|
| 400 | - case 'newest': |
|
| 401 | - $orderby = "$wpdb->posts.post_date desc, "; |
|
| 402 | - break; |
|
| 403 | - case 'oldest': |
|
| 404 | - $orderby = "$wpdb->posts.post_date asc, "; |
|
| 405 | - break; |
|
| 406 | - case 'low_review': |
|
| 407 | - case 'rating_count_asc': |
|
| 408 | - $orderby = $table . ".rating_count ASC, " . $table . ".overall_rating ASC, "; |
|
| 409 | - break; |
|
| 410 | - case 'high_review': |
|
| 411 | - case 'rating_count_desc': |
|
| 399 | + switch ($sort_by): |
|
| 400 | + case 'newest': |
|
| 401 | + $orderby = "$wpdb->posts.post_date desc, "; |
|
| 402 | + break; |
|
| 403 | + case 'oldest': |
|
| 404 | + $orderby = "$wpdb->posts.post_date asc, "; |
|
| 405 | + break; |
|
| 406 | + case 'low_review': |
|
| 407 | + case 'rating_count_asc': |
|
| 408 | + $orderby = $table . ".rating_count ASC, " . $table . ".overall_rating ASC, "; |
|
| 409 | + break; |
|
| 410 | + case 'high_review': |
|
| 411 | + case 'rating_count_desc': |
|
| 412 | 412 | $orderby = $table . ".rating_count DESC, " . $table . ".overall_rating DESC, "; |
| 413 | - break; |
|
| 414 | - case 'low_rating': |
|
| 415 | - $orderby = "( " . $table . ".overall_rating ) ASC, " . $table . ".rating_count ASC, "; |
|
| 416 | - break; |
|
| 417 | - case 'high_rating': |
|
| 418 | - $orderby = " " . $table . ".overall_rating DESC, " . $table . ".rating_count DESC, "; |
|
| 419 | - break; |
|
| 420 | - case 'featured': |
|
| 421 | - $orderby = $table . ".is_featured asc, "; |
|
| 422 | - break; |
|
| 423 | - case 'nearest': |
|
| 424 | - $orderby = " distance asc, "; |
|
| 425 | - break; |
|
| 426 | - case 'farthest': |
|
| 427 | - $orderby = " distance desc, "; |
|
| 428 | - break; |
|
| 429 | - case 'random': |
|
| 430 | - $orderby = " rand(), "; |
|
| 431 | - break; |
|
| 432 | - case 'az': |
|
| 433 | - $orderby = "$wpdb->posts.post_title asc, "; |
|
| 434 | - break; |
|
| 435 | - default: |
|
| 436 | - |
|
| 437 | - break; |
|
| 438 | - endswitch; |
|
| 439 | - |
|
| 440 | - global $s; |
|
| 441 | - |
|
| 442 | - if (is_search() && isset($_REQUEST['geodir_search']) && $s && trim($s) != '') {
|
|
| 443 | - $keywords = explode(" ", $s);
|
|
| 444 | - if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
|
|
| 445 | - foreach($keywords as $kkey=>$kword){
|
|
| 446 | - if(mb_strlen($kword, 'UTF-8')<=$klimit){
|
|
| 447 | - unset($keywords[$kkey]); |
|
| 448 | - } |
|
| 449 | - } |
|
| 450 | - } |
|
| 451 | - if ($sort_by == 'nearest' || $sort_by == 'farthest') {
|
|
| 452 | - if (count($keywords) > 1) {
|
|
| 453 | - $orderby = $orderby . " ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, "; |
|
| 454 | - } else {
|
|
| 455 | - $orderby = $orderby . " ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, "; |
|
| 456 | - } |
|
| 457 | - } else {
|
|
| 458 | - if (count($keywords) > 1) {
|
|
| 459 | - $orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, " . $orderby; |
|
| 460 | - } else {
|
|
| 461 | - $orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, " . $orderby; |
|
| 462 | - } |
|
| 463 | - } |
|
| 464 | - } |
|
| 413 | + break; |
|
| 414 | + case 'low_rating': |
|
| 415 | + $orderby = "( " . $table . ".overall_rating ) ASC, " . $table . ".rating_count ASC, "; |
|
| 416 | + break; |
|
| 417 | + case 'high_rating': |
|
| 418 | + $orderby = " " . $table . ".overall_rating DESC, " . $table . ".rating_count DESC, "; |
|
| 419 | + break; |
|
| 420 | + case 'featured': |
|
| 421 | + $orderby = $table . ".is_featured asc, "; |
|
| 422 | + break; |
|
| 423 | + case 'nearest': |
|
| 424 | + $orderby = " distance asc, "; |
|
| 425 | + break; |
|
| 426 | + case 'farthest': |
|
| 427 | + $orderby = " distance desc, "; |
|
| 428 | + break; |
|
| 429 | + case 'random': |
|
| 430 | + $orderby = " rand(), "; |
|
| 431 | + break; |
|
| 432 | + case 'az': |
|
| 433 | + $orderby = "$wpdb->posts.post_title asc, "; |
|
| 434 | + break; |
|
| 435 | + default: |
|
| 436 | + |
|
| 437 | + break; |
|
| 438 | + endswitch; |
|
| 439 | + |
|
| 440 | + global $s; |
|
| 441 | + |
|
| 442 | + if (is_search() && isset($_REQUEST['geodir_search']) && $s && trim($s) != '') {
|
|
| 443 | + $keywords = explode(" ", $s);
|
|
| 444 | + if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
|
|
| 445 | + foreach($keywords as $kkey=>$kword){
|
|
| 446 | + if(mb_strlen($kword, 'UTF-8')<=$klimit){
|
|
| 447 | + unset($keywords[$kkey]); |
|
| 448 | + } |
|
| 449 | + } |
|
| 450 | + } |
|
| 451 | + if ($sort_by == 'nearest' || $sort_by == 'farthest') {
|
|
| 452 | + if (count($keywords) > 1) {
|
|
| 453 | + $orderby = $orderby . " ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, "; |
|
| 454 | + } else {
|
|
| 455 | + $orderby = $orderby . " ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, "; |
|
| 456 | + } |
|
| 457 | + } else {
|
|
| 458 | + if (count($keywords) > 1) {
|
|
| 459 | + $orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, " . $orderby; |
|
| 460 | + } else {
|
|
| 461 | + $orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, " . $orderby; |
|
| 462 | + } |
|
| 463 | + } |
|
| 464 | + } |
|
| 465 | 465 | |
| 466 | - /** |
|
| 467 | - * Filter order by SQL. |
|
| 468 | - * |
|
| 469 | - * @since 1.0.0 |
|
| 470 | - * @param string $orderby The orderby query string. |
|
| 471 | - * @param string $sort_by Sortby query string. |
|
| 472 | - * @param string $table Listing table name. |
|
| 473 | - */ |
|
| 474 | - $orderby = apply_filters('geodir_posts_order_by_sort', $orderby, $sort_by, $table);
|
|
| 466 | + /** |
|
| 467 | + * Filter order by SQL. |
|
| 468 | + * |
|
| 469 | + * @since 1.0.0 |
|
| 470 | + * @param string $orderby The orderby query string. |
|
| 471 | + * @param string $sort_by Sortby query string. |
|
| 472 | + * @param string $table Listing table name. |
|
| 473 | + */ |
|
| 474 | + $orderby = apply_filters('geodir_posts_order_by_sort', $orderby, $sort_by, $table);
|
|
| 475 | 475 | |
| 476 | - $orderby .= $table . ".is_featured asc, $wpdb->posts.post_date desc, $wpdb->posts.post_title "; |
|
| 476 | + $orderby .= $table . ".is_featured asc, $wpdb->posts.post_date desc, $wpdb->posts.post_title "; |
|
| 477 | 477 | |
| 478 | - return $orderby; |
|
| 478 | + return $orderby; |
|
| 479 | 479 | } |
| 480 | 480 | |
| 481 | 481 | |
@@ -493,53 +493,53 @@ discard block |
||
| 493 | 493 | function geodir_posts_order_by_custom_sort($orderby, $sort_by, $table) |
| 494 | 494 | {
|
| 495 | 495 | |
| 496 | - global $wpdb; |
|
| 496 | + global $wpdb; |
|
| 497 | 497 | |
| 498 | - if ($sort_by != '' && !is_search()) {
|
|
| 498 | + if ($sort_by != '' && !is_search()) {
|
|
| 499 | 499 | |
| 500 | - $sort_array = explode('_', $sort_by);
|
|
| 500 | + $sort_array = explode('_', $sort_by);
|
|
| 501 | 501 | |
| 502 | - $sort_by_count = count($sort_array); |
|
| 502 | + $sort_by_count = count($sort_array); |
|
| 503 | 503 | |
| 504 | - $order = $sort_array[$sort_by_count - 1]; |
|
| 504 | + $order = $sort_array[$sort_by_count - 1]; |
|
| 505 | 505 | |
| 506 | - if ($sort_by_count > 1 && ($order == 'asc' || $order == 'desc')) {
|
|
| 506 | + if ($sort_by_count > 1 && ($order == 'asc' || $order == 'desc')) {
|
|
| 507 | 507 | |
| 508 | - $sort_by = str_replace('_' . $order, '', $sort_by);
|
|
| 508 | + $sort_by = str_replace('_' . $order, '', $sort_by);
|
|
| 509 | 509 | |
| 510 | - switch ($sort_by): |
|
| 510 | + switch ($sort_by): |
|
| 511 | 511 | |
| 512 | - case 'post_date': |
|
| 513 | - case 'comment_count': |
|
| 512 | + case 'post_date': |
|
| 513 | + case 'comment_count': |
|
| 514 | 514 | |
| 515 | - $orderby = "$wpdb->posts." . $sort_by . " " . $order . ", ".$table . ".overall_rating " . $order . ", "; |
|
| 516 | - break; |
|
| 515 | + $orderby = "$wpdb->posts." . $sort_by . " " . $order . ", ".$table . ".overall_rating " . $order . ", "; |
|
| 516 | + break; |
|
| 517 | 517 | |
| 518 | - case 'distance': |
|
| 519 | - $orderby = $sort_by . " " . $order . ", "; |
|
| 520 | - break; |
|
| 518 | + case 'distance': |
|
| 519 | + $orderby = $sort_by . " " . $order . ", "; |
|
| 520 | + break; |
|
| 521 | 521 | |
| 522 | 522 | |
| 523 | - // sort by rating |
|
| 524 | - case 'overall_rating': |
|
| 525 | - $orderby = " " . $table . "." . $sort_by . " " . $order . ", " . $table . ".rating_count " . $order . ", "; |
|
| 523 | + // sort by rating |
|
| 524 | + case 'overall_rating': |
|
| 525 | + $orderby = " " . $table . "." . $sort_by . " " . $order . ", " . $table . ".rating_count " . $order . ", "; |
|
| 526 | 526 | |
| 527 | - break; |
|
| 527 | + break; |
|
| 528 | 528 | |
| 529 | 529 | |
| 530 | - default: |
|
| 531 | - if (geodir_column_exist($table, $sort_by)) {
|
|
| 530 | + default: |
|
| 531 | + if (geodir_column_exist($table, $sort_by)) {
|
|
| 532 | 532 | $orderby = $table . "." . $sort_by . " " . $order . ", "; |
| 533 | 533 | } |
| 534 | - break; |
|
| 534 | + break; |
|
| 535 | 535 | |
| 536 | - endswitch; |
|
| 536 | + endswitch; |
|
| 537 | 537 | |
| 538 | - } |
|
| 538 | + } |
|
| 539 | 539 | |
| 540 | - } |
|
| 540 | + } |
|
| 541 | 541 | |
| 542 | - return $orderby; |
|
| 542 | + return $orderby; |
|
| 543 | 543 | } |
| 544 | 544 | |
| 545 | 545 | /** |
@@ -554,34 +554,34 @@ discard block |
||
| 554 | 554 | {
|
| 555 | 555 | |
| 556 | 556 | |
| 557 | - global $wpdb, $geodir_post_type, $table, $s, $snear; |
|
| 557 | + global $wpdb, $geodir_post_type, $table, $s, $snear; |
|
| 558 | 558 | |
| 559 | - if (!is_admin()) {
|
|
| 559 | + if (!is_admin()) {
|
|
| 560 | 560 | |
| 561 | - if (geodir_is_page('add-listing') && isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 562 | - add_filter('posts_where', 'geodir_edit_listing_where', 1);
|
|
| 561 | + if (geodir_is_page('add-listing') && isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 562 | + add_filter('posts_where', 'geodir_edit_listing_where', 1);
|
|
| 563 | 563 | |
| 564 | - } elseif ((is_search() && $_REQUEST['geodir_search'])) {
|
|
| 564 | + } elseif ((is_search() && $_REQUEST['geodir_search'])) {
|
|
| 565 | 565 | |
| 566 | - add_filter('posts_where', 'searching_filter_where', 1);
|
|
| 566 | + add_filter('posts_where', 'searching_filter_where', 1);
|
|
| 567 | 567 | |
| 568 | - if ($snear != '') |
|
| 569 | - add_filter('posts_where', 'searching_filter_where', 1);
|
|
| 568 | + if ($snear != '') |
|
| 569 | + add_filter('posts_where', 'searching_filter_where', 1);
|
|
| 570 | 570 | |
| 571 | - add_filter('posts_orderby', 'geodir_posts_orderby', 1);
|
|
| 571 | + add_filter('posts_orderby', 'geodir_posts_orderby', 1);
|
|
| 572 | 572 | |
| 573 | - } elseif (geodir_is_page('author')) {
|
|
| 573 | + } elseif (geodir_is_page('author')) {
|
|
| 574 | 574 | |
| 575 | - add_filter('posts_where', 'author_filter_where', 1);
|
|
| 575 | + add_filter('posts_where', 'author_filter_where', 1);
|
|
| 576 | 576 | |
| 577 | - } |
|
| 577 | + } |
|
| 578 | 578 | |
| 579 | - //if (!geodir_is_page('detail'))
|
|
| 580 | - add_filter('posts_where', 'geodir_default_where', 1);/**/
|
|
| 579 | + //if (!geodir_is_page('detail'))
|
|
| 580 | + add_filter('posts_where', 'geodir_default_where', 1);/**/
|
|
| 581 | 581 | |
| 582 | - //add_filter( 'user_has_cap', 'geodir_preview_post_cap', 10, 3 );// let subscribers edit their own posts |
|
| 582 | + //add_filter( 'user_has_cap', 'geodir_preview_post_cap', 10, 3 );// let subscribers edit their own posts |
|
| 583 | 583 | |
| 584 | - } |
|
| 584 | + } |
|
| 585 | 585 | } |
| 586 | 586 | |
| 587 | 587 | /** |
@@ -596,13 +596,13 @@ discard block |
||
| 596 | 596 | */ |
| 597 | 597 | function geodir_preview_post_cap($allcaps, $caps, $args) |
| 598 | 598 | {
|
| 599 | - $user_id = get_current_user_id(); |
|
| 600 | - if ($user_id && isset($_REQUEST['post_type']) && $_REQUEST['post_type'] != '' && isset($_REQUEST['p']) && $_REQUEST['p'] != '' && $args[0] == 'edit_post' && $_REQUEST['p'] == $args[2]) {
|
|
| 599 | + $user_id = get_current_user_id(); |
|
| 600 | + if ($user_id && isset($_REQUEST['post_type']) && $_REQUEST['post_type'] != '' && isset($_REQUEST['p']) && $_REQUEST['p'] != '' && $args[0] == 'edit_post' && $_REQUEST['p'] == $args[2]) {
|
|
| 601 | 601 | |
| 602 | - $allcaps['edit_posts'] = true; |
|
| 603 | - } |
|
| 604 | - //print_r($allcaps); |
|
| 605 | - return $allcaps; |
|
| 602 | + $allcaps['edit_posts'] = true; |
|
| 603 | + } |
|
| 604 | + //print_r($allcaps); |
|
| 605 | + return $allcaps; |
|
| 606 | 606 | } |
| 607 | 607 | |
| 608 | 608 | |
@@ -617,9 +617,9 @@ discard block |
||
| 617 | 617 | */ |
| 618 | 618 | function geodir_edit_listing_where($where) |
| 619 | 619 | {
|
| 620 | - global $wpdb; |
|
| 621 | - $where = $wpdb->prepare(" AND $wpdb->posts.ID = %d ", $_REQUEST['pid']);
|
|
| 622 | - return $where; |
|
| 620 | + global $wpdb; |
|
| 621 | + $where = $wpdb->prepare(" AND $wpdb->posts.ID = %d ", $_REQUEST['pid']);
|
|
| 622 | + return $where; |
|
| 623 | 623 | } |
| 624 | 624 | |
| 625 | 625 | |
@@ -636,29 +636,29 @@ discard block |
||
| 636 | 636 | */ |
| 637 | 637 | function geodir_default_where($where) |
| 638 | 638 | {
|
| 639 | - global $wp_query, $wpdb; |
|
| 640 | - |
|
| 641 | - //print_r($wp_query); |
|
| 642 | - ########### WPML ########### |
|
| 643 | - |
|
| 644 | - if (function_exists('icl_object_id')) {
|
|
| 645 | - global $sitepress, $table_prefix; |
|
| 646 | - $lang_code = ICL_LANGUAGE_CODE; |
|
| 647 | - $default_lang_code = $sitepress->get_default_language(); |
|
| 648 | - $q_post_type = isset($wp_query->query['post_type']) ? $wp_query->query['post_type'] : ''; |
|
| 649 | - //echo '##########'.$q_post_type; |
|
| 650 | - if ($lang_code && $q_post_type) {
|
|
| 651 | - $where .= " AND icl_t.language_code = '$lang_code' AND icl_t.element_type IN('post_" . $q_post_type . "') ";
|
|
| 652 | - //$where .= " AND icl_t.language_code = '$lang_code' "; |
|
| 653 | - } |
|
| 639 | + global $wp_query, $wpdb; |
|
| 654 | 640 | |
| 655 | - } |
|
| 656 | - ########### WPML ########### |
|
| 641 | + //print_r($wp_query); |
|
| 642 | + ########### WPML ########### |
|
| 643 | + |
|
| 644 | + if (function_exists('icl_object_id')) {
|
|
| 645 | + global $sitepress, $table_prefix; |
|
| 646 | + $lang_code = ICL_LANGUAGE_CODE; |
|
| 647 | + $default_lang_code = $sitepress->get_default_language(); |
|
| 648 | + $q_post_type = isset($wp_query->query['post_type']) ? $wp_query->query['post_type'] : ''; |
|
| 649 | + //echo '##########'.$q_post_type; |
|
| 650 | + if ($lang_code && $q_post_type) {
|
|
| 651 | + $where .= " AND icl_t.language_code = '$lang_code' AND icl_t.element_type IN('post_" . $q_post_type . "') ";
|
|
| 652 | + //$where .= " AND icl_t.language_code = '$lang_code' "; |
|
| 653 | + } |
|
| 654 | + |
|
| 655 | + } |
|
| 656 | + ########### WPML ########### |
|
| 657 | 657 | |
| 658 | 658 | |
| 659 | - return $where = str_replace("0 = 1", "1=1", $where);
|
|
| 659 | + return $where = str_replace("0 = 1", "1=1", $where);
|
|
| 660 | 660 | |
| 661 | - /* ====== old code start === |
|
| 661 | + /* ====== old code start === |
|
| 662 | 662 | $where = str_replace("0 = 1", "1=1", $where);
|
| 663 | 663 | $country = get_query_var('gd_country');
|
| 664 | 664 | $region = get_query_var('gd_region');
|
@@ -699,108 +699,108 @@ discard block |
||
| 699 | 699 | * @return string Modified where query string. |
| 700 | 700 | */ |
| 701 | 701 | function searching_filter_where($where) {
|
| 702 | - global $wpdb, $geodir_post_type, $table, $plugin_prefix, $dist, $mylat, $mylon, $s, $snear, $s_A, $s_SA, $search_term, $gd_session; |
|
| 702 | + global $wpdb, $geodir_post_type, $table, $plugin_prefix, $dist, $mylat, $mylon, $s, $snear, $s_A, $s_SA, $search_term, $gd_session; |
|
| 703 | 703 | |
| 704 | - $search_term = 'OR'; |
|
| 705 | - $search_term = 'AND'; |
|
| 706 | - $geodir_custom_search = ''; |
|
| 707 | - $category_search_range = ''; |
|
| 704 | + $search_term = 'OR'; |
|
| 705 | + $search_term = 'AND'; |
|
| 706 | + $geodir_custom_search = ''; |
|
| 707 | + $category_search_range = ''; |
|
| 708 | 708 | |
| 709 | - if (is_single() && get_query_var('post_type')) {
|
|
| 709 | + if (is_single() && get_query_var('post_type')) {
|
|
| 710 | 710 | return $where; |
| 711 | 711 | } |
| 712 | 712 | |
| 713 | - if (is_tax()) {
|
|
| 713 | + if (is_tax()) {
|
|
| 714 | 714 | return $where; |
| 715 | 715 | } |
| 716 | 716 | |
| 717 | 717 | $s = trim($s); |
| 718 | - $s = wp_specialchars_decode($s ,ENT_QUOTES); |
|
| 719 | - $s_A = wp_specialchars_decode($s_A ,ENT_QUOTES); |
|
| 720 | - |
|
| 721 | - $where = ''; |
|
| 722 | - $better_search_terms = ''; |
|
| 723 | - if (isset($_REQUEST['stype'])) |
|
| 724 | - $post_types = esc_attr(wp_strip_all_tags($_REQUEST['stype'])); |
|
| 725 | - else |
|
| 726 | - $post_types = 'gd_place'; |
|
| 727 | - |
|
| 728 | - if ($s != '') {
|
|
| 729 | - $keywords = explode(" ", $s);
|
|
| 730 | - if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
|
|
| 731 | - foreach($keywords as $kkey=>$kword){
|
|
| 732 | - if(mb_strlen($kword, 'UTF-8')<=$klimit){
|
|
| 733 | - unset($keywords[$kkey]); |
|
| 734 | - } |
|
| 735 | - } |
|
| 736 | - } |
|
| 718 | + $s = wp_specialchars_decode($s ,ENT_QUOTES); |
|
| 719 | + $s_A = wp_specialchars_decode($s_A ,ENT_QUOTES); |
|
| 737 | 720 | |
| 738 | - if (!empty($keywords)) {
|
|
| 739 | - foreach ($keywords as $keyword) {
|
|
| 740 | - $keyword = trim($keyword); |
|
| 741 | - $keyword = wp_specialchars_decode($keyword ,ENT_QUOTES); |
|
| 742 | - if ($keyword != '') {
|
|
| 743 | - /** |
|
| 744 | - * Filter the search query keywords SQL. |
|
| 745 | - * |
|
| 746 | - * @since 1.5.9 |
|
| 747 | - * @package GeoDirectory |
|
| 748 | - * @param string $better_search_terms The query values, default: `' OR ( ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '" OR ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '%" OR ' . $wpdb->posts . '.post_title LIKE "% ' . $keyword . '%" )'`. |
|
| 749 | - * @param array $keywords The array of keywords for the query. |
|
| 750 | - * @param string $keyword The single keyword being searched. |
|
| 751 | - */ |
|
| 721 | + $where = ''; |
|
| 722 | + $better_search_terms = ''; |
|
| 723 | + if (isset($_REQUEST['stype'])) |
|
| 724 | + $post_types = esc_attr(wp_strip_all_tags($_REQUEST['stype'])); |
|
| 725 | + else |
|
| 726 | + $post_types = 'gd_place'; |
|
| 727 | + |
|
| 728 | + if ($s != '') {
|
|
| 729 | + $keywords = explode(" ", $s);
|
|
| 730 | + if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
|
|
| 731 | + foreach($keywords as $kkey=>$kword){
|
|
| 732 | + if(mb_strlen($kword, 'UTF-8')<=$klimit){
|
|
| 733 | + unset($keywords[$kkey]); |
|
| 734 | + } |
|
| 735 | + } |
|
| 736 | + } |
|
| 737 | + |
|
| 738 | + if (!empty($keywords)) {
|
|
| 739 | + foreach ($keywords as $keyword) {
|
|
| 740 | + $keyword = trim($keyword); |
|
| 741 | + $keyword = wp_specialchars_decode($keyword ,ENT_QUOTES); |
|
| 742 | + if ($keyword != '') {
|
|
| 743 | + /** |
|
| 744 | + * Filter the search query keywords SQL. |
|
| 745 | + * |
|
| 746 | + * @since 1.5.9 |
|
| 747 | + * @package GeoDirectory |
|
| 748 | + * @param string $better_search_terms The query values, default: `' OR ( ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '" OR ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '%" OR ' . $wpdb->posts . '.post_title LIKE "% ' . $keyword . '%" )'`. |
|
| 749 | + * @param array $keywords The array of keywords for the query. |
|
| 750 | + * @param string $keyword The single keyword being searched. |
|
| 751 | + */ |
|
| 752 | 752 | $better_search_terms .= apply_filters("geodir_search_better_search_terms",' OR ( ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '" OR ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '%" OR ' . $wpdb->posts . '.post_title LIKE "% ' . $keyword . '%" )',$keywords,$keyword);
|
| 753 | - } |
|
| 754 | - } |
|
| 755 | - } |
|
| 756 | - } |
|
| 753 | + } |
|
| 754 | + } |
|
| 755 | + } |
|
| 756 | + } |
|
| 757 | 757 | |
| 758 | - /* get taxonomy */ |
|
| 759 | - $taxonomies = geodir_get_taxonomies($post_types, true); |
|
| 760 | - if($taxonomies) {
|
|
| 761 | - $taxonomies = implode("','", $taxonomies);
|
|
| 762 | - $taxonomies = "'" . $taxonomies . "'"; |
|
| 763 | - }else{$taxonomies='';}
|
|
| 758 | + /* get taxonomy */ |
|
| 759 | + $taxonomies = geodir_get_taxonomies($post_types, true); |
|
| 760 | + if($taxonomies) {
|
|
| 761 | + $taxonomies = implode("','", $taxonomies);
|
|
| 762 | + $taxonomies = "'" . $taxonomies . "'"; |
|
| 763 | + }else{$taxonomies='';}
|
|
| 764 | 764 | |
| 765 | - $content_where = $terms_where = ''; |
|
| 765 | + $content_where = $terms_where = ''; |
|
| 766 | 766 | if ($s != '') {
|
| 767 | - /** |
|
| 768 | - * Filter the search query content where values. |
|
| 769 | - * |
|
| 770 | - * @since 1.5.0 |
|
| 771 | - * @package GeoDirectory |
|
| 772 | - * @param string $content_where The query values, default: `" OR ($wpdb->posts.post_content LIKE \"$s\" OR $wpdb->posts.post_content LIKE \"$s%\" OR $wpdb->posts.post_content LIKE \"% $s%\" OR $wpdb->posts.post_content LIKE \"%>$s%\" OR $wpdb->posts.post_content LIKE \"%\n$s%\") ") "`. |
|
| 773 | - */ |
|
| 767 | + /** |
|
| 768 | + * Filter the search query content where values. |
|
| 769 | + * |
|
| 770 | + * @since 1.5.0 |
|
| 771 | + * @package GeoDirectory |
|
| 772 | + * @param string $content_where The query values, default: `" OR ($wpdb->posts.post_content LIKE \"$s\" OR $wpdb->posts.post_content LIKE \"$s%\" OR $wpdb->posts.post_content LIKE \"% $s%\" OR $wpdb->posts.post_content LIKE \"%>$s%\" OR $wpdb->posts.post_content LIKE \"%\n$s%\") ") "`. |
|
| 773 | + */ |
|
| 774 | 774 | $content_where = apply_filters("geodir_search_content_where"," OR ($wpdb->posts.post_content LIKE \"$s\" OR $wpdb->posts.post_content LIKE \"$s%\" OR $wpdb->posts.post_content LIKE \"% $s%\" OR $wpdb->posts.post_content LIKE \"%>$s%\" OR $wpdb->posts.post_content LIKE \"%\n$s%\") ");
|
| 775 | - /** |
|
| 776 | - * Filter the search query term values. |
|
| 777 | - * |
|
| 778 | - * @since 1.5.0 |
|
| 779 | - * @package GeoDirectory |
|
| 780 | - * @param string $terms_where The separator, default: `" AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) "`. |
|
| 781 | - */ |
|
| 782 | - $terms_where = apply_filters("geodir_search_terms_where"," AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) ");
|
|
| 775 | + /** |
|
| 776 | + * Filter the search query term values. |
|
| 777 | + * |
|
| 778 | + * @since 1.5.0 |
|
| 779 | + * @package GeoDirectory |
|
| 780 | + * @param string $terms_where The separator, default: `" AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) "`. |
|
| 781 | + */ |
|
| 782 | + $terms_where = apply_filters("geodir_search_terms_where"," AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) ");
|
|
| 783 | 783 | } |
| 784 | 784 | |
| 785 | - if ($snear != '') {
|
|
| 785 | + if ($snear != '') {
|
|
| 786 | 786 | |
| 787 | 787 | |
| 788 | - if (is_numeric($gd_session->get('near_me_range')) && !isset($_REQUEST['sdist'])) {
|
|
| 789 | - $dist = $gd_session->get('near_me_range');
|
|
| 790 | - } |
|
| 791 | - $lon1 = $mylon - $dist / abs(cos(deg2rad($mylat)) * 69); |
|
| 792 | - $lon2 = $mylon + $dist / abs(cos(deg2rad($mylat)) * 69); |
|
| 793 | - $lat1 = $mylat - ($dist / 69); |
|
| 794 | - $lat2 = $mylat + ($dist / 69); |
|
| 788 | + if (is_numeric($gd_session->get('near_me_range')) && !isset($_REQUEST['sdist'])) {
|
|
| 789 | + $dist = $gd_session->get('near_me_range');
|
|
| 790 | + } |
|
| 791 | + $lon1 = $mylon - $dist / abs(cos(deg2rad($mylat)) * 69); |
|
| 792 | + $lon2 = $mylon + $dist / abs(cos(deg2rad($mylat)) * 69); |
|
| 793 | + $lat1 = $mylat - ($dist / 69); |
|
| 794 | + $lat2 = $mylat + ($dist / 69); |
|
| 795 | 795 | |
| 796 | - $rlon1 = is_numeric(min($lon1, $lon2)) ? min($lon1, $lon2) : ''; |
|
| 797 | - $rlon2 = is_numeric(max($lon1, $lon2)) ? max($lon1, $lon2) : ''; |
|
| 798 | - $rlat1 = is_numeric(min($lat1, $lat2)) ? min($lat1, $lat2) : ''; |
|
| 799 | - $rlat2 = is_numeric(max($lat1, $lat2)) ? max($lat1, $lat2) : ''; |
|
| 796 | + $rlon1 = is_numeric(min($lon1, $lon2)) ? min($lon1, $lon2) : ''; |
|
| 797 | + $rlon2 = is_numeric(max($lon1, $lon2)) ? max($lon1, $lon2) : ''; |
|
| 798 | + $rlat1 = is_numeric(min($lat1, $lat2)) ? min($lat1, $lat2) : ''; |
|
| 799 | + $rlat2 = is_numeric(max($lat1, $lat2)) ? max($lat1, $lat2) : ''; |
|
| 800 | 800 | |
| 801 | 801 | |
| 802 | 802 | |
| 803 | - $where .= " AND ( ( $wpdb->posts.post_title LIKE \"$s\" $better_search_terms) |
|
| 803 | + $where .= " AND ( ( $wpdb->posts.post_title LIKE \"$s\" $better_search_terms) |
|
| 804 | 804 | $content_where |
| 805 | 805 | OR ($wpdb->posts.ID IN( |
| 806 | 806 | SELECT $wpdb->term_relationships.object_id as post_id |
@@ -817,13 +817,13 @@ discard block |
||
| 817 | 817 | AND ( " . $table . ".post_latitude between $rlat1 and $rlat2 ) |
| 818 | 818 | AND ( " . $table . ".post_longitude between $rlon1 and $rlon2 ) "; |
| 819 | 819 | |
| 820 | - if (isset($_REQUEST['sdist']) && $_REQUEST['sdist'] != 'all') {
|
|
| 821 | - $DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
|
|
| 822 | - $where .= " AND CONVERT((" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) ))),DECIMAL(64,4)) <= " . $dist;
|
|
| 823 | - } |
|
| 820 | + if (isset($_REQUEST['sdist']) && $_REQUEST['sdist'] != 'all') {
|
|
| 821 | + $DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
|
|
| 822 | + $where .= " AND CONVERT((" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) ))),DECIMAL(64,4)) <= " . $dist;
|
|
| 823 | + } |
|
| 824 | 824 | |
| 825 | - } else {
|
|
| 826 | - $where .= " AND ( ( $wpdb->posts.post_title LIKE \"$s\" $better_search_terms) |
|
| 825 | + } else {
|
|
| 826 | + $where .= " AND ( ( $wpdb->posts.post_title LIKE \"$s\" $better_search_terms) |
|
| 827 | 827 | $content_where |
| 828 | 828 | OR ( $wpdb->posts.ID IN( |
| 829 | 829 | SELECT $wpdb->term_relationships.object_id as post_id |
@@ -837,19 +837,19 @@ discard block |
||
| 837 | 837 | ) |
| 838 | 838 | AND $wpdb->posts.post_type in ('$post_types')
|
| 839 | 839 | AND ($wpdb->posts.post_status = 'publish') "; |
| 840 | - } |
|
| 840 | + } |
|
| 841 | 841 | |
| 842 | 842 | ########### WPML ########### |
| 843 | - if ( function_exists( 'icl_object_id' ) ) {
|
|
| 843 | + if ( function_exists( 'icl_object_id' ) ) {
|
|
| 844 | 844 | $lang_code = ICL_LANGUAGE_CODE; |
| 845 | 845 | |
| 846 | 846 | if ($lang_code && $post_types) {
|
| 847 | - $where .= " AND icl_t.language_code = '".$lang_code."' AND icl_t.element_type IN('post_" . $post_types . "') ";
|
|
| 848 | - } |
|
| 849 | - } |
|
| 850 | - ########### WPML ########### |
|
| 847 | + $where .= " AND icl_t.language_code = '".$lang_code."' AND icl_t.element_type IN('post_" . $post_types . "') ";
|
|
| 848 | + } |
|
| 849 | + } |
|
| 850 | + ########### WPML ########### |
|
| 851 | 851 | |
| 852 | - return $where; |
|
| 852 | + return $where; |
|
| 853 | 853 | } |
| 854 | 854 | |
| 855 | 855 | |
@@ -864,45 +864,45 @@ discard block |
||
| 864 | 864 | * @return string Modified where query string. |
| 865 | 865 | */ |
| 866 | 866 | function author_filter_where($where) {
|
| 867 | - global $wpdb, $geodir_post_type, $table, $curr; |
|
| 867 | + global $wpdb, $geodir_post_type, $table, $curr; |
|
| 868 | 868 | |
| 869 | - $curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
|
|
| 870 | - $user_id = !empty($curauth->ID) ? (int)$curauth->ID : 0; |
|
| 869 | + $curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
|
|
| 870 | + $user_id = !empty($curauth->ID) ? (int)$curauth->ID : 0; |
|
| 871 | 871 | |
| 872 | - if (isset($_REQUEST['stype'])) {
|
|
| 873 | - $where = $wpdb->prepare(" AND $wpdb->posts.post_type IN (%s) ",$_REQUEST['stype']);
|
|
| 874 | - } else {
|
|
| 875 | - $where = " AND $wpdb->posts.post_type IN ('gd_place') ";
|
|
| 876 | - } |
|
| 872 | + if (isset($_REQUEST['stype'])) {
|
|
| 873 | + $where = $wpdb->prepare(" AND $wpdb->posts.post_type IN (%s) ",$_REQUEST['stype']);
|
|
| 874 | + } else {
|
|
| 875 | + $where = " AND $wpdb->posts.post_type IN ('gd_place') ";
|
|
| 876 | + } |
|
| 877 | 877 | |
| 878 | - if ($user_id > 0) {
|
|
| 879 | - if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
|
|
| 880 | - $user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true); |
|
| 881 | - $user_fav_posts = !empty($user_fav_posts) && is_array($user_fav_posts) ? implode("','", $user_fav_posts) : '-1';
|
|
| 882 | - $where .= " AND $wpdb->posts.ID IN ('$user_fav_posts')";
|
|
| 883 | - } else |
|
| 884 | - $where .= " AND $wpdb->posts.post_author = $user_id"; |
|
| 885 | - |
|
| 886 | - if ($user_id == (int)get_current_user_id()) {
|
|
| 887 | - $where .= " AND $wpdb->posts.post_status IN ('publish','draft','pending') ";
|
|
| 888 | - } else {
|
|
| 889 | - $where .= " AND $wpdb->posts.post_status = 'publish' "; |
|
| 890 | - } |
|
| 891 | - } else {
|
|
| 892 | - $where .= " AND $wpdb->posts.post_author = '-1' AND $wpdb->posts.post_status = 'publish' "; |
|
| 893 | - } |
|
| 878 | + if ($user_id > 0) {
|
|
| 879 | + if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
|
|
| 880 | + $user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true); |
|
| 881 | + $user_fav_posts = !empty($user_fav_posts) && is_array($user_fav_posts) ? implode("','", $user_fav_posts) : '-1';
|
|
| 882 | + $where .= " AND $wpdb->posts.ID IN ('$user_fav_posts')";
|
|
| 883 | + } else |
|
| 884 | + $where .= " AND $wpdb->posts.post_author = $user_id"; |
|
| 885 | + |
|
| 886 | + if ($user_id == (int)get_current_user_id()) {
|
|
| 887 | + $where .= " AND $wpdb->posts.post_status IN ('publish','draft','pending') ";
|
|
| 888 | + } else {
|
|
| 889 | + $where .= " AND $wpdb->posts.post_status = 'publish' "; |
|
| 890 | + } |
|
| 891 | + } else {
|
|
| 892 | + $where .= " AND $wpdb->posts.post_author = '-1' AND $wpdb->posts.post_status = 'publish' "; |
|
| 893 | + } |
|
| 894 | 894 | |
| 895 | - ########### WPML ########### |
|
| 896 | - if (function_exists('icl_object_id')) {
|
|
| 897 | - $lang_code = ICL_LANGUAGE_CODE; |
|
| 898 | - if ($lang_code) {
|
|
| 899 | - $where .= " AND icl_t.language_code='" . $lang_code . "' "; |
|
| 900 | - } |
|
| 895 | + ########### WPML ########### |
|
| 896 | + if (function_exists('icl_object_id')) {
|
|
| 897 | + $lang_code = ICL_LANGUAGE_CODE; |
|
| 898 | + if ($lang_code) {
|
|
| 899 | + $where .= " AND icl_t.language_code='" . $lang_code . "' "; |
|
| 900 | + } |
|
| 901 | 901 | |
| 902 | - } |
|
| 903 | - ########### WPML ########### |
|
| 902 | + } |
|
| 903 | + ########### WPML ########### |
|
| 904 | 904 | |
| 905 | - return $where; |
|
| 905 | + return $where; |
|
| 906 | 906 | } |
| 907 | 907 | |
| 908 | 908 | /** |
@@ -917,11 +917,11 @@ discard block |
||
| 917 | 917 | */ |
| 918 | 918 | function geodir_filter_widget_join($join) |
| 919 | 919 | {
|
| 920 | - global $wp_query, $table; |
|
| 921 | - if (!empty($wp_query->query['with_pics_only'])) {
|
|
| 922 | - $join .= " LEFT JOIN " . GEODIR_ATTACHMENT_TABLE . " ON ( " . GEODIR_ATTACHMENT_TABLE . ".post_id=" . $table . ".post_id AND " . GEODIR_ATTACHMENT_TABLE . ".mime_type LIKE '%image%' )"; |
|
| 923 | - } |
|
| 924 | - return $join; |
|
| 920 | + global $wp_query, $table; |
|
| 921 | + if (!empty($wp_query->query['with_pics_only'])) {
|
|
| 922 | + $join .= " LEFT JOIN " . GEODIR_ATTACHMENT_TABLE . " ON ( " . GEODIR_ATTACHMENT_TABLE . ".post_id=" . $table . ".post_id AND " . GEODIR_ATTACHMENT_TABLE . ".mime_type LIKE '%image%' )"; |
|
| 923 | + } |
|
| 924 | + return $join; |
|
| 925 | 925 | } |
| 926 | 926 | |
| 927 | 927 | /** |
@@ -936,18 +936,18 @@ discard block |
||
| 936 | 936 | */ |
| 937 | 937 | function geodir_filter_widget_where($where) |
| 938 | 938 | {
|
| 939 | - global $wp_query, $table; |
|
| 940 | - if (!empty($wp_query->query['show_featured_only'])) {
|
|
| 941 | - $where .= " AND " . $table . ".is_featured = '1'"; |
|
| 942 | - } |
|
| 943 | - if (!empty($wp_query->query['show_special_only'])) {
|
|
| 944 | - $where .= " AND ( " . $table . ".geodir_special_offers != '' AND " . $table . ".geodir_special_offers IS NOT NULL )"; |
|
| 945 | - } |
|
| 946 | - if (!empty($wp_query->query['with_pics_only'])) {
|
|
| 947 | - $where .= " AND " . GEODIR_ATTACHMENT_TABLE . ".ID IS NOT NULL GROUP BY " . $table . ".post_id"; |
|
| 948 | - } |
|
| 949 | - if (!empty($wp_query->query['with_videos_only'])) {
|
|
| 950 | - $where .= " AND ( " . $table . ".geodir_video != '' AND " . $table . ".geodir_video IS NOT NULL )"; |
|
| 951 | - } |
|
| 952 | - return $where; |
|
| 939 | + global $wp_query, $table; |
|
| 940 | + if (!empty($wp_query->query['show_featured_only'])) {
|
|
| 941 | + $where .= " AND " . $table . ".is_featured = '1'"; |
|
| 942 | + } |
|
| 943 | + if (!empty($wp_query->query['show_special_only'])) {
|
|
| 944 | + $where .= " AND ( " . $table . ".geodir_special_offers != '' AND " . $table . ".geodir_special_offers IS NOT NULL )"; |
|
| 945 | + } |
|
| 946 | + if (!empty($wp_query->query['with_pics_only'])) {
|
|
| 947 | + $where .= " AND " . GEODIR_ATTACHMENT_TABLE . ".ID IS NOT NULL GROUP BY " . $table . ".post_id"; |
|
| 948 | + } |
|
| 949 | + if (!empty($wp_query->query['with_videos_only'])) {
|
|
| 950 | + $where .= " AND ( " . $table . ".geodir_video != '' AND " . $table . ".geodir_video IS NOT NULL )"; |
|
| 951 | + } |
|
| 952 | + return $where; |
|
| 953 | 953 | } |
| 954 | 954 | \ No newline at end of file |
@@ -99,15 +99,15 @@ discard block |
||
| 99 | 99 | } // Distance |
| 100 | 100 | |
| 101 | 101 | if (isset($_REQUEST['sgeo_lat'])) {
|
| 102 | - $mylat = (float)esc_attr($_REQUEST['sgeo_lat']); |
|
| 102 | + $mylat = (float) esc_attr($_REQUEST['sgeo_lat']); |
|
| 103 | 103 | } else {
|
| 104 | - $mylat = (float)geodir_get_current_city_lat(); |
|
| 104 | + $mylat = (float) geodir_get_current_city_lat(); |
|
| 105 | 105 | } // Latatude |
| 106 | 106 | |
| 107 | 107 | if (isset($_REQUEST['sgeo_lon'])) {
|
| 108 | - $mylon = (float)esc_attr($_REQUEST['sgeo_lon']); |
|
| 108 | + $mylon = (float) esc_attr($_REQUEST['sgeo_lon']); |
|
| 109 | 109 | } else {
|
| 110 | - $mylon = (float)geodir_get_current_city_lng(); |
|
| 110 | + $mylon = (float) geodir_get_current_city_lng(); |
|
| 111 | 111 | } // Distance |
| 112 | 112 | |
| 113 | 113 | if (isset($_REQUEST['snear'])) {
|
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | |
| 121 | 121 | if ($snear == 'NEAR ME') {
|
| 122 | 122 | $ip = $_SERVER['REMOTE_ADDR']; |
| 123 | - $addr_details = unserialize(file_get_contents('http://www.geoplugin.net/php.gp?ip=' . $ip));
|
|
| 123 | + $addr_details = unserialize(file_get_contents('http://www.geoplugin.net/php.gp?ip='.$ip));
|
|
| 124 | 124 | $mylat = stripslashes(ucfirst($addr_details[geoplugin_latitude])); |
| 125 | 125 | $mylon = stripslashes(ucfirst($addr_details[geoplugin_longitude])); |
| 126 | 126 | } |
@@ -130,9 +130,9 @@ discard block |
||
| 130 | 130 | $s_AA = str_replace(" ", "", $s);
|
| 131 | 131 | $s_A = explode(",", $s_AA);
|
| 132 | 132 | $s_A = implode('","', $s_A);
|
| 133 | - $s_A = '"' . $s_A . '"'; |
|
| 133 | + $s_A = '"'.$s_A.'"'; |
|
| 134 | 134 | } else {
|
| 135 | - $s_A = '"' . $s . '"'; |
|
| 135 | + $s_A = '"'.$s.'"'; |
|
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | if (strstr($s, ' ')) {
|
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | } |
| 194 | 194 | if (isset($query->query_vars['is_geodir_loop']) && $query->query_vars['is_geodir_loop']) {
|
| 195 | 195 | |
| 196 | - $table = $plugin_prefix . $geodir_post_type . '_detail'; |
|
| 196 | + $table = $plugin_prefix.$geodir_post_type.'_detail'; |
|
| 197 | 197 | |
| 198 | 198 | add_filter('posts_fields', 'geodir_posts_fields', 1);
|
| 199 | 199 | add_filter('posts_join', 'geodir_posts_join', 1);
|
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | global $wp_query, $wpdb, $geodir_post_type, $table, $plugin_prefix, $dist, $mylat, $mylon, $snear, $gd_session; |
| 234 | 234 | |
| 235 | 235 | // Filter-Location-Manager to add location table. |
| 236 | - $fields .= ", " . $table . ".* "; |
|
| 236 | + $fields .= ", ".$table.".* "; |
|
| 237 | 237 | |
| 238 | 238 | if ($snear != '' || $gd_session->get('all_near_me')) {
|
| 239 | 239 | $DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
|
@@ -243,16 +243,16 @@ discard block |
||
| 243 | 243 | $mylon = $gd_session->get('user_lon');
|
| 244 | 244 | } |
| 245 | 245 | |
| 246 | - $fields .= " , (" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) )))as distance ";
|
|
| 246 | + $fields .= " , (".$DistanceRadius." * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(".$table.".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(".$table.".post_latitude) * pi()/180) *POWER(SIN(($mylon - ".$table.".post_longitude) * pi()/180 / 2), 2) )))as distance ";
|
|
| 247 | 247 | } |
| 248 | 248 | |
| 249 | 249 | global $s; |
| 250 | 250 | if (is_search() && isset($_REQUEST['geodir_search']) && $s && trim($s) != '') {
|
| 251 | 251 | $keywords = explode(" ", $s);
|
| 252 | 252 | |
| 253 | - if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
|
|
| 254 | - foreach($keywords as $kkey=>$kword){
|
|
| 255 | - if(mb_strlen($kword, 'UTF-8')<=$klimit){
|
|
| 253 | + if (is_array($keywords) && $klimit = get_option('geodir_search_word_limit')) {
|
|
| 254 | + foreach ($keywords as $kkey=>$kword) {
|
|
| 255 | + if (mb_strlen($kword, 'UTF-8') <= $klimit) {
|
|
| 256 | 256 | unset($keywords[$kkey]); |
| 257 | 257 | } |
| 258 | 258 | } |
@@ -270,24 +270,24 @@ discard block |
||
| 270 | 270 | $count = 0; |
| 271 | 271 | foreach ($keywords as $keyword) {
|
| 272 | 272 | $keyword = trim($keyword); |
| 273 | - $keyword = wp_specialchars_decode($keyword ,ENT_QUOTES); |
|
| 273 | + $keyword = wp_specialchars_decode($keyword, ENT_QUOTES); |
|
| 274 | 274 | $count++; |
| 275 | 275 | if ($count < count($keywords)) {
|
| 276 | 276 | // $gd_titlematch_part .= $wpdb->posts . ".post_title LIKE '%%" . $keyword . "%%' " . $key . " "; |
| 277 | - $gd_titlematch_part .= "( " . $wpdb->posts . ".post_title LIKE '" . $keyword . "' OR " . $wpdb->posts . ".post_title LIKE '" . $keyword . "%%' OR " . $wpdb->posts . ".post_title LIKE '%% " . $keyword . "%%' ) " . $key . " "; |
|
| 277 | + $gd_titlematch_part .= "( ".$wpdb->posts.".post_title LIKE '".$keyword."' OR ".$wpdb->posts.".post_title LIKE '".$keyword."%%' OR ".$wpdb->posts.".post_title LIKE '%% ".$keyword."%%' ) ".$key." "; |
|
| 278 | 278 | } else {
|
| 279 | 279 | //$gd_titlematch_part .= $wpdb->posts . ".post_title LIKE '%%" . $keyword . "%%' "; |
| 280 | - $gd_titlematch_part .= "( " . $wpdb->posts . ".post_title LIKE '" . $keyword . "' OR " . $wpdb->posts . ".post_title LIKE '" . $keyword . "%%' OR " . $wpdb->posts . ".post_title LIKE '%% " . $keyword . "%%' ) "; |
|
| 280 | + $gd_titlematch_part .= "( ".$wpdb->posts.".post_title LIKE '".$keyword."' OR ".$wpdb->posts.".post_title LIKE '".$keyword."%%' OR ".$wpdb->posts.".post_title LIKE '%% ".$keyword."%%' ) "; |
|
| 281 | 281 | } |
| 282 | 282 | } |
| 283 | - $gd_titlematch_part .= "THEN 1 ELSE 0 END AS " . $part . ","; |
|
| 283 | + $gd_titlematch_part .= "THEN 1 ELSE 0 END AS ".$part.","; |
|
| 284 | 284 | } |
| 285 | 285 | } else {
|
| 286 | 286 | $gd_titlematch_part = ""; |
| 287 | 287 | } |
| 288 | - $s = stripslashes_deep( $s ); |
|
| 289 | - $s = wp_specialchars_decode($s,ENT_QUOTES); |
|
| 290 | - $fields .= $wpdb->prepare(", CASE WHEN " . $table . ".is_featured='1' THEN 1 ELSE 0 END AS gd_featured, CASE WHEN " . $wpdb->posts . ".post_title LIKE %s THEN 1 ELSE 0 END AS gd_exacttitle," . $gd_titlematch_part . " CASE WHEN ( " . $wpdb->posts . ".post_title LIKE %s OR " . $wpdb->posts . ".post_title LIKE %s OR " . $wpdb->posts . ".post_title LIKE %s ) THEN 1 ELSE 0 END AS gd_titlematch, CASE WHEN ( " . $wpdb->posts . ".post_content LIKE %s OR " . $wpdb->posts . ".post_content LIKE %s OR " . $wpdb->posts . ".post_content LIKE %s OR " . $wpdb->posts . ".post_content LIKE %s ) THEN 1 ELSE 0 END AS gd_content", array($s, $s, $s . '%', '% ' . $s . '%', $s, $s . ' %', '% ' . $s . ' %', '% ' . $s));
|
|
| 288 | + $s = stripslashes_deep($s); |
|
| 289 | + $s = wp_specialchars_decode($s, ENT_QUOTES); |
|
| 290 | + $fields .= $wpdb->prepare(", CASE WHEN ".$table.".is_featured='1' THEN 1 ELSE 0 END AS gd_featured, CASE WHEN ".$wpdb->posts.".post_title LIKE %s THEN 1 ELSE 0 END AS gd_exacttitle,".$gd_titlematch_part." CASE WHEN ( ".$wpdb->posts.".post_title LIKE %s OR ".$wpdb->posts.".post_title LIKE %s OR ".$wpdb->posts.".post_title LIKE %s ) THEN 1 ELSE 0 END AS gd_titlematch, CASE WHEN ( ".$wpdb->posts.".post_content LIKE %s OR ".$wpdb->posts.".post_content LIKE %s OR ".$wpdb->posts.".post_content LIKE %s OR ".$wpdb->posts.".post_content LIKE %s ) THEN 1 ELSE 0 END AS gd_content", array($s, $s, $s.'%', '% '.$s.'%', $s, $s.' %', '% '.$s.' %', '% '.$s));
|
|
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | return $fields; |
@@ -316,13 +316,13 @@ discard block |
||
| 316 | 316 | $lang_code = ICL_LANGUAGE_CODE; |
| 317 | 317 | $default_lang_code = $sitepress->get_default_language(); |
| 318 | 318 | if ($lang_code) {
|
| 319 | - $join .= "JOIN " . $table_prefix . "icl_translations icl_t ON icl_t.element_id = " . $table_prefix . "posts.ID"; |
|
| 319 | + $join .= "JOIN ".$table_prefix."icl_translations icl_t ON icl_t.element_id = ".$table_prefix."posts.ID"; |
|
| 320 | 320 | } |
| 321 | 321 | |
| 322 | 322 | } |
| 323 | 323 | ########### WPML ########### |
| 324 | 324 | |
| 325 | - $join .= " INNER JOIN " . $table . " ON (" . $table . ".post_id = $wpdb->posts.ID) ";
|
|
| 325 | + $join .= " INNER JOIN ".$table." ON (".$table.".post_id = $wpdb->posts.ID) ";
|
|
| 326 | 326 | //===old code start |
| 327 | 327 | //$join .= " INNER JOIN ".POST_LOCATION_TABLE." ON (".$table.".post_location_id = ".POST_LOCATION_TABLE.".location_id) " ;//===old code end
|
| 328 | 328 | |
@@ -405,20 +405,20 @@ discard block |
||
| 405 | 405 | break; |
| 406 | 406 | case 'low_review': |
| 407 | 407 | case 'rating_count_asc': |
| 408 | - $orderby = $table . ".rating_count ASC, " . $table . ".overall_rating ASC, "; |
|
| 408 | + $orderby = $table.".rating_count ASC, ".$table.".overall_rating ASC, "; |
|
| 409 | 409 | break; |
| 410 | 410 | case 'high_review': |
| 411 | 411 | case 'rating_count_desc': |
| 412 | - $orderby = $table . ".rating_count DESC, " . $table . ".overall_rating DESC, "; |
|
| 412 | + $orderby = $table.".rating_count DESC, ".$table.".overall_rating DESC, "; |
|
| 413 | 413 | break; |
| 414 | 414 | case 'low_rating': |
| 415 | - $orderby = "( " . $table . ".overall_rating ) ASC, " . $table . ".rating_count ASC, "; |
|
| 415 | + $orderby = "( ".$table.".overall_rating ) ASC, ".$table.".rating_count ASC, "; |
|
| 416 | 416 | break; |
| 417 | 417 | case 'high_rating': |
| 418 | - $orderby = " " . $table . ".overall_rating DESC, " . $table . ".rating_count DESC, "; |
|
| 418 | + $orderby = " ".$table.".overall_rating DESC, ".$table.".rating_count DESC, "; |
|
| 419 | 419 | break; |
| 420 | 420 | case 'featured': |
| 421 | - $orderby = $table . ".is_featured asc, "; |
|
| 421 | + $orderby = $table.".is_featured asc, "; |
|
| 422 | 422 | break; |
| 423 | 423 | case 'nearest': |
| 424 | 424 | $orderby = " distance asc, "; |
@@ -441,24 +441,24 @@ discard block |
||
| 441 | 441 | |
| 442 | 442 | if (is_search() && isset($_REQUEST['geodir_search']) && $s && trim($s) != '') {
|
| 443 | 443 | $keywords = explode(" ", $s);
|
| 444 | - if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
|
|
| 445 | - foreach($keywords as $kkey=>$kword){
|
|
| 446 | - if(mb_strlen($kword, 'UTF-8')<=$klimit){
|
|
| 444 | + if (is_array($keywords) && $klimit = get_option('geodir_search_word_limit')) {
|
|
| 445 | + foreach ($keywords as $kkey=>$kword) {
|
|
| 446 | + if (mb_strlen($kword, 'UTF-8') <= $klimit) {
|
|
| 447 | 447 | unset($keywords[$kkey]); |
| 448 | 448 | } |
| 449 | 449 | } |
| 450 | 450 | } |
| 451 | 451 | if ($sort_by == 'nearest' || $sort_by == 'farthest') {
|
| 452 | 452 | if (count($keywords) > 1) {
|
| 453 | - $orderby = $orderby . " ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, "; |
|
| 453 | + $orderby = $orderby." ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, "; |
|
| 454 | 454 | } else {
|
| 455 | - $orderby = $orderby . " ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, "; |
|
| 455 | + $orderby = $orderby." ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, "; |
|
| 456 | 456 | } |
| 457 | 457 | } else {
|
| 458 | 458 | if (count($keywords) > 1) {
|
| 459 | - $orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, " . $orderby; |
|
| 459 | + $orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, ".$orderby; |
|
| 460 | 460 | } else {
|
| 461 | - $orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, " . $orderby; |
|
| 461 | + $orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, ".$orderby; |
|
| 462 | 462 | } |
| 463 | 463 | } |
| 464 | 464 | } |
@@ -473,7 +473,7 @@ discard block |
||
| 473 | 473 | */ |
| 474 | 474 | $orderby = apply_filters('geodir_posts_order_by_sort', $orderby, $sort_by, $table);
|
| 475 | 475 | |
| 476 | - $orderby .= $table . ".is_featured asc, $wpdb->posts.post_date desc, $wpdb->posts.post_title "; |
|
| 476 | + $orderby .= $table.".is_featured asc, $wpdb->posts.post_date desc, $wpdb->posts.post_title "; |
|
| 477 | 477 | |
| 478 | 478 | return $orderby; |
| 479 | 479 | } |
@@ -505,31 +505,31 @@ discard block |
||
| 505 | 505 | |
| 506 | 506 | if ($sort_by_count > 1 && ($order == 'asc' || $order == 'desc')) {
|
| 507 | 507 | |
| 508 | - $sort_by = str_replace('_' . $order, '', $sort_by);
|
|
| 508 | + $sort_by = str_replace('_'.$order, '', $sort_by);
|
|
| 509 | 509 | |
| 510 | 510 | switch ($sort_by): |
| 511 | 511 | |
| 512 | 512 | case 'post_date': |
| 513 | 513 | case 'comment_count': |
| 514 | 514 | |
| 515 | - $orderby = "$wpdb->posts." . $sort_by . " " . $order . ", ".$table . ".overall_rating " . $order . ", "; |
|
| 515 | + $orderby = "$wpdb->posts.".$sort_by." ".$order.", ".$table.".overall_rating ".$order.", "; |
|
| 516 | 516 | break; |
| 517 | 517 | |
| 518 | 518 | case 'distance': |
| 519 | - $orderby = $sort_by . " " . $order . ", "; |
|
| 519 | + $orderby = $sort_by." ".$order.", "; |
|
| 520 | 520 | break; |
| 521 | 521 | |
| 522 | 522 | |
| 523 | 523 | // sort by rating |
| 524 | 524 | case 'overall_rating': |
| 525 | - $orderby = " " . $table . "." . $sort_by . " " . $order . ", " . $table . ".rating_count " . $order . ", "; |
|
| 525 | + $orderby = " ".$table.".".$sort_by." ".$order.", ".$table.".rating_count ".$order.", "; |
|
| 526 | 526 | |
| 527 | 527 | break; |
| 528 | 528 | |
| 529 | 529 | |
| 530 | 530 | default: |
| 531 | 531 | if (geodir_column_exist($table, $sort_by)) {
|
| 532 | - $orderby = $table . "." . $sort_by . " " . $order . ", "; |
|
| 532 | + $orderby = $table.".".$sort_by." ".$order.", "; |
|
| 533 | 533 | } |
| 534 | 534 | break; |
| 535 | 535 | |
@@ -577,7 +577,7 @@ discard block |
||
| 577 | 577 | } |
| 578 | 578 | |
| 579 | 579 | //if (!geodir_is_page('detail'))
|
| 580 | - add_filter('posts_where', 'geodir_default_where', 1);/**/
|
|
| 580 | + add_filter('posts_where', 'geodir_default_where', 1); /**/
|
|
| 581 | 581 | |
| 582 | 582 | //add_filter( 'user_has_cap', 'geodir_preview_post_cap', 10, 3 );// let subscribers edit their own posts |
| 583 | 583 | |
@@ -648,7 +648,7 @@ discard block |
||
| 648 | 648 | $q_post_type = isset($wp_query->query['post_type']) ? $wp_query->query['post_type'] : ''; |
| 649 | 649 | //echo '##########'.$q_post_type; |
| 650 | 650 | if ($lang_code && $q_post_type) {
|
| 651 | - $where .= " AND icl_t.language_code = '$lang_code' AND icl_t.element_type IN('post_" . $q_post_type . "') ";
|
|
| 651 | + $where .= " AND icl_t.language_code = '$lang_code' AND icl_t.element_type IN('post_".$q_post_type."') ";
|
|
| 652 | 652 | //$where .= " AND icl_t.language_code = '$lang_code' "; |
| 653 | 653 | } |
| 654 | 654 | |
@@ -715,8 +715,8 @@ discard block |
||
| 715 | 715 | } |
| 716 | 716 | |
| 717 | 717 | $s = trim($s); |
| 718 | - $s = wp_specialchars_decode($s ,ENT_QUOTES); |
|
| 719 | - $s_A = wp_specialchars_decode($s_A ,ENT_QUOTES); |
|
| 718 | + $s = wp_specialchars_decode($s, ENT_QUOTES); |
|
| 719 | + $s_A = wp_specialchars_decode($s_A, ENT_QUOTES); |
|
| 720 | 720 | |
| 721 | 721 | $where = ''; |
| 722 | 722 | $better_search_terms = ''; |
@@ -727,9 +727,9 @@ discard block |
||
| 727 | 727 | |
| 728 | 728 | if ($s != '') {
|
| 729 | 729 | $keywords = explode(" ", $s);
|
| 730 | - if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
|
|
| 731 | - foreach($keywords as $kkey=>$kword){
|
|
| 732 | - if(mb_strlen($kword, 'UTF-8')<=$klimit){
|
|
| 730 | + if (is_array($keywords) && $klimit = get_option('geodir_search_word_limit')) {
|
|
| 731 | + foreach ($keywords as $kkey=>$kword) {
|
|
| 732 | + if (mb_strlen($kword, 'UTF-8') <= $klimit) {
|
|
| 733 | 733 | unset($keywords[$kkey]); |
| 734 | 734 | } |
| 735 | 735 | } |
@@ -738,7 +738,7 @@ discard block |
||
| 738 | 738 | if (!empty($keywords)) {
|
| 739 | 739 | foreach ($keywords as $keyword) {
|
| 740 | 740 | $keyword = trim($keyword); |
| 741 | - $keyword = wp_specialchars_decode($keyword ,ENT_QUOTES); |
|
| 741 | + $keyword = wp_specialchars_decode($keyword, ENT_QUOTES); |
|
| 742 | 742 | if ($keyword != '') {
|
| 743 | 743 | /** |
| 744 | 744 | * Filter the search query keywords SQL. |
@@ -749,7 +749,7 @@ discard block |
||
| 749 | 749 | * @param array $keywords The array of keywords for the query. |
| 750 | 750 | * @param string $keyword The single keyword being searched. |
| 751 | 751 | */ |
| 752 | - $better_search_terms .= apply_filters("geodir_search_better_search_terms",' OR ( ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '" OR ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '%" OR ' . $wpdb->posts . '.post_title LIKE "% ' . $keyword . '%" )',$keywords,$keyword);
|
|
| 752 | + $better_search_terms .= apply_filters("geodir_search_better_search_terms", ' OR ( '.$wpdb->posts.'.post_title LIKE "'.$keyword.'" OR '.$wpdb->posts.'.post_title LIKE "'.$keyword.'%" OR '.$wpdb->posts.'.post_title LIKE "% '.$keyword.'%" )', $keywords, $keyword);
|
|
| 753 | 753 | } |
| 754 | 754 | } |
| 755 | 755 | } |
@@ -757,10 +757,10 @@ discard block |
||
| 757 | 757 | |
| 758 | 758 | /* get taxonomy */ |
| 759 | 759 | $taxonomies = geodir_get_taxonomies($post_types, true); |
| 760 | - if($taxonomies) {
|
|
| 760 | + if ($taxonomies) {
|
|
| 761 | 761 | $taxonomies = implode("','", $taxonomies);
|
| 762 | - $taxonomies = "'" . $taxonomies . "'"; |
|
| 763 | - }else{$taxonomies='';}
|
|
| 762 | + $taxonomies = "'".$taxonomies."'"; |
|
| 763 | + } else {$taxonomies = ''; }
|
|
| 764 | 764 | |
| 765 | 765 | $content_where = $terms_where = ''; |
| 766 | 766 | if ($s != '') {
|
@@ -771,7 +771,7 @@ discard block |
||
| 771 | 771 | * @package GeoDirectory |
| 772 | 772 | * @param string $content_where The query values, default: `" OR ($wpdb->posts.post_content LIKE \"$s\" OR $wpdb->posts.post_content LIKE \"$s%\" OR $wpdb->posts.post_content LIKE \"% $s%\" OR $wpdb->posts.post_content LIKE \"%>$s%\" OR $wpdb->posts.post_content LIKE \"%\n$s%\") ") "`. |
| 773 | 773 | */ |
| 774 | - $content_where = apply_filters("geodir_search_content_where"," OR ($wpdb->posts.post_content LIKE \"$s\" OR $wpdb->posts.post_content LIKE \"$s%\" OR $wpdb->posts.post_content LIKE \"% $s%\" OR $wpdb->posts.post_content LIKE \"%>$s%\" OR $wpdb->posts.post_content LIKE \"%\n$s%\") ");
|
|
| 774 | + $content_where = apply_filters("geodir_search_content_where", " OR ($wpdb->posts.post_content LIKE \"$s\" OR $wpdb->posts.post_content LIKE \"$s%\" OR $wpdb->posts.post_content LIKE \"% $s%\" OR $wpdb->posts.post_content LIKE \"%>$s%\" OR $wpdb->posts.post_content LIKE \"%\n$s%\") ");
|
|
| 775 | 775 | /** |
| 776 | 776 | * Filter the search query term values. |
| 777 | 777 | * |
@@ -779,7 +779,7 @@ discard block |
||
| 779 | 779 | * @package GeoDirectory |
| 780 | 780 | * @param string $terms_where The separator, default: `" AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) "`. |
| 781 | 781 | */ |
| 782 | - $terms_where = apply_filters("geodir_search_terms_where"," AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) ");
|
|
| 782 | + $terms_where = apply_filters("geodir_search_terms_where", " AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) ");
|
|
| 783 | 783 | } |
| 784 | 784 | |
| 785 | 785 | if ($snear != '') {
|
@@ -814,12 +814,12 @@ discard block |
||
| 814 | 814 | ) |
| 815 | 815 | AND $wpdb->posts.post_type in ('{$post_types}')
|
| 816 | 816 | AND ($wpdb->posts.post_status = 'publish') |
| 817 | - AND ( " . $table . ".post_latitude between $rlat1 and $rlat2 ) |
|
| 818 | - AND ( " . $table . ".post_longitude between $rlon1 and $rlon2 ) "; |
|
| 817 | + AND ( ".$table.".post_latitude between $rlat1 and $rlat2 ) |
|
| 818 | + AND ( ".$table.".post_longitude between $rlon1 and $rlon2 ) "; |
|
| 819 | 819 | |
| 820 | 820 | if (isset($_REQUEST['sdist']) && $_REQUEST['sdist'] != 'all') {
|
| 821 | 821 | $DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
|
| 822 | - $where .= " AND CONVERT((" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) ))),DECIMAL(64,4)) <= " . $dist;
|
|
| 822 | + $where .= " AND CONVERT((".$DistanceRadius." * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(".$table.".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(".$table.".post_latitude) * pi()/180) *POWER(SIN(($mylon - ".$table.".post_longitude) * pi()/180 / 2), 2) ))),DECIMAL(64,4)) <= ".$dist;
|
|
| 823 | 823 | } |
| 824 | 824 | |
| 825 | 825 | } else {
|
@@ -840,11 +840,11 @@ discard block |
||
| 840 | 840 | } |
| 841 | 841 | |
| 842 | 842 | ########### WPML ########### |
| 843 | - if ( function_exists( 'icl_object_id' ) ) {
|
|
| 843 | + if (function_exists('icl_object_id')) {
|
|
| 844 | 844 | $lang_code = ICL_LANGUAGE_CODE; |
| 845 | 845 | |
| 846 | 846 | if ($lang_code && $post_types) {
|
| 847 | - $where .= " AND icl_t.language_code = '".$lang_code."' AND icl_t.element_type IN('post_" . $post_types . "') ";
|
|
| 847 | + $where .= " AND icl_t.language_code = '".$lang_code."' AND icl_t.element_type IN('post_".$post_types."') ";
|
|
| 848 | 848 | } |
| 849 | 849 | } |
| 850 | 850 | ########### WPML ########### |
@@ -867,10 +867,10 @@ discard block |
||
| 867 | 867 | global $wpdb, $geodir_post_type, $table, $curr; |
| 868 | 868 | |
| 869 | 869 | $curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
|
| 870 | - $user_id = !empty($curauth->ID) ? (int)$curauth->ID : 0; |
|
| 870 | + $user_id = !empty($curauth->ID) ? (int) $curauth->ID : 0; |
|
| 871 | 871 | |
| 872 | 872 | if (isset($_REQUEST['stype'])) {
|
| 873 | - $where = $wpdb->prepare(" AND $wpdb->posts.post_type IN (%s) ",$_REQUEST['stype']);
|
|
| 873 | + $where = $wpdb->prepare(" AND $wpdb->posts.post_type IN (%s) ", $_REQUEST['stype']);
|
|
| 874 | 874 | } else {
|
| 875 | 875 | $where = " AND $wpdb->posts.post_type IN ('gd_place') ";
|
| 876 | 876 | } |
@@ -883,7 +883,7 @@ discard block |
||
| 883 | 883 | } else |
| 884 | 884 | $where .= " AND $wpdb->posts.post_author = $user_id"; |
| 885 | 885 | |
| 886 | - if ($user_id == (int)get_current_user_id()) {
|
|
| 886 | + if ($user_id == (int) get_current_user_id()) {
|
|
| 887 | 887 | $where .= " AND $wpdb->posts.post_status IN ('publish','draft','pending') ";
|
| 888 | 888 | } else {
|
| 889 | 889 | $where .= " AND $wpdb->posts.post_status = 'publish' "; |
@@ -896,7 +896,7 @@ discard block |
||
| 896 | 896 | if (function_exists('icl_object_id')) {
|
| 897 | 897 | $lang_code = ICL_LANGUAGE_CODE; |
| 898 | 898 | if ($lang_code) {
|
| 899 | - $where .= " AND icl_t.language_code='" . $lang_code . "' "; |
|
| 899 | + $where .= " AND icl_t.language_code='".$lang_code."' "; |
|
| 900 | 900 | } |
| 901 | 901 | |
| 902 | 902 | } |
@@ -919,7 +919,7 @@ discard block |
||
| 919 | 919 | {
|
| 920 | 920 | global $wp_query, $table; |
| 921 | 921 | if (!empty($wp_query->query['with_pics_only'])) {
|
| 922 | - $join .= " LEFT JOIN " . GEODIR_ATTACHMENT_TABLE . " ON ( " . GEODIR_ATTACHMENT_TABLE . ".post_id=" . $table . ".post_id AND " . GEODIR_ATTACHMENT_TABLE . ".mime_type LIKE '%image%' )"; |
|
| 922 | + $join .= " LEFT JOIN ".GEODIR_ATTACHMENT_TABLE." ON ( ".GEODIR_ATTACHMENT_TABLE.".post_id=".$table.".post_id AND ".GEODIR_ATTACHMENT_TABLE.".mime_type LIKE '%image%' )"; |
|
| 923 | 923 | } |
| 924 | 924 | return $join; |
| 925 | 925 | } |
@@ -938,16 +938,16 @@ discard block |
||
| 938 | 938 | {
|
| 939 | 939 | global $wp_query, $table; |
| 940 | 940 | if (!empty($wp_query->query['show_featured_only'])) {
|
| 941 | - $where .= " AND " . $table . ".is_featured = '1'"; |
|
| 941 | + $where .= " AND ".$table.".is_featured = '1'"; |
|
| 942 | 942 | } |
| 943 | 943 | if (!empty($wp_query->query['show_special_only'])) {
|
| 944 | - $where .= " AND ( " . $table . ".geodir_special_offers != '' AND " . $table . ".geodir_special_offers IS NOT NULL )"; |
|
| 944 | + $where .= " AND ( ".$table.".geodir_special_offers != '' AND ".$table.".geodir_special_offers IS NOT NULL )"; |
|
| 945 | 945 | } |
| 946 | 946 | if (!empty($wp_query->query['with_pics_only'])) {
|
| 947 | - $where .= " AND " . GEODIR_ATTACHMENT_TABLE . ".ID IS NOT NULL GROUP BY " . $table . ".post_id"; |
|
| 947 | + $where .= " AND ".GEODIR_ATTACHMENT_TABLE.".ID IS NOT NULL GROUP BY ".$table.".post_id"; |
|
| 948 | 948 | } |
| 949 | 949 | if (!empty($wp_query->query['with_videos_only'])) {
|
| 950 | - $where .= " AND ( " . $table . ".geodir_video != '' AND " . $table . ".geodir_video IS NOT NULL )"; |
|
| 950 | + $where .= " AND ( ".$table.".geodir_video != '' AND ".$table.".geodir_video IS NOT NULL )"; |
|
| 951 | 951 | } |
| 952 | 952 | return $where; |
| 953 | 953 | } |
| 954 | 954 | \ No newline at end of file |
@@ -24,8 +24,8 @@ discard block |
||
| 24 | 24 | function geodir_activation() |
| 25 | 25 | {
|
| 26 | 26 | |
| 27 | - geodir_install(); |
|
| 28 | - add_action('wp_loaded', 'geodir_flush_activation');
|
|
| 27 | + geodir_install(); |
|
| 28 | + add_action('wp_loaded', 'geodir_flush_activation');
|
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | /** |
@@ -36,9 +36,9 @@ discard block |
||
| 36 | 36 | */ |
| 37 | 37 | function geodir_flush_activation() |
| 38 | 38 | {
|
| 39 | - // Remove rewrite rules and then recreate rewrite rules. |
|
| 40 | - // flush late so everything is loaded |
|
| 41 | - flush_rewrite_rules(); |
|
| 39 | + // Remove rewrite rules and then recreate rewrite rules. |
|
| 40 | + // flush late so everything is loaded |
|
| 41 | + flush_rewrite_rules(); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | /** |
@@ -50,44 +50,44 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | function geodir_install() |
| 52 | 52 | {
|
| 53 | - global $geodir_settings; |
|
| 54 | - |
|
| 55 | - /** |
|
| 56 | - * Called before the GD installation scripts have run. |
|
| 57 | - * |
|
| 58 | - * @since 1.0.0 |
|
| 59 | - * @see 'geodir_installation_end' |
|
| 60 | - */ |
|
| 61 | - do_action('geodir_installation_start');
|
|
| 62 | - |
|
| 63 | - // Do install |
|
| 64 | - if (!get_option('geodir_default_data_installed')) {
|
|
| 65 | - geodir_create_tables(); // in admin db install.php |
|
| 66 | - geodir_register_defaults(); // geodir_functions/ taxonomy_functions.php |
|
| 67 | - geodir_create_default_fields(); |
|
| 68 | - //geodir_default_taxonomies(); |
|
| 69 | - geodir_set_default_options(); |
|
| 70 | - geodir_create_pages(); |
|
| 71 | - geodir_set_default_widgets(); |
|
| 72 | - gd_install_theme_compat(); |
|
| 73 | - |
|
| 74 | - update_option('geodir_default_data_installed', 1);
|
|
| 75 | - |
|
| 76 | - } |
|
| 77 | - |
|
| 78 | - if (!get_option('geodir_default_data_installed_1.2.8')) {
|
|
| 79 | - //geodir_create_tables(); // in admin db install.php |
|
| 80 | - update_option('geodir_default_data_installed_1.2.8', 1);
|
|
| 81 | - } |
|
| 82 | - |
|
| 83 | - geodir_installation_end(); |
|
| 84 | - /** |
|
| 85 | - * Called after the GD installation scripts have run. |
|
| 86 | - * |
|
| 87 | - * @since 1.0.0 |
|
| 88 | - * @see 'geodir_installation_start' |
|
| 89 | - */ |
|
| 90 | - do_action('geodir_installation_end');
|
|
| 53 | + global $geodir_settings; |
|
| 54 | + |
|
| 55 | + /** |
|
| 56 | + * Called before the GD installation scripts have run. |
|
| 57 | + * |
|
| 58 | + * @since 1.0.0 |
|
| 59 | + * @see 'geodir_installation_end' |
|
| 60 | + */ |
|
| 61 | + do_action('geodir_installation_start');
|
|
| 62 | + |
|
| 63 | + // Do install |
|
| 64 | + if (!get_option('geodir_default_data_installed')) {
|
|
| 65 | + geodir_create_tables(); // in admin db install.php |
|
| 66 | + geodir_register_defaults(); // geodir_functions/ taxonomy_functions.php |
|
| 67 | + geodir_create_default_fields(); |
|
| 68 | + //geodir_default_taxonomies(); |
|
| 69 | + geodir_set_default_options(); |
|
| 70 | + geodir_create_pages(); |
|
| 71 | + geodir_set_default_widgets(); |
|
| 72 | + gd_install_theme_compat(); |
|
| 73 | + |
|
| 74 | + update_option('geodir_default_data_installed', 1);
|
|
| 75 | + |
|
| 76 | + } |
|
| 77 | + |
|
| 78 | + if (!get_option('geodir_default_data_installed_1.2.8')) {
|
|
| 79 | + //geodir_create_tables(); // in admin db install.php |
|
| 80 | + update_option('geodir_default_data_installed_1.2.8', 1);
|
|
| 81 | + } |
|
| 82 | + |
|
| 83 | + geodir_installation_end(); |
|
| 84 | + /** |
|
| 85 | + * Called after the GD installation scripts have run. |
|
| 86 | + * |
|
| 87 | + * @since 1.0.0 |
|
| 88 | + * @see 'geodir_installation_start' |
|
| 89 | + */ |
|
| 90 | + do_action('geodir_installation_end');
|
|
| 91 | 91 | |
| 92 | 92 | |
| 93 | 93 | } |
@@ -104,16 +104,16 @@ discard block |
||
| 104 | 104 | function geodir_create_pages() |
| 105 | 105 | {
|
| 106 | 106 | |
| 107 | - //geodir_create_page( esc_sql( _x('home-map', 'page_slug', 'geodirectory') ), 'geodir_home_map_page', __('Home Map', 'geodirectory'), '',0,'publish' );
|
|
| 108 | - geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), '');
|
|
| 109 | - geodir_create_page(esc_sql(_x('add-listing', 'page_slug', 'geodirectory')), 'geodir_add_listing_page', __('Add Listing', 'geodirectory'), '');
|
|
| 110 | - geodir_create_page(esc_sql(_x('listing-preview', 'page_slug', 'geodirectory')), 'geodir_preview_page', __('Listing Preview', 'geodirectory'), '');
|
|
| 111 | - geodir_create_page(esc_sql(_x('listing-success', 'page_slug', 'geodirectory')), 'geodir_success_page', __('Listing Success', 'geodirectory'), '');
|
|
| 112 | - geodir_create_page(esc_sql(_x('location', 'page_slug', 'geodirectory')), 'geodir_location_page', __('Location', 'geodirectory'), '');
|
|
| 107 | + //geodir_create_page( esc_sql( _x('home-map', 'page_slug', 'geodirectory') ), 'geodir_home_map_page', __('Home Map', 'geodirectory'), '',0,'publish' );
|
|
| 108 | + geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), '');
|
|
| 109 | + geodir_create_page(esc_sql(_x('add-listing', 'page_slug', 'geodirectory')), 'geodir_add_listing_page', __('Add Listing', 'geodirectory'), '');
|
|
| 110 | + geodir_create_page(esc_sql(_x('listing-preview', 'page_slug', 'geodirectory')), 'geodir_preview_page', __('Listing Preview', 'geodirectory'), '');
|
|
| 111 | + geodir_create_page(esc_sql(_x('listing-success', 'page_slug', 'geodirectory')), 'geodir_success_page', __('Listing Success', 'geodirectory'), '');
|
|
| 112 | + geodir_create_page(esc_sql(_x('location', 'page_slug', 'geodirectory')), 'geodir_location_page', __('Location', 'geodirectory'), '');
|
|
| 113 | 113 | |
| 114 | - //New since 1.5.3 |
|
| 115 | - geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), '');
|
|
| 116 | - geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), '');
|
|
| 114 | + //New since 1.5.3 |
|
| 115 | + geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), '');
|
|
| 116 | + geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), '');
|
|
| 117 | 117 | |
| 118 | 118 | |
| 119 | 119 | } |
@@ -129,11 +129,11 @@ discard block |
||
| 129 | 129 | */ |
| 130 | 130 | function geodir_installation_end() |
| 131 | 131 | {
|
| 132 | - //update_option( "geodir_db_version", GEODIRECTORY_VERSION ); |
|
| 132 | + //update_option( "geodir_db_version", GEODIRECTORY_VERSION ); |
|
| 133 | 133 | |
| 134 | - update_option("geodir_installed", 1);
|
|
| 135 | - update_option("geodir_installation_redirect", 1);
|
|
| 136 | - update_option('skip_install_geodir_pages', 0);
|
|
| 134 | + update_option("geodir_installed", 1);
|
|
| 135 | + update_option("geodir_installation_redirect", 1);
|
|
| 136 | + update_option('skip_install_geodir_pages', 0);
|
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | /** |
@@ -147,45 +147,45 @@ discard block |
||
| 147 | 147 | */ |
| 148 | 148 | function geodir_set_default_options() |
| 149 | 149 | {
|
| 150 | - global $geodir_settings; |
|
| 151 | - /** |
|
| 152 | - * Contains settings array for general tab. |
|
| 153 | - * |
|
| 154 | - * @since 1.0.0 |
|
| 155 | - * @package GeoDirectory |
|
| 156 | - */ |
|
| 157 | - include_once("option-pages/general_settings_array.php");
|
|
| 158 | - /** |
|
| 159 | - * Contains settings array for design tab. |
|
| 160 | - * |
|
| 161 | - * @since 1.0.0 |
|
| 162 | - * @package GeoDirectory |
|
| 163 | - */ |
|
| 164 | - include_once("option-pages/design_settings_array.php");
|
|
| 165 | - /** |
|
| 166 | - * Contains settings array for notifications tab. |
|
| 167 | - * |
|
| 168 | - * @since 1.0.0 |
|
| 169 | - * @package GeoDirectory |
|
| 170 | - */ |
|
| 171 | - include_once("option-pages/notifications_settings_array.php");
|
|
| 172 | - /** |
|
| 173 | - * Contains settings array for permalink tab. |
|
| 174 | - * |
|
| 175 | - * @since 1.0.0 |
|
| 176 | - * @package GeoDirectory |
|
| 177 | - */ |
|
| 178 | - include_once("option-pages/permalink_settings_array.php");
|
|
| 179 | - /** |
|
| 180 | - * Contains settings array for title / meta tab. |
|
| 181 | - * |
|
| 182 | - * @since 1.5.4 |
|
| 183 | - * @package GeoDirectory |
|
| 184 | - */ |
|
| 185 | - include_once("option-pages/title_meta_settings_array.php");
|
|
| 186 | - foreach ($geodir_settings as $value) {
|
|
| 187 | - geodir_update_options($value, true); |
|
| 188 | - } |
|
| 150 | + global $geodir_settings; |
|
| 151 | + /** |
|
| 152 | + * Contains settings array for general tab. |
|
| 153 | + * |
|
| 154 | + * @since 1.0.0 |
|
| 155 | + * @package GeoDirectory |
|
| 156 | + */ |
|
| 157 | + include_once("option-pages/general_settings_array.php");
|
|
| 158 | + /** |
|
| 159 | + * Contains settings array for design tab. |
|
| 160 | + * |
|
| 161 | + * @since 1.0.0 |
|
| 162 | + * @package GeoDirectory |
|
| 163 | + */ |
|
| 164 | + include_once("option-pages/design_settings_array.php");
|
|
| 165 | + /** |
|
| 166 | + * Contains settings array for notifications tab. |
|
| 167 | + * |
|
| 168 | + * @since 1.0.0 |
|
| 169 | + * @package GeoDirectory |
|
| 170 | + */ |
|
| 171 | + include_once("option-pages/notifications_settings_array.php");
|
|
| 172 | + /** |
|
| 173 | + * Contains settings array for permalink tab. |
|
| 174 | + * |
|
| 175 | + * @since 1.0.0 |
|
| 176 | + * @package GeoDirectory |
|
| 177 | + */ |
|
| 178 | + include_once("option-pages/permalink_settings_array.php");
|
|
| 179 | + /** |
|
| 180 | + * Contains settings array for title / meta tab. |
|
| 181 | + * |
|
| 182 | + * @since 1.5.4 |
|
| 183 | + * @package GeoDirectory |
|
| 184 | + */ |
|
| 185 | + include_once("option-pages/title_meta_settings_array.php");
|
|
| 186 | + foreach ($geodir_settings as $value) {
|
|
| 187 | + geodir_update_options($value, true); |
|
| 188 | + } |
|
| 189 | 189 | |
| 190 | 190 | } |
| 191 | 191 | |
@@ -199,103 +199,103 @@ discard block |
||
| 199 | 199 | function geodir_set_default_widgets() |
| 200 | 200 | {
|
| 201 | 201 | |
| 202 | - $widget_option_list = array(); |
|
| 203 | - $widgetinfo = array(); |
|
| 204 | - $sidebarvalue_array = array(); |
|
| 205 | - $sidebars_widgets = array(); |
|
| 202 | + $widget_option_list = array(); |
|
| 203 | + $widgetinfo = array(); |
|
| 204 | + $sidebarvalue_array = array(); |
|
| 205 | + $sidebars_widgets = array(); |
|
| 206 | 206 | |
| 207 | - /*===========================*/ |
|
| 208 | - /* Widgets ON HOME PAGE */ |
|
| 209 | - /*===========================*/ |
|
| 207 | + /*===========================*/ |
|
| 208 | + /* Widgets ON HOME PAGE */ |
|
| 209 | + /*===========================*/ |
|
| 210 | 210 | |
| 211 | - $widget_option_list['geodir_home_top'] = |
|
| 212 | - array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')),
|
|
| 213 | - 'geodir_map_v3_home_map' => array("autozoom" => 1, "width" => '100%', "heigh" => '425'),
|
|
| 214 | - 'geodir_advance_search' => array()); |
|
| 211 | + $widget_option_list['geodir_home_top'] = |
|
| 212 | + array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')),
|
|
| 213 | + 'geodir_map_v3_home_map' => array("autozoom" => 1, "width" => '100%', "heigh" => '425'),
|
|
| 214 | + 'geodir_advance_search' => array()); |
|
| 215 | 215 | |
| 216 | - $widget_option_list['geodir_home_content'] = |
|
| 217 | - array('popular_post_view' => array("title" => __('Popular Places', 'geodirectory'), "layout" => 'list', "add_location_filter" => '1'));
|
|
| 216 | + $widget_option_list['geodir_home_content'] = |
|
| 217 | + array('popular_post_view' => array("title" => __('Popular Places', 'geodirectory'), "layout" => 'list', "add_location_filter" => '1'));
|
|
| 218 | 218 | |
| 219 | - $widget_option_list['geodir_home_right'] = |
|
| 220 | - array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
|
|
| 221 | - 'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
|
|
| 219 | + $widget_option_list['geodir_home_right'] = |
|
| 220 | + array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
|
|
| 221 | + 'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
|
|
| 222 | 222 | |
| 223 | - /*===========================*/ |
|
| 224 | - /* Widgets ON LISTING PAGE */ |
|
| 225 | - /*===========================*/ |
|
| 223 | + /*===========================*/ |
|
| 224 | + /* Widgets ON LISTING PAGE */ |
|
| 225 | + /*===========================*/ |
|
| 226 | 226 | |
| 227 | - $widget_option_list['geodir_listing_top'] = |
|
| 228 | - array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')),
|
|
| 229 | - 'geodir_advance_search' => array()); |
|
| 227 | + $widget_option_list['geodir_listing_top'] = |
|
| 228 | + array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')),
|
|
| 229 | + 'geodir_advance_search' => array()); |
|
| 230 | 230 | |
| 231 | - $widget_option_list['geodir_listing_right_sidebar'] = |
|
| 232 | - array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
|
|
| 233 | - 'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1),
|
|
| 234 | - 'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
|
|
| 231 | + $widget_option_list['geodir_listing_right_sidebar'] = |
|
| 232 | + array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
|
|
| 233 | + 'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1),
|
|
| 234 | + 'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
|
|
| 235 | 235 | |
| 236 | 236 | |
| 237 | - /*===========================*/ |
|
| 238 | - /* Widgets ON SEARCH PAGE */ |
|
| 239 | - /*===========================*/ |
|
| 237 | + /*===========================*/ |
|
| 238 | + /* Widgets ON SEARCH PAGE */ |
|
| 239 | + /*===========================*/ |
|
| 240 | 240 | |
| 241 | - $widget_option_list['geodir_search_top'] = |
|
| 242 | - array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')),
|
|
| 243 | - 'geodir_advance_search' => array()); |
|
| 241 | + $widget_option_list['geodir_search_top'] = |
|
| 242 | + array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')),
|
|
| 243 | + 'geodir_advance_search' => array()); |
|
| 244 | 244 | |
| 245 | - $widget_option_list['geodir_search_right_sidebar'] = |
|
| 246 | - array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
|
|
| 247 | - 'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1),
|
|
| 248 | - 'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
|
|
| 245 | + $widget_option_list['geodir_search_right_sidebar'] = |
|
| 246 | + array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
|
|
| 247 | + 'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1),
|
|
| 248 | + 'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
|
|
| 249 | 249 | |
| 250 | - /*===========================*/ |
|
| 251 | - /* Widgets ON DETAIL/SINGLE PAGE */ |
|
| 252 | - /*===========================*/ |
|
| 250 | + /*===========================*/ |
|
| 251 | + /* Widgets ON DETAIL/SINGLE PAGE */ |
|
| 252 | + /*===========================*/ |
|
| 253 | 253 | |
| 254 | - $widget_option_list['geodir_detail_sidebar'] = |
|
| 255 | - array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
|
|
| 256 | - 'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1),
|
|
| 257 | - 'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
|
|
| 254 | + $widget_option_list['geodir_detail_sidebar'] = |
|
| 255 | + array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
|
|
| 256 | + 'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1),
|
|
| 257 | + 'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
|
|
| 258 | 258 | |
| 259 | 259 | |
| 260 | - /*===========================*/ |
|
| 261 | - /* Widgets ON AUTHOR PAGE */ |
|
| 262 | - /*===========================*/ |
|
| 260 | + /*===========================*/ |
|
| 261 | + /* Widgets ON AUTHOR PAGE */ |
|
| 262 | + /*===========================*/ |
|
| 263 | 263 | |
| 264 | 264 | |
| 265 | - $widget_option_list['geodir_author_right_sidebar'] = |
|
| 266 | - array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')));
|
|
| 265 | + $widget_option_list['geodir_author_right_sidebar'] = |
|
| 266 | + array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')));
|
|
| 267 | 267 | |
| 268 | 268 | |
| 269 | - $sidebars_widgets = get_option('sidebars_widgets');
|
|
| 269 | + $sidebars_widgets = get_option('sidebars_widgets');
|
|
| 270 | 270 | |
| 271 | - foreach ($widget_option_list as $key => $widget_options) {
|
|
| 271 | + foreach ($widget_option_list as $key => $widget_options) {
|
|
| 272 | 272 | |
| 273 | - foreach ($widget_options as $key2 => $widget_options_obj) {
|
|
| 274 | - $widgetid = 'widget_' . $key2; |
|
| 273 | + foreach ($widget_options as $key2 => $widget_options_obj) {
|
|
| 274 | + $widgetid = 'widget_' . $key2; |
|
| 275 | 275 | |
| 276 | - $widgetinfo[$widgetid][] = $widget_options_obj; |
|
| 276 | + $widgetinfo[$widgetid][] = $widget_options_obj; |
|
| 277 | 277 | |
| 278 | - $sidebarvalue_array[$key][] = $key2 . "-" . (count($widgetinfo[$widgetid])); |
|
| 278 | + $sidebarvalue_array[$key][] = $key2 . "-" . (count($widgetinfo[$widgetid])); |
|
| 279 | 279 | |
| 280 | - $widget_update[$widgetid][count($widgetinfo[$widgetid])] = $widget_options_obj; |
|
| 280 | + $widget_update[$widgetid][count($widgetinfo[$widgetid])] = $widget_options_obj; |
|
| 281 | 281 | |
| 282 | - } |
|
| 282 | + } |
|
| 283 | 283 | |
| 284 | - if (!empty($sidebarvalue_array[$key])) {
|
|
| 284 | + if (!empty($sidebarvalue_array[$key])) {
|
|
| 285 | 285 | |
| 286 | - $sidebars_widgets = get_option('sidebars_widgets');
|
|
| 287 | - $sidebars_widgets[$key] = $sidebarvalue_array[$key]; |
|
| 288 | - update_option('sidebars_widgets', $sidebars_widgets);
|
|
| 286 | + $sidebars_widgets = get_option('sidebars_widgets');
|
|
| 287 | + $sidebars_widgets[$key] = $sidebarvalue_array[$key]; |
|
| 288 | + update_option('sidebars_widgets', $sidebars_widgets);
|
|
| 289 | 289 | |
| 290 | - foreach ($widget_update as $key => $value) {
|
|
| 290 | + foreach ($widget_update as $key => $value) {
|
|
| 291 | 291 | |
| 292 | - update_option($key, $value); |
|
| 292 | + update_option($key, $value); |
|
| 293 | 293 | |
| 294 | - } |
|
| 294 | + } |
|
| 295 | 295 | |
| 296 | - } |
|
| 296 | + } |
|
| 297 | 297 | |
| 298 | - } |
|
| 298 | + } |
|
| 299 | 299 | |
| 300 | 300 | |
| 301 | 301 | } |
@@ -271,11 +271,11 @@ |
||
| 271 | 271 | foreach ($widget_option_list as $key => $widget_options) {
|
| 272 | 272 | |
| 273 | 273 | foreach ($widget_options as $key2 => $widget_options_obj) {
|
| 274 | - $widgetid = 'widget_' . $key2; |
|
| 274 | + $widgetid = 'widget_'.$key2; |
|
| 275 | 275 | |
| 276 | 276 | $widgetinfo[$widgetid][] = $widget_options_obj; |
| 277 | 277 | |
| 278 | - $sidebarvalue_array[$key][] = $key2 . "-" . (count($widgetinfo[$widgetid])); |
|
| 278 | + $sidebarvalue_array[$key][] = $key2."-".(count($widgetinfo[$widgetid])); |
|
| 279 | 279 | |
| 280 | 280 | $widget_update[$widgetid][count($widgetinfo[$widgetid])] = $widget_options_obj; |
| 281 | 281 | |
@@ -16,28 +16,28 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | function jupiter_action_calls() |
| 18 | 18 | { |
| 19 | - // REMOVE BREADCRUMB |
|
| 20 | - remove_action('geodir_detail_before_main_content', 'geodir_breadcrumb', 20); |
|
| 21 | - remove_action('geodir_listings_before_main_content', 'geodir_breadcrumb', 20); |
|
| 22 | - remove_action('geodir_author_before_main_content', 'geodir_breadcrumb', 20); |
|
| 23 | - remove_action('geodir_search_before_main_content', 'geodir_breadcrumb', 20); |
|
| 24 | - remove_action('geodir_home_before_main_content', 'geodir_breadcrumb', 20); |
|
| 25 | - remove_action('geodir_location_before_main_content', 'geodir_breadcrumb', 20); |
|
| 26 | - |
|
| 27 | - // REMOVE PAGE TITLES |
|
| 28 | - remove_action('geodir_listings_page_title', 'geodir_action_listings_title', 10); |
|
| 29 | - remove_action('geodir_add_listing_page_title', 'geodir_action_add_listing_page_title', 10); |
|
| 30 | - remove_action('geodir_details_main_content', 'geodir_action_page_title', 20); |
|
| 31 | - remove_action('geodir_search_page_title', 'geodir_action_search_page_title', 10); |
|
| 32 | - remove_action('geodir_author_page_title', 'geodir_action_author_page_title', 10); |
|
| 33 | - |
|
| 34 | - |
|
| 35 | - // CAHNGE PAGE TITLES |
|
| 36 | - remove_action('page_title', 'mk_page_title'); |
|
| 37 | - add_action('page_title', 'gd_mk_page_title'); |
|
| 38 | - // CHANGE BREADCRUMS FOR GD PAGES |
|
| 39 | - remove_action('theme_breadcrumbs', 'mk_theme_breadcrumbs'); |
|
| 40 | - add_action('theme_breadcrumbs', 'gd_mk_theme_breadcrumbs'); |
|
| 19 | + // REMOVE BREADCRUMB |
|
| 20 | + remove_action('geodir_detail_before_main_content', 'geodir_breadcrumb', 20); |
|
| 21 | + remove_action('geodir_listings_before_main_content', 'geodir_breadcrumb', 20); |
|
| 22 | + remove_action('geodir_author_before_main_content', 'geodir_breadcrumb', 20); |
|
| 23 | + remove_action('geodir_search_before_main_content', 'geodir_breadcrumb', 20); |
|
| 24 | + remove_action('geodir_home_before_main_content', 'geodir_breadcrumb', 20); |
|
| 25 | + remove_action('geodir_location_before_main_content', 'geodir_breadcrumb', 20); |
|
| 26 | + |
|
| 27 | + // REMOVE PAGE TITLES |
|
| 28 | + remove_action('geodir_listings_page_title', 'geodir_action_listings_title', 10); |
|
| 29 | + remove_action('geodir_add_listing_page_title', 'geodir_action_add_listing_page_title', 10); |
|
| 30 | + remove_action('geodir_details_main_content', 'geodir_action_page_title', 20); |
|
| 31 | + remove_action('geodir_search_page_title', 'geodir_action_search_page_title', 10); |
|
| 32 | + remove_action('geodir_author_page_title', 'geodir_action_author_page_title', 10); |
|
| 33 | + |
|
| 34 | + |
|
| 35 | + // CAHNGE PAGE TITLES |
|
| 36 | + remove_action('page_title', 'mk_page_title'); |
|
| 37 | + add_action('page_title', 'gd_mk_page_title'); |
|
| 38 | + // CHANGE BREADCRUMS FOR GD PAGES |
|
| 39 | + remove_action('theme_breadcrumbs', 'mk_theme_breadcrumbs'); |
|
| 40 | + add_action('theme_breadcrumbs', 'gd_mk_theme_breadcrumbs'); |
|
| 41 | 41 | |
| 42 | 42 | |
| 43 | 43 | } |
@@ -52,19 +52,19 @@ discard block |
||
| 52 | 52 | function gd_mk_theme_breadcrumbs() |
| 53 | 53 | { |
| 54 | 54 | |
| 55 | - if (is_page_geodir_home() || geodir_is_page('location')) { |
|
| 56 | - jupiter_geodir_breadcrumb(); |
|
| 57 | - } elseif (geodir_is_page('listing')) { |
|
| 58 | - jupiter_geodir_breadcrumb(); |
|
| 59 | - } elseif (geodir_is_page('detail')) { |
|
| 60 | - jupiter_geodir_breadcrumb(); |
|
| 61 | - } elseif (geodir_is_page('search')) { |
|
| 62 | - jupiter_geodir_breadcrumb(); |
|
| 63 | - } elseif (geodir_is_page('author')) { |
|
| 64 | - jupiter_geodir_breadcrumb(); |
|
| 65 | - } else { |
|
| 66 | - mk_theme_breadcrumbs(); |
|
| 67 | - } |
|
| 55 | + if (is_page_geodir_home() || geodir_is_page('location')) { |
|
| 56 | + jupiter_geodir_breadcrumb(); |
|
| 57 | + } elseif (geodir_is_page('listing')) { |
|
| 58 | + jupiter_geodir_breadcrumb(); |
|
| 59 | + } elseif (geodir_is_page('detail')) { |
|
| 60 | + jupiter_geodir_breadcrumb(); |
|
| 61 | + } elseif (geodir_is_page('search')) { |
|
| 62 | + jupiter_geodir_breadcrumb(); |
|
| 63 | + } elseif (geodir_is_page('author')) { |
|
| 64 | + jupiter_geodir_breadcrumb(); |
|
| 65 | + } else { |
|
| 66 | + mk_theme_breadcrumbs(); |
|
| 67 | + } |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | /** |
@@ -76,35 +76,35 @@ discard block |
||
| 76 | 76 | */ |
| 77 | 77 | function gd_mk_page_title() |
| 78 | 78 | { |
| 79 | - global $wp; |
|
| 80 | - |
|
| 81 | - |
|
| 82 | - if (is_page_geodir_home() || geodir_is_page('location')) { |
|
| 83 | - jupiter_geodir_page_title(); |
|
| 84 | - } elseif (geodir_is_page('listing')) { |
|
| 85 | - ob_start(); // Start buffering; |
|
| 86 | - geodir_action_listings_title(); |
|
| 87 | - $gd_title = ob_get_clean(); |
|
| 88 | - $title_p = explode('">', $gd_title); |
|
| 89 | - $title = str_replace('</h1></header>', "", $title_p[2]); |
|
| 90 | - jupiter_geodir_page_title($title); |
|
| 91 | - } elseif (geodir_is_page('search')) { |
|
| 92 | - ob_start(); // Start buffering; |
|
| 93 | - geodir_action_listings_title(); |
|
| 94 | - $gd_title = ob_get_clean(); |
|
| 95 | - $title_p = explode('">', $gd_title); |
|
| 96 | - $title = str_replace('</h1></header>', "", $title_p[2]); |
|
| 97 | - jupiter_geodir_page_title($title); |
|
| 98 | - } elseif (geodir_is_page('author')) { |
|
| 99 | - ob_start(); // Start buffering; |
|
| 100 | - geodir_action_author_page_title(); |
|
| 101 | - $gd_title = ob_get_clean(); |
|
| 102 | - $gd_title = str_replace('<h1>', "", $gd_title); |
|
| 103 | - $gd_title = str_replace('</h1>', "", $gd_title); |
|
| 104 | - jupiter_geodir_page_title($gd_title); |
|
| 105 | - } else { |
|
| 106 | - mk_page_title(); |
|
| 107 | - } |
|
| 79 | + global $wp; |
|
| 80 | + |
|
| 81 | + |
|
| 82 | + if (is_page_geodir_home() || geodir_is_page('location')) { |
|
| 83 | + jupiter_geodir_page_title(); |
|
| 84 | + } elseif (geodir_is_page('listing')) { |
|
| 85 | + ob_start(); // Start buffering; |
|
| 86 | + geodir_action_listings_title(); |
|
| 87 | + $gd_title = ob_get_clean(); |
|
| 88 | + $title_p = explode('">', $gd_title); |
|
| 89 | + $title = str_replace('</h1></header>', "", $title_p[2]); |
|
| 90 | + jupiter_geodir_page_title($title); |
|
| 91 | + } elseif (geodir_is_page('search')) { |
|
| 92 | + ob_start(); // Start buffering; |
|
| 93 | + geodir_action_listings_title(); |
|
| 94 | + $gd_title = ob_get_clean(); |
|
| 95 | + $title_p = explode('">', $gd_title); |
|
| 96 | + $title = str_replace('</h1></header>', "", $title_p[2]); |
|
| 97 | + jupiter_geodir_page_title($title); |
|
| 98 | + } elseif (geodir_is_page('author')) { |
|
| 99 | + ob_start(); // Start buffering; |
|
| 100 | + geodir_action_author_page_title(); |
|
| 101 | + $gd_title = ob_get_clean(); |
|
| 102 | + $gd_title = str_replace('<h1>', "", $gd_title); |
|
| 103 | + $gd_title = str_replace('</h1>', "", $gd_title); |
|
| 104 | + jupiter_geodir_page_title($gd_title); |
|
| 105 | + } else { |
|
| 106 | + mk_page_title(); |
|
| 107 | + } |
|
| 108 | 108 | |
| 109 | 109 | |
| 110 | 110 | } |
@@ -119,48 +119,48 @@ discard block |
||
| 119 | 119 | */ |
| 120 | 120 | function jupiter_geodir_breadcrumb() |
| 121 | 121 | { |
| 122 | - $item = ''; |
|
| 123 | - ob_start(); // Start buffering; |
|
| 124 | - geodir_breadcrumb(); |
|
| 125 | - $gd_crums = ob_get_clean(); |
|
| 126 | - if ($gd_crums) { |
|
| 127 | - $gd_crums = str_replace('<div class="geodir-breadcrumb clearfix"><ul id="breadcrumbs"><li>', "", $gd_crums); |
|
| 128 | - $gd_crums = str_replace('</li></ul></div>', "", $gd_crums); |
|
| 129 | - $gd_crums = str_replace(' > ', " > ", $gd_crums); |
|
| 130 | - $gd_crums = str_replace('</li><li>', "", $gd_crums); |
|
| 131 | - $gd_crums = explode(" > ", $gd_crums); |
|
| 132 | - $trail_end = array_pop($gd_crums); |
|
| 133 | - $gd_crums['trail_end'] = $trail_end; |
|
| 134 | - //print_r($gd_crums);exit; |
|
| 135 | - //print_r($trail); |
|
| 136 | - $item = $gd_crums; |
|
| 137 | - |
|
| 138 | - } |
|
| 139 | - if (!$item) { |
|
| 140 | - return; |
|
| 141 | - } |
|
| 142 | - global $mk_options, $post; |
|
| 143 | - $post_id = global_get_post_id(); |
|
| 144 | - |
|
| 145 | - if ($post_id) { |
|
| 146 | - $local_skining = get_post_meta($post_id, '_enable_local_backgrounds', true); |
|
| 147 | - $breadcrumb_skin = get_post_meta($post_id, '_breadcrumb_skin', true); |
|
| 148 | - if ($local_skining == 'true' && !empty($breadcrumb_skin)) { |
|
| 149 | - $breadcrumb_skin_class = $breadcrumb_skin; |
|
| 150 | - } else { |
|
| 151 | - $breadcrumb_skin_class = $mk_options['breadcrumb_skin']; |
|
| 152 | - } |
|
| 153 | - } else { |
|
| 154 | - $breadcrumb_skin_class = $mk_options['breadcrumb_skin']; |
|
| 155 | - } |
|
| 156 | - |
|
| 157 | - |
|
| 158 | - $delimiter = ' / '; |
|
| 159 | - |
|
| 160 | - echo '<div id="mk-breadcrumbs"><div class="mk-breadcrumbs-inner ' . $breadcrumb_skin_class . '-skin">'; |
|
| 161 | - |
|
| 162 | - echo implode($delimiter, $item); |
|
| 163 | - echo "</div></div>"; |
|
| 122 | + $item = ''; |
|
| 123 | + ob_start(); // Start buffering; |
|
| 124 | + geodir_breadcrumb(); |
|
| 125 | + $gd_crums = ob_get_clean(); |
|
| 126 | + if ($gd_crums) { |
|
| 127 | + $gd_crums = str_replace('<div class="geodir-breadcrumb clearfix"><ul id="breadcrumbs"><li>', "", $gd_crums); |
|
| 128 | + $gd_crums = str_replace('</li></ul></div>', "", $gd_crums); |
|
| 129 | + $gd_crums = str_replace(' > ', " > ", $gd_crums); |
|
| 130 | + $gd_crums = str_replace('</li><li>', "", $gd_crums); |
|
| 131 | + $gd_crums = explode(" > ", $gd_crums); |
|
| 132 | + $trail_end = array_pop($gd_crums); |
|
| 133 | + $gd_crums['trail_end'] = $trail_end; |
|
| 134 | + //print_r($gd_crums);exit; |
|
| 135 | + //print_r($trail); |
|
| 136 | + $item = $gd_crums; |
|
| 137 | + |
|
| 138 | + } |
|
| 139 | + if (!$item) { |
|
| 140 | + return; |
|
| 141 | + } |
|
| 142 | + global $mk_options, $post; |
|
| 143 | + $post_id = global_get_post_id(); |
|
| 144 | + |
|
| 145 | + if ($post_id) { |
|
| 146 | + $local_skining = get_post_meta($post_id, '_enable_local_backgrounds', true); |
|
| 147 | + $breadcrumb_skin = get_post_meta($post_id, '_breadcrumb_skin', true); |
|
| 148 | + if ($local_skining == 'true' && !empty($breadcrumb_skin)) { |
|
| 149 | + $breadcrumb_skin_class = $breadcrumb_skin; |
|
| 150 | + } else { |
|
| 151 | + $breadcrumb_skin_class = $mk_options['breadcrumb_skin']; |
|
| 152 | + } |
|
| 153 | + } else { |
|
| 154 | + $breadcrumb_skin_class = $mk_options['breadcrumb_skin']; |
|
| 155 | + } |
|
| 156 | + |
|
| 157 | + |
|
| 158 | + $delimiter = ' / '; |
|
| 159 | + |
|
| 160 | + echo '<div id="mk-breadcrumbs"><div class="mk-breadcrumbs-inner ' . $breadcrumb_skin_class . '-skin">'; |
|
| 161 | + |
|
| 162 | + echo implode($delimiter, $item); |
|
| 163 | + echo "</div></div>"; |
|
| 164 | 164 | |
| 165 | 165 | } |
| 166 | 166 | |
@@ -174,41 +174,41 @@ discard block |
||
| 174 | 174 | */ |
| 175 | 175 | function jupiter_geodir_page_title($title = '', $subtitle = '') |
| 176 | 176 | { |
| 177 | - global $mk_options; |
|
| 178 | - |
|
| 179 | - $post_id = global_get_post_id(); |
|
| 180 | - $shadow_css = ''; |
|
| 181 | - if ($mk_options['page_title_shadow'] == 'true') { |
|
| 182 | - $shadow_css = 'mk-drop-shadow'; |
|
| 183 | - } |
|
| 184 | - |
|
| 185 | - $align = !empty($align) ? $align : 'left'; |
|
| 186 | - |
|
| 187 | - //$title = 'xxxx'; |
|
| 188 | - echo '<section id="mk-page-introduce" class="intro-' . $align . '">'; |
|
| 189 | - echo '<div class="mk-grid">'; |
|
| 190 | - if (!empty($title)) { |
|
| 191 | - echo '<h1 class="page-introduce-title ' . $shadow_css . '">' . $title . '</h1>'; |
|
| 192 | - |
|
| 193 | - } |
|
| 194 | - |
|
| 195 | - if (!empty($subtitle)) { |
|
| 196 | - echo '<div class="page-introduce-subtitle">'; |
|
| 197 | - echo $subtitle; |
|
| 198 | - echo '</div>'; |
|
| 199 | - } |
|
| 200 | - if ($mk_options['disable_breadcrumb'] == 'true') { |
|
| 201 | - if (get_post_meta($post_id, '_disable_breadcrumb', true) != 'false') { |
|
| 202 | - /** |
|
| 203 | - * Calls the theme breadcrumbs for Jupiter theme. |
|
| 204 | - * |
|
| 205 | - * @since 1.4.0 |
|
| 206 | - */ |
|
| 207 | - do_action('theme_breadcrumbs', $post_id); |
|
| 208 | - } |
|
| 209 | - } |
|
| 210 | - |
|
| 211 | - echo '<div class="clearboth"></div></div></section>'; |
|
| 177 | + global $mk_options; |
|
| 178 | + |
|
| 179 | + $post_id = global_get_post_id(); |
|
| 180 | + $shadow_css = ''; |
|
| 181 | + if ($mk_options['page_title_shadow'] == 'true') { |
|
| 182 | + $shadow_css = 'mk-drop-shadow'; |
|
| 183 | + } |
|
| 184 | + |
|
| 185 | + $align = !empty($align) ? $align : 'left'; |
|
| 186 | + |
|
| 187 | + //$title = 'xxxx'; |
|
| 188 | + echo '<section id="mk-page-introduce" class="intro-' . $align . '">'; |
|
| 189 | + echo '<div class="mk-grid">'; |
|
| 190 | + if (!empty($title)) { |
|
| 191 | + echo '<h1 class="page-introduce-title ' . $shadow_css . '">' . $title . '</h1>'; |
|
| 192 | + |
|
| 193 | + } |
|
| 194 | + |
|
| 195 | + if (!empty($subtitle)) { |
|
| 196 | + echo '<div class="page-introduce-subtitle">'; |
|
| 197 | + echo $subtitle; |
|
| 198 | + echo '</div>'; |
|
| 199 | + } |
|
| 200 | + if ($mk_options['disable_breadcrumb'] == 'true') { |
|
| 201 | + if (get_post_meta($post_id, '_disable_breadcrumb', true) != 'false') { |
|
| 202 | + /** |
|
| 203 | + * Calls the theme breadcrumbs for Jupiter theme. |
|
| 204 | + * |
|
| 205 | + * @since 1.4.0 |
|
| 206 | + */ |
|
| 207 | + do_action('theme_breadcrumbs', $post_id); |
|
| 208 | + } |
|
| 209 | + } |
|
| 210 | + |
|
| 211 | + echo '<div class="clearboth"></div></div></section>'; |
|
| 212 | 212 | |
| 213 | 213 | |
| 214 | 214 | } |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | |
| 158 | 158 | $delimiter = ' / '; |
| 159 | 159 | |
| 160 | - echo '<div id="mk-breadcrumbs"><div class="mk-breadcrumbs-inner ' . $breadcrumb_skin_class . '-skin">'; |
|
| 160 | + echo '<div id="mk-breadcrumbs"><div class="mk-breadcrumbs-inner '.$breadcrumb_skin_class.'-skin">'; |
|
| 161 | 161 | |
| 162 | 162 | echo implode($delimiter, $item); |
| 163 | 163 | echo "</div></div>"; |
@@ -185,10 +185,10 @@ discard block |
||
| 185 | 185 | $align = !empty($align) ? $align : 'left'; |
| 186 | 186 | |
| 187 | 187 | //$title = 'xxxx'; |
| 188 | - echo '<section id="mk-page-introduce" class="intro-' . $align . '">'; |
|
| 188 | + echo '<section id="mk-page-introduce" class="intro-'.$align.'">'; |
|
| 189 | 189 | echo '<div class="mk-grid">'; |
| 190 | 190 | if (!empty($title)) { |
| 191 | - echo '<h1 class="page-introduce-title ' . $shadow_css . '">' . $title . '</h1>'; |
|
| 191 | + echo '<h1 class="page-introduce-title '.$shadow_css.'">'.$title.'</h1>'; |
|
| 192 | 192 | |
| 193 | 193 | } |
| 194 | 194 | |
@@ -10,46 +10,46 @@ discard block |
||
| 10 | 10 | global $wpdb; |
| 11 | 11 | |
| 12 | 12 | if (get_option('geodirectory' . '_db_version') != GEODIRECTORY_VERSION) {
|
| 13 | - /** |
|
| 14 | - * Include custom database table related functions. |
|
| 15 | - * |
|
| 16 | - * @since 1.0.0 |
|
| 17 | - * @package GeoDirectory |
|
| 18 | - */ |
|
| 19 | - include_once('geodirectory-admin/admin_db_install.php');
|
|
| 20 | - add_action('plugins_loaded', 'geodirectory_upgrade_all', 10);
|
|
| 21 | - if (GEODIRECTORY_VERSION <= '1.3.6') {
|
|
| 22 | - add_action('plugins_loaded', 'geodir_upgrade_136', 11);
|
|
| 23 | - } |
|
| 13 | + /** |
|
| 14 | + * Include custom database table related functions. |
|
| 15 | + * |
|
| 16 | + * @since 1.0.0 |
|
| 17 | + * @package GeoDirectory |
|
| 18 | + */ |
|
| 19 | + include_once('geodirectory-admin/admin_db_install.php');
|
|
| 20 | + add_action('plugins_loaded', 'geodirectory_upgrade_all', 10);
|
|
| 21 | + if (GEODIRECTORY_VERSION <= '1.3.6') {
|
|
| 22 | + add_action('plugins_loaded', 'geodir_upgrade_136', 11);
|
|
| 23 | + } |
|
| 24 | 24 | |
| 25 | - if (GEODIRECTORY_VERSION <= '1.4.6') {
|
|
| 26 | - add_action('init', 'geodir_upgrade_146', 11);
|
|
| 27 | - } |
|
| 25 | + if (GEODIRECTORY_VERSION <= '1.4.6') {
|
|
| 26 | + add_action('init', 'geodir_upgrade_146', 11);
|
|
| 27 | + } |
|
| 28 | 28 | |
| 29 | - if (GEODIRECTORY_VERSION <= '1.4.8') {
|
|
| 30 | - add_action('init', 'geodir_upgrade_148', 11);
|
|
| 31 | - } |
|
| 29 | + if (GEODIRECTORY_VERSION <= '1.4.8') {
|
|
| 30 | + add_action('init', 'geodir_upgrade_148', 11);
|
|
| 31 | + } |
|
| 32 | 32 | |
| 33 | - if (GEODIRECTORY_VERSION <= '1.5.0') {
|
|
| 34 | - add_action('init', 'geodir_upgrade_150', 11);
|
|
| 35 | - } |
|
| 33 | + if (GEODIRECTORY_VERSION <= '1.5.0') {
|
|
| 34 | + add_action('init', 'geodir_upgrade_150', 11);
|
|
| 35 | + } |
|
| 36 | 36 | |
| 37 | - if (GEODIRECTORY_VERSION <= '1.5.2') {
|
|
| 38 | - add_action('init', 'geodir_upgrade_152', 11);
|
|
| 39 | - } |
|
| 37 | + if (GEODIRECTORY_VERSION <= '1.5.2') {
|
|
| 38 | + add_action('init', 'geodir_upgrade_152', 11);
|
|
| 39 | + } |
|
| 40 | 40 | |
| 41 | - if (GEODIRECTORY_VERSION <= '1.5.3') {
|
|
| 42 | - add_action('init', 'geodir_upgrade_153', 11);
|
|
| 43 | - } |
|
| 41 | + if (GEODIRECTORY_VERSION <= '1.5.3') {
|
|
| 42 | + add_action('init', 'geodir_upgrade_153', 11);
|
|
| 43 | + } |
|
| 44 | 44 | |
| 45 | - if (GEODIRECTORY_VERSION <= '1.5.4') {
|
|
| 46 | - add_action('init', 'geodir_upgrade_154', 11);
|
|
| 47 | - } |
|
| 45 | + if (GEODIRECTORY_VERSION <= '1.5.4') {
|
|
| 46 | + add_action('init', 'geodir_upgrade_154', 11);
|
|
| 47 | + } |
|
| 48 | 48 | |
| 49 | 49 | |
| 50 | - add_action('init', 'gd_fix_cpt_rewrite_slug', 11);// this needs to be kept for a few versions
|
|
| 50 | + add_action('init', 'gd_fix_cpt_rewrite_slug', 11);// this needs to be kept for a few versions
|
|
| 51 | 51 | |
| 52 | - update_option('geodirectory' . '_db_version', GEODIRECTORY_VERSION);
|
|
| 52 | + update_option('geodirectory' . '_db_version', GEODIRECTORY_VERSION);
|
|
| 53 | 53 | |
| 54 | 54 | } |
| 55 | 55 | |
@@ -62,9 +62,9 @@ discard block |
||
| 62 | 62 | */ |
| 63 | 63 | function geodirectory_upgrade_all() |
| 64 | 64 | {
|
| 65 | - geodir_create_tables(); |
|
| 66 | - geodir_update_review_db(); |
|
| 67 | - gd_install_theme_compat(); |
|
| 65 | + geodir_create_tables(); |
|
| 66 | + geodir_update_review_db(); |
|
| 67 | + gd_install_theme_compat(); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | /** |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | function geodir_upgrade_136() |
| 77 | 77 | {
|
| 78 | - geodir_fix_review_overall_rating(); |
|
| 78 | + geodir_fix_review_overall_rating(); |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | /** |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | * @package GeoDirectory |
| 86 | 86 | */ |
| 87 | 87 | function geodir_upgrade_146(){
|
| 88 | - gd_convert_virtual_pages(); |
|
| 88 | + gd_convert_virtual_pages(); |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | /** |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | * @package GeoDirectory |
| 96 | 96 | */ |
| 97 | 97 | function geodir_upgrade_150(){
|
| 98 | - gd_fix_cpt_rewrite_slug(); |
|
| 98 | + gd_fix_cpt_rewrite_slug(); |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | |
@@ -107,11 +107,11 @@ discard block |
||
| 107 | 107 | * @package GeoDirectory |
| 108 | 108 | */ |
| 109 | 109 | function geodir_upgrade_148(){
|
| 110 | - /* |
|
| 110 | + /* |
|
| 111 | 111 | * Blank the users google password if present as we now use oAuth 2.0 |
| 112 | 112 | */ |
| 113 | - update_option('geodir_ga_pass','');
|
|
| 114 | - update_option('geodir_ga_user','');
|
|
| 113 | + update_option('geodir_ga_pass','');
|
|
| 114 | + update_option('geodir_ga_user','');
|
|
| 115 | 115 | |
| 116 | 116 | } |
| 117 | 117 | |
@@ -123,8 +123,8 @@ discard block |
||
| 123 | 123 | * @package GeoDirectory |
| 124 | 124 | */ |
| 125 | 125 | function geodir_upgrade_153(){
|
| 126 | - geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), '');
|
|
| 127 | - geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), '');
|
|
| 126 | + geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), '');
|
|
| 127 | + geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), '');
|
|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | /** |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | * @package GeoDirectory |
| 135 | 135 | */ |
| 136 | 136 | function geodir_upgrade_154(){
|
| 137 | - geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), '');
|
|
| 137 | + geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), '');
|
|
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | /** |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | * @package GeoDirectory |
| 145 | 145 | */ |
| 146 | 146 | function geodir_upgrade_152(){
|
| 147 | - gd_fix_address_detail_table_limit(); |
|
| 147 | + gd_fix_address_detail_table_limit(); |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | |
@@ -158,12 +158,12 @@ discard block |
||
| 158 | 158 | */ |
| 159 | 159 | function geodir_update_review_db() |
| 160 | 160 | {
|
| 161 | - global $wpdb, $plugin_prefix; |
|
| 161 | + global $wpdb, $plugin_prefix; |
|
| 162 | 162 | |
| 163 | - geodir_fix_review_date(); |
|
| 164 | - geodir_fix_review_post_status(); |
|
| 165 | - geodir_fix_review_content(); |
|
| 166 | - geodir_fix_review_location(); |
|
| 163 | + geodir_fix_review_date(); |
|
| 164 | + geodir_fix_review_post_status(); |
|
| 165 | + geodir_fix_review_content(); |
|
| 166 | + geodir_fix_review_location(); |
|
| 167 | 167 | |
| 168 | 168 | } |
| 169 | 169 | |
@@ -176,8 +176,8 @@ discard block |
||
| 176 | 176 | */ |
| 177 | 177 | function geodir_fix_review_date() |
| 178 | 178 | {
|
| 179 | - global $wpdb; |
|
| 180 | - $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.post_date = c.comment_date WHERE gdr.post_date='0000-00-00 00:00:00'");
|
|
| 179 | + global $wpdb; |
|
| 180 | + $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.post_date = c.comment_date WHERE gdr.post_date='0000-00-00 00:00:00'");
|
|
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | /** |
@@ -189,8 +189,8 @@ discard block |
||
| 189 | 189 | */ |
| 190 | 190 | function geodir_fix_review_post_status() |
| 191 | 191 | {
|
| 192 | - global $wpdb; |
|
| 193 | - $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->posts p ON gdr.post_id=p.ID SET gdr.post_status = 1 WHERE gdr.post_status IS NULL AND p.post_status='publish'");
|
|
| 192 | + global $wpdb; |
|
| 193 | + $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->posts p ON gdr.post_id=p.ID SET gdr.post_status = 1 WHERE gdr.post_status IS NULL AND p.post_status='publish'");
|
|
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | /** |
@@ -203,12 +203,12 @@ discard block |
||
| 203 | 203 | */ |
| 204 | 204 | function geodir_fix_review_content() |
| 205 | 205 | {
|
| 206 | - global $wpdb; |
|
| 207 | - if ($wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.comment_content = c.comment_content WHERE gdr.comment_content IS NULL")) {
|
|
| 208 | - return true; |
|
| 209 | - } else {
|
|
| 210 | - return false; |
|
| 211 | - } |
|
| 206 | + global $wpdb; |
|
| 207 | + if ($wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.comment_content = c.comment_content WHERE gdr.comment_content IS NULL")) {
|
|
| 208 | + return true; |
|
| 209 | + } else {
|
|
| 210 | + return false; |
|
| 211 | + } |
|
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | /** |
@@ -221,20 +221,20 @@ discard block |
||
| 221 | 221 | */ |
| 222 | 222 | function geodir_fix_review_location() |
| 223 | 223 | {
|
| 224 | - global $wpdb; |
|
| 224 | + global $wpdb; |
|
| 225 | 225 | |
| 226 | - $all_postypes = geodir_get_posttypes(); |
|
| 226 | + $all_postypes = geodir_get_posttypes(); |
|
| 227 | 227 | |
| 228 | - if (!empty($all_postypes)) {
|
|
| 229 | - foreach ($all_postypes as $key) {
|
|
| 230 | - // update each GD CTP |
|
| 228 | + if (!empty($all_postypes)) {
|
|
| 229 | + foreach ($all_postypes as $key) {
|
|
| 230 | + // update each GD CTP |
|
| 231 | 231 | |
| 232 | - $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN " . $wpdb->prefix . "geodir_" . $key . "_detail d ON gdr.post_id=d.post_id SET gdr.post_latitude = d.post_latitude, gdr.post_longitude = d.post_longitude, gdr.post_city = d.post_city, gdr.post_region=d.post_region, gdr.post_country=d.post_country WHERE gdr.post_latitude IS NULL OR gdr.post_city IS NULL");
|
|
| 232 | + $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN " . $wpdb->prefix . "geodir_" . $key . "_detail d ON gdr.post_id=d.post_id SET gdr.post_latitude = d.post_latitude, gdr.post_longitude = d.post_longitude, gdr.post_city = d.post_city, gdr.post_region=d.post_region, gdr.post_country=d.post_country WHERE gdr.post_latitude IS NULL OR gdr.post_city IS NULL");
|
|
| 233 | 233 | |
| 234 | - } |
|
| 235 | - return true; |
|
| 236 | - } |
|
| 237 | - return false; |
|
| 234 | + } |
|
| 235 | + return true; |
|
| 236 | + } |
|
| 237 | + return false; |
|
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | /** |
@@ -246,25 +246,25 @@ discard block |
||
| 246 | 246 | */ |
| 247 | 247 | function geodir_fix_review_overall_rating() |
| 248 | 248 | {
|
| 249 | - global $wpdb; |
|
| 249 | + global $wpdb; |
|
| 250 | 250 | |
| 251 | - $all_postypes = geodir_get_posttypes(); |
|
| 251 | + $all_postypes = geodir_get_posttypes(); |
|
| 252 | 252 | |
| 253 | - if (!empty($all_postypes)) {
|
|
| 254 | - foreach ($all_postypes as $key) {
|
|
| 255 | - // update each GD CTP |
|
| 256 | - $reviews = $wpdb->get_results("SELECT post_id FROM " . $wpdb->prefix . "geodir_" . $key . "_detail d");
|
|
| 253 | + if (!empty($all_postypes)) {
|
|
| 254 | + foreach ($all_postypes as $key) {
|
|
| 255 | + // update each GD CTP |
|
| 256 | + $reviews = $wpdb->get_results("SELECT post_id FROM " . $wpdb->prefix . "geodir_" . $key . "_detail d");
|
|
| 257 | 257 | |
| 258 | - if (!empty($reviews)) {
|
|
| 259 | - foreach ($reviews as $post_id) {
|
|
| 260 | - geodir_update_postrating($post_id->post_id, $key); |
|
| 261 | - } |
|
| 258 | + if (!empty($reviews)) {
|
|
| 259 | + foreach ($reviews as $post_id) {
|
|
| 260 | + geodir_update_postrating($post_id->post_id, $key); |
|
| 261 | + } |
|
| 262 | 262 | |
| 263 | - } |
|
| 263 | + } |
|
| 264 | 264 | |
| 265 | - } |
|
| 265 | + } |
|
| 266 | 266 | |
| 267 | - } |
|
| 267 | + } |
|
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | |
@@ -281,367 +281,367 @@ discard block |
||
| 281 | 281 | */ |
| 282 | 282 | function gd_install_theme_compat() |
| 283 | 283 | {
|
| 284 | - global $wpdb; |
|
| 284 | + global $wpdb; |
|
| 285 | 285 | |
| 286 | - $theme_compat = array(); |
|
| 287 | - $theme_compat = get_option('gd_theme_compats');
|
|
| 286 | + $theme_compat = array(); |
|
| 287 | + $theme_compat = get_option('gd_theme_compats');
|
|
| 288 | 288 | //GDF |
| 289 | - $theme_compat['GeoDirectory_Framework'] = array( |
|
| 290 | - 'geodir_wrapper_open_id' => 'geodir_wrapper', |
|
| 291 | - 'geodir_wrapper_open_class' => '', |
|
| 292 | - 'geodir_wrapper_open_replace' => '', |
|
| 293 | - 'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->', |
|
| 294 | - 'geodir_wrapper_content_open_id' => 'geodir_content', |
|
| 295 | - 'geodir_wrapper_content_open_class' => '', |
|
| 296 | - 'geodir_wrapper_content_open_replace' => '', |
|
| 297 | - 'geodir_wrapper_content_close_replace' => '', |
|
| 298 | - 'geodir_article_open_id' => '', |
|
| 299 | - 'geodir_article_open_class' => '', |
|
| 300 | - 'geodir_article_open_replace' => '', |
|
| 301 | - 'geodir_article_close_replace' => '', |
|
| 302 | - 'geodir_sidebar_right_open_id' => '', |
|
| 303 | - 'geodir_sidebar_right_open_class' => '', |
|
| 304 | - 'geodir_sidebar_right_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
| 305 | - 'geodir_sidebar_right_close_replace' => '', |
|
| 306 | - 'geodir_sidebar_left_open_id' => '', |
|
| 307 | - 'geodir_sidebar_left_open_class' => '', |
|
| 308 | - 'geodir_sidebar_left_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
| 309 | - 'geodir_sidebar_left_close_replace' => '', |
|
| 310 | - 'geodir_main_content_open_id' => '', |
|
| 311 | - 'geodir_main_content_open_class' => '', |
|
| 312 | - 'geodir_main_content_open_replace' => '<!-- removed -->', |
|
| 313 | - 'geodir_main_content_close_replace' => '<!-- removed -->', |
|
| 314 | - 'geodir_top_content_add' => '', |
|
| 315 | - 'geodir_before_main_content_add' => '<div class="clearfix geodir-common">', |
|
| 316 | - 'geodir_before_widget_filter' => '', |
|
| 317 | - 'geodir_after_widget_filter' => '', |
|
| 318 | - 'geodir_theme_compat_css' => '', |
|
| 319 | - 'geodir_theme_compat_js' => '', |
|
| 320 | - 'geodir_theme_compat_default_options' => '', |
|
| 321 | - 'geodir_theme_compat_code' => '' |
|
| 322 | - ); |
|
| 289 | + $theme_compat['GeoDirectory_Framework'] = array( |
|
| 290 | + 'geodir_wrapper_open_id' => 'geodir_wrapper', |
|
| 291 | + 'geodir_wrapper_open_class' => '', |
|
| 292 | + 'geodir_wrapper_open_replace' => '', |
|
| 293 | + 'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->', |
|
| 294 | + 'geodir_wrapper_content_open_id' => 'geodir_content', |
|
| 295 | + 'geodir_wrapper_content_open_class' => '', |
|
| 296 | + 'geodir_wrapper_content_open_replace' => '', |
|
| 297 | + 'geodir_wrapper_content_close_replace' => '', |
|
| 298 | + 'geodir_article_open_id' => '', |
|
| 299 | + 'geodir_article_open_class' => '', |
|
| 300 | + 'geodir_article_open_replace' => '', |
|
| 301 | + 'geodir_article_close_replace' => '', |
|
| 302 | + 'geodir_sidebar_right_open_id' => '', |
|
| 303 | + 'geodir_sidebar_right_open_class' => '', |
|
| 304 | + 'geodir_sidebar_right_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
| 305 | + 'geodir_sidebar_right_close_replace' => '', |
|
| 306 | + 'geodir_sidebar_left_open_id' => '', |
|
| 307 | + 'geodir_sidebar_left_open_class' => '', |
|
| 308 | + 'geodir_sidebar_left_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
| 309 | + 'geodir_sidebar_left_close_replace' => '', |
|
| 310 | + 'geodir_main_content_open_id' => '', |
|
| 311 | + 'geodir_main_content_open_class' => '', |
|
| 312 | + 'geodir_main_content_open_replace' => '<!-- removed -->', |
|
| 313 | + 'geodir_main_content_close_replace' => '<!-- removed -->', |
|
| 314 | + 'geodir_top_content_add' => '', |
|
| 315 | + 'geodir_before_main_content_add' => '<div class="clearfix geodir-common">', |
|
| 316 | + 'geodir_before_widget_filter' => '', |
|
| 317 | + 'geodir_after_widget_filter' => '', |
|
| 318 | + 'geodir_theme_compat_css' => '', |
|
| 319 | + 'geodir_theme_compat_js' => '', |
|
| 320 | + 'geodir_theme_compat_default_options' => '', |
|
| 321 | + 'geodir_theme_compat_code' => '' |
|
| 322 | + ); |
|
| 323 | 323 | |
| 324 | 324 | //Directory Theme |
| 325 | - $theme_compat['Directory_Starter'] = array( |
|
| 326 | - 'geodir_wrapper_open_id' => 'geodir_wrapper', |
|
| 327 | - 'geodir_wrapper_open_class' => '', |
|
| 328 | - 'geodir_wrapper_open_replace' => '', |
|
| 329 | - 'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->', |
|
| 330 | - 'geodir_wrapper_content_open_id' => 'geodir_content', |
|
| 331 | - 'geodir_wrapper_content_open_class' => '', |
|
| 332 | - 'geodir_wrapper_content_open_replace' => '', |
|
| 333 | - 'geodir_wrapper_content_close_replace' => '', |
|
| 334 | - 'geodir_article_open_id' => '', |
|
| 335 | - 'geodir_article_open_class' => '', |
|
| 336 | - 'geodir_article_open_replace' => '', |
|
| 337 | - 'geodir_article_close_replace' => '', |
|
| 338 | - 'geodir_sidebar_right_open_id' => '', |
|
| 339 | - 'geodir_sidebar_right_open_class' => '', |
|
| 340 | - 'geodir_sidebar_right_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
| 341 | - 'geodir_sidebar_right_close_replace' => '', |
|
| 342 | - 'geodir_sidebar_left_open_id' => '', |
|
| 343 | - 'geodir_sidebar_left_open_class' => '', |
|
| 344 | - 'geodir_sidebar_left_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
| 345 | - 'geodir_sidebar_left_close_replace' => '', |
|
| 346 | - 'geodir_main_content_open_id' => '', |
|
| 347 | - 'geodir_main_content_open_class' => '', |
|
| 348 | - 'geodir_main_content_open_replace' => '<!-- removed -->', |
|
| 349 | - 'geodir_main_content_close_replace' => '<!-- removed -->', |
|
| 350 | - 'geodir_top_content_add' => '', |
|
| 351 | - 'geodir_before_main_content_add' => '<div class="clearfix geodir-common">', |
|
| 352 | - 'geodir_before_widget_filter' => '', |
|
| 353 | - 'geodir_after_widget_filter' => '', |
|
| 354 | - 'geodir_theme_compat_css' => '', |
|
| 355 | - 'geodir_theme_compat_js' => '', |
|
| 356 | - 'geodir_theme_compat_default_options' => '', |
|
| 357 | - 'geodir_theme_compat_code' => '' |
|
| 358 | - ); |
|
| 325 | + $theme_compat['Directory_Starter'] = array( |
|
| 326 | + 'geodir_wrapper_open_id' => 'geodir_wrapper', |
|
| 327 | + 'geodir_wrapper_open_class' => '', |
|
| 328 | + 'geodir_wrapper_open_replace' => '', |
|
| 329 | + 'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->', |
|
| 330 | + 'geodir_wrapper_content_open_id' => 'geodir_content', |
|
| 331 | + 'geodir_wrapper_content_open_class' => '', |
|
| 332 | + 'geodir_wrapper_content_open_replace' => '', |
|
| 333 | + 'geodir_wrapper_content_close_replace' => '', |
|
| 334 | + 'geodir_article_open_id' => '', |
|
| 335 | + 'geodir_article_open_class' => '', |
|
| 336 | + 'geodir_article_open_replace' => '', |
|
| 337 | + 'geodir_article_close_replace' => '', |
|
| 338 | + 'geodir_sidebar_right_open_id' => '', |
|
| 339 | + 'geodir_sidebar_right_open_class' => '', |
|
| 340 | + 'geodir_sidebar_right_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
| 341 | + 'geodir_sidebar_right_close_replace' => '', |
|
| 342 | + 'geodir_sidebar_left_open_id' => '', |
|
| 343 | + 'geodir_sidebar_left_open_class' => '', |
|
| 344 | + 'geodir_sidebar_left_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
| 345 | + 'geodir_sidebar_left_close_replace' => '', |
|
| 346 | + 'geodir_main_content_open_id' => '', |
|
| 347 | + 'geodir_main_content_open_class' => '', |
|
| 348 | + 'geodir_main_content_open_replace' => '<!-- removed -->', |
|
| 349 | + 'geodir_main_content_close_replace' => '<!-- removed -->', |
|
| 350 | + 'geodir_top_content_add' => '', |
|
| 351 | + 'geodir_before_main_content_add' => '<div class="clearfix geodir-common">', |
|
| 352 | + 'geodir_before_widget_filter' => '', |
|
| 353 | + 'geodir_after_widget_filter' => '', |
|
| 354 | + 'geodir_theme_compat_css' => '', |
|
| 355 | + 'geodir_theme_compat_js' => '', |
|
| 356 | + 'geodir_theme_compat_default_options' => '', |
|
| 357 | + 'geodir_theme_compat_code' => '' |
|
| 358 | + ); |
|
| 359 | 359 | |
| 360 | 360 | //Jobby |
| 361 | - $theme_compat['Jobby'] = $theme_compat['Directory_Starter']; |
|
| 361 | + $theme_compat['Jobby'] = $theme_compat['Directory_Starter']; |
|
| 362 | 362 | |
| 363 | 363 | //GeoProperty |
| 364 | - $theme_compat['GeoProperty'] = $theme_compat['Directory_Starter']; |
|
| 364 | + $theme_compat['GeoProperty'] = $theme_compat['Directory_Starter']; |
|
| 365 | 365 | |
| 366 | 366 | //Avada |
| 367 | - $theme_compat['Avada'] = array( |
|
| 368 | - 'geodir_wrapper_open_id' => '', |
|
| 369 | - 'geodir_wrapper_open_class' => '', |
|
| 370 | - 'geodir_wrapper_open_replace' => '<!-- removed -->', |
|
| 371 | - 'geodir_wrapper_close_replace' => '<!-- removed -->', |
|
| 372 | - 'geodir_wrapper_content_open_id' => 'content', |
|
| 373 | - 'geodir_wrapper_content_open_class' => '', |
|
| 374 | - 'geodir_wrapper_content_open_replace' => '', |
|
| 375 | - 'geodir_wrapper_content_close_replace' => '', |
|
| 376 | - 'geodir_article_open_id' => '', |
|
| 377 | - 'geodir_article_open_class' => '', |
|
| 378 | - 'geodir_article_open_replace' => '', |
|
| 379 | - 'geodir_article_close_replace' => '', |
|
| 380 | - 'geodir_sidebar_right_open_id' => '', |
|
| 381 | - 'geodir_sidebar_right_open_class' => '', |
|
| 382 | - 'geodir_sidebar_right_open_replace' => '<div id="sidebar" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
| 383 | - 'geodir_sidebar_right_close_replace' => '</div><!-- end sidebar -->', |
|
| 384 | - 'geodir_sidebar_left_open_id' => '', |
|
| 385 | - 'geodir_sidebar_left_open_class' => '', |
|
| 386 | - 'geodir_sidebar_left_open_replace' => '<div id="sidebar" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
| 387 | - 'geodir_sidebar_left_close_replace' => '</div><!-- end sidebar -->', |
|
| 388 | - 'geodir_main_content_open_id' => '', |
|
| 389 | - 'geodir_main_content_open_class' => '', |
|
| 390 | - 'geodir_main_content_open_replace' => '<!-- removed -->', |
|
| 391 | - 'geodir_main_content_close_replace' => '<!-- removed -->', |
|
| 392 | - 'geodir_top_content_add' => '', |
|
| 393 | - 'geodir_before_main_content_add' => '', |
|
| 394 | - 'geodir_before_widget_filter' => '', |
|
| 395 | - 'geodir_after_widget_filter' => '', |
|
| 396 | - 'geodir_theme_compat_css' => stripslashes('.geodir-sidebar-left{float:left}select,textarea{border-style:solid;border-width:1px}.top-menu li > div{visibility:visible}.geodir-chosen-container-single .chosen-single{height:auto}ul li#menu-item-gd-location-switcher ul{width:222px}ul li#menu-item-gd-location-switcher ul li{padding-right:0!important}#mobile-nav li#mobile-menu-item-gd-location-switcher li a{padding-left:10px;padding-right:10px}#menu-item-gd-location-switcher dd,#mobile-menu-item-gd-location-switcher{margin-left:0}#menu-item-gd-location-switcher dd a{display:block}.geodir-chosen-container .chosen-results li.highlighted{background-color:#eee;background-image:none;color:#444}#mobile-nav li.mobile-nav-item li a:before{content:\'\';margin:0}#mobile-nav li.mobile-nav-item li a{padding:10px;width:auto}.geodir-listing-search{text-align:center}.geodir-search{float:none;margin:0}.geodir-search select,.geodir-search .search_by_post,.geodir-search input[type="text"],.geodir-search button[type="button"], .geodir-search input[type="button"],.geodir-search input[type="submit"]{display:inline-block;float:none}.geodir-cat-list ul li,.map_category ul li{list-style-type:none}.wpgeo-avada .page-title ul li:after{content:\'\'}.top_banner_section{margin-bottom:0}.geodir-category-list-in{margin:0;padding:15px}.geodir_full_page .geodir-cat-list .widget-title{margin-top:0}.geodir_full_page .geodir-cat-list ul li{padding-left:0}.geodir-loc-bar{border:none;margin:0;padding:0}.geodir-loc-bar-in{padding:15px 0}.geodir_full_page section.widget{margin-bottom:20px}.sidebar .geodir-loginbox-list li{margin-bottom:10px;padding-bottom:10px}.sidebar .geodir-loginbox-list li a{display:block}.sidebar .geodir-chosen-container .chosen-results li{margin:0;padding:5px 6px}.sidebar .geodir-chosen-container .chosen-results li.highlighted{background:#eee;background-image:none;color:#000}.sidebar .geodir_category_list_view li.geodir-gridview{display:inline-block;margin-bottom:15px}.wpgeo-avada.double-sidebars #main #sidebar{margin-left:3%}.wpgeo-avada.double-sidebars #main #sidebar-2{margin-left:-100%}.wpgeo-avada.double-sidebars #content{float:left;margin-left:0}.geodir_full_page section.widget{margin-bottom: 0px;} .sidebar .widget .geodir-hide {display: none;}li.fusion-mobile-nav-item .geodir_location_tab_container a:before{content: "" !important; margin-right: auto !important;}li.fusion-mobile-nav-item .geodir_location_tab_container a{padding-left:5px !important;}'),
|
|
| 397 | - 'geodir_theme_compat_js' => '', |
|
| 398 | - 'geodir_theme_compat_default_options' => '', |
|
| 399 | - 'geodir_theme_compat_code' => 'Avada' |
|
| 400 | - ); |
|
| 367 | + $theme_compat['Avada'] = array( |
|
| 368 | + 'geodir_wrapper_open_id' => '', |
|
| 369 | + 'geodir_wrapper_open_class' => '', |
|
| 370 | + 'geodir_wrapper_open_replace' => '<!-- removed -->', |
|
| 371 | + 'geodir_wrapper_close_replace' => '<!-- removed -->', |
|
| 372 | + 'geodir_wrapper_content_open_id' => 'content', |
|
| 373 | + 'geodir_wrapper_content_open_class' => '', |
|
| 374 | + 'geodir_wrapper_content_open_replace' => '', |
|
| 375 | + 'geodir_wrapper_content_close_replace' => '', |
|
| 376 | + 'geodir_article_open_id' => '', |
|
| 377 | + 'geodir_article_open_class' => '', |
|
| 378 | + 'geodir_article_open_replace' => '', |
|
| 379 | + 'geodir_article_close_replace' => '', |
|
| 380 | + 'geodir_sidebar_right_open_id' => '', |
|
| 381 | + 'geodir_sidebar_right_open_class' => '', |
|
| 382 | + 'geodir_sidebar_right_open_replace' => '<div id="sidebar" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
| 383 | + 'geodir_sidebar_right_close_replace' => '</div><!-- end sidebar -->', |
|
| 384 | + 'geodir_sidebar_left_open_id' => '', |
|
| 385 | + 'geodir_sidebar_left_open_class' => '', |
|
| 386 | + 'geodir_sidebar_left_open_replace' => '<div id="sidebar" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
| 387 | + 'geodir_sidebar_left_close_replace' => '</div><!-- end sidebar -->', |
|
| 388 | + 'geodir_main_content_open_id' => '', |
|
| 389 | + 'geodir_main_content_open_class' => '', |
|
| 390 | + 'geodir_main_content_open_replace' => '<!-- removed -->', |
|
| 391 | + 'geodir_main_content_close_replace' => '<!-- removed -->', |
|
| 392 | + 'geodir_top_content_add' => '', |
|
| 393 | + 'geodir_before_main_content_add' => '', |
|
| 394 | + 'geodir_before_widget_filter' => '', |
|
| 395 | + 'geodir_after_widget_filter' => '', |
|
| 396 | + 'geodir_theme_compat_css' => stripslashes('.geodir-sidebar-left{float:left}select,textarea{border-style:solid;border-width:1px}.top-menu li > div{visibility:visible}.geodir-chosen-container-single .chosen-single{height:auto}ul li#menu-item-gd-location-switcher ul{width:222px}ul li#menu-item-gd-location-switcher ul li{padding-right:0!important}#mobile-nav li#mobile-menu-item-gd-location-switcher li a{padding-left:10px;padding-right:10px}#menu-item-gd-location-switcher dd,#mobile-menu-item-gd-location-switcher{margin-left:0}#menu-item-gd-location-switcher dd a{display:block}.geodir-chosen-container .chosen-results li.highlighted{background-color:#eee;background-image:none;color:#444}#mobile-nav li.mobile-nav-item li a:before{content:\'\';margin:0}#mobile-nav li.mobile-nav-item li a{padding:10px;width:auto}.geodir-listing-search{text-align:center}.geodir-search{float:none;margin:0}.geodir-search select,.geodir-search .search_by_post,.geodir-search input[type="text"],.geodir-search button[type="button"], .geodir-search input[type="button"],.geodir-search input[type="submit"]{display:inline-block;float:none}.geodir-cat-list ul li,.map_category ul li{list-style-type:none}.wpgeo-avada .page-title ul li:after{content:\'\'}.top_banner_section{margin-bottom:0}.geodir-category-list-in{margin:0;padding:15px}.geodir_full_page .geodir-cat-list .widget-title{margin-top:0}.geodir_full_page .geodir-cat-list ul li{padding-left:0}.geodir-loc-bar{border:none;margin:0;padding:0}.geodir-loc-bar-in{padding:15px 0}.geodir_full_page section.widget{margin-bottom:20px}.sidebar .geodir-loginbox-list li{margin-bottom:10px;padding-bottom:10px}.sidebar .geodir-loginbox-list li a{display:block}.sidebar .geodir-chosen-container .chosen-results li{margin:0;padding:5px 6px}.sidebar .geodir-chosen-container .chosen-results li.highlighted{background:#eee;background-image:none;color:#000}.sidebar .geodir_category_list_view li.geodir-gridview{display:inline-block;margin-bottom:15px}.wpgeo-avada.double-sidebars #main #sidebar{margin-left:3%}.wpgeo-avada.double-sidebars #main #sidebar-2{margin-left:-100%}.wpgeo-avada.double-sidebars #content{float:left;margin-left:0}.geodir_full_page section.widget{margin-bottom: 0px;} .sidebar .widget .geodir-hide {display: none;}li.fusion-mobile-nav-item .geodir_location_tab_container a:before{content: "" !important; margin-right: auto !important;}li.fusion-mobile-nav-item .geodir_location_tab_container a{padding-left:5px !important;}'),
|
|
| 397 | + 'geodir_theme_compat_js' => '', |
|
| 398 | + 'geodir_theme_compat_default_options' => '', |
|
| 399 | + 'geodir_theme_compat_code' => 'Avada' |
|
| 400 | + ); |
|
| 401 | 401 | |
| 402 | 402 | //Enfold |
| 403 | - $theme_compat['Enfold'] = array( |
|
| 404 | - 'geodir_wrapper_open_id' => '', |
|
| 405 | - 'geodir_wrapper_open_class' => '', |
|
| 406 | - 'geodir_wrapper_open_replace' => '', |
|
| 407 | - 'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->', |
|
| 408 | - 'geodir_wrapper_content_open_id' => '', |
|
| 409 | - 'geodir_wrapper_content_open_class' => '', |
|
| 410 | - 'geodir_wrapper_content_open_replace' => '', |
|
| 411 | - 'geodir_wrapper_content_close_replace' => '</div></main>', |
|
| 412 | - 'geodir_article_open_id' => '', |
|
| 413 | - 'geodir_article_open_class' => '', |
|
| 414 | - 'geodir_article_open_replace' => '', |
|
| 415 | - 'geodir_article_close_replace' => '', |
|
| 416 | - 'geodir_sidebar_right_open_id' => '', |
|
| 417 | - 'geodir_sidebar_right_open_class' => '', |
|
| 418 | - 'geodir_sidebar_right_open_replace' => '', |
|
| 419 | - 'geodir_sidebar_right_close_replace' => '</div></aside><!-- sidebar ends here-->', |
|
| 420 | - 'geodir_sidebar_left_open_id' => '', |
|
| 421 | - 'geodir_sidebar_left_open_class' => '', |
|
| 422 | - 'geodir_sidebar_left_open_replace' => '', |
|
| 423 | - 'geodir_sidebar_left_close_replace' => '</div></aside><!-- sidebar ends here-->', |
|
| 424 | - 'geodir_main_content_open_id' => '', |
|
| 425 | - 'geodir_main_content_open_class' => '', |
|
| 426 | - 'geodir_main_content_open_replace' => '', |
|
| 427 | - 'geodir_main_content_close_replace' => '', |
|
| 428 | - 'geodir_top_content_add' => '', |
|
| 429 | - 'geodir_before_main_content_add' => '', |
|
| 430 | - 'geodir_before_widget_filter' => '', |
|
| 431 | - 'geodir_after_widget_filter' => '', |
|
| 432 | - 'geodir_theme_compat_css' => stripslashes('.geodir_full_page .top_banner_section{margin-bottom:0}.widget .geodir-cat-list ul li{clear:none}.wpgeo-enfold .av-main-nav ul{width:222px}.geodir-listing-search .geodir-loc-bar{border-top:none;padding:0}#main .geodir-listing-search,.geodir-listing-search .geodir-loc-bar{margin-bottom:0}#main .geodir-loc-bar-in,#main .geodir-category-list-in{background-color:#fcfcfc;margin:20px 0;padding:20px}#main .geodir_full_page .geodir-loc-bar-in,#main .geodir_full_page .geodir-loc-bar,#main .geodir_full_page .geodir-category-list-in{margin-top:0;margin-bottom:0}#main .geodir-loc-bar-in{padding:20px}#main .geodir-search{margin:0;width:100%}#main .geodir-search select{margin:0 3% 0 0;padding:8px 10px;width:13%}#main .geodir-search input[type="text"]{margin:0 3% 0 0;padding:10px;width:32.4%}#main .geodir-search input[type="button"],#main .geodir-search input[type="submit"]{font-size:inherit;line-height:2.25;margin:0;padding:7px;width:13%}.enfold-home-top section.widget{margin:0;padding:0}.enfold-home-top .top_banner_section{margin-bottom:0}.enfold-home-top .geodir-loc-bar{background:#fcfcfc;border:none;margin:0;padding:0}#main .enfold-home-top .geodir-loc-bar-in{background:none;border:none;margin:0 auto;padding:20px 0}#main .geodir-breadcrumb{border-bottom-style:solid;border-bottom-width:1px}#gd-tabs dt{clear:none}#geodir_slider ul li{list-style-type:none;margin:0;padding:0}#respond{clear:both}#comments .comments-title span{display:inline;font-size:inherit;font-weight:700}#reviewsTab .comments-area .bypostauthor cite span{display:inline}#top #comments .commentlist .comment,#top #comments .commentlist .comment > div{min-height:0}.commentlist .commenttext{padding-top:15px}#comment_imagesdropbox{margin-bottom:20px}.wpgeo-enfold .geodir_category_list_view li{margin-left:0;padding:0}.widget ul.geodir-loginbox-list{overflow:visible}.geodir_category_list_view li .geodir-post-img{display:block}.wpgeo-enfold .geodir_event_listing_calendar tr.title{background:#ccc}@media only screen and (max-width:480px){.geodir_category_list_view li .geodir-content,.geodir_category_list_view li .geodir-post-img,.geodir_category_list_view li .geodir-addinfo{float:none;width:100%;margin:10px 0}#main .geodir-search input[type="text"],#main .geodir-search input[type="button"],#main .geodir-search input[type="submit"],#main .geodir-search select{margin:10px 0;width:100%}}#main .geodir_full_page section:last-child .geodir-loc-bar{margin-bottom: -1px;border-bottom: none;}'),
|
|
| 433 | - 'geodir_theme_compat_js' => '', |
|
| 434 | - 'geodir_theme_compat_default_options' => '', |
|
| 435 | - 'geodir_theme_compat_code' => 'Enfold' |
|
| 436 | - ); |
|
| 403 | + $theme_compat['Enfold'] = array( |
|
| 404 | + 'geodir_wrapper_open_id' => '', |
|
| 405 | + 'geodir_wrapper_open_class' => '', |
|
| 406 | + 'geodir_wrapper_open_replace' => '', |
|
| 407 | + 'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->', |
|
| 408 | + 'geodir_wrapper_content_open_id' => '', |
|
| 409 | + 'geodir_wrapper_content_open_class' => '', |
|
| 410 | + 'geodir_wrapper_content_open_replace' => '', |
|
| 411 | + 'geodir_wrapper_content_close_replace' => '</div></main>', |
|
| 412 | + 'geodir_article_open_id' => '', |
|
| 413 | + 'geodir_article_open_class' => '', |
|
| 414 | + 'geodir_article_open_replace' => '', |
|
| 415 | + 'geodir_article_close_replace' => '', |
|
| 416 | + 'geodir_sidebar_right_open_id' => '', |
|
| 417 | + 'geodir_sidebar_right_open_class' => '', |
|
| 418 | + 'geodir_sidebar_right_open_replace' => '', |
|
| 419 | + 'geodir_sidebar_right_close_replace' => '</div></aside><!-- sidebar ends here-->', |
|
| 420 | + 'geodir_sidebar_left_open_id' => '', |
|
| 421 | + 'geodir_sidebar_left_open_class' => '', |
|
| 422 | + 'geodir_sidebar_left_open_replace' => '', |
|
| 423 | + 'geodir_sidebar_left_close_replace' => '</div></aside><!-- sidebar ends here-->', |
|
| 424 | + 'geodir_main_content_open_id' => '', |
|
| 425 | + 'geodir_main_content_open_class' => '', |
|
| 426 | + 'geodir_main_content_open_replace' => '', |
|
| 427 | + 'geodir_main_content_close_replace' => '', |
|
| 428 | + 'geodir_top_content_add' => '', |
|
| 429 | + 'geodir_before_main_content_add' => '', |
|
| 430 | + 'geodir_before_widget_filter' => '', |
|
| 431 | + 'geodir_after_widget_filter' => '', |
|
| 432 | + 'geodir_theme_compat_css' => stripslashes('.geodir_full_page .top_banner_section{margin-bottom:0}.widget .geodir-cat-list ul li{clear:none}.wpgeo-enfold .av-main-nav ul{width:222px}.geodir-listing-search .geodir-loc-bar{border-top:none;padding:0}#main .geodir-listing-search,.geodir-listing-search .geodir-loc-bar{margin-bottom:0}#main .geodir-loc-bar-in,#main .geodir-category-list-in{background-color:#fcfcfc;margin:20px 0;padding:20px}#main .geodir_full_page .geodir-loc-bar-in,#main .geodir_full_page .geodir-loc-bar,#main .geodir_full_page .geodir-category-list-in{margin-top:0;margin-bottom:0}#main .geodir-loc-bar-in{padding:20px}#main .geodir-search{margin:0;width:100%}#main .geodir-search select{margin:0 3% 0 0;padding:8px 10px;width:13%}#main .geodir-search input[type="text"]{margin:0 3% 0 0;padding:10px;width:32.4%}#main .geodir-search input[type="button"],#main .geodir-search input[type="submit"]{font-size:inherit;line-height:2.25;margin:0;padding:7px;width:13%}.enfold-home-top section.widget{margin:0;padding:0}.enfold-home-top .top_banner_section{margin-bottom:0}.enfold-home-top .geodir-loc-bar{background:#fcfcfc;border:none;margin:0;padding:0}#main .enfold-home-top .geodir-loc-bar-in{background:none;border:none;margin:0 auto;padding:20px 0}#main .geodir-breadcrumb{border-bottom-style:solid;border-bottom-width:1px}#gd-tabs dt{clear:none}#geodir_slider ul li{list-style-type:none;margin:0;padding:0}#respond{clear:both}#comments .comments-title span{display:inline;font-size:inherit;font-weight:700}#reviewsTab .comments-area .bypostauthor cite span{display:inline}#top #comments .commentlist .comment,#top #comments .commentlist .comment > div{min-height:0}.commentlist .commenttext{padding-top:15px}#comment_imagesdropbox{margin-bottom:20px}.wpgeo-enfold .geodir_category_list_view li{margin-left:0;padding:0}.widget ul.geodir-loginbox-list{overflow:visible}.geodir_category_list_view li .geodir-post-img{display:block}.wpgeo-enfold .geodir_event_listing_calendar tr.title{background:#ccc}@media only screen and (max-width:480px){.geodir_category_list_view li .geodir-content,.geodir_category_list_view li .geodir-post-img,.geodir_category_list_view li .geodir-addinfo{float:none;width:100%;margin:10px 0}#main .geodir-search input[type="text"],#main .geodir-search input[type="button"],#main .geodir-search input[type="submit"],#main .geodir-search select{margin:10px 0;width:100%}}#main .geodir_full_page section:last-child .geodir-loc-bar{margin-bottom: -1px;border-bottom: none;}'),
|
|
| 433 | + 'geodir_theme_compat_js' => '', |
|
| 434 | + 'geodir_theme_compat_default_options' => '', |
|
| 435 | + 'geodir_theme_compat_code' => 'Enfold' |
|
| 436 | + ); |
|
| 437 | 437 | |
| 438 | 438 | // X |
| 439 | - $theme_compat['X'] = array( |
|
| 440 | - 'geodir_wrapper_open_id' => '', |
|
| 441 | - 'geodir_wrapper_open_class' => '', |
|
| 442 | - 'geodir_wrapper_open_replace' => '', |
|
| 443 | - 'geodir_wrapper_close_replace' => '', |
|
| 444 | - 'geodir_wrapper_content_open_id' => '', |
|
| 445 | - 'geodir_wrapper_content_open_class' => '', |
|
| 446 | - 'geodir_wrapper_content_open_replace' => '', |
|
| 447 | - 'geodir_wrapper_content_close_replace' => '', |
|
| 448 | - 'geodir_article_open_id' => '', |
|
| 449 | - 'geodir_article_open_class' => '', |
|
| 450 | - 'geodir_article_open_replace' => '', |
|
| 451 | - 'geodir_article_close_replace' => '', |
|
| 452 | - 'geodir_sidebar_right_open_id' => '', |
|
| 453 | - 'geodir_sidebar_right_open_class' => '', |
|
| 454 | - 'geodir_sidebar_right_open_replace' => '', |
|
| 455 | - 'geodir_sidebar_right_close_replace' => '', |
|
| 456 | - 'geodir_sidebar_left_open_id' => '', |
|
| 457 | - 'geodir_sidebar_left_open_class' => '', |
|
| 458 | - 'geodir_sidebar_left_open_replace' => '', |
|
| 459 | - 'geodir_sidebar_left_close_replace' => '', |
|
| 460 | - 'geodir_main_content_open_id' => '', |
|
| 461 | - 'geodir_main_content_open_class' => '', |
|
| 462 | - 'geodir_main_content_open_replace' => '', |
|
| 463 | - 'geodir_main_content_close_replace' => '', |
|
| 464 | - 'geodir_top_content_add' => '', |
|
| 465 | - 'geodir_before_main_content_add' => '', |
|
| 466 | - 'geodir_before_widget_filter' => '', |
|
| 467 | - 'geodir_after_widget_filter' => '', |
|
| 468 | - 'geodir_theme_compat_css' => stripslashes('.x-colophon.bottom{clear:both}#geodir-main-content,.geodir_flex-container{margin-top:16px}.geodir-x ul{list-style:none}.widget ul.geodir_category_list_view{border:none}.geodir_category_list_view li.geodir-gridview:last-child{border-bottom:1px solid #e1e1e1}.home .x-header-landmark{display:none}.geodir-x .x-main .geodir_advance_search_widget{margin:0}.geodir-x .top_banner_section{margin-bottom:0}.geodir-loc-bar{background:rgba(0,0,0,0.05);margin:0;padding:0}.geodir-loc-bar-in{background:none;border:none;padding:10px}.geodir-search{margin:0;width:100%}.widget .geodir-search select,.geodir-search input[type="text"],.geodir-search input[type="button"],.geodir-search input[type="submit"]{border:1px solid #ccc;box-shadow:none;height:auto;line-height:21px;margin:0 1% 0 0;padding:5px 10px}.widget .geodir-search select,.geodir-search input[type="text"]{width:28%}.geodir-search input[type="submit"],.geodir-search input[type="button"]{line-height:19px;margin-right:0;width:11%}.geodir-search input:hover[type="submit"],.geodir-search input:hover[type="button"]{background:#333;color:#fff}.geodir-cat-list .widget-title{margin-top:0}.geodir-x .geodir-category-list-in{background:rgba(0,0,0,0.05);border:none}.widget .geodir-cat-list ul.geodir-popular-cat-list{border:none;border-radius:0;box-shadow:none}.geodir_full_page .geodir-cat-list ul li{border:none}.geodir_full_page .geodir-cat-list ul li a{border:none}.post-type-archive .geodir-loc-bar{border:none;margin-top:20px}#menu-item-gd-location-switcher dd{margin-left:0}.geodir-chosen-container-single .chosen-single{height:auto}.widget ul.geodir-loginbox-list{overflow:visible}.geodir_full_page section.widget{clear:both}.x-ethos .entry-title{margin-bottom:20px}.x-ethos .geodir-chosen-container-single .chosen-single{padding:0 0 0 8px}.x-ethos .widget ul li a,.x-ethos .geodir_category_list_view li{color:#333}@media only screen and (max-width:767px){.widget .geodir-search select,.geodir-search input[type="text"],.geodir-search input[type="button"],.geodir-search input[type="submit"]{margin:0 0 10px;width:100%}}.geodir_full_page .geodir-loc-bar-in,.geodir_full_page .geodir-loc-bar,.geodir_full_page .geodir-category-list-in{margin-top:0;margin-bottom:0}.geodir_full_page .geodir-loc-bar-in,.geodir_full_page .geodir-category-list-in{border-bottom:1px solid rgba(0,0,0,0.1)}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'),
|
|
| 469 | - 'geodir_theme_compat_js' => '', |
|
| 470 | - 'geodir_theme_compat_default_options' => '', |
|
| 471 | - 'geodir_theme_compat_code' => 'X' |
|
| 472 | - ); |
|
| 439 | + $theme_compat['X'] = array( |
|
| 440 | + 'geodir_wrapper_open_id' => '', |
|
| 441 | + 'geodir_wrapper_open_class' => '', |
|
| 442 | + 'geodir_wrapper_open_replace' => '', |
|
| 443 | + 'geodir_wrapper_close_replace' => '', |
|
| 444 | + 'geodir_wrapper_content_open_id' => '', |
|
| 445 | + 'geodir_wrapper_content_open_class' => '', |
|
| 446 | + 'geodir_wrapper_content_open_replace' => '', |
|
| 447 | + 'geodir_wrapper_content_close_replace' => '', |
|
| 448 | + 'geodir_article_open_id' => '', |
|
| 449 | + 'geodir_article_open_class' => '', |
|
| 450 | + 'geodir_article_open_replace' => '', |
|
| 451 | + 'geodir_article_close_replace' => '', |
|
| 452 | + 'geodir_sidebar_right_open_id' => '', |
|
| 453 | + 'geodir_sidebar_right_open_class' => '', |
|
| 454 | + 'geodir_sidebar_right_open_replace' => '', |
|
| 455 | + 'geodir_sidebar_right_close_replace' => '', |
|
| 456 | + 'geodir_sidebar_left_open_id' => '', |
|
| 457 | + 'geodir_sidebar_left_open_class' => '', |
|
| 458 | + 'geodir_sidebar_left_open_replace' => '', |
|
| 459 | + 'geodir_sidebar_left_close_replace' => '', |
|
| 460 | + 'geodir_main_content_open_id' => '', |
|
| 461 | + 'geodir_main_content_open_class' => '', |
|
| 462 | + 'geodir_main_content_open_replace' => '', |
|
| 463 | + 'geodir_main_content_close_replace' => '', |
|
| 464 | + 'geodir_top_content_add' => '', |
|
| 465 | + 'geodir_before_main_content_add' => '', |
|
| 466 | + 'geodir_before_widget_filter' => '', |
|
| 467 | + 'geodir_after_widget_filter' => '', |
|
| 468 | + 'geodir_theme_compat_css' => stripslashes('.x-colophon.bottom{clear:both}#geodir-main-content,.geodir_flex-container{margin-top:16px}.geodir-x ul{list-style:none}.widget ul.geodir_category_list_view{border:none}.geodir_category_list_view li.geodir-gridview:last-child{border-bottom:1px solid #e1e1e1}.home .x-header-landmark{display:none}.geodir-x .x-main .geodir_advance_search_widget{margin:0}.geodir-x .top_banner_section{margin-bottom:0}.geodir-loc-bar{background:rgba(0,0,0,0.05);margin:0;padding:0}.geodir-loc-bar-in{background:none;border:none;padding:10px}.geodir-search{margin:0;width:100%}.widget .geodir-search select,.geodir-search input[type="text"],.geodir-search input[type="button"],.geodir-search input[type="submit"]{border:1px solid #ccc;box-shadow:none;height:auto;line-height:21px;margin:0 1% 0 0;padding:5px 10px}.widget .geodir-search select,.geodir-search input[type="text"]{width:28%}.geodir-search input[type="submit"],.geodir-search input[type="button"]{line-height:19px;margin-right:0;width:11%}.geodir-search input:hover[type="submit"],.geodir-search input:hover[type="button"]{background:#333;color:#fff}.geodir-cat-list .widget-title{margin-top:0}.geodir-x .geodir-category-list-in{background:rgba(0,0,0,0.05);border:none}.widget .geodir-cat-list ul.geodir-popular-cat-list{border:none;border-radius:0;box-shadow:none}.geodir_full_page .geodir-cat-list ul li{border:none}.geodir_full_page .geodir-cat-list ul li a{border:none}.post-type-archive .geodir-loc-bar{border:none;margin-top:20px}#menu-item-gd-location-switcher dd{margin-left:0}.geodir-chosen-container-single .chosen-single{height:auto}.widget ul.geodir-loginbox-list{overflow:visible}.geodir_full_page section.widget{clear:both}.x-ethos .entry-title{margin-bottom:20px}.x-ethos .geodir-chosen-container-single .chosen-single{padding:0 0 0 8px}.x-ethos .widget ul li a,.x-ethos .geodir_category_list_view li{color:#333}@media only screen and (max-width:767px){.widget .geodir-search select,.geodir-search input[type="text"],.geodir-search input[type="button"],.geodir-search input[type="submit"]{margin:0 0 10px;width:100%}}.geodir_full_page .geodir-loc-bar-in,.geodir_full_page .geodir-loc-bar,.geodir_full_page .geodir-category-list-in{margin-top:0;margin-bottom:0}.geodir_full_page .geodir-loc-bar-in,.geodir_full_page .geodir-category-list-in{border-bottom:1px solid rgba(0,0,0,0.1)}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'),
|
|
| 469 | + 'geodir_theme_compat_js' => '', |
|
| 470 | + 'geodir_theme_compat_default_options' => '', |
|
| 471 | + 'geodir_theme_compat_code' => 'X' |
|
| 472 | + ); |
|
| 473 | 473 | |
| 474 | 474 | // Divi |
| 475 | - $theme_compat['Divi'] = array( |
|
| 476 | - 'geodir_wrapper_open_id' => 'main-content', |
|
| 477 | - 'geodir_wrapper_open_class' => '', |
|
| 478 | - 'geodir_wrapper_open_replace' => '', |
|
| 479 | - 'geodir_wrapper_close_replace' => '', |
|
| 480 | - 'geodir_wrapper_content_open_id' => 'left-area', |
|
| 481 | - 'geodir_wrapper_content_open_class' => '', |
|
| 482 | - 'geodir_wrapper_content_open_replace' => '<div class="container"><div id="content-area" class="clearfix"><div id="[id]" class="[class]" role="main" >', |
|
| 483 | - 'geodir_wrapper_content_close_replace' => '', |
|
| 484 | - 'geodir_article_open_id' => '', |
|
| 485 | - 'geodir_article_open_class' => '', |
|
| 486 | - 'geodir_article_open_replace' => '', |
|
| 487 | - 'geodir_article_close_replace' => '', |
|
| 488 | - 'geodir_sidebar_right_open_id' => 'sidebar', |
|
| 489 | - 'geodir_sidebar_right_open_class' => '', |
|
| 490 | - 'geodir_sidebar_right_open_replace' => '<aside id="[id]" class="" role="complementary" itemscope itemtype="[itemtype]" >', |
|
| 491 | - 'geodir_sidebar_right_close_replace' => '</aside><!-- sidebar ends here--></div></div>', |
|
| 492 | - 'geodir_sidebar_left_open_id' => 'sidebar', |
|
| 493 | - 'geodir_sidebar_left_open_class' => '', |
|
| 494 | - 'geodir_sidebar_left_open_replace' => '<aside id="[id]" class="" role="complementary" itemscope itemtype="[itemtype]" >', |
|
| 495 | - 'geodir_sidebar_left_close_replace' => '</aside><!-- sidebar ends here--></div></div>', |
|
| 496 | - 'geodir_main_content_open_id' => '', |
|
| 497 | - 'geodir_main_content_open_class' => '', |
|
| 498 | - 'geodir_main_content_open_replace' => '', |
|
| 499 | - 'geodir_main_content_close_replace' => '', |
|
| 500 | - 'geodir_top_content_add' => '', |
|
| 501 | - 'geodir_before_main_content_add' => '', |
|
| 502 | - 'geodir_before_widget_filter' => '', |
|
| 503 | - 'geodir_after_widget_filter' => '', |
|
| 504 | - 'geodir_theme_compat_css' => stripslashes('#left-area ul.geodir-direction-nav{list-style-type:none}#sidebar .geodir-company_info{margin-left:30px}#sidebar .geodir-widget{float:none;margin:0 0 30px 30px}.geodir_full_page .geodir-loc-bar{padding:0;margin:0;border:none}.geodir_full_page .geodir-category-list-in{margin-top:0}.geodir_full_page .top_banner_section{margin-bottom:0}.archive .entry-header,.geodir-breadcrumb{border-bottom:1px solid #e2e2e2}.archive .entry-header h1,ul#breadcrumbs{margin:0 auto;width:1080px}#left-area ul.geodir_category_list_view{padding:10px 0}.nav li#menu-item-gd-location-switcher ul{width:222px}#menu-item-gd-location-switcher li.gd-location-switcher-menu-item{padding-right:0}#menu-item-gd-location-switcher dd{margin-left:0}#menu-item-gd-location-switcher .geodir_location_tab_container dd a{padding:5px;width:auto}@media only screen and ( max-width: 980px ){.geodir-loc-bar-in,.geodir-cat-list,ul#breadcrumbs{width:690px}}@media only screen and ( max-width: 767px ){.geodir-loc-bar-in,.geodir-cat-list,ul#breadcrumbs{width:400px}}@media only screen and ( max-width: 479px ){.geodir-loc-bar-in,.geodir-cat-list,ul#breadcrumbs{width:280px}}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'),
|
|
| 505 | - 'geodir_theme_compat_js' => '', |
|
| 506 | - 'geodir_theme_compat_default_options' => '', |
|
| 507 | - 'geodir_theme_compat_code' => 'Divi' |
|
| 508 | - ); |
|
| 475 | + $theme_compat['Divi'] = array( |
|
| 476 | + 'geodir_wrapper_open_id' => 'main-content', |
|
| 477 | + 'geodir_wrapper_open_class' => '', |
|
| 478 | + 'geodir_wrapper_open_replace' => '', |
|
| 479 | + 'geodir_wrapper_close_replace' => '', |
|
| 480 | + 'geodir_wrapper_content_open_id' => 'left-area', |
|
| 481 | + 'geodir_wrapper_content_open_class' => '', |
|
| 482 | + 'geodir_wrapper_content_open_replace' => '<div class="container"><div id="content-area" class="clearfix"><div id="[id]" class="[class]" role="main" >', |
|
| 483 | + 'geodir_wrapper_content_close_replace' => '', |
|
| 484 | + 'geodir_article_open_id' => '', |
|
| 485 | + 'geodir_article_open_class' => '', |
|
| 486 | + 'geodir_article_open_replace' => '', |
|
| 487 | + 'geodir_article_close_replace' => '', |
|
| 488 | + 'geodir_sidebar_right_open_id' => 'sidebar', |
|
| 489 | + 'geodir_sidebar_right_open_class' => '', |
|
| 490 | + 'geodir_sidebar_right_open_replace' => '<aside id="[id]" class="" role="complementary" itemscope itemtype="[itemtype]" >', |
|
| 491 | + 'geodir_sidebar_right_close_replace' => '</aside><!-- sidebar ends here--></div></div>', |
|
| 492 | + 'geodir_sidebar_left_open_id' => 'sidebar', |
|
| 493 | + 'geodir_sidebar_left_open_class' => '', |
|
| 494 | + 'geodir_sidebar_left_open_replace' => '<aside id="[id]" class="" role="complementary" itemscope itemtype="[itemtype]" >', |
|
| 495 | + 'geodir_sidebar_left_close_replace' => '</aside><!-- sidebar ends here--></div></div>', |
|
| 496 | + 'geodir_main_content_open_id' => '', |
|
| 497 | + 'geodir_main_content_open_class' => '', |
|
| 498 | + 'geodir_main_content_open_replace' => '', |
|
| 499 | + 'geodir_main_content_close_replace' => '', |
|
| 500 | + 'geodir_top_content_add' => '', |
|
| 501 | + 'geodir_before_main_content_add' => '', |
|
| 502 | + 'geodir_before_widget_filter' => '', |
|
| 503 | + 'geodir_after_widget_filter' => '', |
|
| 504 | + 'geodir_theme_compat_css' => stripslashes('#left-area ul.geodir-direction-nav{list-style-type:none}#sidebar .geodir-company_info{margin-left:30px}#sidebar .geodir-widget{float:none;margin:0 0 30px 30px}.geodir_full_page .geodir-loc-bar{padding:0;margin:0;border:none}.geodir_full_page .geodir-category-list-in{margin-top:0}.geodir_full_page .top_banner_section{margin-bottom:0}.archive .entry-header,.geodir-breadcrumb{border-bottom:1px solid #e2e2e2}.archive .entry-header h1,ul#breadcrumbs{margin:0 auto;width:1080px}#left-area ul.geodir_category_list_view{padding:10px 0}.nav li#menu-item-gd-location-switcher ul{width:222px}#menu-item-gd-location-switcher li.gd-location-switcher-menu-item{padding-right:0}#menu-item-gd-location-switcher dd{margin-left:0}#menu-item-gd-location-switcher .geodir_location_tab_container dd a{padding:5px;width:auto}@media only screen and ( max-width: 980px ){.geodir-loc-bar-in,.geodir-cat-list,ul#breadcrumbs{width:690px}}@media only screen and ( max-width: 767px ){.geodir-loc-bar-in,.geodir-cat-list,ul#breadcrumbs{width:400px}}@media only screen and ( max-width: 479px ){.geodir-loc-bar-in,.geodir-cat-list,ul#breadcrumbs{width:280px}}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'),
|
|
| 505 | + 'geodir_theme_compat_js' => '', |
|
| 506 | + 'geodir_theme_compat_default_options' => '', |
|
| 507 | + 'geodir_theme_compat_code' => 'Divi' |
|
| 508 | + ); |
|
| 509 | 509 | |
| 510 | 510 | // Genesis |
| 511 | - $theme_compat['Genesis'] = array( |
|
| 512 | - 'geodir_wrapper_open_id' => '', |
|
| 513 | - 'geodir_wrapper_open_class' => 'content-sidebar-wrap', |
|
| 514 | - 'geodir_wrapper_open_replace' => '', |
|
| 515 | - 'geodir_wrapper_close_replace' => '', |
|
| 516 | - 'geodir_wrapper_content_open_id' => '', |
|
| 517 | - 'geodir_wrapper_content_open_class' => 'content', |
|
| 518 | - 'geodir_wrapper_content_open_replace' => '<div class="[class]" role="main" >', |
|
| 519 | - 'geodir_wrapper_content_close_replace' => '', |
|
| 520 | - 'geodir_article_open_id' => '', |
|
| 521 | - 'geodir_article_open_class' => '', |
|
| 522 | - 'geodir_article_open_replace' => '', |
|
| 523 | - 'geodir_article_close_replace' => '', |
|
| 524 | - 'geodir_sidebar_right_open_id' => '', |
|
| 525 | - 'geodir_sidebar_right_open_class' => 'sidebar sidebar-primary widget-area', |
|
| 526 | - 'geodir_sidebar_right_open_replace' => '<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]">', |
|
| 527 | - 'geodir_sidebar_right_close_replace' => '', |
|
| 528 | - 'geodir_sidebar_left_open_id' => '', |
|
| 529 | - 'geodir_sidebar_left_open_class' => 'sidebar sidebar-secondary widget-area', |
|
| 530 | - 'geodir_sidebar_left_open_replace' => '<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]">', |
|
| 531 | - 'geodir_sidebar_left_close_replace' => '', |
|
| 532 | - 'geodir_main_content_open_id' => '', |
|
| 533 | - 'geodir_main_content_open_class' => '', |
|
| 534 | - 'geodir_main_content_open_replace' => '<main id="[id]" class="entry [class]" role="main">', |
|
| 535 | - 'geodir_main_content_close_replace' => '', |
|
| 536 | - 'geodir_top_content_add' => '', |
|
| 537 | - 'geodir_before_main_content_add' => '', |
|
| 538 | - 'geodir_before_widget_filter' => '', |
|
| 539 | - 'geodir_after_widget_filter' => '', |
|
| 540 | - 'geodir_location_switcher_menu_li_class_filter' => 'menu-item menu-item-gd-location-switcher menu-item-has-children gd-location-switcher', |
|
| 541 | - 'geodir_theme_compat_css' => stripslashes('.full-width-content #geodir-wrapper-content{width:100%}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}.content{float:left}.sidebar-content .content,.sidebar-content #geodir-wrapper-content{float:right}.sidebar .geodir-company_info{background-color:#fff;border:none}.geodir_full_page .geodir-loc-bar{padding:0;margin:0;border:none}.geodir_full_page .geodir-category-list-in{margin-top:0}.geodir_full_page .top_banner_section{margin-bottom:0}.geodir-breadcrumb-bar{margin-bottom:-35px} .search-page .entry-title,.listings-page .entry-title{font-size: 20px;}.site-inner .geodir-breadcrumb-bar{margin-bottom:0px}'),
|
|
| 542 | - 'geodir_theme_compat_js' => '', |
|
| 543 | - 'geodir_theme_compat_default_options' => '', |
|
| 544 | - 'geodir_theme_compat_code' => 'Genesis' |
|
| 545 | - ); |
|
| 511 | + $theme_compat['Genesis'] = array( |
|
| 512 | + 'geodir_wrapper_open_id' => '', |
|
| 513 | + 'geodir_wrapper_open_class' => 'content-sidebar-wrap', |
|
| 514 | + 'geodir_wrapper_open_replace' => '', |
|
| 515 | + 'geodir_wrapper_close_replace' => '', |
|
| 516 | + 'geodir_wrapper_content_open_id' => '', |
|
| 517 | + 'geodir_wrapper_content_open_class' => 'content', |
|
| 518 | + 'geodir_wrapper_content_open_replace' => '<div class="[class]" role="main" >', |
|
| 519 | + 'geodir_wrapper_content_close_replace' => '', |
|
| 520 | + 'geodir_article_open_id' => '', |
|
| 521 | + 'geodir_article_open_class' => '', |
|
| 522 | + 'geodir_article_open_replace' => '', |
|
| 523 | + 'geodir_article_close_replace' => '', |
|
| 524 | + 'geodir_sidebar_right_open_id' => '', |
|
| 525 | + 'geodir_sidebar_right_open_class' => 'sidebar sidebar-primary widget-area', |
|
| 526 | + 'geodir_sidebar_right_open_replace' => '<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]">', |
|
| 527 | + 'geodir_sidebar_right_close_replace' => '', |
|
| 528 | + 'geodir_sidebar_left_open_id' => '', |
|
| 529 | + 'geodir_sidebar_left_open_class' => 'sidebar sidebar-secondary widget-area', |
|
| 530 | + 'geodir_sidebar_left_open_replace' => '<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]">', |
|
| 531 | + 'geodir_sidebar_left_close_replace' => '', |
|
| 532 | + 'geodir_main_content_open_id' => '', |
|
| 533 | + 'geodir_main_content_open_class' => '', |
|
| 534 | + 'geodir_main_content_open_replace' => '<main id="[id]" class="entry [class]" role="main">', |
|
| 535 | + 'geodir_main_content_close_replace' => '', |
|
| 536 | + 'geodir_top_content_add' => '', |
|
| 537 | + 'geodir_before_main_content_add' => '', |
|
| 538 | + 'geodir_before_widget_filter' => '', |
|
| 539 | + 'geodir_after_widget_filter' => '', |
|
| 540 | + 'geodir_location_switcher_menu_li_class_filter' => 'menu-item menu-item-gd-location-switcher menu-item-has-children gd-location-switcher', |
|
| 541 | + 'geodir_theme_compat_css' => stripslashes('.full-width-content #geodir-wrapper-content{width:100%}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}.content{float:left}.sidebar-content .content,.sidebar-content #geodir-wrapper-content{float:right}.sidebar .geodir-company_info{background-color:#fff;border:none}.geodir_full_page .geodir-loc-bar{padding:0;margin:0;border:none}.geodir_full_page .geodir-category-list-in{margin-top:0}.geodir_full_page .top_banner_section{margin-bottom:0}.geodir-breadcrumb-bar{margin-bottom:-35px} .search-page .entry-title,.listings-page .entry-title{font-size: 20px;}.site-inner .geodir-breadcrumb-bar{margin-bottom:0px}'),
|
|
| 542 | + 'geodir_theme_compat_js' => '', |
|
| 543 | + 'geodir_theme_compat_default_options' => '', |
|
| 544 | + 'geodir_theme_compat_code' => 'Genesis' |
|
| 545 | + ); |
|
| 546 | 546 | |
| 547 | 547 | // Jupiter |
| 548 | - $theme_compat['Jupiter'] = array( |
|
| 549 | - 'geodir_wrapper_open_id' => '', |
|
| 550 | - 'geodir_wrapper_open_class' => '', |
|
| 551 | - 'geodir_wrapper_open_replace' => '<div id="theme-page"><div class="mk-main-wrapper-holder"><div class="theme-page-wrapper mk-main-wrapper mk-grid vc_row-fluid">', |
|
| 552 | - 'geodir_wrapper_close_replace' => '</div></div></div>', |
|
| 553 | - 'geodir_wrapper_content_open_id' => '', |
|
| 554 | - 'geodir_wrapper_content_open_class' => '', |
|
| 555 | - 'geodir_wrapper_content_open_replace' => '', |
|
| 556 | - 'geodir_wrapper_content_close_replace' => '', |
|
| 557 | - 'geodir_article_open_id' => '', |
|
| 558 | - 'geodir_article_open_class' => '', |
|
| 559 | - 'geodir_article_open_replace' => '', |
|
| 560 | - 'geodir_article_close_replace' => '', |
|
| 561 | - 'geodir_sidebar_right_open_id' => 'mk-sidebar', |
|
| 562 | - 'geodir_sidebar_right_open_class' => 'mk-builtin geodir-sidebar-right geodir-listings-sidebar-right', |
|
| 563 | - 'geodir_sidebar_right_open_replace' => '', |
|
| 564 | - 'geodir_sidebar_right_close_replace' => '', |
|
| 565 | - 'geodir_sidebar_left_open_id' => 'mk-sidebar', |
|
| 566 | - 'geodir_sidebar_left_open_class' => 'mk-builtin geodir-sidebar-right geodir-listings-sidebar-right', |
|
| 567 | - 'geodir_sidebar_left_open_replace' => '', |
|
| 568 | - 'geodir_sidebar_left_close_replace' => '', |
|
| 569 | - 'geodir_main_content_open_id' => '', |
|
| 570 | - 'geodir_main_content_open_class' => '', |
|
| 571 | - 'geodir_main_content_open_replace' => '', |
|
| 572 | - 'geodir_main_content_close_replace' => '', |
|
| 573 | - 'geodir_top_content_add' => '', |
|
| 574 | - 'geodir_before_main_content_add' => '', |
|
| 575 | - 'geodir_before_widget_filter' => '', |
|
| 576 | - 'geodir_after_widget_filter' => '', |
|
| 577 | - 'geodir_before_title_filter' => '<h3 class="widgettitle geodir-widget-title">', |
|
| 578 | - 'geodir_after_title_filter' => '', |
|
| 579 | - 'geodir_menu_li_class_filter' => 'menu-item menu-item-has-children no-mega-menu', |
|
| 580 | - 'geodir_sub_menu_ul_class_filter' => '', |
|
| 581 | - 'geodir_sub_menu_li_class_filter' => '', |
|
| 582 | - 'geodir_menu_a_class_filter' => 'menu-item-link', |
|
| 583 | - 'geodir_sub_menu_a_class_filter' => 'menu-item-link one-page-nav-item', |
|
| 584 | - 'geodir_location_switcher_menu_li_class_filter' => 'menu-item menu-item-type-social menu-item-type-social gd-location-switcher menu-item-has-children no-mega-menu', |
|
| 585 | - 'geodir_location_switcher_menu_a_class_filter' => 'menu-item-link', |
|
| 586 | - 'geodir_location_switcher_menu_sub_ul_class_filter' => '', |
|
| 587 | - 'geodir_location_switcher_menu_sub_li_class_filter' => '', |
|
| 588 | - 'geodir_theme_compat_css' => stripslashes('.geodir-widget li,.geodir_category_list_view li{margin:0}#theme-page h3.geodir-entry-title{font-size:14px}#menu-item-gd-location-switcher dd{line-height:44px}#menu-item-gd-location-switcher .geodir_location_sugestion{line-height:20px}.geodir_loginbox{overflow:visible}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'),
|
|
| 589 | - 'geodir_theme_compat_js' => '', |
|
| 590 | - 'geodir_theme_compat_default_options' => '', |
|
| 591 | - 'geodir_theme_compat_code' => 'Jupiter' |
|
| 592 | - ); |
|
| 548 | + $theme_compat['Jupiter'] = array( |
|
| 549 | + 'geodir_wrapper_open_id' => '', |
|
| 550 | + 'geodir_wrapper_open_class' => '', |
|
| 551 | + 'geodir_wrapper_open_replace' => '<div id="theme-page"><div class="mk-main-wrapper-holder"><div class="theme-page-wrapper mk-main-wrapper mk-grid vc_row-fluid">', |
|
| 552 | + 'geodir_wrapper_close_replace' => '</div></div></div>', |
|
| 553 | + 'geodir_wrapper_content_open_id' => '', |
|
| 554 | + 'geodir_wrapper_content_open_class' => '', |
|
| 555 | + 'geodir_wrapper_content_open_replace' => '', |
|
| 556 | + 'geodir_wrapper_content_close_replace' => '', |
|
| 557 | + 'geodir_article_open_id' => '', |
|
| 558 | + 'geodir_article_open_class' => '', |
|
| 559 | + 'geodir_article_open_replace' => '', |
|
| 560 | + 'geodir_article_close_replace' => '', |
|
| 561 | + 'geodir_sidebar_right_open_id' => 'mk-sidebar', |
|
| 562 | + 'geodir_sidebar_right_open_class' => 'mk-builtin geodir-sidebar-right geodir-listings-sidebar-right', |
|
| 563 | + 'geodir_sidebar_right_open_replace' => '', |
|
| 564 | + 'geodir_sidebar_right_close_replace' => '', |
|
| 565 | + 'geodir_sidebar_left_open_id' => 'mk-sidebar', |
|
| 566 | + 'geodir_sidebar_left_open_class' => 'mk-builtin geodir-sidebar-right geodir-listings-sidebar-right', |
|
| 567 | + 'geodir_sidebar_left_open_replace' => '', |
|
| 568 | + 'geodir_sidebar_left_close_replace' => '', |
|
| 569 | + 'geodir_main_content_open_id' => '', |
|
| 570 | + 'geodir_main_content_open_class' => '', |
|
| 571 | + 'geodir_main_content_open_replace' => '', |
|
| 572 | + 'geodir_main_content_close_replace' => '', |
|
| 573 | + 'geodir_top_content_add' => '', |
|
| 574 | + 'geodir_before_main_content_add' => '', |
|
| 575 | + 'geodir_before_widget_filter' => '', |
|
| 576 | + 'geodir_after_widget_filter' => '', |
|
| 577 | + 'geodir_before_title_filter' => '<h3 class="widgettitle geodir-widget-title">', |
|
| 578 | + 'geodir_after_title_filter' => '', |
|
| 579 | + 'geodir_menu_li_class_filter' => 'menu-item menu-item-has-children no-mega-menu', |
|
| 580 | + 'geodir_sub_menu_ul_class_filter' => '', |
|
| 581 | + 'geodir_sub_menu_li_class_filter' => '', |
|
| 582 | + 'geodir_menu_a_class_filter' => 'menu-item-link', |
|
| 583 | + 'geodir_sub_menu_a_class_filter' => 'menu-item-link one-page-nav-item', |
|
| 584 | + 'geodir_location_switcher_menu_li_class_filter' => 'menu-item menu-item-type-social menu-item-type-social gd-location-switcher menu-item-has-children no-mega-menu', |
|
| 585 | + 'geodir_location_switcher_menu_a_class_filter' => 'menu-item-link', |
|
| 586 | + 'geodir_location_switcher_menu_sub_ul_class_filter' => '', |
|
| 587 | + 'geodir_location_switcher_menu_sub_li_class_filter' => '', |
|
| 588 | + 'geodir_theme_compat_css' => stripslashes('.geodir-widget li,.geodir_category_list_view li{margin:0}#theme-page h3.geodir-entry-title{font-size:14px}#menu-item-gd-location-switcher dd{line-height:44px}#menu-item-gd-location-switcher .geodir_location_sugestion{line-height:20px}.geodir_loginbox{overflow:visible}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'),
|
|
| 589 | + 'geodir_theme_compat_js' => '', |
|
| 590 | + 'geodir_theme_compat_default_options' => '', |
|
| 591 | + 'geodir_theme_compat_code' => 'Jupiter' |
|
| 592 | + ); |
|
| 593 | 593 | |
| 594 | 594 | // Multi News |
| 595 | - $theme_compat['Multi_News'] = array( |
|
| 596 | - 'geodir_wrapper_open_id' => '', |
|
| 597 | - 'geodir_wrapper_open_class' => 'main-container clearfix', |
|
| 598 | - 'geodir_wrapper_open_replace' => '', |
|
| 599 | - 'geodir_wrapper_close_replace' => '', |
|
| 600 | - 'geodir_wrapper_content_open_id' => '', |
|
| 601 | - 'geodir_wrapper_content_open_class' => '', |
|
| 602 | - 'geodir_wrapper_content_open_replace' => '<div class="main-left" ><div class="main-content "><div class="site-content page-wrap">', |
|
| 603 | - 'geodir_wrapper_content_close_replace' => '</div></div></div>', |
|
| 604 | - 'geodir_article_open_id' => '', |
|
| 605 | - 'geodir_article_open_class' => '', |
|
| 606 | - 'geodir_article_open_replace' => '', |
|
| 607 | - 'geodir_article_close_replace' => '', |
|
| 608 | - 'geodir_sidebar_right_open_id' => '', |
|
| 609 | - 'geodir_sidebar_right_open_class' => '', |
|
| 610 | - 'geodir_sidebar_right_open_replace' => '<aside class="sidebar" role="complementary" itemscope itemtype="[itemtype]" >', |
|
| 611 | - 'geodir_sidebar_right_close_replace' => '', |
|
| 612 | - 'geodir_sidebar_left_open_id' => '', |
|
| 613 | - 'geodir_sidebar_left_open_class' => '', |
|
| 614 | - 'geodir_sidebar_left_open_replace' => '<aside class="secondary-sidebar" role="complementary" itemscope itemtype="[itemtype]" >', |
|
| 615 | - 'geodir_sidebar_left_close_replace' => '', |
|
| 616 | - 'geodir_main_content_open_id' => '', |
|
| 617 | - 'geodir_main_content_open_class' => '', |
|
| 618 | - 'geodir_main_content_open_replace' => '<div class="site-content page-wrap">', |
|
| 619 | - 'geodir_main_content_close_replace' => '</div>', |
|
| 620 | - 'geodir_top_content_add' => '', |
|
| 621 | - 'geodir_before_main_content_add' => '', |
|
| 622 | - 'geodir_full_page_class_filter' => 'section full-width-section', |
|
| 623 | - 'geodir_before_widget_filter' => '', |
|
| 624 | - 'geodir_after_widget_filter' => '', |
|
| 625 | - 'geodir_before_title_filter' => '<div class="widget-title"><h2>', |
|
| 626 | - 'geodir_after_title_filter' => '</h2></div>', |
|
| 627 | - 'geodir_menu_li_class_filter' => '', |
|
| 628 | - 'geodir_sub_menu_ul_class_filter' => '', |
|
| 629 | - 'geodir_sub_menu_li_class_filter' => '', |
|
| 630 | - 'geodir_menu_a_class_filter' => '', |
|
| 631 | - 'geodir_sub_menu_a_class_filter' => '', |
|
| 632 | - 'geodir_location_switcher_menu_li_class_filter' => '', |
|
| 633 | - 'geodir_location_switcher_menu_a_class_filter' => '', |
|
| 634 | - 'geodir_location_switcher_menu_sub_ul_class_filter' => '', |
|
| 635 | - 'geodir_location_switcher_menu_sub_li_class_filter' => '', |
|
| 636 | - 'geodir_theme_compat_css' => stripslashes('.full-width-section .geodir-search{margin:0;width:100%}.geodir_full_page .geodir-search{margin:0 auto;float:none}.geodir-search input[type=button],.geodir-search input[type=submit]{width:13%}.geodir-search input[type=text]{border:1px solid #ddd;border-radius:0;padding:0 8px}.geodir-category-list-in,.geodir-loc-bar-in{background:#f2f2f2;border-color:#dbdbdb}.geodir-category-list-in{margin-top:0}.geodir-cat-list .widget-title h2{margin:-13px -13px 13px}.widget .geodir-cat-list ul li.geodir-pcat-show a:before{display:none!important}.widget .geodir-cat-list ul li.geodir-pcat-show i{margin-right:5px}.container .geodir-search select{margin:0 3% 0 0;padding:8px 10px;width:13%}#geodir_carousel,#geodir_slider{border-radius:0;-webkit-border-radius:0;-moz-border-radius:0;margin-bottom:20px!important;border:1px solid #e1e1e1;box-shadow:none}#geodir_carousel{padding:10px}.geodir-tabs-content ol.commentlist{margin:40px 0;padding:0}li#post_mapTab{min-height:400px}#reviewsTab ol.commentlist li{border-bottom:none}#reviewsTab ol.commentlist li article.comment{border-bottom:1px solid #e1e1e1;padding-bottom:10px}.comment-content .rating{display:none}.comment-respond .gd_rating{margin-bottom:20px}div.geodir-rating{width:85px!important}.comment-respond .comment-notes{margin-bottom:10px}.average-review span,.comment-form label,.dtreviewed,.geodir-details-sidebar-user-links a,.geodir-viewall,.geodir_more_info span,.reviewer,dl.geodir-tab-head dd a{font-family:"Archivo Narrow",sans-serif}section.comment-content{margin:0 0 0 12%}#reviewsTab .comments-area .comment-content{width:auto}section.comment-content .description,section.comment-content p{margin:15px 0}dl.geodir-tab-head dd a{background:#f3f3f3;margin-top:-1px;font-size:14px;padding:0 15px}dl.geodir-tab-head dd.geodir-tab-active a{padding-bottom:1px}.geodir-widget .geodir_list_heading,.geodir-widget h3.widget-title{padding:0 15px;background:#e9e9e9;border:1px solid #dbdbdb;height:38px;line-height:38px;color:#2d2d2d}.geodir-widget .geodir_list_heading h3{background:0 0;border:none}.geodir-widget .geodir_list_heading{margin:-13px -14px 13px}.geodir-map-listing-page{border-width:1px 0 0;border-style:solid;border-color:#dbdbdb}.geodir-sidebar-wrap .geodir-company_info{margin:15px}.geodir-details-sidebar-social-sharing iframe{float:left}.geodir-details-sidebar-rating{overflow:hidden}.geodir-details-sidebar-rating .gd_rating_show,.geodir-details-sidebar-rating .geodir-rating{float:left;margin-right:15px}.geodir-details-sidebar-rating span.item{float:left;margin-top:5px}.geodir-details-sidebar-rating .average-review{top:-4px;position:relative}.geodir-details-sidebar-rating span.item img{margin-top:5px}.geodir_full_page{background:#fff;border:1px solid #e1e1e1;-webkit-box-shadow:0 1px 0 #e5e5e5;box-shadow:0 1px 0 #e5e5e5;padding:15px;margin-bottom:20px;clear:both}.geodir_map_container .main_list img{margin:0 5px}.geodir_category_list_view li.geodir-gridview .geodir-post-img .geodir_thumbnail{margin-bottom:10px}.geodir-addinfo .geodir-pinpoint,.geodir-addinfo a i{margin-right:5px}.geodir_category_list_view li.geodir-gridview h3{font-size:18px;margin-bottom:10px}#related_listingTab ul.geodir_category_list_view{padding:0!important}#reviewsTab #comments .gd_rating{margin-top:5px}.widget .geodir_category_list_view li .geodir-entry-content,.widget .geodir_category_list_view li a:before{display:none!important}.geodir_category_list_view li .geodir-entry-title{margin-bottom:10px}.widget ul.geodir_category_list_view{padding:15px}.sidebar .widget .geodir_category_list_view li{width:calc(100% - 25px)}.widget .geodir-loginbox-list li{overflow:visible!important}.widget ul.chosen-results{margin:0!important}.main_list_selecter{margin-right:5px}.geodir-viewall{float:right;width:auto!important}.widget-title h2{padding:0 15px;background:#e9e9e9;border:1px solid #dbdbdb;height:38px;line-height:38px}.widget:first-child .geodir_list_heading .widget-title{margin-top:0}.geodir_list_heading .widget-title{float:left;width:80%;margin-top:0}.geodir_list_heading .widget-title h2{padding:0 px;background:0 0;border:none;height:auto;line-height:auto}.chosen-default:before{content:none;display:none;position:absolute;margin-left:-1000000px;float:left}#geodir-wrapper .entry-crumbs{margin-bottom:20px}.geodir-search .mom-select{float:left;width:150px;margin:5px;border:1px solid #ddd;height:40px}.iprelative .gm-style .gm-style-iw{width:100%!important}'),
|
|
| 637 | - 'geodir_theme_compat_js' => 'jQuery(document).ready(function(e){e(".geodir_full_page").length&&""===e.trim(e(".geodir_full_page").html())&&e(".geodir_full_page").css({display:"none"})});',
|
|
| 638 | - 'geodir_theme_compat_default_options' => '', |
|
| 639 | - 'geodir_theme_compat_code' => 'Multi_News' |
|
| 640 | - ); |
|
| 641 | - |
|
| 642 | - update_option('gd_theme_compats', $theme_compat);
|
|
| 643 | - |
|
| 644 | - gd_set_theme_compat();// set the compat pack if avail |
|
| 595 | + $theme_compat['Multi_News'] = array( |
|
| 596 | + 'geodir_wrapper_open_id' => '', |
|
| 597 | + 'geodir_wrapper_open_class' => 'main-container clearfix', |
|
| 598 | + 'geodir_wrapper_open_replace' => '', |
|
| 599 | + 'geodir_wrapper_close_replace' => '', |
|
| 600 | + 'geodir_wrapper_content_open_id' => '', |
|
| 601 | + 'geodir_wrapper_content_open_class' => '', |
|
| 602 | + 'geodir_wrapper_content_open_replace' => '<div class="main-left" ><div class="main-content "><div class="site-content page-wrap">', |
|
| 603 | + 'geodir_wrapper_content_close_replace' => '</div></div></div>', |
|
| 604 | + 'geodir_article_open_id' => '', |
|
| 605 | + 'geodir_article_open_class' => '', |
|
| 606 | + 'geodir_article_open_replace' => '', |
|
| 607 | + 'geodir_article_close_replace' => '', |
|
| 608 | + 'geodir_sidebar_right_open_id' => '', |
|
| 609 | + 'geodir_sidebar_right_open_class' => '', |
|
| 610 | + 'geodir_sidebar_right_open_replace' => '<aside class="sidebar" role="complementary" itemscope itemtype="[itemtype]" >', |
|
| 611 | + 'geodir_sidebar_right_close_replace' => '', |
|
| 612 | + 'geodir_sidebar_left_open_id' => '', |
|
| 613 | + 'geodir_sidebar_left_open_class' => '', |
|
| 614 | + 'geodir_sidebar_left_open_replace' => '<aside class="secondary-sidebar" role="complementary" itemscope itemtype="[itemtype]" >', |
|
| 615 | + 'geodir_sidebar_left_close_replace' => '', |
|
| 616 | + 'geodir_main_content_open_id' => '', |
|
| 617 | + 'geodir_main_content_open_class' => '', |
|
| 618 | + 'geodir_main_content_open_replace' => '<div class="site-content page-wrap">', |
|
| 619 | + 'geodir_main_content_close_replace' => '</div>', |
|
| 620 | + 'geodir_top_content_add' => '', |
|
| 621 | + 'geodir_before_main_content_add' => '', |
|
| 622 | + 'geodir_full_page_class_filter' => 'section full-width-section', |
|
| 623 | + 'geodir_before_widget_filter' => '', |
|
| 624 | + 'geodir_after_widget_filter' => '', |
|
| 625 | + 'geodir_before_title_filter' => '<div class="widget-title"><h2>', |
|
| 626 | + 'geodir_after_title_filter' => '</h2></div>', |
|
| 627 | + 'geodir_menu_li_class_filter' => '', |
|
| 628 | + 'geodir_sub_menu_ul_class_filter' => '', |
|
| 629 | + 'geodir_sub_menu_li_class_filter' => '', |
|
| 630 | + 'geodir_menu_a_class_filter' => '', |
|
| 631 | + 'geodir_sub_menu_a_class_filter' => '', |
|
| 632 | + 'geodir_location_switcher_menu_li_class_filter' => '', |
|
| 633 | + 'geodir_location_switcher_menu_a_class_filter' => '', |
|
| 634 | + 'geodir_location_switcher_menu_sub_ul_class_filter' => '', |
|
| 635 | + 'geodir_location_switcher_menu_sub_li_class_filter' => '', |
|
| 636 | + 'geodir_theme_compat_css' => stripslashes('.full-width-section .geodir-search{margin:0;width:100%}.geodir_full_page .geodir-search{margin:0 auto;float:none}.geodir-search input[type=button],.geodir-search input[type=submit]{width:13%}.geodir-search input[type=text]{border:1px solid #ddd;border-radius:0;padding:0 8px}.geodir-category-list-in,.geodir-loc-bar-in{background:#f2f2f2;border-color:#dbdbdb}.geodir-category-list-in{margin-top:0}.geodir-cat-list .widget-title h2{margin:-13px -13px 13px}.widget .geodir-cat-list ul li.geodir-pcat-show a:before{display:none!important}.widget .geodir-cat-list ul li.geodir-pcat-show i{margin-right:5px}.container .geodir-search select{margin:0 3% 0 0;padding:8px 10px;width:13%}#geodir_carousel,#geodir_slider{border-radius:0;-webkit-border-radius:0;-moz-border-radius:0;margin-bottom:20px!important;border:1px solid #e1e1e1;box-shadow:none}#geodir_carousel{padding:10px}.geodir-tabs-content ol.commentlist{margin:40px 0;padding:0}li#post_mapTab{min-height:400px}#reviewsTab ol.commentlist li{border-bottom:none}#reviewsTab ol.commentlist li article.comment{border-bottom:1px solid #e1e1e1;padding-bottom:10px}.comment-content .rating{display:none}.comment-respond .gd_rating{margin-bottom:20px}div.geodir-rating{width:85px!important}.comment-respond .comment-notes{margin-bottom:10px}.average-review span,.comment-form label,.dtreviewed,.geodir-details-sidebar-user-links a,.geodir-viewall,.geodir_more_info span,.reviewer,dl.geodir-tab-head dd a{font-family:"Archivo Narrow",sans-serif}section.comment-content{margin:0 0 0 12%}#reviewsTab .comments-area .comment-content{width:auto}section.comment-content .description,section.comment-content p{margin:15px 0}dl.geodir-tab-head dd a{background:#f3f3f3;margin-top:-1px;font-size:14px;padding:0 15px}dl.geodir-tab-head dd.geodir-tab-active a{padding-bottom:1px}.geodir-widget .geodir_list_heading,.geodir-widget h3.widget-title{padding:0 15px;background:#e9e9e9;border:1px solid #dbdbdb;height:38px;line-height:38px;color:#2d2d2d}.geodir-widget .geodir_list_heading h3{background:0 0;border:none}.geodir-widget .geodir_list_heading{margin:-13px -14px 13px}.geodir-map-listing-page{border-width:1px 0 0;border-style:solid;border-color:#dbdbdb}.geodir-sidebar-wrap .geodir-company_info{margin:15px}.geodir-details-sidebar-social-sharing iframe{float:left}.geodir-details-sidebar-rating{overflow:hidden}.geodir-details-sidebar-rating .gd_rating_show,.geodir-details-sidebar-rating .geodir-rating{float:left;margin-right:15px}.geodir-details-sidebar-rating span.item{float:left;margin-top:5px}.geodir-details-sidebar-rating .average-review{top:-4px;position:relative}.geodir-details-sidebar-rating span.item img{margin-top:5px}.geodir_full_page{background:#fff;border:1px solid #e1e1e1;-webkit-box-shadow:0 1px 0 #e5e5e5;box-shadow:0 1px 0 #e5e5e5;padding:15px;margin-bottom:20px;clear:both}.geodir_map_container .main_list img{margin:0 5px}.geodir_category_list_view li.geodir-gridview .geodir-post-img .geodir_thumbnail{margin-bottom:10px}.geodir-addinfo .geodir-pinpoint,.geodir-addinfo a i{margin-right:5px}.geodir_category_list_view li.geodir-gridview h3{font-size:18px;margin-bottom:10px}#related_listingTab ul.geodir_category_list_view{padding:0!important}#reviewsTab #comments .gd_rating{margin-top:5px}.widget .geodir_category_list_view li .geodir-entry-content,.widget .geodir_category_list_view li a:before{display:none!important}.geodir_category_list_view li .geodir-entry-title{margin-bottom:10px}.widget ul.geodir_category_list_view{padding:15px}.sidebar .widget .geodir_category_list_view li{width:calc(100% - 25px)}.widget .geodir-loginbox-list li{overflow:visible!important}.widget ul.chosen-results{margin:0!important}.main_list_selecter{margin-right:5px}.geodir-viewall{float:right;width:auto!important}.widget-title h2{padding:0 15px;background:#e9e9e9;border:1px solid #dbdbdb;height:38px;line-height:38px}.widget:first-child .geodir_list_heading .widget-title{margin-top:0}.geodir_list_heading .widget-title{float:left;width:80%;margin-top:0}.geodir_list_heading .widget-title h2{padding:0 px;background:0 0;border:none;height:auto;line-height:auto}.chosen-default:before{content:none;display:none;position:absolute;margin-left:-1000000px;float:left}#geodir-wrapper .entry-crumbs{margin-bottom:20px}.geodir-search .mom-select{float:left;width:150px;margin:5px;border:1px solid #ddd;height:40px}.iprelative .gm-style .gm-style-iw{width:100%!important}'),
|
|
| 637 | + 'geodir_theme_compat_js' => 'jQuery(document).ready(function(e){e(".geodir_full_page").length&&""===e.trim(e(".geodir_full_page").html())&&e(".geodir_full_page").css({display:"none"})});',
|
|
| 638 | + 'geodir_theme_compat_default_options' => '', |
|
| 639 | + 'geodir_theme_compat_code' => 'Multi_News' |
|
| 640 | + ); |
|
| 641 | + |
|
| 642 | + update_option('gd_theme_compats', $theme_compat);
|
|
| 643 | + |
|
| 644 | + gd_set_theme_compat();// set the compat pack if avail |
|
| 645 | 645 | } |
| 646 | 646 | |
| 647 | 647 | |
@@ -653,61 +653,61 @@ discard block |
||
| 653 | 653 | * @global object $wpdb WordPress Database object. |
| 654 | 654 | */ |
| 655 | 655 | function gd_convert_virtual_pages(){
|
| 656 | - global $wpdb; |
|
| 657 | - |
|
| 658 | - // Update the add listing page settings |
|
| 659 | - $add_listing_page = $wpdb->get_var( |
|
| 660 | - $wpdb->prepare( |
|
| 661 | - "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
| 662 | - array('add-listing')
|
|
| 663 | - ) |
|
| 664 | - ); |
|
| 665 | - |
|
| 666 | - if($add_listing_page){
|
|
| 667 | - wp_update_post( array('ID' => $add_listing_page, 'post_status' => 'publish') );
|
|
| 668 | - update_option( 'geodir_add_listing_page', $add_listing_page); |
|
| 669 | - } |
|
| 670 | - |
|
| 671 | - // Update the listing preview page settings |
|
| 672 | - $listing_preview_page = $wpdb->get_var( |
|
| 673 | - $wpdb->prepare( |
|
| 674 | - "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
| 675 | - array('listing-preview')
|
|
| 676 | - ) |
|
| 677 | - ); |
|
| 678 | - |
|
| 679 | - if($listing_preview_page){
|
|
| 680 | - wp_update_post( array('ID' => $listing_preview_page, 'post_status' => 'publish') );
|
|
| 681 | - update_option( 'geodir_preview_page', $listing_preview_page); |
|
| 682 | - } |
|
| 683 | - |
|
| 684 | - // Update the listing success page settings |
|
| 685 | - $listing_success_page = $wpdb->get_var( |
|
| 686 | - $wpdb->prepare( |
|
| 687 | - "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
| 688 | - array('listing-success')
|
|
| 689 | - ) |
|
| 690 | - ); |
|
| 691 | - |
|
| 692 | - if($listing_success_page){
|
|
| 693 | - wp_update_post( array('ID' => $listing_success_page, 'post_status' => 'publish') );
|
|
| 694 | - update_option( 'geodir_success_page', $listing_success_page); |
|
| 695 | - } |
|
| 696 | - |
|
| 697 | - // Update the listing success page settings |
|
| 698 | - $location_page = $wpdb->get_var( |
|
| 699 | - $wpdb->prepare( |
|
| 700 | - "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
| 701 | - array('location')
|
|
| 702 | - ) |
|
| 703 | - ); |
|
| 704 | - |
|
| 705 | - if($location_page){
|
|
| 706 | - $location_slug = get_option('geodir_location_prefix');
|
|
| 707 | - if(!$location_slug ){$location_slug = 'location';}
|
|
| 708 | - wp_update_post( array('ID' => $location_page, 'post_status' => 'publish','post_name' => $location_slug) );
|
|
| 709 | - update_option( 'geodir_location_page', $location_page); |
|
| 710 | - } |
|
| 656 | + global $wpdb; |
|
| 657 | + |
|
| 658 | + // Update the add listing page settings |
|
| 659 | + $add_listing_page = $wpdb->get_var( |
|
| 660 | + $wpdb->prepare( |
|
| 661 | + "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
| 662 | + array('add-listing')
|
|
| 663 | + ) |
|
| 664 | + ); |
|
| 665 | + |
|
| 666 | + if($add_listing_page){
|
|
| 667 | + wp_update_post( array('ID' => $add_listing_page, 'post_status' => 'publish') );
|
|
| 668 | + update_option( 'geodir_add_listing_page', $add_listing_page); |
|
| 669 | + } |
|
| 670 | + |
|
| 671 | + // Update the listing preview page settings |
|
| 672 | + $listing_preview_page = $wpdb->get_var( |
|
| 673 | + $wpdb->prepare( |
|
| 674 | + "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
| 675 | + array('listing-preview')
|
|
| 676 | + ) |
|
| 677 | + ); |
|
| 678 | + |
|
| 679 | + if($listing_preview_page){
|
|
| 680 | + wp_update_post( array('ID' => $listing_preview_page, 'post_status' => 'publish') );
|
|
| 681 | + update_option( 'geodir_preview_page', $listing_preview_page); |
|
| 682 | + } |
|
| 683 | + |
|
| 684 | + // Update the listing success page settings |
|
| 685 | + $listing_success_page = $wpdb->get_var( |
|
| 686 | + $wpdb->prepare( |
|
| 687 | + "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
| 688 | + array('listing-success')
|
|
| 689 | + ) |
|
| 690 | + ); |
|
| 691 | + |
|
| 692 | + if($listing_success_page){
|
|
| 693 | + wp_update_post( array('ID' => $listing_success_page, 'post_status' => 'publish') );
|
|
| 694 | + update_option( 'geodir_success_page', $listing_success_page); |
|
| 695 | + } |
|
| 696 | + |
|
| 697 | + // Update the listing success page settings |
|
| 698 | + $location_page = $wpdb->get_var( |
|
| 699 | + $wpdb->prepare( |
|
| 700 | + "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
| 701 | + array('location')
|
|
| 702 | + ) |
|
| 703 | + ); |
|
| 704 | + |
|
| 705 | + if($location_page){
|
|
| 706 | + $location_slug = get_option('geodir_location_prefix');
|
|
| 707 | + if(!$location_slug ){$location_slug = 'location';}
|
|
| 708 | + wp_update_post( array('ID' => $location_page, 'post_status' => 'publish','post_name' => $location_slug) );
|
|
| 709 | + update_option( 'geodir_location_page', $location_page); |
|
| 710 | + } |
|
| 711 | 711 | |
| 712 | 712 | } |
| 713 | 713 | |
@@ -721,31 +721,31 @@ discard block |
||
| 721 | 721 | function gd_fix_cpt_rewrite_slug() |
| 722 | 722 | {
|
| 723 | 723 | |
| 724 | - $alt_post_types = array(); |
|
| 725 | - $post_types = get_option('geodir_post_types');
|
|
| 724 | + $alt_post_types = array(); |
|
| 725 | + $post_types = get_option('geodir_post_types');
|
|
| 726 | 726 | |
| 727 | 727 | |
| 728 | - if (is_array($post_types)){
|
|
| 728 | + if (is_array($post_types)){
|
|
| 729 | 729 | |
| 730 | - foreach ($post_types as $post_type => $args) {
|
|
| 730 | + foreach ($post_types as $post_type => $args) {
|
|
| 731 | 731 | |
| 732 | 732 | |
| 733 | - if(isset($args['rewrite']['slug'])){
|
|
| 734 | - $args['rewrite']['slug'] = str_replace("/%gd_taxonomy%","",$args['rewrite']['slug']);
|
|
| 735 | - } |
|
| 733 | + if(isset($args['rewrite']['slug'])){
|
|
| 734 | + $args['rewrite']['slug'] = str_replace("/%gd_taxonomy%","",$args['rewrite']['slug']);
|
|
| 735 | + } |
|
| 736 | 736 | |
| 737 | - $alt_post_types[$post_type] = $args; |
|
| 737 | + $alt_post_types[$post_type] = $args; |
|
| 738 | 738 | |
| 739 | - } |
|
| 740 | - } |
|
| 739 | + } |
|
| 740 | + } |
|
| 741 | 741 | |
| 742 | - if(!empty($alt_post_types)) {
|
|
| 743 | - update_option('geodir_post_types',$alt_post_types);
|
|
| 744 | - } |
|
| 742 | + if(!empty($alt_post_types)) {
|
|
| 743 | + update_option('geodir_post_types',$alt_post_types);
|
|
| 744 | + } |
|
| 745 | 745 | |
| 746 | 746 | |
| 747 | - // flush the rewrite rules |
|
| 748 | - flush_rewrite_rules(); |
|
| 747 | + // flush the rewrite rules |
|
| 748 | + flush_rewrite_rules(); |
|
| 749 | 749 | } |
| 750 | 750 | |
| 751 | 751 | |
@@ -758,18 +758,18 @@ discard block |
||
| 758 | 758 | */ |
| 759 | 759 | function gd_fix_address_detail_table_limit() |
| 760 | 760 | {
|
| 761 | - global $wpdb; |
|
| 762 | - |
|
| 763 | - $all_postypes = geodir_get_posttypes(); |
|
| 764 | - |
|
| 765 | - if (!empty($all_postypes)) {
|
|
| 766 | - foreach ($all_postypes as $key) {
|
|
| 767 | - // update each GD CTP |
|
| 768 | - try {
|
|
| 769 | - $wpdb->query("ALTER TABLE " . $wpdb->prefix . "geodir_" . $key . "_detail MODIFY post_city VARCHAR( 50 ) NULL,MODIFY post_region VARCHAR( 50 ) NULL,MODIFY post_country VARCHAR( 50 ) NULL");
|
|
| 770 | - } catch(Exception $e) {
|
|
| 771 | - error_log( 'Error: ' . $e->getMessage() ); |
|
| 772 | - } |
|
| 773 | - } |
|
| 774 | - } |
|
| 761 | + global $wpdb; |
|
| 762 | + |
|
| 763 | + $all_postypes = geodir_get_posttypes(); |
|
| 764 | + |
|
| 765 | + if (!empty($all_postypes)) {
|
|
| 766 | + foreach ($all_postypes as $key) {
|
|
| 767 | + // update each GD CTP |
|
| 768 | + try {
|
|
| 769 | + $wpdb->query("ALTER TABLE " . $wpdb->prefix . "geodir_" . $key . "_detail MODIFY post_city VARCHAR( 50 ) NULL,MODIFY post_region VARCHAR( 50 ) NULL,MODIFY post_country VARCHAR( 50 ) NULL");
|
|
| 770 | + } catch(Exception $e) {
|
|
| 771 | + error_log( 'Error: ' . $e->getMessage() ); |
|
| 772 | + } |
|
| 773 | + } |
|
| 774 | + } |
|
| 775 | 775 | } |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | |
| 10 | 10 | global $wpdb; |
| 11 | 11 | |
| 12 | -if (get_option('geodirectory' . '_db_version') != GEODIRECTORY_VERSION) {
|
|
| 12 | +if (get_option('geodirectory'.'_db_version') != GEODIRECTORY_VERSION) {
|
|
| 13 | 13 | /** |
| 14 | 14 | * Include custom database table related functions. |
| 15 | 15 | * |
@@ -47,9 +47,9 @@ discard block |
||
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | |
| 50 | - add_action('init', 'gd_fix_cpt_rewrite_slug', 11);// this needs to be kept for a few versions
|
|
| 50 | + add_action('init', 'gd_fix_cpt_rewrite_slug', 11); // this needs to be kept for a few versions
|
|
| 51 | 51 | |
| 52 | - update_option('geodirectory' . '_db_version', GEODIRECTORY_VERSION);
|
|
| 52 | + update_option('geodirectory'.'_db_version', GEODIRECTORY_VERSION);
|
|
| 53 | 53 | |
| 54 | 54 | } |
| 55 | 55 | |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | * @since 1.0.0 |
| 85 | 85 | * @package GeoDirectory |
| 86 | 86 | */ |
| 87 | -function geodir_upgrade_146(){
|
|
| 87 | +function geodir_upgrade_146() {
|
|
| 88 | 88 | gd_convert_virtual_pages(); |
| 89 | 89 | } |
| 90 | 90 | |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | * @since 1.5.0 |
| 95 | 95 | * @package GeoDirectory |
| 96 | 96 | */ |
| 97 | -function geodir_upgrade_150(){
|
|
| 97 | +function geodir_upgrade_150() {
|
|
| 98 | 98 | gd_fix_cpt_rewrite_slug(); |
| 99 | 99 | } |
| 100 | 100 | |
@@ -106,12 +106,12 @@ discard block |
||
| 106 | 106 | * @since 1.4.8 |
| 107 | 107 | * @package GeoDirectory |
| 108 | 108 | */ |
| 109 | -function geodir_upgrade_148(){
|
|
| 109 | +function geodir_upgrade_148() {
|
|
| 110 | 110 | /* |
| 111 | 111 | * Blank the users google password if present as we now use oAuth 2.0 |
| 112 | 112 | */ |
| 113 | - update_option('geodir_ga_pass','');
|
|
| 114 | - update_option('geodir_ga_user','');
|
|
| 113 | + update_option('geodir_ga_pass', '');
|
|
| 114 | + update_option('geodir_ga_user', '');
|
|
| 115 | 115 | |
| 116 | 116 | } |
| 117 | 117 | |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | * @since 1.5.3 |
| 123 | 123 | * @package GeoDirectory |
| 124 | 124 | */ |
| 125 | -function geodir_upgrade_153(){
|
|
| 125 | +function geodir_upgrade_153() {
|
|
| 126 | 126 | geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), '');
|
| 127 | 127 | geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), '');
|
| 128 | 128 | } |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | * @since 1.5.3 |
| 134 | 134 | * @package GeoDirectory |
| 135 | 135 | */ |
| 136 | -function geodir_upgrade_154(){
|
|
| 136 | +function geodir_upgrade_154() {
|
|
| 137 | 137 | geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), '');
|
| 138 | 138 | } |
| 139 | 139 | |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | * @since 1.5.2 |
| 144 | 144 | * @package GeoDirectory |
| 145 | 145 | */ |
| 146 | -function geodir_upgrade_152(){
|
|
| 146 | +function geodir_upgrade_152() {
|
|
| 147 | 147 | gd_fix_address_detail_table_limit(); |
| 148 | 148 | } |
| 149 | 149 | |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | function geodir_fix_review_date() |
| 178 | 178 | {
|
| 179 | 179 | global $wpdb; |
| 180 | - $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.post_date = c.comment_date WHERE gdr.post_date='0000-00-00 00:00:00'");
|
|
| 180 | + $wpdb->query("UPDATE ".GEODIR_REVIEW_TABLE." gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.post_date = c.comment_date WHERE gdr.post_date='0000-00-00 00:00:00'");
|
|
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | /** |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | function geodir_fix_review_post_status() |
| 191 | 191 | {
|
| 192 | 192 | global $wpdb; |
| 193 | - $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->posts p ON gdr.post_id=p.ID SET gdr.post_status = 1 WHERE gdr.post_status IS NULL AND p.post_status='publish'");
|
|
| 193 | + $wpdb->query("UPDATE ".GEODIR_REVIEW_TABLE." gdr JOIN $wpdb->posts p ON gdr.post_id=p.ID SET gdr.post_status = 1 WHERE gdr.post_status IS NULL AND p.post_status='publish'");
|
|
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | /** |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | function geodir_fix_review_content() |
| 205 | 205 | {
|
| 206 | 206 | global $wpdb; |
| 207 | - if ($wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.comment_content = c.comment_content WHERE gdr.comment_content IS NULL")) {
|
|
| 207 | + if ($wpdb->query("UPDATE ".GEODIR_REVIEW_TABLE." gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.comment_content = c.comment_content WHERE gdr.comment_content IS NULL")) {
|
|
| 208 | 208 | return true; |
| 209 | 209 | } else {
|
| 210 | 210 | return false; |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | foreach ($all_postypes as $key) {
|
| 230 | 230 | // update each GD CTP |
| 231 | 231 | |
| 232 | - $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN " . $wpdb->prefix . "geodir_" . $key . "_detail d ON gdr.post_id=d.post_id SET gdr.post_latitude = d.post_latitude, gdr.post_longitude = d.post_longitude, gdr.post_city = d.post_city, gdr.post_region=d.post_region, gdr.post_country=d.post_country WHERE gdr.post_latitude IS NULL OR gdr.post_city IS NULL");
|
|
| 232 | + $wpdb->query("UPDATE ".GEODIR_REVIEW_TABLE." gdr JOIN ".$wpdb->prefix."geodir_".$key."_detail d ON gdr.post_id=d.post_id SET gdr.post_latitude = d.post_latitude, gdr.post_longitude = d.post_longitude, gdr.post_city = d.post_city, gdr.post_region=d.post_region, gdr.post_country=d.post_country WHERE gdr.post_latitude IS NULL OR gdr.post_city IS NULL");
|
|
| 233 | 233 | |
| 234 | 234 | } |
| 235 | 235 | return true; |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | if (!empty($all_postypes)) {
|
| 254 | 254 | foreach ($all_postypes as $key) {
|
| 255 | 255 | // update each GD CTP |
| 256 | - $reviews = $wpdb->get_results("SELECT post_id FROM " . $wpdb->prefix . "geodir_" . $key . "_detail d");
|
|
| 256 | + $reviews = $wpdb->get_results("SELECT post_id FROM ".$wpdb->prefix."geodir_".$key."_detail d");
|
|
| 257 | 257 | |
| 258 | 258 | if (!empty($reviews)) {
|
| 259 | 259 | foreach ($reviews as $post_id) {
|
@@ -641,7 +641,7 @@ discard block |
||
| 641 | 641 | |
| 642 | 642 | update_option('gd_theme_compats', $theme_compat);
|
| 643 | 643 | |
| 644 | - gd_set_theme_compat();// set the compat pack if avail |
|
| 644 | + gd_set_theme_compat(); // set the compat pack if avail |
|
| 645 | 645 | } |
| 646 | 646 | |
| 647 | 647 | |
@@ -652,61 +652,61 @@ discard block |
||
| 652 | 652 | * @package GeoDirectory |
| 653 | 653 | * @global object $wpdb WordPress Database object. |
| 654 | 654 | */ |
| 655 | -function gd_convert_virtual_pages(){
|
|
| 655 | +function gd_convert_virtual_pages() {
|
|
| 656 | 656 | global $wpdb; |
| 657 | 657 | |
| 658 | 658 | // Update the add listing page settings |
| 659 | 659 | $add_listing_page = $wpdb->get_var( |
| 660 | 660 | $wpdb->prepare( |
| 661 | - "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
| 661 | + "SELECT ID FROM ".$wpdb->posts." WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
| 662 | 662 | array('add-listing')
|
| 663 | 663 | ) |
| 664 | 664 | ); |
| 665 | 665 | |
| 666 | - if($add_listing_page){
|
|
| 667 | - wp_update_post( array('ID' => $add_listing_page, 'post_status' => 'publish') );
|
|
| 668 | - update_option( 'geodir_add_listing_page', $add_listing_page); |
|
| 666 | + if ($add_listing_page) {
|
|
| 667 | + wp_update_post(array('ID' => $add_listing_page, 'post_status' => 'publish'));
|
|
| 668 | + update_option('geodir_add_listing_page', $add_listing_page);
|
|
| 669 | 669 | } |
| 670 | 670 | |
| 671 | 671 | // Update the listing preview page settings |
| 672 | 672 | $listing_preview_page = $wpdb->get_var( |
| 673 | 673 | $wpdb->prepare( |
| 674 | - "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
| 674 | + "SELECT ID FROM ".$wpdb->posts." WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
| 675 | 675 | array('listing-preview')
|
| 676 | 676 | ) |
| 677 | 677 | ); |
| 678 | 678 | |
| 679 | - if($listing_preview_page){
|
|
| 680 | - wp_update_post( array('ID' => $listing_preview_page, 'post_status' => 'publish') );
|
|
| 681 | - update_option( 'geodir_preview_page', $listing_preview_page); |
|
| 679 | + if ($listing_preview_page) {
|
|
| 680 | + wp_update_post(array('ID' => $listing_preview_page, 'post_status' => 'publish'));
|
|
| 681 | + update_option('geodir_preview_page', $listing_preview_page);
|
|
| 682 | 682 | } |
| 683 | 683 | |
| 684 | 684 | // Update the listing success page settings |
| 685 | 685 | $listing_success_page = $wpdb->get_var( |
| 686 | 686 | $wpdb->prepare( |
| 687 | - "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
| 687 | + "SELECT ID FROM ".$wpdb->posts." WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
| 688 | 688 | array('listing-success')
|
| 689 | 689 | ) |
| 690 | 690 | ); |
| 691 | 691 | |
| 692 | - if($listing_success_page){
|
|
| 693 | - wp_update_post( array('ID' => $listing_success_page, 'post_status' => 'publish') );
|
|
| 694 | - update_option( 'geodir_success_page', $listing_success_page); |
|
| 692 | + if ($listing_success_page) {
|
|
| 693 | + wp_update_post(array('ID' => $listing_success_page, 'post_status' => 'publish'));
|
|
| 694 | + update_option('geodir_success_page', $listing_success_page);
|
|
| 695 | 695 | } |
| 696 | 696 | |
| 697 | 697 | // Update the listing success page settings |
| 698 | 698 | $location_page = $wpdb->get_var( |
| 699 | 699 | $wpdb->prepare( |
| 700 | - "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
| 700 | + "SELECT ID FROM ".$wpdb->posts." WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
| 701 | 701 | array('location')
|
| 702 | 702 | ) |
| 703 | 703 | ); |
| 704 | 704 | |
| 705 | - if($location_page){
|
|
| 705 | + if ($location_page) {
|
|
| 706 | 706 | $location_slug = get_option('geodir_location_prefix');
|
| 707 | - if(!$location_slug ){$location_slug = 'location';}
|
|
| 708 | - wp_update_post( array('ID' => $location_page, 'post_status' => 'publish','post_name' => $location_slug) );
|
|
| 709 | - update_option( 'geodir_location_page', $location_page); |
|
| 707 | + if (!$location_slug) {$location_slug = 'location'; }
|
|
| 708 | + wp_update_post(array('ID' => $location_page, 'post_status' => 'publish', 'post_name' => $location_slug));
|
|
| 709 | + update_option('geodir_location_page', $location_page);
|
|
| 710 | 710 | } |
| 711 | 711 | |
| 712 | 712 | } |
@@ -725,13 +725,13 @@ discard block |
||
| 725 | 725 | $post_types = get_option('geodir_post_types');
|
| 726 | 726 | |
| 727 | 727 | |
| 728 | - if (is_array($post_types)){
|
|
| 728 | + if (is_array($post_types)) {
|
|
| 729 | 729 | |
| 730 | 730 | foreach ($post_types as $post_type => $args) {
|
| 731 | 731 | |
| 732 | 732 | |
| 733 | - if(isset($args['rewrite']['slug'])){
|
|
| 734 | - $args['rewrite']['slug'] = str_replace("/%gd_taxonomy%","",$args['rewrite']['slug']);
|
|
| 733 | + if (isset($args['rewrite']['slug'])) {
|
|
| 734 | + $args['rewrite']['slug'] = str_replace("/%gd_taxonomy%", "", $args['rewrite']['slug']);
|
|
| 735 | 735 | } |
| 736 | 736 | |
| 737 | 737 | $alt_post_types[$post_type] = $args; |
@@ -739,8 +739,8 @@ discard block |
||
| 739 | 739 | } |
| 740 | 740 | } |
| 741 | 741 | |
| 742 | - if(!empty($alt_post_types)) {
|
|
| 743 | - update_option('geodir_post_types',$alt_post_types);
|
|
| 742 | + if (!empty($alt_post_types)) {
|
|
| 743 | + update_option('geodir_post_types', $alt_post_types);
|
|
| 744 | 744 | } |
| 745 | 745 | |
| 746 | 746 | |
@@ -766,9 +766,9 @@ discard block |
||
| 766 | 766 | foreach ($all_postypes as $key) {
|
| 767 | 767 | // update each GD CTP |
| 768 | 768 | try {
|
| 769 | - $wpdb->query("ALTER TABLE " . $wpdb->prefix . "geodir_" . $key . "_detail MODIFY post_city VARCHAR( 50 ) NULL,MODIFY post_region VARCHAR( 50 ) NULL,MODIFY post_country VARCHAR( 50 ) NULL");
|
|
| 770 | - } catch(Exception $e) {
|
|
| 771 | - error_log( 'Error: ' . $e->getMessage() ); |
|
| 769 | + $wpdb->query("ALTER TABLE ".$wpdb->prefix."geodir_".$key."_detail MODIFY post_city VARCHAR( 50 ) NULL,MODIFY post_region VARCHAR( 50 ) NULL,MODIFY post_country VARCHAR( 50 ) NULL");
|
|
| 770 | + } catch (Exception $e) {
|
|
| 771 | + error_log('Error: '.$e->getMessage());
|
|
| 772 | 772 | } |
| 773 | 773 | } |
| 774 | 774 | } |
@@ -29,23 +29,23 @@ discard block |
||
| 29 | 29 | <input type="hidden" id="send_to_Frnd_pid" name="pid" value="<?php echo $post_info->ID;?>"/> |
| 30 | 30 | |
| 31 | 31 | <h3><?php |
| 32 | - /** |
|
| 33 | - * Filter the title for the send to friend popup form. |
|
| 34 | - * |
|
| 35 | - * @since 1.0.0 |
|
| 36 | - * @param string $title The title for the form, defaults to global `SEND_TO_FRIEND` text. |
|
| 37 | - */ |
|
| 38 | - echo apply_filters('geodir_send_to_friend_page_title', SEND_TO_FRIEND);?></h3> |
|
| 32 | + /** |
|
| 33 | + * Filter the title for the send to friend popup form. |
|
| 34 | + * |
|
| 35 | + * @since 1.0.0 |
|
| 36 | + * @param string $title The title for the form, defaults to global `SEND_TO_FRIEND` text. |
|
| 37 | + */ |
|
| 38 | + echo apply_filters('geodir_send_to_friend_page_title', SEND_TO_FRIEND);?></h3> |
|
| 39 | 39 | |
| 40 | 40 | <p id="reply_send_success" class="sucess_msg" style="display:none;"></p> |
| 41 | 41 | <?php |
| 42 | - /** |
|
| 43 | - * Called before each field in the send to friend popup template. |
|
| 44 | - * |
|
| 45 | - * @since 1.0.0 |
|
| 46 | - * @param string $field The field name the actions is called before. |
|
| 47 | - */ |
|
| 48 | - do_action('geodir_before_stf_form_field', 'to_name');?> |
|
| 42 | + /** |
|
| 43 | + * Called before each field in the send to friend popup template. |
|
| 44 | + * |
|
| 45 | + * @since 1.0.0 |
|
| 46 | + * @param string $field The field name the actions is called before. |
|
| 47 | + */ |
|
| 48 | + do_action('geodir_before_stf_form_field', 'to_name');?> |
|
| 49 | 49 | <div class="row clearfix"> |
| 50 | 50 | <div class="geodir_popup_heading"> |
| 51 | 51 | <label><?php _e('Friend Name', 'geodirectory');?> : <span>*</span></label></div> |
@@ -54,16 +54,16 @@ discard block |
||
| 54 | 54 | <span class="message_error2" id="to_nameInfo"></span></div> |
| 55 | 55 | </div> |
| 56 | 56 | <?php |
| 57 | - /** |
|
| 58 | - * Called after each field in the send to friend popup template. |
|
| 59 | - * |
|
| 60 | - * @since 1.0.0 |
|
| 61 | - * @param string $field The field name the actions is called after. |
|
| 62 | - */ |
|
| 63 | - do_action('geodir_after_stf_form_field', 'to_name');?> |
|
| 57 | + /** |
|
| 58 | + * Called after each field in the send to friend popup template. |
|
| 59 | + * |
|
| 60 | + * @since 1.0.0 |
|
| 61 | + * @param string $field The field name the actions is called after. |
|
| 62 | + */ |
|
| 63 | + do_action('geodir_after_stf_form_field', 'to_name');?> |
|
| 64 | 64 | <?php |
| 65 | - /** This action is documented in geodirectory-templates/popup-forms.php */ |
|
| 66 | - do_action('geodir_before_stf_form_field', 'to_email');?> |
|
| 65 | + /** This action is documented in geodirectory-templates/popup-forms.php */ |
|
| 66 | + do_action('geodir_before_stf_form_field', 'to_email');?> |
|
| 67 | 67 | <div class="row clearfix"> |
| 68 | 68 | <div class="geodir_popup_heading"> |
| 69 | 69 | <label> <?php _e('Email', 'geodirectory');?> : <span>*</span></label></div> |
@@ -72,11 +72,11 @@ discard block |
||
| 72 | 72 | <span class="message_error2" id="to_emailInfo"></span></div> |
| 73 | 73 | </div> |
| 74 | 74 | <?php |
| 75 | - /** This action is documented in geodirectory-templates/popup-forms.php */ |
|
| 76 | - do_action('geodir_after_stf_form_field', 'to_email');?> |
|
| 75 | + /** This action is documented in geodirectory-templates/popup-forms.php */ |
|
| 76 | + do_action('geodir_after_stf_form_field', 'to_email');?> |
|
| 77 | 77 | <?php |
| 78 | - /** This action is documented in geodirectory-templates/popup-forms.php */ |
|
| 79 | - do_action('geodir_before_stf_form_field', 'yourname');?> |
|
| 78 | + /** This action is documented in geodirectory-templates/popup-forms.php */ |
|
| 79 | + do_action('geodir_before_stf_form_field', 'yourname');?> |
|
| 80 | 80 | <div class="row clearfix"> |
| 81 | 81 | <div class="geodir_popup_heading"> |
| 82 | 82 | <label><?php _e('Your Name', 'geodirectory');?> : <span>*</span></label></div> |
@@ -85,11 +85,11 @@ discard block |
||
| 85 | 85 | <span class="message_error2" id="yournameInfo"></span></div> |
| 86 | 86 | </div> |
| 87 | 87 | <?php |
| 88 | - /** This action is documented in geodirectory-templates/popup-forms.php */ |
|
| 89 | - do_action('geodir_after_stf_form_field', 'yourname');?> |
|
| 88 | + /** This action is documented in geodirectory-templates/popup-forms.php */ |
|
| 89 | + do_action('geodir_after_stf_form_field', 'yourname');?> |
|
| 90 | 90 | <?php |
| 91 | - /** This action is documented in geodirectory-templates/popup-forms.php */ |
|
| 92 | - do_action('geodir_before_stf_form_field', 'youremail');?> |
|
| 91 | + /** This action is documented in geodirectory-templates/popup-forms.php */ |
|
| 92 | + do_action('geodir_before_stf_form_field', 'youremail');?> |
|
| 93 | 93 | <div class="row clearfix"> |
| 94 | 94 | <div class="geodir_popup_heading"> |
| 95 | 95 | <label> <?php _e('Email', 'geodirectory');?> : <span>*</span></label></div> |
@@ -98,11 +98,11 @@ discard block |
||
| 98 | 98 | <span class="message_error2" id="youremailInfo"></span></div> |
| 99 | 99 | </div> |
| 100 | 100 | <?php |
| 101 | - /** This action is documented in geodirectory-templates/popup-forms.php */ |
|
| 102 | - do_action('geodir_after_stf_form_field', 'youremail');?> |
|
| 101 | + /** This action is documented in geodirectory-templates/popup-forms.php */ |
|
| 102 | + do_action('geodir_after_stf_form_field', 'youremail');?> |
|
| 103 | 103 | <?php |
| 104 | - /** This action is documented in geodirectory-templates/popup-forms.php */ |
|
| 105 | - do_action('geodir_before_stf_form_field', 'frnd_subject');?> |
|
| 104 | + /** This action is documented in geodirectory-templates/popup-forms.php */ |
|
| 105 | + do_action('geodir_before_stf_form_field', 'frnd_subject');?> |
|
| 106 | 106 | <div class="row clearfix"> |
| 107 | 107 | <div class="geodir_popup_heading"> |
| 108 | 108 | <label><?php _e('Subject', 'geodirectory');?> : <span>*</span></label></div> |
@@ -113,11 +113,11 @@ discard block |
||
| 113 | 113 | <span class="message_error2" id="frnd_subjectInfo"></span></div> |
| 114 | 114 | </div> |
| 115 | 115 | <?php |
| 116 | - /** This action is documented in geodirectory-templates/popup-forms.php */ |
|
| 117 | - do_action('geodir_after_stf_form_field', 'frnd_subject');?> |
|
| 116 | + /** This action is documented in geodirectory-templates/popup-forms.php */ |
|
| 117 | + do_action('geodir_after_stf_form_field', 'frnd_subject');?> |
|
| 118 | 118 | <?php |
| 119 | - /** This action is documented in geodirectory-templates/popup-forms.php */ |
|
| 120 | - do_action('geodir_before_stf_form_field', 'frnd_comments');?> |
|
| 119 | + /** This action is documented in geodirectory-templates/popup-forms.php */ |
|
| 120 | + do_action('geodir_before_stf_form_field', 'frnd_comments');?> |
|
| 121 | 121 | <div class="row clearfix"> |
| 122 | 122 | <div class="geodir_popup_heading"> |
| 123 | 123 | <label><?php _e('Comments', 'geodirectory');?> : <span>*</span></label></div> |
@@ -127,11 +127,11 @@ discard block |
||
| 127 | 127 | <span class="message_error2" id="frnd_commentsInfo"></span></div> |
| 128 | 128 | </div> |
| 129 | 129 | <?php |
| 130 | - /** This action is documented in geodirectory-templates/popup-forms.php */ |
|
| 131 | - do_action('geodir_after_stf_form_field', 'frnd_comments');?> |
|
| 130 | + /** This action is documented in geodirectory-templates/popup-forms.php */ |
|
| 131 | + do_action('geodir_after_stf_form_field', 'frnd_comments');?> |
|
| 132 | 132 | <?php if (function_exists('geodir_get_captch')) { |
| 133 | - geodir_get_captch('-1'); |
|
| 134 | - }?> |
|
| 133 | + geodir_get_captch('-1'); |
|
| 134 | + }?> |
|
| 135 | 135 | <input name="Send" type="submit" value="<?php _e('Send', 'geodirectory')?> " class="button "/> |
| 136 | 136 | </form> |
| 137 | 137 | </div> <?php |
@@ -145,23 +145,23 @@ discard block |
||
| 145 | 145 | <input type="hidden" name="pid" value="<?php echo $post_info->ID;?>"/> |
| 146 | 146 | |
| 147 | 147 | <h3><?php |
| 148 | - /** |
|
| 149 | - * Filter the title for the send inquiry popup form. |
|
| 150 | - * |
|
| 151 | - * @since 1.0.0 |
|
| 152 | - * @param string $title The title for the form, defaults to global `SEND_INQUIRY` text. |
|
| 153 | - */ |
|
| 154 | - echo apply_filters('geodir_send_inquiry_page_title', SEND_INQUIRY);?> </h3> |
|
| 148 | + /** |
|
| 149 | + * Filter the title for the send inquiry popup form. |
|
| 150 | + * |
|
| 151 | + * @since 1.0.0 |
|
| 152 | + * @param string $title The title for the form, defaults to global `SEND_INQUIRY` text. |
|
| 153 | + */ |
|
| 154 | + echo apply_filters('geodir_send_inquiry_page_title', SEND_INQUIRY);?> </h3> |
|
| 155 | 155 | |
| 156 | 156 | <p id="inquiry_send_success" class="sucess_msg" style="display:none;"></p> |
| 157 | 157 | <?php |
| 158 | - /** |
|
| 159 | - * Called before each field in the send to friend inquiry template. |
|
| 160 | - * |
|
| 161 | - * @since 1.0.0 |
|
| 162 | - * @param string $field The field name the actions is called before. |
|
| 163 | - */ |
|
| 164 | - do_action('geodir_before_inquiry_form_field', 'inq_name');?> |
|
| 158 | + /** |
|
| 159 | + * Called before each field in the send to friend inquiry template. |
|
| 160 | + * |
|
| 161 | + * @since 1.0.0 |
|
| 162 | + * @param string $field The field name the actions is called before. |
|
| 163 | + */ |
|
| 164 | + do_action('geodir_before_inquiry_form_field', 'inq_name');?> |
|
| 165 | 165 | <div class="row clearfix"> |
| 166 | 166 | <div class="geodir_popup_heading"><label><?php _e('Your Name', 'geodirectory');?> : |
| 167 | 167 | <span>*</span></label></div> |
@@ -170,16 +170,16 @@ discard block |
||
| 170 | 170 | <span class="message_error2" id="span_agt_mail_name"></span></div> |
| 171 | 171 | </div> |
| 172 | 172 | <?php |
| 173 | - /** |
|
| 174 | - * Called after each field in the send to friend inquiry template. |
|
| 175 | - * |
|
| 176 | - * @since 1.0.0 |
|
| 177 | - * @param string $field The field name the actions is called after. |
|
| 178 | - */ |
|
| 179 | - do_action('geodir_after_inquiry_form_field', 'inq_name');?> |
|
| 173 | + /** |
|
| 174 | + * Called after each field in the send to friend inquiry template. |
|
| 175 | + * |
|
| 176 | + * @since 1.0.0 |
|
| 177 | + * @param string $field The field name the actions is called after. |
|
| 178 | + */ |
|
| 179 | + do_action('geodir_after_inquiry_form_field', 'inq_name');?> |
|
| 180 | 180 | <?php |
| 181 | - /** This action is documented in geodirectory-templates/popup-forms.php */ |
|
| 182 | - do_action('geodir_before_inquiry_form_field', 'inq_email');?> |
|
| 181 | + /** This action is documented in geodirectory-templates/popup-forms.php */ |
|
| 182 | + do_action('geodir_before_inquiry_form_field', 'inq_email');?> |
|
| 183 | 183 | <div class="row clearfix"> |
| 184 | 184 | <div class="geodir_popup_heading"> |
| 185 | 185 | <label><?php _e('Email', 'geodirectory');?> : <span>*</span></label></div> |
@@ -189,11 +189,11 @@ discard block |
||
| 189 | 189 | </div> |
| 190 | 190 | </div> |
| 191 | 191 | <?php |
| 192 | - /** This action is documented in geodirectory-templates/popup-forms.php */ |
|
| 193 | - do_action('geodir_after_inquiry_form_field', 'inq_email');?> |
|
| 192 | + /** This action is documented in geodirectory-templates/popup-forms.php */ |
|
| 193 | + do_action('geodir_after_inquiry_form_field', 'inq_email');?> |
|
| 194 | 194 | <?php |
| 195 | - /** This action is documented in geodirectory-templates/popup-forms.php */ |
|
| 196 | - do_action('geodir_before_inquiry_form_field', 'inq_phone');?> |
|
| 195 | + /** This action is documented in geodirectory-templates/popup-forms.php */ |
|
| 196 | + do_action('geodir_before_inquiry_form_field', 'inq_phone');?> |
|
| 197 | 197 | <div class="row clearfix"> |
| 198 | 198 | <div class="geodir_popup_heading"> |
| 199 | 199 | <label><?php _e('Contact Info', 'geodirectory');?> :</label></div> |
@@ -202,11 +202,11 @@ discard block |
||
| 202 | 202 | </div> |
| 203 | 203 | </div> |
| 204 | 204 | <?php |
| 205 | - /** This action is documented in geodirectory-templates/popup-forms.php */ |
|
| 206 | - do_action('geodir_after_inquiry_form_field', 'inq_phone');?> |
|
| 205 | + /** This action is documented in geodirectory-templates/popup-forms.php */ |
|
| 206 | + do_action('geodir_after_inquiry_form_field', 'inq_phone');?> |
|
| 207 | 207 | <?php |
| 208 | - /** This action is documented in geodirectory-templates/popup-forms.php */ |
|
| 209 | - do_action('geodir_before_inquiry_form_field', 'inq_msg');?> |
|
| 208 | + /** This action is documented in geodirectory-templates/popup-forms.php */ |
|
| 209 | + do_action('geodir_before_inquiry_form_field', 'inq_msg');?> |
|
| 210 | 210 | <div class="row clearfix"> |
| 211 | 211 | <div class="geodir_popup_heading"> |
| 212 | 212 | <label><?php _e('Comments', 'geodirectory');?> : <span>*</span></label></div> |
@@ -216,8 +216,8 @@ discard block |
||
| 216 | 216 | <span class="message_error2" id="span_agt_mail_msg"></span></div> |
| 217 | 217 | </div> |
| 218 | 218 | <?php |
| 219 | - /** This action is documented in geodirectory-templates/popup-forms.php */ |
|
| 220 | - do_action('geodir_after_inquiry_form_field', 'inq_msg');?> |
|
| 219 | + /** This action is documented in geodirectory-templates/popup-forms.php */ |
|
| 220 | + do_action('geodir_after_inquiry_form_field', 'inq_msg');?> |
|
| 221 | 221 | <input name="Send" type="submit" value="<?php _e('Send', 'geodirectory');?>" |
| 222 | 222 | class="button clearfix"/> |
| 223 | 223 | </form> |
@@ -19,14 +19,14 @@ discard block |
||
| 19 | 19 | * @param int $post_id The post id requested by the popup. |
| 20 | 20 | * @param object $post_info The post object requested by the popup. |
| 21 | 21 | */ |
| 22 | -do_action('geodir_popup_forms_template_start',$post_id,$post_info); |
|
| 22 | +do_action('geodir_popup_forms_template_start', $post_id, $post_info); |
|
| 23 | 23 | |
| 24 | 24 | if ($_REQUEST['popuptype'] == 'b_sendtofriend') { ?> |
| 25 | 25 | |
| 26 | 26 | <div id="basic-modal-content" class="clearfix"> |
| 27 | 27 | <form name="send_to_frnd" id="send_to_frnd" action="<?php echo get_permalink($post_info->ID); ?>" method="post"> |
| 28 | 28 | <input type="hidden" name="sendact" value="email_frnd"/> |
| 29 | - <input type="hidden" id="send_to_Frnd_pid" name="pid" value="<?php echo $post_info->ID;?>"/> |
|
| 29 | + <input type="hidden" id="send_to_Frnd_pid" name="pid" value="<?php echo $post_info->ID; ?>"/> |
|
| 30 | 30 | |
| 31 | 31 | <h3><?php |
| 32 | 32 | /** |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | * @since 1.0.0 |
| 36 | 36 | * @param string $title The title for the form, defaults to global `SEND_TO_FRIEND` text. |
| 37 | 37 | */ |
| 38 | - echo apply_filters('geodir_send_to_friend_page_title', SEND_TO_FRIEND);?></h3> |
|
| 38 | + echo apply_filters('geodir_send_to_friend_page_title', SEND_TO_FRIEND); ?></h3> |
|
| 39 | 39 | |
| 40 | 40 | <p id="reply_send_success" class="sucess_msg" style="display:none;"></p> |
| 41 | 41 | <?php |
@@ -45,10 +45,10 @@ discard block |
||
| 45 | 45 | * @since 1.0.0 |
| 46 | 46 | * @param string $field The field name the actions is called before. |
| 47 | 47 | */ |
| 48 | - do_action('geodir_before_stf_form_field', 'to_name');?> |
|
| 48 | + do_action('geodir_before_stf_form_field', 'to_name'); ?> |
|
| 49 | 49 | <div class="row clearfix"> |
| 50 | 50 | <div class="geodir_popup_heading"> |
| 51 | - <label><?php _e('Friend Name', 'geodirectory');?> : <span>*</span></label></div> |
|
| 51 | + <label><?php _e('Friend Name', 'geodirectory'); ?> : <span>*</span></label></div> |
|
| 52 | 52 | <div class="geodir_popup_field"> |
| 53 | 53 | <input class="is_required" field_type="text" name="to_name" id="to_name" type="text" value=""/> |
| 54 | 54 | <span class="message_error2" id="to_nameInfo"></span></div> |
@@ -60,75 +60,75 @@ discard block |
||
| 60 | 60 | * @since 1.0.0 |
| 61 | 61 | * @param string $field The field name the actions is called after. |
| 62 | 62 | */ |
| 63 | - do_action('geodir_after_stf_form_field', 'to_name');?> |
|
| 63 | + do_action('geodir_after_stf_form_field', 'to_name'); ?> |
|
| 64 | 64 | <?php |
| 65 | 65 | /** This action is documented in geodirectory-templates/popup-forms.php */ |
| 66 | - do_action('geodir_before_stf_form_field', 'to_email');?> |
|
| 66 | + do_action('geodir_before_stf_form_field', 'to_email'); ?> |
|
| 67 | 67 | <div class="row clearfix"> |
| 68 | 68 | <div class="geodir_popup_heading"> |
| 69 | - <label> <?php _e('Email', 'geodirectory');?> : <span>*</span></label></div> |
|
| 69 | + <label> <?php _e('Email', 'geodirectory'); ?> : <span>*</span></label></div> |
|
| 70 | 70 | <div class="geodir_popup_field"> |
| 71 | 71 | <input class="is_required" field_type="email" name="to_email" id="to_email" type="text" value=""/> |
| 72 | 72 | <span class="message_error2" id="to_emailInfo"></span></div> |
| 73 | 73 | </div> |
| 74 | 74 | <?php |
| 75 | 75 | /** This action is documented in geodirectory-templates/popup-forms.php */ |
| 76 | - do_action('geodir_after_stf_form_field', 'to_email');?> |
|
| 76 | + do_action('geodir_after_stf_form_field', 'to_email'); ?> |
|
| 77 | 77 | <?php |
| 78 | 78 | /** This action is documented in geodirectory-templates/popup-forms.php */ |
| 79 | - do_action('geodir_before_stf_form_field', 'yourname');?> |
|
| 79 | + do_action('geodir_before_stf_form_field', 'yourname'); ?> |
|
| 80 | 80 | <div class="row clearfix"> |
| 81 | 81 | <div class="geodir_popup_heading"> |
| 82 | - <label><?php _e('Your Name', 'geodirectory');?> : <span>*</span></label></div> |
|
| 82 | + <label><?php _e('Your Name', 'geodirectory'); ?> : <span>*</span></label></div> |
|
| 83 | 83 | <div class="geodir_popup_field"> |
| 84 | 84 | <input class="is_required" field_type="text" name="yourname" id="yourname" type="text" value=""/> |
| 85 | 85 | <span class="message_error2" id="yournameInfo"></span></div> |
| 86 | 86 | </div> |
| 87 | 87 | <?php |
| 88 | 88 | /** This action is documented in geodirectory-templates/popup-forms.php */ |
| 89 | - do_action('geodir_after_stf_form_field', 'yourname');?> |
|
| 89 | + do_action('geodir_after_stf_form_field', 'yourname'); ?> |
|
| 90 | 90 | <?php |
| 91 | 91 | /** This action is documented in geodirectory-templates/popup-forms.php */ |
| 92 | - do_action('geodir_before_stf_form_field', 'youremail');?> |
|
| 92 | + do_action('geodir_before_stf_form_field', 'youremail'); ?> |
|
| 93 | 93 | <div class="row clearfix"> |
| 94 | 94 | <div class="geodir_popup_heading"> |
| 95 | - <label> <?php _e('Email', 'geodirectory');?> : <span>*</span></label></div> |
|
| 95 | + <label> <?php _e('Email', 'geodirectory'); ?> : <span>*</span></label></div> |
|
| 96 | 96 | <div class="geodir_popup_field"> |
| 97 | 97 | <input class="is_required" field_type="email" name="youremail" id="youremail" type="text" value=""/> |
| 98 | 98 | <span class="message_error2" id="youremailInfo"></span></div> |
| 99 | 99 | </div> |
| 100 | 100 | <?php |
| 101 | 101 | /** This action is documented in geodirectory-templates/popup-forms.php */ |
| 102 | - do_action('geodir_after_stf_form_field', 'youremail');?> |
|
| 102 | + do_action('geodir_after_stf_form_field', 'youremail'); ?> |
|
| 103 | 103 | <?php |
| 104 | 104 | /** This action is documented in geodirectory-templates/popup-forms.php */ |
| 105 | - do_action('geodir_before_stf_form_field', 'frnd_subject');?> |
|
| 105 | + do_action('geodir_before_stf_form_field', 'frnd_subject'); ?> |
|
| 106 | 106 | <div class="row clearfix"> |
| 107 | 107 | <div class="geodir_popup_heading"> |
| 108 | - <label><?php _e('Subject', 'geodirectory');?> : <span>*</span></label></div> |
|
| 108 | + <label><?php _e('Subject', 'geodirectory'); ?> : <span>*</span></label></div> |
|
| 109 | 109 | <div class="geodir_popup_field"> |
| 110 | 110 | <input class="is_required" field_type="text" name="frnd_subject" |
| 111 | - value="<?php echo __('About', 'geodirectory') . ' ' . $post_info->post_title;?>" |
|
| 111 | + value="<?php echo __('About', 'geodirectory').' '.$post_info->post_title; ?>" |
|
| 112 | 112 | id="frnd_subject" type="text" value=""/> |
| 113 | 113 | <span class="message_error2" id="frnd_subjectInfo"></span></div> |
| 114 | 114 | </div> |
| 115 | 115 | <?php |
| 116 | 116 | /** This action is documented in geodirectory-templates/popup-forms.php */ |
| 117 | - do_action('geodir_after_stf_form_field', 'frnd_subject');?> |
|
| 117 | + do_action('geodir_after_stf_form_field', 'frnd_subject'); ?> |
|
| 118 | 118 | <?php |
| 119 | 119 | /** This action is documented in geodirectory-templates/popup-forms.php */ |
| 120 | - do_action('geodir_before_stf_form_field', 'frnd_comments');?> |
|
| 120 | + do_action('geodir_before_stf_form_field', 'frnd_comments'); ?> |
|
| 121 | 121 | <div class="row clearfix"> |
| 122 | 122 | <div class="geodir_popup_heading"> |
| 123 | - <label><?php _e('Comments', 'geodirectory');?> : <span>*</span></label></div> |
|
| 123 | + <label><?php _e('Comments', 'geodirectory'); ?> : <span>*</span></label></div> |
|
| 124 | 124 | <div class="geodir_popup_field"> |
| 125 | 125 | <textarea class="is_required" field_type="textarea" name="frnd_comments" id="frnd_comments" cols="" |
| 126 | - rows=""><?php echo SEND_TO_FRIEND_SAMPLE_CONTENT;?></textarea> |
|
| 126 | + rows=""><?php echo SEND_TO_FRIEND_SAMPLE_CONTENT; ?></textarea> |
|
| 127 | 127 | <span class="message_error2" id="frnd_commentsInfo"></span></div> |
| 128 | 128 | </div> |
| 129 | 129 | <?php |
| 130 | 130 | /** This action is documented in geodirectory-templates/popup-forms.php */ |
| 131 | - do_action('geodir_after_stf_form_field', 'frnd_comments');?> |
|
| 131 | + do_action('geodir_after_stf_form_field', 'frnd_comments'); ?> |
|
| 132 | 132 | <?php if (function_exists('geodir_get_captch')) { |
| 133 | 133 | geodir_get_captch('-1'); |
| 134 | 134 | }?> |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | <form method="post" name="agt_mail_agent" id="agt_mail_agent" |
| 143 | 143 | action="<?php echo get_permalink($post_info->ID); ?>"> |
| 144 | 144 | <input type="hidden" name="sendact" value="send_inqury"/> |
| 145 | - <input type="hidden" name="pid" value="<?php echo $post_info->ID;?>"/> |
|
| 145 | + <input type="hidden" name="pid" value="<?php echo $post_info->ID; ?>"/> |
|
| 146 | 146 | |
| 147 | 147 | <h3><?php |
| 148 | 148 | /** |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | * @since 1.0.0 |
| 152 | 152 | * @param string $title The title for the form, defaults to global `SEND_INQUIRY` text. |
| 153 | 153 | */ |
| 154 | - echo apply_filters('geodir_send_inquiry_page_title', SEND_INQUIRY);?> </h3> |
|
| 154 | + echo apply_filters('geodir_send_inquiry_page_title', SEND_INQUIRY); ?> </h3> |
|
| 155 | 155 | |
| 156 | 156 | <p id="inquiry_send_success" class="sucess_msg" style="display:none;"></p> |
| 157 | 157 | <?php |
@@ -161,9 +161,9 @@ discard block |
||
| 161 | 161 | * @since 1.0.0 |
| 162 | 162 | * @param string $field The field name the actions is called before. |
| 163 | 163 | */ |
| 164 | - do_action('geodir_before_inquiry_form_field', 'inq_name');?> |
|
| 164 | + do_action('geodir_before_inquiry_form_field', 'inq_name'); ?> |
|
| 165 | 165 | <div class="row clearfix"> |
| 166 | - <div class="geodir_popup_heading"><label><?php _e('Your Name', 'geodirectory');?> : |
|
| 166 | + <div class="geodir_popup_heading"><label><?php _e('Your Name', 'geodirectory'); ?> : |
|
| 167 | 167 | <span>*</span></label></div> |
| 168 | 168 | <div class="geodir_popup_field"> |
| 169 | 169 | <input class="is_required" field_type="text" name="inq_name" type="text" value=""/> |
@@ -176,13 +176,13 @@ discard block |
||
| 176 | 176 | * @since 1.0.0 |
| 177 | 177 | * @param string $field The field name the actions is called after. |
| 178 | 178 | */ |
| 179 | - do_action('geodir_after_inquiry_form_field', 'inq_name');?> |
|
| 179 | + do_action('geodir_after_inquiry_form_field', 'inq_name'); ?> |
|
| 180 | 180 | <?php |
| 181 | 181 | /** This action is documented in geodirectory-templates/popup-forms.php */ |
| 182 | - do_action('geodir_before_inquiry_form_field', 'inq_email');?> |
|
| 182 | + do_action('geodir_before_inquiry_form_field', 'inq_email'); ?> |
|
| 183 | 183 | <div class="row clearfix"> |
| 184 | 184 | <div class="geodir_popup_heading"> |
| 185 | - <label><?php _e('Email', 'geodirectory');?> : <span>*</span></label></div> |
|
| 185 | + <label><?php _e('Email', 'geodirectory'); ?> : <span>*</span></label></div> |
|
| 186 | 186 | <div class="geodir_popup_field"> |
| 187 | 187 | <input class="is_required" field_type="email" name="inq_email" type="text" value=""/> |
| 188 | 188 | <span class="message_error2" id="span_agt_mail_email"></span> |
@@ -190,35 +190,35 @@ discard block |
||
| 190 | 190 | </div> |
| 191 | 191 | <?php |
| 192 | 192 | /** This action is documented in geodirectory-templates/popup-forms.php */ |
| 193 | - do_action('geodir_after_inquiry_form_field', 'inq_email');?> |
|
| 193 | + do_action('geodir_after_inquiry_form_field', 'inq_email'); ?> |
|
| 194 | 194 | <?php |
| 195 | 195 | /** This action is documented in geodirectory-templates/popup-forms.php */ |
| 196 | - do_action('geodir_before_inquiry_form_field', 'inq_phone');?> |
|
| 196 | + do_action('geodir_before_inquiry_form_field', 'inq_phone'); ?> |
|
| 197 | 197 | <div class="row clearfix"> |
| 198 | 198 | <div class="geodir_popup_heading"> |
| 199 | - <label><?php _e('Contact Info', 'geodirectory');?> :</label></div> |
|
| 199 | + <label><?php _e('Contact Info', 'geodirectory'); ?> :</label></div> |
|
| 200 | 200 | <div class="geodir_popup_field"> |
| 201 | 201 | <input name="inq_phone" id="agt_mail_phone" type="text" value=""/> |
| 202 | 202 | </div> |
| 203 | 203 | </div> |
| 204 | 204 | <?php |
| 205 | 205 | /** This action is documented in geodirectory-templates/popup-forms.php */ |
| 206 | - do_action('geodir_after_inquiry_form_field', 'inq_phone');?> |
|
| 206 | + do_action('geodir_after_inquiry_form_field', 'inq_phone'); ?> |
|
| 207 | 207 | <?php |
| 208 | 208 | /** This action is documented in geodirectory-templates/popup-forms.php */ |
| 209 | - do_action('geodir_before_inquiry_form_field', 'inq_msg');?> |
|
| 209 | + do_action('geodir_before_inquiry_form_field', 'inq_msg'); ?> |
|
| 210 | 210 | <div class="row clearfix"> |
| 211 | 211 | <div class="geodir_popup_heading"> |
| 212 | - <label><?php _e('Comments', 'geodirectory');?> : <span>*</span></label></div> |
|
| 212 | + <label><?php _e('Comments', 'geodirectory'); ?> : <span>*</span></label></div> |
|
| 213 | 213 | <div class="geodir_popup_field"> |
| 214 | 214 | <textarea class="is_required" field_type="textarea" name="inq_msg" cols="" |
| 215 | - rows=""><?php echo SEND_INQUIRY_SAMPLE_CONTENT;?></textarea> |
|
| 215 | + rows=""><?php echo SEND_INQUIRY_SAMPLE_CONTENT; ?></textarea> |
|
| 216 | 216 | <span class="message_error2" id="span_agt_mail_msg"></span></div> |
| 217 | 217 | </div> |
| 218 | 218 | <?php |
| 219 | 219 | /** This action is documented in geodirectory-templates/popup-forms.php */ |
| 220 | - do_action('geodir_after_inquiry_form_field', 'inq_msg');?> |
|
| 221 | - <input name="Send" type="submit" value="<?php _e('Send', 'geodirectory');?>" |
|
| 220 | + do_action('geodir_after_inquiry_form_field', 'inq_msg'); ?> |
|
| 221 | + <input name="Send" type="submit" value="<?php _e('Send', 'geodirectory'); ?>" |
|
| 222 | 222 | class="button clearfix"/> |
| 223 | 223 | </form> |
| 224 | 224 | </div> <?php |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | global $gd_session; |
| 13 | 13 | |
| 14 | 14 | if (!isset($_REQUEST['backandedit'])) { |
| 15 | - $gd_session->un_set('listing'); |
|
| 15 | + $gd_session->un_set('listing'); |
|
| 16 | 16 | } |
| 17 | 17 | // call header |
| 18 | 18 | get_header(); |
@@ -9,13 +9,13 @@ discard block |
||
| 9 | 9 | * @package GeoDirectory |
| 10 | 10 | */ |
| 11 | 11 | if (isset($_GET['redirect_to']) && $_GET['redirect_to'] != '') {
|
| 12 | - $redirect_to = $_GET['redirect_to']; |
|
| 12 | + $redirect_to = $_GET['redirect_to']; |
|
| 13 | 13 | } else {
|
| 14 | - //echo $_SERVER['HTTP_HOST'] ; |
|
| 15 | - $redirect_to = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; |
|
| 16 | - if (strpos($redirect_to, $_SERVER['HTTP_HOST']) === false) {
|
|
| 17 | - $redirect_to = home_url(); |
|
| 18 | - } |
|
| 14 | + //echo $_SERVER['HTTP_HOST'] ; |
|
| 15 | + $redirect_to = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; |
|
| 16 | + if (strpos($redirect_to, $_SERVER['HTTP_HOST']) === false) {
|
|
| 17 | + $redirect_to = home_url(); |
|
| 18 | + } |
|
| 19 | 19 | } |
| 20 | 20 | ?> |
| 21 | 21 | <div id="sign_up"> |
@@ -26,28 +26,28 @@ discard block |
||
| 26 | 26 | <h4> |
| 27 | 27 | <?php |
| 28 | 28 | |
| 29 | - /** |
|
| 30 | - * Filter the `REGISTRATION_NOW_TEXT` title text on the register form template. |
|
| 31 | - * |
|
| 32 | - * @since 1.0.0 |
|
| 33 | - */ |
|
| 34 | - echo apply_filters('geodir_registration_page_title', REGISTRATION_NOW_TEXT);
|
|
| 29 | + /** |
|
| 30 | + * Filter the `REGISTRATION_NOW_TEXT` title text on the register form template. |
|
| 31 | + * |
|
| 32 | + * @since 1.0.0 |
|
| 33 | + */ |
|
| 34 | + echo apply_filters('geodir_registration_page_title', REGISTRATION_NOW_TEXT);
|
|
| 35 | 35 | |
| 36 | - ?> |
|
| 36 | + ?> |
|
| 37 | 37 | </h4> |
| 38 | 38 | <?php |
| 39 | - global $geodir_signup_error; |
|
| 40 | - if ($geodir_signup_error != '') {
|
|
| 41 | - echo '<p class="error_msg">' . $geodir_signup_error . '</p>'; |
|
| 42 | - unset($geodir_signup_error); |
|
| 43 | - } else {
|
|
| 44 | - if (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 1) {
|
|
| 45 | - echo '<p class="error_msg">' . EMAIL_USERNAME_EXIST_MSG . '</p>'; |
|
| 46 | - } else if (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 'regnewusr') {
|
|
| 47 | - echo '<p class="error_msg">' . REGISTRATION_DESABLED_MSG . '</p>'; |
|
| 48 | - } |
|
| 49 | - } |
|
| 50 | - ?> |
|
| 39 | + global $geodir_signup_error; |
|
| 40 | + if ($geodir_signup_error != '') {
|
|
| 41 | + echo '<p class="error_msg">' . $geodir_signup_error . '</p>'; |
|
| 42 | + unset($geodir_signup_error); |
|
| 43 | + } else {
|
|
| 44 | + if (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 1) {
|
|
| 45 | + echo '<p class="error_msg">' . EMAIL_USERNAME_EXIST_MSG . '</p>'; |
|
| 46 | + } else if (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 'regnewusr') {
|
|
| 47 | + echo '<p class="error_msg">' . REGISTRATION_DESABLED_MSG . '</p>'; |
|
| 48 | + } |
|
| 49 | + } |
|
| 50 | + ?> |
|
| 51 | 51 | |
| 52 | 52 | <form name="cus_registerform" id="cus_registerform" |
| 53 | 53 | action="<?php echo htmlspecialchars(geodir_curPageURL()); ?>" method="post"> |
@@ -57,10 +57,10 @@ discard block |
||
| 57 | 57 | <div class="form_row clearfix"> |
| 58 | 58 | <input placeholder='<?php echo EMAIL_TEXT; ?>' type="text" name="user_email" id="user_email" |
| 59 | 59 | class="textfield" value="<?php global $user_email; |
| 60 | - if (!isset($user_email)) {
|
|
| 61 | - $user_email = ''; |
|
| 62 | - } |
|
| 63 | - echo esc_attr(stripslashes($user_email)); ?>" size="25"/> |
|
| 60 | + if (!isset($user_email)) {
|
|
| 61 | + $user_email = ''; |
|
| 62 | + } |
|
| 63 | + echo esc_attr(stripslashes($user_email)); ?>" size="25"/> |
|
| 64 | 64 | |
| 65 | 65 | <?php if (!get_option('geodir_allow_cpass')) { ?>
|
| 66 | 66 | <div id="reg_passmail"> |
@@ -74,8 +74,8 @@ discard block |
||
| 74 | 74 | <div class="form_row clearfix"> |
| 75 | 75 | <input placeholder='<?php echo FIRST_NAME_TEXT; ?>' type="text" name="user_fname" id="user_fname" |
| 76 | 76 | class="textfield" value="<?php if (isset($user_fname)) {
|
| 77 | - echo esc_attr(stripslashes($user_fname)); |
|
| 78 | - } ?>" size="25"/> |
|
| 77 | + echo esc_attr(stripslashes($user_fname)); |
|
| 78 | + } ?>" size="25"/> |
|
| 79 | 79 | <span id="user_fnameInfo"></span> |
| 80 | 80 | </div> |
| 81 | 81 | </div> |
@@ -101,14 +101,14 @@ discard block |
||
| 101 | 101 | <?php } ?> |
| 102 | 102 | |
| 103 | 103 | <?php |
| 104 | - /** |
|
| 105 | - * Called just before the register new user button on the register form template. |
|
| 106 | - * |
|
| 107 | - * Also used by other plugins to add social connect buttons. |
|
| 108 | - * |
|
| 109 | - * @since 1.0.0 |
|
| 110 | - */ |
|
| 111 | - do_action('social_connect_form'); ?>
|
|
| 104 | + /** |
|
| 105 | + * Called just before the register new user button on the register form template. |
|
| 106 | + * |
|
| 107 | + * Also used by other plugins to add social connect buttons. |
|
| 108 | + * |
|
| 109 | + * @since 1.0.0 |
|
| 110 | + */ |
|
| 111 | + do_action('social_connect_form'); ?>
|
|
| 112 | 112 | <input type="submit" name="registernow" value="<?php echo REGISTER_NOW_TEXT; ?>" class="geodir_button"/> |
| 113 | 113 | </form> |
| 114 | 114 | </div> |
@@ -38,13 +38,13 @@ |
||
| 38 | 38 | <?php |
| 39 | 39 | global $geodir_signup_error; |
| 40 | 40 | if ($geodir_signup_error != '') {
|
| 41 | - echo '<p class="error_msg">' . $geodir_signup_error . '</p>'; |
|
| 41 | + echo '<p class="error_msg">'.$geodir_signup_error.'</p>'; |
|
| 42 | 42 | unset($geodir_signup_error); |
| 43 | 43 | } else {
|
| 44 | 44 | if (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 1) {
|
| 45 | - echo '<p class="error_msg">' . EMAIL_USERNAME_EXIST_MSG . '</p>'; |
|
| 45 | + echo '<p class="error_msg">'.EMAIL_USERNAME_EXIST_MSG.'</p>'; |
|
| 46 | 46 | } else if (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 'regnewusr') {
|
| 47 | - echo '<p class="error_msg">' . REGISTRATION_DESABLED_MSG . '</p>'; |
|
| 47 | + echo '<p class="error_msg">'.REGISTRATION_DESABLED_MSG.'</p>'; |
|
| 48 | 48 | } |
| 49 | 49 | } |
| 50 | 50 | ?> |
@@ -76,29 +76,45 @@ discard block |
||
| 76 | 76 | /** |
| 77 | 77 | * Do not store any revisions (except the one autosave per post). |
| 78 | 78 | */ |
| 79 | -if (!defined('WP_POST_REVISIONS')) define('WP_POST_REVISIONS', 0);
|
|
| 79 | +if (!defined('WP_POST_REVISIONS')) { |
|
| 80 | + define('WP_POST_REVISIONS', 0); |
|
| 81 | +} |
|
| 80 | 82 | |
| 81 | 83 | /** |
| 82 | 84 | * Define constants |
| 83 | 85 | */ |
| 84 | -if(!defined('GEODIRECTORY_PLUGIN_DIR')) define('GEODIRECTORY_PLUGIN_DIR', plugin_dir_path( __FILE__ ));
|
|
| 86 | +if(!defined('GEODIRECTORY_PLUGIN_DIR')) { |
|
| 87 | + define('GEODIRECTORY_PLUGIN_DIR', plugin_dir_path( __FILE__ )); |
|
| 88 | +} |
|
| 85 | 89 | |
| 86 | 90 | /* |
| 87 | 91 | * Declare database table names. All since version 1.0.0 |
| 88 | 92 | */ |
| 89 | 93 | |
| 90 | 94 | /** Define the database name for the countries table. */ |
| 91 | -if (!defined('GEODIR_COUNTRIES_TABLE')) define('GEODIR_COUNTRIES_TABLE', $plugin_prefix . 'countries');
|
|
| 95 | +if (!defined('GEODIR_COUNTRIES_TABLE')) { |
|
| 96 | + define('GEODIR_COUNTRIES_TABLE', $plugin_prefix . 'countries'); |
|
| 97 | +} |
|
| 92 | 98 | /** Define the database name for the custom fields table. */ |
| 93 | -if (!defined('GEODIR_CUSTOM_FIELDS_TABLE')) define('GEODIR_CUSTOM_FIELDS_TABLE', $plugin_prefix . 'custom_fields');
|
|
| 99 | +if (!defined('GEODIR_CUSTOM_FIELDS_TABLE')) { |
|
| 100 | + define('GEODIR_CUSTOM_FIELDS_TABLE', $plugin_prefix . 'custom_fields'); |
|
| 101 | +} |
|
| 94 | 102 | /** Define the database name for the icons table. */ |
| 95 | -if (!defined('GEODIR_ICON_TABLE')) define('GEODIR_ICON_TABLE', $plugin_prefix . 'post_icon');
|
|
| 103 | +if (!defined('GEODIR_ICON_TABLE')) { |
|
| 104 | + define('GEODIR_ICON_TABLE', $plugin_prefix . 'post_icon'); |
|
| 105 | +} |
|
| 96 | 106 | /** Define the database name for the attachments table. */ |
| 97 | -if (!defined('GEODIR_ATTACHMENT_TABLE')) define('GEODIR_ATTACHMENT_TABLE', $plugin_prefix . 'attachments');
|
|
| 107 | +if (!defined('GEODIR_ATTACHMENT_TABLE')) { |
|
| 108 | + define('GEODIR_ATTACHMENT_TABLE', $plugin_prefix . 'attachments'); |
|
| 109 | +} |
|
| 98 | 110 | /** Define the database name for the review table. */ |
| 99 | -if (!defined('GEODIR_REVIEW_TABLE')) define('GEODIR_REVIEW_TABLE', $plugin_prefix . 'post_review');
|
|
| 111 | +if (!defined('GEODIR_REVIEW_TABLE')) { |
|
| 112 | + define('GEODIR_REVIEW_TABLE', $plugin_prefix . 'post_review'); |
|
| 113 | +} |
|
| 100 | 114 | /** Define the database name for the custom sort fields table. */ |
| 101 | -if (!defined('GEODIR_CUSTOM_SORT_FIELDS_TABLE')) define('GEODIR_CUSTOM_SORT_FIELDS_TABLE', $plugin_prefix . 'custom_sort_fields');
|
|
| 115 | +if (!defined('GEODIR_CUSTOM_SORT_FIELDS_TABLE')) { |
|
| 116 | + define('GEODIR_CUSTOM_SORT_FIELDS_TABLE', $plugin_prefix . 'custom_sort_fields'); |
|
| 117 | +} |
|
| 102 | 118 | |
| 103 | 119 | |
| 104 | 120 | if ($_SERVER['REQUEST_URI'] == '' || $_SERVER['REQUEST_URI'] == '/') {
|
@@ -113,7 +129,9 @@ discard block |
||
| 113 | 129 | /* |
| 114 | 130 | * Localisation items. |
| 115 | 131 | */ |
| 116 | -if (!defined('GEODIRECTORY_TEXTDOMAIN')) define('GEODIRECTORY_TEXTDOMAIN', 'geodirectory');
|
|
| 132 | +if (!defined('GEODIRECTORY_TEXTDOMAIN')) { |
|
| 133 | + define('GEODIRECTORY_TEXTDOMAIN', 'geodirectory'); |
|
| 134 | +} |
|
| 117 | 135 | |
| 118 | 136 | // Load geodirectory plugin textdomain. |
| 119 | 137 | add_action( 'plugins_loaded', 'geodir_load_textdomain' ); |
@@ -31,30 +31,30 @@ discard block |
||
| 31 | 31 | * CHECK FOR OLD COMPATIBILITY PACKS AND DISABLE IF THEY ARE ACTIVE |
| 32 | 32 | */ |
| 33 | 33 | if (is_admin()) {
|
| 34 | - /** |
|
| 35 | - * Include WordPress core file so we can use core functions to check for active plugins. |
|
| 36 | - */ |
|
| 37 | - include_once(ABSPATH . 'wp-admin/includes/plugin.php'); |
|
| 34 | + /** |
|
| 35 | + * Include WordPress core file so we can use core functions to check for active plugins. |
|
| 36 | + */ |
|
| 37 | + include_once(ABSPATH . 'wp-admin/includes/plugin.php'); |
|
| 38 | 38 | |
| 39 | - if (is_plugin_active('geodirectory-genesis-compatibility-pack/geodir_genesis_compatibility.php')) {
|
|
| 40 | - deactivate_plugins('geodirectory-genesis-compatibility-pack/geodir_genesis_compatibility.php');
|
|
| 41 | - } |
|
| 39 | + if (is_plugin_active('geodirectory-genesis-compatibility-pack/geodir_genesis_compatibility.php')) {
|
|
| 40 | + deactivate_plugins('geodirectory-genesis-compatibility-pack/geodir_genesis_compatibility.php');
|
|
| 41 | + } |
|
| 42 | 42 | |
| 43 | - if (is_plugin_active('geodirectory-x-theme-compatibility-pack/geodir_x_compatibility.php')) {
|
|
| 44 | - deactivate_plugins('geodirectory-x-theme-compatibility-pack/geodir_x_compatibility.php');
|
|
| 45 | - } |
|
| 43 | + if (is_plugin_active('geodirectory-x-theme-compatibility-pack/geodir_x_compatibility.php')) {
|
|
| 44 | + deactivate_plugins('geodirectory-x-theme-compatibility-pack/geodir_x_compatibility.php');
|
|
| 45 | + } |
|
| 46 | 46 | |
| 47 | - if (is_plugin_active('geodirectory-enfold-theme-compatibility-pack/geodir_enfold_compatibility.php')) {
|
|
| 48 | - deactivate_plugins('geodirectory-enfold-theme-compatibility-pack/geodir_enfold_compatibility.php');
|
|
| 49 | - } |
|
| 47 | + if (is_plugin_active('geodirectory-enfold-theme-compatibility-pack/geodir_enfold_compatibility.php')) {
|
|
| 48 | + deactivate_plugins('geodirectory-enfold-theme-compatibility-pack/geodir_enfold_compatibility.php');
|
|
| 49 | + } |
|
| 50 | 50 | |
| 51 | - if (is_plugin_active('geodir_avada_compatibility/geodir_avada_compatibility.php')) {
|
|
| 52 | - deactivate_plugins('geodir_avada_compatibility/geodir_avada_compatibility.php');
|
|
| 53 | - } |
|
| 51 | + if (is_plugin_active('geodir_avada_compatibility/geodir_avada_compatibility.php')) {
|
|
| 52 | + deactivate_plugins('geodir_avada_compatibility/geodir_avada_compatibility.php');
|
|
| 53 | + } |
|
| 54 | 54 | |
| 55 | - if (is_plugin_active('geodir_compat_pack_divi/geodir_divi_compatibility.php')) {
|
|
| 56 | - deactivate_plugins('geodir_compat_pack_divi/geodir_divi_compatibility.php');
|
|
| 57 | - } |
|
| 55 | + if (is_plugin_active('geodir_compat_pack_divi/geodir_divi_compatibility.php')) {
|
|
| 56 | + deactivate_plugins('geodir_compat_pack_divi/geodir_divi_compatibility.php');
|
|
| 57 | + } |
|
| 58 | 58 | |
| 59 | 59 | } |
| 60 | 60 | |
@@ -122,19 +122,19 @@ discard block |
||
| 122 | 122 | * @package GeoDirectory |
| 123 | 123 | */ |
| 124 | 124 | function geodir_error_log($log){
|
| 125 | - /* |
|
| 125 | + /* |
|
| 126 | 126 | * A filter to override the WP_DEBUG setting for function geodir_error_log(). |
| 127 | 127 | * |
| 128 | 128 | * @since 1.5.7 |
| 129 | 129 | */ |
| 130 | - $should_log = apply_filters( 'geodir_log_errors', WP_DEBUG); |
|
| 131 | - if ( true === $should_log ) {
|
|
| 132 | - if ( is_array( $log ) || is_object( $log ) ) {
|
|
| 133 | - error_log( print_r( $log, true ) ); |
|
| 134 | - } else {
|
|
| 135 | - error_log( $log ); |
|
| 136 | - } |
|
| 137 | - } |
|
| 130 | + $should_log = apply_filters( 'geodir_log_errors', WP_DEBUG); |
|
| 131 | + if ( true === $should_log ) {
|
|
| 132 | + if ( is_array( $log ) || is_object( $log ) ) {
|
|
| 133 | + error_log( print_r( $log, true ) ); |
|
| 134 | + } else {
|
|
| 135 | + error_log( $log ); |
|
| 136 | + } |
|
| 137 | + } |
|
| 138 | 138 | } |
| 139 | 139 | /** |
| 140 | 140 | * Include all plugin functions. |
@@ -173,61 +173,61 @@ discard block |
||
| 173 | 173 | */ |
| 174 | 174 | if (is_admin() || defined( 'GD_TESTING_MODE' )) {
|
| 175 | 175 | |
| 176 | - /** |
|
| 177 | - * Include functions used in admin area only. |
|
| 178 | - * |
|
| 179 | - * @since 1.0.0 |
|
| 180 | - */ |
|
| 181 | - require_once('geodirectory-admin/admin_functions.php');
|
|
| 182 | - /** |
|
| 183 | - * Most actions/hooks used in admin area only are called from here. |
|
| 184 | - * |
|
| 185 | - * @since 1.0.0 |
|
| 186 | - */ |
|
| 187 | - require_once('geodirectory-admin/admin_hooks_actions.php');
|
|
| 188 | - /** |
|
| 189 | - * Most admin JS and CSS is called from here. |
|
| 190 | - * |
|
| 191 | - * @since 1.0.0 |
|
| 192 | - */ |
|
| 193 | - require_once('geodirectory-admin/admin_template_tags.php');
|
|
| 194 | - /** |
|
| 195 | - * Include any functions needed for upgrades. |
|
| 196 | - * |
|
| 197 | - * @since 1.0.0 |
|
| 198 | - */ |
|
| 199 | - require_once(geodir_plugin_path() . '/upgrade.php'); |
|
| 200 | - if (get_option('geodir_installed') != 1) {
|
|
| 201 | - /** |
|
| 202 | - * Define language constants, here as they are not loaded yet. |
|
| 203 | - * |
|
| 204 | - * @since 1.0.0 |
|
| 205 | - */ |
|
| 206 | - require_once(geodir_plugin_path() . '/language.php'); |
|
| 207 | - /** |
|
| 208 | - * Include the plugin install file that sets up the databases and any options on first run. |
|
| 209 | - * |
|
| 210 | - * @since 1.0.0 |
|
| 211 | - */ |
|
| 212 | - require_once('geodirectory-admin/admin_install.php');
|
|
| 213 | - register_activation_hook(__FILE__, 'geodir_activation'); |
|
| 214 | - } |
|
| 215 | - register_deactivation_hook(__FILE__, 'geodir_deactivation'); |
|
| 216 | - register_uninstall_hook(__FILE__, 'geodir_uninstall'); |
|
| 217 | - |
|
| 218 | - /* |
|
| 176 | + /** |
|
| 177 | + * Include functions used in admin area only. |
|
| 178 | + * |
|
| 179 | + * @since 1.0.0 |
|
| 180 | + */ |
|
| 181 | + require_once('geodirectory-admin/admin_functions.php');
|
|
| 182 | + /** |
|
| 183 | + * Most actions/hooks used in admin area only are called from here. |
|
| 184 | + * |
|
| 185 | + * @since 1.0.0 |
|
| 186 | + */ |
|
| 187 | + require_once('geodirectory-admin/admin_hooks_actions.php');
|
|
| 188 | + /** |
|
| 189 | + * Most admin JS and CSS is called from here. |
|
| 190 | + * |
|
| 191 | + * @since 1.0.0 |
|
| 192 | + */ |
|
| 193 | + require_once('geodirectory-admin/admin_template_tags.php');
|
|
| 194 | + /** |
|
| 195 | + * Include any functions needed for upgrades. |
|
| 196 | + * |
|
| 197 | + * @since 1.0.0 |
|
| 198 | + */ |
|
| 199 | + require_once(geodir_plugin_path() . '/upgrade.php'); |
|
| 200 | + if (get_option('geodir_installed') != 1) {
|
|
| 201 | + /** |
|
| 202 | + * Define language constants, here as they are not loaded yet. |
|
| 203 | + * |
|
| 204 | + * @since 1.0.0 |
|
| 205 | + */ |
|
| 206 | + require_once(geodir_plugin_path() . '/language.php'); |
|
| 207 | + /** |
|
| 208 | + * Include the plugin install file that sets up the databases and any options on first run. |
|
| 209 | + * |
|
| 210 | + * @since 1.0.0 |
|
| 211 | + */ |
|
| 212 | + require_once('geodirectory-admin/admin_install.php');
|
|
| 213 | + register_activation_hook(__FILE__, 'geodir_activation'); |
|
| 214 | + } |
|
| 215 | + register_deactivation_hook(__FILE__, 'geodir_deactivation'); |
|
| 216 | + register_uninstall_hook(__FILE__, 'geodir_uninstall'); |
|
| 217 | + |
|
| 218 | + /* |
|
| 219 | 219 | * Show a upgrade warning message if applicable. |
| 220 | 220 | * |
| 221 | 221 | * @since 1.5.6 |
| 222 | 222 | */ |
| 223 | - global $pagenow; |
|
| 223 | + global $pagenow; |
|
| 224 | 224 | if ( 'plugins.php' === $pagenow ) |
| 225 | - {
|
|
| 226 | - // Better update message |
|
| 227 | - $file = basename( __FILE__ ); |
|
| 228 | - $folder = basename( dirname( __FILE__ ) ); |
|
| 229 | - $hook = "in_plugin_update_message-{$folder}/{$file}";
|
|
| 230 | - add_action( $hook, 'geodire_admin_upgrade_notice', 20, 2 ); |
|
| 231 | - } |
|
| 225 | + {
|
|
| 226 | + // Better update message |
|
| 227 | + $file = basename( __FILE__ ); |
|
| 228 | + $folder = basename( dirname( __FILE__ ) ); |
|
| 229 | + $hook = "in_plugin_update_message-{$folder}/{$file}";
|
|
| 230 | + add_action( $hook, 'geodire_admin_upgrade_notice', 20, 2 ); |
|
| 231 | + } |
|
| 232 | 232 | |
| 233 | 233 | } |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | /** |
| 35 | 35 | * Include WordPress core file so we can use core functions to check for active plugins. |
| 36 | 36 | */ |
| 37 | - include_once(ABSPATH . 'wp-admin/includes/plugin.php'); |
|
| 37 | + include_once(ABSPATH.'wp-admin/includes/plugin.php'); |
|
| 38 | 38 | |
| 39 | 39 | if (is_plugin_active('geodirectory-genesis-compatibility-pack/geodir_genesis_compatibility.php')) {
|
| 40 | 40 | deactivate_plugins('geodirectory-genesis-compatibility-pack/geodir_genesis_compatibility.php');
|
@@ -68,8 +68,8 @@ discard block |
||
| 68 | 68 | * @global string $plugin_file_name Base file name. 'geodirectory/geodirectory.php'. |
| 69 | 69 | */ |
| 70 | 70 | global $wpdb, $plugin_prefix, $geodir_addon_list, $plugin_file_name; |
| 71 | -$plugin_prefix = $wpdb->prefix . 'geodir_'; |
|
| 72 | -$plugin_file_name = basename(plugin_dir_path(__FILE__)) . '/' . basename(__FILE__); |
|
| 71 | +$plugin_prefix = $wpdb->prefix.'geodir_'; |
|
| 72 | +$plugin_file_name = basename(plugin_dir_path(__FILE__)).'/'.basename(__FILE__); |
|
| 73 | 73 | |
| 74 | 74 | /* |
| 75 | 75 | * This will store the cached post custom fields per package for each page load so not to run for each listing. |
@@ -84,24 +84,24 @@ discard block |
||
| 84 | 84 | /** |
| 85 | 85 | * Define constants |
| 86 | 86 | */ |
| 87 | -if(!defined('GEODIRECTORY_PLUGIN_DIR')) define('GEODIRECTORY_PLUGIN_DIR', plugin_dir_path( __FILE__ ));
|
|
| 87 | +if (!defined('GEODIRECTORY_PLUGIN_DIR')) define('GEODIRECTORY_PLUGIN_DIR', plugin_dir_path(__FILE__));
|
|
| 88 | 88 | |
| 89 | 89 | /* |
| 90 | 90 | * Declare database table names. All since version 1.0.0 |
| 91 | 91 | */ |
| 92 | 92 | |
| 93 | 93 | /** Define the database name for the countries table. */ |
| 94 | -if (!defined('GEODIR_COUNTRIES_TABLE')) define('GEODIR_COUNTRIES_TABLE', $plugin_prefix . 'countries');
|
|
| 94 | +if (!defined('GEODIR_COUNTRIES_TABLE')) define('GEODIR_COUNTRIES_TABLE', $plugin_prefix.'countries');
|
|
| 95 | 95 | /** Define the database name for the custom fields table. */ |
| 96 | -if (!defined('GEODIR_CUSTOM_FIELDS_TABLE')) define('GEODIR_CUSTOM_FIELDS_TABLE', $plugin_prefix . 'custom_fields');
|
|
| 96 | +if (!defined('GEODIR_CUSTOM_FIELDS_TABLE')) define('GEODIR_CUSTOM_FIELDS_TABLE', $plugin_prefix.'custom_fields');
|
|
| 97 | 97 | /** Define the database name for the icons table. */ |
| 98 | -if (!defined('GEODIR_ICON_TABLE')) define('GEODIR_ICON_TABLE', $plugin_prefix . 'post_icon');
|
|
| 98 | +if (!defined('GEODIR_ICON_TABLE')) define('GEODIR_ICON_TABLE', $plugin_prefix.'post_icon');
|
|
| 99 | 99 | /** Define the database name for the attachments table. */ |
| 100 | -if (!defined('GEODIR_ATTACHMENT_TABLE')) define('GEODIR_ATTACHMENT_TABLE', $plugin_prefix . 'attachments');
|
|
| 100 | +if (!defined('GEODIR_ATTACHMENT_TABLE')) define('GEODIR_ATTACHMENT_TABLE', $plugin_prefix.'attachments');
|
|
| 101 | 101 | /** Define the database name for the review table. */ |
| 102 | -if (!defined('GEODIR_REVIEW_TABLE')) define('GEODIR_REVIEW_TABLE', $plugin_prefix . 'post_review');
|
|
| 102 | +if (!defined('GEODIR_REVIEW_TABLE')) define('GEODIR_REVIEW_TABLE', $plugin_prefix.'post_review');
|
|
| 103 | 103 | /** Define the database name for the custom sort fields table. */ |
| 104 | -if (!defined('GEODIR_CUSTOM_SORT_FIELDS_TABLE')) define('GEODIR_CUSTOM_SORT_FIELDS_TABLE', $plugin_prefix . 'custom_sort_fields');
|
|
| 104 | +if (!defined('GEODIR_CUSTOM_SORT_FIELDS_TABLE')) define('GEODIR_CUSTOM_SORT_FIELDS_TABLE', $plugin_prefix.'custom_sort_fields');
|
|
| 105 | 105 | |
| 106 | 106 | |
| 107 | 107 | /* |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | if (!defined('GEODIRECTORY_TEXTDOMAIN')) define('GEODIRECTORY_TEXTDOMAIN', 'geodirectory');
|
| 111 | 111 | |
| 112 | 112 | // Load geodirectory plugin textdomain. |
| 113 | -add_action( 'init', 'geodir_load_textdomain' ); |
|
| 113 | +add_action('init', 'geodir_load_textdomain');
|
|
| 114 | 114 | |
| 115 | 115 | /* |
| 116 | 116 | * A function to log GD errors no matter the type given. |
@@ -121,18 +121,18 @@ discard block |
||
| 121 | 121 | * @param mixed $log The thing that should be logged. |
| 122 | 122 | * @package GeoDirectory |
| 123 | 123 | */ |
| 124 | -function geodir_error_log($log){
|
|
| 124 | +function geodir_error_log($log) {
|
|
| 125 | 125 | /* |
| 126 | 126 | * A filter to override the WP_DEBUG setting for function geodir_error_log(). |
| 127 | 127 | * |
| 128 | 128 | * @since 1.5.7 |
| 129 | 129 | */ |
| 130 | - $should_log = apply_filters( 'geodir_log_errors', WP_DEBUG); |
|
| 131 | - if ( true === $should_log ) {
|
|
| 132 | - if ( is_array( $log ) || is_object( $log ) ) {
|
|
| 133 | - error_log( print_r( $log, true ) ); |
|
| 130 | + $should_log = apply_filters('geodir_log_errors', WP_DEBUG);
|
|
| 131 | + if (true === $should_log) {
|
|
| 132 | + if (is_array($log) || is_object($log)) {
|
|
| 133 | + error_log(print_r($log, true)); |
|
| 134 | 134 | } else {
|
| 135 | - error_log( $log ); |
|
| 135 | + error_log($log); |
|
| 136 | 136 | } |
| 137 | 137 | } |
| 138 | 138 | } |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | /* |
| 172 | 172 | * Admin init + activation hooks |
| 173 | 173 | */ |
| 174 | -if (is_admin() || defined( 'GD_TESTING_MODE' )) {
|
|
| 174 | +if (is_admin() || defined('GD_TESTING_MODE')) {
|
|
| 175 | 175 | |
| 176 | 176 | /** |
| 177 | 177 | * Include functions used in admin area only. |
@@ -196,14 +196,14 @@ discard block |
||
| 196 | 196 | * |
| 197 | 197 | * @since 1.0.0 |
| 198 | 198 | */ |
| 199 | - require_once(geodir_plugin_path() . '/upgrade.php'); |
|
| 199 | + require_once(geodir_plugin_path().'/upgrade.php'); |
|
| 200 | 200 | if (get_option('geodir_installed') != 1) {
|
| 201 | 201 | /** |
| 202 | 202 | * Define language constants, here as they are not loaded yet. |
| 203 | 203 | * |
| 204 | 204 | * @since 1.0.0 |
| 205 | 205 | */ |
| 206 | - require_once(geodir_plugin_path() . '/language.php'); |
|
| 206 | + require_once(geodir_plugin_path().'/language.php'); |
|
| 207 | 207 | /** |
| 208 | 208 | * Include the plugin install file that sets up the databases and any options on first run. |
| 209 | 209 | * |
@@ -221,13 +221,13 @@ discard block |
||
| 221 | 221 | * @since 1.5.6 |
| 222 | 222 | */ |
| 223 | 223 | global $pagenow; |
| 224 | - if ( 'plugins.php' === $pagenow ) |
|
| 224 | + if ('plugins.php' === $pagenow)
|
|
| 225 | 225 | {
|
| 226 | 226 | // Better update message |
| 227 | - $file = basename( __FILE__ ); |
|
| 228 | - $folder = basename( dirname( __FILE__ ) ); |
|
| 227 | + $file = basename(__FILE__); |
|
| 228 | + $folder = basename(dirname(__FILE__)); |
|
| 229 | 229 | $hook = "in_plugin_update_message-{$folder}/{$file}";
|
| 230 | - add_action( $hook, 'geodire_admin_upgrade_notice', 20, 2 ); |
|
| 230 | + add_action($hook, 'geodire_admin_upgrade_notice', 20, 2); |
|
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | } |